.“ .... ,. LBNL-42877 .. ”--’ .-, , . . ~ >. -,.

.! .: .C,. ; ,- fimm ~lRNEST ~RLANDEl bAWRENCE .. . . ~ERIKEILEY ~ATUC21NAL- kAIH~RATaRY *:.-,..:.*..ish_.? . ..–. ) -k ;:.. 4.., ..’ ..... Femtosecond Photoelectron ~-. Spectroscopy A NewTool for . ,. the Studyof AnionDynamics

Benjamin J. Greenblatt Chemical SciencesDivision

February 1999

Ph.D. Thesis

.. ..

~./.- — .-..-.— —------.,-- ... . ;>;., c.‘>;:::.‘..,” $+’.,. ‘.’.:,. ‘A-,,{. DISCLAIMER Thisdocumentwaspreparedm m accountofworksponsoredbythe UnitedStatesGovernment.Whilethisdocumentisbelievedto contain correctinformation,neitherthe UnitedStatesGovernmentnor any agencythereof,norTheRegentsof theUniversityof California,norany of theiremployees,makesanywarranty,expressor implied,orassumes anylegalresponsibilityfortheaccuracy,completeness,or usefulnessof trny information,apparatus,product, or process dkclosed, or representsthat its use wouldnot infringeprivatelyownedrights. Referencehereinto any specificcommercialproduct,process,or serviceby its tradename,trademark,manufacturer,orotherwise,does I notnecessarilyconstituteorimplyitsendorsement,recommendation, or favoringby theUnitedStatesGovernmentoranyagencythereof,or TheRegentsof theUniversityofCalifornia.Theviewsand opinionsof authorsexpressedhereindonotnecessarilystateor reflectthoseofthe UnitedStatesGovernmentor anyagencythereof,or TheRegentsof the Universityof California.

ErnestOrlandoLawrenceBerkeleyNationalLaboratory is an equalopportunityemployer.

.— DISCLAIMER

Portions of this document may be illegible in electronic image products. Images are produced from the best avaiiabie originai document.

-.. LBNL-42877

Femtosecond Photoelectron Spectroscopy: A New Tool for the Study of Anion Dynamics

by

Benjamin Jefferys Greenblatt

B.S. (Haverford College) 1993

A dissertation submitted in partial satisfaction of the

requirements for the degree of

Doctor of Philosophy

in

Chemistry

in the

GRADUATE DIVISION

of the

UNIVERSITY OF CALIFORNIA, BERKELEY

Committee in charge:

Professor Daniel M. Neumark, Chair Professor Ronald C. Cohen Professor Jeffrey Bokor

Spring 1999

This work was supported in part by the Director, Office of Science, Office of Basic Energy Sciences, Chemical Sciences Division, of the U.S. Department of Energy under Contract No. DE-AC03-76SFOO098, by the National Science Foundation under Grant No. CHE-97 10243, and by the Defense University Research Instrumentation Program under Grant No. F49620-95- 1-0078.

... .. ~<~.--,,..,,.. -.,,.. . -. ., ,.- . .. . ~,, - -- -..--.——.- ,.,

Femtosecond Photoelectron Spectroscopy: A New Tool for the Study of Anion Dynamics

Copyright @ 1999

by

Benjamin Jefferys Greenblatt

The U.S. Department of Energy has the right to use this document for any purposewhatsoeverincludingthe right to reproduce all or anypart thereof

..-. --- .,-- 1 Abstract

Femtosecond Photoelectron Spectroscopy: A New Tool for the Study of Anion Dynamics

by

Benjamin Jefferys Greenblatt

Doctor of Philosophy in Chemistry

University of California, Berkeley

Professor Daniel M. Neumark, Chair

A new experimental technique for the time-resolved study of anion reactions is presented. Using femtosecond laser pulses, which provide extremely fast (- 100 fs) time resolution, in conjunction with photoelectron spectroscopy, which reveals differences between anion and neutral potential energy surfaces, a complex anion reaction can be followed from its inception through the formation of asymptotic products. Experimental data can be modeled quantitatively using established theoretical approaches, allowing for the refinement of potential energy surfaces as well as dynamical models.

After a brief overview, a detailed account of the construction of the experimental apparatus is presented. Documentation of the data acquisition program is contained in the

Appendix. The first experimental demonstration of the technique is then presented for Iz- photodissociation, modeled using a simulation program which is also detailed in the Ap- pendix. The investigation of Iz- photodissociation in several size-selected Iz-(Ar). (n = 6-

20) and 12-(C02). (YZ= 4- 16) clusters forms the heart of the dissertation. In a series of chapters, the numerous effects of solvation on this fundamental bond-breaking reaction

.,..= -- ,,,-- - ,-,. ,: ../ ,- - -- .7.--.:-.-,,... 2 Abstract are explored, the most notable of which is the recombination of 12-on the ground

~(2X~) state in sufficiently large clusters. Recombination and trapping of 12-on the ex- cited ~(211~,2,~) state is also observed in both types of clusters. The studies have re- vealed electronic state transitions, the first step in recombination, on a -500 fs to -10 ps timescale. Accompanying the changes in electronic state is solvent reorganization, which occurs on a similar timescale. Over longer periods (-1 ps to >200 ps), energy is trans- ferred from vibrationally excited 12-to modes of the solvent, which in turn leads to sol- vent evaporation. These effects become more important as cluster size increases. In addi- tion, differences in timescale and mechanism are observed between clusters of Ar, which binds to r and 12-rather weakly, and C02, whose large quadruple moment allows sub- stantially stronger binding to these anions. ... 111

Dedication

This dissertation is dedicated to my father

Raymond Benjamin Greenblatt

His unwavering love for me throughout my life

has allowed me to soar ;able of contents

1 Abstract.-...... ------... Dedication ...... ------111 Table of contents ...... iv.. Preface ...... ------...... Vlll Acknowledgments ...... ------...... ------...... xii Chapter 1. Introduction ------...... -...... References ...... ------...... 1. Chapter 2. Experimental AppuatUs ...... 14 1. Vacuum system --...... ------14 1.1. Pumps...- ...... -.-...... -...... -...... -..--...... -..-...... -...... l6 1.2. Interlock ------.------...... ------...... ------...... 18 1.3. Source and zeroeth differential regions ------...... 21 1.3.1. Pulsed valve ------...... ------...... 21 1.3.2. Electron ~n ...... 23 1.3.3. Zeroeth differential region ...... 25 1.3.4. Extraction and acceleration ...... ------...... 27 1.4. First and second differential regions ...... 28 1.4.1. Ion deflectors ..-----...... ------...... 28 1.4.2. Einzel lenses ...... ------...... 29 1.5. Detector region ...... ------.------...... ------...... 30 1.5.1. Laser windows and baffles ...... ------34 1.5.2. Retractable ion detector ...... ------1.5.3. Magnetic bottle ,------..------...... ------...... ___..:~ 1.5.4. Electron detector ...... ------...... 38 1.5.5. Mass gate ...... -.--...... ------40 1.5.6. Pulsed ion decelerator ...... 41 1.5.7. Reflection ...... ------...... ------...... ------41 1.6. Timing. -----...... -...... -..-...... -----...... -...... -...... 43 1.7. Ion time of flight ------...... 44 1.8. Electron time of flight ...... 47 1.8.1. Resolution ------....-.------...... ------48 1.8.2. Pulsed ion deceleration ...... ------...... 50 1.9. Reflection ion time of flight ...------...... ------53 2. Laser system ...... 55 2.1. Principles “ofnonlinear optics --...... 59 2.2. Clark-MXR femtosecond laser ...... 63 2.3. Beam pointing stability ...... 66 2.4. Quantronix TOPAS optical parametric amplifier ...... 68 2.5. CSK Optronics harmonic generator ...... ------...... 68 2.5.1. Principles ...... ------...... ------...... 68 2.5.2. Operation ------.....-...... ------71 2.6. Aerotech translation stages ...... 74 2.7. New Focus optical chopper ...... 76

..-. --2-.-6-.,...-.:1 ~ . - ,. .,. -. -.,::.- ...... Table of Contents v 2.8. Autocorrelation and cross.conelation ...... 77 2.8.1. Slow-scan autocomelator ...... 78 2.8.2. Fast scan autocorrelator ...... 8l 2.8.3. Cross-correlation ...... 85 2.9. Laser pulse optimization ...... 87 3. Data acquisition ...... 9o 3.1. Mass spectra ...... 9o 3.2. Photoelectron spectra ...... 9o 3.2.1. Background subtraction ...... 92 3.2.2. Above threshold detachment ...... 94 3.3. Correlation spectra ...... 96 4. References ...... 97 Chapter 3. Photodissociation dynamics of the 12-anion using femtosecond photoelectron spe~trOsCOpY...... I...... 99 1. Introduction ...... 99 2. Experimental ...... 102 3. Results and halysis ...... 106 4. Discussion. -..--.-...... ----...... ---...... ---...... -..-...... -.....-...... l 11 5. sumq ...... -...... -..-...... -...... -...... -...... -...... -.-...... -.-.....--...... --...... l 13 6. Acbowled~ents..--- ...... -...... ----..-...---...... --...... ---...----...... -...... -.....-.---...... l 14 7. References ...... --.-...... --...... -...... --...... -...... -...... -...... -...... -...... --...... -.....l 14 Chapter 4. Time-resolved photodissociation dynamics of I;(Ar). clusters using anion femtosecond photoelectron spectroscopy ...... l 17 1. Introduction ...... -.117 2. Experimental ...... 119 3. Results ...... l2l 4. Discussion ...... --.-...-.-..-...... -.....-...-...... -...... --...... -...... -.....-.-...... --...... l23 5. Conclusions..- ...... ----.....-...... -.-...-...... -..-....-....--.-....-...... -----....--.....---.....l27 6. Ackowled~ents ...... -...... -...... -.....-...... ---....-...... -..-...... -...... ----...... l28 7. References. -...... -...... ----...... ---...... --.....-...... ---....-..-.-.....--....-.--...... -...... l28 Chapter 5. Time-resolved Studies of Dynamics in Molecular and Cluster Anions... -.....-l3O 1. ~troduction.- ...... -...... -...... -...... -...... -...... --..-...... -.....--...... ---...... --l3O 2. Experimental ...... 134 3. Results ...... -...... -...... -...... -...... -.--....-.-...... -...... --...... --.....l39 4. Discussion.+...--.. -....-...... -...... --...... -...... l42 4.1. Iz.(COz)d ...... l43 4.2. 12-(C02)16...... -..-.....--.-.....--...... -...... ----...... -...... -....-..-...--...... -...-.....l46 5. Conclusions .....-.-...... -...... --...... -.-.....---.....-.....--.....--...... -.---.l53 6. Ackowled~ents--..- .....-...... -...... --...... --...... --.-....--.-...... -...... l54 7. References .....--...... -...... -...... ---...... -...... -..-.-..-.-.....-..--...... --.l54 Chapter 6. Femtosecond photoelectron spectroscopy of Iz-(Ar)n photodissociation dy- namics (n= 6,9, 12, 16, 20)...... 158 1. htroduction...-- ...... ----...-.-...... -.-...... -...... -...... --...... --.....--...... ----...... -.-...... l58 2. Experimental ...... 167 3. Results ...... --...... -...... -...... --...... -...... -.--...... ---...... -...... l68 4. Analysis ...... 173 vi Table of Contents 5. Discussion .------...... ------...... ------183 5.1. Short-time dynamics ------...... 184 5.2. IJ(Ar)G and 12.(A)9 ...... 184 5.3. I~(Ar)lz and I~(Ar)lG ...... 186 5.4. I;(Ar)zO--...... 191 6. Conclusions ...... 197 7. Acknowledgments ...... ------..------199 8. References ...... ------199 Chapter 7. Femtosecond photoelectron spectroscopy of I~(COz)n photodissociation dy- namics (n= 4,6,9, 12, 14, 16)...... 2O3 1. Introduction ...... ------204 2. Experimental ------.------.------...... 210 3. Results ...... -.....-...... ------211 4. Analysis ...... ------218 5. Discussion ...... -...... ------...... ------.------...... 222 5.1. I;(COz)Q ...... ----...... ------...... -...... 222 5.2. I~(CO&, I~(COz)!l and Ij(COZ)lZ ...... 226 5.3. I;(COZ)14 and I~(C02)16 ...... z3b 5.4. Trends across cluster size, and comparisons with other studies ...... 242 5.5. Comparison with Ii(Ar)~ clusters ...... 246 6. Conclusions .------...... -...... ------...... ------.------248 7. Acknowledgments ...... -...... ------...... ------...... ------250 8. References ------...... ------...... ------...... ------250 Appendix 1. Data Acquisition Program (fPeS) ...... 253 1. Program overview .------...... ------253 2. Selected variables ------...... ------...... ------...... ------...... ------...... 254 2.1. Background subtraction: .bS ...... 255 2.2. Command line: com ...... ------.-257 2.3. Screens: sc ...... 258 2.4. “Waves” (spectra): w ...... 261 2.5. Local variables ...-----.....-.--...... ------...... ------...... ------...... ------265 3. Compiling and execution ...... 265 4. program listing ...... 266 4.1. fpes. pas ...... 268 4.2. fpescom. pas ...... 268 4.3. fpesai. pas ...... 3O4 4.4. fpes j r. pas. ---.-...... --....---.--.....-...... -...... 332 4.5. fpesst. pas ...... ~+~ 4.6. fpesuz . pas ------...... --- 4.7. fpesvar. pas ...... 386 4.8. dosshell. PaS ...... 393 4.9. keys. pas ...... 394 4.10. tpdecl pas ...... ------395 4.11. fs. bat ...... 399 4.12. mass . par ...... --...... -...... -..-.-...-.-...... 399

. . :,,7:.. .-. .., .,.,- ,.:<-~.,.. .y-,r,~- z. . ---- .

Table of Contents vii Appendix 2. Femtosecond photoelectron spectrum simulation program (alpine, trans) ...... ------...... 400 1. Theoretical back~ound ...... 4OO 2. Compiling and execution ...... 4O6 3. Input files to alpine ...... 4O7 3.1. alpine. inP ...... 4O7 3.2. pot*. in ...... 411 3.3. psi* . inp ...... ----...... 412 4. Output files from alpine ...... 4l2 5. Input files to trans ...... ------...... 413 5.1. trans. inp ...... 4l3 5.2. matrix. out ...... 4l5 6. Output files from trans ...... ------...... -...... 415 7. References ...... 415 8. Program listings ...... 4l6 8.1. alpine5.4.1. f ...... -.----...... 417 8.2. trans2 .2.1. f ...... 438 Appendix 3. Complete FPES spectra of Ii(Ar)~ ~d Iz-(COz)~ clusters ...... -...... ----.....446 1.12-...... ------...... 447 2. IJ(&)6..---.-.- ...... -..-...... --.---...... -.-...... -.-.-...... 45o 3. Iz-(Ar)g...... -...... -...... -..---.-...... --...-.-...... -.454 4. I;(Ar)12 ...... ------...... ------...... 465 5. Iz-(Ar)lG...... 467 6. I~(Ar)20 ...... 469 7. I~(COZ)q------.------..------...... -.-...-...... --...... -.--...... 472 8. I~(C02)6..------...... -.....-..-...... -...... -....-...... -..-...... -...... -...... 475 9. I~(COz)g ...... -..-...... --...... -.-...... -.--.-...... -.-----...... ---...... ----....477 10. I;(C02)12.-...--. --...... --..-...... --.-..-...... -...-..-...... ----...... ---...... 48O 11. Ii(co2)14..- ...... -...... -.-.-.....-...... -.-...... -..-.-...... -.-...... 483 12. IJ(C02)16 ....--...... --..-...... -...... -...... -..-.-...... --.--...... --...... -.--...... a85 Appendix 4. Publications from graduate work ...... 488 ... VIII Preface

As I have learned throughout my graduate career, scientific language is often ex- tremely difficult for non-scientists to comprehend, and even when it is translated into common usage, the ideas themselves are sometimes a challenge. I have tried my hardest to provide here a short “layman’s” explanation of my work, with the hope that, even if the rest of the dissertation is unintelligible, one can still walk away with a general under- standing of the research, and where it fits into a larger context.

A femtosecond is an extremely short unit of time, a million times faster than a nanosecond, the time in which a computer can (currently) make decisions. It is so short, in fact, that light, which can circle the Earth seven times each second, only moves a hair’s breadth. It is also shorter than the time it takes many molecules to vibrate. This means that the atoms of a molecule can in principle be observed in different positions at differ- ent times, rather than being smeared out over a range of locations if they were measured over many vibrations. We use these extremely short bursts of light as “strobe lights” for molecular motion. Everybody knows these devices from the dance floor: a quick burst of light which seems to freeze the motions of people and objects when observed by the eye.

The same approach is used to study molecules, employing a pair of light pulses to first, rapidly initiate a chemical reaction, and second, to take a “picture” of the reaction a short time later. We can use the dance floor as a metaphor for our experiment: the first flash signals a dancer to begin dancing, and the second flash is used to photograph her.

The dancer will have to have good stamina, because will be asked to repeat her moves precisely many thousands of times, while the time delay between pulses is slowly changed! Fortunately, molecules will always perform the same “dance” if they are care- Preface ix fully prepared beforehand, so molecular fatigue is not a concern here. In the end, a de- tailed movie of the dance is obtained. This approach is far more complex than simply filming the dance as it occurs, but the “movie camera” option is not possible for mole- cules: although the flashes of light happen very quickly, recording each “frame” takes far longer. Also, the second flash of light destroys the molecule!

We conduct our experiments inside a vacuum chamber, that is, a place where all the air has been removed. This is because collisions between the molecules under study and molecules of the surrounding air will invalidate our careful measurements, and can- not be tolerated. Typically, only one trillionth of atmospheric pressure is used, which sounds phenomenal, but it is actually routinely obtained for many scientific experiments done in vacuum. We produce a stream of negatively charged molecules (“anions”) which are then guided from one end of the chamber to the other (a dk,tance of 1.3 meters) using a series of small electric fields, rather like guiding a fast-moving pinball with paddles and bumpers. When the anions reach their destination, they are bathed with laser light for a few brief instants, after which ~’photoelectrons” are produced (photo= created from light; electron = a subatomic particle which orbits the nucleus of an atom). These electrons travel with different speeds toward a detector at the end of another tube (also about 1.3 meters long). The laser pulses start a clock which is stopped when the electrons are de- tected, revealing the time it took them to traverse the dktance, and hence their speed.

Speed is converted into a more useful quantity called “electron kinetic energy,” and the data take the form of a histogram called a “spectrum;’ showing the numbers of electrons with each possible electron kinetic energy. While far from being a photograph of the molecule, the spectrum reveals important information about the molecule’s structure, and x Preface it is fairly easy to convert the information into a more intuitive physical picture. The study of a spectrum is called “spectroscopy.”

The focus of my research is on understanding how a chemical reaction changes its course when it is surrounded by a liquid. Rather than studying the reaction in a liquid di- rectly, we simulate a liquid environment by making small anion “clusters” inside the vac- uum chamber, consisting of no more than a single layer of liquid molecules (about 16-20) surrounding the chemical reaction. I will not attempt to explain how the number of mole- cules in our clusters can be controlled, but suffice it to say that the number may be varied one at a time. We study the motion of the reaction without any liquid, then begin adding liquid molecules, and see how the motions change. In our case, the basic reaction is sim- ply the breaking of a molecule into two atoms. In a cluster, however, collisions with the liquid molecules allow the atoms to come together again, forming the original molecule.

The amount of “recombined” molecules increases as the size of the liquid cluster grows, until no atoms can escape the cluster.

The process by which the recombination process happens is very interesting: for the first few hundred to few thousand femtoseconds, the atoms appear to separate, but collisions between the atoms and the liquid heats the cluster, so that it begins to jiggle wildly. In order for the atoms to recombine, the jiggling must be reduced. This happens by expelling liquid molecules from the cluster, each of which takes away some of the heat. Over a period ranging from 10,000 femtoseconds to more than 200,000 femtosec- onds, the cluster gradually cools, and the atoms recombine. The process of expelling liq- uid molecules is called evaporation, and is completely analogous to what happens to peo-

.- . -,. ..7,. . . ,.. . .;, - -,, .,, . . Preface xi ple on a hot day: evaporating water from our skin cools us by taking away part of our heat.

Thus, there is the dissertation in a nutshell: using femtosecond photoelectron spectroscopy to study chemical reactions in small anion clusters. xii Acknowledgments

Five and a half years is a long time to spend in one place, working on a single project, and I did not make it through alone.

I would like to acknowledge Dan Neumark for taking me into his group, for al- lowing me to be the first student on the FPES project, and for being my advisor.

Warm thanks go to Marty Zanni, my sole partner in the lab for three years.

Marty’s natural talent for experiments quickly became apparent, despite his year lag be- hind me, and we built the FPES machine as equals. Marty has a spontaneity to his scien- tific approach which was a welcome contrast to my more methodical style, and I believe we learned from each other how to be more effective experimenters. I also thank him for bringing a lot of fun into lab, with his music, swing dancing, chess games, midnight soc- cer matches (I only heard about them, not a player myself), cultural discussions, and gen- eral social coordination of the group.

Besides Marty, the FPES machine has seen a number of faces throughout my ca- reer. I acknowledge the visitations of Benoit Seep from the Universit6 Paris-Sud, France;

Rainer Weinkauf and Leo Lehr from the Technische Universitat Munchen, Germany; and

Gustav Gerber from the Universitat Wurzburg, Germany. Current team members include graduate student Alison Davis, and our first post-doctoral student, Christian Frischkom.

Alison in particular I’ve gotten to know over the past year, as she spent a commendable amount of time in the lab from the beginning. My last weeks in lab, working on the first

SN2 reaction experiments, she almost always stayed as late as I did, even into the wee hours of the morning. I congratulate heron passing her second year exams, and wish her many successful experiments in the future.

/~,. . ... ,;.: ~ ,:!:-. ..’>>’ , .. --- v,...... Acknowledgments X111 Among other current group members, I extend a warm hand in thanks, both for

practical assistance in the lab and as friends. In particular, I wish to acknowledge Mike

Furlanetto for many discussions on a wide variety of scientific and cultural topics, and for

being an excellent computer administrator during the last couple years. I also want to ac-

knowledge Weizhong Sun for interesting discussions about China, and, especially, for

arranging a lecture appearance for me at Beijing University with Professor Liming Ying,

when I visited the country last summer.

Former Neumark group members are numerous, and I acknowledge them all for their direct and indirect gestures. In addition, I want to thank a few people I was espe- cially close to. Among the graduate students, David Osbom was a role model for me from the beginning, as I was quickly awed by his multiple talents apart from science, and he made an effort to share some of them with me: rock climbing, river rafting, kite flying, carillon playing, and bread baking. Don Arnold gave me’encouragement when I was first starting to think about the FPES machine (a year before it was constructed), and helped to orient me with his computer programs which I would later transform into the FPES data acquisition code. Cangshan Xu and I bonded in a number of ways: as computer affi- cianados, as tennis players, and as admirers of Chinese culture and language. Ivan Your- shaw also became close to me, as a movie hound, pop psychologist, environmentalist, feminist and fellow cynic.

There are also a few former post-dots I wish to highlight. Esther de Beer had sto- ries of Europe to dazzle me with, and was my swimming partner for the last six months of her stay. Gordon Burton was a role model for me, always calm, positive, cultured, and fascinated by machines as well as science; he was a great brainstorming partner. David xiv Acknowledgments Leahy, resident computer expert, spectroscopy guru, and comedian, tickled me with his off-the-wall humor, and taught me quite a bit about science. Finally, David Mordaunt be- came more of a friend after leaving the group, having discovered our similar tempera- ments and interests, and we have fallen into a social foursome together with our partners.

My contacts at Berkeley were not limited to the Neumark group, and there are several people outside the group I wish to acknowledge. For assistance with understand- ing femtosecond lasers and/or femtosecond photoelectron spectroscopy, Matt Blackwell and Pete Ludowise of the Chen group, Matt Asplund of the Charles Harris group, and

Victor Batista of the Miller group all gave generously of their time. Matt and Pete, in particular, were practically coworkers for a time, both because their project strongly re- sembled ours (though they looked at neutral molecules), and because they were in our lab lending and borrowing equipment like any other group member. We hope our expertise was as beneficial to their project as theirs was to ours. I acknowledge student seminar program organizers Amy Herhold and C-J Lee of the Alivisatos group, Haw Yang of the

Charles Harris group, and Linda Koch of the Cohen group: they all contributed to the success of the program, and with their sunny personalities, made it worthwhile for me to come to meetings.

There is another group of people whom I acknowledge for their innate abilities in speaking Chinese: Cangshan Xu and Weizhong Sun (Neumark group), C-J Lee (Alivisa- tos group), Haw Yang and Nien-hui Ge (Charles Harris group), Wenhong Yang and

Hongwen Li (Strauss group), and Neil Fang (Accounting office). In addition, I acknowl- edge the patience of my Chinese teachers in the East Asian Languages Department: Joyce

Wang, Ying Yang and Cecilia Chu. An interest of mine since college, I only had the op-

,,>.::.. .. - , . ,. -,,.,, “2 ..” *- - ., ..-,.< ---- . . Acknowledgments xv portunity to take courses in Chinese language during my fourth year at Berkeley. Once I had begun my studies, the above-named group of people received constant entreaties for spoken and written practice. The culmination of my studies in a sightseeing tour of China together with my parents in July 1998 was all the more enriching to me because of their help and encouragement.

Two faculty members deserve my special thanks for helping me choose a new ca- reer dkection. Professor Ilon Cohen has been patient, encouraging and generous of time and resources since I first expressed an interest in the field of atmospheric chemistry about a year ago. Since that time I have gone on to take a class with him, attend his group meetings, and ask him to sit on my dissertation committee. Ilr. Susan Kegley has also served as an advisor of sorts, having spearheaded an inspiring, new environmental lab curriculum for Freshman Chemistry when I first came to Berkeley. Since that time, I have continued to keep tabs on her environmental projects, and she has encouraged me strongly in my recent pursuits of a post-dot in atmospheric chemistry.

I have had considerable professional interaction with two theoretical students from the University of Colorado, Boulder: James Faeder and Nicole Delaney of the Par- son group. At first, we corresponded on the subject of anion cluster dynamics exclusively by phone and e-mail, but we finally met at the ACS Conference in Las Vegas in August

1997, and became friends. Their continued efforts in providing both calculation results and critical thinking has been invaluable to the writing process, and I wanted to acknowl- edge their good will.

I’ve had a few friends in the Bay Area completely outside the chemistry circle whom I wish to acknowledge. I met Lorin Gillin at Haverford College, and he has been in xvi Acknowledgments and out of California ever since he graduated, but finally moved to San Francisco last year, where he has been pursuing high school science teaching. An avid outdoorsman, he and I have camped together in the mountains of Los Angeles, but haven’ t made it to the

Sierra (yet). Ruth Wittman, an old family friend, first introduced me to Berkeley when I was here as a prospective student, and allowed me to stay in her home the following summer when I was shopping for an apartment. We get together occasionally for ice cream on the porch, and swap stories. My neighbors, Don and Linda Weingarten, share my love of science, and have employed me this past year and a half to tutor their two children, Eric and Neil. Don, especially, entertains me with his tall but true tales, and dis- cussions on a wide variety of topics.

Out of state are some of my closest friends, and I acknowledge all of them for making the effort to keep in touch with me. John Kerrigan is a high school acquaintance, who became a more serious friend only after our graduations from college. He moved closer to me (to Las Vegas) in 1995, and subsequent y we have visited each other several times along with his new wife, Kristin. An expert in Irish literature, John’s intellect, hu- mor and incomparable hospitality have helped sustain me through my years at Berkeley.

Evan Manvel was another Haverford student who has always inspired me with his strong activist spirit. First he lived in Corvallis, Oregon pursuing local environmental issues, and

I visited him several times there. Then he returned to the East Coast where he studied public policy at Harvard. Now he’s back in Oregon doing activism, though we haven’t

seen much of each other latel y. Lastly, I met Ameet Raval during a summer internship at

the Princeton Geophysical Fluid Dynamics Laboratory in 1991. We quickly became good

friends, and remain so today. He left atmospheric physics for psychology a few years af-

.. ..m. . . . . ,.- .-. ,, .,..7..-.“:.7,... -7. f Acknowledgments xvii ter we met, and is now almost through his Ph.D. program at Temple University (Phila- delphia, PA). Not only a great mental sparring partner, his spiritual and emotional sides have been a blessing to experience in a friend.

My parents, Ray and Sue, and my brother, Alex, all live near West Chester, PA.

They have been a constant support for me, and vacations are seldom considered without including them: the feeling of renewal in seeing family is tremendous. My uncle, Bill Jef- ferys, is an astronomer at the University of Austin, Texas, and is in some way responsible for inspiring me to pursue the Ph.D., since he’s the only other family member who has one. My grandmother, Ena Jefferys, lives in the tiny town of Waitsfield, VT, where I’ve managed to visit her three times since coming to Berkeley. I always enjoy the views from her porch, the smells of her kitchen, and her warm and witty manner. While at Berkeley,

I’ve lost my three other grandparents, Ben and Claire Greenblatt (in 1995), and Bill Jef- ferys Sr. (in 1996). Fortunately, I saw them all often enough that I didn’t feel I had lost touch with them when they died, though it was still very painful when I heard the news from my parents 3,000 miles away.

Finally, there is one last person who has been patiently waiting until the end of my acknowledgments for recognition, and that is Noreen Buyers. First secretary of the group, then girlfriend, now fianc~e, she has transformed my life as well as helped me through the most difficult year of my Ph.D. program. My thanks to her are without end, as our journey unfolds together.

The research described in this dissertation was supported by the Director, Office of Science, Office of Basic Energy Sciences, Chemical Sciences Division, of the U.S. ... Xvlll Acknowledgments Department of Energy under Contract No. DE-AC03-76SFOO098. Additional funds were provided by the National Science Foundation under Grant No. CHE-97 10243, and the

Defense University Research Instrumentation Program under Grant No. F49620-95- 1-

0078.

...... F. ,, .,.: Chapter 1. Introduction

For physical chemists, a primary motivation for experimental and theoretical work is to improve understanding of the process of making and breaking of chemical bonds. We focus on characterization of potential energy surfaces, which govern both structure and dynamics of molecular systems. Structure is best studied using so-called

“frequency domain” laser techniques which, owing to the extremely narrow bandwidth of most tunable lasers, has enabled the complex energetic surfaces of a large number of systems to be characterized in phenomenal detail. If a sufficient y detailed and accurate surface can be produced, and the system has only a few degrees of freedom, then all the dynamics can be calculated from the potential energy surfaces. However, only a small region of the coordinate space of a potential energy surface is generally accessible from the minimum-energy configurations typically studied to derive structural information. In this case, molecules must be perturbed (through laser excitation, collisions in a molecular beam, or other means) in order to explore new regions of potential surfaces. In the fre- quency domain, such experiments are valuable if the end result of such a perturbation can be observed, such as a spectrum or kinetic energy distribution of product molecules, or if the transition state of a reaction can be detected through the broadening of transitions in the reactant spectrum, or a direct spectral signature of the transition state.

The wide availability of femtosecond pulsed lasers has added powerful new tools to the study of dynamics, as well as molecular structure, through observation of reactions in the “time domain.” As the vibrational period of a typical diatomic molecule, such as Iz, is on the order of 50 fs, comparable to laser pulse durations, these lasers have the unique ability to prepare a molecular “wavepacket,” or coherent superposition of vibrational lev-

...... ,, .“. .,- ...... -. .. -,., 2 Chapter els, and subsequently probe the molecule’s evolution in time. In other words, the dynam- ics of a chemical reaction can be studied as it unfolds, not just at its starting or ending points. Numerous systems have been examined using a variety of pump-probe tech- niques, in both the condensed and gas phases, examining small and large molecules, neu- tral and charged species. l-g

One area where relatively little work has been done up until now is the time- resolved study of anion reactions. Anions play essential roles in the condensed phase, where they are basic to organic and biological reactions (e.g., nucleophilic substitution, oxidation-reduction, proton transfer). In the gas phase, they are important in the atmos- phere (e.g. 03- and C03- are intermediates in stratospheric anion chemistry,lo,l I and in- creased electron densities in the sunlit ionosphere is attributed to 0- photodetachmentlz).

However, the gas phase is also an ideal environment for studying fundamental reactions, without the distortions to potential surfaces caused by the proximity of solvent molecules encountered in the condensed phase.

While many gas-phase anion syst6ms have been explored in the frequency do- main, only a handfi,d have been studied in the time domain, most notably, the experi- ments on 12-(Ar)~ and 12-(C02)~ clusters by the Lineberger group, 1s-1g and more recently, the femtosecond photoelectron spectroscopy of AU3-by Eberhardt and coworkers.zo

Thus, time-resolved studies of gas-phase anion reactions represent an enormous untapped

area of research. Through studying anion reactions, we hope to gain a better understand-

ing of the underlying chemical processes involved, including the timescales of product formation in photodissociation reactions (such as 12U”22and 13d3’24),the formation of in-

termediate states on more complex potential surfaces (e.g., the gas-phase SN2 reaction Cl- Chapter 1 3 + CH3CN),ZS or the role of solvent in altering a reaction [e.g., the formation of dipole- bound anion states in I_(HzO)~ clusters,26’27 and the solvent-induced recombination of Iz” in 12-(Ar). or 12-(C02)n clusters (see Chapters 4-7)].

In the gas phase, anions are difficult to produce in large amounts compared with neutral molecules, making many traditional detection schemes (direct absorption, laser- induced fluorescence, multiphoton ionization) infeasible. Sensitive methods have been developed for studying anions in the gas phase, most notably photoelectron spectroscopy.

It is basically this technique, with a long history in the Neumark group, which has been coupled to a femtosecond pulsed laser, to enable the study of time-resolved anion reac- tions.

Photoelectron spectroscopy refers to a collection of related approaches for exam- ining the electronic structure of gas-phase or surface-bound ions and molecules. Its ori- gins lie in the discovery of the photoelectric effect, which identified a threshold photon energy for ejection of electrons from a metal surface.28’29 As a gas-phase technique, its development in the early 1960sS0’S1has led to an explosive growth of the field, and pho- toelectron spectroscopy is now routinely used to study a wide variety of molecular and ionic systems. “

The photoelectric effect can be summarized in terms of an energy conservation equation as follows:32’33

h~ = EA + Eintemal+ Ee- (1) where hv is the photon energy, EA is the electron affinity (or, in the case of a neutral molecule, it is replaced by 1P, the ionization potential), Eintemalis the internal energy of the newly-created neutral molecule (or positive ion), and E.- is the kinetic energy of the

.:*. ,-,: ...... “..“--<. .-,“r,’.-., 4 Chapter electron. Ei~t~~dcan be further broken down into various components, e.g., electronic, vibrational and rotational. Since the electron produced is free, all its energy is kinetic; thus useful implementation of the principle involves measuring either the kinetic energy of ejected electrons using a fixed-frequency photon, or varying the photon energy while monitoring electrons ejected with a specific (usually zero) kinetic energy. Both methods have been implemented successfully in the Neumark group laboratories, and each ap- proach has different strengths and weaknesses. With a fixed-frequency laser source, an entire spectrum may be collected at once (photoelectron spectroscopy or PES),SQ but resolution is limited to -50-100 cm-[ by the collection angle of the electron detector, the length of the flight tube, and the spatial extent of the ion and laser beams. When the laser frequency is tunable, the resolution may approach that of the laser, e.g. -0.05 cm-l, if electrons with nearly zero kinetic energy are detected [threshold or zero electron kinetic energy (ZEKE) spectroscopy],ss but such electrons must have the proper angular mo- mentum to be detected efficiently near threshold, and data collection is both slower and at a single energy at a time,

The extension of photoelectron spectroscopy to the ultrafast regime began with a series of experiments in the early 1990s studying intramolecular vibrational energy re- distribution in gas-phase anilines,sG~sTusing a pair of picosecond pulses to first promote molecules to an electronically excited state, and then to ionize them, producing photoe- lectrons. Both PES and ZEISE techniques were employed. Later studies utilizing femto- second pulses examined the time-resolved vibrations of excited Na3,g and 12;S8rates of internal conversion in hexatriene,s and the control of NO product states through the Chapter 1 shifting of potentials using intense femtosecond pulses,sg using either ZEKE - copy (in the first two examples), or PES.

Femtosecond photoelectron spectroscopy (FPES) for anions is similar to the above approaches for neutrals. It involves the following pump-probe scheme, using the photodissociation of a generic diatomic anion “XY” as an example:

Xy- h“, XY +e- )[xY-]*J%x... y- ‘“2 (2) ‘{X+ Y+e- where [XY_] * is the anion in an excited electronic state immediately after excitation,

X... Y_ is the anion at a later time, where the X and Y_ products have mostly separated, e- is the detached photoelectron, hv 1and hvz are femtosecond-duration pump and probe la- ser pulses, respectively, and At is a variable time delay between the pulses. The measured signal is the photoelectron, which is energy-analyzed by time-of-flight; therefore, an en- tire photoelectron spectrum may be collected for each pump-probe time delay At.

The technique is illustrated in more detail in Fig. 1. Preparation of XY- is as- sumed to be vibrationally cold, however, the same analysis may apply for a vibrationally hot ion, though dynamics will be blurred out due to a less localized starting wavepacket.

Promotion to an anion excited state takes place with the pump photon. The wavepacket then evolves toward larger internuclear distances, i.e. dissociation into X + Y_. Because of the ultrafast time duration of the laser pulses, this wavepacket motion can be followed with the probe pulse at various time delays between pump and probe pulses, indicated by

Atl and At2. This second pulse detaches an electron from the anion, leaving the remaining neutral molecule in a state determined by the Franck-Condon overlap between anion and neutral wavefunctions. From Eq. 1, the kinetic energy of the electron is determined by the

... 6 Chapter internal energy of the neutral molecule; this is reflected in the figure by horizontal lines representing vibrational eigenstates of the neutral, which connect to peaks in the photoe- lectron spectrum on the right. The total energy of the probe photon corresponds to the origin of the spectrum.

. ,0

A

~-

X+Y . ; XY ‘, . 4 E%obe Probe . ‘r/At hv2 P XY-]*

\ ➤ Pump x+y- ‘%hvl ~

xY-

w ➤ Reaction Coordinate

Fig. 1. Schematic diagram of the FPES”technique.

At time delay Atl, the wavepacket is still on the repulsive wall of the anion poten- . tial, so overlap with the neutral potential is strongest in the bound region, generating an

extended vibrational progression in the photoelectron spectrum. By time delay At2, the

wavepacket has reached the dissociation asymptote, and both potentials are flat; the pho- Chapter 1 7 toelectron spectrum displays a single sharp peak, corresponding to the energy of Y_ pho- todetachment. The horizontal arrow near each wavepacket represents its average kinetic energy along the reaction coordinate, and has the effect of shifting the Franck-Condon overlap toward the turning point (zero kinetic energy) region of the neutral potential.

..I(2P,,2)...... +.....I(2&)......

..I(2P3,2)...... +.....I(2P,,2)......

,’ ,’ 260 nm ‘, ‘,

‘.

300 fs

1-+ I(2P,,2) \

2 3 4 5 6 7 8 Distance/~

Fig. 2. Snapshots of calculated 12-wavepacket on the ~’(211,,,,, ) state.

,.<:’:’” ‘ ,-,.,. 8 Chapter As an example of a real system, a series of “snapshots” of the calculated evolving wavepacket for 12-photodissociation are shown in Fig. 2. Here the anion is excited from the ground %(2Z~) state to the excited ~(2H1,z,~) state with 780 nm light of 80 fs dura- tion. As the wavepacket moves considerably over the pump pulse duration, the wavepacket at 50 fs is highly asymmetric, with a strong peak in the initial Franck-

Condon region, and a broad tail at larger internuclear distances. By 150 fs, the wavepacket is completely outside the Franck-Condon region, and by -300 fs, it has reached the I + T dissociation asymptote.

A set of experimental photoelectron spectra of this reaction, taken from Chapter 6, is shown in Fig. 3. At early time delays, the spectrum is dominated by intensity in two broad regions, roughly 0.7- 1.0 eV, and 1.6-2.3 eV, corresponding to transitions to the two manifolds of neutral states correlating with the 2P112and 2P312asymptotes of I, respec- tively (see Fig. 2). By 380 fs, these broad features have been replaced by sharp features at

770 meV and 1.71 eV, respectively: transitions to the I spin-orbit states. As demonstrated in Zanni et al.,zz these photoelectron spectra can be modeled quantitatively, confirming that wavepacket dynamics maybe followed from start to finish over a duration of only a few hundred fs, and there is a considerable amount of information to be had from such spectra. The femtosecond photoelectron spectrum simulation program used to generate such spectra, including a more extensive theoretical background, is covered in Appendix

2.

Fig. 3. Experimental photoelectron spectra of 12-photodissociation (on next page), Chapter 1 9 t I 1 u I 1 & a I I 1 1 I 1 I- II 2

580fs

380

280

180 80 -20 >-120

00● 10● 20● 30● Electron Kinetic EnergyleV

>.. .’:.$.” 10 “ Chapter This dissertation contains, in addition to the first account of the FPES technique applied to anions (Chapter 3), a series of papers exploring the effects of solvent mole- cules on a chemical reaction (Chapters 4-7). Using mass-selected cluster anions to “tune” the amount of solvation one molecule at a time, the photodissociation of 12-in both Ar and C02 clusters has been studied. These experiments are based on earlier work by the

Lineberger group, which examined anionic photofragment distributions of these clusters, as well as time-resolved two-photon absorption. Is-lg The goal of the FPES experiments has been to understand the evolution of the dynamics from the uncaged to fully-caged size regime. The level of detail afforded by measuring complete photoelectron spectra, rather than probing a specific transition of the anion, is unsurpassed in these reactions, and has allowed us to glimpse a much more complete picture than what was previously possible.

Although the detailed findings can be found in the individual chapters, a few key results are summarized here. With only a few (-4-6) solvent molecules present, photodis- sociation proceeds relatively unimpeded, though the effect of solvent on the motion of the iodine atoms is unmistakable. In larger clusters, interesting new dynamics occur, most importantly, the “caging” of the r and I atoms by the solvent to reform 12-,either on the ground state, or in an electronically excited state [ ~(2H3,z,~) ]. By the time a full solvent shell is reached (20 for the case of Ar, or 16 for COZ), 100% caging is observed, with a considerable speedup in the rate of 12-formation as well. Extensive vibrational relaxation of the 12-in the ground state is observed, accompanied by evaporation of solvent mole- cules to dissipate the energy. The main differences in the dynamics between the 12-(Ar),l and 12-(C02)~ clusters is the presence of solvent-induced electronic transitions in the first Chapter 1 11 -500 fs- 1 ps in 12-(C02). clusters which are absent in Iz-(Ar)” clusters, and considerably

faster 12-formation and vibrational relaxation in Iz-(COz)n clusters. These distinctions

1 highlight thesignificantly stronger binding energy of COzwith rand Iz-overthatof Ar.

References

1 D. E. Smith and C. B. Harris, J. Chem. Phys. 87,2709 (1987).

2 C. Lienau and A. H. Zewail, J. Phys. Chem. 100, 18629 (1996).

3 D. R. Cyr and C. C. Hayden, J. Chem. Phys. 104,771 (1996).

4 R. M. Bowman, M. Dantus, and A. H. Zewail, Chem. Phys. Lett. 161,297 (1989).

5 M. Gmebele, G. Roberts, M. Dantus, R. M. Bowman, and A. H. Zewail, Chem. phys.

Lett. 166,459 (1990).

6 M. Gmebele and A. H. Zewail, J. Chem. Phys. 98,883 (1993).

7 T. Baumert, V. Engel, C. Meier, and G. Gerber, Chem. Phys. L&t. 200,488 ( 1992).

8 T. Baumert, V. Engel, C. Rottgermann, W. T. Strunz, and G. Gerber, Chem. Phys.

Lett. 191,639 (1992).

9 T. Baumert, R. Thalweiser, and G. Gerber, Chem. Phys. Lett. 209,29 (1993).

10 E. E. Ferguson, F. c. Fehsenfeld, and D. L. Albritton, in Gas Phase ZCVZche~istry,

Vol. 1, edited by M. T. Bowers (Academic Press, New York, 1979), pp. 45-82.

11 F. Arnold, in Atmospheric Chemistry, edited by E. D. Goldberg (Springer-Verlag,

New York, 1982), pp. 273-300.

12 J. R. Peterson, J. Geophys. Res. 81, 1433 (1976).

13 D. Ray, N. E. Levinger, J. M. Papanikolas, and W. C. Lineberger, J. Chem. Phys. 91,

6533 (1989).

.. . - ...... :., 12 Chapter 14 J. M. Papanikolas, J. R. Gord, N. E. Levinger, D. Ray, V. Versa, and W. C. Lineber-

ger, J. Phys. Chem. 95,8028 (1991).

15 J. M. Papanikolas, V. Versa, M. E. Nadal, P. J. Campagnola, J. R. Gord, and W. C.

Lineberger, J. Chem. Phys. 97,7002 (1992).

16 J. M. Papanikolas, V. Versa, M. E. Nadal, P. J. Campagnola, H. K. Buchenau, and W.

C. Lineberger, J. Chem. Phys. 99,8733 (1993).

17 V. Versa, Ph.D. Thesis, University of Colorado, Boulder (1996).

18 V. Versa, P. J. Campagnola, S. Nandi, M. Larsson, and W. C. Lineberger, J. Chem.

Phys. 105,2298 (1996).

19 V. Versa, S. Nandi, P. J. Campagnola, M. Larsson, and W. C. Lineberger, J. Chem.

Phys. 106, 1402 (1997).

20 G. Gantefor, S. Kraus, and W. Eberhardt, J. Electron Spectroscopy and Related Phe-

nomena 88-91,35 (1998).

21 B. J. Greenblatt, M. T. Zarmi, and D. M. Neuma.rk, Chem. Phys. Lett. 258, 523-529

(1996).

22 M. T. Zanni, V. S. Batista, B. J. Greenblatt, W. H. Miller, and D. M. Neumark, J.

Chem. Phys. 110,3748 (1999).

23 M. T. Zanni, B. J. Greenblatt, A. V. Davis, and D. M. Neumark, in preparation .

24 M. T. Zanni, B. J. Greenblatt, A. V. Davis, and D. M. Neumark, Proc. SPIE 3271,

196 (1998).

25 A. V. Davis, M. T. Zanni, and D. M. Neumark, in progress .

26 L. Lehr, M. T. Zann~ C. Frischkorn, R. Weinkauf, and D. M. Neumark, Science, in Chapter 1 13 press .

27 M. T. ‘zanni, L. ~hr, B. J. G~e~~b]~tt, R. Weinkauf, and D. M- Ne~mark, pr~~eed.

ings of the XIth Ultrafast Conference, Garrnisch-Partenkirchen, Germany, in press .

28 A. Einstein, Ann. Phys. 17, 132 (1905).

29 R. A. Millikan, Phys. Rev. 7,355 (1916).

30 M. I. A1-Joboury and D. W. Turner, J. Chem. Phys. 37,3007 (1962).

31 F. 1. Vilesov, B. L. I@rbatov, and A. N. Terenin, SOV.Phys. Dokl. 6,490 ( 1961 ).

32 J. H. D. Eland, Photoelectron spectroscopy: an introduction to ultraviolet photoelec-

tron spectroscopy in the gas phase, 2nd ed. (Butterworths, Boston, 1984).

33 J. W, Rabalais, Principles of Ultraviolet Photoelectron Spectroscopy (Wiley, New

York, 1977).

34 A. Weaver, Ph.D. Thesis, University of California, Berkeley (1991).

35 T. N. Kitsopoulos, Ph.D. Thesis, University of California, Berkeley (1992).

36 X. song, C. W. Willcerson, Jr., J. Lucia, S.. Pauls, and J. P. Reilly, Chem. Phys. Lett.

174,377 (1990).

37 J. M. Smith, X. Zhang, and J. L. Knee, J. Chem. Phys. 99,2550 (1993).

38 I. Fischer, D. M. Villeneuve, M. J. J. Vrakking, and A. Stolow, J. Chem. Phys. 102,

5566 (1995).

39 p. Ludowise, M. Blackwell, and Y. Chen, Chem. Phys. Lett. 258,530 (1996).

-. .. .. - -- v.:,----- .-,- ., ,. ....- .>l--’~-.,..- - ., J . -.. 14 Chapter 2. Experimental Apparatus

The femtosecond photoelectron spectrometer (FPES machine) is designed to collect time-dependent photoelectron spectra of anions. To accomplish this task, two fairly independent segments are coupled together: 1) a high-vacuum chamber, in which anions are produced and photoelectron signals detected; and 2) a femtosecond laser system, for producing and characterizing pulses of light at multiple wavelengths. Each is a highly complex apparatus, and will be described separately. Acquisition of data will be discussed last.

1. Vacuum system

The vacuum system consists of several differentially pumped regions, a drawing of which is shown in Fig. 1. Each region of the vacuum is labeled according to function and/or order of differential pumping: source, “zeroeth” differential, first differential, second differential and detector. Within the source region, anions are produced and cooled by crossing an electron beam with a supersonic gas expansion. Passing through a beam skimmer into the zeroeth differential region, the anions are extracted into a Wiley-

McLarenl time-of-flight mass spectrometer. The first and second differential. regions contain ion steering and focusing optics for controlling the position of the beam. Once inside the detector region, anions are intercepted by the laser pulses, which enter and exit the region through a pair of windows. After the anions have interacted with the laser, photoelectrons, neutrals, and possibly photofragment ions are produced. Photoelectrons are collected in a “magnetic bottle” time of flight energy analyzer, and detected with an electron detector at the end of a long flight tube. Ions or neutrals are detected by a Chapter 2 15 retractable detector, and photofragment ions are analyzed in an off-axis reflection/detector. Prior to laser interaction, anions may also be mass-selected and/or decelerated with a mass gate/pulsed ion decelerator, in order to improve photoelectron energy resolution.

Electron Time of Flitit Tube “

Pn~atic Gat&lve Source Region

Zeroeth 7Differential 1 [ Manual ElGate Valve (Diffusion) Turbomolecular Region Pumps Diffhsion Pump l--( Scale =l:16

Fig. 1. FPES vacuum apparatus.

...... ?-q<~,r-- . ,,s..-., ...... ;:..*,.. . . ;:.%:.>,,; :- - ....:..-... 16 Chapter 2 1.1. Pumps

“ The design considerations of the FPES machine are rather unusual. Pulsed ion beams have been shown to work well for photoelectron spectroscopy, but in order to take advantage of the high repetition rate (1 kHz) of the femtosecond laser, anions must be produced at a comparable rate. This introduces complications to the pumping - requirements of the system, as previous pulsed experiments in the Neumark Group run at

100 Hz or below. Each anion pulse generated involves the admission of a quantity of gas into the vacuum chamber, increasing the pressure, so the restriction to a working pressure of< 5X104 tom (both to prevent the diffusion pumps from stalling, and to maintain a viable electron beam) places serious constraints on the choice of primary pumps.

Although the amount of gas contained in each pulse can be limited by reducing the hole diameter of the gas inlet valve, a minimum quantity is still required to produce reasonable anion signals. The solution has been found in a combination of large pumps, small valve orifices, and an “extra” differential region (typical vacuum systems built by the group have only four differential regions) to reduce the effects on the rest of the system of an unusually large gas pressure in the source region.

The source region is pumped by a Varian VHS-10 diffusion pump (4400 L/s pumping speed), backed by an Alcatel 2063 direct drive mechanical pump [50 cfm (cubic feet per minute) or 23.6 L/s]. When present, the zeroeth differential region is pumped by a second Varian VHS-10, backed by a Sargent-Welch belt-drive mechanical pump (- 10

L/s). Otherwise, both Varian pumps evacuate the source region (backed by the Alcatel pump), for a total pumping speed of 8800 L/s. Maximum working pressure in the source Chapter 2 17 region is limited to approximately 5X10A torr, above which the diffusion pumps begin to stall, an undesirable (and messy) situation.

The first differential region is pumped by a Varian VHS-6 diffusion pump (1900

L/s), backed by an Alcatel 2021 direct drive mechanical pump (15 L/s). Typical working pressure in this region is lx IO+ torr. The second differential and detector regions are each pumped by a Varian V-250 turbomolecular pump (250 IA) and backed by a Varian

SD-300 direct drive mechanical pump (5 L/s). The second differential region maintains a working pressure of 2X10-8 torr, while the detector region maintains 1x10-9 torr.

Between each region is a 3 mm diameter hole (between the source and zeroeth differential regions, the hole is effected by a skimmer, whose diameter can be varied), which enables differential pumping. An electropneumatic gate valve separates the first and second differential regions. The source, zeroeth differential and first differential regions are referred to as the low vacuum region, and generally do not attain pressures below 1X10-8 torr because of the use of rubber o-ring seals and a generally oily environment. The second differential and detector regions constitute the ultrahigh vacuum region, which routinely attains 5X10-10 torr. All seals in this region use copper gaskets, and outgassing materials are kept to a minimum: a capacitor for each detector, and few resistors associated with the deceleration and reflection stacks. Any handling of materials to reside inside these regions must be done under extremely clean conditions, as a small amount of grease or dirt can spoil the ultrahigh vacuum environment. This region is usually baked for 1-3 days after initial pump-down.

.,. .,, - . ..>, ‘.):..,-?-”’” - 18 Chapter 2 1.2. Interlock

An automatic protection or “interlock” circuit is required for the automatic shutdown of the machine under unsafe operating conditions. Although a detailed description of the circuit will appear in the dissertation of Martin Zanni, who designed

“andbuilt it, a brief sumnmy of its functions is presented here. The interlock controls the power to the diffusion and turbomolecular pumps, electropneumatic valves and high- voltage equipment. Sensors including pressure gauges, temperature thermocouples (on the diffusion pumps) and speed regulators (on the turbomolecular pumps) enable the interlock circuit to safely turn off and isolate parts of the vacuum chamber, in order to protect sensitive equipment from damage, and neutralize any potentially dangerous (high temperature and/or pressure) situation. In addition, the vacuum system was designed so that, in the event of a power failure, key electropneumatic valves automatically vent the ultrahigh vacuum region to prevent the diffusion of mechanical pump oil into ultraclean regions. Without human intervention, when power is restored, the interlock keeps the system shut down since sensors then report an inoperable condition.

Fig. 2. Source and zeroeth differential regions – front view (on next page).

Fig. 3. Source and zeroeth differential regions – side view (on page 20). Chapter 2 19 .

, ‘* ‘“: I

., y~, 3------‘------Dr% IAW21’t

xtractio nPlate Zeroeth Source Differential Region Region

Diffision Diffusion Pump II Pump

I \ !

Scale 1:8 . .

20 Chapter 2

Caion Ultratorr Gas Inlet Electrical Fitting Feedthroughs Mounting Flange

Ill l\ I Ill Ill Ill I — I a Ill II Ii !:

— Source Region

Feedthroughs Skimmer ----- Ill — ,. + L I :.;. I I I I I T I ,, Deflectors 1 rst / ,xtraction Plate \ ff rential cceleration Plate’ R gion A Ground Plate— ~ ‘ m — Extraction Acceleration Region Region

— Zeroeth Differential Region

— — I I PI — 1 . Chapter 2 21 1.3. Source and zeroeth differential regions

The source and zeroeth differential regions are shown in two views, from the front in Fig. 2 and from the side in Fig. 3. The source region consists of a large, stainless steel box with two solid sides (bottom and rear) and four open sides, on the outside of which are mounted removable aluminum doors. This design both saves on the total weight of the’chamber, and offers maximum flexibility for modifications and access. Two 12“ diameter manual gate valves (Kurt Lesker) are bolted to the bottom of the source chamber, and under each of these is bolted a diffusion pump. The left side of the chamber

(as viewed from the front, looking toward the detector region) has holes drilled on the inside bottom and rear surfaces for mounting of a removable zeroeth differential region, which is described separately below. The right door of the chamber holds the electron gun flange, containing electrical feedthroughs and, on the inside, pairs of tapped holes for mounting and adjusting the height of the electron gun. The top door has several flanges for mounting the pulsed valve, Faraday cup, two sets of electrical feedthroughs, and an ionization gauge. Some electronic instrumentation (primarily the extraction/acceleration circuit) sits permanently on the top side of this door. The front door has a transparent acrylic flange for viewing inside the chamber while under vacuum. The left door is currently blank.

1.3.1. Pulsed valve

The pulsed valve, used to introduce gas into the vacuum chamber, is very similar in design to that used by the group’s Fast Radical Beam Machine (FRBM),2 and is originally based on the design of Trickl and Proch.s Briefly, it consists of a stainless steel cylindrical housing with coupling to the gas supply tube on the rear side, and an area on

,> ;.37..,,. < ...... ,. -,. ———._— _ ...

22 Chapter 2 the front for mounting a face plate with a variable diameter orifice. Inside the valve is a .

piezoelectric disk translator with a hole in the center, through which is mounted a poppet

shaft. This seals against the inside surface of the faceplate with an o-ring when the valve

is off, and is pulled back by the piezoelectric disk when voltage is applied, allowing gas

to escape through the orifice into the source region.

The valve body itself is made up of two sections bolted together and sealed by an

o-ring, and the faceplate, piezoelectric disk and poppet are all mounted to the front

section. This scheme allows the alignment of the poppet with the faceplate to be adjusted without the valve in place in the vacuum chamber; the front section can be mounted on a flange elsewhere on a source chamber door and adjusted from outside, while the front of the faceplate is under vacuum. Performance of the valve is monitored using a fast ion gauge (FIG)Z which is borrowed from another group laboratory.

Centering of the valve orifice with the beam axis of the mass spectrometer

(defined by the line of 3 mm diameter differential pumping holes separating each region

after the zeroeth differential) is critical to high ion signals, and this is accomplished using

a close-clearance positioning ring in one of two ways. With the zeroeth differential region in place, the ring is precisely mounted on the top plate of this internal chamber, and the valve hangs down from the top of the source chamber, resting inside the ring. Without the zeroeth differential region, the ring is less precisely mounted on a flange bolted to the

inside of the source top door, with the valve again hanging down from the top door, resting inside the ring. In this latter case, the internally mounted flange has been carefully

aligned, then left in place even when using the zeroeth differential region. Either scheme

allows for easy adjustment of the vertical position of the valve under vacuum, because Chapter 2 23 the tube connecting the valve to the outside is held in place with a Cajon Ultratorr

connection, which can be loosened slightly without significant air leakage.

The driver circuit for the pulsed valve was built by Martin Zanni, so no circuit

diagram is presented here; the design originates from the Hanna Reisler group at USC. It

- delivers a voltage pulse to the piezoelectric disk in a “shark’s fin” (RC decay) profile, in

order not to damage the crystal. The voltage can be adjusted up to 700 V, though

typically only 200 V are needed for a well-adjusted poppet. The duration of the high

voltage segment can be varied, but is generally kept as short as possible (150? p) while

allowing the valve to fully open. The valve is capable of running at a repetition rate well

over 1 kHz, though the optimal rate for producing anions has been found to be 500 Hz.

The only modification from earlier incarnations of the design for implementing this high

speed is the use of a higher current power supply, and a Bertan 205-OIR unit (1 kV, 30

mA) meets these requirements.

1.3.2. Electron gun

The electron gun (Fig. 4 and also Fig. 5) delivers a beam of electrons at 1-2 keV

to the gas pulse emerging from the pulsed valve, creating positive ions and slow,

secondary electrons which then attach to neutral molecules and cool in the ensuing

supersonic expansion. It is a continuous device, unlike most other source components. It

has been found that a fairly diffuse beam, aimed 1-3 mm below the pulsed valve orifice,

produces the highest levels of anions, though the exact conditions vary considerably with

the anion of interest. In certain instances, a pulsed discharge source (see, for instance,

Cyrz) produces higher anion intensities, but the production of 12-and 12-clusters, in

particular, have only been made successfully with the electron gun.

.,,.,.,, .,7,/,,. ”.. .,. =,..’ .. —-. -y<,:, . . . . ,,,.,,.~ .- ,.. 24 Chapter 2 I I

Vertical Deflectors Deflector { Y Voltage Supplies

Horizontal Deflectors { ( Einzel Lens Einzel Lens I Voltage Supply ( L- ...... , () Anode / : Voltage Supply ; Anode ~Protective {>A~ ~ Housing Filament Filament : ~’ Current Supply / l.-.------.------’

Electron Energy (} Voltage Supply — I I

Fig. 4. Electron gun schematic diagram.

The electron gun is modified from a “rejected” Tektronix oscilloscope electron gun to accommodate a custom filament mount and anode cup. Filaments are made of thoriated iridium powder on platinum ribbon, custom ordered from Electron

Technologies, Huntingdon Valley, PA. The filament and anode cup are floated at –1 to –

2 kV, passing a current of 5-7 A; an anode bias voltage of –30 V is typically used. An

Einzel lens, and horizontal and vertical deflectors, are used to optimally position the beam in the gas expansion. Bertan 205-05R high voltage supplies (5 kV, 5 mA) are used Chapter 2 25 for the float voltage and Einzel lens, while a 150 V Acopian A0150NT05 powe~supply is

used for the anode bias, and an Kepco ATE6- 10M current supply for the filament current.

The deflector circuits have been susceptible to large current fluctuations caused

by the electron beam nearby to the deflector plates, and as a result, the original circuit, in

which a voltage divider was used, had to be abandoned. The new circuit (Fig. 5), based . . on the anode power supply, uses Acopian AO150NX05 adjustable 150 V power supplies

to better deal with the high currents involved in maintaining a deflection voltage.

A copper Faraday cup (Fig. 2), mounted opposite the pulsed valve from the

electron gun, is used to measure the electron current, typically 100-500 pA. It is biased to

+9 V using a battery attached outside the source chamber. The cup is soldered to a %“

diameter copper rod, which passes through the top of the source chamber, isolated

electrically by an o-ring found in the Cajon Ultratorr connection. The cup can be

repositioned in the beam while under vacuum, in the same manner as for the pulsed

valve.

1.3.3. Zeroeth differential region

The “zeroeth” differential region, so named since it was built after the first and

second differential regions were completed, yet precedes both of them in the differential

pumping order, is a removable chamber mounted inside the source. Because of its wholly

internal location, it is awkward to measure the pressure, but an ionization gauge is

available in the arm of the roughing line. The purpose of the region is to reduce the

pressure in the vicinity of the extraction and acceleration plates, which is essential for

optimal focusing of the mass spectrometer. The pressure inside this region is typically

:!,,,-.::., .,. , ...,;. ,., -’.,.. ‘:,-..-,’ . ....-.’=+. “-: 1- — —

.. 26 Chapter 2

— — ...... 5V Ov Decimal OV& - point position { Datel DMS-30PL Digital Readout

‘~~~~ ...... ? CwCcw I – v out 150 v supply -s n Acopian n f #AO150’NX05 ‘s ...... c;...... +V Polarity =

~HotizontiDeflecta ...... S~~.h ...... ------...... 5V Ov Decimal OV (3-- - point position { Datel DMS-30PL Digital Readout 1 —— : lo-turn ~ ...... Cw Ccw {\ r -v – v out 150 v supply -s n Acopian n f #AO150NX05 ‘s ...... c:...... +V — Polarity = . ~eticdD.eflector ...... S~~h ......

Fig. 5. Electron gun circuit diagram. Chapter 2 27 -2.5-10 times lower than inside the source region, depending on the distance between the skimmer and pulsed valve. It has been shown to assist in the production of large IZ-(Ar)n and 12-(C02)~ clusters. The drawback of using the region, other than having a more cramped and less accessible source chamber, is that the maximum gas load in the source is reduced by approximately 2x, since only half the pumping capacity is available JO evacuate the source region.

The region is used in conjunction with a stainless steel skimmer, which is mounted directly under the pulsed valve and of which several sizes are available. Typical hole diameters used are 2-6 mm, the largest one being the most successful for the production of large 12-clusters. The distance between valve orifice and skimmer can be adjusted while under vacuum, as explained above in the description of the pulsed valve.

The valve mounting ring atop the chamber aligns the valve precisely with the skimmer.

1.3.4. Extraction and acceleration

Three stainless steel electrode plates (see Fig. 3) located in the zeroeth differential region serve to “extract” the cold anion plume into the time of flight mass spectrometer, which constitutes the rest of the vacuum chamber. (Technically speaking, when the zeroeth differential region is not being used, the extraction and acceleration plates are located in the source region.) A pulsing circuit, built by Martin Zanni and detailed in his dissertation, delivers rapidly falling (100 ns) high voltage pulses to the extraction and acceleration plates simultaneously; the third plate, serving as a partition between the zeroeth and first differential regions, is always grounded. The region between the extraction and acceleration plates is referred to as the extraction region, while the smaller region between the acceleration and ground plates is called the acceleration region. The

, . 28 Chapter 2 voltage on the extraction plate is more negative than the acceleration plate during the pulse, so that anions are accelerated away from the extraction plate, toward the detector region. The maximum voltage on either plate is currently limited to 2 kV, though it is

~traightforward to increase this limitation by adding extra 1 kV MOSFET stages. Typical voltages used are 1.3 kV for the extraction plate, and 1.0 kV for the acceleration plate. - . .

1.4. First and second differential regions

A diagram of the first and second differential regions is shown in Fig. 6. The first differential region consists of a stainless steel tee mounted on the back side of the source chamber, and a box mounted on the opposite side, extending into the zeroeth differential chamber. Mounted inside the box are a set of horizontal and vertical ion deflector plates, with wires ultimately connecting to feedthroughs on the top of the source chamber.

Mounted inside the tee, in the arm away from the source, is the first Einzel lens. A manual gate valve is bolted to the bottom of the tee, with the diffusion pump mounted underneath. The top flange of the tee holds an ionization gauge. The second differential region is separated from the first differential region by a pneumatic gate value. This region contains a set of deflectors on the side nearest the source, and a second Einzel lens on the side opposite. The top flange contains feedthroughs, and an ionization gauge, while the bottom flange holds the turbomolecular pump. A fifth flange is blank, to allow for access to components.

1.4.1. Ion deflectors

Both sets of deflectors are controlled by a circuit designed and built by Martin

Zanni, so the diagram will appear in his dissertation. In brief, each circuit consists of a Chapter 2 , 29 fixed, 200 V power supply connected to a potentiometer, arranged such that a dynamic range of –50 to +50 V is obtained by turning the potentiometer only; no polarity switch is required. This is an adequate range in virtually all circumstances, so the circuit has worked well. A digital readout is provided for each voltage, to aid in reproducing settings.

Pneuma ic

First I Deflectors

h J Region

First Second IllEinzel Lens , F.in7el-—.. T. ens.... 71 n-l JI Turbomolecular Pump+ Manual Gate Valve Second Deflectors

Difiion m~Pump Scale 1:8

Fig. 6. First and second differential regions.

1.4.2. Einzel lenses

The first Einzel lens is used to focus the ion beam in the plane perpendicular to

the traveling direction. A negative voltage of a few hundred volts (Bertan 355) applied to

the central plate is required for optimal ion signals. Intensity is fairly sensitive to the

voltage; in general, a value of 400-500 V is necessary. The second Einzel lens is not I

‘ 30 Chapter 2 typically used. This is not to say it has no effect on the ion signal; on the contrary, a

voltage of several hundred (negative) volts greatly increases the ion signal. However, this

improvement also seems to decimate the electron signal (when the laser is present), and

the best compromise seems to be to leave the lens at O V. This problem is not entirely

understood, but appears to stem from the different locations of the laser focal point and

the ion detector (about 21.5 cm); with the Einzel lens located only 25.5 cm away from the .

laser focus, the longitudinal focus can be quite different in the two locations. It is possible

that careful optimization of settings may well increase the electron signal above its

current performance level.

1.5. Detector region

The detector region is the heart of the FPES machine, where ion beams, laser

beams, electrons and photofragment ions all share space. It consists of two cross-shaped

chambers, and a long tube for electron time of flight. In the “detachment” chamber (Figs.

7 and 8), the left and right flanges each hold a set of laser windows and baffles. Mounted

in the front arm of the chamber is a mass gate/ion decelerator assembly, while the rear

arm contains a wire grid covering the entire area of the tube, to prevent stray fields from

the ion detector located behind the mesh from affecting electron trajectories. The bottom

flange contains electrical feedthroughs for the mass gate/ion decelerator, and a hollow

post extending close to the midline of the chamber, inside of which (outside vacuum) is a

set of removable, strong permanent magnets, constituting the bottom half of the magnetic

Fig. 7. Detachment chamber – front view (on next page).

Fig. 8. Detachment chamber – front view (on page 32). Chapter 2

I- .— t

I I

c r

i- -

I ===d -

P-- J

-

E1

-. ,.7,.,.. .,.,..”,.,.:, 32 Chapter 2 .

A

Electron Time of Flight . Tube

Mass Pulsed Gate Decelerator

Laser Interaction Region

111111111111111 ;;. / . . . = - Ion Beam --=---:8 . . . ----<=- mXw---- ”----””-- .. *-..! b ..;.. . : ,—, 1111 1 [1111111

Permanent Magnets Grounding Mesh El _!ll-

Electrical ;edthroughs ‘1 Jilt Al Ill Post

I I 111 111

Cajon Ultratorr Fitting Chapter 2 . 33

BNC Ionization Connector Gauge Electrical Feedthroughs

\o, :;

la -

t

I Reflection Ill _ Ion Detector Retractable ! Ion Detector Ion

!-i Grotiding Shield I

BNC Comector F 1 * Turbomolecular Pump Scale 1:4

Fig. 9. Reflection chamber. bottle. Above this is a 1.17 m long electron flight tube ending at an electron detector.

Outside vacuum, the tube is encased in a removable plastic cylinder wound with wire to create a weak solenoid, the top half of the magnetic bottle. Around the solenoid is a single layer of Hypernom magnetic shielding. The “reflection” chamber (Fig. 9) holds a turbomolecular pump on the bottom flange, reflection on the rear flange, and reflection 34 “ Chapter 2 ion detector, electrical feedthroughs, and ionization gauge sharing the top flange. A retractable ion detector is mounted on a small left flange, along with associated feedthroughs.

1.5.1. Laser windows and baffles

Suprasil windows, transparent to ultraviolet light down to -190 nm, are mounted on the ends of narrow tubes extending from the left and right arms of the detachment chamber (Fig. 7). Although the left (exiting) window is still mounted at Brewster’s angle to minimize reflections from vertically polarized light, the right (entrance) window has been replaced with a 2 mm thick window mounted nearly normal to incident light. This was done primarily to reduce the thickness of glass encountered by the laser as much as possible. It also gave flexibility if horizontally polarized light was desired, though the reflection of oppositely polarized light from a Brewster’s window is only - 15%. The reason for using a thinner window stem from group velocity dispersion (GVD) or broadening considerations of femtosecond ultraviolet pulses, which are discussed in section 2.1.

A baffle tube is mounted inside each, arm. The tube is black anodized aluminum containing a set of three baffle disks, also black anodized aluminum, with a %“ hole drilled through the center, one side chamfered to forma knife edge at the rim. The disks in the tube nearest the laser beam, as well as the two innermost disks in the tube away from the beam, are oriented with the knife edge pointing toward the laser (chamfer in back); the remaining two disks in the far tube are oriented pointing away from the laser

(chamfer in front). The purpose of the baffles is to reduce scattered light from the edges of the laser beam, which maybe blotchy, or overall defocused. It also aids in aligning the . Chapter 2 35 laser beam, as a narrow range of input angles can actually get through to the other side.

The main method of laser alignment relies, however, on a pair of reference pinholes separated by several meters, located on either side of the vacuum chamber.

-1.5.2. Retractable ion detector

All three charged-particle (ion, reflection ion, and electron) detectors utilize a pair of microchannel plates held at high positive voltage, which, when struck by an anion or electron, generate an electron cascade whose current can be measured on an ordinary oscilloscope. These high performance devices require a 1-2 kV potential, producing signals with a rise time of -1 ns.

The ion detector (Fig. 10) consists of a front wire mesh (grid) held by a metal sandwich; the microchannel plate pair (Galileo 1390-2500, 25 mm dia.) consisting of front and rear mounting rings, and a thin loop inserted between the plates; and the anode.

The entire assembly is connected together via three sets of insulating vespel spacers compressed together with loose springs, and bolted to small metal cylinders; the cylinders are then held in place on a mounting plate with set screws. The voltage of the grid can be switched negative to repel ions and detect fast-moving neutral molecules, but it is otherwise kept at O V. Each of the remaining four components is connected outside the vacuum chamber by a resistor chain, with the front plate held at O V, and the anode held at+ 1.5 kV. In order to measure signals at a safe DC voltage, the anode is capacitive y coupled inside the vacuum chamber to a separate BNC signal connector.

When the machine was first built, the ion detector was mounted on the back flange, behind the reflection, but this location was discovered to be too far from the laser interaction region (55 cm) to allow for optimal ion focusing. Therefore, the entire

‘,.>,,,., ,. ..-

36 Chapter 2 detector has been designed to retract via ultrahigh vacuum baffles-sealed translator arm

(MDC Corp. SBLM-133-4), which moves the assembly entirely out of the way of the ion beam so that reflection experiments can be performed, but otherwise allows the detector to sit much closer to the laser beam, 21.5 cm.

spring I I . I A/ I n 1 1 ...... Grid GRID -Hv ■ k ▼t ■ ‘ 2MC2 t MCP1 I F I .B~u:2Mn ■ 9 a LOOP 1 ■ 1 / /- ¤~. Insulating MCP2 Spacers b \\ 9 1

■ ■ \ ✚ loom I 50 m ANODE +Hv ■ ■ I n

II -5000 pF H II ❑ o ~ 3 kV •1 n — 1000 pF u 6 kV n H M n Signal L, II BNC “ I t

I I Vacuum 1 Atmosphere

Fig. 10. Ion detector schematic diagram. Chapter 2 37 1.5.3. Magnetic bottle

The magnetic bottled’s is designed to collect a large (>50910)fraction of photoelectrons while preserving electron energy resolution as much as possible. This is accomplished using two elements: a stack of strong permanent magnets (3000 G surface field) located 9.5 mm below the ion beam axis, and a weak solenoid (20 G) beginning approximately 7.6 cm above the beam axis and continuing for 1.17 m, past the electron detector. The field at the laser interaction point is difficult to measure precisely, but is estimated to be -1000 G. Electrons in a magnetic field will precess about the field lines, so that as the field changes, the radius of the orbit will increase or decrease accordingly, along with a change in the orbital velocity. Since total energy must be conserved, the forward velocity of electrons headed toward the increasing magnetic field will eventually become zero, resulting in reflection (the so-called “magnetic mirror” effect).G All electrons traveling along field lines which intersect the electron detector are therefore collected.

The permanent magnets are a samarium type (Edmund Scientific) in two cylindrical shapes: 1“ dia. x 0.38” thick (part # 30963), and 0.5” dia. x 0.20” thick (part ##

5286 1). The arrangement producing the highest electron yield appears to be when they are stacked on top of one another, the 8 small ones on top of the 3 large ones. However, detection efficiency is not critically dependent on this set-up. The stack is glued to an

aluminum shaft and the entire post then secured inside the hollow tube with a Cajon

Ultratorr connector. Nonmagnetic stainless steel is used in the construction of all parts of

the ultrahigh vacuum region. The solenoid consists of a removable plastic tube which is

placed around the electron flight tube. One layer of Hypemom magnetic shielding

;:,.: ,-~,.;, .:;, , .. ._,:,. ,, -.., ,.- ..”7J 38 Chapter 2 surrounds the solenoid, to reduce extraneous magnetic fields. Coated copper magnet wire

(14 gauge) is wound at 10 turns per inch (3.94 turns per cm) for the entire length of the tube. A Kepco high current power supply (ATE25-4M) maintains an adjustable current of up to 4 A. The magnetic field B at the center of the solenoid can be calculated by: “

- “B=~nI (1)

● where ~ is the magnetic permeability (4nx10-7 H m-l), n is the coiling density

(turns/unit length), and 1 is the current. Thus, a current of 4 A produces a field of 20 G.

The choice of wire thickness was based on the maximum voltage of the power supply (25

V). We find, for a -350 m length of wire, a resistance of 4.5 !2, which produces a voltage of 18 V at 4 A, well within these limits. The heat dissipated, 72 W, is not found to be significant over the length of the solenoid.

Although it is not trivial to calculate the field surrounding a permanent magnet, such calculations have been done for similar magnetic bottles using an electromagnet

(solenoid) in place of the permanent magnets The combined magnetic field of the strong and weak solenoid fields is found to be highly divergent in the vicinity of the ion beam, the key to the magnetic focusing property. Electrons produced at this “focal point” through photodetachment are repelled by the converging field near the strong magnet, and orient themselves along lines of the field as they travel toward the electron detector.

1.5.4. Electron detector

The electron detector (Fig. 11) uses a pair of large, 75 mm diameter microchannel plates (Galileo 1396-7500) to increase the electron collection area. They are mounted on the top flange of the electron flight tube, behind a wire mesh which is directly bolted to Chapter 2 39 I I I H ■ I —

Insulating Spacers I

■ 1 1

■ 1 I

■ ■ I I ~ I •1 ❑ — 1000 pF I I 3 kV I B M, 10X Anplifier Signal I I I Ortec 9301 BNC I 1 I

I Vacuum I Atmosphere

Fig. 11. Electron detector schematic diagram. the sides of the flight tube, allowing electrons below the mesh to experience an

(electrically) field-free region. The microchannel plates are held together via front and back mounting rings only; the middle loop is absent since the plate resistances have been matched, allowing a single voltage to be applied across the pair. Behind the plates is an anode. The assembly is connected together using vespel spacers and loose springs, as for the ion detector. The three components are connected outside the vacuum chamber by a

,, .,- :,.,. .;?.- ,: 40 Chapter 2 I resistor chain, with the front plate at OV, and the anode at –2.2 kV. The anode is capacitively coupled inside the vacuum chamber to a BNC signal connector. A 10x fast preamplifier (Ortec 9301) is used just, outside the vacuum chamber to boost the signal prior to digitization.

1.5.5. Mass gate

The mass gate is used to admit a narrow time slice of ions through to the rest of the spectrometer, which is necessary for both the pulsed ion decelerator and reflection. It consists of three stainless steel plates, each with a grid of fine wires to ensure uniform electric fields, mounted on the same assembly as the ion decelerator (Fig. 8). Normally, the middle plate is held at high negative voltage to repel all ions, but when the ion packet of interest approaches the first plate, the potential is quickly and temporarily dropped to ground to allow admission. After the packet clears the third plate, the potential returns to high voltage.

The success of such a gate relies heavily on a pulsing circuit capable of delivering rising and falling edges of- 100 ns (see dissertation of Martin Zanni). It also requires the close spacing of plates. If the distance between plates is large, a greater amount of time must be spent with the gate “open” (at ground potential), with the consequence of lower mass selectivity. For an assumed mass resolution of 300 and a time of flight distance of

1.3 m, the spatial extent of an ion packet at the detector is 4.3 mm; it will be slightly larger at the mass gate. The distance between the first and last plate of the mass gate, 6.2 mm, is comparable. For a typical flight time of 50 p-s, the ions spend 240 ns inside the gate, within the capabilities of the pulsing circuit. Chapter 2 41 ‘ 1.5.6. Pulsed ion decelerator

The decelerator consists of a stack of 11 plates spaced 1/8” (3.18 mm) apart, with grids on the first and last plates, and a resistor (1.5 kfil) joining each plate together; see

Fig. 8. The first plate (closest to the source region) is also apart of the mass gate, being normally grounded. The last plate (closest to the ion detector) is permanently grounded.

Once the ions have passed the first plate, it is pulsed to high positive voltage, and it is grounded again before the ions pass the last plate. The response time of the plates, -150 ns, is slightly slower than that of the driving circuit, owing to some capacitance of the stack, but as 1 w or more is typically needed to decelerate the ions with a 2 kV potential, this is adequately fast. An example of the deceleration capabilities is presented in the section on resolution of photoelectron spectra, described below.

1.5.7. Reflection

The reflection (Fig. 9) consists of 12 rings, 4“ in diameter with a 2.5” diameter hole, separated by %“ long insulating Vespel spacers. Each plate is connected electrically by a 2 Mi2 vacuum-compatible resistor (K&M Electronics, CR1 243 G2MOOG3), with the front plate grounded, and the rear plate held at a high negative voltage. The front and rear plates contain mesh grids to ensure a uniform electric field across their entire surfaces.

Anion photofragments entering the reflection experience a retarding electric field which ultimately reflects them back out. The reflection is tilted upward by 4.5°, redirecting the path of the ions toward the detector located above the beam axis.

....=. ., . ~...:.“ .-..:./; .,.<,.., ,. /.: L 42 Chapter 2 n ■

¤~a: . ,~, : Insulating Spacers

■ m t

■ t I w t ■ ■ t — 5000 pF t 3 kV ❑ t I 5000 pF •1 t —— 3 kV t M t I u: Signal t BNC t t B Vacuum I Atmosphere

Fig. 12. Reflection detector schematic diagram.

The reflection ion detector (Fig. 12) is similar in design to the retractable ion

detector. It consists of a pair of 25 mm dia. microchannel plates (Galileo 1390-2500) held

together by front and rear mounting rings, with a thin loop inserted between the plates;

behind this assembly is the anode. Components are connected together with three sets of

insulating Vespel spacers compressed by loose springs, and bolted to small metal

cylinders; the cylinders are then held in place on a mounting plate with set screws. Chapter 2 43 Outside the vacuum chamber is a resistor chain connecting the plates electrically. The front MCP is grounded, while the anode is held at –1.5 kV. The anode is capacitive y coupled inside the vacuum chamber to a separate BNC signal connector for measuring signals. The entire assembly is housed inside a grounded cylinder to electrically shield it from the anion beam, which passes underneath it only W’ away. The detector is tilted downward by 9°, so that the detector face is normal to the reflected photofragment beam.

1.6. Timing

The FPES experiment is pulsed. Anions are created, cooled, extracted, focused, excited and detached by laser beams, and electrons detected, at up to 1 kHz. Therefore, the careful control of different timing elements in the system is essential for a successful experiment.

Because the femtosecond laser is passively modelocked, it cannot be triggered by an external signal, but must instead be used to trigger other parts of the experiment. The

NJA-5 oscillator triggers the Clark-MXR DT-505, which drives the Pockels cell at a greatly-reduced repetition rate (500 Hz). The Sync 3 output from the”DT-505 serves as the primary trigger for the molecular beam segment of the experiment. From this trigger, two Stanford Research Systems DG535 delay generators (“Stanford boxes”) are used to coordinate several devices: pulsed valve driver, extraction and acceleration circuit, pulsed discharge circuit, mass gate circuit, pulsed deceleration circuit, New Focus optical chopper, ion oscilloscope, and an analog-to-digital (A/D) converter for recording autocorrelation and cross-correlation signals. The multichannel scalar (MCS) for collecting electron time of flight spectra is separately triggered by the DT-505 (Sync 2), which is almost coincident (few ns delay) with the arrival of the laser pulses in the

.. 44 Chapter 2 detector region. Although needs change slightly depending on the task at hand, an overall schematic’ diagram illustrates the general timing approach of the experiment (Fig. 13).

I I -.s.illoscow

1 I sync 3

A A/D Converter

B TO Stanford Pulsed Discharge 4 Box #1 c Extraction/Acceleration, Chopper, Oscilloscope, Stamiiord Box #2 D L T Pulsed Valve AB Mass Gate

TO Stadord — Box #1 CD Pulsed Deceleration

Fig. 13. Timing signals of the FPES experiment.

1.7. Ion time of flight

The spacing of plates in the extraction and acceleration regions, and the electric fields in each region, critically affect the focusing of the spectrometer, which is Chapter 2 45 monitored by the sharpness of features at the ion detector. Wiley and McLaren 1first derived the equations needed to determine these parameters for an idealized mass spectrometer, assuming negligible initial kinetic energy to the ions, where D is the distance between the ground plate and the ion detector:

(2)

SE +dE~ ko=os. (3) SOE,

Here so and d are the distances the ions travel in the extraction and acceleration regions, and Es and Ed are the electric fields in each of these regions. Since the pulsed valve is centered over the extraction region, the width of this region is 2s0, and so only represents an average distance traveled by the ions. Note that D is independent of ion mass, which is a key advantage of the design. Using typical parameters for the machine (2s0 = 6.35 cm, d

= 2.54 cm, E, =50 V/cm, Ed= 400 V/cm), one obtains a focal point of 1.18 m, close to the measured distance of 1.3 m. However, in reality it has been found that the anion spectrum is slightly dependent on mass, requiring a larger extraction field to focus heavier anions.

The overall resolution M,= m/Am of the spectrometer depends on the spread of ion energies, which is in turn determined by the spatial spread As of the ions in the extraction region:

2 M,= 16ko()& . (4)

Without a skimmer, As maybe as large as 2s., the width of the extraction region, giving

M,= 30 in the current setup. However, ions are typically not distributed uniformly across

-,. ,,-- ,, ..<.”y,.:>{,j&,-., ,t., ,. ... :,‘T,; 46 Chapter 2 the extraction region, and we find MS = 200 under typical operating conditions, implying

As= 2.5 cm. With a skimmer, As may be smaller, producing better resolution (M, = 400).

Ions of mass m arrive at the detector at time fi

2kO~ T= 1.02cm-*amu-*eV*W & 2kO~s0+— (5) /@+ld+D m(on ) Uj~~– qs&~ + qdEd (6) where q is the charge on the ion, and UiOflis the total ion kinetic energy.

Because distances are not known precisely, a mass spectrum is generally calibrated from the measured arrival times of two known masses using the simpler equation

m = S(T– to)2 (7) where S and to are empirically determined slope and intercept parameters. A sample mass spectrum is shown in Fig. 14(a). The spectrum was obtained from an 12/Ar/C02 expansion mixture, and calibrated from two known points, 12-and Iz-(coz)lb. The dominant masses are 12-(CO& and (C02).- clusters, as well as 12-(C02).(H20) and

(C02).(H20)- in smaller amounts. Fig. 14(b) shows an expanded view in the vicinity of

IZ-(COZ)16,where the various CIUSterprogressions can be seen clearly. As this spectrum was focused for Iz-(COz)l& the mass resolution is highest in this region, about 370. Chapter 2 47 0123456789 10111213141516171819 , I,-(co,)” (a) I I I I I I I I I I I I I I I I I I I 567891011121314 15161718192021222324 2526 I I I I I I I I I [ I I I I I I I i I I I , (Q)n- 0123456789 10111213141516171819 12-(C02)n(H20) I I I I I I I I I I I I I I I I I I I I 567891011121314 15161718192021222324 25 (co,).-(H*o) 1 I I I [ I I I I I I I I I I I I I I I [ I

200 400 600 800 1000 Mass/amu b) (cp- (co,),,-@o) (Cc),)z- (CQ)Z-(J320) L-(CW5 12-(COJ,6 L-(co*),, ‘i .~o) ~ h 1!K6;”

“ A.JI ! -A1 Aml

900 920 940 960 980 1000 Mass/amu

Fig. 14. Sample mass spectrum for an 12/Ar/C02 expansion. (a) Full spectrum. (b) Expanded view near 958 amu [IZ-(COZ)lG],showing cluster progressions.

1.8. Electron time of flight

Electrons photodetached at the laser interaction region initially travel in all directions, but the magnetic bottle forces them to turn toward the electron detector, where they travel with constant electron kinetic energy (UJ which can be measured by the time of flight technique:

u, .&= mJ-2 (8) 2 2(t – to)2 where me is the electron’s mass, Veis its absolute velocity, t is its arrival time, to is the laser firing time, and L is the length of the flight tube. The quantity t– tois the time of flight. In general, to and L are empirical quantities which must be determined from

.:. . . .. ,.,. ..,---. .- .; .. .> . >..----. 48 Chapter 2 calibration. Typically, r is used for this purpose; it displays two atomic transitions (I

‘P3i2~ r lSOand 12P1/z ~ r lS.) split by a roughly 1 eV spin-orbit energy. Using the third harmonic frequency of the laser (260 rim), the electron kinetic energies of these transitions are 1.709 and 0.766 eV, respectively.

1.8.1. Resolution

Several factors affect the resolution of the electron spectrometer. The most significant is ion velocity viO~,which is added as a vector to the center-of-mass electron velocity v~cm,giving the apparent electron velocity in the laboratory frame v~:

(9)

The largest difference in velocities is twice the ion velocity: Av~= 2U0.. The resulting spread in the laboratory frame electron kinetic energy AU~ is:s

meuecmuion AU. = ~eVecmAVe = hev$rnvion = 4 (lo) J m,On where UiOn,U. and U.cmare the kinetic energies of the ion, laboratory frame electron and center-of-mass frame electron, respectively, and rn,Onis the mass of the ion. Typical parameters are Uecm= 1 eV, UiO~= 1200 eV and mlO.= 254 amu (12-), giving AU. = 200 meV. However, this spread can be reduced significantly by decelerating the ion beam; this will be dealt within the following section.

Since the apparent electron kinetic energy is changed so significantly by the ion velocity effect, an instrument reponse function was derived, for an isotropic electron angular distribution. The probability p of finding an electron with lab energy Ue,based on a center-of-mass energy Uecm,is: Chapter 2 49

p(ue, Uecm)= (11) /1-4m&u:m[ue-uJm-~]

Note that the offset, meUJmio., is generally very small (2.6 meV using the above parameters) in comparison to U. – U.cm.

Another source of resolution loss is the finite time required for electrons ejected in a direction away from the electron detector to be reflected by the rapidly converging - magnetic field lines near the permanent magnet. The time spread At is proportional to 1/v. or l/U.* ’2. Since from Eq. 8, U. cc l/t2, we find that

(12)

Thus, the relative uncertainty AUJUe is independent of energy. It is difficult to calculate

At exactly, but in a similar magnetic bottle spectrometer which used a second solenoid in place of the permanent magnet, the magnetic fields were known exactly, and trajectory calculations were performed.5 They obtained At = 45 ns eV1’2/U~l’2which gives AUJU. =

4% using our flight length.

After reflection by the magnetic bottle, electrons do not point precisely toward the detector but precess with a small angle about the magnetic field axis of the solenoid. The maximum value of this angle %m depends on the ratio of initial to final magnetic fields, referred to as the “degree of parallelization”:s

(13)

where Bi and Bf are the initial and final magnetic fields, respectively. The effect of ~rnax on resolution is to retard the arrival of an electron, resulting in an energy uncertainty of

... :.,.”,. ,. ,-- .,.-,,.,;., ,..:. -,-,,- :-.,<.,,-, .,. ,. ,. :...... \ .’. . 50 Chapter 2 AUe _ Bf —_— (14) ‘ U. Bi “

The field at the laser interaction point, -1.0 cm above the top magnet, is not known precisely, but is estimated to be -1000 G. The final field Bf used is 20 G or less. Thus,

AUJU. < -2?40.

The factor which most limits resolution in more traditional photoelectron spectrometers is the uncertainty in timing arising from the finite pulse duration of ns lasers, the interaction volume of the ions, and changes in flight length due to differences in beam position. The minimum time duration of the digitizing electronics is generally not an issue. For the FPES machine, the laser pulse duration is obviously not a limiting factor, but the other two items must still be considered. The size of the interaction volume of laser and ion beam is on the order of 3 mm, the differential hole diameter. Changes in laser beam position are probably smaller than 3 mm. The energy uncertainty is:T

2ueAL AUe = (15) L“

Thus, with AL= 3 mm and L = 1.3 m, AUJUe = 0.5$?0,a very small effect.

1.8.2. Pulsed ion deceleration

In order to improve electron kinetic energy resolution, it is necessary to reduce the ion velocity and therefore the electron velocity offsets. Simply running at a lower ion beam energy is not feasible, since these energies are required for focusing in a reasonable flight distance, minimizing the importance of intrinsic kinetic energy of the beam, minimizing the effects of stray fields, and efficient ion detection. Therefore, the ions must be decelerated just prior to interaction with the laser beams. Chapter 2 51 The most straightforward scheme for accomplishing this would, at first glance, seem to require only a static retarding electric field prior to laser photodetachment, with appropriate rereferencing of the beam either before or after deceleration. This was the approach taken in some of the first magnetic bottle photoelectron spectrometers.s

However, the kinetic energy spread of the ions inherent in the Wiley-McLaren time of flight scheme, often 10% or more of the total energy, makes this approach impractical if significant signal levels are needed, because the energy spread is the same before and after deceleration:

Ui= UiO.+ q&E~ (16)

Uf= Ui– qxEx (17)

AUi = AUf = qNE~ (18) where Ui and Uf are the initial and final ion kinetic energies, respectively, x is the length of the deceleration region, and E. is the deceleration field.

A better deceleration technique, known as “impulse” or “momentum” deceleration, employs a retarding electric field applied to the ion packet for a finite amount of time txwhile inside the deceleration region:

@xL Vf =vi– — (19) m,On

viAUi Avf= Avi = — (20) 2U,

2uJAvf =~AUi = u AUJ = ~AUi ‘f vi J Ui

where vi and vf are the initial and final ion velocities. Thus, the spread in velocities, rather

than energies, is preserved, resulting in a much smaller final energy spread AU’

...... ,.. . , :-----. .-...,3,7 .,.,.. . ,,. 52 Chapter 2 3500 ———. —... 2 P 2 1/2 P 3000 3/2

“: 2500 2’ 1 .-g 2000

500

! 0 --!?’!!o 0.5 1 1.5 2 2.5 Electron KineticEnergy/eV

Fig. 15. Sample photoelectron spectra of I_ obtained (a) without ion deceleration, and (b) with ion deceleration.

As a demonstration of the deceleration properties of the spectrometer, Fig. 15 shows a spectrum of r (127 amu) measured both with and without deceleration. With a

photon energy of 4.71 eV, both spectra display two peaks, at 1.65 eV (I 2P3/2+ r lSO) and 0.71 eV (I 2P112~ r lS.). The undecelerated electron kinetic energy widths are 450 and 240 meV, respectively, consistent with the known beam energy Ui= 1400 eV. The initial energy spread AUi is estimated to be 100 eV. The decelerated spectrum displays energy widths of 100 and 45 meV, respectively, a roughly 5-fold decrease, indicating Uf

=55 eV and hence AUf = 20 eV. Chapter 2 53 1.9. Reflection ion time of flight

The reflection operates on the principle that the kinetic energy of a parent ion U,On is shared among photofragments according to their masses mfn~, so that the velocity of each fragment vfn~is unchanged:

Vfrag= V,on (22)

Ufrag= + mfragvionz=y (+nqnvion’) =~uion (23) Ion m,On where viO~and miO~are the parent ion velocity and mass, respectively, and Uf~~is the fragment ion kinetic energy. The uniform retarding electric field of the reflection serves to separate ions of different kinetic energy by allowing them to penetrate to different distances r (< 15.2 cm, the full length of the reflection) before being reflected, exiting the reflection with the same energy as they entered:

u frag r.— (24) qE, where E~is the electric field of the reflection. The reflection is tilted so that the beam exits at an angle 8 (9°) with respect to the incoming beam, directing the reflected ions toward an off-axis detector. The primary time-of-flight focus (at the laser interaction region) occurs at a considerable distance from the entrance to the reflection, unlike the setup described in Lineberger and coworkers,g where the focus is very close to the reflection front plate. Therefore, the time of flight T between the primary focus and arrival at the detector is modified slightly from their equation:

–+ ~_ 2mfm~sec(d / 2) 2uinn ~ 2uion — +( Dl+D2secf3) — qE, [1m,nn [ m,On)- -.

54 \ Chapter 2 2000 —. .——. -——.— — .———. —. . . . 1 2 ; I,”(CO,)n‘ ~

1500 4 ~65 I-(COJn

-g 1000 g < ~> .—Cn as —-E 500

0

.500 122 124 126 128 130 132 134 Flighttimehs

Fig. 16. Reflection ion spectrum for the 780 nm photodissociation of Iz-(COz)&

Here D1 is the distance from the primary focus to the reflection entrance, and D2 is the

distance from the reflection entrance to the detector. Note that T is linearly dependent on

mf~~.The secondary focus at the reflection detector is obtained when dT/dUiOn= O (here

recognizing that sec El= 1.012 = 1): Chapter 2 55 4ufrag DI+D~=— = 4r. (26) qE,

With Ill =38 cm and D2 = 3 cm, r = 10.3 cm, about 70% of the reflection length. Note that, for optimal focusing, E, must be adjusted for each fragment ion.

A sample reflection spectrum of the 780 nm photodissociation of IZ-(COZ)8is shown in Fig. 16. Both 12-(COz)~ and r(CO& photofragments are visible, as two sets of progressions. Because r (127 amu) has approximately the same mass as 3 COZ molecules

(132 amu), the 12-(C02). and r(C02). peaks are quite close to one another, but they are easily resolved. The focus is optimized for r(COz)5, which has a resolution MS= 130.

2. Laser system

The femtosecond laser system occupies the full area of a 4 ft. x 12 ft. laser table

(Newport-Klinger RS 2000). In addition to the Clark-MXR femtosecond laser, there are several other commercial and home-built components: beam pointing system, harmonic and parametric frequency generation, translation stages, autocorrelators, beam chopper, and coupling to the vacuum system. This section covers all these components in detail, as well as necessary theoretical background.

Figs. 17 and 18 show the layout of the laser table. The Clark-MXR laser system occupies approximately the full width and first (farthest from the vacuum chamber) 8 feet of length of the table. The system consists of six components, described below in more detail. After the amplified laser beam emerges from the pulse compressor of the system, it encounters beam steering optics, which include a pointing stability system called

Pointmaster. The beam is then split at the first cinematically mounted, removable beamsplitter (typically 50% reflection), and the reflected light is directed toward the

., - ...... ,...... -, ...... 56 Chapter 2 fundamental frequency segment of the table. The transmitted light continues on to a

second cinematically mounted, removable beamsplitter (typically 70% reflection), which

directs a portion of the beam into the Quantronix TOPAS optical parametric amplifier

(OPA). The light transmitted encounters additional steering optics before entering the

CSK Optronics harmonic generator, which produces both second and third harmonic

frequency laser light.

The fundamental frequency segment includes, first, a half-wave plate, rotating the

polarization from horizontal to vertical. The beam next encounters a glass window,

antireflection-coated on only one side to provide a small (4%) reflectance, mounted on a

“flipper” (New Focus 9891, allowing rotation in and out of the beam with kinematic

reproducibility). This reflected beam is used by two of the three autocorrelators for

monitoring the temporal width of the laser pulse. Both autocorrelators share the same

detector; the slow-scan autocorrelator signal is directed along the same path as the fast-

scan autocorrelator using another 50% beamsplitter (not shown). The part of the beam not

reflected by the glass window continues on to a flipper-mounted mirror, directing the

entire beam toward the single-shot autocorrelator. When this mirror is rotated out of the

way, the beam continues through a long delay line, and then into a retroflector mounted

on a translation stage. After emerging from the retroreflector, it is directed through a

periscope, which raises the height of the beam to the level of the vacuum chamber laser

window.

Fig. 17. Laser table layout – overview (on next page). NdYAG Laser Oscillator

Ar+ Ion Lase, “

Legerative Pulse Amplifier Stretcher

Pulse Compressor

Harmonic Generation and Diagnostics Area

Scale 1:16 58 . Chapter 2

, ..

Pointmaster photodiodes Pulse Compressor

— A12 Ii ~’>; Fast scan N: auto- 1: . 1. . correlator 1: 1. Super Tripler 1= I s:1: II Slow scan 1. 1: t k : 1, Joint :: 1 . etec I :: \/ I . . tor =- t [ :: ■ t - / :: Translation [ + II■ - ~~ .----.--- \ --+.:1 stage #1 . .. H 3 Translation stage #2 ~;~: =.s .m. I _ =.. , T *\ 1 “’.:: =. . 1

t Single-shot

t auto-

~/ correlator

I Pekscopes to laser window level — Fundamental beam ------Second harmonic beam ==”==”=====”””T.hird harmonic beam ---- TOPAS beam Scale 1:8

Fig. 18. Laser table layout - close-up. Chapter 2 59 The output from the TOPAS OPA encounters a pair of beam separation mirrors designed to reflect only the desired frequency. This beam is then directed into another periscope to laser window height. The harmonic generator outputs are similarly directed into periscopes, but the second harmonic frequency beam is first sent into a second, translation stage mounted retroreflector, and the third harmonic frequency beam is sent- through an optical delay line prior to the periscope. The purpose of the delay lines is to synchronize the arrival time of each beam inside the vacuum chamber at some translation stage position.

Once all the beams are collinear at the laser window height, they are directed into the vacuum chamber (see Fig. 24 below). A set of beam combining mirrors allows lower frequency beams to pass through each mirror which reflects a given higher frequency beam. The beams encounter a long focal length (50 cm or 1 m), uncoated lens, just prior to passing through the laser window. On the other side of the vacuum chamber, they emerge and propagate toward the far wall of the laboratory, though usually they are blocked just beyond the exit window.

2.1. Principles of nonlinear optics

Femtosecond laser pulses are characterized by large frequency bandwidths as well as very large peak intensities, both of which tend to push their interaction with optical components into a “nonlinear” response regime. The frequency spread leads to temporal broadening and other pulse distortions, while the high intensity is responsible for efficient harmonic generation, self-phase modulation, self-focusing, and easily damaged materials.

Information presented in this section is taken from both Diels and Rudolph,9 and Shen. 10 60 Chapter 2 The electric field of the laser pulse is usually broken into a slowly-varying envelope function, and an exponential phase function, in both the frequency and time domains, related through Fourier transformation:

E (co)= E(o) ei$(m) (27)

~ (t) = E(t) ei$tr)e@r = & ~~(co)eiadco (28) where ~ (o) or ~ (t) is the complex electric field, E(m) or E(t) is the envelope function, and O(O) or ~(t) is the phase function. In the time domain, the carrier frequency coOis used to remove the high-frequency oscillations in the phase, and is somewhat arbitrarily chosen; for symmetric pulses (Gaussian or sech profile), it is usually the average frequency.

It is convenient to refer to the phase in terms of elements of a Taylor expansion:

$((!3)= p-?mo)loo((B- a),)” (29)

()(t) = ~+(”yt)l,o(t-to)” (30) ~=o n. where $“)(o) = d“@/d6)~and @(~)(t)= dn@/dt”are the nth derivative functions, and to is, like

~, a reference point centered in time on the pulse. In the absence of nonlinear distortions, an optimally shaped femtosecond pulse will have contributions from then=O and n = 1 terms only. $2) is referred to as the “chirp” of the pulse, which is sometimes expressed in terms of an instantaneous frequency:

o)(t) = Q + @l)(t) (31) Chapter 2 61 Thus, doI(t)/dt = d$(’)(t)/dt = $(*)(t) # O for chirped pulses, indicating that the instantaneous frequency changes with time. “Up-chirp” refers to an increasing frequency sweep or @(*)(t)>0, while “down-chirp” refers to $(*)(t) <0. Higher-order phase distortions, e.g. 0(3)# O etc., are also possible.

The propagation of light through a medium is only possible because of the

“sympathetic” oscillation of atoms or molecules in response to the incoming electromagnetic field. This response is expressed by the polarization P of the medium. In the limit of a weak radiation source at a frequency far from any resonances, P is linearly proportional to the vector electric field E:

P(o) = ~(l)(@E(@ (32) where ~(l)(co) is the (3x3 matrix) linear polarizability of the medium, related in the isotropic case to the index of refraction n(co) by:

n2(o$ = 1 + 4z~(’)(@. (33)

For a sufficiently strong incoming field, this linear approximation breaks down, and nonlinear dependencies on the electric field must be considered:

P(o) = ~(])(@”E(co) + ~(2)(o$:E(m)E(@ + ~(3)(@:E(0)E(co)E(o$ + . .. (34) where ~(2),X(3),etc. are higher-order tensor polarizabilities of the medium. These higher- order terms are responsible for radiation at new frequencies (20, etc.), and will be dealt with in the section on harmonic generation. For a femtosecond laser pulse, propagation through a medium in the linear coupling limit still produces nonlinear changes in pulse characteristics, owing to the frequency dependence of ~(*)or n.

Generally, the electric field is expressed in terms of z, the position inside the medium, and ax 62 Chapter 2 E (m, z) = E (0, O) e-i~(w)z. (35)

Here k(m) is the wave index:

k(ci))= + (36) where c is the speed of light in vacuum. A number of useful quantities can be defined based on derivatives of k(o). The group velocity, v~:

describes the average speed of the pulse inside the medium; when dnldm is small, V~= c/n(@. The group velocity dispersion or GVD, is defined as:

where L is wavelength. The effect of GVD on a pulse generally results in chirp. For instance, a pulse passing through a medium of length z acquires a phase

$(0, z)= @(co,o)+ lk(6))z (39) with

d2k @(Z)(Q,z) = z= #o. (40)

@o

For an initially unchirped, Gaussian-shaped pulse ~f form

l?(t) = Eo e-(’’”)’ (41) where E. is the maximum field intensity, and@ is related to the pulse duration 7P

(FWHM) by

(42) we find that ~Gincreases with z as Chapter 2 63

(43) -

Thus, so long as 21$(2)(@, z)I cc ~G2,the pulse broadening is not significant. For input

pulses of ~c = 100 fs, $(2)is generally negligible for a few mm of material at infrared

frequencies. However, it becomes significant in the ultraviolet. For instance, in fused

silica at 250 nm, @‘2)= 2800 fs2/cm, producing a pulse width of 1.15@ for z = 1 cm.

Third-order dispersion, based on d3k/d@3,is also important for pulses with

durations shorter than -50 fs. Although minor for our laser system, it nevertheless plays a

role in optimal pulse compression, which is discussed in section 2.9.

2.2. C1ark-MXR femtosecond laser

The amplified femtosecond laser source (Clark-MXR CPA-1000) consists of six

components housed in separate boxes (see Fig. 17): an Ar+ ion laser (Coherent Innova

190-6), femtosecond oscillator (Clark-MXR NJA-5), pulse stretcher (Clark-MXR PS-

1000), Nd:YAG laser (Clark-MXR ORC-1OOO), regenerative amplifier (Clark-MXR

TRA- 1000), and pulse compressor (Clark-MXR PC- 1000). Both the oscillator and

regenerative amplifier use a Ti:sapphire crystal as the lasing medium.

The Ar+ ion laser (continuous wave, all lines, -2.5 W) pumps the first Ti:sapphire

rod in the oscillator, generating weak (-2.5 nJ) femtosecond pulses at -100 MHz. The

basic principle of solid-state femtosecond pulse generation is self-phase modulation,

arising from changes in the index of refraction at very high intensities:

n(t) = no + nz IE (t)12 (44)

... “, -,- ,- --- \ - -y --~, .,,<;, .. . .< .. ., ..’ ,- ...... ,,Lr:”,T--- . .. -” 64 Chapter 2 where no is the linear index of refraction and n2 k the first nonlinear term. Note that

IE (t)12is proportional to the intensity l(t), while n2 is proportional to the third-order polarizability %(3):

n2 3X(3) (45) = 8no “

Most materials, including Ti:sapphire, have z ‘3)>0 . Thus, when focused sufficiently, a pulse of moderately short light will be retarded more at the peak intensity than at the fringes, resulting in a time-dependent phase:

ICO((DJ%(CI)O) ~ ] ~ (~,())[2 O(Lz) = 4(L 0) - (46) no(~o)

(47)

Rather than chirping or otherwise distorting the phase of the pulse, the effect is to broaden the frequency spectrum and thereby shorten the pulse if the group velocity dispersion is compensated for (typically, using a pair of intracavity prisms). Evidence for a wider frequency sweep can be seen by examining the instantaneous frequency:

Iko((.oo)%(alo) ZI Ijj (t, 0)12. co(t, z) = coo+ @l)(t, z) = Q + @l)(t, o) – (48) no(coo) dt

We see that the maxima in Ico(t,z)l are found at the inflection points of I~ (t, 0)12,and there the magnitude of the frequency excursions increases with larger peak power and shorter pulse duration.

Amplification of pulses is accomplished using the technique called chirped pulse amplification, or CPA (hence the name CPA-1000). This involves stretching pulses from the oscillator out in time through up-chirping, multi-pass amplification, and subsequent Chapter 2 65 recompression using down-chirping. The reason for stretching out the pulse is twofold.

First, it avoids damage to the amplifier optics, which would quickly occur if an unchi~ed pulse were to propagate through the cavity at full power. Second, the tremendously higher peak power of an amplified femtosecond pulse would induce unwanted nonlinear effects in the gain medium, ruining the pulse duration among other properties. By carefully choosing a pulse duration short enough to preferentially stimulate emission from the gain medium over the normally occurring ns-duration pulse, yet long enough to suppress deleterious nonlinear effects, effective amplification is achieved.

Up-chirping is accomplished by bouncing pulses off a diffraction grating several times, which introduces GVD through angular dispersion, generating pulses of roughly

100 ps duration. A Pockels cell (controlled by the Clark-MXR DT-505 high-voltage electronics) is used to select pulses at -500 Hz for injection into the regenerative amplifier cavity, which consists of a second Ti:sapphire rod synchronously pumped by the Nd:YAG laser (500 Hz, 100 ns duration, 532 nm, 10 mJ/pulse). This “seed” pulse makes several passes inside the cavity, where it quickly builds up intensity in preference to the ns-duration pulse which would normally be created every laser shot. The amplified pulse (-1.5 mJ) is switched out of the cavity via the Pockels cell, and directed into the compressor. Recompression is accomplished by reversing the up-chirping process with a down-chirp, using a second diffraction grating in combination with a retroreflector. Aside from some technical challenges discussed in section 2.9, transform-limited 80 fs pulses with 1.0 mJ energy can be routinely generated at up to 1 kHz repetition rate using the

Clark-MXR laser. For all experiments discussed in this dissertation, however, a repetition rate of 500 Hz was used.

.,-c ..-- .,, . . . . ,, .. -.:, -. . . .,

66 Chapter 2 2.3. Beam pointing stability

The laser system has been plagued by temperature fluctuation-induced problems

since it was purchased, and this has been partially, though not completely, alleviated

through the use of temperature regulation in three of the four covered boxes comprising . . the laser system: oscillator, pulse stretcher and pulse compressor (a unit was not available

for the regenerative amplifier). These simple devices, sold by Clark-MXR, consist of a

series of resistive heaters in thermal contact with the aluminum breadboard of each box,

and a small control box containing a thermocouple switch, electronic keypad and readout.

Although the devices are only capable of heating, the temperature of the breadboards can

be maintained to Ml. 1°C if set to’above ambient room temperature. It has been

discovered, however, that setting them too far (> 4°C) above room temperature results in jittery beam output, perhaps due to vibrations caused by drawing too much current. Still,

even with this temperature regulation there is a noticeable drift to the beam position over

a period of hours, which has been dealt with using a different approach, detailed below.

The Pointmaster system, also manufactured by Clark-MXR, was designed for use

with the Ar+ ion laser beam, which is known to suffer from drift. Because it was felt that “

the stability of the oscillator was not problematic, it made more sense to purchase

Pointmaster for use with the amplified laser beam output, since small changes in beam

position, changing the overlap of the pump and probe beams inside the vacuum chamber,

has disastrous effects on the normalization of FPES data. In fact, no alterations to

Pointmaster were requested for use with the amplified beam (the mirrors supplied for 488

nm have simply been substituted with more appropriate ones), so it would still be Chapter 2 67 possible to reconfigure Pointmaster for use with the Ar+ ion laser, if this turns out to be a

larger source of drift.

The system consists of two piezoelectric xy tilt stages, two beamsplitters (-99%

reflectance), two quadrant photodiode detectors, a control circuit, and remote

display/keypad. As the beam emerges from the pulse compressor, it is reflected from first

a piezoelectrically-mounted mirror, then a beamsplitter, then a second piezoelectrically-

mounted mirror, then a second beamsplitter, on its way to the harmonic generator. The

weak beams transmitted through each beamsplitter are directed along moderately long

(-1 m) paths before striking a quadrant photodiode. These detectors are able to detect

small changes in both horizontal and vertical position through the principle of current

balancing. The face of each photodiode is divided into four sections called quadrants, and

the beams are initially aligned so they strike precisely in the center, the same amount of

light falling on each quadrant, producing an identical photocurrent. If the beams move,

the photocurrents from each quadrant will no longer balance, and the system can tell in

which direction the beam has moved. Note that this approach is insensitive to fluctuations

in overall laser power, provided the change is not too great (the dynamic range of the

photodiodes is somewhat limited). A feedback circuit then directs the piezoelectric stages

to move the beams back to the centers of the detectors, restoring the current balance. The

photodiodes are calibrated before use each day (to compensate for small alignment

changes made elsewhere in the system), and are able to maintain good beam pointing

stability indefinitely, provided the beam does not move too much, or the power fluctuate

excessively (more than -50%).

,.. ... r... -,, , -. .! . .Z. :- ..-.r,--.. .,r,. .- .= ..,...... — , z. 68 Chapter 2 2.4. Quantronix TOPAS optical parametric amplifier

The Quantronix TOPAS optical parametric amplifier (OPA) was purchased fairly recently, and was not used in any experiment reported in this dissertation. Its detailed operation, therefore, will be covered in another dissertation (presumably that of Martin

Zanni or Alison Davis). However, a few words will be said about the purpose of the device. It enables wavelength tunability over a very wide range, from the mid-infrared

(2800 nm) to the blue (450 rim), with continuous coverage. Although pulse energies are considerably lower than those encountered in the fundamental or second harmonic frequency beams, they are comparable in most wavelength regimes to the pulse energy of the third harmonic frequency, with excellent pulse width characteristics. As a result, it is a valuable addition to the femtosecond laser arsenal.

2.5. CSK Optronics harmonic generator

The generation of second and third harmonic frequency laser pulses is essential to the study of most anions using FPES, as the electron binding energy (EBE) of most anions is typically larger than what can be accessed with fundamental frequency light.

For the case of 12-(vertical EBE = 3.21 eV) and its clusters, the third harmonic frequency is needed. Therefore, the CSK Optronics 8315A Super Tripler has been a workhorse of the experiment, and its principles and operation will be discussed in detail.

2.5.1. Principles

The interaction of light in a condensed medium to generate light at new

frequencies is a sometimes strange process to understand. I have found a classical

enharmonic oscillator model to be the clearest example for me, though others may find Chapter 2 69 alternative models to be simpler. Shen 10was consulted extensive y in developing this section.

Outlined here is an explanation both for second harmonic generation (SHG) as well as sum- and frequency generation (SFG and DFG, respectively), using light of two frequencies, O.)land@, interacting with an anharrnonic oscillator. This oscillator consists of an electrically charged (q) mass (m) which is displaced along the x axis when subjected to a force (F’) due to the oscillating electric fields of maximum strength El and

E2 for the two frequencies, respectively. The natural frequency @ of the oscillator is quantitatively unimportant, so long as it is different from both co, and W. The anharmonicity a may be either positive or negative, and supplies an asymmetry to the oscillator as in a real molecular interaction. No damping term is assumed. The differential equation governing the motion is:

d2x —+ C002X+ax2 = F =~(E1e-i@l’+ E2e-i@2’+Cc.) , (49) dt2 m

Here t is time, and C.C.denotes the complex conjugate. Note that a = O for materials with a center of symmetry, since F(x) = –F(–x) must be satisfied. a is proportional to the second-order nonlinear polarizability X(2).

The motion of the charged mass is assumed to be responsible for the re-radiation of light, which we solve for using a perturbative treatment:

x=x(l) + X(2)+ . .. (50)

The first-order solution results in a term for each frequency component ~i:

x(,)(o) = (q / rn)Eie-i@l’ 1 +C.c. (51) 0)02 – (2i2

..:, ,,). ,:,’ :-..’: ,;.,-----J’; ~-’ ,.:,. 70 Chapter 2 In other words, the medium re-radiates at each driving frequency, the normal case for materials without absorption. Substituting aX2with ax‘1)2, the second-order solution X(2)is obtained:

X(2)= X(*)(@l+ Q) + x(2)(oll – Q) + X(2)(2C!)I)+ X(2)(2C02)+ X(2)(0) (52) with

‘2a(q / nz)2~1~2e-@*oz)t J2) (q *%) = (53) a)02– C!)*2 ( )(%%7(%%*@2)2)+c”c”

2 -2iuif –a(q / nZ)2Eie ‘(2)(2@i) = +C.c. 002 – mi2 ao2 – 4mi2 ( )( )

–Cz(q/ m)2 1 X(2)(0)= 02 ~2_@2+@2:@2 + c. c. o (0 1 0 2 )

These new frequency components represent sum-frequency generation [X(2)(CI)I+ c@], difference-frequency generation [x(2)(ci)l– w)], second harmonic generation [~(2)(2~i)], and optical rectification [X(2)(0)].Note that the terms scale as the square of the electric field strength. This concludes the development of the enharmonic model.

While generation of new frequency components is possible in all directions, momentum conservation requires a particular orientation of the incoming and outgoing beams: the so-called phase matching condition. This is expressed as (for SHG, CO1= m):

k(col) * k(@ = k(@ (54) or

7z(c@ci)l+ 7Z(C!)J(D2= 7z(c&Jwj (55) where k(~i) is the momentum of the beam with frequency ~i, and @ = @l * @ is the

new frequency component. For most materials, n increases with frequency in the visible Chapter 2 71 or near-infrared range. Therefore, for sum-frequency and second harmonic generation,

where n(c@ is larger than both n(col) and n(o), the equation cannot be satisfied.

However, a negative birefringent material has the property that the index of refraction of

a beam polarized perpendicular to the optic axis of the crystal (the “extraordinary” wave)

is smaller than the index of refraction of a beam polarized parallel to the optic axis (the

“ordinary” wave). The index of refraction of the extraordinary wave n~ also depends on the angle e of the beam relative to the optic axis:

n, = ‘emnO (56) 2sinz e + n,~2 COS2O where n~~ is the minimum in the extraordinary index of refraction, and no is the ordinary index of refraction, which is independent of El.Two polarization schemes can be used to satisfy Eq. 55, referred to as Type I and Type II phase-matching. Both require wave @ to be extraordinary, but Type I requires waves ml and w both to be ordinary or extraordinary, while Type II requires one of each. The CSK Super Tripler uses Type I phase-matching for generation of both second-harmonic and sum-frequency beams.

2.5.2. Operation

The layout of the harmonic generator is shown in Fig. 19. For illustration, it is assumed that 800 pJ of 780 nm fundamental light is used. The incoming fundamental frequency beam (horizontal polarization) passes first through a 1.5 mm thick lithium borate (LBO) crystal, producing a collinear second harmonic frequency beam (390 nm,

-200 pJ, vertical polarization). The frequencies are next separated at a dichroic

Fig. 19. CSK Optronics harmonic generator (on next page).

“,,,..:.;.- ...... ,, ,,.y,,-: 72 Chapter 2 .“ Fundamental and , second harmonic Input beam outputs (co)

Third harmonic Dichroic output (3co) beamsplitter

Second harmonic A crystal Sum-frequency ~ crystal ?

Dichroic beamsplitte Fund lental I (03) 4 + Dichroic bearnsplitte ~Half-wave I plate 4s —

Manual translation stage

,+..-:, }....,..,I v I I Scale 1:2 Chapter 2 73 beamsplitter, which reflects the second harmonic while transmitting the fundamental. The fundamental beam continues through a half-wave plate (rotating the light to vertical polarization) to a retroreflector mounted on a manually adjustable translation stage, and finally to a second, identical dichroic beamsplitter which transmits the beam. Meanwhile, the second harmonic beam is reflected off of two fixed mirrors toward the second dichroic beamsplitter, which also reflects it. The two beams, collinear and vertically polarized, now enter a 300 Lm thick ~-barium borate (BBO) crystal, producing third harmonic (sum-frequency) light (260 nm, -50 @, horizontal polarization). Note that, unlike the second harmonic beam, which required only a match between crystal orientation and beam direction, the third harmonic beam requires in addition the proper temporal overlap of the fundamental and second harmonic beams, accomplished by adjustment of the retroreflector. This “two-dimensional search problem” makes it a bit of a challenge to find the third harmonic beam when realigning the unit, but it is no more difficult than aligning a laser cavity, also a two-dimensional problem.

After producing the third harmonic beam, the three frequencies must be separated.

Originally this was accomplished using a series of CSK Optronics-provided mirrors, but the first mirror, a simple broadband metallic mirror for reflecting all three frequencies, was easily burned by the pulse energies involved. Beam separation is now accomplished using, first, a 260 nm high reflector (CVI TLM 1-260-45P- 1037) to separate third harmonic from the other two frequencies, and a 390 nm high reflector (CVI TLMl-260-

45P- 1037) on the remaining two beams to separate off the second harmonic. The fundamental beam is not usable, the brightest spatial areas having been depleted in the conversion to the harmonic frequencies, and so is directed into a beam block. Transport

; .-. ,J -,-, - . . ‘r’?. 74 Chapter 2 of the two harmonic beams is accomplished using additional high reflectors of the same types, in order to increase the frequency purity as much as possible. The residual amount of each harmonic beam in the other beam path at the entrance to the vacuum chamber is detectable by the eye, but of inconsequential energy.

The original unit contained a pair of lenses to reduce the beam diameter by approximately 2x, but this was found to be problematic to overlapping the second or third harmonic beam and the fundamental beam inside the vacuum chamber, due to the difference in size. Rather than squeezing maximum energy out of the harmonic generator through focusing, and then reexpanding the beams afterward, it was easier to leave all beams the same size, even if it resulted in lower energy harmonic beams. It must also be pointed out, however, that there were few lenses to spare during the “proving” phase of the experiment, so that now it would certainly be feasible to implement this scheme with the guarantee of considerable gain in pulse energies, if such were required.

2.6. Aerotech translation stages

Control of the pump-probe time delay is accomplished through use of an optical delay line involving a pair of mirrors in a retroreflecting arrangement mounted on a motorized, computer-controlled translation stage (Aerotech ATS-1OO-15O). Although there are now two such stages on the optical table (one for delaying the fundamental beam, the other, for the second harmonic beam), there is only one controller (Aerotech

U1OOM-A-4O-F1), so that cables from each stage must be switched on the controller in

order to change which stage moves.

One pm equals approximately 3.34 fs for light in air, though since the laser beam

must travel toward and then away from the retroreflecting mirrors, the effective delay Chapter 2 75 time is always twice the stage movement, so in practice, 1 Lm = 6.67 fs. The total range

of either stage is 15 cm, or -1 ns temporally. The resolution of the stage is reported to be

1 pm, and positioning is in fact possible in 50 nm increments, giving an ultimate time

resolution of -0.3 fs. However, there is a large inaccuracy problem of *2-3 ~m having to

do with the controller, rather than the stages. The stage motor is a stepper design,

meaning there is a set of four coils or “poles” arranged in a ring about the motor core. To

turn the motor, alternating coils turn on and off, causing the motor to step by one pole at a

time. Fractional movements can be achieved by only partially turning on or off coils, but

the effect is not very linear; in other words, the motor tends to jump from one pole to the

next, without a great deal of flexibility. This point aside, the inaccuracy problem stems from the fact that the power circuits supplying current to each pole are not very evenly balanced, meaning that as the motor turns, it “wobbles” irregularly, resulting in a roughly sinusoidal advance of the stage with a period of 10 ~m and amplitude of 2-3 ~m.

Amazingly, this performance is within the specifications established by the company, which actually gives an “accuracy” of *5 ym. In short, the wrong stage was purchased.

Happily, much of the problem has been overcome through the use of software.

Because the problem is reproducible on a sub-~m scale, the stage can be precisely positioned anywhere along its wobbly path. By calibrating the apparent position to the absolute position (though the use of a fitted autocorrelation trace), the variation can be reduced to a noise level. The only problem with this method is that the offset, or “phase,” of the sinusoidal cycle must be determined whenever the stage is translated by a significant amount, i.e. a few mm, because the period of the cycle is not exactly 10 ~m.

In many cases, however, precise positioning is only required very close to the zero of

-,>,...7 ., ~-,: :,, .,. 76 Chapter 2 time, or “to,” location, with inaccuracy of a few fs tolerated tens of ps away from this location. Fig. 20 illustrates the effectiveness of this correction with a pair of autocorrelation traces taken with and without wobble correction.

.“ —.— .. ..

● ● —(a) raw *● * *. ● ● %**.. - “(b) corrected ‘ ● . . ; .

9 .% m ~

●.* . . . . **” t / . , . **=$ ● ● \ ● 1: “k

●☛✎ +“ ● ..*● [ I I 1 -200 -1oo 0 100 200 TimeIfs

Fig. 20. Autocorrelation traces illustrating translation stage sinusoidal problem: (a) without wobble correction; (b) with wobble correction.

2.7. New Focus optical chopper

To aid the normalization of FPES spectra taken at different time delays under

changing ion beam and laser power conditions, an optical chopper (New Focus 3501) was

purchased to perform shot-to-shot background subtraction (see section 3.2.1). This

approach entails blocking the pump laser by the blades of a rapidly spinning chopper

wheel every other laser pulse, or 250 Hz, and subtracting probe-only photoelectron . Chapter 2 77 spectra from pump-and-probe spectra on a per pulse basis. Synchronization of the wheel

with the laser is critical, which was the most difficult feature to locate in a chopper; most

models force the experiment to be triggered from the chopper itself, not an option in our

experiment. The New Focus chopper may be triggered externally, and includes circuitry

to run at a fractional or multiple harmonic of the trigger frequency (1/2 was required for

our application). Also, the timing offset or “phase” with respect to the trigger is fully

adjustable, avoiding the problem of chopping only part of a beam’s spatial profile.

2.8. Autocorrelation and cross-correlation

An autocorrelation is the temporal overlap of a laser pulse with itself.

Mathematically speaking, this is expressed as:

A(t) = j- W(t’)l(t + t’) (57) where I(t) is the time-dependent intensity profile of a laser pulse, and A(t) is its autocorrelation function. Although it is not possible to directly measure the intensity profile, a significant amount of information about it is contained in the autocorrelation, as can be confirmed through deconvolution. Generally, however, the most useful piece of information is simply the pulse width (full width at half maximum, or FWHM), which can be derived from the FWHM of the autocorrelation, and an assumption about the shape of l(t). If it is Gaussian, then the FWHM of A(t) is equal to W (-1.414) times the

FWHM of A(t). On the other hand, if the shape of I(t) is sechz, then the ratio is -1.543. It is generally assumedl 1~]2 that a well-formed femtosecond pulse has a sechz intensity profile, though in practice, it makes little difference which is used, other than the fact that a sech2-shaped pulse happens to have a shorter FWHM for a given A(t) FWHM.

.... .’ ~.x.-.. .’:,.. ,.; 78 Chapter 2 Cross correlation is analogous to autocorrelation, except that two frequencies of light are combined to generate a signal dependent on the pulse width of both pulses.

Mathematically, it is very similar to Eq. 57:

c(t)=f-_dt’IA(t’)IB(t+t’) (58) where ZA(t)and l~(t) are the time-dependent intensity profiles of each laser pulse, and C(t) is its cross correlation. Since in principle either pulse could be characterized separately by autocorrelation, the cross correlation can be used to find the width of the other pulse though deconvolution. For gaussian pulses, the relationship is straightforward:

TC2= T*2+ TB2 (59) where ‘tA,~Band ‘rCare the l?WHhk of the two beams and the cross correlation, respectively. For sech2 pulses, the relationship is not analytic, but a lookup table has been employed tO CalCUlate~BfrOm knowledge Of7A and ZC.

Measurement of the autocorrelation or cross-correlation signal is obtained through a nonlinear optical process, usually SHG for autocorrelation, and SFG or DFG for cross- correlation, inside a nonlinear crystal. See section 2.5.1 for more information on these techniques.

2.8.1. Slow-scan autocorrelator

A total of three autocorrelators have been built for the laser system. The “fast- scan” autocorrelator is used for quick, qualitative measurements only, as no data can be recorded with it. The “slow-scan” autocorrelator uses one of the motorized translation stages to vary the path length, so that a computer can direct the stage through an autocorrelation, recording the digitized photodiode signal at each step. The “single-shot” Chapter 2 79 autocorrelator is also used for qualitative measurement, but it was added in 1998 by

Alison Davis, and will not be discussed here. Note that each autocorrelator is of a noncollinear type, meaning the two beams are crossed at a small angle inside the nonlinear crystal. This arrangement guarantees that the autocorrelation signal will be background free, but it also prevents an interferometric autocorrelation, containing valuable additional information, such as temporal chirp, from being obtained if a collinear arrangement were used.

The table layout for the slow-scan autocorrelator is shown in Fig. 21. After the fundamental beam is directed into the autocorrelator with a pair of beamsplitters (2% and

50%, respectively), the beam encounters a 50% beamsplitter. The reflected beam is directed toward a fixed leg retroreflector permanently mounted on the laser table, while the transmitted beam propagates toward a retroreflector mounted on the same translation stage as used for the fundamental frequency delay line (on the opposite side of the carriage). Beams are recombined with the same beamsplitter, then directed into the detector with a second 50% beamsplitter, which allows the fast-scan autocorrelator to use the detector without having to move mirrors (one pair of autocorrelator beams are blocked, of course). The detector consists of a 4“ f.1. lens, a 5x5x0.5 mm BBO crystal

(CSK Optronics) cut for second harmonic generation, placed just before the focal point to prevent burning, a blue bandpass filter (Newport BG40), and a photodiode (Thorlabs

FDs 100).

. ,,,.. . .;.V: ,,,.- -7, --- .,- - ...... ,.. L—— — .-

80 Chapter 2 Fundamental Beam

50% Bearnsplitter 2’%0 \ To Fast Beamsplitter F Autocorrelator 50% 5070 A Beamsplitter /

8

v <—> 4“ F.L. To Lens Experiment

BBO ~ crystal

i l!I ~ & ‘, ~ Blue Filter Translation Stage Photo- Eldiode

Scale 1:4

Fig. 21. Slow scan autocorrelator.

The highlight of this autocorrelator is its ability to record autocorrelation traces by computer, digitizing the photodiode signal while scanning the translation stage. An overview of the translation stage appears elsewhere in this chapter, and the digitizing electronics are described in section 3.3. Chapter 2 81 2.8.2. Fast scan autocorrelator

The layout of the fast scan autocorrelator is shown in Fig. 22. ‘A50% beamsplitter

reflects half the beam along the variable path, which consists of a pair of mirrors mounted

on a small, 90° aluminum bracket (1/16“ thick) glued to a speaker cone (Radio Shack 4“

woofer, part #40- 1022B), while the transmitted half travels along the fixed path

consisting of a pair of mirrors mounted on a small, manual translation stage (Newport-

Speaker Cone

Fundamental IL \ II Beam IHI

Beamsplitter 2% > Manual Beamsplitter Translation Stage

Beamsplitter I 1 Beamsplitter To S1OW Autocorrelator I c 4“ F.L. To Lens Experiment

/

Scale 1:4

Fig. 22. Fast scan autocorrelator.

.,-!;-- --- .- , 82 Chapter 2 Klinger UMR5. 16). Rather than recombining the beams with a beamsplitter, the variable path beam passes directly into the detector, while the fixed path beam is directed into the detector via a mirror. Both beams pass through the 50% beamsplitter used by the slow- scan autocorrelator.

The heart of the autocorrelator is the speaker-mounted retroreflector. The speaker is driven by a home-built amplifier at -20 Hz, which scans the laser pulse from the variable path through the fixed path pulse. To obtain a real-time autocorrelation trace on an oscilloscope, the XY mode is employed, using a scaled output from the amplifier as the X input, and the photodiode signal as the Y input. Note that a relatively large impedance (1 Mf2) must be used for the photodiode signal in order to generate a slow

(-100 W) decay; otherwise, the signal will be invisible on the time scale of the laser repetition period (2 ins). Since there is a phase lag between the signal sent to the speaker and the speaker position, the scaled amplifier output has a variable phase adjustment.

Also, the photodiode signal is blocked on the oscilloscope during half the cycle, in order to prevent two superimposed images from appearing, which are difficult to align; a “Z blank” output from the amplifier is used for this purpose,

Fig. 23. Fast scan autocorrelator oscillator circuit (on next page). . Sine wave ......

)

v ...... -; 1470114701 II (~ ) (F NS 5kQ + ~ LMIOIAI ) r — f12 I v +& NS Xdeflector 150,,pF 8V + LM101AJ I f12 8 :+ II 8V v 1 . . T - ‘M$ - -7 I 141 I ...... ( I W+-N lWrlF ...... I Iokn I -12v n Ill 10 Id-1 ...... “+- ...... ~ Amplitude ; [ loorrF pF to [ 500 n 4. I m ; +12v n r =; n - RCA +15v SPe&er driver — Z blank 2PF s (separate ground) v ~ NS . Speaker 6.2V LM1875 (8Q) rTL & .12V = lMQ 22M2 3 generator . l,6f2 ...... 300VF )+ ~lw-15V h !70rlF_ ,.. 84 Chapter 2 The design of the circuit was copied from Lucas Hunziker, a graduate student with Prof. Yongqin Chen at Berkeley; it is reproduced in Fig. 23. It consists of, principally, a sine-wave oscillator, two signal-modifying circuits generating the X and Z blank outputs, and a power amplifier for the speaker. The frequency of the oscillator can be adjusted with a potentiometer and a properly chosen capacitor; with a toggle switch to choose between two sets of capacitors, the frequency range is currently 4-85 Hz. Part of the oscillator circuit is a feedback loop called “clipping,” containing a potentiometer whose value must be adjusted for different frequencies, and often again once the circuit has warmed up. Setting the value too high allows the circuit to swing to the minimum and maximum voltages of the operational amplifier (op-amp), causing flattening of the sine wave; setting it too low attenuates the oscillator completely. The output from the oscillator is split; one half passes through a phase shifter, adjusted with a potentiometer, and on to two simple op-amp circuits, one of which provides the reference X signal for the oscilloscope, the other of which generates the Z blank (TTL) signal. The other half of the oscillator output is connected to a power amplifier circuit, with adjustable amplitude, and from there, to the speaker (8 Q impedance).

Originally, the circuit was plagued by a terrible noise problem, which seemed to stem from the use of a single power supply for all components. This problem was solved by using two power supplies, one for the power amplifier (International Power HAA15-

0.8-A, *15 Vat 0.8 A), and a second for the rest of the circuit (International Power

IHTAA-16W, Y12 V at 0.4 A). The addition of large capacitors on the power supply

outputs also helped reduce the noise. The amplifier segment of the circuit is also

separately grounded, to minimize potential ground loops. Chapter 2 85 2.8.3. Cross-correlation

The layout of a typical cross-correlation setup is shown in Fig: 24. It is a collinear

arrangement, the path length of one beam being varied by a translation stage elsewhere on the laser table. Beams are combined using a mirror which allows the lower frequency beam to pass through. No focusing is required, as the full power of each beam is

generally used, providing more than enough cross correlation signal intensity.

The cross correlation signal is generated using a nonlinear crystal to generate sum- or difference-frequency radiation. We have successfully measured cross correlation signals for all combinations of fundamental (co), second harmonic frequency (2co) and third harmonic frequency (30) light, using a 7x7x0.3 mm KDP crystal (CSK Optronics), cut for co+ 2c0 sum frequency generation. For the other two frequency combinations, difference frequency generation was used at the same incidence angle to the crystal; however, the polarizations of the beams had to be correctly oriented. Separation of frequencies is essential to detection in this collinear design. For coand 20 light, a simple filter (red or blue bandpass) before the photodiode was used to block the other frequencies. For 30 light, a Pellin-Broca prism was employed to separate the beams spatially, and a fluorescent card placed at right angles to the photodiode was used to image the ultraviolet 30 light, since the photodiode was insensitive to this wavelength.

Recording of cross correlation spectra was accomplished in the same manner as for autocorrelation spectra.

Fig, 24. Cross-correlation optical layout (on next page). 86

Entrance window to vacuum chamber Lens (0.5 m F.L.) .,?,...... ,: Photodiode ~ .:

...... Filter ::.-:.-: “

I

.., KDP crystal

chamber platform F Periscope platform - - Iris

o

* Mirror (30)

&dextension coor TOPAS visible)

(co)

Mirror (TOPAS infrared) & Chapter 2 87 In our experiment, cross correlation is also very useful for finding the zero of time

(tO)of two beams prior to entering the vacuum chamber. Although the,tO changes slightly each time the beams pass through additional material, such as a lens or laser window, the offset is only a few ps for 260 nm light. Therefore, cross correlation is the primary means of temporal beam alignment when preparing for an experiment, and can often be used in lieu of an actual determination of to in vacuum (see section 3.2.2), once the time offset has been measured.

2.9. Laser pulse optirnization

Over the course of learning how to operate the Clark-MXR system, several

“tricks” have been discovered which are useful in the optimization of laser pulses. Some of the most important are detailed here.

The oscillator is remarkably stable, though over a period of weeks the average power in the cavity declines to the point where spontaneous loss of mode-locking occurs.

This may be due to changes in the direction of the Ar+ ion pump beam, but as this is not easily adjusted without a complete realignment of the oscillator, the cavity end mirrors are typically adjusted instead. The most significant improvement in power is often made with vertical adjustments, which are more sensitive. Dusting the cavity mirrors may also make large improvements in power. The continuous-wave (CW)cavity power may be optimized before achieving mode-locked operation, since the cavity alignment of the two modes is very similar. With an Ar+ laser aperature size of 4 and pump power of 2.5 W, good alignment should approach 200 mW or more. If this benchmark cannot be reached, a general alignment of the cavity may be necessary.

... ._ 88 Chapter 2 The Ar+ laser tube has a lifetime of approximately 2000 hours, or 1.5 years depending on usage, after which a common sign of impending failure is mode degradation, caused by physical descent of the electrodes within the laser tube which partially blocks the beam. This seriously affects the efficiency of the oscillator, which requires a very good quality pump mode (TEMOO)to achieve proper self-focusing. The mode may be easily examined by reflecting the beam, with aperature fully open, off of a concave mirror (the “mode tool” of the oscillator maybe used) onto a surface several meters away. The presence of dark areas or pronounced rings usually indicates mode degradation.

The angular misalignment of the Pockels cell in the regenerative amplifier causes an incomplete polarization change to the amplified pulse train before and/or after the selected pulse has exited the cavity. This results in a series of “pre-pulses” and/or “post- pulses” in addition to the main pulse. For gross misalignments, such additional pulses can be seen in a photodiode signal from the compressor. They also appear in the autocorrelation spectrum as “wings” (temporally wide, low-intensity shoulders on an otherwise nearly sech2-shaped pulse), because they are not optimally compressed, spending a different number of round trips in the amplifier cavity and therefore having a different amount of group velocity dispersion relative to the main pulse. However, other optical elements can also produce wings (see below). An unambiguous method of detecting the presence of additional pulses is by using the photoelectron spectrometer. In performing a pump-probe experiment on Iz- (using 780 nm for the pump pulse and 260 nm for the probe pulse), it was discovered that a significant (as much as 20%) amount of dissociated T was being produced even at “negative” time delays, i.e. when the probe Chapter 2 89 pulse arrived before the pump pulse. Although both pre-pulses, which introduce a premature pump, and post-pulses, which supply a late probe, could be.responsible for the effect seen in the photoelectron spectrum, it is most likely due to additional pre-pulses.

This is because the intensity of the additional pulses should be greatly reduced for the second- and third-harmonic beams, which scale inversely with pulse duration. Since the r signal is very strong, adjustments made to the Pockels cell are easily detected, and the effect can be minimized, although not always completely eliminated.

Although compression of amplified pulses to -80 fs is usually achievable without much effort, the presence of wings in the fundamental beam, as seen in an autocorrelation spectrum, is a more difficult problem to remedy. Unlike the wings caused by additional pulses, these are due to contributions from parts of the frequency spectrum which have acquired a significant third-order dispersion $(3)(CN),and possibly higher dispersions, in the amplification process. These temporal distortions cannot be compensated for by optimizing the compressor distance, which only alters the group velocity dispersion

$2)(0). However, changing the compressor grating angle in the plane of the table introduces third-order dispersion which can reduce the high-order phase offset. Another approach is to introduce third-order dispersion before regenerative amplification, using the “third order knob” in the stretcher. Here, instead of changing the grating horizontal angle, the horizontal folding mirror angle is adjusted so that the reflected spectrum striking the grating is offset horizontally. High-order dispersion introduced in the amplification process will then be partially cancelled by the initial third-order dispersion.

In practice, iterative adjustment of both optical elements can significantly reduce wings in a spectrum.

.-. T-...... --- ‘:.:7;,7; .,.: ,.,..0’ \ ::”.7 -. . .. ,. :,%’: ‘-- . . 90 Chapter 2 3. Data acquisition

3.1. Mass spectra

Mass spectra are acquired using the Tektronix TDS744A digitizing oscilloscope.

This device is remotely controlled by computer using the National Instruments GPI13 interface. It is capable of very high resolution (< 1 ns) data acquisition, though in practice, only 20-100 ns time intervals are used. Spectra are typically averaged for 1000-

4000 scans before downloading the data. Although limited to -80 Hz repetition rate (it is even lower when several processes are active), high-quality spectra may be obtained in only a few seconds. Up to 500,000 consecutive time intervals maybe stored in the oscilloscope, though currently the PC data acquisition software is only capable of reading

1024 intervals at a time; therefore, to record larger record sizes, spectra must be obtained in 1024-interval segments. The sample mass spectrum shown in Fig. 14(a) consists of three such segments recorded consecutively, using a 20 ns time interval.

3.2. Photoelectron spectra

Electron time-of-flight spectra are acquired using the Stanford Research Systems

SR430 multichannel scalar (MCS), which is a combination of discriminator and event counter. It has a >1 kHz maximum repetition rate, 5 ns minimum time resolution, storage capacity of 32,768 consecutive time intervals, and maximum run time of 65,536 trigger events before downloading is necessary. Generally, spectra are acquired at 500 Hz using

5 ns resolution, –10 mV discrimination threshold, 1024 time intervals (total acquisition time of 5.12 p.s), and data are acquired for 10,000 laser shots (20s) before downloading. Chapter 2 91 Communication with the lab computer occurs through the National Instruments GPIB

interface.

The MCS must operate in a low-signal limit, that is, in a regime where the likelihood of two electrons arriving in the same 5 ns time interval is practically zero. This requirement is in fact for a 10 ns interval, because the MCS cannot register two consecutive 5 ns events (for larger interval sizes, this limitation is absent; presumably, some of the internal circuitry has a 10 ns cycle time). However, most users would be more than happy to reduce their signal level if they discovered it to be close to 1 e-/10 ns; with an overall 500 Hz repetition rate, this represents a very fast data acquisition rate indeed, as a high-quality spectrum requires only -1000 e- per time interval. More typical operating conditions are nowhere near this limit, except perhaps occasionally when photodetaching r.

Electron spectra may also be acquired using the Tektronix TDS744A digitizing oscilloscope. Although the resolution of this device is considerably higher (e 1 ns) than the MCS, its major limitation is the low -80 Hz repetition rate. However, its primary application, the collection of 1-photon photoelectron spectra in shot-to-shot background subtraction mode (see section 3.2. 1), does not need a large signal. To collect electron spectra, the oscilloscope is “tricked” into operating in a kind of discrimination mode whereby the baseline is shifted far offscreen, just outside the range of the digitizer, so that the spectrum appears flat except for real signals which protrude into the valid range. Note that, unlike the MCS, signals are not simply counted (as a 1 or O), but have a variable height since their voltages are digitized with some resolution. This approach adds to the noise of a spectrum, and also presents a greater challenge when normalizing spectra

,7, - “., ::,.-...... , , . . ., .. . .. 92 Chapter 2 collected by the two techniques, since intensities. must be scaled. Another difference of the oscilloscope technique is that consecutive spectra are averaged (with 16 bits of resolution), rather than summed, so that data must be downloaded well before the signal size of a single electron is reduced to one bit. Generally only -1200 spectra are acquired in the time it takes the MCS to acquire 10,000, so there is plenty of resolution to spare.

3.2.1. Background subtraction

Subtraction of one-photon “background” signal is essential, where the probe laser

(and, sometimes, pump laser) can detach an electron from almost every anion studied by

FPES. Also, because the ion and/or laser sources do not always operate with steady intensity, concurrent measurement of background and two-photon signals is necessary to normalize two-photon spectra taken at different pump-probe time delays. In rare cases, such as ATD measurements on r (see section 3.2.2) the one- and two-photon signals are both present in the same spectrum at well-separated energies, and separate background subtraction is not necessary.

Two background subtraction methods have been developed, each of which has different strengths and weaknesses. The first method, “alternating scan” background subtraction, consists of switching the time delay (by moving the translation stage) between a time of interest and a fixed, negative time (that is, probe pulse before pump pulse) at typically 20s intervals. By choosing a negative time delay much larger than the pump-probe overlap, no signal arising from anions excited by the pump laser will be present, and a one-photon, background photoelectron spectrum will be recorded. The second method, “shot-to-shot” background subtraction, is much more rapid, and uses an optical chopper (see section 2.7) to block the pump laser by the blades of a rapidly Chapter 2 93 spinning wheel every other laser pulse, subtracting probe-only photoelectron spectra from

pump-and-probe spectra at 250 Hz. The MCS normally used for recording of photoelectron spectra supports this capability. However, since the integrated intensity of the time-dependent signals are not necessarily the same, separate recording of the probe- only spectra is also required to normalize spectra. An effective, if perhaps inelegant, system has been implemented using the Tektronix digitizing oscilloscope to record probe-only spectra at -80 Hz. Although considerably less signal is recorded this way, only the integrated intensity is required to normalize spectra.

Alternating scan background subtraction is only useful when the ion and laser power intensities are not fluctuating very much. Because several time delays are generally acquired in the same set of scans, choosing a different time delay after each background spectrum, and cycling through the full set many times, the number of background scans can be much greater than the number of individual two-photon spectra.

This situation allows for an advantage over shot-to-shot background subtraction: the number of laser shots used to acquire each background scan can be reduced, so that more time is spent acquiring two-photon spectra, yet a high-signal background spectrum is also obtained, averaged for all the time delays measured in the set. With shot-to-shot background subtraction, 50% of the spectra must be background, unless the chopper wheel spacing is altered. However, the main advantage of shot-to-shot background subtraction is its ability to ride out large fluctuations in ion and laser intensity. While it is always advisable to correct such problems before acquiring data, there is almost inevitably a slow drift to the ion intensity over a period of minutes, which is not easily 94 Chapter 2 compensated for by the alternating scan method, unless a large number of scans (> 20) are acquired at each time delay.

3.2.2. Above threshold detachment

As mentioned in the section on cross-correlation, when using two laser frequencies in an experiment, to changes each time the beams pass through material, such as a lens or laser window. The pulse width of each beam also increases, much more so for shorter wavelengths. For both these reasons, it is essential to be able to determine tO inside the vacuum chamber. The nonresonant, two-photon above-threshold detachment

(ATD) of a halidelq such as I_ has been used successfully for this purpose. The technique is general, but most commonly consists of using the fundamental (780 nm) and third- harmonic (260 nm) beams. When beams are temporally separate, only the 260 nm light detaches electrons, but when the beams are temporally overlapped, new photoelectron features appear at higher kinetic energy, corresponding to two-photon detachment. The integrated intensity of these features is proportional to the cross-correlation signal. The one-photon features are used for normalization of spectra.

Other approaches we have either tried or considered, such as cross correlation inside a vented vacuum chamber, averaging the cross correlations measured before and after the vacuum chamber, or nonlinear ejection of electrons from the metal walls of the chamber, all suffer from one or more major drawbacks: determination takes place at a location different than the interaction region, which is especially important if the beams are focused; day to day variation in beam position is not corrected fo~ a fundamentally different process than photoelectron spectroscopy is used, with the potential for unknown time offsets. Among the advantages of ATD: the detachment process is instantaneous for Chapter 2 95 a bare anion; and halogen anions are usually already present and plentiful in the ion

beam, requiring little adjustment to experimental parameters other than laser timing. The

ATD signal is moderately weak in comparison to typical FPES signals, but a good quality

spectrum can still be collected rapidly since only integrated peak intensities are required,

rather than fine details. An example of an ATD photoelectron spectrum of I_ at two time

delays (near and far from to), is shown in Fig. 25. Other peaks, i.e., one- and two-photon

30 signals, are independent of time delay and are used to normalize spectra to 1400C

1200C 3@ ~+3@ background o fs 1000C m z 8000 0 c v f (jooo ~+3@ iii -600 fs 4000 3@+3~ background 2000

0 I 0 1 2 3 4 Flighttime/us

Fig. 25. Example of above-threshold detachment photoelectron spectrum of I_, showing appearance of additional features when the laser pulses are overlapped.

,.. . ..7 ...... , 96 Chapter 2 each other. A plot showing the integrated time-dependent peak intensities vs. time, in comparison with a cross correlation spectrum measured on the same day, is shown in Fig.

26. The ATD is considerably broader than the cross correlation (170 vs. 230 fs FWHM). 1.2- .-. . ..

1-

0.8- + ATD -g- cc .—A $ 0.6- .— : 0.4- 5 u 0.2-

0-

-0.2 ! I I I I I I I -700 -500 -300 -1oo 100 300 500 700 Tme/fs

Fig. 26. Integrated ATD peak intensities vs. time, in comparison with cross-correlation of fundamental and third harmonic beams, showing broader pulse overlap inside vacuum.

3.3. Correlation spectra

Auto- and cross-correlation spectra are recorded using a Data Conversion DT2821 analog-to-digital (AJD) card, which plugs into an expansion slot of the lab computer (PC- compatible 486). This flexible device has 12-bit resolution and a software adjustable dynamic range from 1.25 to 10 V. It can read up to eight separate analog signals simultaneously, though only a single one is used, shared between the auto- and cross- Chapter 2 97 correlation photodiode signals. The A/D conversion process requires approximately 20 ~s

to complete. For this reason, the signal is connected through 1 MQ impedance to provide

a sufficiently long decay, though doing this also generates a higher voltage level than a smaller impedance connection. A separate trigger signal (~L) is used to start the digitization, supplied by an output from the Stanford box. It is set 120 PS after the laser trigger to allow sufficient time for the signal to reach its maximum level. Reading the digitized signal requires some assembly language programming, but this has been built into the data acquisition program and is transparent to the user. One item of important practical consequence is that the signal level generally seems to fluctuate a great deal, so that a number of laser shots (-100) must be digitized to obtain a clean signal for each time delay.

4. References

1 W. C. Wiley and I. H. McLaren, Rev. Sci. Instrum. 26, 1150 (1955).

2 D. R. Cyr, Ph.D. Thesis, University of California, Berkeley (1993).

3 R. Proch and T. Trickl, Rev. Sci. Instrum. 60,713 (1989).

4 L.-S. Wang, H.-S. Cheng, and J. Fan, J. Chem. Phys. 102,9480 (1995).

5 0. CheshnovskY, S. H. yang,c.L.Pettiette,M.J. Craycraft, and R. E. Smalley, Rev.

Sci. Instrum. 58,2131 (1987).

6 J. M. A1ford, p. E. Williams, D. J. Trevor, and R. E. Smalley, Intl. J. Mass. Spec. Ion

Proc. 72,33 (1986).

7 A. Weaver, ph.D. Thesis, University of California, Berkeley (1991). 98 Chapter 2 8 M. L. Alexander, N. E.~vinger, MoA. Johnson, D. Ray, and W. C. Lineberger, J.

Chem. Phys. 88,6200 (1988).

9 J.-C. Diels and W. Rudolph, Ultrashort Laser Pulse Phenomena: Fundamentals,

Techniques, and Applications on a Femtosecond Time Scale (Academic Press, San

Diego, CA, 1996).

10 Y. R. Shen, The Principles of Nonlinear .Optics (John Wiley & Sons, New York,

1984).

11 R. L. Fork, C. H. B. Cruz, P. C. Becker, and C. V. Shank, Opt. Lett. 12,483 (1987).

12 A. Baltuska, Z. Wei, M. S. Pshenichnikov, and D. A. Wiersma, Opt. Lett. 22, 102

(1997).

13 M. D. Davidson, B. Broers, H. G. Muller, and H. B. van Linden van den Heuvell, J.

Phys. B 25,3093 (1992). 99 Chapter 3. Photodissociation dynamics of the 12- . anion using femtosecond photoelectron spectroscopy*

The photodissociation dynamics of the 12-anion have been studied in real-time

using femtosecond photoelectron spectroscopy. In this experiment, 12-is excited to a

dissociative electronic state with an ukrafast pump pulse, and the photoelectron spectrum

of the dissociating anion is measured by photodetachment with a second, ultrafast probe

pulse. The variation of the photoelectron spectrum with delay time enables one to

monitor the dissociating anion from the initial Franck-Condon region of excitation out to

the asymptotic region. Dissociation occurs on a time scale of 100 fs. The results are

comprised with quantum mechanical simulations using previously published potential

energy curves for [i.

1. Introduction

The successful application of time-resolved techniques to gas phase processes occurring on a femtosecond time scale has been one of the most important developments in chemical dynamics during the last ten years. 1‘z The considerable body of work in this area has provided new insights into the photodissociation and reaction dynamics of molecules and clusters. However, nearly all gas-phase femtosecond experiments performed to date have focused on neutral species. The application of these methods to ions, particularly negative ions, is very appealing. In contrast to neutral species, most potential energy surfaces involving negative ions are poorly characterized. The low number densities typical of gas phase negative ion experiments make it difficult to study

*B. J. Greenblatt, M. T. Zanni and D. M. Neumark, Chem. Phys. Lett., 258,523 (1996).

-,-- ....,Ln - - .-,., , . . .. 100 Chapter 3 the spectroscopy and dynamics of these species using frequency-resolved techniques,

such as absorption spectroscopy, laser-induced fluorescence, or multi-photon ionization,

that are applied almost routinely to neutral species. Hence, the photodissociation and

reaction dynamics of negative ions represent fertile ground for time-resolved

● experiments. The desirability and feasibility of performing time-resolved experiments on

mass-selected anions has been demonstrated in the pioneering work by Lineberger and

co-workersq-G on dissociation and caging dynamics in 12-(C02)n clusters.

These cluster studies provide the motivation for the work described here, in which

the photodissociation dynamics of 12-are investigated using femtosecond photoelectron

spectroscopy (FPES). This is a relatively new technique which, along with the related

technique of femtosecond zero electron kinetic energy spectroscopy,7~8 has recently been

applied to excited state dynamics in neutral molecules.$’~lo The results here represent the

first application of FPES to negative ions. FPES is a pump-and-probe experiment

involving two femtosecond pulses. In our experiment, the first pulse (hvl) electronically

excites the 12-to a repulsive state, and the second (hvz) photodetaches the dissociating

molecule to form a photoelectron and either two I atoms or an excited 12molecule. The

overall process is given by:

(1)

By measuring the photoelectron kinetic energy spectrum as a function of delay time At,

one can monitor the dissociation dynamics of the electronically excited 12-all the way

from the Franck-Condon region to the dissociation asymptote.

The Ii anion was chosen for these first studies because of its experimental

accessibility, and because it is a fundamentally important anion in gas phase and solution Chapter 3 101 phase chemistry. Chen and Wentworthl 1constructed a set of potential energy curves for

the ground and excited states of 12-based on Raman spectroscopy in a rare gas matrix,

electronic spectroscopy in a crystal, and gas phase dissociative attachment experiments.

However, questions remain concerning the accuracy of these curves. For example, the Iz-

electronic spectrum clearly depends on the environment of the ion; the bands in rare gas

matrices are shifted by 0.16-0.27 eV to the blue of the bands in a crystalline environment, 12-14and one expects the gas phase spectrum to differ from either condensed phase spectrum. Recent dissociative attachment resultsls also suggest that the Iz- potential energy curves in Ref. II need to be modified. These curves have been used to simulate time-resolved dynamics of 12-in clusters 16and in various solvents, lT~l8 so it is important that they be as accurate as possible. The results presented here provide a stringent test of the available potential energy curves for 12-.

Fig. 1 shows the potential energy curves involved in our experiments. Iz- is excited from its ground ~ 2Z: state to the low-lying 2ll~,ln excited state by the pump pulse with photon energy hvl. The time-dependence of the resulting wavepacket is monitored by measuring its photoelectron spectrum. The photodetaching probe pulse, hv2, has sufficient energy to access the ~ lZ~, ~‘ 3172U, Z 3H1U, and ~ 3HO+Ustates of

12. At short delay times, photodetachment will access bound vibrational levels of these Iz states, but at longer times, when dissociation to 1-+ I is complete, one is essentially photodetaching a free 1-ion. Hence, the photoelectron spectrum of the dissociating wavepacket should change substantially with delay time. Since the 12states are well characterized, 19-21the time-resolved photoelectron spectra should serve as a probe of the anion states, as desired.

.::,-7 ,,~ .> ---- ~.. .,— ...... :.:;:.:,. ,. Chapter 3

1+1 ~------

260nm

1-+1

2 3 4 5 6 l-l Distance/~

Fig. 1. Potential energy curves for relevant electronic states of I; and 12taken from Refs. 11,19-21.

2. Experimental

The experiment consists of two major components: a negative ion photoelectron

spectrometer with a “magnetic bottle” electron detector, and a high (1 kHz) repetition rate

laser capable of generating sub-100 fs pulses. The photoelectron spectrometer is shown . in Fig. 2. It shares several features with spectrometers currently in operation in our

laboratory22 as well as others,zs-zs but is optimized in design so as to be compatible with

the laser repetition rate and pulse energy. Chapter 3 103 c o c 0 o 1[1[1 0 0 11 [11 c) 11111 0 11111 o 0 11111 0 0 0 0 1’4! 0 0 0 hv2 0 ~B~ o 0 Id 0 Ar, 9 0 111[1 0 0 11111 c1 11111 / 0 11111 0 11111 0 11111 0 \llll \llll 1111)

IT

[on Time-of-Flight Photoelectron Source Mass Spectrometer Spectrometer

Fig. 2. Schematic of apparatus, showing ion source region, time-of-flight mass spectrometer, and “magnetic bottle” photoelectron time-of-flight spectrometer.

12-anions are generated in a continuous free jet ion source by passing Ar carrier gas at 20 psig over 12,expanding the resulting mixture through a 100 ym orifice into the source chamber, and crossing the resulting molecular beam just downstream of the orifice with 1 keV electrons from an electron gun. The source chamber is pumped by two

Varian VHS- 10 diffusion pumps for a total pumping speed of 8800 l/see. Ions are extracted from the beam and injected into a Wiley-McLaren time-of-flight mass spectrometerzG by applying pulsed extraction and acceleration fields perpendicular to the molecular beam axis; the final ion beam energy is about 1200 eV. Once the ions are accelerated, they pass through two differentially pumped regions en route to the laser

‘.,,, .- 104 Chapter 3 interaction region. The first differential region is pumped by a Varian VHS-6 diffusion pump. The second differential region and laser interaction region are pumped by Varian

V250 turbomolecula.r pumps, and the base pressure in the latter region is 2X10-9 Tom. An in-line microchannel plate detector is used to obtain the time-of-flight mass spectmm of . the ion beam.

The ion beam is crossed by the laser pulses 55 cm upstream of the ion detector. A large fraction (>50%) of the resulting photoelectrons is collected using a magnetic bottle time-of-flight photoelectron spectrometer based on the design of Cheshnovsky et al.,25 although we use a strong (0.8 tesla) permanent magnet rather than an electro-magnet to generate the inhomogeneous magnetic field. The electrons are collected at a 75 mm diameter microchannel plate detector 1.4 m from the interaction region, and the arrival time distribution is recorded after each laser shot with a Stanford Research Systems

SR430 multichannel scalar. The energy resolution of the spectrometer is currently 150-

300 meV, depending on the electron kinetic energy; this will be improved in the near future by pulsed deceleration of the ion beam.~~25

The pump and probe laser pulses are generated from a commercial femtosecond laser system. A Coherent Innova-90 Ar+ laser pumps a Clark-MXR NJA-5 Ti:sapphire oscillator. Selected pulses are amplified using a Clark-MXR regenerative amplifier system that includes a pulse stretcher, a Ti:sapphire regenerative amplifier pumped by a

Nd:YAG laser running at a repetition rate of 1 kHz, and a pulse Compressor. At T80 nrn, the pump pulse wavelength, the pulse width and energy are 85 fs and 800 j.LT, respectively. About 70% of this beam is directed into a frequency tripling unit (CSK

Optronics 83 15A), resulting in a probe pulse at 260 nm with width and energy of 110 fs Chapter 3 105 and 18 p.J, respectively. (The pulse width of the probe pulse is measured by cross-

correlation with the pump pulse using a KDP crystal for frequency differencing.) The

remainder of the 780 nm pulse passes through a variable delay line and is then collinearly

recombined with the probe pulse prior to entering the vacuum chamber.

The UV probe pulse spreads when it passes through the vacuum chamber

window, and this window also affects the delay between the pump and probe pulses.

Two-color above threshold detachment (ATD) of 1-is used to characterize the laser

pulses inside the vacuum chamber.zT The probe pulse alone produces the characteristic

photoelectron spectrum of 1-(see below). When the pump and probe pulses temporally

overlap, additional peaks are observed that correspond to shifting the 1-spectrum by 1.6

eV towards higher electron kinetic energy; this is the photon energy of the pump pulse.

From the intensity of this two-color signal as a function of pump-probe delay, we

determine the zero-delay time and the cross-correlation of the pump and probe pulses

inside the vacuum chamber. This yields a pulse width of 140 fs for the probe pulse.

The combination of high laser repetition rate and high electron collection

efficiency results in rapid data collection. In the data set presented below, only 50 sec of

data collection are required at each time delay. The spectra are not background-free

because one probe photon can photodetach ground state 12-. At each time delay,

background subtraction is accomplished by collecting 50% of the data (i.e. for 25 see) at

long negative delays (-2 ps), where the probe pulse fires well before the pump pulse.

This background is suitably scaled and subtracted from the raw spectra to yield the

spectra in the following section.

---- .- . .,. ,““, .-.::.” -.’.“’ -..-. - 106 Chapter 3 3. Results and Analysis

Experimental results are shown in Fig. 3. In the top half of Fig. 3, three photoelectron spectra are superimposed, at At = O, 150, and 425 fs. The spectrum at the longest delay time, At = 425 fs, is essentially the 1 photoelectron spectrum; the two peaks centered at 0.75 and 1.7 eV represent transitions to the I(2P312)and I*(2P112)states, respectively. A comp@on with the two spectra at shorter delay times shows that the intensities of these atomic transitions increase monotonically with At. In addition, there is a transient signal on the high electron kinetic energy side of each atomic transition that is of comparable intensity in the spectra at At = O and 150 fs but has decayed to zero by

At= 425 fs. A comparison of the spectra at At = O and 150 fs shows that the transient

signal is shifted towards the atomic transitions at the longer delay time.

The full data set of 21 photoelectron spectra is shown as a three-dimensional

surface plot in the bottom half of Fig. 3. This plot emphasizes the temporal structure of

the signal at each electron kinetic energy, and shows that depending on the electron

kinetic energy, the signal is either monotonically increasing or transient with a full width

at half-maximum (FWHM) of about 200 fs. The value of At at which the transient signal

reaches a maximum depends on the electron kinetic energy, as indicated by the dark lines

in Fig. 3. As the electron kinetic energy decreases (i.e. moves towards the atomic

transition), the maximum occurs at longer values of At. Chapter 3 107 40( I 1 I I

o fs ...... 150f 30( ----- 425 f .-& I m $c 20( —c L *O*. \ “. 10( \ “. \\ “*.* \\ ““*. \\ ““*. “.*. % -0.5 1.0 1.5 2.0 2.5 Electron Kinetic Energy/eV

‘1/2 ~ ‘3/2

AIA

-42+=

Fig. 3. Experimental femtosecond photoelectron spectra of 12-.Upper panel: spectra at three delay times. Lower panel: spectra at21 delay times ranging from -400 to 725 fs. Assignments of various energy ranges are indicated. The dark lines show the delay time at which the maximum intensity of transient signal occurs for each electron kinetic energy. .—

108 Chapter 3 The monotonically increasing r signal clearly comes from fully dissociated I;.

. The transient signal can be assigned with reference to the potential energy curves in Fig.

1. At 260 nm, the ~ lX;, ~’311zU, ~ 3111U,and ~ 31TO+Ustates of ILshould be

energetically accessible by photodetachment from the excited 12-2Hg,uz state over the full

range of internuclear distances probed in the experiment. However, the ~ 1X; state of 12

cannot be reached by a one-electron photodetachment transition from the 2Hg,m state of

12-;the valence molecular orbital configurations for these states are ag2 Z4 zg4 and og2 %4

Z~30U2,respectively. Transitions from the excited anion to the ~ 1X; state should

therefore be weak or non-existent, whereas the other three states are accessible by one-

electron photodetachment transitions. Fig. 1 shows that the excited anion and neutral

potential energy curves are closer at short internuclear distances than in the asymptotic

region. We therefore assign the transient signal on the high kinetic energy side of the I-

+I(2P312) and r+I*(2PlD) peaks to transitions from the dissociating anion to the

~’3112,, / ~ 3HIU states and the ~ 3?10+Ustate, respectively; these assignments are

indicated in Fig. 3.

In order to interpret the spectra in more detail, quantum mechanical simulations of

the time-resolved photoelectron spectra have been performed, using a wavepacket

propagation scheme developed by Kosloff.zg Wavefunctions Iyn (t)), with n = 1,2 or 3,

are represented on a spatial grid for each of three potential energy curves: 1 = 12-

(~ 2Z~); 2 = 12-(211g,l,2);3 = Iz (~’3112U, ~ 3111U,orfi 3110+U). Morse functionsll~lg-21

were used for all states. Chapter 3 109 The simulations are carried out in two steps. The wavepacket for the dissociating anion, V2(t)), k found by numerically integrating the time-dependent Schrodinger equation

II@ = H, -k~;,(f) ~.~ Iw)) (2) d?(I!%(0)H–/+%(0 HZ 1(Iw)) )

Here H. is the nuclear Hamiltonian for state n, EIz(t) = E12sech(t/T12)exp(–i@ zt) is the time-dependent pump laser field (Elz is the maximum field intensity; T12,the pulse width;

COIZ,the ca~ier frequency), and fllz is the transition dipole moment between states 1 and

2, assumed to be constant for all internuclear distances.

First order perturbation theory is then used to calculate I~~(t; S, At)), the neutral vibrational wavefunctions corresponding to electron kinetic energy azg This is given by:

Iv~(t; .E,At)) = -~ ~dt’e-i(~3+E)(’-’’)’fiE2,At)l At)l ~,(t’)) (3) where At is the time delay between pump and probe pulses, H3 is the nuclear Hamiltonian for state 3, &is the electron kinetic energy, and E23(t - At) is the probe laser field, with the same assumed functional form as for EIZ(t). The transition dipole moment A23is again assumed to be constant for all distances. The time-dependent photoelectron intensity is then obtained by calculating the norm of IV3) in the long-time limit:’2g~s0

P(E,Af) =lim(y3(t;E,@y3(f;E,At))= E23(t’- At)e’H’’”h\y,(t’))] ‘ + Peia’m[ (4)

Note that the bracketed expression in the integrand is the argument of a Fourier

transform. Thus, once the set of wavefunctions I~(t’)) = e;”]’”hl y2 (r’)) is determined, the entire photoelectron spectrum is readily calculated. In addition, since Ez3(t’ – At) is a

,,-,,,:../ ,,, ----<.:.---: ’----- :.-47-- ,- 110 Chapter 3 scalar multiplier, it can be applied independently of x(t’)), allowing calculation of the spectrum for arbitrary At or probe pulse shape without re-determining I v2(t’)).

Raw spectra were convoluted with the instrument resolution function for an isotropic electron angular distribution, assuming electrons are collected over 4Z steradians in our experiment:

(5)

Here M = ion mass, m, = electron mass, U = ion beam energy, is= electron kinetic energy

(center-of-mass frame) and E= electron kinetic energy (lab frame). Using M = 254 amu and U = 1200 eV gives an energy resolution of 0.20 eV for 1 eV electrons, in good agreement with experiment.

The spectra arising from transitions to the three neutral states of 12are calculated separately, then summed using the following weighting criterion: ~23 is assumed equal for transitions to the ~‘ 31T2Uand ~ 3111Ustates, and ~23for the transition to the fi 3HO+U state is adjusted so that ‘tie ratio of I*(2P11Z)to I(2P3j2)intensities (at large delay time)

reproduces the experimental value of 0.9.

The simulated spectra are shown in Fig. 4. Overall, the experimental and

simulated spectra are in reasonable agreement. The transient signal appears over the same

energy range in both the experimental and simulated spectra, indicating that our

assignment of the transient features discussed above is correct. However, there clearly

are differences between the two spectra, and these are discussed in the next section. Chapter 3 111

.=z7 U5 -0’

Fig.4. Simulated femtosecond photoelectron spectra of I;using Eq.4in text. Delay times range from -400 to 600 fs. The dark lines show the delay time at which the maximum intensity of transient signal occurs for each electron kinetic energy.

4. Discussion

From the experimental spectra alone, one can obtain an approximate time scale for dissociation of excited 12-from the rise time of the signal corresponding to the product atomic transitions. This is plotted in Fig. 5 for electron kinetic energies of 1.65 eV and

0.75 eV, corresponding to the I-~I(2pq/z) and r+I(2pliz) transitions, respectively. In both cases, the electron signal reaches 50% of its maximum value by At= 140 fs. A more detailed picture of the dynamics comes from the temporal profiles at constant electron kinetic energy. As the electron kinetic energy decreases from the onset of the ~’/~ transient at 2.6 eV to the start of the I-+I(2P3/2) transition at 1.9 eV, the maximum in the temporal profile (dark line, Fig. 3) increases from At= 10 to At= 110 fs. A similar shift is seen for the B transient. This shift essentially tracks the dissociating wavepacket from

-, .-, . -,.“-- ..———

112 Chapter 3 the initial Franck-Condon region of excitation at short times, where the vertical detachment energy from the anion 2Hg,in state is smaller (see Fig. 1), to the ~YmPtotic region at longer times where the vertical detachment energy is larger. 350

250 ------* ‘~200 ------. ~ 150 — 100“ 50 - 0 -400 -200 0 200 400 600 800 Delay time/fs

Fig. 5. Appearance of signal versus delay time at electron kinetic energies of 1.65 and 0.75 eV, corresponding to r product. Solid lines: experimental spectra. Dashed lines: simulated spectra. Vertical line indicates At= 100 fs.

We next compare the experimental and simulated spectra. The transient signals

are noticeably less intense in the simulated spectra, and there is a broad peak centered at

2.5 eV and At = O fs in the simulated spectra that is not apparent in the experimental

spectra. However, the overall timescales in the simulated spectra are similar to those in

the experiment. Fig. 5 shows that the 50% level of the simulated signal at 1.65 eV occurs

at 100 fs, with a slighly longer rise time (120 fs) at 0.75 eV. From Fig. 4, the maxima in

the temporal profiles shift by 100 fs in the energy range of the two transients. Chapter 3 113 The lower intensity in the simulated spectra may simply result from our

assumption that the transition dipole for photodetachment, ~23, is constant in Eq. 3; this

discrepancy would be resolved if ~23were larger for small internuclear distances, before

dissociation is complete. On the other hand, it appears that the potential energy curves

used in the simulations reproduce the main features of the experimental dynamics

reasonably well. A new set of 12-potential energy curves has just been published, s 1and

it will be of interest to simulate the spectra using these new curves and compare the

results to experiment.

5. Summary

This Letter represents the first application of femtosecond photoelectron

spectroscopy to negative ions, specifically the photodissociation dynamics of Iz-. This

method offers considerable promise for performing time-resolved studies of molecular

and cluster anions. The general advantage afforded by FPES is that the probe pulse need

not be tunable; the photoelectron spectrum maps out the dissociating anion state onto all

neutral states that are energetically accessible at the photon energy of the probe laser. In

the case of 12-,the wavefunction for the dissociating anion is simultaneously mapped onto

the ~’3112U, ~ 3llIU, and ~ 3110+Ustates of 12. Moreover, since electron binding

energies in negative ions are relatively low, on]y one photon is typically required to

photodetach the dissociating ion anywhere along the reaction coordinate. One can

therefore analyze the spectra relatively easily, in contrast to analogous experiments on

neutrals where multiple photon absorption is typically required for ionization.

.,,.!. ,T .,. - .-..., , f - -~, ’-.-y-.-., .. -., . . . . !. .;;:T , ;y’ .- ,? :< .>.. /;,.., ,...:, ‘f.. . ——..

114 Chapter 3 6. Acknowledgments

This research is supported by the National Science Foundation under Grant No.

CHE-9404735. Support from the Defense University Research Instrumentation Program and Air Force Office of Scientific Research under Grant No. F49620-95-1-O078 is also gratefully acknowledged. The authors thank Prof. Yongqin Chen for many invaluable discussions.

7. References

1 A. H. Zewail, J. Phys. Chem. 97, 12427 (1993).

2 J. C. Polanyi and A. H. Zewail, Ace. Chem. Res. 28, 119 (1995).

3 D. Ray, N. E. Levinger, J. M. Papanikolas, and W. C. Lineberger, J. Chem. Phys. 91,

6533 (1989).

4 J. M. Papanikolas, V. Versa, M. E. Nadal, P. J. Campagnola, H. K. Buchenau, and W.

C. Lineberger, J. Chem. Phys. 99,8733 (1993).

5 J. M. Papanikolas, V. Versa, M. E. Nadal, P. J. Campagnola, J. R. Gord, and W. C.

Lineberger, J. Chem. Phys. 97,7002 (1992).

6 J. M. Papanikolas, J. R. Gord, N. E. Levinger, D. Ray, V. Versa, and W. C.

Lineberger, J. Phys. Chem. 95,8028 (1991).

7 T. Baumert, R. Thalweiser, and G. Gerber, Chem. Phys. Lett. 209,29 (1993).

8 I. Fischer, D. M. Villeneuve, M. J. J. Vrakking, and A. Stolow, J. Chem. Phys. 102,

5566 (1995).

9 B, Kim, C, P, Schick, and P. M, Weber, J. Chem, Phys, 103,6903 (1995).

10 D. R. Cyr and C. C. Hayden, J. Chem. Phys. 104,771 (1996). Chapter 3 115 11 E. C. M. Chen and W. E. Wentworth, J. Phys. Chem. 89,4099 (1985).

12 C. J. Delbecq, W. Hayes, and P. H. Yuster, Phys. Rev. 121, 1043 (1961).

13 L. Andrews, J. Am. Chem. Sot. 98,2152 (1976).

14 H. N. Hersh, J. Chem. Phys. 31,909 (1959).

15 R. ~ria, R. Abouaf, and D. Teillet-Billy, J. Phys. B: At. Mo1. Opt. Phys. 21, L2 13

(1988).

16 J. M. Papanikolas, P. E. Maslen, and R. Parson, J. Chem. Phys. 102,2452 (1995).

17 A. E. Johnson, N. E. Levinger, and P. F. Barbara, J. Phys. Chem. 96,7841 (1992).

18 p. K. Walhout, J. C. Alfano, K. A. M. Thakur, and P. F. Barbara, J. Phys. Chem. 99,

7568 (1995).

19 X. N. Zheng, S. L. Fei, M. C. Heaven, and J. Tellinghuisen, J. Chem. Phys. 96,4877

(1992).

20 x. N. Zheng, S. L. Fei, M. C. Heaven, and J. Tellinghuisen, J. Molec. Spectrosc. 149,

399 (1991).

21 J. I. Steinfeld, R. N. Zare, L. Jones, M. Lesk, and W. Klemperer, J. Chem. Phys. 42,

25 (1965).

22 R. B. Metz, A. Weaver, S. E. Bradforth, T. N. Kitsopoulos, and D. M. Neumark, J.

Phys. Chem. 94, 1377 (1990).

23 L. A. posey, M. J. DeLuca, and M. A. Johnson, Chem. Phys. Lett. 131, 170 (1986).

24 C.-Y. Cha, G. Gantefor, and W. Eberhardt, Rev. Sci. Instrum. 63,5661 ( 1992).

25 0. Cheshnovsky, S. H. Yang, C. L. Pettiette, M. J. Craycraft, and R. E. Smalley, Rev

Sci. Instrum. 58,2131 (1987).

.,, ,...... -,: ...... ,-.r~, . 116 Chapter 3 26 W. C. Wiley and I. H. McLaren, Rev. Sci. Instrum. 26, 1150 (1955).

27 M.D. Davidson, B. Broers, H. G. Muller, and H. B. van Linden van den Heuvell, J.

Phys. B 25,3093 (1992).

28 R. Kosloff, Annu. Rev. Phys. Chem. 45, 145 (1994).

29 C. Meier and V. Engel, Phys. Rev. Lett. 73,3207 (1994).

30 M. Seel and W. Domcke, J. Phys. Chem; 95,7806 (1991).

31 J. G. Dojahn, E. C. M. Chen, and W. E. Wentworth, J. Phys. Chem. 100,9649 (1996). 117 Chapter 4. Time-resolved photodissociation dynamics of l;(Ar). clusters using anion femtosecond photoelectron spectroscopy*

Anion femtosecond photoelectron spectroscopy (FPES) is used to follow the dynamics of the Iz-(Ar)ij and 12-(Ar)20clusters subsequent to photodissociation of the Iz- chromophore. The experiments show that photodissociation of the 12-moiety in Iz-(Ar)b is complete by -200 femtoseconds (fs), just as in bare 12-,but also that attractive interactions between the departing anion fragment and the solvent atoms persist for 1200 femtoseconds. Photodissociation of I~(Ar)zO results in caging of the I; followed by recombination and vibrational relaxation on the excited ~ 211~~fl state and the ground

~ 2Z~ states; these processes are complete in 35 picosecond (ps) and 200 picosecond, respectively.

1. Introduction

Our understanding of the potential energy surfaces governing the dynamics of elementary chemical reactions in the gas phase has grown significantly during the past 10 years, largely because of the development of new frequency and time-resolved experimental techniques I‘zcombined with theoretical advances in quantum chemistry and reaction dynamicsA. A very appealing new direction in this field is to investigate, in a systematic way, the effects of solvation on reaction dynamics. Studies of chemical reactions occurring within size-selected clusters provides an elegant means of achieving this goal, because one can monitor qualitative changes that occur as a function of cluster

- B. J. Greenblatt,M. T. Zanni,and D. M. Neumark,Science276, 1675(1997).

.. ,—-.. -.. ,!, .-,?., ‘-,, ;.s-<-‘-” “,- —— ..— .—

118 Chapter 4 size and ultimately learn how the dynamics of an elementary unimolecular or bimolecular reaction evolve as one approaches a condensed phase environments It is particularly useful to perform such experiments on ionic clusters, for which size-selection is straightforward. We recently performed a time-resolved study of the photodissociation dynamics of the 12-anion using a new technique, anion femtosecond photoelectron spectroscopy (FPES)6. We now apply this method to follow the dynamics that result from photodissociation of the 12-chromophore in the clusters Iz-(Ar)Gand 12-(Ar)20. These experiments yield time-resolved measurements of the anion-solvent interactions subsequent to photodissociation and, in the case of Iz-(Ar)zo, provide new insight into the caging and recombination dynamics of the 12-moiety.

Anion FPES is a pump-probe experiment that uses two femtosecond pulses, a pump pulse that photodissociates an anion (or anion chromophore in a cluster) and a probe pulse that ejects an electron from the dissociating species. By measuring the resulting PE spectrum at various delay times, the experiment yields “snapshots” of the dissociation dynamics, and in particular probes how the local environment of the excess electron evolves with time. This highly multiplexed experiment yields information on the entire photoexcited wavepacket at each delay time, in contrast to most pump-and-probe experiments in which signal is observed only if there is an absorption at the frequency of the probe pulse. Although FPES has also been applied to neutrals,T-g the anion experiment is inherently mass-selective, making it especially useful in studies of size- selected clusters.

The present work builds on the experiments of Lineberger and co-workers,lo-lz

who performed one-photon photodlssociation and time-resolved pump-and-probe Chapter 4 119 experiments on size-selected 12-(C02)n and 12-(Ar)ncluster anions, and on the time- resolved studies of neutral 12(Ar)nclusters by Zewail and co-workers. 13 The one-photon cluster anion experiments yield the asymptotic daughter ion distributions as a function of initial cluster size, in particular the relative amounts of “caged” 12-(Ar)~l<~ products, in which the I and r photofragments are trapped by the solvent atoms and eventually recombine, versus “uncaged” I-(Ar)~2

12-(Ar). with -a>= 11. The time-resolved experiments on Iz-(Ar)20 yield a time constant of

127 ps for recovery of the 12-absorptionlz; this represents the overall time scale for recombination and relaxation of the 12-product. Our experiment provides a more complete picture of the dynamics following excitation of Iz-(Ar)Gand Iz-(Ar)zo, and in particular clarifies the origin of the two product channels seen for 12-(Ar)zo.

2. Experimental

The FPES experiment is described in detail elsewhere.6 Briefly, a pulsed, mass- selected beam of cold cluster anions is intercepted by the pump and probe pulses at the focus of a “magnetic bottle” time-of-flight PE spectrometer. The two laser pulses are generated by a Ti:sapphire oscillator/regenerative amplifier system (Clark MXR) operating at a repetition rate of 500 Hz. The pump pulse at 780 nm and the probe pulse at

;.,.,. .... , ,.,,:. .. :,,; Y,T,- -:--- .,.,.,.., 120 Chapter 4 260 nm are 80 and 100 fs long, respectively. The high laser repetition rate combined with the high (>507Q) collection efficiency of the magnetic bottle analyzer results in rapid data acquisition; each spectrum is typically obtained in 40 to 80s for 12-and Iz-(Ar)& and 10 to 15 minutes for 12-(Ar)20. At the ion beam energy used in this work (1750 eV), the electron energy resolution of the spectrometer at 1 eV electron kinetic energy (eICE) is

0.25 eV for 1;, 0.18 eV for IJ(Ar)6, and 0.12 eV for I~(Ar)20.

]+l*+e- l+l+e-

X2ZU+ .- Pump (780nm)~ ‘L — — 3— 4 5 Distance//!

Fig. 1. Potential energy curves for the low-lying electronic states of Ii and 12. The curves for the I; ~ 2Z~ ~’ 21Z~,l,2states are taken from Refs. 1Aand 15,respectively. For the ~ state, De=l .01 eV and R,=3.205 ~. The Z 2H~,3n state is described in the text. The v=O and v=5 wavefunctions on the 12-~ and ~ states are also shown (see text). The 12curves are from Ref. lb and references therein. Chapter 4 121 The relevant potential energy curves for 12-and 12are shown in Fig. 1.14-]b The pump pulse excites the ~’ 211~,,,z+ ~ 2Z~ transition in 12-,creating a localized wavepacket on the repulsive excited state. The probe pulse detaches the dissociating ion to the various low-lying states of 12shown in Fig. 1. In the bare ion, rapid and direct dissociation to r + I(2P312)occurs. However, when the same 12-transition is excited in an

I~(Ar)n cluster, the recoiling fragments interact with the Ar atoms, and the FPES experiment provides a sensitive probe of these interactions.

3. Results

Fig. 2 shows selected PE spectra at various pump-probe delay times ~ for Iz-,

Iz-(Ar)b and 12-(Ar)20.The spectra of Iz- in Fig. 2a have been discussed in detail previously.G Two peaks centered at eKE = 1.70 eV and 0.75 eV rise monotonically with increasing delay; these correspond to photodetachment of the 1 photodissociation product to the I(2P312)and I*(2P112)atomic states, respectively. In addition, there is a transient signal peaking at z=5O-1OOfs on the high electron energy side of each product peak attributed to the dissociating ions. The product peaks dominate the spectra by 200 fs, and no further changes are observed at later times, indicating dissociation is complete.

Fig. 2 (on next page). Anion femtosecond photoelectron spectra at various pump-probe delay times ‘t for (a) Ii, (b) I~(Ar)b, and (c) I;(Ar)zo. In Fig. 2b, the I; spectrum at 250 fs is superimposed on the Iz-(Ar)b spectrum at 240 fs for comparison. In Fig 2c, the signal at eKE >1.6 eV is magnified by a factor of 6 for @1 PS. A simulation of the Iz-(Ar)~O spectrum at 200 ps is superimposed on the experimental spectrum at the top of Fig. 2c. Contributions to the simulation from transitions originated from the I; ~ state (...) and ~ state (---) are indicated. .

122 Chapter 4 t i 1 1 1 1 1

u) N’ o N q

I-:::::::::.:::: -:::::::::::::::*

Id

q o N

o

A]lsua]ul. Chapter 4 123 The I;(Ar)c spectra in Fig. 2b resemble the Ii spectra at first glance, particularly

for ~c240 fs. By ~=240 fs, the spectra for Iz-(Ar)c consist of two peaks clearly analogous

to the atomic I-r transitions in the 12-spectra. However, these two “r” peaks occur at

0.12 lower eKE than for barer. In addition, they gradually shift toward 0.10 eV higher

eKE as ~ increases from 240 to 1200 fs. The spectra do not change after ~=1200 fs.

The spectra for I~(Ar)20 in Fig. 2C show the same general trends up to t= 1 ps.

Two new trends are seen at later times, however. First, as ‘cincreases from 1 to 35 ps, the

two ‘T” peaks apparently reverse direction and shift toward lower eKE by about 0.14 eV.

Second, a new, broad feature at high electron energy (eKE>l.6 eV) appears at ~4 ps.

This feature shifts toward lower eKE until 7=200 ps, after which no further significant

evolution occurs. Two small peaks between the two “r” peaks also grow in on this time

scale.

4. Discussion

The Iz-(Ar)c spectra indicate that the dynamics subsequent to photoexcitation can

be divided into two time regimes. At early times (z ~ 240 fs), the 12-chromophore

dissociates to r + I. The similarity between these spectra and those for 12-indicates that

the primary bond-breaking dynamics are not affected by clustering, and that this process

is complete by 240 fs. The interpretation of the spectra in the second time regime, from

240 to 1200 fs, is aided by our previous measurements of the electron affinities of I(Ar)n clusters, which show that each Ar atom increases the electron affinity by -25 meV. 1T

The 0.12 eV energy offset in the “1-”peaks at 240 fs relative to bare 1-is what would be expected for an 1-ion bound to 5 Ar atoms. As ~ increases, the shifts of these peaks

-. ,. -.,...... —.—

124 Chapter 4 toward higher eKE indicate that the r is interacting with progressively fewer Ar atoms.

The spectrum at 1200 fs is that expected for Arr; this is consistent with the mass- resolved experimental 1 that show Arr to be the dominant product from Iz-(Ar)(j photodissociation. Thus, the evolution of the spectra from 240 to 1200 fs reflects the progressively weaker interactions between the solvent atoms and the r fragment, with formation of the asymptotic Arr product complete by 1200 fs.

One picture of the dynamics during the second time regime consistent with the

spectra is that once the 12-chromophore is dissociated, the neutral I atom is ejected,

leaving behind a vibrationally hot r(Ar)n cluster from which Ar atoms evaporate until the

available energy is dissipated, with Arr as the stable product. This picture is suggested

by molecular dynamics simulations carried out by Amar18 on Br2-(C02)n clusters.

However, recent molecular dynamics simulations by Faeder et al.lg~zo suggest a

somewhat different mechanism. Their calculations predict that the equilibrium geometry

of Iz-(Ar)Gis an open, highly symmetric structure consisting of a ring of Ar atoms lying in

the plane that bisects the 12-bond. When the 12-is dissociated, the I and r fragments

separate sufficiently rapidly so that the Ar atoms do not cluster around the r fragment.

Instead, the departing r fragment abstracts one of the solvent atoms, on average, as the

cluster breaks up. The shifts in the PE spectrum during the second time regime are

qualitatively consistent with this picture, in that as the r fragment leaves the cluster, its

attractive interactions with the solvent atoms decrease and the electron afllnity drops.

We next consider the I~(Ar)zo clusters, for which cagingiscomplete.11 The

overall appearance and evolution of these spectra from 300 fs to 1 ps is similar to that

seen for I~(Ar)6, in that there are two ‘T” peaks that shift towards higher electron energy Chapter 4 125 as ~ increases. Thus, up to z= 1 ps, the cluster contains I and 1-fragments that are

essentially independent of one another. The shifting of the peaks towards higher eJSE can

again be explained as a progressive weakening of the interactions between the 1-fragment

and the solvent atoms. This is probably due to a combination of evaporation of solvent

atoms induced by the recoil energy of the I and 1-fragments (- 0.6 eV), and the rather

large excursions that the r fragment makes within the cluster as the I and 1-photoproducts

separate on the repulsive ~’ 2Hg,l/2 state. Molecular dynamics simulations by Batista

and Cokerzl predict the inter-iodine separation increases to 8-10 ~ after 1 ps has elapsed,

a distance comparable to the original size of the cluster, and it is likely that the strength of the solvent interactions with the 1-decreases while this occurs.

The evolution of the I~(Ar)20 spectra at later times can be explained as a result of recombination of the I and 1-on the two lowest potential energy curves in Fig. 1. The shifting of the two “17’peaks towards lower energy from z= 1 to 35 ps is consistent with recombination and vibrational relaxation on the ~ 211~~fl curve. Recent ab initio calculations predict that R.= 4.18 ~ and D,=O. 11 eV for this state.22 Fig. 1 shows that at such a large internuclear distance, photodetach~ent will access the neutral potential energy curves near their asymptotic energies. This will yield two peaks approximately separated by the I atom spin-orbit splitting, but shifted toward lower electron energy compared to bare 1-by the well depth (D,) of the ~ 2H~,~flstate and the sum of the attractive interactions with the remaining Ar atoms. If we use an approximate binding energy of 73 meV/Ar, 11the total energy released by the recoiling photofragments and by vibrational relaxation of the 12-to the v=O level of the ab initio ~ 211~~n state is 126 Chapter 4 sufficient to evaporate 9 Ar atoms, so this excited state recombination mechanism is the

, I likely Ofigin of the Iz-(Ar)a,.l ~product seen by Lineberger and co-workers. From these considerations, it is reasonable to attribute the signal at eKE>l.6 eV to recombination on the ~ 2X; state followed by vibrational relaxation. This can release enough energy to

I evaporate all of the Ar atoms, leaving 12-(v=8) in the limit of zero photofragment KE.

In order to test these assignments, the spectrum at 200 ps was simulated assuming photodetachment to occur from Ii(Ar)l 1with the I; chromophore in the v=O level of the i 21-1~,3flstate, and from 12-(~ 2Z~ ) in a mixture of vibrational levels. The simulations involve calculating the Franck-Condon factors between the anion and neutral vibrational wave fimctions and scaling the results for different electronic transitions to best match the

experimental intensities. For the ~ 211g,3n state, Re md De w= t~en to be 45 ~ and

0.16 eV, respectively, with both values differing somewhat from the ab initio values; these differences may reflect in part the influence of the remaining Ar atoms in the cluster. Best results for the ~ 2X: state were obtained using a vibrational distribution with 0>=5. The results, shown in Fig. 2c, reproduce the experimental spectrum quite well. The 12-(~ 211g,3fl,v=O) and 12-(~ 2X;, v=5) vibrational wave functions are superimposed on the appropriate potential energy curves in Fig. 1. Note that photodetachment from the inner turning point of the 1~( ~ 2X:, v=5) wave function is

responsible for the signal at eKEs 1.6 eV; the outer turning point contributes to the “1-”

peak at 1.35 eV along with photodetachment from the Ii ~ 2~g,3n state. Chapter 4 127 The shifting of the signal at eKE >1.6 eV toward lower energy from 10-200 ps is attributed to vibrational relaxation of the ground state 12-accompanied by evaporative cooling of the Ar atoms, that is a series of reactions of the type 12-(v“)Arn+

12-(v‘o’ ‘)Ar.-l+Ar. As the 12-vibrational quantum number decreases, the contribution to the PE spectrum from the inner turning point of the vibrational wavefunction shifts towards lower eKE. Although this is partially compensated by the lowering of the electron affinity as Ar atoms evaporate, our simulations of the PE spectra show a net shift of the signal in this region towards lower eKE as the cluster cools. By comparing these simulations with the experimental spectra, and starting with the 12-vibrational distribution at 200 ps, one can estimate the average number of Ar atoms e> and 12-vibrational quantum number for ~c200 ps. We find that e>=2, EV>=17 at ~=35 ps, and

CO=4.5, OS=32 at ~= 10 ps. It therefore appears that 15 or 16 of the original 20 solvent atoms evaporate in the first 10 ps, and that the evaporation rate slows down markedly at later times.

5. Conclusions

Our spectra yield the following picture of the dynamics resulting from photoexcitation of I~(Ar)zo. As with I; and I;(Ar)G, dissociation of the Ii chromophore is complete by 300 fs. Between 300 fs and 1 ps, the interaction between the I and 1-atoms within the cluster is very weak. After 1 ps, the I and r atoms recombine on either of the two lower-lying attractive potential energy surfaces. Recombination on the x 2rIg#3nstate leads to 12-(Ar)=l1 product in which the 12-is vibrationally cold, whereas recombination aon the ~ 2Z~ state results in bare Iz- with KV>=5. The first

*: .: 7-: : ‘-’!- ,.~~.,l ,,----- 128 Chapter 4 process is complete by 35 ps, whereas the second, involving considerably more energy . flow between the 12-and the solvent atoms, is over after 200 ps. Although recombination on the ~ 211~,3n state was proposed as a possible mechanism in Lineberger’s earlier studyl 1, our experiments provide conclusive spectroscopic evidence that this occurs.

6. Acknowledgments

This research is supported by the National Science Foundation under Grant No.

CHE-9404735. Support from the Defense University Research Instrumentation Program under Grant No. F49620-95-1-O078 is also gratefully acknowledged. The authors thank

J. Faeder, P. Maslen, V. Batista, and R. Parson for helpful discussions and for providing access to unpublished results. We are grateful to R. J. Le Roy for a copy of RKR1: A

Computer Program for Implementing the First-Order RKR Method for Determining

Diatom Potential Energy Curves from Spectroscopic Constants.

7. References

1 A. H. Zewail, J. Phys. Chem. 100, 12701 (1996).

2 P. L. Houston, J. Phys. Chem. 100,12757 (1996).

3 M. H. Head-Gordon, J. Phys. Chem. 100,13213 (1996).

4 G. C. Schatz, J. Phys. Chem. 100,12839 (1996).

5 A. W. Castleman, Jr. and K. H. Bowen, Jr., J. Phys. Chem. 100,12911 (1996).

6 B. J. Greenblatt, M. T. Zanni, and D. M. Neumark, Chem. Phys. Lett. 258,523

(1996).

7 D. R. Cyr and C. C. Hayden, J. Chem. Phys. 104,771 (1996).

8 P. Ludowise, M. Blackwell, and Y. Chen, Chem. Phys. Lett. 258,530 (1996). Chapter 4 129 9 A. Assion, M. Geisler, J. Helbing, V. Seyfried, and T. Baumert, Phys. Rev. A 54,

R4605 (1996).

10 J. M. Papanikolas, V. Versa, M. E. Nadal, P. J. Campagnola, H. K. Buchenau, and W.

C. Lineberger, J. Chem. Phys. 99,8733 (1993).

11 V. Versa, P. J. Campagnola, S. Nandi, M. Larsson, and W. C. Lineberger, J. Chem.

Phys. 105,2298 (1996).

12 V. Versa, S. Nandi, P. J. Campagnola, M. Larsson, and W. C. Lineberger, J. Chem.

Phys. 106, 1402 (1997).

13 Q. L. Liu, J.-K. Wang, and A. H. Zewail, Nature 364,427 (1993).

14 M. T. Zanni, T. R. Taylor, B. J. Greenblatt, B. Seep, and D. M. Neumark, J. Chem.

Phys. 107,7613 (1997).

15 E. C. M. Chen and W. E. Wentworth, J. Phys. Chem. 89,4099 (1985).

16 D. R. T. Appadoo, R. J. Leroy, P. F. Bemath, S. Gerstenkom, P. Luc, J. Verges, J.

Sinzelle, J. Chevillard, and Y. Daignaux, J. Chem. Phys. 104,903 (1996).

17 I. Yourshaw, Y. Zhao, and D. M. Neumark, J. Chem. Phys. 105,351 (1996).

18 L. Perera and F. G. Amar, J. Chem. Phys. 90,7354 (1989).

19 J. Faeder and R. Parson, J. Chem. Phys. 108,3909 (1998).

20 J. Faeder, N. Delaney, P. E. Maslen, and R. Parson, Chem. Phys. Lett. 270, 196

(1997).

21 V. S. Batista and D. F. Coker, J. Chem. Phys. 106,7102 (1997).

22 P. E. Maslen, J. Faeder, and R. Parson, Chem. Phys. Lett. 263,63 (1996). —-—.

130 Chapter 5. Time-resolved Studies of Dynamics in Molecular and Cluster Anions* .

Femtosecond photoelectron spectroscopy (FPES) is used to study the time- I resolved photodissociation dynamics of Iz-(COz)na,lG clusters excited at 780 nm. The

FPES experiment on IJ(C02)4 shows that the r fragment formed by excitation to the A’

21_1112,~repulsive state of 12-initially pulls away from the cluster, but by 0.2 ps it is drawn back to complex with more of the solvent molecules. In the n=16 cluster, where caging of the 12-is known to be complete, FPES probes the recombination dynamics of the 12-in considerable detail. Specifically, vibrational relaxation on the 12- X 2Z~ state and the

accompanying evaporation on COZ molecules can be followed in real-time. Vibrational relaxation is essentially complete by 10 ps, whereas solvent evaporation is not entirel y complete by 200 ps. The spectra also show evidence for short-lived recombination on the

12-A 2113i2,gstate. The results are compared to previous experimental results for Iz-(Ar)n

clusters and recent simulations of cluster dynamics.

1. Introduction

The effect of clustering on the dynamics of elementary chemical processes has

been the focus of considerable interest, as it offers a route toward understanding the

evolution of chemistry from gas phase to condensed phase environments. Much of the

original work in this area focused on neutral van der Waals clusters,l-s in which a

chromophore such as 12was complexed to one or more solvating species, and the

resulting effects on the chromophore photophysics were probed using laser-induced

*B. J. Greenblatt, M. T. Zanni, and D. M. Neumark, Faraday Discms., 108, 101 (1997). Chapter 5 131 fluorescence, multiphoton ionization, and other spectroscopic/dynamical probes. More

recently, femtosecond time-resolved techniques have been applied to clusters of this

type.Q1s A parallel effort has developed in the study of ionic clusters comprised of

solvated charged chromophores.G These experiments have an advantage over neutral

cluster studies in that there is generally no ambiguity concerning the size of the cluster,

an important issue if one is trying to probe size-dependent effects. Clusters of Iz- with Ar

and C02 have been of particular recent interest; the photodissociation dynamics of these

clusters have been studied in an elegant series of frequency and time-resolved

experiments by Lineberger and co-workers. T-l’$We have undertaken studies of these

clusters using a new experimental technique, femtosecond photoelectron spectroscopy

(FPES), providing a picture of the photodissociation dynamics that in many ways

complements the Lineberger experiments. Previously we have reported results on Iz- and

12-(Ar). clusters. 1$16 Here new results for I~(C02)n clusters are presented and discussed

in light of earlier experiments on 12-(Ar)~clusters.

Two types of experiments have been performed by Lineberger’s group on clusters

of 12-and other dihalides with C02 and Ar. In the experiments on 12-(see Fig. 1), the

anion is photoexcited from the X 2Z~ state to a repulsive electronic state, theA’2 II,,2 ~

state, and the subsequent interactions between the recoiling photofragments and solvent

species (S) are probed. In one set of experiments,T~g~ls,zzthe product masses from one-

photon dissociation were determined. These experiments show that for small numbers of

solvent species, only “uncaged” ionic products of the type l-(S). are produced, whereas

for larger clusters, stable products of the type X~(S). dominate. These “caged” products

result from recombination of the photofragments on a lower-lying, bound state of Iz-, a

,,, . . .. . “., -.. ,,,..<.,.~,- -,- ..,.:.+,,.,, ~- ~.,.w,” ,.-,.,: .—— .—

.

132 Chapter 5 m 1 1

, I*(T,,,)t ltp3,2) BI&3 A 4 ‘u 3 A* 4,, IfP,,,)+(R,,)

Probe(260nm)

cl) s I-(’so) + lfp3,2) UJo

Pump (780nm) -9 . . m -L 2 3 4 5 6 Distance/)!

Fig. 1. Potential energy curves for low-lying electronic states of Ii and 12. Correlating atomic states are indicated to the right. The anion X 2&+ and A 2173n,~state parameters are taken from Ref. 16. The anion A’2171fl,~state parameters are taken from Ref. 17. Neutral state parameters are from Refs. 18-21. process analogous to geminate recombination in solution.zs The second set of experimentsg-1 1$14used a two-photon pump-and-probe scheme with picosecond and, more recently, femtosecond lasers to perform time-resolved studies of the recombination dynamics in clusters of 12-sufficiently large so that caging occurs. In these experiments, the 12-chromophore is dissociated with the pump pulse, and subsequent absorption of the probe pulse (of the same color) is monitored as a function of delay time. The experiments yield the overall time scale for recombination and vibrational relaxation of the Ii on its Chapter 5 133 ground electronic State: 1.3 ps in the case of IZ-(COZ)lG,versus 130 ps for Iz-(Ar)zO.14

While the recovery of the 12-absorption is monotonic for 12-(Ar). clusters, the results for

IZ-(COQ)lGhave been interpreted in terms of “coherent recombination” of the photofragments occurring on the A 211~,2,~excited state of 12-(see Fig. 1) -2 ps after the pump pulse.g~lO~lAIn related work, the time-resolved recombination dynamics of Iz”in solution were studied by Barbara and co-workers via transient absorption in a variety of polar solvents.z’$~zs The absorption recovery times lie in the range of a few picosecond, i.e. a similar time scale to the 12-(C02)~ clusters.

The finite clusters have been considered in a series of theoretical papers in which molecular dynamics simulations are used to determine the equilibrium geometries of the clusters and track the dynamics subsequent to photodissociation of the dihalide chromophore. The original studies by Perera and AmarzG focused on the time scales for recombination and solvent evaporation on the ground electronic state of the dihalide.

More recent work by Batista and Coker2T and Parson and co-workerszg-so has considered the importance and time-scale of non-adiabatic electronic transitions that occur subsequent to photoexcitation. Parson in particular has emphasized the role of

“anOrnalous charge switching” in these clusters, in which the asymmetric charge distribution on the two iodine atoms induced by solvation in the cluster ground state is reversed in the photoexcited state.

The FPES experiments discussed here were undertaken to provide a more complete picture of the dissociation dynamics in 12-(C02)~clusters. In these experiments, the 12-chromophore is excited to the repulsive A’ 217~,2,gstate by an ultrafast (-80 fs) pump pulse. The time-evolution of the cluster is monitored by photodetachment with an

,’,~-. ‘,$:. ! ,< ...... ‘z:~’ : ..- ,-.-:-”. ‘-’, ...... 134 Chapter 5 ultrafast probe pulse and measurement of the resulting photoelectron spectrum. At each pump-probe delay, the photoelectron spectrum provides a “snapshot” of the cluster dynamics, and is particularly sensitive to the local environment of the excess electron in the cluster. In contrast to the Lineberger’s pump-probe experiments, FPES can be used to investigate clusters in which no caging and recombination occurs. When recombination does occur, FPES can reveal the electronic state of the dihalide at each delay time, along with the degree of vibrational excitation and the approximate number of solvent species remaining in the cluster. Results are reported here for two clusters: 12-(C02)4, for which almost no caging occurs, and IZ-(COZ)lG,in which caging is complete.

2. Experimental

Although the FPES experiment has been described in detail elsewhere,ls several improvements have been made recently and are discussed below. Figure 2 shows the apparatus. Cluster anions are generated by passing a mixture of 3% C02 in Ar over 12 crystals at a backing pressure of 10-30 psig, expanding the gas mixture into a vacuum chamber through a piezoelectric valve running at a repetition rate of 500 Hz, and crossing the resulting free jet with a 1.5 keV electron beam just downstream of the nozzle. The resulting plasma cools collisionally to produce both positive and negative ions. After passing through a 5 mm diameter skimmer located 11 mm below the valve orifice, the negative ions are injected into a Wiley-McLaren time-of-flight mass spectrometer 1by applying pulsed extraction and acceleration fields perpendicular to the beam axis. The final beam energy varies between 800 eV and 1.7 keV, depending on the voltages used.

A three-plate pulsed mass gateqz insures that only anions of the desired mass interact with the lasers. Chapter 5 135 ● ✘ ● ● ● ● * ● . ● ● . ● . ● . ● . m ● . ..● !.● Iw I “d Ul Fig. 2. Schematic of the apparatus. Shown are the ion source, time-of-flight mass spectrometer, “magnetic bottle” photoelectron spectrometer and reflection photofragment anal yzer.

The original source chamber of our apparatus has been divided into two regions to

accommodate additional differential pumping. Each region is now pumped by a Varian

VHS- 10 diffusion pump with 4400 L/s pumping speed; this results in a considerable y

lower pressure in the region where the ion extraction pulses are applied. On their way to

the laser interaction region, the anions pass through two additional differentially pumped

regions. The first differential region is pumped by a Varian VHS-6 diffusion pump. The

second differential region and laser interaction region are each pumped by Varian V250

turbomolecular pumps. The base pressure in the final region is lx 10-9 torr.

Laser pulses cross the ion beam at the focus of a “magnetic bottle” photoelectron

spectrometer, which is based on the design of Cheshnovsky et al.32 However, a strong

(0.8 tesla) permanent magnet, rather than an electromagnet, is used to produce the

inhomogeneous magnetic field. It is located 9.5 mm below the beam axis, outside the

.;, ,. ,.,,,.,..,., ... 136 Chapter 5 vacuum chamber, and can be easily removed. A 1.3 m long solenoid field (20 gauss) guides the photoelectrons toward a 75 mm diameter dual microchannel plate detector.

The arrival time distribution is recorded after each laser shot with a Stanford Research

Systems SR430 multichannel scalar. Because of the inherently low resolution (-250 meV) of a spectrometer which collects all of the electrons ejected from a fast-moving ion beam, a pulsed deceleration field is used to slow the ions down just before the interaction region.sq?q’$ This results in an improvement in the electron energy resolution of up to a factor of four, with further improvements expected shortly.

An in-line microchannel plate detector mounted on a retractable translator arm is used to record time-of-flight mass spectra of the ion beam. We can also measure the photofragment mass spectra resulting from excitation of a particular cluster with the pump pulse alone. To do this, the primary ion detector is retracted, allowing the ions to continue into an off-axis reflectronT which separates the daughter and parent ions. These are collected by another microchannel plate ‘detector for photofragment mass analysis.

Both types of mass spectra are recorded using a Tektronix TDS744A digitizing oscilloscope at a repetition rate of-80 Hz.

The pump and probe laser pulses are generated from a commercial femtosecond laser system. A Coherent Innova-90 Ar+ laser pumps a Clark-MXR NJA-5 Ti:sapphire oscillator. Selected pulses are amplified using a Clark-MXR regenerative amplifier system that includes a pulse stretcher, a Ti:sapphire regenerative amplifier pumped by a

Nd:YAG laser running at a repetition rate of 500 Hz, and a pulse compressor. At 780 nm, the pump pulse wavelength, the pulse width and energy are 70 fs FWHM (sech2) and

1 mJ, respectively. About 80% of this beam is directed into a frequency tripling unit Chapter 5 137 (CSKOptronics8315A), resulting in a probe pulse at 260 nm with width and energy of

110 fs and 20 pJ, respectively. (The width of the probe pulse is measured by difference frequency cross-correlation using a 300 y.m thick KDP crystal). The remainder of the

780 nm pulse passes through a computer-controlled variable delay line, and is then collinearly recombined with the probe pulse prior to entering the vacuum chamber. The polarization of the pump and probe pulses are perpendicular to the ion beam axis. For accurate determination of the temporal overlap of the pulses inside the vacuum chamber, two-color above threshold photodetachment (ATD) of r is used.ss

Because the probe pulse wavelength is sufficient to detach electrons from ground state 12-(Ar)~and 12-(C02)~ clusters, the photoelectron spectra are not background-free.

Background subtraction is accomplished by either alternating 20s scans between the desired delay and a fixed, negative (–2 ps) delay, or by using an optical chopper (New

Focus 3501). The chopper blocks the pump pulse every other laser shot, and the SR430 scalar performs shot-by-shot background subtraction. Background spectra are also collected concurrently at 80 Hz repetition rate with the TDS744A oscilloscope. These are stored and used for longer-time normalization of the spectra. Depletion of the Iz- ground statesG causes a bleach of the background-subtracted signal, which is compensated by adding a percentage of the background back to the spectra. — . .

Chapter 5 I I I I I

B 1. 1- I 2 B2

1 I ! I 0.5 1.0 1.5 2.0 2.5 Electron Kinetic Energy / eV

Flg.3. Femtosecond photoelectron spectra of bme 1~, withdecelerated ion beam. The pump-probe delay times meindicated totheright of thespectra. Assignments of various features are indicated, and explained in the text. Chapter 5 139 3. Results

Figure 3 shows FPES spectra of bare 12- for several pump-probe delay times.

These spectra are taken using pulsed deceleration to slow down the ion beam; consequently the electron energy resolution (-100 meV) is substantially better than in our spectra reported and discussed previously. ]S As the delay time increases, two broad features, Al and A2 shift toward lower electron energy and evolve into two sharp features

B 1and B2, at electron energies of 1.71 and 0.77 ev, respectively. pe~s B 1and& represent photodetachment of the T photoproduct to the 2P312and 2Pu2 states of atomic iodine, respectively, whereas the broader features Al and A2 at early times result from photodetachment of the dissociating wavepacket on the A’ 211,,2,g anion state to the close lying A’3112Uand A 3111Ustates (Al), and the B 3110+Ustate (Az) of neutral 12. No evolution of the spectra occurs after 200 fs, indicating that dissociation of the bare ion is complete by this time.

Femtosecond photoelectron spectra for 12-(C02)4 are shown in Figure 4, also with a decelerated ion beam. At short times, from 0.0 to 0.1 ps, the evolution of the photoelectron signal between 1.4 and 2.0 eV is similar to bare 12-,in that a broad feature

(A) arises and shifts toward lower electron energy to forma narrower peak (Bl). At lower energy, a second sharp feature (Bz) arises on the same time scale. B 1and Bz are separated approximately by the spin-orbit splitting in atomic iodine (0.943 eV), and therefore appear to be analogous to the atomic 1-transitions in Fig. 3, although they are noticeably broader and shifted toward lower electron energy by 0.30 eV. By 0.2 ps, two new features are evident in the spectrum on the low energy side of B 1and B2, labeled C 1 and C2, with each of the new features occurring at 0.14 eV lower electron energy than the Chapter 5

8

I I I I 1 I 0.5 1.0 1.5 2.0 2.5 Electron Kinetic Energy / eV

Fig. 4. Femtosecond photoelectron spectra of I~(Coz)A (with decelerated ion beam). A simulation (---) of the 200 ps spectrum is shown superimposed on the experimental Chapter 5 141 spectrum. Labeled features are discussed in the text. Mass distribution used in simulation: n=l, 23%; n=2, 3990; n=3, 30%; n=4, 8%.

main peaks. By 0.5 ps, each doublet has evolved into a single broad peak (DI and Dz).

D1 broadens and shifts toward lower electron energy from 0.3-2 ps, followed by a slight

shift (0.05 eV) of the entire feature to higher energy between 2 and 200 ps.

Figure 5 shows femtosecond photoelectron SpeCtra fOr Iz-(C@l& k contrast to

the 12-and IZ-(C@LI spectra, no transitions to neutral electronic states correlating to

I(2P1j2) are seen; these are too high in energy for the probe pulse because of stabilization energy of the anion from the 16 solvent molecules initially. At 0.0 ps, the spectrum consists of a broad, symmetric feature (A) centered at 0.72 eV, which is analogous to the

transient in the FPES of bare 12-. As the delay time increases, this feature rapidl y disappears, while another broad feature (B) centered at 0.38 eV dominates the spectrum by 0.2-0.4 ps. By 0.7 ps, this feature appears as a shoulder on lower energy feature, labeled C in Fig. 5; this shoulder steadily decreases in intensity and disappears by 4.0 ps.

An additional high energy feature (D) is apparent starting at 0.7 ps between 0.5 and 1.7 eV. This feature increases in intensity to 1.6 ps, and from 1.6 to 10 ps shifts gradually toward lower electron energy. During this time, feature C shifts toward higher energy, coalescing with D into a single feature (E) by 10 ps.

,:7:. - - ..,,. .:

%, s \* *-9 ...... 07m

04■ 02m 1 1 I 008 05 10 15 20 Eleckron Kinetic Ene;gy / eV’

Fig. 5. I~(COz)lG femtosecond photoelectron SpeCtra. Simulations (---) Of SpeCtra at ().4 ps and later based on parameters in Table I are shown superimposed on experimental spectra. Between 0.4 and 10 ps, the vertical scale is expanded for energies larger than 0.9 eV. Labeled features are are discussed in the text. Chapter 5 143 4. Discussion

401. IZ-(COZ)A

It is instructive to compare the FPES results for 12-(C02)4 with those obtained for

Ia-(Ar)G.16Lineberger found that I-(C02)2 and I-(Ar) are the dominant products from the photodissociation of I~(C02)4 at 720 nm and I~(Ar)G at 790 nm, respectively .g’ls At 780 . nm, we measure essentially the same distribution of products for 12-(C02)4 using the reflection mass analyzer to separate the photoproducts from the pump laser alone. In spite of similar asymptotic product distributions for the two anions, with essentially zero caging in both cases, the FPES spectra of 12-(C02)4 differ significantly from those for Iz-

(Ar)6. The Ii(Ar)G spectra show that the Ii bond breaks in approximately 200 fs, just as in bare 12-. The resulting ‘T” features then shift toward higher electron energy from 240 to 1200 fs without otherwise changing in appearance, and do not evolve further after

1200 fs. This is due to a progressive weakening of the interaction between the 1-anion and the Ar solvent atoms as the charged photofragment leaves the cluster.zg

In the 12-(C02)4 spectra in Fig. 4, the narrow “1-” features, B 1and B2, are clearl y apparent at 0.1 ps. They are shifted by 0.30 eV toward lower electron energy from bare I-

; this “solvent shift” corresponds to -1.5 C02 molecules.sT However, the appearance by

0.2 ps of features Cl and C2 at lower electron energy indicates that the interaction between the 1-fragment and solvent molecules has increased between 0.1 and 0.2 ps, and the subsequent evolution of the doublets into the broad features D] and DZ by 0.5 ps implies that this interaction strengthens further during this time. The spectra thus suggest that the 1-fragment does not monotonically move away from the solvent species, as was the case in Ia-(Ar)G. Instead, it appears to initially pull away from the cluster (O.1 ps) but

,..,- 7,-- -p~- ~. .-F. ,,,. .,. 144 Chapter 5 then complexes with the solvent molecules (0.2-0.5 ps). These dynamics are consistent with the considerably deeper well in r.. .C02 (212 meV)sg as compared to r:. .Ar (46 meV).sg Fig. 6 shows a “cartoon” of the dissociation dynamics.

Parson and co-workers have performed molecular dynamics simulations on I somewhat larger IZ-(COZ)nclusters which show effects similar to those implied by our spectra.so These calculations show that in the X state of the cluster, there is an asymmetric charge distribution on the two I atoms; the C02 molecules preferential y solvate the I atom with the larger negative charge. This situation is reversed upon excitation to the A’ state, an effect referred to as “anomalous charge switching’’.zg

Consequently, once dissociation begins, the r fragment is relatively unencumbered by solvent molecules. Although the interiodine distance rapidly increases, the attractive force between the r and the C02 molecules surrounding the I atom fragment is sufficient to prevent or at least slow down dissociation on the A’ state, and this attractive force results in the solvent atoms being drawn toward the r. The resulting more symmetric distribution of solvent molecules induces non-adiabatic transitions to the lower-lying A or

X state. This is accompanied by rapid, asymmetric solvation of the 1-,leaving the neutral

I fragment with its much weaker solvent interaction free to leave the cluster. These calculations therefore suggest that the rapid complexation of the r fragment and dissociation of the cluster as evidenced by the evolution of the sharp features B 1and “B2 into the broader features D1 and D2 is associated at least in part with anon-adiabatic transition to one of the two lower-lying electronic states of the cluster. Chapter 5 145

hv 0.0ps ~@

Fig. 6. “cartoon” of dissociation dynamics in the Iz-(CO& cluster. Dark spheres indicate iodine atoms, and light elongated structures denote C02 molecules. The symbols ((( ))) indicate vibrational excitation.

:L ;-... .-.-?” - .“”.’,,; L, ,:.,<...- - “ - ...... 146 Chapter 5 Little change in the spectra occurs after 2 ps, so these photoelectron spectra are attributed to r(C02)~ clusters. In this time regime, the number of C02 molecules solvated to the r fragment can be estimated by fitting the spectra to a distribution of I-(C02). photoelectron spectr% these spectra have been measured previouslysT and show that for n<9, each COZ molecule increases the electron binding energy by -150 meV. The results of the best fit at 200 ps is shown superimposed on the experimental spectrum Fig. 4; the assumed distribution is given in the figure caption. Note that the n=2 and n=3 clusters constitute the bulk of the products at 200 ps, with n=2 being slightly dominant. This disagrees with the experimental mass distribution, in which r(C02)2 and r(C02)3 comprise 7590 and 7% of the products, respectively.do This discrepancy may indicate that the time required to evaporate the last C02 molecule is longer than the time window of the experiments (200”ps), in contrast to the Iz-(k)fj results in which photoelectron spectra corresponding to the asymptotic Arr product was evident by 1.2 ps. 16 This explanation could be tested by measuring spectra at much larger (-ns) delay times, which is feasible with a slight modification to the apparatus. We note that the r(C02)~ spectra used to fit the spectrum in Fig. 4 were taken for cold anions; the imperfect fit at 200 ps may be an indication that this spectrum is from vibrationally excited r(C02)~, a necessary condition for further evaporation.

4.2. l~-(C@)lb

Previous work on I~(COz)lG photodissociation at 720 nm and 790 nm by

Lineberger and co-workers8’9@ show 100% caging of the Ii product, with 7 (720 nm) or

6.5 (790 nm) COZ molecules lost, on average, via evaporative cooling as the Ii

recombines and vibrationally relaxes. Time-resolved experimentsg’10’14 show that Chapter 5 147 relaxation of the 12-is complete on a time scale of several picosecond, with the exact value depending on the photodissociation wavelength. Similar experiments on 12-(Ar)zo also show 100% caging, but the product mass distribution is bimodal, split approximate y evenly between bare 12-and Iz-(Ar)~s. 11.13,40The 12-channel is attributed to recombination on the X state of 12-,and the FPES study of 12-(Ar)20shows that the other channel is due to recombination on the 12-A state; this state apparently survives for at least several microseconds, the time scale of the Lineberger experiments. The FPES experiments on 12-(Ar)zoalso show that the time scales for vibrational energy relaxation on the A and X states of 12-are 35 and 200 ps, respectively. The role of the A state in the dynamics Of IZ-(COZ)lGCIUSterSfO1lOWingphotoexcitation appears tO be qUite different.

From the product mass distributions, it is clear that there is no asymptotic trapping on the

A state. On the other hand, the time-resolved measurements by Lineberger show evidence for “coherent recombination” on the A state at pump-probe delays around 2 ps.

With this background, we now consider the interpretation of the IZ-(COZ)]Gspectra in Fig. 5. There are several trends in these spectra to be understood: (1) the evolution and eventual disappearance of feature B from 0.2 to 4 ps, (2), the appearance of features

C and D starting at 0.7 ps, and (3) the eventual coalescence of these two features by 10 ps. The second two trends are similar to effects seen in the FPES of Iz-(Ar)zo and are attributed to vibrational relaxation of the 12-chromophore on the X state potential energy curve. As shown in Figure 7, photodetachment from a highly vibrationally excited anion state results in well-separated high and low energy features in the photoelectron spectrum corresponding to transitions from the inner and outer turning points, respectively, of the vibrational wavefunction on the 12- X 2Z~ state to the X 1Z; state of neutral Iz. As the Iz-

,...... - .. ., .; ; ,. “=-’’”.,.,, :,’- “-: ——. .

148 Chapter 5

I 4

3

i

CD Pi m o

. . -1 0 2 3 4 5 6 Distance/~

Fig. 7. Simulated Ii X 2Z+ state v=O and v=20 vibrational wavefunctions, and photoelectron spectra. Chapter 5 149 vibrationally relaxes, the inner and outer turning points coalesce, as will the two

corresponding features in the photoelectron spectrum. Hence, the first appearance of the high energy feature D indicates that recombination on the X state has occurred by 0.7 ps,

resulting in highly excited 12-. The subsequent coalescence of features C and D by 10 ps represents the time scale over which vibrational relaxation is complete. We note that a full coalescence of the analogous features in the 12-(Ar)zoFPES does not occur, because

all of the Ar atoms evaporate before the 12-relaxes to its vibrational ground state. In Iz-

(COZ)I15,the evaporation of each Coz molecule removes considerably more energy from the cluster (-240 vs. 73 meV), 1S140so 12-can easily relax to its ground vibrational state without evaporation of all the solvent molecules.

This process of vibrational relaxation and solvent evaporation can be treated more quantitatively by simulating the FPES at various delay times in order to determine the average level of vibrational excitation and the number of solvent molecules remaining on the cluster as a function of time. To do this, one needs to know how much each COZ molecule increases the electron binding energy of the 12-. We have measured photoelectron spectra of several 12-(C02)n clusters using the probe laser alone, and find an average increase of 80 meV per C02 molecule (significant y less than the 140 meV shift for I-(C02).). Assuming this to be independent of the 12-vibrational state, the simulations in Fig. 5 can be generated using a range of vibrational levels and cluster sizes, the average values of which are given in Table I. Thus, for example, at 1.6 ps, the simulations assume a broad vibrational level distribution (16 S v S 55, ao=32) and 13-

14 COZ molecules solvating the cluster, moving to a much colder distribution (OS v S 17,

.-. ., , !. -T,~.;. 150 Chapter 5 CV>=3) and 11-12 C02 molecules by 10 ps. The fit is quite good, except at energies <0.4 eV in the spectra between 0.7 and 2.9 ps; this is discussed below.

Time / ps a,~> / eV a> 0.7 40.5 0.482 14.5 1.0 40.5 0.482 14.5 1.6 32.1 0.396 13.5 2.9 17.5 0.231 13.5 4 7.3 0.104 11.7 6 4.8 0.071 11.5 10 3.1 “- 0.049 11.5 200 3.1 0.049 11.5

Table I. Average values of parameters used to fit the IZ-(COZ)lGFPES spectra between 0.7 and 200 ps. = average vibrational level, ~’b> = average vibrational energy, = average number of C02 molecules.

The simulations indicate 4-5 C02 molecules have evaporated by 200 ps, and that the 12-chromophore is largely vibrationally relaxed, with =3. This means nearly all the available energy from relaxation on the X state has been transferred to the various solvent vibrational and vibrational modes. However, comparison with the photofragmentation study by Vors%AOin which the dominant product fragments are IZ-

(Coz)g,lo, indicates that solvent evaporation is not complete by 200 ps. Thus, at 200”ps, the remaining excess energy is distributed among the solvent modes, and the time scale for firther solvent evaporation is likely to be described statistically. The incomplete evaporation by 200 ps is consistent with recent simulations by Parson and co-workers, who predict minimum time scales of several hundred ps for complete evaporation .41

We next consider the interpretation of feature B. This feature is a distinct peak at

0.2 and 0.4 ps, but from 0.7 to 2.9 ps it appears more as a shoulder in the spectra around

0.4 eV. At 0.2 ps, it is reasonable to assign feature B to newly formed I-(C02). within the Chapter 5 151 cluster; the shift from bare 1-is equivalent to solvation by 8-9 COZ molecules. This

number does not reflect the number of COZ molecules in the cluster, only the average

number close enough to the r to interact with it. There are two possible interpretations

to the subsequent evolution of this feature. One can consider this evolution as a steady

decrease of intensity of feature B from 0.4 to 2.9 ps and attribute this decrease to

depletion of solvated 1-via recombination on the X state to form vibrationally excited Iz”.

Alternatively, the change in appearance of feature B from a distinct peak at 0.4 ps to a shoulder at 0.7 ps can be interpreted as recombination on the A state, with the disappearance of the shoulder between 0.7 and 4 ps due to leakage out of the A state and onto the X state. According to this mechanism, which is depicted in the “cartoon” in

Figure 8, recombination on both the X and A state occurs starting around 0.7 ps, but no population remains on the A state by 4.0 ps.

The second mechanism is more in line Lineberger’s experiments and Parson’s simulations,so both of which suggest that recombination on the A state plays a role in the overall dynamics. In contrast to the photodissociation of 12-(Ar)20,the stronger interactions with the C02 solvent molecules are likely to shorten the lifetime of this excited state significantly, consistent with disappearance of the shoulder by 4 ps. It would also be somewhat surprising for the solvated 1-to persist for several picosecond, given that recombination in 12-(Ar)20occurs in 1 ps, and all other processes common to both clusters occur more rapidly in clusters with COZ. We therefore favor the mechanism involving some short-lived recombination on the A state. However, to really distinguish the two mechanisms it is necessary to have a better understanding of the A state and how

Iz- molecules in that state interact with C02 solvent molecules.

, -----,. --- -<-yX-. --,. ,- -.-.-., ... . . -- ...-.-...... , .1 152 Chapter 5

hv X22: 0.0 ps

1.6PS (((&%)))v A*II312,g \ 4 ps @‘t .:,:. ~ 10ps ;.’ -, ,“ :, .; &@ &

Fig. 8. “cartoon” Of IZ-(COZ)lGCIUSterevaporation and recombination dynamics. Symbols are identical to those in Fig. 6. Chapter 5 153 5. Conclusions

Time-resolved photodissociation studies of 12-(C02)..4,16 chJ.SterShave been

performed using femtosecond photoelectron spectroscopy (FPES). The 12-(COZ)4 spectra

show that the 1-photofragment initially moves away from the cluster, but the attractive

interaction between the 1-and COZ molecules is sufficiently strong so that the 1-is

prevented from escaping. Instead, from 0.2 to 0.5 ps, it is drawn toward the solvent

molecules and complexes with several of them. This differs from the scenario for 12-(Ar)6 photodissociation, in which the attraction between the 1-and Ar atoms is sufficiently

weak so the anion solvent interaction decreases monotonically subsequent to photodissociation of the 12-chromophore. The FPES of 12-(C02)4 for times greater than

0.7 ps appear to be from a distribution of I-(C02)n clusters, with the n=2 and 3 clusters present in approximately equal amounts as long as 200 ps after the dissociation pulse.

Comparison with photofragment ion mass spectra taken several microseconds after dissociation indicates that solvent evaporation is incomplete at 200 ps.

In 12-(C02)]6, the FPES experiment allOV/Sus to follow a complex series of events that occurs subsequent to photodissociation of the 12-chromophore. Dissociation results in a partially solvated 1-chromophore which can be distinctly observed out to 0.4 ps. We interpret the spectra at longer times to indicate that recombination occurs on both the A and X states of 12-.Recombination on the A state is short-lived, and by 4 ps only the X state is populated. Starting at 0.7 ps, we can monitor the process of vibrational relaxation on the X state and the accompanying evaporation of solvent molecules. We find vibrational relaxation to be largely complete by 10 ps, but solvent evaporation is not

—-. .—..-. .. 154 Chapter 5 complete even by 200 ps. The role of the A state is the most uncertain component of our interpretation and requires further experimental theoretical investigation. .

6. Acknowledgments

This work is supported by the National Science Foundation under Grant No.

CHE-9710243 and the Defense University Research Instrumentation Program under

Grant No. F49620-95-1-O078.

7. References

1 R. E. Smalley, L. Wharton, and D. H. Levy, J. Chem. Phys. 68,671 (1978).

2 R. J. Le Roy and J. S. Carley, Advances in Chemical Physics 42,353 (1980).

3 N. Halberstadt and K. C. Janda, Dynamics of Polyatomic van der Waals Clusters

(Plenum, New York, 1990).

4 J. J. Breen, D. M. Willberg, M. Gutmann, and A. H. Zewa.il, J. Chem. Phys. 93,9180

(1990).

5 Q. L. Liu, J.-K. Wang, and A. H. Zewail, Nature 364,427 (1993).

6 A. W. Castleman, Jr. and K. H. Bowen, Jr., J. Phys. Chem. 100,12911 (1996).

7 M. L. Alexander, N. E. Levinger, M. A. Johnson, D. Ray, and W. C. Lineberger, J.

Chem. Phys. 88,6200 (1988).

8 J. M. Papanikolas, J. R. Gord, N. E. Levinger, D. Ray, V. Versa, and W. C.

Lineberger, J. Phys. Chem. 95,8028 (1991).

9 J. M. Papanikolas, V. Versa, M. E. Nadal, P. J. Campagnola, J. R. Gord, and W. C.

Lineberger, J. Chem. Phys. 97,7002 (1992). Chapter 5 155 10 J+M. papanikolm, V. Versa, M. E. Nadal, P. J. Campagnola, H. K. Buchenau, and W.

C. Lineberger, J. Chem. Phys. 99,8733 (1993).

1I D. Ray, N. E. Levinger, J. M. Papanikolas, and W. C. Lineberger, J. Chem. Phys. 91,

6533 (1989).

12 A. Sanov, S. Nandi, and W. C. Lineberger, J. Chem. Phys. 108,5155 (1998).

13 V. Versa, p. J. Campagnola, S. Nandi, M. Larsson, and W. C. Lineberger, J. Chem.

Phys. 105,2298 (1996).

14 V. Versa, S. Nandi, P. J. Campagnola, M. Larsson, and W. C. Lineberger, J. Chem.

Phys. 106, 1402 (1997).

15 B. J. &eenblatt, Ivl. T. Zanni, and D. M. Neumark, Chem. Phys. Lett. 258, 523

(1996).

16 B. J. Greenblatt, M+T. Zanni, and D. M. Neumark, science 276, 1675 ( 1997).

17 E. C. M. Chen and W. E. Wentworth, J. Phys. Chem. 89,4099 (1985).

18 D. R. T. Appadoo, R. J. Leroy, P. F. Bemath, S. Gerstenkom, P. Luc, J. Verges, J.

Sinzelle, J. Chevillard, and Y. Daignaux, J. Chem. Phys. 104,903 (1996).

19 X. N. Zheng, S. L. Fei, M. C. Heaven, and J. Tellinghuisen, J. Chem. Phys. 96,4877

(1992).

20 J. w. Tromp and R. J. ~ Roy, J. Mol. Spectrosc. log, 352 (1985).

21 F. Martin, R. Bacis, S Churmsy, and J. verges,J. IvIo1.Spectrosc. 116, T1 (1986).

22 M. E. Nadal, p. D. Kleiber, and W. C. Lineberger, J. Chem. Phys. 105,504 (1996).

23 D. E. Smith and C. B. Harris, J. Chem. Phys. 87,2709 (1987).

24 A E. Johnson, N. E. ~vinger, and p. F. Barbara, J. PhYs. Chem. 96,7841 ( 1992).

.,;.~.,..,-..,. .. ..,7 -,-,>, y:-.:.-,-~:;---- .,- r----- ,- ;,, - .,’ ,.,., ./. . ...-, ,. . . 156 Chapter 5 25 P. K. Walhout, J. C. Alfano, K. A. M. Thakur, and P. F. Barbara, J. Phys. Chem. 99,

7568 (1995 ).-

26 L. Perera and F. G. Amar, J. Chem. Phys. 90,7354 (1989).

27 V. S. Batista and D. F. Coker, J. Chem. Phys. 106,7102 (1997).

28 J. M. Papanikolas, P. E. Maslen, and R. Parson, J. Chem. Phys. 102,2452 (1995).

29 J. Faeder, N. Del~ey, p. E. Maslq and R. Parson, Chem. Phys. ~tt. 270, 196

(1997).

30 N. Delaney, J. Faeder, P. E. Maslen, and R. Parson, J. Phys. Chem. A 101 (1997).

31 W. C. Wiley and I. H. McLaren, Rev. Sci. Instrum. 26,1150 (1955).

32 0. Cheshnovsky, So H. Yang, co L. Pettiette, M. J. Craycraft, and R. E. Smrdley, Rev.

Sci. Instrum. 58,2131 (1987).

33 L.-S. Wang, H.-S. Cheng, and J. Fan, J. Chem. Phys. 102,9480 (1995).

34 H. Handschuh, G. Gantefor, and W. Eberhardt, Rev. Sci. Instrum. 66,3838 (1995).

35 M. D. Davidson, B. Broers, H. G. Muller, and H. B. van Linden van den Heuvell, J.

Phys. B 25,3093 (1992).

36 M. T. Zanni, T. R. Taylor, B. J. Greenblatt, B. Seep, and D. M. Neumark, J. Chem.

Phys. 107,7613 (1997).

37 D. W. Arnold, S. E. Bradforth, E. H. Kim, and D. M. Neumark, J. Chem. Phys. 102,

3510 (1995).

38 y. Zhao, c. c. hold, and D. M. Neummk, J. Chem. Phys. Faraday Trans. 89, 1449

(1993).

39 I. Yourshaw, Y. Zhao, and D. M. Neumark, J. Chem. Phys. 105,351 (1996). Chapter 5 157 40 v. vor~a, ph.Do Thesis, University of Colorado, Boulder (1996). x 1 N, D~laney, J. Faeder, and R. Parson, private communication . “

. ..-. ~.” ~,. ... .- H...-. . . ~-. . ,.<. . -—-—-—.

158 Chapter 6. Femtosecond photoelectron spectroscopy of 12-(Ar)~photodissociation dynamics (n= 6,9,12, 16, 20)’

Femtosecond photoelectron spectroscopy has been used to study the photodissociation of I; embedded in size-selected I;(Ar). cluster (n = 6-20). This size range spans the uncaged and fully caged product limits for this reaction. The number of

Ar atoms around the nascent r product decreases in the first -1.0 ps, due to separation of r from the cluster. At longer time delays, the number increases again in I;(Ar)n ~g, due to an electronic transition from the ~’ state to the ~ and/or ~ states, followed by solvent rearrangement. In 12-(Ar). ~ 12,recombination of 12-also occurs, along with vibrational relaxation and evaporation of Ar atoms. Simulations of the photoelectron spectra at different time delays were generated in order to characterize the dynamics in detail. An increasing rate of 12-recombination is observed as cluster size increases from n = 12 to

20; however, vibrational relaxation is minimal in clusters smaller than n = 20, due to insufficient energy dissipation by Ar evaporation. In 12-(Ar)20,energy transfer from 12-to

Ar atoms through vibrational relaxation is slightly faster than energy loss from the cluster through Ar evaporation, indicating the temporary storage of energy within Ar cluster modes. Results are compared to previous experimental studies of 12-(Ar). photodissociation, as well as theoretical models.

1. Introduction

The femtosecond photodissociation dynamics of I; in small, mass-selected clusters provides an unprecedented opportunity to study real-time energy transfer

● B. J. Greenblatt,M. T. Zanni,and D. M. Neumark,J. Chem.Phys., in preparationfor submission Chapter 6 159 between solute and solvent in the gas phase. Beginning with the pioneering efforts of the

Lineberger group studying Brz-(COz)n and Iz-(CO& photofragments, 1“2work has

expanded to include photofragmentation studies in related clusters3-5 including IZ-(Ar)n,b’T

femtosecond pump-probe experiments,2’4’8-13 and several theoretical models. 14-27

Photodissociation of 12-in solution has also been performed on the femtosecond time

scale,28-32 allowing for comparison between molecular cluster and bulk environments.

The general picture which has emerged is that “caging” of photodissociated XZ-(12-,Br~-,

IC1-) can occur in clusters with only a few solvent molecules, producing recombined (X2--

based) products. As the cluster size increases, so does the caging fraction, reaching unity

in the case of 12-(Ar). at n = 17, somewhat less than one full solvent shell. Rates of

recombination also increase with cluster size. Changing the type of solvent reveals a

strong dependence on solvent-solute binding energy in the recombination rate (Ar < CQ

= OCS). Mechanistic changes are also apparent in different solvent environments.

12-(Ar). clusters represent an almost ideal weakly interacting system, with an 12--

Ar well depth of only 53 meV,33 much smaller than the Ii ~ state well depth (1.014 eV) .34 Despite the small per atom interaction, the collective effect of many solvent atoms has a strong influence on the photodissociation dynamics. A previous study of this system

using femtosecond photoelectron spectroscopy (FPES) investigated the uncaged and

full y-caged cluster limits,12 providing information such as the interaction time of the

solvent with dissociating r, and time scales for electronic transitions and subsequent

vibrational relaxation of 12-.This work examines these previous clusters, plus three

additional intermediate-sized clusters, one of which [12-(Ar)12]yields both caged and

uncaged products, allowing the evolution of the energy transfer dynamics to be followed

y.+,,.!- ..-.

,. -..”. 160 Chapter 6 across cluster size. A companion paper details results for 12”(C02)~clusters over a similar range of sizes.35”

FPES36 is a time-resolved, pump-probe scheme in which a cold, mass-selected anion is promoted to an excited electronic state by a femtosecond pump pulse. The resulting wavepacket will evolve on this excited potential surface, generally leading to dissociation or nonadiabatic transitions to other electronic states with possible recombination of fragments. A second, delayed femtosecond probe pulse detaches an electron from the anion, producing a photoelectron spectrum. Since the electron kinetic energy depends on the difference between anion and neutral potential energies, identification of electronic and vibrational states of the anion is possible when the neutral potential energy surfaces are well-characterized. The strength of the technique lies in the ability to observe wavepacket dynamics on multiple electronic states at all time delays, without changing the probe wavelength. This was not possible with the techniques employed by Lineberger and coworkers,7~l 1 who only observed asymptotic products, or the time-resolved appearance of vibrationally relaxed 12-.These and other previous experimental and theoretical studies will be described briefly below.

Photofragmentation mass spectra of photodissociated I~(Ar). clusters were

measured by Versa et al.,G~Tin which a cold, mass-selected cluster was excited to the ~’

state of 12-(Fig. 1) with a pulsed laser at 790 nm, and the masses of photofragments

analyzed using a reflection. They observed only r(Ar)” fragments in smaller clusters,

slowly being replaced by Iz-(Ar)~ fragments starting at a parent cluster size of n = 10,

with the r(Ar)~ channel vanishing by n = 17. The numbers of Ar atoms present in both

r(Ar)n and 12-(Ar)nfragments were smaller than that of the parent cluster, with more Chapter 6 161 atoms lost in the 12-fragments. This observation was consistent with the expectation that

the available energy in the cluster is dissipated through Ar evaporation, so that the larger

energy liberated by the recombination of 12-resulted in a smaller number of remaining Ar

atoms. Interesting y, two distinct 12-(Ar)~fragment size groupings or “channels” were

observed, hypothesized to correspond to 12- ~ and ~ state products. Two I-(Ar).

fragment groupings were also observed in larger (n > 11) clusters, for which no

explanation was given, but Faeder et aL20 later attributed the high-mass channel to dissociation on the % or ~ state, rather than the ~’ state.

I 1 1 1 1 i -.

, 1 12P3,2 -.. ------‘P,,,.+...... 12P,,2+ 12P3,2 ‘8. . ------. ------. . . .

.“

Probe

12P,,2+1- %0

I ‘Pq,,+ 1- ‘Sn A17-\ 5?ZU+ I 1 1 I I I ! I 2345678 Distance/~

Fig. 1. Potential energy curves for bare Ii. Solid lines (--): 12-. Dotted lines (...... ): 12.

...... lTi...... , ‘-.7 ‘WT; ‘.-,----- .... “. . - . -a. . 162 Chapter 6 A time-resolved absorption recovery experiment of the 12-(Ar)20cluster was also performed by Versa et al.,1 I in which cold, mass-selected clusters were excited with a fs- duration pulse at 790 nm, then re-excited with a second, identical pulse after a variable time delay, recording the total flux of two-photon photofragments which presumably indicated the absorption of 12-near the bottom of the ~ state well. This absorption was found to occur with an exponential time constant tlieof 127 ps. No other transient features were observed, such as those found in large 12-(C02)nclusters.2’9-11 This work was complemented by FPES studies of 12-(Ar)6and 12-(Ar)20clusters in our group.12 In

I~(Ar)6, r(Ar).. 1was observed to leave the cluster in -1.2 ps. In Ii(Ar)20, caging by the solvent resulted in recombination and vibrational relaxation of 12-on both the ~ and ~ states; these processes were complete in -200 ps and -35 ps, respectively.

A number of theoretical papers have been published on I~(Ar). clusters, exploring both structure and dynamics. Minimum energy structures of 12-(Ar). clusters have been calculated by Faeder et al.zo and Batista et al.lg In the study of Faeder et al., which appears to be more consistent with experiments,ss the first 6 Ar atoms surround the 12- axis in a ring configuration, with the next 7 Ar atoms solvating one I atom, and any additionid atoms cluster to the other I atom, completing a full shell at n = 20.

Asymmetrically-solvated clusters have an excess negative charge on the more solvated I atom. Fig. 2 shows calculated structures for three cluster sizes: n = 6, 12 and 20.

Fig. 2. (On next page) Calculated minimum-energy structures of selected I~(Ar). clusters: (a) 12-(Ar)6;(b) 12.-(Ar)lz;(c) Iz-(Ar)zo. Chapter 6 163 ()a

(b)

()c 164 Chapter 6 Maslen et al.16investigated the effect of solvent on charge localization in different I; electronic states. For the two lowest-lying states, the j? and ~ (see Fig. 1), the charge is attracted to the more solvated atom, localizing completely at sufficiently large internuclear distances, a process called “normal charge-switching.” In the 2’ state, however, the polarizability of the molecule is negative along the 12-axis,20 so that the charge tends to localize on the less solvated atom, a process called “anomalous charge- switching.” This is illustrated schematically in Fig. 3 for 12-(Ar)12,an asymmetrically- solvated cluster, adapted from Delaney et al.zl Solid lines indicate potential surfaces near the equilibrium radius of 12-,while dotted lines indicate surfaces near the dissociation asymptote. The cluster drawings indicate the solvent configuration and location of the charge. The “solvent coordinate” is defined as the change in energy when the charge is moved to the opposite I atom. When 12-is excited by the pump pulse (represented by the thick vertical arrow) from the ~ to the ~’ state, the energetically favorable solvent configuration on the ~ state becomes energetically unfavorable on the ~’ state. This results in motion of the solvent atoms back toward the charge. However, the solvent atoms are unable to completely surround the charge, because it is always localized on the less solvated I atom, resulting in a symmetric solvent distribution as the minimum energy structure in this state. As the 12-bond lengthens, the likelihood of an electronic transition to the ~ or ~ state increases; when this occurs, the solvent atoms will rearrange into a more heavily solvated configuration around the 1, similar to the starting arrangement. Chapter 6 165 .. . :>,+,:. ,.. ! ,, ,.. ” ,. ● ->,. ..,...’- . .

&, ... ‘ ..-, . ,.?+ > ... . ‘-, .,: ,’. ,“

.,. , ‘ @ 38

Solvent Coordinate

Fig. 3. Illustration of charge-switching. Solid lines indicate potential surface near the equilibrium radius of 12-;dotted lines indicate potential surface near the dissociation asymptote. Drawings indicate schematically the solvent configuration and location of the charge. The symmetric configuration (center drawing) has the charge shared equally by both I atoms. The “solvent coordinate” is defined as the change in energy when the charge is moved to the opposite I atom. The thick vertical arrow indicates the ~’ C ~ excitation. (Adapted from Delaney et al.)21

Time-resolved dynamics of I;(Ar)n clusters were investigated by Faeder et al. ,2023 with molecular dynamics simulations, using a surface-hopping algorithm to

model electronic transitions. Photoelectron spectra were simulated for IZ-(Ar)6and 166 Chapter 6 12-(Ar)20to allow comparison with FPES work from Greenblatt et al.12.In all clusters, the simulations predicted that r and I fragments separated rapidly until -1 ps; in larger clusters [12-(Ar)~z 9],20,37some trajectories underwent a transition to the ~ or ~ state, resulting both in r dissociation, and 12-recombination and vibrational relaxation. For

12-(Ar)20,recombination on the ~ state occurred in 5-10 ps, with vibrational relaxation requiring more than 200 ps to complete. The number of solvent atoms evaporated tracked the solute internal energy closely. Recombination on the ~ state took up to 40 ps, but relaxation was much more rapid (-10 ps), owing to the smaller amount (-10%) of internal energy required to be dissipated. However, the solvent evaporation rate was slow, comparable to the ~ state.

Batista et al.lg also investigated 12-(Ar). photodissociation using a similar molecular dynamics/surface-hopping algorithm. Their results were much the same as for

Faeder et al., reproducing all the asymptotic features observed in Versa et al.

Recombination on both the ~ and ~ states was increasingly rapid as cluster size increased, from -10 ps in 12-(Ar)l1, to -3 ps in 12-(Ar)lg, but solvent evaporation in the largest cluster took longer than the time scale of the simulations, 45 ps. They also observed a larger number of solvent atoms in the 12- ~ state at long time delays than in

Versa et aL,G~Timplying a slow evaporation rate from this state.

The FPES experiment excites a mass-selected anion cluster with a femtosecond pump pulse from the ~ state to the dissociative ~’ state. A second, delayed femtosecond probe pulse generates a photoelectron spectrum. Features arising from r, and the 12- ~ state in different vibrational levels, are readily distinguished. The 12- ~ Chapter 6 167 state appears similar to 1-,but is still discernible. The number of solvent atoms surrounding the anion in each state may also be determined from the spectrum.

The major goal of this study, as well as the accompanying study of 12-(C02). clusters, is to use FPES to observe how the dynamics evolve from the uncaged to caged cluster size limits. Key findings for 12-(Ar)nclusters include: 1). Determination of the initial solvent configuration from measuring the number of solvent atoms around 1-at early time delays (-300 fs). This confirms the anomalous charge-switching predictions of

Maslen et al., 16where the electron hops to the Iess-solvated I atom upon excitation to the

~’ state. 2). Measurement of the time-resolved number of solvent atoms in both the I- and 12- ~ state channels, providing information on relaxation dynamics from the point of view of solvent evaporation. This enabled the time evolution of uncaged fragments to be observed, and the rates of solvent loss and vibrational relaxation to be compared in caged clusters, such as 12-(Ar)20.3). A detailed picture of the vibrational relaxation in caged photofragments, especially I~(Ar)20, which relaxes almost completely over a -200 ps timescale. 4). Unambiguous identification of the 12- ~ state, along with information about its time evolution, which provided a more complete characterization of this state.

2. Experimental

The experimental apparatus has been described in considerable detail elsewhere, 13 and will only be summarized briefly here. To generate cluster anions, Ar carrier gas (20 psig) is passed over solid 12and expanded into vacuum through a piezoelectric pulsed valve running at a repetition rate of 500 Hz. A 1.5 keV electron gun crosses the resulting supersonic expansion, creating vibrationally cold negative ions, which are then pulse- extracted into a Wiley-McLaren38 time-of-flight mass spectrometer. Femtosecond pump 168 Chapter 6 (780 nm, 80 fs, 150 ILT)and probe (260 nm, 100fs, 20 p.J) pulses, produced from a Clark-

MXR regeneratively amplified Ti:sapphire laser, intersect the ions at the focus of a magnetic bottle electron spectrometer,qg detaching photoelectrons. Electron kinetic energies (eKE) for the resulting photoelectrons are measured by time-of-flight. High “ collection el%ciency of the magnetic bottle enables rapid acquisition (400- 1200s) of photoelectron spectra. Since the probe photon has sufficient energy to detach electrons from the ground state of I~(Ar). clusters, spectra are not background-free, so a fraction of this “probe only” spectrum was subtracted from the pump-probe spectra in order to facilitate observation of the two-photon signals. The energy resolution of the Iz- photoelectron spectrum has been improved -4x using pulsed decelerationAO of the anions just prior to laser interaction. This technique, recently added to the spectrometer, was only employed for bare 12-.However, since the resolution scales as (EUhn)”2, where E is the electron kinetic energy, U is the anion kinetic energy, and m is the anion mass,3G the heavier 12-(Ar). clusters have an inherently narrower resolution, and light clusters were measured at slower beam energies to improve their resolution. Typical resolution for 1 eV electrons was 90 meV for 12-,and 90-130 meV for 12-(Ar)~clusters.

3. Results

Time-resolved photoelectron spectra have been measured for Ii and for I;(Ar)~ clusters with n = 6, 9, 12, 16 and 20. Each molecule was studied at several pump-probe time delays, over a range of -50-200 ps. In addition, the 12-(Ar)20cluster was measured at

3 ns pump-probe delay. Spectra at selected time delays are shown in Figs. 4-5. Features have been labeled with capital letter designations, following a scheme summarized in

Table 1 which is consistent among all the clusters studies, as well as with the I~(COz)n Chapter 6 169 clusters in the accompanying paper,3s to allow for comparisons across cluster size and type. These assignments are based on previous work, 12J13136and the analysis presented in the following section.

Bare Ii displays two broad features Al (1.7-2.2 eV) and Az (0.8- 1.3 eV) peaking near O fs, transforming into sharper features B1(1.71 eV) and Bz (770 meV) which reach full height by 380 fs. The A features originate from wavepacket overlap with neutral potential energy curves in the initial Franck-Condon region3b’41 (see Fig. 1). The B features, differing in energy by the spin-orbit splitting of neutral I (943 meV),’Q correspond to fully dissociated l-.

Table 1. Labeling system of features observed in FPES, with corresponding assignments. In cases where two spin-orbit manifolds are visible (peaks A, B and D), each is labeled with a subscript, e.g. Al and Az, according to decreasing eKE.

Label Assimment Al, A2 12~ I; ~’ (short-time transient) B], B2 I+r D], D2 124+ 12-2 E 12 ~ + I; ~ inner turning point (ITP) F 12 ~ ~ I; ~ outer turning point (OTP),

Fig. 4. (On next page) FPES at selected time delays: (a) I;; (b) I;(Ar)b; (c) I~(Ar)Q. Pump photon energy = 1.589 eV, probe photon energy= 4.768 eV.

,. .’-,.,,,,.7.,,J .. ’!: m<; .; --- .y.r. =-- y .-:.. :.7-- f ,- .:.- t m ()a ()c ?2=9

100m

12

2.8

1.2

~-120 I I I n 290 fs o 1 2 3/0 1 2 0/0 1 23 Electron Kinetic Energy/eV Chapter 6 171 In I~(Ar)G, the spectrum initially resembles bare 12-,displaying A features at 10 fs

which evolve to B features by 300 fs. B 1and Bz are shifted 120 meV to lower eKE

relative to bare r. This shift is due to the presence of Ar atoms, since the I--Ar bond is

stronger than that of I-Ar, resulting in an increase in electron affinity. Between 300 fs and

1.5 ps, the energies of the B features increase 80 meV, indicating a lessening interaction

between the Ar atoms and 1-, as the 1-fragment separates from the cluster. Through 200

ps there is an additional eKE increase of 10 meV, due to Ar atom evaporation.

For I~(Ar)g, the B features appear 150 meV lower than barer, and from 300 fs to

1.1 ps their eKE’s increase 80 meV, as for 12-(Ar)6.However, from 2.8 to 12 ps, the

features decrease 30 meV in energy, indicating an increased number of Ar atoms around

1-,the cause for which will be explored in the Discussion section. Through 100 ps, the energy increases again by 10 meV, due to Ar atom evaporation.

In the I~(Ar)12 cluster, the B features closely track thoseinI;(Ar)gfrom310 fs through 2.5 ps, after which they broaden significantly toward lower eKE, and decrease

-25% in integrated intensity. At this point (9.0 ps), the features are relabeled D1 and Dz.

The broadening is attributed to partial recombination on the 12- ~ state (see Discussion).

Between 2.5 and 9.0 ps, feature E appears between 1.9 and 3.0 eV, along with a broad feature F between 900 meV and 1.3 eV. These features are assigned to vibrationally excited 12-on the ~ state. Both features E and F become more prominent out to 45 ps.

Fig. 5. (On next page) FPES at selected time delays: (a) I~(Ar)12; (b) I~(Ar)lG; (c) I;(Ar)20. Pump photon energy= 1.589 eV, probe photon energy= 4.768 eV. z IQ

o 1 2 3/0 1 2 “ 3/0 1 2 3 Electron Kinetic Energy/eV Chapter 6 173 The Iz-(Ar)lGspectra display B features initially 220 meV lower than 1-,increasing

90 meV through 1.1 ps. Between 2.0 and 20 ps the features broaden and shift to lower

eKE by 240 meV, where they are relabeled D] and Dz, due to recombination on the ~

state. Between 2.0 and 10 ps, features E (1.7 and 2.9 eV) and F (0.8- 1.3 eV) grow in,

more intense relative to the D features than in 12-(Ar)12,due to recombination on the Iz”

~ state. Between 10 and 50 ps, the high-energy edge of feature E shifts -100 meV to

lower energy, indicating partial vibrational relaxation.

For 12-(Ar)20,the B features appear 300 meV lower than r and increase 50 meV

through 1.0 ps. After this time delay, they reverse direction and are relabeled DI and Dz,

shifting 140 meV to lower eKE through 35 ps, due to ~ state recombination, with

broadening and a -40% decrease in integrated intensity. Features E ( 1.6-2.7 eV) and F

(0.5- 1.2 eV) appear by 6.0 ps. The high-energy edge of feature E shifts -700 meV to

lower eKE through 3 ns, while feature F undergoes a complex evolution in structure. The

changes in features E and F are due to extensive ~ state vibrational relaxation.

4. Analysis

The goal in simulating the FPES spectra is to determine, at each time delay, the

state of the cluster. This consists of answering four basic questions: 1). Have I and I-

recombined? 2). If 1-is present, how many solvent molecules surround it? 3). If 12-is

present, what is the electronic and vibrational state, and how many solvent molecules

surround it? 4). What are the relative populations of the different states (12- ~, 12- ~, 1-)

in the cluster? In certain cases, these questions can be answered immediately by looking

at the spectrum, whereas others require iterative refinement of simulation parameters to

accurately characterize the cluster. Simulations were performed using a combination of

,, “. “ ‘- ‘k 174 Chapter 6 measured spectra and theoretical calculations, the procedures for which are detailed below. Unlike previous studies of bare 12-,s@$lno explicitly time-dependent calculations were performed, as the number of degrees of freedom in 12-(Ar)~clusters were far too large for our existing wavepacket propagation programs.

It was assumed that, after the initial (-300 fs) Ii dissociation, I and r are well- separated, so that I has little influence on the photoelectron spectrum of r. This is substantiated by the observation that pairs of features (B 1and B2) are present in all spectra at short times (z 1-2 ps), differing in energy by approximately the spin-orbit splitting of I (943 meV) which is characteristic of the photoelectron spectrum of r, though shifted to lower eKE. The shift is a well-understood effect, arising from the difference in binding energy between the r-Ar (45.8 meV) and I-Ar (18.8 meV) bonds.43

These differences have been measured precisely using zero electron kinetic energy

(ZEKE) and partially-discriminated threshold photodetachment spectroscopy of r(Ar). clusters.43

The initial average number of Ar atoms around r (“*1->”) were calculated by comparing the eKE of feature B 1at -300 fs to the measured values in the above study, using linear interpolation to estimate a fractional *1-> when the energy lay between measured shifts. Results are presented in Table 2, along with estimates of -az~> for the

“anomalous and normal charge-switching states, based on calculated structures,20 and assuming no loss of Ar atoms. For analyzing ~i> at later time delays, Fig. 6 shows the eKE of feature B 1vs. time for all clusters, with -i> indicated on the righthand side of the figure. For Iz-(Ar)n a 12,the graph stops when the feature begins to decrease in energy and is relabeled D1, as it no longer reflects a purer signal. Chapter 6 175 Table 2. Number of solvent atoms -~> for feature B 1at -300 fs, along with estimated .- en{> for anomalous and normal charge-switching states, calculated from model structures .23

Parent cluster B1 Anomalous Normal 6 4.7 6.0 6.0 9 5.4 6.0 9.0 12 5.8 6.0 12.0 16 9.1 9.0 13.0 20 13.3 13.0 13.0

1.7 1- 1 I [ I I [ 11 1 1 I I I I II 1 1 1 I 1 1 11 ;0 n=6 “ z n=12 G n=9 $ s n=16 - 5$ 2 ~ ● % + - 10g n=20 Versa mB 1.4 I I I I 1 1 1 II I I I I 1 1 II et al. O.l 1.0 10 100 Time/ps

Fig. 6. Center eKE of feature B 1vs. time, for all 12-(Ar). clusters. Number of Ar atoms (cn~>) is shown on righthand axis, calculated from Yourshaw et al.os

For simulating the FPES spectra, r(Ar)n features were generated from a measured probe-only spectrum of barer, shifted in energy according to the known solvent shift.

The integrated intensity of the 12P3i2 ~ 1- ‘SOtransition was taken to be 2.0 (see Table 3), relative to 1.0 for the 12 ~ ~ 12- ~ (v = O) transition as determined by comparing the integrated intensities of 12-bleach and 1-(signal) features in the FPES of bare Iz-. The intensity of the 12P1j2 ~ r lSOtransition was empirically determined to be 0.6. The final

,. ,. .,-. ;K,;>. - ...... - -.. - -- .-,, .,, ‘.;;.r:-.-: ,...,.- ...... ’ :“:.;:.” ——.

176 Chapter 6 spectrum was convoluted with an instrument resolution function,sb calibrated approximately for experimental conditions.

Table 3. Relative integrated intensities of transitions used in simulated spectra,

Transition Relative integrated intensity Iz~~I~~(v=O) 1.0 Iz~~I~~(v>O) 0.4-1.6* 12 ~’1~ ~Iy ~ 0.24 12 ~lfi” ~1~ ~ 0.2 12iie12-z 0.15-O.5** 122’+ 12-2 1.5X(I2 fi ~1~ ~)

125 +12-Z 0.6 12P3j2 ~ r lSO 2.0 I 2P~J2+ r lsO 0.6 *Spectra scaled with energy-dependent function; see below and text. **Varied with spectrum.

To simulate the photoelectron spectrum arising from a vibrationally excited Ii ~ state, wavefunctions were calculated using standard procedures for a Morse oscillator,~ and a photoelectron spectrum for each vibrational level was generated using a time- dependent propagation methodos to calculate the Franck-Condon overlap with various neutral states. The 12- ~ state potential parameters are identical to Ref. 34. Neutral state parameters are identical to Ref. 41, with the exception of the & state, whose repulsive wall was adjusted empirically to fit a high-resolution (-10 meV) photoelectron spectrum of 1;.33 It was assumed that spectra arose from an incoherent superposition of vibrational levels, so composite spectra were constructed by summing spectra from individual vibrational wavefunctions over a distribution of levels. The presence of Ar atoms Chapter 6 177 decreases the eKE of 12-features, much as for r(Ar)n. These solvent shifts have been measured for vibrationally cold 12-(Ar)~clusters using photoelectron spectroscopy,ss and are used to shift the simulated spectra. The shifts are smaller than for I-(Ar)n, despite the fact that the IJ-Ar binding energy (53 meV) is larger than that of r-Ar (45.8 meV);Qs this is due to a somewhat larger 12-Ar binding energy over that of I-Ar. It is assumed that the shifts do not change for v >0. Note that the Iz--Ar bond energy is significantly lower than the energy lost per Ar atom due to evaporation (73 meV), as calculated in Versa et al. from the number of solvent atoms remaining in 12-fragments from large (n > 20) parent clusters. This discrepancy was attributed to kinetic energy of the departing Ar atom.T

Two simulated photoelectron spectra of the 12- ~ state and their relation to the Iz potential energy curves are shown in Fig. 7 for (a) v = O and (b) v = 20. The vibrationally cold spectrum (v = O) consists of an extended progression, unresolvable with instrument resolution, centered at 1.54 eV (the 12 ~ state), a pair of narrow features at 1.00 eV

[ ~’(31T2u)] and 900 meV [ ~(311,U) ], another pair of narrow features at 650 meV

[ ~’(3110_U) ] and 540 meV [ ~“(’lTU) ], and two broad, overlapping features at -300 meV

[Z(31T,, ) and ~(3HO+U)]. The Z’(3Z~+, ) state is not observable, as it is not accessible by the probe photon from 12- ~ (v = O).

For the vibrationally excited ~ state (v = 20), the shapes and energies of the photoelectron features change considerably. Since the amplitude of the ~ state wavefunction is concentrated near the classical inner and outer turning points of the potential (ITP and OTP, respectively), Franck-Condon overlap with IZstates will be largest in these regions. For the 12 ~ ~ 12- X transition, the large change in IZ ~ ———..

178 Chapter 6 potential energy with internuclear distance produces distinctive and well-separated features arising from each region (see Fig. 7): an extended tail at high eKE, arising from the ITP region, and a narrower, intense peak at low eKE due to the OTP region. The ITP region of the spectrum is very sensitive to v, whereas the OTP region is fairly

1 . J J , #n- — CD L

-1 2 3 4 5 6 Internuclear distance/~

Fig. 7. Example of how I; ~ state wavefunctions in different vibrational levels give rise to very different photoelectron spectra. (a) v = O; (b) v = 20.

, .

Chapter 6 179 independent of v over a wide range (-10-30). At higher vibrational levels, the OTP

energy increases with v. For the ~’ ~ ~ and ~ ~ ~ transitions, the difference in

eKE between the JTP and OTP regions is much less, though there is a considerable

broadening for v >-30. The ~, ~“, E and Z’ states display a wider range of potential

energies, so that the OTP regions of these transitions overlap with the ~’/ ~ ~ ~, and

the ITP regions occur at much lower eKE. The ~ ~ ~ transition, correlating at large

internuclear distance with the 12Pv2 ~ r lSOtransition, appears near 200 meV for v s 60.

In order to determine CV> from a spectrum, the number of solvent atoms (“cnx>”)

must also be known, since both parameters affect the eKE of features E and F. When O>

is very small (c -5), the ~ ~ ~ transition is compact and the shape depends sensitively

on CV>, so both *x> and CV> may be simultaneously determined by simulating the

shape and energy of feature E. For larger o>, the ~ ~ ~ ITP energy is mostly governed by CV>, but UZX>strongly modifies it, so feature E cannot be used to determine

CV> exclusively. However, feature F, arising from the ~ S ~ OTP and

~’/ ~/~ /~ /ti /ii’ /~ (collectively referred to as 12*) ~ ~ transitions, is more

sensitive to ax> than to a>, and for o> between -5 and -30, two distinct peaks are

visible which can be used in conduction with the ~ ~ ~ ITP transition to obtain both

a> and UZX>.For o> larger than -30, the ~ & ~ OTP and 12* ~ ~ transitions

coalesce into a single, broad peak, and determination of ex> is less precise.

The integrated intensities of transitions from 12- ~ to different 12electronic states

were empirically determined from fitting a one-photon spectrum of bare 12-,normalizing

the ~ ~ ~ (v = O) transition to 1.0 as a reference (see Table 3). It is assumed that these

.. . ., ,,...-. . .. ,. . . .– ~.-.. , ... ; ,,,:., ... .,. ,,, .-,.. 180 Chapter 6 intensities do not change in 12-clusters. For v >0, it has been shown in the course of fitting spectra that the ~ ~ ~ transition dipole moment varies with eKE as well as V, the most dramatic deviations being observed in the ITP and OTP regions at large v (>

-30), with apparent intensities 1.6 and 0.4 times the v = O intensities, respectively. This is not unexpected, since the wavefunctions are quite extended for vibrationally excited levels, and the overlap of the electronic orbitals will be significantly different than at the equilibrium bond distance, changing the relative cross section. Therefore, to obtain the best estimate of the true integrated intensities, a smooth, energy-dependent scaling function~(E) was applied to the simulated spectra for the ~ ~ ~ transition:

al–l az–l (1) f (E)= ~+ ~-( E-E, )/kl + ~ + ~-( E-E2)/k2 + 1 where E is electron kinetic energy (eV) before applying any solvent shifts. Parameters for this function are summarized in Table 4. Note that al, which governs the ~ ~ ~ OTP intensity, was varied in different spectra from 0.4 to 1.0, following an inverse trend with

CV>, which indicated a decreasing transition dipole moment as the internuclear radius increased. No such modifications were made to the simulated spectra for transitions to higher-lying states, with the exceptions of the d/Z’ ~ ~ and E ~ ~ transitions.

Here, the relative intensity of the E ~ ~ transition was freely varied to best fit feature

F, with the ii’ ~ ~ intensity scaled to 1.5x that of the ~ ~ ~, in accord with the

estimated relative intensities of these transitions, as discussed in Zanni et aL41 The

scaling of the ~ ~ ~ transition, which appeared at very low eKE in all spectra, was

varied between 0.5 and 1.0 to best fit this region. The final spectrum was convoluted with

the same instrument resolution function as for r above. Chapter 6 181 Table 4. Parameters used injl(E) function for scaling 12 ~ + 12- ~ transition. Equation is defined in the text.

Parameter Value A1 0.4-1.0* 1.6 : -0.02 eV k2 0.08 eV El 1.3 eV E2 2.0 eV *Varied with CV>.

Simulation of the Ii ~ state was considerably less precise than the ~ state. A simple Morse function was employed, using parameters (R. = 4.7 ~, D.= 140 meV) slightly modified from Greenblatt et al. 12to better fit the Iz-(Ar)zo spectrum at 3 ns, assuming that the number of solvent atoms (“-A>”) was equal to the photofragmentation average for this cluster (11. 1).6 This assumption was supported by the lack of any significant change in the energy of the ~ state features (D I and D2) between 15 ps and 3 ns, indicating an asymptotic solvent configuration had been achieved; see the Discussion for more details. Transitions from v = O to each neutral state (except ~ ) were weighted equally, as done in Zanni et al. for the 12- ~’ state.41 The broadening of feature D 1is likely due to the repulsive regions of the 12states ( ~, ~“, ti, ii’), but as these are poorly defined, adequate reproduction of this broadening was not possible. To simulate the broad appearance, therefore, this feature was convoluted with a wide resolution function (-250 meV). -A> was determined from the experimental spectra using the energy shifts of the r(Ar)n clusters, rather than the 12-(Ar). clusters, based on the assumption that the electron is localized on a single I atom at the large equilibrium bond distance, and is therefore stabilized by solvent to the same extent as for l-. This

------,~,: -,:,-,., ,,p&, -. 182 Chapter 6 assumption was borne out in other clusters by fairly good agreement between the calculated ~A>’k at long time delays and the photofragmentation averages (see

Discussion). The integrated intensity was assumed to be the same as for r, which was also supported experimentally.

Populations of the r, Ii ~ and Ii ~ contributions, indicated by “PI-,” “Px,” and

“PA,”respectively, were determined from the intensities of simulated spectral features, weighted by their relative cross-sections. Populations sum to unity for all spectra.

Numerous time delays have been simulated to follow the dynamics in clusters of

I;(Ar). ~ 12.For I~(Ar)lz.l& where changes are minimal once features E and F have appeared, only a single, long time delay (45-50 ps) is shown in Figs. 8(a-b). In 12-(Ar)20, where significant evolution is observed in the spectra after the appearance of these features, several time delays (6.0, 15,35 and 200 ps) are shown in Figs. 8(c-f). Each figure includes curves representing the r [for I;(Ar)12 only], Ii ~ and Ii ~ contributions, the total simulated spectrum, and the experimental spectrum. Simulation parameters are summarized in Table 5. In Fig. 9, Px is plotted vs. time for all three clusters, for many more time delays than shown in Fig. 8. Photofragmentation values are indicated as detach,ed points on the righthand side of the graph. AS 12-(Ar)20displays considerable vibrational relaxation not seen in the smaller clusters, Fig. 10(a-b) plots Q> and -aX> vs. time for this cluster, along with model data from Faeder et aLQs Fig. 10(c) plots a derived quantity E.lu,t., which is defined in the section on I~(Ar)20 in the

Discussion. Chapter 6 183 Table 5. Parameters used in simulating spectra of Iz-(Ar). clusters at selected time delays. Px, PA and PI- indicate populations of 12- ~, 12- ~ and r fragments, respectively. o> indicates the average vibrational level of the 12- ~ state. -x>, -A> and e~> indicate the average numbers of Ar atoms surrounding the 12- ~, 12- ~ and 1-fragments, respective y. “MS” indicates results of photofragment experiments from Versa et al.G.T

Parent Time Population 11~~ Number of Ar

Cluster (ps) Px PA pl- Cv> -ax> ~A> ~1-> 12 45 0.30 0.21 0.49 68.0 0 5.0 3.2 MS 0.23 0.23 0.54 - 0 2.3 3.2 16 50 0.50 0.50 0 34.4 0 8.0 - MS 0.43 0.55 0.02 . 0 6.2 8.5 20 6.0 0.36 0.64 0 40.0 8.0 9.0 - 15 0.50 0.50 0 29.1 6.0 11.0 - 35 0.50 0.50 0 14.2 3.0 11.5 - 200 0.54 0.46 0 5.6 0.5 11.0 - MS 0.44 0.56 0 . 0.2 11.1 -

5. Discussion

This section of the paper is divided into four parts. In the first section, the spectra of dissociated r at -300 fs are examined for all clusters, in order to determine the initial configuration of solvent atoms around the l-. Then, Iz-(Ar)Gand 12-(Ar)gclusters are discussed, which display only r dynamics. This is followed by a discussion of l~-(Ar)lZ and 12-(Ar)16clusters, which display 12- ~ state and 12- ~ state features, but limited vibrational relaxation in the ~ state. Finally, 12-(Ar)20is examined separately, whose spectra display extensive ~ state vibrational relaxation, in addition to the dynamics observed in smaller clusters. By way of orientation, the fraction of 12-products measured by Versa et aL6 is useful to state here: 0.00 (n = 6 and 9), 0.46 (n = 12), 0.98 (n = 16),

1.00 (n = 20). Roughly equal amounts of low- and high-mass fragments are observed in the 12-products, which will be shown below to correspond to the Iz- ~ and ~ states, respectively.

- ... ------...... , ,..., : ,’-, , ~,, , 184 Chapter 6 5.1. Short-time dynamics

An unverified prediction of Maslen et al.16is whether the electron localizes on the less solvated I atom after excitation to the ~’ state. When r first appears at -300 fs after photodissociation in bare Ii, the distance between r and I is not very large (6.4 ~).zs

Therefore, the number of Ar atoms -i> surrounding r has probably not changed much from the initial configuration around Ii. In Table 2, we examine this measured quantity, along with estimated numbers assuming the charge is localized on the more- and less- solvated I atom (corresponding to the normal and anomalous charge-switching states, respectively). For IZ-(Ar)g-lG,where the difference between the two estimates is 3.0-6.0 Ar atoms, the observed -i>’s are in excellent agreement (O.1-0.6) with the anomalous charge-switching estimate. k the symmetrically-solvated Iz-(Ar)Gand Iz-(Ar)zo clusters, where there is no distinction between the normal and anomalous configurations, -i> is still fairly close to the estimated number, though for Iz-(Ar)fj it is significantly lower (1 .3) than the estimate. This discrepancy probably ~ises from the virtually unimpeded motion of r away from the Ar atoms, lowering the apparent average, whereas in 12-(Ar)20,with r motion more arrested by solvent,23 the discrepancy is expected to be less, as verified by the excellent agreement (0.3) with the model for this cluster.

5.2. I;(Ar)b and I;(Ar)g

For these two clusters, the increase in the eKE of the B features after -300 fs results from a decreasing number of solvent atoms surrounding r; from Fig. 6, it is seen that -i> decreases until -1.5 ps. One possible explanation for the decrease is that the loss of solvent is due to fast ejection of neutral I, leaving behind a vibrationally excited r(Ar)n cluster which evaporates Ar atoms until the available energy is dissipated. This Chapter 6 185 mechanism was suggested in studies of Br2-(C02)~ clusters. 14However, theoretical

simulations by Faeder et aL20~23predict that, in small clusters such as ,Iz-(Ar)G,the I-

fragment simply leaves the cluster, capturing one or more Ar atoms during its escape.

Hence, as discussed previously,lz the decrease in UZ(> reflects the steady weakening of

the attractive interaction between the 1-and Ar solvent atoms.

For Iz-(Ar)G,changes to the spectrum are essentially over by 1.5 ps, at which point

the value of-a;> (1.2), is close to the photofragmentation average of 0.9 (indicated in

Fig. 6), which further indicates that the reaction is complete on the -1.5 ps time scale.

In I~(Ar)g, there is an increase in cn~> of 1.5 between 2.8 and 12 ps, followed by

a decrease of 0.5 through 100 ps. The increase in az~> does not occur for IZ-(Ar)G,and is

most likely due to a transition to the ~ or ~ state, which is predicted to result in a substantially greater anion solvation, due to solvent rearrangement from the symmetric

~’ state configuration to a more asymmetric configuration on the normal charge- switching state. This transition allows the neutral iodine atom to leave the cluster virtually unimpeded. A transition to the ~ state without recombination is supported by

Faeder et al. ,20 who found these transitions to be responsible for the high-mass I-(Ar),, channel observed by Versa et al. in clusters of Iz-(Ar)~z 11,67 since the solvent can more effectively surround the 1-in a normal charge-switching state. Although not reported in the paper, their model also observes transitions prior to final dissociation in clusters of

12-(Ar)g.sTIn 12-(C02),, clusters, this electronic transition mechanism is present in all cluster sizes and occurs as rapidly as -500 fs in large clusters.ss

The long-time (> 12 ps) decrease in a~> is probably due to solvent evaporation. a;> exceeds the photofragmentation average (2.7) by 1.0 after the electronic transition

,. ... ,,. . ..~ -, 186 Chapter 6 to the ~/~ state, and the value at 100 ps is still larger than the photofragmentation average by 0.5 & atoms. After solvent rearrangement on the normal charge-switching state, the marginal increase in ‘available energy [estimated at 110 meV from the per atom evaporative energy loss of 73 rneV] is likely to dissipate rather slowly through solvent evaporation, as observed for the 12- ~ state in 12-(Ar)12and Iz-(@lfj (see below). The disagreement between the FPES and photofragmentation values of -i> at 100 ps probably indicates further evaporation on a longer time scale.

5.3. I~(Ar)12 and lz-(Ar)lG

In these two clusters, the increase in the eKE of the B features is similar to that of the smaller clusters, and also occurs over a -1-2 ps timescale, as seen in Fig. 6. Thus, the increases, reflecting decreases in -i>, are probably caused by the same mechanism of r pulling away from the cluster. However, in I;(Ar)16, the less-solvated I atom is expected to be more arrested by the surrounding Ar atoms than in the smaller clusters, so that the decrease in ~i> may be partially attributed to evaporation of cluster atoms.

According to the photofragmentation study, there is substantial recombination of

12-,with virtually nor remaining in Iz-(Ar)lG. Features E and F appear by -10 ps in each cluster, indicating recombination of 12-on the ~ state. The broadening of the D features after 2.0-2.5 ps, and the shifting toward lower eKE, particularly for Iz-(Ar)lGwhere the decrease (240 meV) is much larger than in I~(Ar)g, indicate recombination on the ~ state. Because these spectra no longer indicated the presence of exclusively r, simulations were required in order to characterize the dynamics after these time delays.

In 12-(Ar)12,although the D features broaden through the longest time delay measured, and the intensities of features E and F also grow slowly throughout this time Chapter 6 187 range, there is little change in shape to any of these features after their formation by -10 ps. Therefore, only the spectrum at 45 ps is shown in Fig. 8(a), where. feature E is most intense. Unfortunately, the poor signal-to-noise ratio in the region of this feature, even at

45 ps, made accurate determination of o> difficult. We therefore set o> = 68 and vzx>

= O, the value consistent with the calculated available energy after evaporation of all 12

Ar atoms (710 meV) assuming 73 meV per Ar atom. Complete loss of solvent is consistent with Versa et aL,6’7 who observed ax> = O in their photofragmentation study.

Using cv> as a starting point, an ~ state vibrational distribution was constructed with Px = 0.30 and *x> = O. Although the ~ ~ ~ ITP transition does not accurately reproduce feature E, error bars in the intensity are estimated at 20-30%, and the overall intensity in this region is comparable to the simulation. The ~ ~ ~ OTP and IZ* ● ~ transitions together account for much of the broad feature F. Px is close to the photofragmentation value (0.23). D1 was represented by a combination of Ii ~ and I- states, using the following parameters: PA = 0.21, PI- = 0.49, -A> = 5.0 and cn(> = 3.2.

The eKE of D2 is also accounted for by the excited spin-orbit transitions from these states, though the intensity is lower than in the spectrum. The populations of the Iz- ~ and r channels are close to the photofragmentation values (0.23 and 0.54, respectively; see Table 5), and az~> is equal to the measured average. -A>, however, is larger than the photofragmentation average of 2.3, which was necessary in order to adequatel y simulate the spectrum.

,. .,, ...... —<-%.. ,..,. ,,,, . .@.. .-...... -. “.- ,“.: ‘ ~:,.:,.;,---- ... ~ Chapter 6 (a) n=12 f’ 45 ps

[)c F J B. k-d

0 1 2 3/0 1 2 3 Electron Kinetic Energy/eV

Fig. 8. Experimental (solid) and simulated (dotted) FPES of I~(Ar). clusters at selected time delays. Thin solid lines indicate simulated contributions from various states. (a) Iz-(Ar)12,45 ps; (b) Iz-(Ar)lG, 50 ps; (c) 12-(Ar)zo,6.0 ps; (d) Iz-(Ar)zo, 15 ps; (e) 12-(Ar)20, 50 pS; (f) I~(Ar)20, 200 pS. Chapter 6 189 Px is plotted vs. time in Fig. 9 for several time delays between 3.5 and 45 ps.

Population appears by 9.0 ps, and grows in slowly through 45 ps. The slow, monotonic

increase in the width of the D features over this time interval (not shown) indicates a

similarly slow growth of the 12- ~ state, and the large value of-A> at 45 ps compared to

the photofragmentation average also indicates incomplete dynamics on this state. Both cnx> and cn~>, however, are equal to the photofragmentation averages. In IZ-(Ar)band

12-(Ar)gclusters, uz~> was also observed to be very close (S 0.5 atoms) to the Versa et d. results by -50 ps. Thus, the r solvent evaporation appears to be complete by 45 ps, and only the ~ state has not finished relaxing. This conclusion is supported by the Faeder et al. study, which reported that ~ state evaporation required longer than the 50 ps length of the simulation to complete,20~23 while the low-mass r(Ar)~ product, which gives rise to the photoelectron signal at the highest eKE where the simulation is most sensitive to ezl-

>, appears in the first 1.0 ps. It would be helpful to measure Iz-(Ar)lZ FPES spectra at longer time delays to verify that ~A> decreases beyond 50 ps.

In the FPES of Iz-(&)l& the shifts in the D features are complete by 20 ps, and after features E and F have appeared at 10 ps, they evolve slightly through 50 ps, but the decrease in Q> on the ~ state is small (5.1). Therefore, only the 50 ps spectrum is shown in Fig. 8(b), with the following parameters: Px = 0.50, PA= 0.50, 0> = 34.4, crzx> = O and -A> = 8.0. Px and PA are close to the photofragmentation results (0.43 and

0.57, respectively). CV> corresponds almost exactly to the calculated energy remaining in the cluster after evaporation of all 16 Ar atoms (420 meV). This result supports the assumption that -ax> = O, which is also the long-time limit set by the photofragmentation study. Feature E is reproduced by the ~ ~ ~ ITP transition, while F is accounted for

.... , ...,. - _..,., -, --,,, - ., .A . . . .. F.. .F .:, :, ,-... 190 Chapter 6 by the overlapping ~ ~ ~ OTP and 12* ~ ~ transitions. Features D1 and D2 were simulated by the” ~ state. The value of ~A> (8.0) is actually larger than -i> at 2.0 ps

(5.0), reflecting the expected solvent rearrangement on the normal charge-switching state, much as was seen in Iz-(k)g. However, as *A> iS larger than the photofragment average

(6.2), further evaporation must occur on a longer time scale, as also inferred for Ii(Ar)lz.

I I 1 1 I 1 1 1 1 1 1 1 1 I I 1 I I 1 1 1 1 1 8 I I I 08● 1’

06● n= 20

04●

02●

I I t I I ! I I o . v I 1 10 100 1000 Time/ps

Fig. 9. Population of Ii ~ state (Px) vs. time, for Ii(Ar)n z 12clusters: I~(Ar)lz (plus- signs), Iz-(Ar)lG (diamonds), IZ-(Ar)ZO(squares). Detached points indicate photofragrnentation averages from Versa et al.b

Px is plotted vs. time in Fig. 9 for several simulated time delays. It rises faster, and is larger at all time delays than that of 12-(Ar)12,though it never achieves a plateau Chapter 6 191 value. As Px for time delays 220 ps are roughly the same as the photofragmentation

value, however, population transfer to the ~ state (“recombination”)- is probabl y

complete on this time scale (-20-50 ps). It appears that vibrational relaxation is also

complete on this time scale, as CV> agrees with the long-term value at 50 ps.

5.4. I;(Ar)20

In this cluster, the decrease in a(> of the B features through 1.0 ps is smaller

than in the smaller clusters (2.6 vs. -3-4), but its time evolution is fairly similar. Since

both I atoms are predicted to be completely surrounded by solvent atoms,20 the

unimpeded motion of 1-away from the Ar atoms in the smaller clusters cannot explain the

observations. Instead, a combination of cluster expansion and rapid evaporation of Ar

atoms, particularly the “capping” atoms which lie along the 12-axis, appears reasonable.~o

At later time delays, the features are relabeled D, where they broaden considerably, and

shift 140 meV toward lower eKE; again, the 12- ~ state is implicated. The time-resolved

motion of the E feature, and the complex evolution of the F feature, also indicate extensive vibrational relaxation on the 12- ~ state. Several time delays were simulated

(6.0 ps, 15 ps, 50 ps, 200 ps) to follow this process, shown in Figs. 8(c-f).

In the 6.0 ps spectrum (Px = 0.36, PA= 0.64, ~> = 44.5, ezx> = 8.0, ~A> =

9.0), the I; ~ state is still in the process of growing in. It is also so vibrationally excited

that the relative intensity of the ~ ~ ~ OTP transition appears to be changing rapidly

in this range; thus, feature F above 1.0 eV is difficult to simulate accurately. At lower eKE, however, the 12* ~ ~ transitions accounts for much of the intensity of feature F,

while the ~ ~ ~ ITP transition reproduces feature E satisfactorily. ex> is also 192 Chapter 6 difficult to determine from feature F, but an approximate upper limit is obtained by matching the falling edge near 1.0 eV. The ~ state, accounting for D1 and D2, has a smaller apparent number of Ar atoms than at later time delays, and D1 is also not as broad. This probably reflects a wavepacket that is still in the process of moving into the

~ statewell, giving ~ ardfkkdly.hw value Of -A>.

The 15 ps spectrum (Px = 0.50, PA= 0.50, a> = 29.0, -x> = 6.0,-,4> = 11.0) displays an ~ state which is considerably larger in population, less vibrationally excited, and with fewer Ar atoms than at 6.0 ps. Feature E is well-reproduced by the ~ ~ ~

ITP transition. The F feature displays two peaks which are reproduced in the simulation, corresponding to the ~ ~ ~ OTP transition at higher eKE, and the 12* ~ ~ transitions at lower eKE, which enabled accurate determination of-x>. The ~ state, accounting for DI and D2, has reached its asymptotic number of Ar atoms, although some variation (M.5) is seen at other time delays. D1 undergoes no more broadening at later time delays.

At 35 ps (Px = 0.50, PA = 0.50, ~> = 14.2, ax> = 3.0, UZA>= 11.5), the ~ state has undergone more vibrational relaxation, so that the ~’/ ~ ~ x and P/~ ~ .

~ transitions now appear as separate peaks at 900 and 610 meV, respectively. The ~ ~

~ OTP transition appears as a small shoulder on the low eKE side of feature Dl; at later time delays, it is completely absorbed by this feature. The ~ state, accounting for D1 and

D2, is virtually unchanged from 15 ps.

The 200 ps spectrum (Px = 0.54, PA = 0.56, ~> = 5.6, ax> = 0.5, -A> = 11.0) shows that 12- ~ is almost completely relaxed. While the ~ ~ ~ ITP transition Chapter 6 193 accounts for feature E, the OTP transition falls completely under D]. Feature F consists of the ~’/ ~ ~ ~ and ~/ ~“ ~ ~ transitions, which are clearly separated with considerably less intensity between the peaks than at 35 ps, allowing accurate determination of cnx>. The ~ state again accounts for D1 and D2.

Px is plotted vs. time in Fig. 9, where it is seen to rise more rapidly than in the smaller clusters, achieving a plateau near -0.55 by 10 ps, before either vibrational relaxation or solvent evaporation has neared completion. Thus, recombination appears to occur rapidly, after which these relaxation processes take place. This distinction between recombination and relaxation was not visible in Iz-(Ar)12or 12-(Ar)lG,where relaxation has proceeded almost as far as possible by the time significant ~ population was present.

This trend of accelerating recombination with cluster size reflects the increased translational energy dissipation by a larger number of Ar atoms.

~ state relaxation appears complete by -15 ps, soon after Px reaches its final value at 10 ps, as indicated by the plateauing of-A> in the simulations. One should not be surprised by the agreement between ~A> at long time delays (11.OM).5) and the photofragmentation average ( 11. 1), as the ~ state parameters were determined by setting

~A> in the 3 ns spectrum equal to the photofragmentation value (see Analysis section).

It is interesting, however, that -A> is significantly larger (-2-3) at -50 ps than the photofragmentation average in the Iz-(Ar)lz and Iz-(Ar)lGclusters. This trend is consistent with the increasing ~ state recombination rate as cluster size increases. Faeder et al. predict slow (> 50 ps) evaporation of solvent from the 12- ~ state, but they report a similarly slow rate for Iz-(Ar)zOas well.20~23As the ~ state potential determined from the

12-(Ar)20spectrum differs considerable y from the ab initiopotential,l 8 it is possible that the

.--, .,. . ,,, ,,,., ;, ,, .; 194 Chapter 6 presence of-1 1 Ar atoms has a sizable influence on this marginally-bound state, so that

potential parameters will be different in smaller clusters. Spectra of Ii(Ar)lz and I;(Ar)tG

at longer time delays are necessary to resolve whether slow evaporation, or changes in

the 12- ~ state well depth and/or equilibrium distance, is responsible for the discrepancy

in -A> for 12-(Ar)12and Iz-(&)lG clusters.

The average vibrational level a> of the ~ state simulated for each measured

- spectrum has been plotted vs. time in Fig. 10(a), along with Q> derived from Faeder et

aL23 Between 6.0 ps and 3 ns, the FPES a> drops from 40.0 to 5.1, with most of the

decrease occurring before 50 ps. There is little difference in o> between 200 ps and 3

ns. The Faeder et al. results have been adjusted to reflect the available energy from a 780

nm photon, rather than 790 nm as used in the study. The time scale for vibrational

relaxation in the Faeder et al. results is similar, and while there is a sizable discrepancy

between 6.0 and 35 ps, the curves match fairly well at later time delays.

The average number of solvent atoms -x> is plotted vs. ‘time in Fig. 10(b),

together with the Faeder et al. simulation results. In the FPES data, -x> drops from 8.0

to 0.0 between 6.0 ps and 3 ns, with the majority of the Ar loss (6.0) occurring before 50

ps. The final -2.0 Ar atoms take longer than 150 ps to evaporate, consistent with the

slowdown in evaporation rates seen in other clusters. The Faeder et al. data display

remarkable agreement with the experiment at time delays 26 ps. The agreement is

encouraging, for it not only suggests that the model is correctly describing the mechanism

Fig. 10. (On next page) (a) Average I; ~ state vibrational level (~>), (b) average number of 12- X state solvent atoms (Qx>), and (c) excess cluster energy (EClu~t~r)vs. time, for 12-(Ar)20:From FPES (circles and thin line); from Faeder et aL23 (thick line). Chapter 6 195 40

0 , 1 ! I I , I f I I , , ! I , , , I I I 1 1 1 1 , 1 I I

10 1 I o

0 I I 1 1 1 t 8 # I r 1 1 I , 1 , , I , 1 , , I 0 , 04.

o I , , ! I , ! , I 0 , ! I , , 1 t I t I , 1 1 1 1 1 1 10 100 1000 Time/ps

.,,---. ...,.- 196 Chapter 6 of vibrational relaxation and solvent evaporation, but it confirms that the spectroscopic method used to determine -x> is valid.

At first glance, it appears that vibrational relaxation and solvent evaporation evolve in step with one another, but closer examination reveals a significant time lag. To make this comparison, ESOIV,the total solvent energy that can be removed by evaporation of Ar atoms, is defined:

E,olv= &@J&ap (2) where AE~V~Pis the average energy lost from the cluster by evaporation of one Ar atom

(73 meV).T Eint,the average Ii internal energy in excess of the final (3 ns FPES) energy, is obtained by:

Ei.~= E(~>) – E(Q>~) (3) where E(a>) is the Morse energy for vibrational level o>, and CV>f(= 5.1) is the average vibrational level at 3 ns.

Subtracting l?i~tfrom EsoIv,one obtains a positive excess “cluster” energy l?~l”st~~, indicating energy neither associated with the 12-vibrational mode, nor lost as evaporating solvent. ECluSt~~is plotted vs. time in Fig. 1O(C),along with the same quantity calculated using the data from Faeder et aL23 (adjusted for 780 nm, and assuming O>f is equal to the FPES value). Both plots show a general decre%e with time, the experimental Ecluster dropping from 180 meV at 6.0 ps, to Oby 3 ns. The model shows higher values at all time delays, but it is more pronounced at earlier times (320 meV at 6.0 ps), the disparity being

due to the smaller a> relative to the experimental data at these time delays.

The excess cluster energy (at 6.0 ps, equivalent to 2.5 extra Ar atoms in the

experimental data, and 4.4 atoms in the simulation) implies that energy is temporarily Chapter 6 197 tied up in solvent modes after removal from the 12-vibrational coordinate, but before

solvent evaporation. The amount of excess energy is expected to be larger at early times,

because there are more solvent atoms available to provide for storage of this energy. For

solvent molecules with a stronger binding energy to 12-(such as COZ), this storage

capacity is larger, allowing greater amounts of energy to be stored for longer times.ss

Although there is disagreement between the Faeder et al. model and the FPES data in

a>, which m turn affects EcluSter,the signature of a delayed evaporation mechanism is

undeniable in both model and experiment, and in fact, the model results show a more

pronounced effect.

6. Conclusions

FPES has been used to study the photodissociation, recombination and energy

transfer dynamics of 12-(Ar). clusters over a range of sizes. From determination of the

number of Ar atoms surrounding the nascent r product, the anomalous charge-switching

nature of the ~’ state is confirmed, with the electron localized on the less-solvated I

atom immediately after photoexcitation. Subsequent separation of 1-and I fragments

results in a decreasing number of Ar atoms through -1.5 ps in all clusters, after which the

dissociated products have been formed in the case of small (n= 6) clusters, or

recombination on the 12- ~ or ~ states begins to occur in larger (n 2 12) clusters.

Although only dissociated products are observed for I~(Ar)p, there is a long-time (- 15-50

ps) increase in the number of Ar atoms in the cluster, suggesting an electronic transition

to the ~ or ~ state followed by solvent rearrangement. This effect was predicted by

Faeder et aL,20’37and illustrates a situation intermediate between dissociation and caging,

whereby an electronic transition occurs without subsequent recombination.

.7. ,7.: , -.”., , ....”.._y.. , , .,, -:; ., ~%-,:, ,+=..: ~- ,.. ,;, /..” ., ... 198 Chapter 6 In I~(Ar)12 and Iz-(Ar)lG, vibrational relaxation on the ~ state was slight or unobservable, and the final vibrational level remained quite high (o> =68 and 34, respectively). In 12-(Ar)20,however, extensive vibrational relaxation was observed, accompanied by evaporation of solvent. Maximum relaxation (to o> = 5.1) is achieved

by 3 ns, with the loss of all Ar atoms. The average vibrational level a> and number of . I solvent atoms uzx> were compared to the theoretical study of Faeder et al.,zs which agreed in large measure, despite a discrepancy in a> between 6.0 and 35 ps. Further analysis revealed excess energy stored in the cluster, demonstrating a delay between removal of 12-vibrational energy to the cluster, and its dissipation through solvent evaporation, in both the experimental and theoretical studies.

Although 12- ~ state solvent evaporation is complete on the time scale of the experiment, r and 12- ~ state cluster evaporation appears to require longer to complete in

I~(Ar). s 16.In Ii(Ar)g, there is a long-time slope in the graph of ~i> vs. time (Fig. 6), and the final -i> is slightly (0.5 atoms) higher than the photofragmentation results.6’7

Larger discrepancies exist for the Ii ~ state in IJ(Ar)lz and I~(Ar)lG, where the long- time value of-A> is higher by -2-3 atoms, but in 12-(Ar)20,~A> matches the photofragmentation value. The differences either indicate much slower solvent evaporation in the smaller clusters, as predicted by theoretical studies,zo~zs or a change in the ~ state parameters from 12-(Ar)12through 12-(Ar)20,which would preclude comparative analysis. FPES experiments on 12-(Ar)12and Iz-(Ar)115at longer time delays would help resolve this ambiguity. Chapter 6 199 7. Acknowledgments

The authors would like to thank James Faeder, Nicole Delaney and Professor

Robert Parson for many helpful discussions. Victor Batista is also acknowledged for

sharing his insight. Funds were supplied by the National Science Foundation under Grant

No. CHE-97 10243, and the Defense University Research Instrumentation Program under

Grant No. F49620-95-1 -0078, and are gratefull y acknowledged.

8. References

1 M. L. Alexander, N. E. Levinger, M. A. Johnson, D. Ray, and W. C. Lineberger, J.

Chem. Phys. 88,6200 (1988).

2 J. M. Papanikolas, J. R. Gord, N. E. Levinger, D. Ray, V. Versa, and W. C.

Lineberger, J. Phys. Chem. 95,8028 (199 1).

3 M. E. Nadal, P. D. Kleiber, and W. C. Lineberger, J. Chem. Phys. 105,504 (1996).

4 S. Nandi, A. Sanov, N. Delaney, J. Faeder, R. Parson, and W. C. Lineberger, J. Phys.

Chem. A 102,8827-8835 (1998).

5 A. Sanov, S. Nandi, and W. C. Lineberger, J. Chem. Phys. 108,5155 (1998).

6 V. Versa, Ph.D. Thesis, University of Colorado, Boulder (1996).

7 V. Versa, P. J. Campagnola, S. Nandi, M. Larsson, and W. C. Lineberger, J. Chem.

Phys. 105,2298 (1996).

8 D. Ray, N. E. Levinger, J. M. Papanikolas, and W. C. Lineberger, J. Chem. Phys. 91,

6533 (1989).

9 J. M. Papanikolas, V. Versa, M. E. Nadal, P. J. Campagnola, J. R. Gord, and W. C.

Lineberger, J. Chem. Phys. 97,7002 (1992).

...... , ...,,,,...... 200 Chapter 6 10 J. M. Papanikolas, V. Versa, M. E. Nadal, P: J. Campagnola, H. K. Buchenau, and W.

C. Lineberger, J. Chem. Phys. 99,8733 (1993).

11 V. Versa, S. Nandi, P. J. Campagnola, M. Larsson, and W. C. Lineberger, J. Chem.

Phys. 106, 1402 (1997).

12 B. J. Greenblatt, M. T. Zanni, and D. M. Neumark, Science 276,1675 (1997).

13 B. J. Greenblatt, M. T. Zanni, and D. M; Neumark, Faraday Discuss. 108, 101 (1997).

14 L. Perera and F. G. Amar, J. Chem. Phys. 90,7354 (1989).

15 F. G. Amar and L. Perera, Z. Phys. D. 20, 173-175 (1991).

16 P. E. Maslen, J. M. Papanikolas, J. Faeder, R. Parson, and S. V. ONeil, J. Chem.

Phys. 101,5731 (1994).

17 J. M. Papanikolas, P. E. Maslen, and R. Parson, J. Chem. Phys. 102,2452 (1995).

18 P. E. Maslen, J. Faeder, and R. Parson, Chem. Phys. Lett. 263,63 (1996).

19 V. S. Batista and D. F. Coker, J. Chem. Phys. 10697102 (1997).

20 J. Faeder, N. Delaney, P. E. Maslen, and R. Parson, Chem. Phys. Lett. 270, 196

(1997).

21 N. Delaney, J. Faeder, P. E. Maslen, and R. Parson, J. Phys. Chem. A 101 (1997).

22 B. M. Ladanyi and R. Parson, J. Chem. Phys. 107,9326 (1997).

23 J. Faeder and R. Parson, J. Chem. Phys. 108,3909 (1998).

24 P. E. Maslen, J. Faeder, and R. Parson, Mol. Phys. 94,693 (1998).

25 J. Faeder, N. Delaney, P. E. Maslen, and R. Parson, Chem. Phys. 239,525 (1998).

26 M. E. Nadal, S. Nandi, D. W. Boo, and W. C. Lineberger, J. Chem. Phys., submitted.

27 C. J. Margulis and D, F. Coker, J. Chem. Phys., in press (1999). Chapter 6 201 28 A. E. Johnson, N. E. Levinger, and P. F. Barbara, J. Phys. Chem. 96,7841 ( 1992).

29 D.A. V. Kliner, J. C. Alfano, and P. F. Barbara, J. Chem. Phys. 98,5375 (1993).

30 J. C. Alfano, Y. Kimura, P. K. Walhout, and P. F. Barbara, Chem. Phys. 175, 147-155

(1993).

31 I. Benjamin, P. F. Barbara, B. J. Gertner, and J. T. Hynes, J. Phys. Chem. 99,7557-

7567 (1995).

32 p. K. Walhout, J. C. Alfano, K. A. M. Thakur, and P. F. Barbara, J. Phys. Chem. 99,

7568 (1995).

33 K. Asmis, T. Taylor, and D. M. Neumark, J. Chem. Phys. 109,4389 (1998).

34 M. T. Zanni, T. R. Taylor, B. J. Greenblatt, B. Seep, and D. M. Neumark, J. Chem.

Phys. 107,7613 (1997).

35 B. J. Greenb]att, M. T. Zanni, and D. M. Neumark, J. Chem. Phys., to be submitted .

36 B. J. Greenblatt, M. T. Zanni, and D. M. Neumark, Chem. Phys. Lett. 258,523

(1996).

37 N. Delaney, J. Faeder, and R. Parson, private communication

38 W. C. Wiley and I. H. McLaren, Rev. Sci. Instrum. 26, 1150 (1955).

39 c). Cheshnovsky, S. H. Yang, C. L. Pettiette, M. J. Craycraft, and R. E. Smalley, Rev.

Sci. Instrum. 58,2131 (1987).

40 L.-S. Wang, H.-S. Cheng, and J. Fan, J. Chem. Phys. 102,9480 (1995).

41 M, T, Zanni, v, s, B~ti~@ B, J, &~~~bl~tt, W. H. Mill~~, and D, M. N~U~~k, J.

Chem. Phys. 110,3748 (1999).

42 C. E. Moore, Atomic Energy Levels, Vol. 1, NSRDS-NBS 3.5(197 1). ..

202 Chapter 6 431. your~haw, y. Zhao, and D. M. Neumark, J. Chem. Phys. IOS, 351 (1996).

44 T. Kuhne and P. Vohringer, J. Chem. Phys. 105,10788 (1996). ‘

45 S. E. Bradforth, ph.D. Thesis, University of California, Berkeley (1992). 203 Chapter 7. Femtosecond photoelectron spectroscopy of 12-(C02)~photodissociation dynamics (n= 4,6,9,12, 14, 16)*

The photodissociation dynamics of 12-embedded in size-selected van der Waals

clusters of 4-16 C02 molecules have been studied with femtosecond photoelectron

spectroscopy (FPES). The range of cluster sizes span the uncaged and fully-caged

product limits for this reaction; several intermediate-sized clusters exhibit both caged and

uncaged products at long (200 ps) time delay. All clusters exhibit exclusively solvated I-

features initially, with the number of C02 molecules increasing with time delay, due to

solvent rearrangement and/or electronic relaxation in which the electron hops from the

less- to more-solvated I atom. At longer time delays (-500 fs- 10 ps), vibrationally excited

Ii ~ state features appear in I;(C02). ~Gclusters, with a decrease in r intensity. The ~

state features evolve through 10-200 ps, reflecting vibrational relaxation, with a rate

which increases substantially with cluster size. In clusters of Iz-(C02)~ ~g, there is also

significant intensity (-O. 1-0.4 fraction of the total population) arising from a solvent-

separated 12-structure, which resembles r with fewer surrounding C02 molecules,

presumably trapped on the ~ state. Detailed simulations of the spectra were performed

in order to determine the populations, ~ state vibrational level, and number of COZ

molecules in the cluster at different time delays. Results are compared to previous

experimental and theoretical studies of 12-(C02)~ photodissociation, as well as to the

FPES study of I~(Ar). photodissociation presented elsewhere in this journal.

- B. J. Greenblatt, M. T. Zanni, and D. M. Neumark, J. Chem. Phys., in preparation for submission.

..4 -, .- ,,- ,, ,~,r .--.:- ;~y--- .,- Y--- ,’ -.-s--,,> ... ” ,-,.’,.- 204 Chapter 7 1. Introduction

The gas-phase study of 12-embedded in a van der Waals cluster of C02 molecules is a powerful method for understanding the effects of solvation on a chemical reaction.

Solvent molecules, which often profoundly change the energetic surfaces governing a reaction, may be progressively added to a cluster one molecule at a time, owing to the inherent size-selectivity of charged particles. This approach enables changes in reaction dynamics to be studied across cluster size, as the solvent environment moves from the gas phase to a condensed-like phase. Lineberger and coworkers first examined the anionic products of Br2-(C02)~ photodissociation in 1988,1 and subsequently expanded their scope to include 12-in C02, Ar and most recently OCS clusters, examining both

asymptotic products as well as time-resolved dynamics.z-lo Theoretical investigations of the structure and dynamics of 12-clusters have been performed by several groups. 11-23

Solution-phase experiments involving 12-photodissociation in numerous solvents have also been pursed by Barbara and coworkers.z~zg The gas-phase studies have shown that the dissociation channel closes in 12-clusters with a relatively small number of solvent

molecules (less than one-half of a solvent shell), and that the rate of appearance of

“caged” 12-products increases dramatically with cluster size. Comparisons across solvent

type reveal a strong dependence on solvent-solute binding energy in the recombination

rate. In solution, timescales for caging are similar to those of large 12-(CO& clusters,

though interesting new effects appear, such as the permanent escape of r into solution,

not observed in the gas-phase experiments.

Our research group has focused on I~(Ar). and I~(C02). clusters using

femtosecond photoelectron spectroscopy (FPES).Z9’SOThe preceding article on I~(Ar). Chapter 7 205 photodissociation dynamicssl demonstrated the effect of a weakly-interacting solvent on

the 12-photodissociation reaction, such as closing of the dissociation channel through

solvent-induced electronic transitions, dissipation of energy through solvent evaporation,

and stabilization of an excited state. It was also shown that the FPES pump-probe techniques provided an enormous amount of time-resolved information, including the changing electronic and vibrational state of the anion, and the number of solvent molecules near the negative charge. These effects were not observable using previous experimental approaches.

The I~(C02). system represents a stronger solute-solvent interaction than that of

12-(Ar).. While C02 lacks a dipole moment, its large quadruple moment gives rise to a sizable 12--C02 well depth (-200 meV),7 about four times larger than that of Iz--Ar (53 meV).Js Solvent-induced effects are therefore expected to be more pronounced in

12-(C02). clusters. This paper reports on the use of FPES to investigate IZ-(COZ). clusters, ranging in size from n =4, which produces almost exclusively uncaged r(COz). fragments, ton = 16, which exhibits only caged 12-(COZ).fragments. Intermediate-sized clusters are of particular interest, as both types of fragments are present. The timescales for caging, vibrational relaxation and solvent rearrangement and evaporation are investigated as a function of cluster size. A comparison with the Iz-(Ar). study is made at the end of the paper.

The FPES technique excites a cold, mass-selected 12-(COZ).cluster with a 780 nm femtosecond pump pulse from the ~ (2Z~) ground state to the ~’(211,,2,, ) dissociative state of 12-(Fig. 1). A second, delayed femtosecond probe pulse (260 nm) then detaches an electron from the cluster, producing a photoelectron spectrum. Different vibrational

. ., -....7.*T- .-’,-, ,:;%:- “’.-”. T,’,- ,,;::..: -.““’,, ‘%%””‘z .~:- - ,.:.,., .,...... 206 Chapter 7 and electronic states of the anion, including photodissociated r, are readily distinguishable, tid the number of solvent molecules nearby to the anion cam also be determined, giving a detailed picture of the dynamics. The information obtained with

PPES is complementary to previous experimental and theoretical work, which is described briefly below.

------I 2P,,*------+ I 2P3,----,

------I ------2P3,2------+ I 2P3,---

Probe x-1 1 ‘P,,’ + 1“‘s.

– azIIu.3,2 I ‘P,,’+ 1“‘s.

I t , , I 2 3 4 5 6 7 8 Distance/~

Fig. 1. Potential energy curves for bare 1;. Solid lines (--): Ii. Dotted lines (“””o””):Iz.

Photofragment mass spectra of photodissociated I~(C02). clusters were measured

by the Lineberger group at two wavelengths, 720 and 790 nm.’$’TIn these experiments,

cold mass-selected clusters were excited with a pulsed laser, and photofragment masses

were determined using a reflection. Only uncaged fragments were observed in smaller

clusters, gradually replaced by caged fragments as the size increased; the uncaged

channel closed at one full solvent shell, 12-(C02)lfj.The number of solvent molecules Chapter 7 207 present in both types of product fragments was smaller than that of the parent cluster,

with more molecules lost in the caged fragments due to energy released when the 12-bond

reforms.

Time-resolved absorption recovery experiments on IZ-(COZ). clusters were also

performed by the Lineberger group, in which cold mass-selected clusters were excited

with a ps-duration laser pulse at 720 nm,s-g or a fs-duration pulse at 790 nm,lo then re- excited with a second, identical pulse after a variable time delay. The total flux of two- photon photofragments as a function of pump-probe time delay was assumed to indicate the absorption of 12-near the bottom of the ~ state well. Minimum absorption was observed initially, growing at later time delays. Exponential recovery time constants (tlj~

= 1.3-24 ps) were much shorter than observed for 12-(Ar)20(127 ps).lo Additional temporal structure in the recovery curves was also observed, most notably a transient increase (“bump”) at -2 ps in IZ-(COZ)11-16clusters, attributed to a resonant Z (z13~,z,U) C

~(21T~,z,~) transition in 12-.

Considerable theoretical work has been done on the IZ-(COZ). system. Minimum energy structures have been investigated by several groups, and agree in large measure. ‘ZS’4’’8’ZS’S4Fig. 2 shows calculated structures for selected cluster sizes, taken from the Parson group studies. 14S18’S4The first 3 solvent molecules locate in a ring about the Iz- intemuclear axis. Six additional molecules surround one I atom, until no more space remains. The other end of the 12-molecule is then solvated, and the number of solvent molecules around the 12-internuclear axis also increases to 4. A full shell is obtained for

16 solvent molecules. The charge is equally shared by both I atoms in the small and large

.;. - s-., -J— ,,,...,.- . . . ., ,.-., ——. —..

208 Chapter 7 clusters, but in then = 6-12 size regime, where asymmetric structures are observed, the charge is more localized on the heavily solvated atom.

The mechanism of I;(COz)n photodissociation was investigated by Parson and coworkersls’14’lg’’g’22’s4using nonadiabatic molecular dynamics simulations. They found that photodissociation on the ~’ state is accompanied by rearrangement of solvent to a more symmetrical configuration in the first 400-500 fs in all clusters, due to an effect called “anomalous charge-switching” where the solvent is prevented from fully surrounding the charge. A transition to the ~ or ~ state occurs in all clusters, even those which form uncaged products, from -500 fs to> 2 ps; the longest transition times occur for intermediate-sized clusters [Iz-(C02).. 9]. Although some transitions proceed from the ~’ directly to the ~ state, the ~ ~ ~’ transition becomes increasingly favored as an intermediate step as cluster size increases, with the effect that ~ state recombination becomes more and more delayed in large clusters. However, once recombination on the ~ state occurs, vibrational relaxation proceeds rapidly (1-3 ps) in all clusters. Population on the ~ state is not permanent, but persists in IZ-(COZ)nz T anywhere from 1 to 100 ps. Unlike the ~ state product predicted for Iz-(Ar)n clusters, with 12-stabilized in the shallow well, this structure consists of a “solvent-separated pair,” with the r surrounded by most of the solvent molecules, and the I located outside the

solvent shell, surrounded by a fewer number of C02 molecules.

Fig. 2. (On next page) Calculated minimum-energy structures of selected I;(COz)n clusters: (a) 12-(C02)4; (b) 12-(C02)9; (c) IZ-(COZ)lG. Chapter 7 209 ()a n

(b)

(

... ,.. ,... .-,-:.;..-.. . -,, - ~-,. ...-.,*,,- ..-x- ; 210 Chapter 7 Margulis and Coker~ also investigated the photodissociation of I;(C02)8 and

IZ-(COZ)IGclusters at 720 and 790 nm using a similar nonadiabatic molecular’dynamics framework. For the smaller cluster, uncaged fragments are produced in -500 fs when the electron hops to the more solvated I atom as a result of an electronic transition from the

~’ state, while caged fragments result when the transition occurs later, allowing solvent rearrangement to trap both I atoms. The larger cluster exhibits complete caging, but at

720 nm, only -20910 recombine within 2 ps, the majority being delayed by 10-25 ps due to trapping in a solvent-separated configuration; at 790 nm, all trajectories are delayed.

Vibrational relaxation occurs within -10 ps after recombination.

The main goal of this study is to follow the evolution of cluster dynamics from the uncaged to filly-caged size regime. Our most important findings include: 1). Short- time (c -1 ps) changes in the number of solvent molecules around r, implying fast solvent rearrangement on the initial ~’ state, as well as electronic transitions to the ~ or

~ states. 2). Time-resolved vibrational relaxation of 12-on the ~ state in Iz-(COz)nz (i clusters. 3). Excess numbers of solvent molecules at long time delays (200 ps) around 12-

x as compared to photofragmentation measurements, implying incomplete solvent evaporation despite rapid relaxation of 12-.4). The presence of a long-lived (>200 ps) solvent-separated 12-product in clusters of 12-(C02). ~g, presumably trapped on the ~

state.

2. Experimental

The apparatus differs slightly from the one described in the previous article,31 so it

is summarized briefly here. 12-(C02)~ clusters are produced by passing a mixture of 3%

C02 in Ar at 20 psig over solid 12and expanding into vacuum through a pulsed Chapter 7 211 piezoelectric valve, where the gas is intercepted by a 1.5 keV electron gun. Cluster anions

are pulse~extracted into a Wiley-McLarensS time-of-flight mass spectrometer where they

travel to the laser interaction region. Femtosecond pump pump (780 nm, 80 fs, 150 pJ)

and probe (260 nm, 100 fs, 20 pJ) pulses intersect the anions at the focus of a magnetic

bottle electron spectrometer,sG and photoelectrons produced are energy-analyzed by time-

of-flight. To increase electron resolution, anions were pulse-decelerateds7 just prior to

laser interaction; however, this technique resulted in a loss of -75% of the electron

signal, and so was only applied to clusters with relatively high anion flux [IZ-(COZ)~~ l?].

However, the slower beam velocity of the heavier anions results in an energy resolution

which scales as m‘1’2,where m is the anion mass. Resolution for 1 eV electrons was 40-50

meV with deceleration, and -100 meV without deceleration. Typical acquisition times

were 80- 1000s per time delay. One-photon (probe only) photoelectron spectra of

12-(C02). clusters (n= 1-10, 12, 14, 16) were also collected, in order to determine the

energy shift of 12-features due to the presence of C02 molecules. Acquisition times for

these spectra were 1000-6000s per cluster.

3. Results

One-photon (probe only) photoelectron spectra of I~(C02). clusters (n= 1-10, 12,

14, 16) are shown in Fig. 3, and the shift in the vertical detachment energy of the ~ state

relative to bare 12-is plotted vs. n in Fig 4. A monotonic shift toward lower electron

kinetic energy is observed wi’th increasing cluster size, -150 meV per COZ molecule for

12-(C02), and decreasing to -50 meV/C02 for 12-(C02). ~ 10.A more systematic study of these trends will be presented in a future publication.ss

,. .,.,. ~,-,- ,..-..:..?----... .- 212 Chapter 7 0 1 1 I , 1 t n= 16 14, 12 10, 9 8 7 6 5, 4 3 2, WM 1

0.0 0.5 l.O 1.5 2.0 Electron Kinetic Energy/eV

Fig. 3. One-photon photoelectron spectra of I~(COz). (n = 1-10, 12, 14, 16) clusters. Photon energy = 4.768 eV. . Chapter 7 213

12●

10● “

08● -

06● - 04-. 02-9

0“00246810121416 Number of CO,

Fig. 4. Solvent shift energy of the I; ~ state vs. n, for I;(C02). clusters (n= 1-10, 12, 14, 16).

Time-resolved photoelectron spectra for 12-(C02). clusters with n = 4,6,9, 12, 14 and 16 are shown in Figs. 5a-c and 6a-c for selected pump-probe delay times. Spectra were taken at many more delays than are shown in the figures; the selected spectra represent the minimum needed to follow the dynamics in these clusters. The spectra consist of peaks of various widths that evolve as a function of time. The maximum time delay recorded for each cluster is 200 ps.

Based on our detailed study of I~(Ar). reported in the previous paper,J1 and the mass spectroscopy studies of 12-(C02)~ photofragmentation by Lineberger and co- workers,q,s many of the features in these spectra can be assigned at least on a preliminary basis. This assignment scheme is summarized in Table 1. Feature A, seen at the earliest 214 Chapter 7 times, reflects the transient 12-created on the repulsive ~’ state by the pump pulse; anal ysis of this feature has been reported in detail elsewhere.sg Features B, C, ‘and D are relatively sharp peaks that appear by -1.1 ps. We attribute these to the I ~ r transitions, where r is solvated by increasing numbers of C02 molecules, since for a given cluster they occur at progressively lower electron kinetic energies (eKE). The subscripts 1 and 2, when shown, (n= 4, 6, 9) result from photodetachment to the 2P31Zand 2P1jzstates of atomic iodine, respectively. The progression in time and energy for these three features is most apparent for IZ-(COZ)G,IZ-(COZ)9and 12-(C02)12, where peak B is most intense at

-200 fs, peak C is most intense at -400-500 fs, and peak D is most intense by -800 fs-1. 1 ps. A distinct feature C is not evident for the other clusters, but in all cases there is a net shift to lower electron energy from feature B at -200 fs to feature D at -800 fs- 1.1 ps.

Table 1. Labeling system of features observed in FPES of 12-(Ar). and 12-(COZ).clusters, with corresponding assignments. In cases where two spin-orbit manifolds are visible (peaks A-D), each is labeled with a subscript, e.g. Al and A2, according to decreasing eKE.

Label I Assimment A 12 ~ I; ~’ (transient) B I ~ r (anomalous state) c I + r (symmetrically solvated) D I ~ r (dissociated), I ~ r (solvent-separated 1;) E 12 X+12- XV=O, 12 ~ ~ Ii ~ excited inner turning point (JTP) F 12 ~ ~ I; ~ excited outer turning point (OTP), 12*(higher-lying states) ~ Ii ~ G 12 ~ ~ 1; ~ and I ~ r (indistinguishable)

Feature E appears at high electron kinetic energy for all clusters except I~(C@d.

The earliest time at which it can be observed drops with increasing cluster size, from -10 Chapter 7 215 ps for Iz-(CO& to -500 fs for Iz-(coz)lo.lfj. Once this feature appears, it shifts toward

lower electron kinetic energy with increasing time, and the degree of shifting is most apparent for the 12-(C02)ld.l(jclusters. Based on comparison with our 12-(Ar)20 results, feature Eat early times is attributed to photodetachment from the classical inner turning point region of a vibrationally excited 12-wavefunction, resulting from recombination on the ~ state; the shifting toward lower electron kinetic energy is from subsequent vibrational relaxation of the 12-.At time delays >5 ps for n = 14 and >4 ps for n = 16, feature E is relabeled feature G to signify that is has merged with lower energy features

(see below). In clusters of n <12, feature E remains distinguishable from other features in the spectrum at all time delays.

The trends at time delays beyond -1 ps for n = 9, 12, 14, and 16 clusters at low eKE (e -1 eV) hint at more complex dynamics that were seen for 12-(Ar). clusters. The labeling scheme for the spectra in this regime is based on the simulations described in the following sections; it is not obvious by inspection. For 12-(C02)9, the single feature D at

1.0 ps broadens slightly toward higher eKE, and by 200 ps appears to be a shoulder on the high energy side of a peak labeled F. For 12-(C02)12, feature D splits into two features by 6.0 ps, D (at low eKE) and D’ (at high eKE), with feature E appearing as a shoulder on D‘ at 200 ps. In the 12-(C02)14spectra, feature D begins shifting toward higher eKE after 1.3 ps, and merges with E by 20 ps, at which point the merged feature is labeled G.

Fig. 5. (On next page) FPES of I;(C02). clusters at selected delay times: (a) IZ-(COZ)A (b) I’2-(CO’2)Gand (c) I~(COZ)9. pump photon energy= 1.589 eV, probe photon energy= 4.768 eV.

Fig. 6. (On page 217) FPES of I~(C02). clusters at selected delay times: (a) IZ-(COZ),Z, (b) I~(C02)li and (c) I~(COz)~& Pump photon energy= 1.589 eV, probe photon energy= 4.768 eV.

.-,..,-...-!-..Y--,- - : -~ - 216 Chapter 7

10 n WI i \ 1 .rml I –[ –

[ /10 m

d 5 %!” < >{

0 Chapter 7 217 0

d- Q N II

0

n- io 0 Apsua~uI* 218 Chapter 7 A low-energy feature, F, emerges after 880 fs, and drops away again by 20 PS. For 12” -.

(C@l& D changes from a peak at 500 fs to a shoulder at 1.0 ps on a lower energy feature labeled F. By 4.0 ps, D is gone, leaving E and F, which merge into feature G by 6.0 ps.

The detailed interpretation of this last set of results is possible only by comparison- with simulations described below. These will demonstrate that peak F has a similar origin as in the Iz-(Ar)~ spectra namely, photodetachment from the classical outer turning point of vibrationally excited 12-to the ground state of 12,and from vibrationally relaxed 12-to the low-lying excited states of 12.The simulations also suggest that feature D in clusters of 12-(C02). ~s [D’ in 12-(C02)12] is due to formation of a long-lived, solvent-separated state of 12-within the cluster.

4. Analysis

Simulations of the photoelectron spectra were performed in a manner similar to that for the Iz-(Ar)n clusters,sl using a combination of previously-measured photoelectron spectra to simulate the r features, and calculated photoelectron spectra to model vibrationally excited 12-features. Details of the methods used can be found in the previous paper,Jl but a brief overview of considerations unique to the 12-(C02). simulations are discussed below.

The number of solvent molecules around r, termed “#z~>,” was determined from previously-measured solvent shifts of r(COz). clusters.~2 The shifts are much larger per

COZ molecule than per Ar atom, -170 meV for r(COz), decreasing to -40 meV for r(C02),1 ~ 10.For analysis of short-time (< -1 ps) spectra, the eKE of features B, C and D

have been converted into *1-> (using linear interpolation to calculate a fractional value

when the eKE lay between measured shifts) and are presented in Table 2. Included in this Chapter 7 219 table are estimates of en;> for the anomalous and normal charge-switching states, based on calculated structures, 18,ZZOJ4and assuming no loss of C02 molecules, An estimate for a symmetrically-solvated structure, which would occur at later time delays on the ~’ state, is also shown, obtained by averaging the anomalous and normal values. In clusters of

12-(C02). ~g, there is evidence that a solvent-separated 12-structure (“SS 12-”)is at least partially responsible for feature D [D’ in the case of 12-(C02)12].This structure appears spectroscopically as solvated r, because the 1-is surrounded by C02 molecules, with the I atom located outside the solvent shell. This interpretation is explored in detail in the

Discussion.

Table 2. Calculated number of solvent molecules ez~> for features B, C and D in I~(CO& clusters from FPES. Estimated a~> for anomalous ( ~’ ) and normal ( ~, ~ ) charge-switching states, and cn~> for a symmetric solvent configuration on the ~’ state, derived from model structures.lg

Parent FPES Model estimates Cluster BCD Anomalous Symmetric Normal 4 1.4 - 2.5 3.0 3.5 4.0 6 2.1 3.4 4.4 3.0 4.5 6.0 9 3.0 5.0 6.7 3.0 6.0 9.0 12 4.8 7.2 8.0 5.0 7.0 9.0 14 7.8 - 8.2 9.0 9.5 10.0 16 8.4 - 8.9 10.0 10.0 10.0

For simulating FPES spectra, actual r(C02). photoelectron spectra were used,~l rather than the shifted 1-spectra used for I-(Ar)., because the r(COz). spectra contain prominent progressions arising from C02 vibrational modes. Normalization of the spectra was achieved by scaling the integral of the 12P3/2 ~ 1- lSOtransition to that of the bare I“ spectrum [2.0, relative to 1.0 for the 12 ~ ~ 12- ~ (v = O) transition] .31 220 Chapter 7 Solvated Ii ~ was modeled using an empirically determined distribution of vibrational levels, designated by an average level “Q>,” and average number of solvent molecules “~x>.” The solvent shift energies from the one-photon photoelectron spectra of 12-(C02). clusters measured in this work (Fig. 4) were employed to shift the simulated spectra. The method of generating spectra, and the relative intensities of transitions, were identical to those used for 12-(Ar). clusters, including the energy-dependent scaling functionfiE) for the ~ ~ ~ transition.J]

The most important task in fitting the solvated Ii ~ state features is determining cnx> and o>. At long time delays, when a> is fairly small (<-5), simultaneous determination of-ax> and -a> from the spectrum is possible by simulating feature E (or

G). In this situation, the feature arises from a compact 12 ~ ~ 12- ~ transition whose shape depends sensitively on a>, while the overall eKE of the transition is governed by cnx>. At larger -a>, the ~ ~ ~ transition splits into two distinct energy regions arising from different segments of the 12-vibrational wavefunction. Near the classical inner turning point (ITP) of the 12-potential, the transition exhibits a broad range of eKE’s, and the maximum eKE increases rapidly with CV>. Near the classical outer turning point (OTP), the transition is much narrower and intense, occurring at lower eKE, and its eKE is relatively insensitive to a> over a wide range (-10-30), giving an indication of cnx>. The ~ ~ ~ ITP transition, lying at the highest eKE in the spectrum, corresponds to feature E at short time delays; however, as its eKE is dependent on VZx> and CV>, both quantities cannot be simultaneously determined from this feature.

In the I~(Ar). clusters, the ~ + ~ OTP transition, as well as transitions from Ii ~ to Chapter 7 221 higher-lying 12states ( ~’, ~ , &, ~“, d, ii’ and ~), collectively referred to as the IZ*

~ ~ transitions, occur at lower eKE where they are denoted by featu~e F. This feature was used to determine cnx>, as the eKE’s of the transitions are all relatively insensitive to cv>.11 In 12-(C02). clusters, however, the transitions either are not accessible at the probe wavelength due to large solvent shifts, or they are masked by overlapping I- features, making accurate determination of -ax> difficult.

In these cases [primarily at short time delays in I~(C02)lQ and I~(COz)16 clusters], simulations using several values of ax> were performed. Several criteria were then considered in determining a “best” uzx> time progression for the cluster. The value of cnx> at long time delays, where it could be determined with more confidence, served as a primary constraint. It was assumed that ax> decreased monotonically with time delay, and that changes from one spectrum to another were not abrupt (S 1 C02 molecule). The correspondence between the experimental spectra and simulations using different values of uzx> was not equally good, further limiting the choices of uzx>. A final decision rested on careful comparison of -aX> in neighboring clusters, and the photofragmentation averages. These issues are covered in detail in the Discussion.

Populations of the 1-and 12- ~ state contributions, indicated by “PI-” and “Px,” respectively, were determined from the intensities of simulated spectral features, weighted by their relative cross-sections. PI- and Px sum to unity for all spectra.

Simulation parameters are summarized in a series of graphs in Figs. 7a-b (Px and

~> vs. time), and 8a-b (cnx> and az~> vs. time). Included in these figures are data from

12-(Ar)20, and photofragmentation values indicated as detached points in the Px, *x> and ez~> vs. time graphs. Although several time delays have been simulated to follow the

~>-, ,.~,.-”-, .,, —- .-, ,,7, .-...,., 222 Chapter 7 dynamics in each cluster, only a selected number are shown to illustrate the changes

taking place. These are presented in Figs. 9 (n= 4), 10a-f (n = 6,9 and 12), 12a-c (n=

14) and 13a-d (n= 16), and each graph includes curves representing the solvated r and I;

~ contributions, the total simulated spectrum, and the experimental spectrum.

5. Discussion

Cluster spectra are treated in three sections, grouped by similar dynamics:

I~(C02)4, which shows relatively simple solvated r formation, and no I;; I~(C@fj,

12-(C02)9 and 12-(C02)12, which exhibit more complex r dynamics, and increasing

amounts of 12-recombination and vibrational relaxation; and 12-(C02)14and IZ-(COZ)lIj,

where r dynamics are rapidly obscured by 12-features, which exhibit extensive

vibrational relaxation. For reference in the following discussions, the fraction of 12-

products measured in the photofragmentation experiments are: 0.03 in I~(C@Q, 0.29 in

I~(CO&, 0.70 in I~(C02)S, 0.85 in I~(C02)12, 0.95 in I~(C02)ld, and 1.00 in I~(Coz)l&

Thus, there are essentially no 12-products in 12-(C02)4, and nor products in I~(C02)14.16.

After discussion of each group of clusters, trends across cluster size are summarized, and

comparisons are made to previous experimental and theoretical work. Parallels with

12-(AI-).clusters are made in the final section.

5.1. I~(COZ)4

In I~(C02)4, r-based products dominate in the photofragmentation experiments,

and no 12-features are observed in the FPES spectra. This cluster is also predicted to

possess an initial solvent configuration which is fairly symmetric, with three of the four

solvent molecules around the 12-waist. Chapter 7 223 We begin by focusing on the short-time dynamics. Feature B, peaking at -200 fs, represents the earliest observable r signal, when the r and I are not very far apart and the system is presumably still on the ~’ state. For this feature, az~> = 1.4, significantly smaller than the total number in the cluster, which indicates substantial movement of the

1-away from the cluster by this time delay. By the time feature D fully forms at 800 fs,

~1-> is larger (2.5), suggesting a more heavily solvated environment around l-. The increase could be due to either rearrangement on the ~’ state into a symmetric solvent configuration, or a transition to the normal charge-switching ~ or ~ state which returns the electron to the original, more solvated I atom. These alternatives are represented in

Table 2 as the “symmetric” and “normal” estimates, respectively. However, because the

-1-> of D is smaller than either of these estimates, it is not possible to distinguish among these possibilities from the spectra.

Fig. 7. (On next page) Simulation parameters for I;(C02). clusters: (a) Population of the 12- ~ state (Px) vs. time, (b) Average vibrational level of the 12- ~ state (a>) vs. time. Legend: upward-pointing triangles = I~(CO’&, downward-pointing triangles= Iz-(COz)g, circles = 12-(C02)12,squares = 12-(CC)2)14,diamonds = 12-(C02)16,crosses = Iz-(Ar)zo. Detached points indicate values from Versa et LzL1O

Fig. 8. (On page 224) Simulation parameters for 12-(C02). clusters: (a) Average number of C02 molecules in the 12- ~ state (ax>) vs. time, (b) Average number of COZ molecules in the 1-fragment (ez~>) vs. time. Legend is identical to Fig. 7. Detached points indicate values from Versa et CZLNJ

,?-“ ,- .. ,-, , , y. ;<.y:.’. .------...... - ..”.,-. ,,. --m ,,. . 224 Chapter 7

A 1 1 1 I 1 I Ii i I I I I I 111 I 1 1 I 1 1 11[ 1 v 10●

08● ‘a) F16 ‘: v 06 x“ 4

04●

02● Versa et al. o 48

lb~

30 t \

A $’20

12” 10 9+

x

0 ,

01● 1 10 100 1000 Time/ps 225 4P I i I 1 0 , I t 1 1 1 , , b t 1 1 a () Versa et al. ● 16 10 + A ii!? v 5

0

et al. 10 A ;“ v 5

A

1 1 I 1 1 1 1 1 t 1 1 , I I 1 II 1 1 I I ! I !!1 t o—

01● 1 10 100 TimeJps

,,.>,.., .. _.,,. . . ,,, . . .’ 226 Chapter 7 The FPES of I~(C02)4 undergo little change after 800 fs, demonstrating the extremely fast nature of the reaction: essentially the unencumbered photodissociation of

Ii. To illustrate the composition of the products, the 200 ps spectrum was simulated using a distribution of r(C02)~ spectra, shown in Fig. 9. This distribution does not match the photofragmentation data exactly, with -i> (2.6) somewhat higher than observed in these experiments (-i> = 1.9). This discrepancy points to possibly vibrationally excited product which has not dissipated its excess energy through solvent evaporation by 200 ps.

Fig. 9. Simulated spectra of I~(C02)4 at 200 ps. Experimental (thick solid line) and simulated (thick dotted line) data are shown. Only r contributions were required to reproduce the experimental spectrum.

5.2. l~(COz)fj, l~(C@$l and Ii(COZ)12

These intermediate-sized clusters exhibit both solvated r and 12-features in their spectra at long time delays, consistent with the photofragmentation experiments. They are also predictedls’zz’qqto have highly asymmetric initial solvent configurations, that is, with the more negative I atom strongly solvated, and other I atom significantly less solvated.

This asymmetry is exhibited in the short-time dynamics as three distinct solvated I-

features (at different eKE’s) in the first -1.0 ps after photodissociation. These short-time Chapter 7 227 dynamics will be discussed first, and then simulations of the Iz- dynamics will be covered for each cluster individually.

As shown in Table 2, the difference in o~> between the anomalous and normal estimates is fairly substantial for these clusters, allowing the charge-switching state responsible for the cnl-> of feature B to be determined unambiguously. In all cases, cnl-> is closest to the anomalous estimate, meaning that the negative charge is initially on the less-solvated I atom. The increases in cn~> for features C and D indicate more heavily solvated environments around r, but the presence of two distinct features, one of which is short-lived (C), and the other of which persists for several ps (D), suggests the existence of two, possibly coupled, mechanisms. As for 12-(C02)4 above, both features could be due to either rearrangement on the ~’ state into a symmetric solvent configuration, or a transition to the normal charge-switching ~ or ~ state which returns the electron to the original, more solvated I atom. Some C02 molecules probably escape from the cluster during the first -1 ps, making the estimates for cn(> upper limits on the observed value of UZ;> corresponding to each structure (symmetric or normal). Bearing this in mind, in each cluster there is a reasonable correspondence between the -(> of feature C and the symmetric estimate, and between the e(> of feature D and the normal estimate. This implies a mechanism where the solvent molecules first rearrange into an energetically favorable, symmetric configuration on the ~’ state (feature C), which maximizes the coupling with the ~ and ~ states. After a transition to either of these normal charge- switching states, the solvent rapidly rearranges again into a configuration where 1-is heavily solvated (feature D). Theoretical models must be examined to confirm these assignments; the work of Faeder et al.zz and Margulis et al.zs will be considered.

,-. - ..~.. —.—-—-

228 Chapter 7 The Faeder et al. model predicts for IZ-(COZ)9and I~(C02)12 [Iz-(CO& was not considered] that the solvent rearranges to a symmetric configuration within 500 fs, followed by transitions to the ~ or ~ states at later time delays. The electronic transitions are much slower in 12-(C02)9 (-2 ps) than 12-(C02)12(-700 fs), and is dominated by the ~ ~ ~’ transition in this time range. The solvent rearrangement step is consistent with the assignment of feature C, which appears with maximum intensity at

-500 fs in both clusters. The ~ ~ ~’ transition corresponds to feature Din 12-(C02)12, but in I~(C02)g the transition occurs considerably more slowly in the model than observed experimentally. The discrepancy may by symptomatic of the predicted slow transitions to the ~ state from both the ~’ and ~ states, which are discussed below in comparing the appearance of the ~ state in this model with experiment.

The model of Margulis et al. investigated Iz-(CO& photodissociation at 720 nm, which, while not identical to any of the clusters studied by FPES, is worth examining. For

-50% of the trajectories, the electron returns to the original I atom (i.e., normal charge- switching state) in -500 fs, leading to rapid dissociation. The remaining trajectories undergo solvent rearrangement on the ~’ state, with a transition to the ~ or ~ state occurring within 30 ps, resulting in 12-recombination. This description presents a significantly different picture of the dynamics than the Faeder et al. study. The -500 fs transition to the ~ or ~ state would correspond to feature C, which appears at the same time, while the slower rearrangement of solvent molecules on the ~’ state would be indicated by feature D. However, the model predicts that the ~/~ state trajectories lead to rapid dissociation, implying that C remains in the spectrum as an r(C02). product, while in fact it vanishes by 1.0 ps. A possible explanation for this disappearance might be Chapter 7 229 a subsequent solvent rearrangement on the ~ / ~ state, increasing az~> so that the

dissociating r signal overlaps with feature D, the trapped 12- ~’ sigmil, at longer time

delays.

We are inclined to favor the Faeder et al. model since it agrees with the arguments

made at the beginning of this section, and, despite its shortcomings, offers a slightly

simpler explanation than the Margulis et al. model.

Simulations for individual clusters will now be discussed.

The FPES of Iz-(CO& were simulated between 10 ps (the earliest time delay at

which an indisputable E feature was identified) and 200 ps. Over this time period, Px

grows slowly from 0.24 at 10psto0.31 at 200 ps (Fig. 7a), while Q> decreases in step

with the rise of Px (Fig. 7b) from 9.4 to 4.5; -x> and cn~> are virtually unchanged after

10 ps (Figs. 8a-b). Iz-(CO& displays the slowest appearance of the ~ state in all the clusters studied here, and the initial value of Q> is also smaller than that seen in any other cluster. Since 12-must enter the ~ state from either the ~ or ~’ state with -1 eV of internal energy (the difference in bond energies), the low initial value of -a>, corresponding to only 130 meV of internal energy, must indicate an average of clusters over a wide range of vibrational levels. This idea is reflected in the large width of the distribution (standard deviation av = CV>), which narrows in the larger clusters (n 2 14) at early time delays. The growth of PX isalso correlated with the decrease in -a>, as shown by comparing Figs. 7a and 7b. Thus, the rate-limiting step in vibrational relaxation is the influx of population to ~ state. 230 Chapter 7

D (a) n=6 fiD (d)n=12

(cin=91 U “(f). . ri=12 200 m A.

p) A ‘A J 0.0 0.5 1.0 1.5 2.0/0.0 0.5 1.0 1.5 2.0 Election Kinetic Energy/eV

Fig. 10. Simulated spectra of(a) I~(CO& at 200 ps, (b) I~(COZ)9 at 9.0 ps, (c) I~(COZ)9 at 200 ps, (d) IZ-(COZ)lZat 1.1 ps, (e) IZ-(COZ)lZat 6.0 ps, and (f) IZ-(COZ)lZat 200 ps. Experimental (thick solid line) and simulated (thick dotted line) data are shown. Thin lines indicate simulated r- and 12- ~ -based COZ fragment contributions.

As the changes in the spectra after 10 ps were not dramatic, only the 200 ps simulation is shown (Fig. 10a), which illustrates the features encountered in all the Chapter 7 231 spectra. The simulation parameters (Px = 0.31,0>= 4.5, -@X>= 0.5, aq-> = 4.1) indicate a spectrum dominated by solvated 1-,which almost entirely accounts for feature

D. Solvated Ii ~ generates a fairly uniform, low-intensity signal over the entire range of observed electron kinetic energies, O-2 eV, with a distinctive, sloping shape in the region of the E feature, arising from the ~ + ~ transition, and a slight increase at 750 meV due to the ~’/ ~ ~ ~ transitions. Because of the broad appearance of E, there was some latitude in the choice of UZX>(0.5- 1.5), which influences the values of the other parameters, but the changes are not substantial. The photofragmentation average of 0.4 is comparable to the low end of this range. As for IZ-(COZ)O,cn~> is larger than the photofragmentation average (3.4), which points to vibrational excitation and incomplete evaporation in the solvated r fragment at 200 ps. a> is also the largest of any cluster at

200 ps, suggesting inefficient energy transfer to the small number of COZ molecules, i.e.,

Oor 1, present in the cluster. In larger clusters, with a larger number of COZ molecules remaining, O> attains values as low as 0.8.

In I~(C02)g, the spectra were simulated from 1.0 to 200 ps. More significant changes in the shape of feature E are observed than in Iz-(C()&, so two time delays (9.0 and 200 ps) are shown in Figs. 10h-c to illustrate the changes. The 9.0 ps spectrum (Z’x=

0.34, CV> = 8.4, cnx> = 4.0, -~>= 6.4) contains an ~ state signal which appears very similar to that seen in the Iz-(C@!)(jSimLIlatiOn:intensity fairly Uniforrdy distributed over

O-2 eV, with a sloped structure in the vicinity of feature E ( ~ ~ ~), and a peak at 500 meV (~’/ ~ ~ ~ ). Feature D is almost entirely accounted for by solvated l-. As with

I~(CO’&, there is some uncertainty in -x> (*1.0) which alters the other parameters slightly, but the simulation is essentially unchanged. By contrast, the 200 ps spectrum (Z’x

. “.%/ .,...... ---- ., .,, ,. . . —,’7.- ‘-“ - .. <;: 232 Chapter 7 = 0.44, -a>= 1.1, ex> = 3.5, -az~> = 6.4) exhibits a much more structured ~ state signal, which is peaked at 1.15 eV ( X ~ X , corresponding to E), -550 meV (~’ /~ ~

~, feature F) and -250 meV ( ~ / & ~ ~). Solvated r still accounts for the majority of the intensity of D; it is broadened and diminished relative to 9.0 ps, but otherwise unchanged. cnx> is well-defined at this time delay (c MI.5), due to a compact and easily distinguished E feature.

~x (Fig. 7a) inCre~eS more rapidly than in Iz-(CO&, eSSential]y reaching itS final value of 0.44 by 25 ps, while e> (Fig. 7b) tracks the rise in Px, falling from 9.4 to 1.4 by this time delay. There is little change to either *x> or ~i> after 1.0 ps (Figs. 8a-b).

As for I~(C@& the earliest value of ~> is fairly small with a wide distribution of levels

(o, = o>), and the correlated changes between Px and o> probably indicate that the fraction of highly vibrationally excited molecules is small at any given time, with relaxation limited by the initial transition into the ~ state.

Both -x> and -i> are -0.5 C02 molecules larger than the photofragmentation averages of 2.8 and 5.9, respectively, which indicate that some energy still resides in COZ vibrational modes. This is despite the fact that the 200 ps value of-a> is much lower than in Iz-(CO&, indicating more complete vibrational reh.xation. Thus, energy is efficiently transferred from 12-to C02 modes, but much less efficiently to COZ evaporation. This effect will become even more pronounced in larger clusters, as the number of C02 modes increases,

At 200 ps, the spectrum is dominated by solvated r, with PX = 0.44 far smaller than the photofragmentation value of 0.70. Together with stronger spectroscopic evidence

to be described in 12-(C02)12, this discrepancy is explained by the trapping of part of the Chapter 7 Ii population into an SS Ii structure, which appears as solvated 1-spectroscopically.

Approximately half the 1 signal must be due to SS Ii in order to account for the small value of Px as compared to the photofragmentation experiment. SS 12-is predicted by

Faeder et al.zz to contain more C02 molecules than would be indicated by the 1-solvent shift, since some C02’s surround the neutral I. However, in the case of 12-(COZ)Q,it appears that there is little difference between the r and SS 12-spectral signals, other than a -50% increase in the width of the distribution between 3.0 and 25 ps, indicating possible differences in cn~> which are not discernible within the resolution of the spectra.

I~(C02)12 clusters were simulated from 1.1 to 200 ps. Like 12-(C02)Q,the spectra exhibit significant changes during this time interval; three time delays (1. 1, 6.0 and 200 ps) are shown to illustrate them in Figs. 10d-f. At 1.1 ps, the spectrum (Px = 0.14, CV> =

11.9, -x> = 7.0, UZ:> = 7.5) is almost entirely due to solvated r; the small amount of solvated 12- ~ accounts for the small tail comprising E, with a negligible amount of intensity present in the vicinity of D. The distribution of r(C02). contributions is strongly peaked near the average value. The spectrum at 6.0 ps (Z’x= 0.27, a>= 6.9, -aX> = 7.0, en{> = 7.8) consists of a more substantial 12- ~ state, resembling the one simulated for

12-(C02)Qat 9.0 ps, with a sloped structure accounting for E ( ~ ~ ~), and increased intensity at -200 meV (~’/ ~ ~ ~). The 1-distribution is double-peaked at n = 7 and n

=9, though with an average number which is roughly the same as in the 1.1 ps spectrum.

These two peaks largely account for features D and D’; the ~’/ ~ ~ ~ transition makes a minor contribution to D. The 200 ps spectrum (Px = 0.47, 0> = 0.8, -ozx> =

7.0, cn~> = 7.3) exhibits strongly peaked ~ state signals at 850 meV ( ~ G ~, feature

...... 234 Chapter 7 E) and -200 meV ( ~’ / ~ ~ ~, accounting for half of feature D’s intensity), and an I- signal which is much less double-peaked, the majority of the intensity occurring at n =7.

The r contribution accounts for the entirety of D’, and half the intensity of D.

The double-peaked r distribution is a fairly direct indication of the presence of the SS 12-structure, for the following reasons. While the Versa et al. study4J0 observed no r(C02). photofragments with n <8, feature D’ is accounted for almost entirely by r(C02). S7. Feature D, reproduced mainly by n = 8-10 (as well as the ~’ / ~ ~ ~ transitions at later time delays), represents an r distribution much closer to the photofragmentation average (8.6). Even the overall -az~> at all time delays (7.3-7.8) is smaller than the photofragmentation average, while in smaller clusters, it was always observed to be larger. An excess of C02 molecules over the photofragmentation average is easy to account for in terms of incomplete solvent evaporation, but the only realistic way to account for too few C02 molecules is the SS 12-structure, which is predicted to contain more C02 molecules than are apparent from the FPES signal.zz In addition, the

200 ps spectrum is dominated by the solvated r features, with Px (0.47) far short of the photofragmentation result (0.84), as in I~(C02)g, indicating a major additional r-like component.

Therefore, we propose that feature D’, simulated principally by r(COz)ns T, indicates the SS 12-structure, while D, represented mainly by r(C02)~ ~& indicates

“normal” dissociated r. To illustrate the time-resolved changes in the r distribution more clearly, the simulated populations of individual r(C02). contributions are plotted in Fig.

11 as a series of histograms. At 1.1 ps, a Gaussian-like distribution is observed from o =

5 to 9, with az~> = 7.5. By 6.0 ps, however, the double-peaked structure with major Chapter 7 235 components n = 7 and 9 is clearly apparent. Through 200 ps, the n <7 contribution remains essentially constant near 0.41, while the n 28 component diminishes to only

0.12. Assuming that all of the SS 12-eventually recombines on the ~ state, Px may be added to the SS 12-population to obtain a predicted total of 0.88, very close to the photofragmentation value (0.84).

0.4

0.35

0.1 0.05 -. 0 J J d,, 1.1113.1 6 10 20 30 50 200 Time/ps

Fig. 11. Population of individual r(C02). contributions to the r signal in 12-(C02)IZ simulated spectra.

Looking at the time-resolved changes in the other simulation parameters, it is observed that PX and o> (Figs. 7a-b) are again inversely correlated, as observed in the smaller clusters. While the X state appears earlier (1.1 ps) than in the smaller clusters, the growth of Px is actually slower than in Iz-(CO&, and the initial value of 0> (11 .9) is essentially the same as those found in the smaller clusters, probably due to the same averaging effects of a population transfer-limited relaxation rate. o> does decrease about twice as fast as in IZ-(COZ)9,however, so population transfer alone is not

. ..-,., . ! , J.<- —,-.7 - 7 -..,. .-$..-.’. ,, ..~.,-- ..

236 Chapter 7 responsible for the relaxation rate. There is no change in ax> in the simulated spectra

(Fig. 8a); however, at 200 ps it is larger than the photofragmentation average-of 5.7, and is a larger discrepancy (1.3) than found in the smaller clusters. This increase may reflect the greater energy storage capacity of a larger COZ cage, forestalling evaporation.

5.3. I~(CO& and IZ-(C@lIj

h IZ-(C@14 and Iz-(coz)lb CIUSterS,“featUreE appears at -500 fS, much edier than in the smaller clusters, and also undergoes much larger changes in shape, with a distinctly peaked appearance at early time delays (-1 ps), becoming more sloped and moving toward lower eKE as time progresses. Feature F is also visible in both sets of spectra as an intense peak at very low eKE which is present at early times. These features are characteristic of a solvated, highly vibrationally excited 12- ~ state. The presence of solvated r, both as a dissociated product and as SS 12-,is also observed, though the amount of r at long time delays is somewhat ambiguous as only a single broad feature G remains at 200 ps in both clusters. Since littler fragments were observed by Versa et aL,4’Sthe domination of the spectra by these 12- ~ state features is not surprising. We begin by briefly considering the short-time (< -1 ps) dynamics of solvated r, then focus on the simulations.

Since these two clusters possess fairly symmetric solvent configurations, there is little difference between the anomalous and normal estimates for uz~> (Table 2), precluding definitive assignment of the charge-switching state responsible for the B features. However, there is no reason to suspect that the system is not on the ~’ state. In fact, it is seen that az~> for the B feature is significantly smaller than either estimate,

which was also the case in 12-(C02)4. Rather than being due to rapid separation of r from Chapter 7 237 the cluster, since the I atoms are virtually surrounded by solvent molecules, the discrepancy is probably caused by rapid loss of COZ molecules in the’’’capping” positions

(along the I; axis) of the cluster, which Parson and coworkersJ4 predict to collide with the

I and r fragments immediately after photoexcitation. The 0.4-0.5 molecule increase in

~~> by -700 fs (feature D) indicates a small increase in solvation. It has been established from earlier discussion that solvent rearrangement on the ~’ state occurs on the -500 fs timescale. Presumably, the rapid appearance of solvated 12- ~ (-500 fs) implies that production of r on the ~ / ~ states occurs on a similar timescale. Thus, the increase in -az~> producing feature D is probably due to a combination of ~’ state

-- solvent rearrangement, and transitions to the X / A states which switches the electron to the (slightly) more solvated I atom, followed by solvent rearrangement.

In I~(Coz)ll, spectra at three time delays are shown in Figs. 12a-c: 1.3,5.0 and

200 ps. The 1.3 ps spectrum (Z’x= 0.62, -o>= 23.9, ax>= 10.0, e(> = 7.8) exhibits a solvated 12- ~ state spectrum which is very extended, due to the large value of a>: feature E is accounted for by the ~ ~ ~ ITP transition at high eKE, while F is represented at very low eKE by a combination of ~ & ~ OTP and 12* ~ ~ transitions. Solvated 1-contributes the bulk of the intensity to D. In the 5.0 ps spectrum

(FIx= 0.51, o>= 4.4, UZx> = 9.0, *I_> = 8.3), o> is much lower, generating a more compact ~ ~ ~ feature which accounts for feature E at much lower eKE, and part of

D; the ~’/ ~ ~ ~ transition accounts for F. The solvated r contribution peaks at -300 meV, in between D and F, but represents about 2/3 of the intensity of D. The 200 ps spectrum (Px = 0.62, 0> = 0.8, cnx> = 9.0, ez~> = 7.7) consists of a single broad feature G, which is accounted for roughly equally by solvated I; ~, occupying the high

,...., .; r,..,<;,, :.,-—. ...”,-.=. ,>. .,’.. .~,.~ ,..-. -7.-:,--- ,“-”. .“ :“ 238 Chapter 7 eKE side of the feature, and solvated r, occupying the low eKE side. The ~’/ ~ ~ ~ “ transition is also present in the vicinity of F.

!

\

,-,

+2x E “. ,

AF

,. , ,

0.0 0.5 1.0 1.5 2.0 Electron Kinetic Energy/eV

Fig. 12. Simulated I~(Coz)la spectra at (a) 1.3 ps, (b) 5.0 ps, (c) 200 ps. Experimental (thick solid line) and simulated (thick dotted line) data are shown. Thin lines indicate simulated r- and 12- ~ -based C02 fragment contributions. Chapter 7 239 At 200 ps, ax> (9.0) is larger than the photofragmentation average (7.6), by

about the’same amount as for IZ-(COZ)12,indicating excess energy stored in C02 modes

which has not yet found its way into evaporation. Although there is significant leeway in

the choice of parameters for simulating the 200 ps spectrum, the breadth of feature G in

comparison to the IZ-(C@lIj spectrum suggests a significant amount of solvated 1-is

present, comparable to earlier time delays.

Like the smaller clusters, Px at 200 ps (0.62) is much smaller than observed in the

photofragmentation experiments (0.95), and like I~(C02)12, crz~> is also significantly

smaller (7.7 vs. 9.6), indicating the presence of SS 12-.No double-peaked 1-structure is

observed, however, as it appears that the dissociated r signal is so small that it has little

influence on the simulation; with a photofragmentation population of only 0.05, this is

not surprising. There is almost no change in the distribution of r(C02)~ populations vs.

time delay, other than a slight narrowing after 5.0 ps.

As shown in Fig. 7a, Px rises much faster than in 12-(C02)12,essentially reaching a plateau at 1.3 ps (0.62). Over this time interval, o> (Fig. 7b) appears to stay constant at

23.9, much larger than in the smaller clusters. Together with the early plateauing of Px, this higher initial value of CV> indicates that the average vibrational level is becoming less controlled by the rate of infusion of population onto the ~ state, so that all clusters now enter the ~ state by 1.3 ps with substantial vibrational excitation. There is also a relatively narrow distribution of vibrational levels (CTv= 0.30>) compared with smaller clusters, which further illustrates this distinction. Between 1.3 and 20 ps, o> falls to a very low value (1.3), then decreases slightly more (to 0.8) by 200 ps. There is some decrease to cnx> with time (Fig. 8a), falling from 10.0 at 1.3 ps to 9.0 at 5.0 ps, but it is

.-.-;- - .,>.,.,,..’,< ,<~.-,- .Wr-.- ,- -s .-..- 240 Chapter 7 constant after this time delay. Still, this decrease was not observed in the smaller clusters, and reflects a more concerted vibrational relaxation process, where an initial,, rapid evaporation of solvent molecules discarding most of the vibrational energy of the cluster is becoming visible. az~> (Fig. 8b) undergoes small changes (MI.7), some of which may be model-dependent, but remains essentially constant near 7.7.

For I~(COz)l& the following simulated spectra are shown in Figs. 13a-d: 1.0 ps,

2.2 ps, 4.0 ps and 200 ps, respectively, which illustrate the large changes to all features in the spectra. At 1.0 ps (Z’x= 0.68, Q>= 38.8, -ax>= 14.5, -i> = 8.5), solvated 12- ~ is responsible for features E ( ~ ~ ~ ITP) and F ( ~ ~ ~ OTP), while solvated r accounts for D. Note the very intense F feature dominating the spectrum, due to the much larger value of o>, which was absent in I~(C02)14 near this time delay. B y 2.2 ps (Px =

0.85, a>= 20.9, ax> = 13.0, ~i> = 8.7), the general shape of the spectrum is unchanged, but E has moved to much lower eKE, and the intensity of F is diminished, due to the considerable ~ state relaxation and loss of C02 molecules compared with 1.0 ps. The ~ state population has increased significantly as well. The solvated r contribution, still accounting for D, is of lower intensity but ~i> is almost identical. The

4.0 ps spectrum (Px = 0.89, -a> = 6.4, azx> = 12.0, ~i> = 8.5) could be simulated exclusively by the 12- ~ state, but there is better reproduction of the low eKE region if a small amount of r is included in the vicinity of F. The ~ ~ ~ ITP transition is responsible for feature E, while the ~ ~ ~ OTP transition now dominates feature F.

Unlike I~(C02)14, the ~’/ ~ ~ ~ transitions occur at an eKE too low to observe. The

200 ps spectrum (Px = 0.86, a> = 1.4, *X>= 11.5, -i> = 8.9) reveals further vibrational relaxation to the ~ state, and whether any r is present depends primarily on Chapter 7 241 the choice of cnx>; over the range ax>= 10.5-12.0, Px varies from 0.70-1.00. Here we choose a median value, which is most consistent with simulations at earlier time delays.

The ~ ~ ~ transition accounts for the majority of G, with the solvated r signal making a small contribution to the low eKE side.

0.0 0.5 1.0 1.5 2.0/0.0 0.5 1.0 1.5 2.0 Electron Kinetic Energy/eV

Fig. 13. Simulated I~(C@lG spectra at (a) 1.0 ps, (b) 2.2 ps, (c) 4.O ps, (d) 200 ps. Experimental (thick solid line) and simulated (thick dotted line) data are shown. Thin lines indicate simulated r- and 12.-~ -based COZ fragment contributions.

Although spectral evidence is not conclusive, as it was in smaller clusters, it appears that the r contribution persists through 200 ps. This structure is presumably SS

12-,because r products were not observed in the photofragmentation experiments. The value of ~1-> (8.9) is also comparable to IZ-(COZ)M, indicating on]y about half of the COZ

,.. . ., ---.,. - -. . 242 Chapter 7 molecules surround the r, consistent with the SS 12-structure. Varying the population of r in the 200 ps spectrum affects az~> very little.

Px rises faster than in any other cluster, reaching a plateau of-0.9 by 2.2 ps (Fig.

7a). Over this time period, O> drops from an initial value of -39 to 20.9, and relaxes almost completely by 10 ps (Fig. 7b). The relaxation rate appears slightly slower than in

IZ-(COZ)lAbefore 2.9 ps, but surpasses it at later time delays. As the initial value of 0> is much larger than in any other cluster, it appears that population is building up in the ~ state even more rapidly than in IZ-(COZ)14 after which thiS krge fraction of clusters relaxes in tandem. The width of the distribution is again fairly narrow initially (oV =

0.3~>), illustrating the more correlated nature of the relaxation process. As seen in Fig.

8a, cnx> undergoes a large change, from 14.5 at 1.0 pS to 11.5 by 10 ps, indicating simultaneous evaporation of COZ molecules as energy leaks from 12-into the C02 cluster modes. The 200 ps value of ax> is larger than the photofragmentation average (9.7), by approximately the same amount as in IZ-(C02.)lZand IZ-(COZ)14reflecting the energy residing in the cluster which will eventually dissipate through C02 evaporation. az~> undergoes little variation @O.2) with time, after its initial increase through 500 fs (Fig.

8b).

5.4. Trends across cluster size, and comparisons with other studies

The most significant trend across cluster size is the increasingly rapid appearance

and subsequent vibrational relaxation of the 12- ~ state. Using the time of initial

appearance of feature E ( ~ ~ ~ transition) as a basis of comparison (see Fig. 7a), a

monotonic decrease with cluster size is observed, from -10 ps in IZ-(COZ)Gto -500 fs in Chapter 7 243 12-(C02)14.16.This order-of-magnitude change is due to the increasing perturbation on the

12-electronic states by larger numbers of C02 molecules, facilitating nonadiabatic electronic transitions to the ~ state. The earlier appearance of ~ state population in larger clusters is also accompanied by initially larger vibrational excitation with a smaller range of levels, indicating the more concerted appearance of 12-on the ~ state and subsequent vibrational relaxation. In smaller clusters, where the rate of population transfer onto the ~ state was slower than the vibrational relaxation rate of individual cluster molecules, a much lower maximum vibrational level is observed, with a wider distribution of levels.

Although not directly comparable to our determinations of Px and Q>, the absorption recovery experiments of Versa et aL confirm the general decrease in time required to reach a low vibrational state, with exponential time constants ranging from 24 ps for Iz-(CO& to 1.3 ps for Iz-(C@)l&10 These time constants correspond approximately to the time at which O> crosses -7 in Fig. 7b.

While the Parson group model reports a decrease in the initial appearance of the

X state with cluster size for n = 6 through 12 (Px = 0.20 at from -3.1 to -1.6 ps),sd a large fraction of trajectories become trapped in the SS 12-configuration on the ~ state, particularly for Iz-(COz)l& so that growth of the ~ State and vibrational relaxation appear significantly slower than observed experimentally. However, once a trajectory does enter the ~ state, vibrational relaxation is very rapid in all clusters (1-2 ps),22 comparable to the rates observed in 12-(C02)14-16clusters where relaxation does not appear significant y limited by the electronic transition rate.

-y- ,,,, ., ------:,-,~------T -. .?.,-‘-- . -, 244 Chapter 7 The Margulis et al. study observes for IZ-(COZ)8recombination in anywhere from

3-27 ps, depending on trajectory, with fast vibrational relaxation (-3 ps). These results are about on par with the FPES data for 12-(C02)9. However, it should be pointed out this cluster was simulated only at 720 nm, which deposits enough energy in the IZ-(C02)8 cluster to evaporate all C02 molecules, whereas -3 C02 molecules remain for 12-(C02)9 at

780 nm. For IZ-(C@lfj, the simulations fare little better than the parson results, as exclusively delayed (10-25 ps) recombination is predicted at 790 nm. The 720 nm results do show a minority of trajectories (-20%) which recombine after the first bond extension at -700 fs, which is much more consistent with the FPES observations. The paper points toward a possible explanation for this major difference in mechanism: that the initial Iz- bond distance extends farther at the higher-energy pump excitation (5.5 ~) than at the lower-energy (5.0 ~), facilitating electronic coupling to the ~ state. Perhaps this apparently sensitive parameter also explains the anomalously high ~ state population observed in the Parson model.

A by-product of efficient energy absorption by C02 is longer energy retention, which is exhibited in the trend of. increasing discrepancy between -x> determined from

FPES and measured in the photofragmentation experiments. As cluster size increases, cnx> is seen to increase above the photofragrnentation average more and more, growing from essentially O in I~(C()&, to 1.8 in I~(COz)l& The P~SOn group model also revealed a decrease in the solvent evaporation rate as cluster size increases, but this decrease was compounded by the trapping of a much larger fraction of trajectories on the ~ state than was supported by the FPES data, delaying the appearance of the ~ state. Thus, no quantitative comparison could be made between this group’s predictions and FPES at Chapter 7 245 particular time delays. Margulis et al. offered no information on their solvent evaporation

dynamics.

One of the most interesting results from the FPES study is the identification of the

solvent-separated 12-structure in 12-(C02). ~s clusters, which was not observed in the

photofragmentation experiments. Features arising from SS I; resemble solvated 1-,

because the Ii potential is expected to lie very near the dissociation energy when 1-and I “

are far enough apart to allow a C02 molecule to intervene (5-7 ~). ‘8*2,31By comparison,

the long-lived ~ state structure in Iz-(Ar)n clusters, which is not solvent-separated, exists

at a considerably shorter internuclear radius (4.6 ~) and possesses a significant well (140

meV),J’ which serves to shift the photoelectron spectrum dramaticallyy. However, in

12”(C02). clusters, the effect of the ~ state well is much less important, as it is smaller

than the binding energy of a single COZ molecule to 1 (212 meV).W It is feasible that the

SS 12-structure could be stabilized by this strong solvent interaction on any of the

accessible anion states ( ~, ~ or ~’), but Faeder et aL22predict it to exist exclusively on

the ~ state. In their model, SS 12-contains more C02 molecules than would be indicated

by the 1 solvent shift, with some C02’S surrounding the neutral I. Indeed, SS 12-must

contain approximately as many solvent molecules as found in the 1 fragments, since the

difference in energy between these structures is the binding energy of neutral I to the

cluster, which is estimated@-4*to be much smaller than the 1-C02 well depth. Therefore,

the main distinguishing factor between SS 12-and dissociated 1 is the apparent o~>. It

was shown that SS 12-is only clearly identifiable using -~> for 12-(COz)n ~ 12,but that in

clusters of 12-(C02)fl~g, the large 1-population in comparison to the photofragmentation

results also pointed strongly toward an additional r-like structure, e.g. SS Iz-.

,,, ,, ,Z, .. ..! 246 Chapter 7 If the SS Ii stmcture is indeed limited to the ~ state, its prominence in the spectra is not sufirising, as the ~’ state lies closer in energy to the ~ than the ~ state at intermediate internuclear distances, making the ~ + ~’ coupling stronger than that of the ~ ~ ~’. As seen above, the ~ state is predicted by both theoretical groups to play a major role in I; recombination dynamics;zz’zs indeed, perhaps too great a role!

However, in clusters where the ~ state appears in K -1 ps [12-(C02). ~ 12],the question arises of why the ~ does not rapidly fall onto the ~ state. The answer seems to be less a matter of electronic coupling, as all states are essentially degenerate at large internuclear distances, and more of physical constraint in the SS I; structure. Thus, regardless of the electronic state, the r and I atoms must overcome the resistance of one or more CO; molecules blocking their way to recombination. This is apparently feasible on the timescale of the photofragmentation experiments (-5 ps),s but not on the 200 ps timescale.

5.5. Comparison with 12-(Ar). clusters

Comparing the 12-(C02). cluster results to those of 12-(Ar)20,the most obvious difference is the much faster rate of I; vibrational relaxation in I~(C02). clusters, despite the fact that the 12- ~ state grows at approximately the same rate for 12-(C02). s g (see

Fig. 7a). This distinction highlights the existence of the two separate effects involved in

Ii recombination: the ability to remove energy from the 12-bond, and the ability to facilitate an electronic transition to the ~ state in the first place. It is clear that C02 is far more effective than Ar in removing energy, but appears no better than Ar in promoting an electronic transition for 12-(C02)~s g. However, there is an increased long-term ability to Chapter 7 247 return 12-to the ~ state, exhibited by the lack of any ~ state products in the photofragmentation studies (-5 w timescale).5 It should also be mentioned that clusters as small as 12-(C02)4 exhibit some 12-recombination, which is not observed in 12-(Ar). clusters until n = 10. This last point, however, illustrates the ability of C02to prevent Iz- from dissociating (often trapping the system in an SS 12-configuration), rather than its efficacy in promoting a speedy transition to the ~ state.

The increasingly large discrepancy between the FPES and photofragmentation values of cnx> in 12-(C02)~, which was absent in Iz-(Ar)~, illustrates another difference between solvent types: the ability to retain energy in the solvent cage. Ar lacks any internal degrees of freedom, and the Ar-Ar interaction is also weaker than C02-COZ, making Ar far less effective than COZ in storing energy liberated from 12-vibration. Thus, whereas 12-(C02)~ clusters may store a great deal in internal and collective cluster modes, forestalling evaporation until time delays much longer than 200 ps, IZ-(Ar)nclusters must rapidly evaporate Ar atoms to dissipate internal energy, and Iz-(Ar)zo has almost no Ar atoms left by 200 ps.

At early time delays (c -1 ps), I~(COz)n and I;(Ar)n clusters exhibit dramaticallyy different solvent motions, with the number of solvent molecules increming in l~-(COZ),,, while decreasing in Iz-(Ar)n. The increase in Iz-(COz)n clusters has been explained by solvent molecules strongly affecting the 1 and I motion via solvent reorganization on the

~’ state, and/or electronic transitions to the ~/~ states, whereas the decrease in IZ-(Ar),, clusters reflects the much weaker influence of the Ar atoms on the motion of r and I, as I- is able to separate considerably from the cluster before an electronic transition occurs.

,T, ,-.f .—, -,, .-,: ..-. ,. .-.’ ., ---7 --.--.7>.. “,=.”.”“ 248 Chapter 7 Both types of clusters also exhibit long-lived metastable structures, although it is known for 12-(C02)n clusters that this state is not stable on the w timescale of photofragmentation experiments. In Iz-(Ar)n clusters, the bond length of Ii on the ~ state is short enough so that a large energy shift is seen in the photoelectron spectra, distinguishing this state spectroscopically from solvated r. In IJ(COz)n clusters, the much - stronger solvation energy of r-COz enables a solvent-separated structure to form on the

~ state, keeping the 12-bond long enough (estimated at 5-7 &4 so that it is spectroscopically indistinguishable from r. Presumably it is the difference in bond length which determines the longevity of this state, because the ~ and ~ states lie much closer together at long bond lengths than at the ~ state equilibrium distance (4.6 ~),sl facilitating an ~ ~ ~ transition on the >200 ps timescale. Experiments probing

12-(C02). clusters in the ns regime should be conducted to look for evidence of increased

X state population.

6. Conclusions

The time-resolved photodissociation dynamics of Ii in COZ van der Waals clusters have been investigated using FPES for a range of sizes covering the uncaged and fully-caged product limits. In all clusters, solvated r is produced on the anomalous charge-switching ~’ state in -200 fs, followed by solvent rearrangement on this state

occurs by -500 fs, increasing the number of COZ molecules around r. Electronic

transitions to the normal charge-switching ~ and/or ~ states occur by -800- 1.1 ps,

further increasing the number of COZ molecules by returning the electron to the more

solvated I atom. In 12-(COZ)4,the reaction is essentially over at 800 fs. Chapter 7 249 In 12-(C02). ~(jclusters, the transition to the ~/~ state induces 12-recombination, the fraction of which increases with cluster size. For Iz-(COz)ns 12,recombination is the rate-limiting step in vibrational relaxation, resulting in abroad distribution of vibrational levels which decreases from CV> = 9-12 initially to CV> = 1 by 200 ps; in IZ-(COZ)6,the final a> is much higher, -5, due to the small number of COZ molecules present (O-1). In

12-(C02)14.16,recombination occurs much faster, and higher initial values of o> are observed (up to -40), with narrower distributions. The overall rate of vibrational relaxation incremes dramatically from IZ-(COZ)6to Iz-(C()’2)lfj.

The numbers of solvent molecules around r and Ii products at 200 ps are larger than those observed in the photofragmentation experiments, implying that evaporation of

COZ from the cluster occurs on a much longer timescale. This is consistent with the assumption that the C02 cage stores a considerable amount of energy in vibrational and/or cluster modes after removing it from r kinetic energy or 12-vibration. The discrepancy increases with cluster size, illustrating the increasing energy “storage capacity” of larger clusters.

In clusters of 12-(C02)nz g, a solvent-separated 12-structure is observed at long time delays, which appears spectroscopically as solvated l-. This structure is needed to explain the high intensity of 1-features observed in these spectra, and the small number of COZ molecules surrounding r. While the lifetime of this metastable state appears to be >200 ps (the longest time delays measured), it is not present in the photofragmentation experiments, which have a -5 w duration. The strong r-COz bond is thought to be responsible for the stability of the solvent-separated structure.

.v ...... 7,.T.. . .,., ,, . .,,...... ------., ,x. ., 250 Chapter 7 7. Acknowledgments

The authors would like to thank James Faeder, Nicole Delaney and Professor

Robert Parson for many helpful discussions. Funds supplied by the National Science

Foundation under Grant No. CHE-9710243, and the Defense University Research

Instrumentation Program under Grant No. F49620-95-1-O078, are gratefully acknowledged.

8. References

1M. L. Alexander, N. E. Levinger, M. A. Johnson, D. Ray, and W. C. Lineberger, J.

Chem. Phys. 88,6200 (1988). z S. Nandi, A. Sanov, N. Delaney, J. Faeder, R. Parson, and W. C. Lineberger, J. Phys.

Chem. A 102,8827 (1998). s A. Sanov, S. Nandi, and W. C. Lineberger, J. Chem. Phys. 108,5155 (1998). qV. Versa, Ph.D. Thesis, University of Colorado, Boulder (1996). s V. Versa, P. J. Campagnola, S. Nandi, M. Larsson, and W. C. Lineberger, J. Chem.

Phys. 105,2298 (1996).

15D. Ray, N. E. Levinger, J. M. Papanikola.s, and W. C. Lineberger, J. Chem. Phys. 91,

6533 (1989).

TJ. M. Papanikolas, J. R. Gord, N. E. Levinger, D. Ray, V. Versa, and W. C. Lineberger,

J. Phys. Chem. 95,8028 (1991). gJ. M. Papanikolas, V. Versa, M. E. Nadal, P. J. Campagnola, J. R. Gord, and W. C.

Lineberger, J. Chem. Phys. 97,7002 (1992). gJ. M. Papanikolas, V. Versa, M. E. Nadal, P. J Campagnola, H. K. Buchenau, and W.

C. Lineberger, J. Chem. Phys. 99,8733 (1993). Chapter 7 251 10V. Versa, S. Nandi, P. J. Campagnola, M. Larsson, and W. C. Lineberger, J. Chem.

Phys. 106, 1402 (1997).

11L. Perera and F. G. Amar, J. Chem. Phys. 90,7354 (1989).

12F. G. Amar and L. Perera, Z. Phys. D. 20, 173 (1991).

13P. E. Maslen, J. M. Papanikolas, J. Faeder, R. Parson, and S. V. ONeil, J. Chem. Phys.

101,5731 (1994).

MJ. M. Papanikolas, P. E. Maslen, and R. Parson, J. Chem. Phys. 102, 2452 (1995).

MP. E. Maslen, J. Faeder, and R. Parson, Chem. Phys. Lett. 263,63 (1996). lbV. S. Batista and D. F. Coker, J. Chem. Phys. 106,7102 (1997).

17J. Faeder, N. Delaney, P. E. Maslen, and R. Parson, Chem. Phys. Lett. 270, 196 (1997).

18N. Delaney, J. Faeder, P. E. Maslen, and R. Parson, J. Phys. Chem. A 101 (1997).

19B. M. Ladanyi and R. Parson, J. Chem. Phys. 107, 9326 (1997).

ZOJ. Faeder and R. Parson, J. Chem. Phys. 108, 3909 (1998).

21P. E. Maslen, J. Faeder, and R. Parson, Mol. Phys. 94, 693 (1998).

22J. Faeder, N. Delaney, P. E. Maslen, and R. Parson, Chem. Phys. 239, 525 (1998).

23C. J. Margulis and D. F. Coker, J. Chem. Phys., in press (1999).

24A. E. Johnson, N. E. ~vinger, and p. F. Barbara, J. phys. Chem. 96,7841 (1992).

MD. A. V. Kliner, J. C. Alfano, and P. F. Barbara, J. Chem. Phys. 98, 5375 (1993). x J. C. Alfano, Y. Kimura, P. K. Walhout, and P. F. Barbara, Chem. Phys. 175, 147

(1993). v I, Benjamin, P, F, Barbara, B. J. Gertner, and J. T. Hynes, J. Phys. Chem. 99, 7557

(1995).

~ .> ... ..,. .. . . ----,., .,.. ,-’7 >.: ,’ --z’ $! . . .. . 252 Chapter 7 ~SP. K. Walhout, J. C. Alfano, K. A. M. Thakur, and P. F. Barbara, J. Phys. Chem. 99,

7568 (1995). “

29B. J. Greenblatt, M. T. Zanni, ad D. M. Neum~k, Science 276, 1675 (1997). soB. J. Greenblatt, M. T. Zanni, and D.M. Neumark, Faraday Discuss. 108, 101 (1997).

31B. J. Greenblatt, M. T. Zanni, and D. M. Neumark, J. Chem. Phys., to be submitted .

32B. J. Greenblatt, M. T. Zanni, and D. M. Neumark, Chem. Phys. Lett. 258,523 (1996).

33K. Asmis, T. Taylor, and D. M. Neumark, J. Chem. Phys. 109,4389 (1998).

34N. Delaney, J. Faeder, and R. Parson, private communication .

35W. C. Wiley and I. H. McLaren, Rev. Sci. Instrum. 26, 1150 (1955).

360. Cheshnovsky, S. Ho Yang,c.L.Petti&te,M.J. Craycraft, and R, E. Smalley, Rev.

Sci. Instrum. 58,2131 (1987).

STL.-S. Wang, H.-S. Cheng, and J. Fan, J. Chem. Phys. 102,9480 (1995).

38H. Gomez and D. M. Neumark, in progress .

39M. T. ‘Zanni, V. S. Batista, B. J. Greenblatt, W. H. Miller, and DOM. Neummk, J.

Chem. Phys. 110,3748 (1999).

40Y. Zhao, C. C. Arnold, and D. M. Neumark, J. Chem. Phys. Faraday Trans. 89, 1449

(1993).

11D. W. Arnold, S. E. Bradforth, E. H. Kim, and D. M. Neumark, J. Chem. Phys. 102,

3510 (1995).

42D. W. Arnold, S. E. Bradforth, E. H. Kim, and D. M. Neumark, J. Chem. Phys. 102,

3493 (1995). 253 Appendix 1. Data Acquisition Program (fpes)

1. Program overview

The primary purpose of the data acquisition program (f pes) is to record photoelectron spectra, mass spectra and auto/cross-correlation spectra. However, because of the need to record photoelectron spectra at many time delays, and because the program is also used to analyze and manipulate these data, a significant amount of extra functionality has been added to aid in these tasks. For instance, several spectra, not ne~essarily of the same type, can be held in memory and displayed simultaneously; the screen format can be a single window or several side-by-side windows; zoom-in capabilities are supported; peak heights, positions, widths and integrated areas can be measured automatically; smoothing and summing of data is possible; data can be displayed with alternate units (for instance, a photoelectron spectrum maybe displayed either on a time or energy axis) and calibration for use of these formats is possible. The user interface is also fairly sophisticated, replacing the “one key, one function” approach of earlier programs in the group with a command word format, allowing for infinite expansion.

At its largest level, the program operates in a loop, alternating between two procedures, com_rd and com_ex (see f pes. pas). com_rd itself operates in a loop, updating active processes related to data acquisition (scan procedure), and then checking for a keypress. If a key has been entered, com_rd either displays it on the screen while simultaneously adding it to a command line buffer (tX–wr_Ch procedure), or acts on the key immediately. Pressing the enter key (“carriage return,” or CR for short)

,...... ,, ,, ;V}.,e.,. ., . . . -b=,, .-,.,. ,. .:-. -.,.,-7- , >,+4.W ——

254 Appendix 1 ends the loop, causing the typed command line to be processed or “parsed” for content

(com~arse procedure). The processed command is then executed by com~ex.

Commands are designed to use as many modular procedures as possible. For instance, commands which modify the graphics display do not write to the screen directly; they only change the controlling variables (SC or WV).The visual change is caused by calling an updating procedure, update or updat eal 1, upon exiting. The syntax for commands is detailed in the help. par file (readable via the help command) Q

2. Selected variables

There are too many variables in f pes for an exhaustive survey, but selected structured and simple variables will be discussed here. The documentation contained within the source code should be sufficient to at least clarify the intended use of other variables used by the program.

Several of these structures (corn, SC, WV)contain variables with similar functions:

1s, a “list” or array of a kind of information (such as individual spectra); cur, the index of the current element being manipulated; and num, the total number of such elements in memory. In addition, both sc and wv have a sel (“select”) variable which many commands use when a list has been specified as part of the input line. Those screens or

waves in the list will have their sel variables set (= 1) to select them for action; ~he

command then acts on each selected item, after which the sel variables are cleared (=

o).

To refer to an element of a structure in Pascal, a period (. ) is used between the

structure name and its element. For instance, to access the num variable within the sc Appendix 1 255 structure, the syntax is sc. num. It can be extended for more complex references, e.g. sc. ls [l] .mode. gr. xh. u[2],

2.1. Background subtraction: _bs

Variable in Function

bg Background wave and mode

fg Foreground wave

dis Display mode simulating background- subtraction waves (alternating scan mode)

Sts Shot-to-shot mode

s t s_blank Point range for blanking background wave > st s_blank 2

sts_ch Oscilloscope channel of background wave (shot-to-shot mode)

sts_f ac Scaling factor (shot-to-shot mode)

St s_tog Toggle mode (shot-to-shot mode)

sts_vert Vertical scale of background wave on oscilloscope (shot-to-shot mode)

, rhe variables pertaining to background subtraction have been collected in _bs

(the unckxs.core “_” is to distinguish it from bs, a substructure within WV).Background subtraction is used when collecting electron spectra, in order to compensate for changing signal levels due to the ions and/or laser, and concerns the collection of a “background” spectrum, generally one obtained in the absence of the pump laser. There are two kinds of background subtraction: “alternating scan” and “shot-to-shot.” Alternating scan background subtraction indicates alternation between various positive time delays and a 256 Appendix 1 fixed, negative time delay, such that the effect of the pump laser is absent. Shot-to-shot background subtraction requires the participation of the New Focus optical chopper (see

Experimental apparatus chapter) to block the pump laser every other laser shot; photoelectron spectra are either added or subtracted from the accumulating average on the Stanford Research Systems Multichannel Scalar (MCS), depending on whether or not the pump beam is present. A separate, probe-beam only (“background”) spectrum is collected at the same time using the Tektronix digitizing oscilloscope.

In order to use either background subtraction mode, the background wave must be specified by bg; if it is O, no background subtraction is performed. The type of, background subtraction is indicated by sts (“shot-to-shot”), being equal to O for alternating scan background subtraction, and 1 for shot-to-shot background subtraction.

Note that, in addition, a participating wave must have its par. dt. ele. bs. mode variable set (= 1); see w variable.

The di.s variable is useful only in alternating scan background subtraction mode, and enables (when equal to 1) a display mode whereby participating waves appear with the background wave subtracted from it automatically, though the unsubtracted, raw data

is actually stored in the wave.

s t s_tog (accessed with thes ts tog command) indicates a choice of “toggle”

modes useful only in shot-to-shot background subtraction, where the action taken by the

MCS during a background acquisition can be modified. It is normally set (= 1),

indicating that background spectra are subtracted from the accumulating data. When

cleared to O, it inhibits any action whatsoever, which can be useful in certain

circumstances, e.g. when a pump + probe signal is desired to be recorded. Note that the Appendix 1 257 BNC cable connection from the New Focus chopper controller to the back of the MCS

must be changed according y (fors t S_tog = 1, use “toggle” input; fors t S_tog = O,

use “inhibit” input).

The other variables in _bs are relatively minor.

2.2. Command line: com

Variable in Function c om 1s[] Array of words comprising command

cur Current word being processed

num Number of words in command

old Last string typed (for ! ! command)

Sv Current string typed

tx Text screen variables:

.bdy[] Bounding coordinates of command screen

.bufA Character buffer pointer

. COIA Color array pointer (one per line)

. cur Current cursor coordinates

. num Character dimensions of screen

ystart Command screen current starting line

The com structure is used to record command input. It has a two-stage “life,” first used to record characters as the command line is input and edited (tx structure), then used to store the processed “words” (characters separated by spaces) comprising the

,)- .,~ .,. .- --- .. ~.-,, ...- —

258 Appendix 1 command (1s array). The remaining variables are either used by text input procedures

(old, sv and ys tart) or command execution procedures (cur and num). cur is an important variable, used by numerous procedures, and indicates the current position in the array where a procedure has “read” to.

tx, a tx_type structure, was originally designed to be used by both com and sc (screens structure), as f pes was planned to allow each screen to operate in either a text or graphics mode. The text capability was not built, however, so tx_type applies only to the com. tx structure. The main variable is buf, a storage area containing the characters visible on screen, which is needed for editing and also for when the graphics screen is redrawn. CO1 contains a color code for each line of text. Note that both of these variables are pointers, which allow their sizes to be altered within the program (in practice, however, this feature is unnecessary, since the size of the command screen can be fixed before compilation). The other variables are of relatively minor importance.

The 1s array contains simple strings which com~arse creates as it reads through the command line. For more information on this process, see the com~arse procedure.

2.3. Screens: sc

I Variable in sc Function bdy Overall screen bounding coordinates

cur Current screen

1s[] Array of screen variables:

. sel Selection flag

. ti Screen title variables Appendix 1 259

. mode. gr Screen mode variables:

. bdy Bounding coordinates of screen

. cursormune Cursor variables

. plotarea Bounding coordinates of plotting area

. maxxnums, Axis variables .maxynums, .umune, .vname, .xname, . yname

. xh Crosshairs variables:

. bi tmap Storage area for graphics under crosshairs

. mode Mode (on or off)

.U[], .v[], .x[], Coordinates of crosshairs .Y[l

. which Active crosshairs

mode Screen mode

num Number of active screens

sel Overall selection indicator flaz

One of the most poweful features of fpes is its multiple or “split” screen display ability. It is accomplished through the s c structure, which contains, in addition to some

general variables, the screen list array 1s, each element of which has all the variables

needed to display a complete graphics screen.

The mode variable enables alternation between text (= sc_mode_TX) and graphics (= sc_mode_GR) formats. The text format is used for wave editing (ed command), and a few other isolated commands, such as calibration (cal command).

...... ,. -.7:’.7.,’- ‘:,- , 260 Appendix 1 While using text format, modifications made to a graphics screen (for instance, by data acquisition procedures) are normally suppressed, though when the display reverts to graphics format, the changes are implemented, since the controlling variables were modified, not the screen itself. However, it is sometimes necessary to revert back to the graphics format while the program is using text format, such as when an error occurs in the middle of data acquisition. Therefore, a third mode, SC–rnode_TX_OVR, is available to allow for this “override” possibility (for details of conditions, seethe tX_wr procedure).

Actual switching between modes is a bit convoluted. To enter text mode, the procedure TextMode is called, which automatically changes mode to sc_mode_TX.

To enter Graphic sMode, the UpdateAll procedure must be used, which changes mode back tos c_mode_GR. mode maybe switched betweens C–rn~de-TX and sc_mode_TX_OVR at will, since there is no immediate change to the screen.

The other variables in the main sc structure are minor.

Within 1s area few minor variables, and mode, the main variable. mode is a case variable, which means it can refer to more than one kind of variable, depending on its value. As described in the section on corn, f pes was originally planned to allow each screen to operate in either a text or graphics mode. The text capability was not built, however, so only the gr_t~’e (“graphics”) structure is used, and mode is always set to

s c_mode_GR. Information is accessed with the syntax mode. gr (for discussion of

case variable usage, see the dt variable in the wv section).

Most of the variables within gr are used to manage the unit translation and axis

labeling features of the screen; these variables all start with the letter u, v, x or y (plus Appendix 1 261 maxxnums and maxynums). The remaining variables deal with the cursor position

(curs orname variables), with the crosshairs (xh structure) or with screen size (bdy and plotarea).

The crosshairs, when active (xh. mode = l), are composed of three horizontal and three vertical lines, one of which is always midway between the other two for each direction. The positions of these lines are stored both as screen coordinates (x and y arrays) and as unit coordinates (u and v arrays). One line of each direction is “active,” meaning it is the one which moves from keyboard input; this is indicated by whi ch.

Finally, because the crosshairs must quickly move over a screen which may contain complicated graphics, the entire screen cannot be redrawn every step. Therefore, when the crosshairs are drawn, a copy of those sections of the screen underneath them are recorded in the bitmap structure, and they are restored when the crosshairs are erased, using built-in graphics procedures.

2.4. “Waves” (spectra): wv

wv is probably the most important variable in the program, since it stores photoelectron spectra, as well as other data. It is also the largest and most complex variable. It is so big that pointers must be used to access it, since it encompasses more than 64 kbytes of memory; fortunately, little additional work is needed to utilize pointers, other than a few initialization routines (see Initialize procedure), and a carat (A) symbol after the 1s [ ] variable.

, ~,. , . .,. ~~~-, ,, ,, -,..,-. ~.-,... ,.-=...... -...—..7 .< . -.

262 Appendix 1

Variable in wv Function cur Currentwave

lS[]A Array of wave variable pointers;

. data [ ] Intensity array

.tmp[] Temporary array (for redo)

. par Parameter variables:

. dt Datatype anddatatype-dependent variables

. alert, . comment, Other variables . fn, . gen, . pt, .pt_gl, scan, . scan_gl, .sh, . skip, .ti.meperpt, .vstop, .yoffset, . yscale

. scan Scan variables:

. accum Accumulator for cor and pow data

. cycle Number of cycles (see par. skip)

. mode Scan status

. shot s Number of laser shots

. starttime Time of most recent scan

. steptime Time to wait before updating

. CO1, .datasaved, Other miscellaneous variables lines, .massl, on, .parsaved, .pmi-n, . savemode, screen, . sel, . timel, .vmax, . vmin

Num Number of waves Appendix 1 263

Sel Overall selection indicator flag

temp [ ] Temuorarv wave used in smoothing

At the top level of w are a few bookkeeping variables (cur, num, sel), a

temporary array (temp), and 1s, the wave list array (see figure). Within each element of

1s is the information about each wave. It contains the actual data array (data), a

temporary data array (tmp), a parameter structure (par), a scan structure (scan), and

several other variables. The miscellaneous variables can be grouped into several categories: display features (co 1, 1 ines, on, screen, se 1), save status

(datasaved, par saved, savemode), calibration (mass 1, t imel), and display

mode-specific quantities (pmin, vmin, vmax).

The data and tmp arrays each have a WPOINTS (currently 1024) number of elements, sufficient for a photoelectron or mass spectrum, and more than enough for a correlation spectrum. The data array is meant to store an accumulating spectrum, while

the tmp array is used to store the most recently acquired spectrum, in order to provide a means of subtracting it from data if there is a problem (see redo command). The tmp array type is integer, which uses half the memory of the real type, an important memory-saving trick, since data must be able to take on noninteger values for arbitrarily adding and scaling waves, but tmp does not require these capabilities.

The par (“parameter’’)structure contains information displayed when editing a

wave (see ed command). The most important variable here is dt, “datatype,” which represents the kind of spectrum stored in the wave. There are currently four datatypes defined, represented by constants:

,, ,y., .,$.,.:; -,,-;...,. - . 264 Appendix 1 Constant Actual value Datatype dt_COR 1 Correlation

dt_ELE 2 Electron

dt_POW 3 Power

dt_&IAS 4 Mass

The actual values are irrelevant, as the constants are always used. The power datatype is seldom used, and caution should be exercised when programming for it, as procedures associated with the power datatype may no longer be filly functional.

Parameters are divided into two groups. Those applicable to all waves, regardless of datatype, are placed in the main par structure, and appear on the top half of the editing screen in white. Those specific to a certain datatype are accessed through dt using the case expression, and appear on the bottom half of the editing screen in green. case allows several different variables to be accessed, depending on the value of a governing variable (dt). Each possible variable has a different name (cor, ele, pow and mas, respectively), which are themselves structures. For instance, if dt = dt_COR, then access to the correlation structure is specified by par. dt. cor. Note that no error checking is performed when accessing a particular case variable; it is up to the programmer to know the value of dt at all times.

The scan structure stores acquisition status information, used by all datatypes but with slightly different functions for each. The most critical variable is mode, which indicates the current state of an acquisition sequence; see the Scan procedure for detailed information. Appendix 1 265 2.5. Local variables

Within individual procedures are “local” variables where, for general purposes,

the same names are usually used. Here is a partial list of these variables:

Name Tvne Function c char Keypress, string manipulation

dummy integer “Dummy” (unused) variable, used with the val built-in procedure to convert a string to a number

exitflag boolean Flag to signal exit from loop

f text File specifier (for reading/writing files)

i,j, k,n integer Counting, array indices

r real Real-number calculation

s, s2, etc. bufstrin String manipulation 9 t emp bufstrin Temporary values 9, integer

w integer Wave index

3. Compiling and execution

The program is written in Borland Pascal 7.0. The easiest way to compile the program is to use the make menu command within the compiler, after specifying

fpes. pas as the “target” file. Alternatively, each unit can be compiled separately

(creating name. tpu object files), and then fpes. pas maybe compiled; this is what make does automatically. The result in either case is an executable file, fpes. exe. The

only additional complication is the necessity of executing a single DOS command, for

serial port initialization, prior to running fpes. exe. This awkward step has been

alleviated with a DOS batch file, fs. bat, which accomplishes these tasks with a single

. .:-’- ,! -,....‘-.-.-s----”=.,- 7. --<<7 .+-..-.7.- ..r-- ; $:, 266 Appendix 1 command, fs (from DOS). Note that it is currently not possible to run f pes from

Windows if data acquisition is required (it is fine simply for data manipulation).

Running the program entails simply typing fs from the DOS command line.

4. Program listing

The f pes program is divided into a number of files (name. pas), all but one

(fpes. pas) of which are Pascal “units,” an archaic but necessary organization used to run a program in the DOS environment. Units are limited to 64 kbytes when compiled, and to make matters worse, the total memory of program plus variables cannot exceed

640 kbytes. As f pes has grown, the number of waves simultaneously held in memory has had to decrease accordingly. On the bright side, the unit organization of the program has been used advantageously to subdivide logical sections of the program. An overview of the files and their contents are as follows: Appendix 1 267 fpes. pas (not a Main procedure only (highest level of organization) unit) fpescom. pas Command processing (com_nmne) anti command action (do_name) procedures, organized alphabetically

fpesai. pas All other procedures and functions, organized fpesjr. pas alphabetically over several units fpesst pas fpesuz. pas

fpesvar. pas All constants, types and variables, organized into logical sections; within each section, in order as cons t, type, and var; within each category, alphabetically

dosshell pas Procedures for limited DOS functionality within the fpes program, originally designed to be used by other programs (hence separate unit)

keys . pas Constant definitions for nonprinting characters used by fpes

tpdecl. pas Interface structure for the National Instruments GPIB card (executable code contained in tpib. obj, not listed here)

The above files are collectively referred to as the “fpes program,” and version 6 of this program is presented in the files which follow.

In addition, the following files are important enough to list along with the units:

fs bat DOS batch file to initialize serial port before running fpes. exe

help. par Syntax of all commands (viewable from within program using help command)

mass. Par Mass calculator parameters (exam~le)

------.- 4.2. fpescom. pas 4.1. fpes pas unit Fpe5C0m; ($M $4000,0,0 ) ($M 16384, 0, 327680) ($N+) interface program fpes (input, output) ; uses ( History of modifications (please add to BOTTOM of list!): FpesVar;

Version 1: Begun 28maY94 8JG. procedure com_err; procedure comerr_wv(w : integer; s : bufstring); Style notes for program entities: procedure com_ex; lowercase: for commands, types, and variables; procedure cowarse(s : bufstring); CapitalizedWords: for program and unit procedures and functions (not com- procedure co~rd; mands! ); procedure comwr(s : string; CO1 : word); ALLCAPITALS: fOr COnStantS. procedure c0nu#r_db(5 : bufstring); procedure com_wrJJv(w : integer: s : string; CO1 : word); Version 6: 1998-6-3-Wed EJG function comwrm(s : bufstring) : integer; NB: Sorry no other notes have been recorded over the years -- this function co~wr~aesc(s : bufstring) : integer; situation will be rectified when I write up my thesis. procedure conLwrJw; procedure do-abs; Current version has made the following modifications over version 5 procedure do_ac-cc(pos : real); (to be itself documented later): procedure do-ad; PtoU: Quadratic energy formula modified so as to not crash program procedure do-add; when attempting to smooth in energy space (sm en) . Simply set the procedure do_auto; temp variable to zero when temp < 0, rather than setting entire procedure do_blank; PtoU return to O (this is because sqrt(temp) is calculated next). procedure do_bg; This prevents a large discontinuity in the value of points at low procedure d%bg-chg(i : integer); energy, in the case where temp c O, and allows smooth to work fine. procedure dobs; procedure do_bs_dis; 1998 -6-8-Men BJG procedure do_bsflode(i : integer); Realized the reason versions 3 and later can’t take mass spectra is procedure do_cal; because the TEK initialization code in ScanMAS was deleted! So I procedure do_cd: put it back in. procedure do_cp; ) procedure do-cpd; procedure do_dos; uses procedure do_dots; {Calib5, )crt, dos, FpesCom, FpesVar, FpesAI, FpesJR, FpesST, procedure do-cd; FpesUZ, graph, procedure do_fit; Keys; procedure do_fn; procedure do_ fn_x; begin procedure do- fpes; ( Note: VerSiOn # iS in VERSION variable; see FPEsVAR. PAS ) procedure do_gen; Initialize; ( Initialize all internal variables, check for workspace procedure do_macro; default file on disk (use internal defaults if none). ) procedure do_mc; ( IntroducePro9r8m; { Print friendly greeting. ) procedure do_mon; UpdateAll; ( Draw waves with proper bells & whistles ) procedure do-rev; while exit flag = false do procedure do_nw; begin procedure do-osc; co~rd; ( Read command line; also process ‘hot keys. - ) procedure do_rd; comex; ( Execute commands. ) procedure do-redo; end; — procedure do-rm; ws_sv(WS_FN_DF); ( Save workspace. ) procedure do_run(blank : integer): TidyUp; ( Deallocate memory. ) procedure do_sc; end. procedure do_sc_ss(w : integer); procedure do_sech; procedure do_sh; procedure do_sm; procedure do_ss: procedure do_stop; procedure do_sts , end procedure do-sv : else if s = ‘absr then do_abs procedure do-t O; else if s = ,ac, then do_ac-cc(tO ac) procedure do-t.s; else if s = ‘ad, then do_ad ,-...,. procedure do_ts_dly ; else if s = ‘add, then do-add :.-J procedure do_ts_tog; else if s = ,area, then do_wv-xnfol O, s) procedure do-tw; else if s = ,avg, then do_wv-infol O, s) procedure do_vis(v : integer) ; else if s = ‘auto, then do_auto procedure do-ws ; else if s = ,blank, then do_blank procedure do_wv ; ,,1 else if s = ,bg, then do_bg procedure do_wv-alert; eke if s = ‘bs, then do_bs L’: procedure do_wvJo ; else if s . ,cale then do_cal procedure do_wv_dly ; else if s = ,CC, then do_ac_cc(tO. cc) procedure do_wv-fn; else if s E ,cd, then do_cd procedure do-wv-info(w : integer; S2 : bufstring) ; else if s . ‘co1, then _col procedure do_wv-lines(l : integer); else if s . ‘cp, then do_cp procedure do_tr/_sC ; else if s = ,cpd, then do_cpd procedure do_wv_sh : else if s . ‘ctr> then do_wv_info(O, s) procedure do_wv-skip; else if s . ‘dis, then do_bs_dis procedure do_wv_vs top; else if s = ‘disc, then disc procedure do_x(scr : xnteger); else if s = ,dly, then _dly ,<..,. procedure do_xh ; else if s = ,dos, then do_dos :’-%{ ,,\ procedure do fl(scr : integer) ; else if s = ,dots, then do_dots ,,i procedure do_yo ff ; else if s . led, then do_ed procedure do~sc ; else if s = ,edgel, then do_wv_inf.a (O, s) else if s = ,edger, then do_wv_infol O, s) Implementation else if s = ,en, then Set EnergyConversicm else if s = ,ex, then Sxit Program uses else if s = ,exit, then ExitProgram crt, dos, FpesAI, FpesJR, FpesST, FpesUZ, else if s = ,fit, then do_ fit graph, Keys, 00sshell, TPDecl; else if s = Pfn, then do_fn else if s = ,fu, then FullView(sc. cur) procedure com_err; else if s = ,fwhm, then do_wv_mfo(O, s) ( Print error message with some diagnostics to help user figure out else if s = ,gen, then do_gen ,. what, s wrong. ) else if s = ,help, then Help [ va r else if s = ,ht, then do_wv_info (O, s) m s : bufstring: else if s = oint, then Integral , begin else if s = ,inv, then do_vis (0) ( Convert current word number to string. ) else if s = ,macro, then do_macro ; str(com. cur, s): else if s = ‘MC - then do_mc . com_wr (#Error in word ‘ + s + ‘: “ + corn.ls[com. curl + ‘-o, else if s = ,mon, then do_mon COLORHL) ; else if s = ,mve then do_mv wv_sel-off; ( Turn off selected waves (usually get errors before else if s = snore then ToggleSaveMode routine has had a chance to do this) ) else if s = ,nw, then dc._nw end; else if s = $osc 9 then do_osc else If s = ,P, then Pause procedure com_err_wv(w : integer; s : bufstrlngl ; else if s = ,pr, then PrxntWave I print error messa9e concerning wave w, ) else if s = -q, then SxitProgra” ,,\ begin else If s = ‘quit< then ExitProgram .$ com_wr_wv (w, s, COLORHL) ; else if s = ,rd, then do_rd end; else if s = 8rebin, then rebin else if s . 0redo, then do_redo procedure com_ex; else if s = ,rescale, then _rescale ( Executes commands ) else if s = ‘resume< then do_r”n (0) Var else lf s = ‘rf- then UpdateAll s : bufstrmg, else If s = ,, as flag to cOm_wr routine not to tx_dr (@corn.t%) ; ( Print screen. ) b-other saving. ) corn.sv :n ,, ; ( Erase previously saved input. ) repeat ( First truncate trailing spaces. ) Scan; ( Take care of active waves, ) for i := length(s) downto 1 do co~wr_sv; ( Re8tore input if it has been saved due to messages if s[i] = ‘ ‘ then printed during Scan. ) s := COPY(S, 1, i - 1) tx_wr_ch (@corn.t%, ‘_’ ); ( Write cursor. ) else if keypressed then i := 1; ( Get out of looP. 1 begin ( Read key. ) ( Special case: ,I !, = echo last string typed. ) c :. readkey; ifs= ‘!!’ then if (c >= #32) and (c <= #127) then begin begin com_wr (corn.old, COUIPJIESS); ( Echo last string typed to screen. ) tx_wr_ch (8com. tx, c); exit; ( Just use last tom. 1s[ 1 values Over a9ain. ) if corn.tx. cur. x c corn.tx. num. x then end; inc(com. tx. cur. x) else if corn.tx. cur. y < corn.tx. num. y then cm. old := s; { Transfer current string to stOH&Ie fOr use by !!. ) begin ( Advance to next line. ) corn.num := 1; corn.tx. cur. x := 1: clast := ‘ ,; inc(com. tx. cur. y) ; for i :. 1 to com_ls_WAX do end corn.ls[il := “; else if corn.ystart > 1 then ( Perform parse. ) begin ( Scroll down if didn, t begin at top. ) for i := 1 to length(s) do corn.tx. cur. x := 1; ( Advance word counter on first space encountered; others ignored. ) tx_scr_up (‘JcOm.tx) ; if s[i] = ‘ ‘ then dec(com. ystart) ; begin end; ( Otherwise, leave cursor at end of line (dead-ended) . ) I if clast c> ‘ ‘ then end begin else case c of Clast := “ ‘; BS : begin inc (tom.num) ; tx_wr_ch (#COI1l.tx, , ,); end; if corn.tx. cur. x s 1 then end dec(com. tx. cur. x) else else if corn.tx. cur. y > corn.ystart then begin begin ( Move to previous line if we haven, t gone past beginning. ) ( Check if exceed max words (trick into ending fOr 100PI ) corn.tx. cur. x := corn.tx. num. x; if corn.mm > com_ls_WAX then dec(com. tx. cur. yl ; end. ( Otherwise, cursor doesn, t move. ) corn.tx. num.x + com tx cur. x - 1 do end; corn.sv := corn.sv + corn,tx, bufa lx], ... CR : exltflag := true: ( Erase input lines: move current cursor back to start of xnput. ) CTRLS. ScanStopAl 1; FlllChar (corn.tx. buf-[(tom. ystart - 1) . corn.tx. num x + 1], ,. CTRLZ. YScaleChangeSlgn; (tom. tx. cur. y - corn.ystart + 1) + corn,tx. num. x, , .); ,,f corn.tx. cur. x := 1: ,:. ESC : Pause; EXTENDED : corn.tx. cur. y := con, ystart; case readkey of end; XARROWLSFT: MoveCursor (O, -1 I; ( Write message. ) XARROWRIGHT: MoveCursor (0, 1 ): tx-wr(ecOm. tx, S, CO1, 1); XARROWUP: ChangeCurrentWave (-1 ): ( Updat& ystart. ) uRROWDOW?4: ChangeCurrentWave (1 ): corn.ystart :. corn,tx, cur. y: XCTRLARROWLEFT: MoveCursor (O, -20 ); end: XCTRLARROWRIGHT: MoveCursor (O, 20 ): XCTRLEWD: YScaleChange (-1); procedure coKwr_db(s : bufstring) ; XCTRLHOME: YScaleChange (1 ); ( Print debug message s, wait for user to hit key. ) XCTRLPAGSUP: MoveCursor (1, -20) ; beg in XCTRLPAGEDQWW: MoveCursor (1, 20) ; i f debug . 0 then XDELETE: YScaleChange (-O. 1) ; exit; XSWD: YScaleChange (-O. 01) : com_wr (s , COLORDEBUG ); XF2: SystemControl; if readkey = extended then XHOME: YScaleChange (O.01) ; readkey; XINSERT: YScaleChange (O. 1) ; end; XPAGEUP: MoveCursor (1, -1) : XPAGEDOWW: MoveCursor (1, 1) ; procedure com_wr_wv [w : integer; s : string; CO1 : word) ; end; ( Print message concerning wave w. ) TAB : ToggleCrosshair sWhich; begin end; cOm_wr (,Wave o + mc.kestri”gxnt (w) + , , + s, CO1); tx-wr_ch (@tom. tx, ‘_, ); end; end; until exit flag, function com_wr3 (s : bufstring) : integer; ( Srase cursor. ) ( Print message s on tom, wait for user response: tx_wr-ch(@com. t%, ‘ ‘); Y (yes): 1 N (no): O. .. ( Transfer text into s. ) Also stores result in ynaesc_response variable, ) . , ~:=.?; ..: begin u .... for i := (tom.ystart - 1) ‘ corn.tx. num. x + 1 to corn.tx. cur. x - 1 + com_wr(s + , (Yes INo) ?<, COLORWL) ; (tom. tx. cur. y - 1 ) . corn,tx, num, x do if nu.cro_override = 1 then s := s + com tx. buf”[il: begin ( Clean UP screen display for next action -- only advance cursor if com_wrfl := 1; something was typed. ) ynaesc_respOnse := 1; if lcom. tx. cur. y , com wtart) or (tom. tx. cur. x > 1) then exit: begin end; corn,tx. cur. x := 1; repeat If corn,tx. cur. y = corn.tx. num Y then Scan; ( Keep active waves happy. ) tx_scr-up(@cOm. tx) case readkey of else Jn#, ,N. : inc(com tx. cur. y) ; begin end; cOm_wrJn := O; cOm_parse (s ), ( Parse text Into corn.1s[ 1. ) ynaesc_respOnse := O; end; exit; end; procedure com_wr (s strxng: CO1 word) ; ‘Y’< *Y, : ( Print string s m color col to coin,tx screen, first saving user Input begin I f nothxng has been saved ) cOm_wr_yn := 1, var ynaesc_response = 1, I >nteger; exit; begxn end, ( See if something has been saved ) EXTENDED readkey, ( Handle extended keys ) If corn.sv = ,, then end, beg in uncll false, h) ( Save input in com sv ) end, 4 for i = (tom ystazt 1) - com tx numx + 1 to [tom tx cur y - 1) . function co~wr~naesc (s : bufstring) : inte9er; end; ( If the Ynaesc_resPonse variable is O or 1, prints message G on corn, then waits for user to type a key, returning: procedure do_abs; [ Switch to absolute Y mode. ) A (all yes) : XetUrn 2 begin Y [yes) : return 1 if sc. 1s [SC. cur] .gr. yaxismode = YAXISMODE_RELATIVE then N (no) : return O ToggleYAxisMode (SC,curl ; ESC (abort) : return -1. end;

However, if ynaesc_response = 2 or -1,will return this value immediately, procedure do_ac_cc (POS : real) ; neither printing the message nor waiting for user input. This is how ( Set UP an AC or CC wave centered at position Pos. ) the concepts “all” and ‘abort” are implemented. To clear an “all” 02 beain;— ‘abort - condition, set ynaesc-response = O (or 1) . If wv. nun = MAXWAVES then begin See also com_wr_yn, which has more limited choices. ) com_wr (‘Memory Full. ‘, COLORHL) ; begin exit; if (yoaesc_response < 0 ) or (ynaesc_response > 1 ) then end; begin CreateWave (dt-cor, O); cOm_wr~aesc := ynaesc_respOnse; with wv. ls[wv.curl” do exit; begin end; par. cOr. ts. tO := Pos; I Comwr(s + ‘ (Yes/No/A21/ESC) ?‘, COLORWL); UpdateCORLimits (@par) ; ( Change start & stop. ) repeat end ! Scan; ( Keep active waves happy. ) UpdateVitals; case readkey of Update (se.cur) ; ESC : end; begin cOm_wr~aesc := -1; procedure do_ad; ynaesc_response := -1: ( Print or change AID board Params. ) exit; va r end; ch, chmin, chmax : integer; I ‘a, , ‘A, : dummy : integer; begin i : integer; cOm_wr_ynaesc := 2; s : bufstring; ynaesc_respOnse :. 2; sel : array [1 .. AD-MAXI of integer: ( Selection array. ) exit; begin end; if tom. cur = corn.num then ,n, , ‘N’ : begin begin cOm_err; cOm_wr_ynaesc := O; exit; ynaesc_respOnse :. O; end; exit; , inc (tom.cur) ; end; s := Corn.ls[com. cur] ; ‘Y’< ‘y’: val(s, chmin, dummy) ; begin if chmin in [1, .AD_MAX] then cOm_wrDaesc := 1; begin ynaesc-response := 1; if corn.cur = corn.num then exit; begin end; . co-err; EXTEWOSP: readkey; { Handle extended keys. ) exit; end; end: until false; clunax :. chmin; end; inc (corn.cur) ; s := corn.ls[com. cur] ; procedure conLwr_sv; end ( Restore saved input to screen. ) else begin begin if corn.sv <> ,‘ then chmin :. 1; begin Chmax := AD_14Ax; t%_wr(@com. tx, corn.SV. COLORUSER, O); ( O: non-scroll mode. ) end: corn.ystart :. corn.tx. cur. y - length (corn.SV) div corn.tx. num. x; if s = ,gain, then corn.sv := ,,; begin end; if can. cur = cam. num then beg an begin for ch = chnmn to chmax do wv, ls[i]~. sel := O; com_wr (,Channel - + makes tringmt(ch) + - gain r + com_wr_wvl i, ,removed from target llst r, COLORHL) ; ... makes trlngmt(ad. ls[ch] .gaxn) , COLOIU4ESS) ; end; ..; exxt., ~m“: end: ( Do additions. ) inc (corn.cur) ; sc-sel_Of f ; val(com. ls[com. curl, 1, dumny); for i := 1 to wv. num do if(l=l)0r(i=2)0r (i=4)or(i=8) then with wv. ls[i]~ do for ch := chmin to chmax do if sel . 1 then ...: ad. lslch] gain := i begin else for j := 1 to par. pt do cOm_err; with sc. 1s [screen] gr do end begin else data [j ] := PtoV( i, j, xaxismode_POINTS, yaxismode) . cOm_err; sgn(par. yscale) : ( Need sgn since PtoV uses abs [par, end; yscale) Use POINTS mode to prevent vertical scale changing due to non”” iforrr,x axis (e.g. energy space) ) procedure do_add; for k := 1 to wv. num do ( Handle addwaves commands. ) if w[k] = 1 then var with sc. ls[wv. ls[k]-, screen] .gr do 1, j, k, dumny : xnteger; data[ j] := data [I ] + PtoV(k, j, xaxismode_POINTS, w : array[l NAKWAVES] of integer; ( Keep track of 1st wavelist. ) yaxismode) + sgn(wv, ls[k]-. par, yscale) ; beg in end; If wv. num = O then ( Now reset scaling todefault since data has been altered by ex~t; these parameters. ) if corn.num . 3 then prtr.yscale := 1; ( Old add functions: turn on{of f addwave ) pax. yoffset := O; begin datasaved :. O; if (addwaves. mode = 1) or (tom.cur = corn.num) then parsaved := O; ToggleAddWavesMode (wv. cur) ( Disable bs mode so don, t get b. d~s affecting result. ) else if pax. dt = DT_ELE then begin par. ele. bs, mode := O; mc(com. cur) : ( Tag screen for update, ) val(com, ls[com. cur 1, i, dummy); sc. ls[screen] ,sel := 1; if (i s= 1) and (I .= wv. nurn) then end; m ToggleAddWavesMode (i ) wv-sel_Of f; else UpdateSel; ., cOm_err: end; .i end; exit: procedure do_auto; end; ( Change auto parameters. ) Var ( New add function: add (!’WLIST) to (WLIST) ) dumny : integer; wv-sel (l) : s : bufstring; ( COPY first wave list to temp array. ) begin for I := 1 to wv. num do if tom, cur = tom, num then lf wv, ls [i]” sel = 1 then begxn w[i] := 1 cOm_err; else exit: w(l) := o; end; ( Ensure that ,to, word 1s present. ) xnc (corn.cur) ; lf (tom.cur = corn.num) or (corn ls[com. cur + 1] <> ‘to, ) then s := corn,ls[com. cur] ; begin if s = ,adv, then com_wr( ‘Format add (WVLIST) to (WVLIST) .9, COLORHL) , beg in exit, if corn.cur = com num the” end, begin Inclcom. cur) , com_wr( ‘Auto, adv + makes trlng (auto adv / POWFS, VALMAKFS, ( Get target wave llst ) VALDECFS) + , fs , COLORMESS ), wv_sel(ll , exit; ( Remove waves selected in both lISCS from the target list ) end, for i .ltowvnumdo Lnc (corn cur ], w 4 :f [w 1s[1]$ sel = 1] and IWII] =1) then s = com ls[com cur] w if s = ,0, then else if s . ‘num’ then begin rd_int (auto .num, ‘Auto .num’ , 1, 999) auto, adv :. O; else if s = ,rm, then exit; rkint (auto. rm, ‘Auto .rm’, O, 1) end; else if 5 = ,ser’ then val (s, auto. adv, dummy] ; begin auto. adv := auto. adv ● POWPS; ( Convert fs to s. ) rd_str (auto .ser, ,Auto. ser, ); roundof f (auto. adv, ts, step / WALFSPEECOFLIGHT) ; ( Round to ( Add ‘-- to end if not already there. ) nearest 1 um. ) if auto. ser [length (auto .ser) 1 <> ‘-‘ then ( Check for excessively large step size. ) auto. ser := auto. ser + ‘-’; if .abs(auto. adv ) s STAGEMAK / SALFSPEECOFLIGHT then end auto. adv := O; else if s = ‘SV’ then end rd_int(auto. sv, ,Auto. sv, , O, 1) else if s = ‘all’ then else begin cOm_err; i f corn.cur = corn.num then end; begin ( Print values of all auto vars. ) str(auto. bg, s); procedure do_blank; COlli_WX(‘Auto. bg ‘ + S, COLOPMESS) ; ( Blank part of waves. ) str(auto. fn, s) ; var COM_WX( ‘Auto .cor $ + S, COLQRMESS) ; dummy : integer; str(auto. cor, s); begin com_wr (‘Auto. fn # + s, coLoRf4sss) ; if corn.cur = corn.num then str(auto. gen, s) ; ( Assume just blank current wave, using current limits. ) corrLwr (‘Auto. gen , + s , CO14X-?14ESS); begin str(auto. off, .5); wv-sel (1); com_wr( ‘Auto .off ‘ + s, COLCIRMESS); Blank; Str(auto. ml, s) ; exit; com_wr( ‘Auto. rm < + s, COLCIRMESS); end; str(auto. sv, s) ; inc (corn.cur) ; COM_WZ (‘Auto. SV ‘ + S, COLON4ESS) : if com.ls[com. curl = ‘lim’ then exit; begin end; if corn.cur . corn.num then inc (corn.cur) ; ( Print current limits. ) s := corn.ls[com. curl; begin ( Read value and put in first variable. ) couwr (,blankmin , + makes tringint (blankmin) + , blankmax , + if s = ‘O’ then makes tringint (blankma%) , COIJN.MESS) ; auto. fn := O exit; else if s = ‘1’ then end; auto. fn := 1 else ( Read new limits. ) begin inc (corn.curl ; corn--err; if corn.cur + 1 > corn.num then [ Snsure there are two words follow- ! exit; ing ,lim, . ) end: begin ( Assign other auto vars. ) co~err; auto. bg :E auto. fn; exit; auto .cor := auto. fn; end auto .gen := auto. fn; else auto. off := auto. fn; begin .auto.m :. auto. fn; val (corn.ls[com. cur] , blankmin, dummy) ; auto. sv := auto. fn: val (tom. ls[com. cur + 1], blmkma%, dutrany); end ( Keep in range. ) else if s = ‘LxI’ then if blankmin < 1 then rd_int(auto. bg, ‘Auto .bg’, 0. 1) blankmin := 1: else if s . ‘cor’ then i f blankmax > MAXPOINrS then raint(auto. cor, “Auto .cor’ . 0, 1) blankmax := WAXFOINrS; else if s = ‘fn’ then end rd_int(auto. fn, ‘Auto .fn’ , 0, 1) end else if s = ,gen’ then else rd_int(auto. c?en, ‘Auto .gen’ , 0. 1) dec [tom.cur) ; else if s = ‘off’ then wv-sel (1); rd_int(auto. off, ‘Auto .off ’. 0. 1) Blank; end, Var procedure do-bg; S : bufstrxng; ( Prxnt or change bg wave ) beg Ln var if corn.cur = corn.num then dummy, i : integer: begin s : bufstring; do_bs-mode (1 ); begin exit; x f com. cur = tom. num then end; begin xnc (co”. cu-) ; do_tg_chg (w, cur) ; ( Change current wave to bg. ) s := corn.ls[com. cur] ; exit; if s = ‘O, then end; do-bs_mode (O ) else if s = ,?, then mc (corn.cur) ; do_bs_mode (-1 ) s :. corn.ls[com. curl; else if s . #adapt, then Ifs= 8?, then BsAdapt ( Show current bg wave. ) else if s = ‘diss then com_wr (,bs bg , + makes tringint[-bs. bg) , COLORMESS) do_bs_dis else else if s = ‘off, then begin do-bs-mode (O ) val (s, i, dummy): else if s . ,on, then do-bg_chg (i ); do-bs_mode (1 ) end; else if is_sel— (s, 1) then end; begin dec (corn.cur) ; ( Back up before 1st sel word, ) procedure do_bg_chg (i : integer) : do_bs_mode (1 ): ( Change current bg wave to x if allowed. 1 end begxn else Lf (i < 1) or (i > wv. num) then com_err; begin end; com_wr (,Wave number out o i range ‘, COLORHL ): exit; procedure do_bs_dis; end; ( Print or change dis mode. ) with wv, ls[i]~ do var begin 1 : integer; ( Forbid change if either: s : bufstring; 1. current wave is bs scanning, begin 2. new wave is bs scanning. ) If tom, cur = corn.num then if ((_bs. bg > O) and (wv, lsl_bs. bgl”. par. dt = dt_ELE) and -bs, dis := 1 (wv.lsl_bs. ~l’. par ele. bs. mode = 1) and (wv. ls[_bs. twl”. else scan .mode > 0 I) begin or mc(com. cur) ; ((par. dt = dt_ELEl and (Par ele. bs. mode = 1) and lsc?.n.mode w s := corn.ls[com, c”r]; o)) lf S = ,?, them then begxn begin com_wr( ‘bs dis , + makes tringint(-bs, dis) , COLORMESS) ; cOm_wr-wv (i, ,active 8 No change. 5, COLORHL) ; exit; exit; end end; else if (s = ,0, ) or (s = #off, ) the” if par. dt .> dt-ELE then -bs, dis :. 0 begin else if (s = cl, ) or (s . ‘on, ) then cOm_wr_ww (L, anot ELE * No change. ,, COLORHLI , -bs. dis := 1 exit; else end: begin -bs bq = L, corn-err; par ele bs mode = 1, ( Turn on mode ,f off ) exit, end; end, Dr.w#.’faveData, ( Update 8< flag ) end, end, sc-sel-off, for 1 =ltowvnwndo procedure do-bs, with w lS[l]A do ( Handle bs commands ) lf [pdr dt = dt-ELE) and (par ele bs mode . 1) then SC. ls [screen] .sel :. 1; Updatesel; procedure do-cd; end; ( Print or change current directory. ) var procedure do_bsflode (i : integer); i, j, k : integer; ( counters ) { Print (i = -1) or change (i = O, 1) par. ele. bs. mode of waves. ) s : bufstring; ( user in9ut buffer 1 var tdir, tdir2 ; bufstring; - ( Temporary directories. ) j : integer; begin begin if corn.cur = corn.num then wv_sel (1) ; ( Get wave list. ) begin if corn.cur <> corn.num then com_wr (dir, COLDR14ESS) ; ( Should not be additional words at end. ) exit: begin end; cOm_err; tdir :. dir; ( Copy directory for manipulation. ) exit; inc (tom. cur); end; s := corn.ls[com. cur] ; for j := 1 to wv. num do if s .> ,, then ( if user types nothing, no change ) with wv. ls[jla do begin if sel = 1 then if s[l I = ‘.’ then becfin ( ‘1 ‘”indicates user wants extension of current directory ) zf i = -1 then for i := 2 to length(s) do com-.wr-uv( j, ,bs mode , + makes tringint (par .ele. bs. mode) , tdir := tdir + s[i] COLOP.MESS ) else else if par. dt <> DT-ELE then begin com_wr-wv (j, ,not ELE ! No change. ‘, [email protected]) ( remove subdirectories ) eke if scan. mode > 0 then if (s[1] = ,-, ) then com_wr_wv (j, Iseaming ! No change. ‘, COLORHL) begin else j := 1; begin tdir2 :n tdir; ( restore if necessary ) par. ele. bs. mode := i; repeat [ Change b wave if currently invalid. ) i := length (tdir) - 1; with ~.lst_bs. @l” do repeat if (_bs. tw < 1) or (_bs. LKI z wv. numl or (par. dt <> i:= i-l; dtlSLE) ‘or (par .ele. bs. mode = O) then until ((tdir[i] = “\’) or (i=l)); _bs. bg := j; delete (tdir, i+l, length (tdir) -i) ; end; j :=j+l; end: until ((s[j]+t-~) or (i=l)); wv_sel_Off; for k := j to length(s) do DrawWaveData; ( Erase selection tags, update bs ta9S. ) tdir :. tdir + s[kl; end; if (i=l) then tdir :E tdir2; procedure do_cal; end begin else if corn.cur < corn.num then ( manual input of new directory ) begin begin inc(com. cur) ; tdir := , ,; case wv.ls[wv. curl” .par. dt of for i := 2 to length(s) do dt_ELE: case corm.ls[com. cur] [1] of tdir := tdir + , ,; ,1, : CalibSnergy(l) ; for i := 1 to length(s) do ,2, : Calibsnergy (2 ); tdir[i] :. s[i]; else cOm_err; end; end; end; dt_MkS: case can.ls[com. cur] [11 of end; ,1, : Caliti.fassl; Update Filenmnes (tdir ); ( Assigns tdir to dir inside procedure. ) ,2, : CalibMass2; DrawNaveData; ( fn representation maY change. ) else co%err; end; end; else cOm_err; procedure do_cp; end; { COPY waves. ) end var else tempnumwaves : integer; cOm_err; w : integer; end; begin wv_sel (1); printdlr := printdlr + s[k] ; if wv. sel = O then if (i.1) then exit: printdir := tempdxr, tempnumwaves := w. num: end for w := 1 to tewnmwaves do else with wv. lsIw]- do ( manual input of new directory ) if sel = 1 then beg in begin printdir := , ,; if W. num . MAXWAVES then for i := 2 to length(s) do begin printdir := printdir . , ,; com_wr (‘Memory full. ,, COLORHL) : for i := 1 to length(s) do w :. tempnumwaves; ( Trxck to get out of loop, ) printdir [i] :. s[ l]; end; end; inc(wv. num) ; end; wv, ls[wv. num]’ := w.lsIw]”; end: Initial izeWave (w. numl ; ( Set certain parameters to defaults. ) end: ( Now change a couple back: ) w-...ls[numl”ml” datasaved :. W. 1s [w]~.datasaved: procedure do_dos; v,v.ls[wv.num]”. lines :. Wv, ls[w]h, lanes; ( Interfact to ShellToCOS code. ) W, ls[wv. num] “ ,parsaved := W.l SIW]A ,parsaved; begin wv, ls[wv. num]-, par, sh := wv. ls[w]a. par. sh; TextMode; end; Shel lToSOS; wf_sel_Off: ( Turn off wave selections, ) DrawAl 1; UpdateVitals: end: Update (SC. cur) : end; procedure do_dots; ( Change dot size. ) procedure do_cpd; var ( Print or change current pr,nt directory. ) dummy : integer; var i : integer; l,j, k : integer; ( counters) s : bufstring; . s : bufstring; ( user xnput buffer ) begin tempdir : bufstring; ( for restoring directory ) if corn.cur = tom. num then begin beg m if com cur . tom. num then str (dotradius, s) ; begin com_wr (‘Dot radius = v + s, COLOSMESSI ; com_wr (printdir, COLORMESS) ; exit: exit; end; end; inc (corn,cur) ; inc (corn,cur ); val(com, ls[com, cur], i, dummy) ; s := corn,ls[com. cur]; if (i . O) or (i z FL4XDOTSIZE) then If s.>,, then ( lf user types nothing, no change ) beg in begxn cOm_err; If s[l] = ,., then ex~t; ( ,.0 ,nd,cates user wants extensxon of current d~rectory ) end; ,’; for 1 := 2 to length(s) do dotradlus :. i; prxntdlr :. prxntdlr + SII] for i := 1 to sc_wAxdo else SC, lS II] sel := O; begin for i := 1 to wv, nwn do ( remove subdirectories ) with w ls[i]~ do if (s [1] = ‘-t) then lf (on = 1) a“d (lines . O) then begin sc, ls[screen], sel .= 1; J := 1, for x := 1 to sc~ do tempdir = prlntdlr, ( restore If necessary ) if sc. ls[l], sel . 1 then repeat Drawscree” (L ); I ,= length (prlntdlr) - 1, Drawvltals; repeat end, 1 .1 -1, until ((prlntdlr[ll = ‘i,) or (1=111. procedure do_ed; delete (prlntdlr, 1.1, lengch(prlntdl r) -1] , ( Edit current or specxfled wave, or defaults (‘df .] ) 3 =1+1. var until IIs III.>-,) O, [1=1)), dummy Integer, for k = I to length(s) do 1 integer, s : bufstring; begin N begin if (wv.num = 0) or [tom.cur = corn.num) then 4 i f com. cur = corn.num then begin w begin co-err; if wv. num a O then exit; Change Par (WV. cur 1; end; exit; ( Check for ,x, in second word. ) end; inc (corn.cur) ; inc (corn.cur) ; if com.ls[com. curl E ‘x’ then s := com.ls[com. curl; begin if s = ‘df ’ then do-f U; begin exit; ChangePar (O ): end; exit; end ( Break filename into series, number and extension parts. 1 else s := corn.ls[com. curl; begin intelligent-f ilename (s, aser, anum, ext ) : val(s, i, dununy); if (i >= 1) and (i c= wv. num) then { Check that num is ,= O. ) begin if anum < 0 then Change Par (i ); begin exit; co~err; end; exit; end; end; cOm_err; end; if tom. cur c cam. nun then begin procedure do_fit; inc (corn.cur) ; Var if corn.ls[com. cur] = ,step’ then s : bufstring; begin begin if tom. cur = tom. num then if corn.cur = corn.num then begin begin cOm_err; PitY(dtJfIN - 1) ; exit; exit; end; end; inc (corn.cur) ; inc (tom.cur) ; val (corn.1s [tom.curl, step, dummy): s := corn.ls[com. curl ; if step <= O then if s = ,area’ then begin AreaFitY co~err; else if s = ‘bs’ then exit; FitBs end; else end co~err; else end; begin dec (corn.cur) : procedure do_fn; step := 1; ( Renames wave names. TWO modes: end; EXACT MODE (fn X) : Renames waves with same filename, does not need to end; adhere to standard filename convention. NOPJ4AL MODE (fnl : Renmes waves starting with ntier NUN. If more ( Now we go thru waves, renaming their filenames if selected. We keep than one wave specified, increments nuuber for subsequent waves. the same file extension they had before. ) STEP MODE (fn nun step nUM) : ) auto. ser := aser; auto. num := .anum; var w--sel (1); aser : bufstring; if w.sel = O then anum : integer; exit; dash : Iwolean; for i := 1 to wv. num do dummy : integer; with wv.ls[i]” do ext : bufstring; if sel = 1 then i : integer; begin s : bufstring; str(auto. num, s) ; step : integer; if ext = ,, then par fn .= auto. ser + s + , , + 9et-extenSlOn (Par En) ( Keep end; old extension, ) else if wv. num w O then par. fn :. auto, ser + s + , , + ext. ( Use new extensxon, ) begin mc(auto. num, step) ; if co~wrfl (,Load FPES template, Erase waves, ) = 1 then end; begin UpdateFilenames (d,. ); ( Update filenames if path changed. ) forl:. ltow num do wv-sel_Off; wv, ls[i]~. sel = 1: DrawWaveData; EraseWaves: end: end; end; procedure do_f n_x, assign (f, s): ( Renames waves w.th exact filename (no conventions heeded) ) reset(f) : var readln (f, bg_temp) ; i : integer; if bg_temp > 0 then ( Shift UP location of tq wave if other waves s : bufstring; present. ) begin bg_temp := bg.temp + WV. t-mm; if tom. cur = corn.num then if bg_terrp s f4AXWAVES then begin begin cOm_err; co~wr (,Bg wave number exceeds maximum. Aborting, V, COLCOIHL ); exit; exit; end: end; inc (corn.cur) ; _bs. bq := bg_ter@: s :. con. ls[com. cur] ; ( Record filename ) while (wv. num . MAXWAVESI and (not eof (f) ) do wv-sel (l) ; begin if wv. sel . 0 then readln( f, delay) ; exit; delay := delay . POWFS; for i := 1 to wv, num do CreateWave (dt_ELE, O) ; ( Use d.ef.rmlt values. ) with wv. ls[il” do with wv. ls[wv, cur] ~.par do if sel = 1 then begin par. fn :. s; if _b.s,bg = O then UpdateFilenames (dir) ; ( Update filenames If path changed, ) ele. bs, mode := O wv-sel_o Ef; else DrawWaveData; ele. bs. mode := 1; end, ele. dly :. delay; ( Fix other parameters to ensure all is ok. ) m procedure do_ fpes; ele. ts, pos := ele. dly . HALF SPEED3FLIGHT + ele. ts. tO; ( Set up multiple waves for fpes experiment. Format of f11.s 1s: roundoff (ele. ts. pos, ts. step) ; - bg wave (O to turn off bs mode for all waves) limit (ele. ts. pos, sTAGEwIN, STAGEf4AX) ; - Delay times (fs) for each wave desired Will use default ele ( Update dly again. ) parameters (tO, number of shots, etc. ) for everything else. ) ele. dly := (ele. ts. pos - ele. ts. to) I HALFSPEESOFLIGHT; Var end; bg_temp : integer; end: delay : real; close(f) : f text; ( File variable. ) UpdateAll; i integer, end; s : bufstrlng; begin procedure do-gen; if tom, cur = corn.num then ( Generate new wave, of optionally speci fled datatype, using auto begin filename. ) co~err, va r exit; i : integer; end; s : bufstring, inc(com cur) , begxn s .. com ls[com cur], if corn.cur = com num then >f get-extension(s) = aa then CreateWave (O, O ) 5,=5+ , + FPES_EXT; else ( If not Full Path(s) then begin s =dir+ s,) lnc(com cur) , If not FlleExlsts (s) then s = com ls[com cur], begin for x = dt_MIN to dt_wAX do com_wr (s + does not exist COLORML) if s = dt-NAME [l] then exit beg In CreateWave (i, o); com_wr (me. s, COLOSMESS ); w i := dt_MAX; exit; 00 end; end; 0 end; inc (corn.curl ; UpdateVitals; s := com.ls[com. cur] ; Update (sc. cur) ; if s . ‘auto, then end; begin if corn.cur . corn.num then procedure dcunncro; begin ( Print current mode state. ) ~ Read macro file from disk and execute commands. ) str(mc. auto, s); va r co~wr( ‘mc auto , + s, COLORNESS) ; f : text; exit; s : bufstring; end; begin inc (corn.cur) ; if tom. cur = corn.num then s := corn.ls[com. cur] ; begin if s = ‘O* then mc. auto := O cOm_err; else if s . ’1’ then mc. auto := 1 exit; end end; else if s = ‘1s’ then ( Print list to screen. ) inc (corn.cur) ; begin s := com.ls [tom.curl; if mc. fn = ‘, then f if not FullPath(s) then begin s:=dir+ s;) conLwr (,No mc file loaded. $, COLORWL) ; if not FileExists [s) then exit; begin end: couwr (ERR_FILENO’fFOUND, COLORWL); Textmode; exit; writeln[ ‘Filename ,. mc. fn. , Number of elements s. mc .num) : end; for j := O to MC. nuk div MC_LINESPERSCRESN do assign (f, s); begin reset(f) ; if j c MC. nun div MC_LINESPERSCRESN then macro_override := 1; lim := MC_LIWESPERSCREEN while not eof (f) do else begin lim :E MC. num mod MC-LINES PERSCREEN; ( See if user wants to abort. ) for i := 1 to limdo if kemressed.- then with mc. 1s [i + j ● MCJIWESPERSCREEN] do case readkey of writeln( ‘Mass ,, makes tring(m, VALNAX, VALDEC) , , Min ,, CTRLC : min. , Max ,, max, , Label ,, s) ; begin write (‘Press any key to continue. ‘); close (f) : if readkey . SXTSNDSD then me.cros.verride := O; readkey; exit; writeln; end; end; EXTENPED: readkey; DrawAl 1; end; end readln(f, s); ( Read command line. ) else if s = ‘rd’ then conwr (s, COLOSnACROl; ( Echo to screen. ) begin cOmGarse (s); ( Parse into corn.1s [1. ) mc. fn := ,x, : com_ex; ( Execute command. ) mc-rd(com. ls[com. cur + 1] ); end; end close(f) ; else if s = ‘sens’ then macros.verride := O; begin end: if corn.cur = corn.num then begin ( Print sensitivity. ) procedure do_mc; cOm_wr (‘mc sens , + nmkestring(mc. sens, VALMAX, VALDECI , ( Handle mass calculator (Mc ) co~nds. ) COLOSMESS) ; var exit; i, j, lim : integer: end; r : real; inc (corn.cur) ; s : bufstring; val(com. ls[com. cur], r, i); begin if r <. 0 then if corn.cur . com, nun then cOm_err begin else UpdateMC; mc. sens :. r; end procedwe do_mv: else cOm_err: ( Change to mv scale for all vlszble mas waves ) end; var x : integer; procedure do_mon; ytemp : real; ( Handle commands for mon( itor) command ) begin var sc_sel_Of f ; dummy : integer; for i := 1 to wv. num do x : Anteger; with v,w,ls[i)h do s : bufstrlng: if (on = 1) and (par, dt . dt_t4AS) then beg>n begin if corn.cur = corn.num then ytemp := par. yscale; ( Save before changing. ) begin par. yscale := par ,mas .vert / TEK_YPISPERDIV; co~wr (,mon. w o + makes trmgint(mon. w) , COLOPJ!ESS) ; if (yoffsetrescale . 1) and (.,’terrm.> 0) then exit; pa;. yof fset := par. yoffset : par,- yscale 1 ytew; end: sc. ls [screen] .sel := 1; xnc (corn.curl ; end; s := corn.ls[com. curl; UpdateVitals; if s . ,0, then for i := 1 tosc. num do begin with sc. ls [i] do men. w :. O; if sel ‘= 1 then DrawWaveData: ( Update wave indicator, ) begin end gr. yaxismode := Y.UISMODE-RELATIVE; else if s = ,bins, then Update (i) ; begin end; if tom. cur = corn.num then end; begin com.-wr (,mon. bins o + makes tringint (men.bins) , COLORMESS) ; procedure do_nw; exit: ( Generate new wave, of optionally specified datatne, usxng filename of end; specified wave. ) inc (tom. cur) ; va r s :. corn.ls[com. curl; d, dummy, i, n : integer; val (s, men. bins, dumnyl ; s : bufstring; if non. bins . 1 then begin men. bins := 1 ( Pind number of waves to generate. ) else if men. bins > MAXPOINTS then inc (corn.cur) ; mon, bins := f4AXP01N’TS: s := corn.ls[com. cur]; end val (s, n, dummy) ; else If s = ,t.ot, then if n > 0 then cOm_wr (,mon. tot $ + makes trlngxnt(mon. tot) , COLQFJ4ESS) inc {tom. curl ( Go to next word, ) else else begin “ .. 1; val (s, i, dumny); ( Find datatype (or leave as d = O) ) Lf (i . 1) or (i > wv. num) then begxn begin s := corn.ls[com, cur], cokwr (,Wave number out of range. 0, COLORHL) ; d := O; exit; for i := dt-MIN to dtJ.fAS do end; if s = dt_fiAME[i] then if (wv. ls[il”. scan. mode > O) or (addw.aves.w = i) then begin begin d := I; com_wr_wv (i, ,act Ive 1 No change. ,, COLORHL) ; 1 := dt_NAX; ( Get out of loop. ) exit; end; end; end; If (w ls[ll”. par dt .> dt-ELE) then if d = O then begin de. (corn,cur) , ( Back “p to previous word since nothing was recog- cOCwr_wv (L, = 1) and (i <= sc. num) then s : bufstring; begin begin scr := i; with osc do ( Torn on if not on. ) begin if mode . 0 then ( If osc was off, mint message to alert that if corn.cur = corn.num then now on. ) begin comwr (OSC-ON, COLOIU02SS ); mode := 1 - mode; Ad.ls[ch]. on := 1; if mode = O then mode := 1; begin end Aooff (ch) ; else cent-wr (OSC_OFF, COLORMSSS ); co-err; end end else else begin cOm_err; fi.ls[chl. on := 1; end; co~wr (OSC-ON, COLORNESS ); end; end; exit; procedure do_rd; end; { Read waves. Checks for existence. Terminates with error if there are inc (corn.cur) ; more files than available waves in memory. ) s := com.ls[com. curl; Var if s = ,ch, then dJOFt : boolean; ( Flag toabort procedure. ) begin anunl : integer; if corn.cur = corn.num then aser : bufstring; begin dummy : integer; com_wr (,Osc channel = , + makes tringint (ch ), COLORMSSS ); ext : bufstring; exit; s : bufstring; end; inc (corn.cur) ; procedure do-rd_exit; forward; val(com. ls[com. curl, i, dumw); procedure do_rd_fn; forward; if [i >. 1) and (i <. AO_MAX)— then procedure do-rd_wv; forward; begin procedure do_rd_x; forward; if mode = O then ( If osc was off, print message to alert that now on. ) procedure do_rd_exit; CO!V,VK (OSC_ON, COLOR24ESS) ; ( Tidy up before exiting. ) mode :. O; ( Must turn off so channel can be freed. ) begin ADoff (ch) ; UpdateVitals; ch := i; Update (sc. cur) ; ( Since can only load waves into current screen, Ad. ls[ch]. on := 1; this works. ) mode := 1; ( lmrn on again. ) end; end else procedure do_rd_fn; conunx; ( Assemble and check for existence of filename. ) end var else if s = ‘fu’ then i : integer; with sc.ls[scr] .gr do begin begin str(auto. num, s) ; vllim := 2048; if ext = ,, then v21im := 4095; begin yfullmode :. O; s := auto. ser + .5; UpdateVitals; if not Pull Path(s) then s .= dir. s; do_rd_tw ; ( Try all dt extensions: ) end; i := dt_!41N; do-rd_exx t; while (i . . dtJ.iAX) and (not F1leExists(s + , , + dt_NAME[ l])) do end; xnc (x); I f i .= dt_MAX then BEGIN S.= s+,., + dt_NAt4E [i ] ; abort := false; end ext :. ,,; ( Prevent disaster by presetting this. ) else If tom. cur = cotn.num then begin beg in s := auto. ser + s + ,., + ext; ( Use new extension. ) cOm_err; if not Full Path(s) then exit; s :. dir + s; end; end: inc (corn,cur) ; do_rd_v.w: s := corn.ls[com. cur]; inc [auto .numl : ( Prepare for possible increments. ) if s = ,fpes, then end; beg in do- fpes: procedure do-rd_wv; exit; ( Ca 11 readwave procedure. ) end Var else if s = ,WS, then w : integer; begin begin if corn.cur . con. mm then if keypressed then ws_rd (WS-FN_DF ) case readkey of else ESC : ( Get out of read. ) ws_rd(com, ls[com. c”r + 1] ); begin UpdateAll; com_wr (‘Aborted. ‘, COLORWESS) ; exit; abort := true; end exit: else if s . ,x, then ( Literal filenmne mode, ) end; begin EXTENDED : readkey; ( Clean out buffer n case of extended key. ) do_rd_x; end; exit; if not FileExists (s) then end; begin com_wr (,Read waves. Press ESC to abort, ,, COLOFJ4ESS) ; cOm_wr (s + , does not exist- , COLORHL) ; dec(com. cur) : exzt; while [tom. c“r . tom. mxn) and (abort = false) do end; begin i f wv. num = MASWAVES then inc (tom, cur) ; begin s := corn,ls[com, cur]: com_wr (‘Memory full. V, COLORHL) ; if (s = ,to, ) then ( Flag that next word is a file “wnber for abort := true; us to read to; assumes auto. ser, auto. rum already set, ) exit; begxn end; if (tom.cur . cmn. nurn) then ( Must be a number Eollowi”g ‘to,) begin begin w := wv. num + 1; co~err; lf ReadWave (s, w, TRUE ) = FALSE then do_rd-exx t, com_wr (,Bad load on P + s, COLORHL) exit; else end; Initial izeWave (w) ; ( Change other parameters, update W.J,num, inc (tom, cur) ; etc ) s := corn,ls[com. cur]; end; valls, anum, dunnny) ; ( Get number. ) end; while (a”to, nwn .. anwn) and (abort . false) do do-rd-f n, procedure do_rd_x, end ( Literal read ) else begin begin whxle (corn cur . corn.num) and (abort = false) do xntellxgent_f llename (s, aser, anwn, extl ; ( Analyze filename, ) begxn ( Check that num IS ,. 0 ) Lnc(com cur) , lC anum . 0 then s= com ls[com curl, begin If not Full Pach (s) then tom-err, s = dlr . s, do_rd_exit, exit; ( Get permission before erasing. ) end; i f AreYouSure then auto. ser := aser; begin auto .num := anum; E.raseWnves: do.rd_f n; Updatesel; end; end; end; end; do_rd_exi t; end; procedure do_run (blank : integer) : ( Activates wave(s) for scanning. blank is a flag to erase existing procedure do_redo; data and reset scan number (blank just passed on to ScanIni t, which ( Erase most recent scan from a wave, decreases scan counter and re- does the actual initializing) . ) starts scan if off. Note waves maY be currently seaming. ) va r procedure check (w : integer) : i, j : integer; ( Internal function: check that wave satisfies criteria for scanning. begin ) wv_sel (1); var if corn.cur < corn.num then s : bufstring; begin begin inc (tom.cur) ; ( Put cursor on mystery word. ) str (w, s) ; cOm_err; s:=#Wave, +s +”; exit; with W. 1s [w]” do end; begin - ( Check if already seaming. ) sc_sel-Off; if scan .rnode a O then for i := 1 to wv. num do begin with wv.ls[il” do com_wr(s + ‘already scanning. ‘, COLORHL) ; if lsel = 1) and (uar. scan > O) then exit; begin end; SC. ls[screen] .sel := 1; ( Flag screen for update. ) ( Check if in addwaves mode. ) for j := 1 to Pax. pt do if (addwaves. mode . 1 ) and (addwaves. w = wv. cur) then I begin begin data[j] := data[jl - tn!p[jl; comwr (s + ,in add waves mode. ,, COLOSHL) ; tm[jl :n O; ( Erase tmp to prevent disastrous multiple exit; redos. ) end; end; ( Check that number of points is comwitible with MCS in ele ( Special handling for bs electron waves. ) scans. ) if (par. dt = dt-ELE) and (par. ele. bs. mode = 1) then if (par. dt = VrJ?LE) and (par. pt <> MCS_PT [MCS_PT_MIN] ) then begin begin par. ele. bs. tot := par. ele. bs. tot - par. ele. bs.last; com_wr(s + ‘pt not compatible. ‘, COLORHL); par. ele. bs.last := O; exit; end; end; dec(par. scan) ; ( If there is already data in wave make sure user wants to over- datasaved := O; write it. ) parsaved := O; if datasaved - 0 then end; begin wv_sel_Off; if corn_wr>aesc(s + ‘not saved. Overwrite’ ) < 1 then updatesel; begin end; co~wr (s + 8scan aborted. ,, COLORJJESS ); exit; procedure do_rm; end; ( Remove waves. ) com_wr(s + ‘overwriting. ‘, CoLOP.MESS); begin end; ( Get list of waves to erase. ) ScanInit (w, biank); ( Initialize scan. ) wv_sel (1); SC. ls[screen] .sel := 1; ( Tag screen for update afterward. ) ( -it if extra words after wave list. ) end; if corn.cur . tom. nun then begin tic (tom.cur) ; ( Fwt cursor on mystery word. ) var co-err; f : boolean; exit; i : integer; end; begin if wv. sel = 1 then if w.num = O then exxt, dw Integer, ( For val ) wv-sel {l); I integer: ( Holding val results ) If com cur . corn.num then ( Makes no sense if more words at end ) S, S2 : bufstring: ( Current word ) begin temp : integer; inc (tom. cur) ; ( Point to trouble word. ) begin cOm_err, if corn.cur = corn.num then exit: begin ( Print current screen. ) end; str(sc. cur, s); sc-sel_Of f ; cOm_wr (‘Current screen . e + s, COLOP.MESS) ; ynaesc_response := O; ( Initlallze response Var. ) exit; for x := 1 to wv. num do end; with wv. ls[il’ do sc_sel; if sel = 1 then if sc. sel = O then check( i ); exit: ( Nothing to do. ) wv_sel_Of f, if corn.cur = corn.num then ( Assume just switch screens. Take first screen number from list. ) ( Check bg wave status if bs waves present. ) begin i f bs_on then for i := 1 to sc. num do begin if sc. ls[i]. sel = 1 then ( Check range on background wave. ) begin if (_bs. bg . 1) or (_bs. bi! ~ wv. num) then EraseCursor (SC. curl ; ( Erase old cursor first. ) begxn temp := sc. cur; com_wr (-Background wave out o f range. ‘, COLORHL ); sc. cur := i; exxt; str{temp, s); end; str(sc, cur, s): ( Check datatype of kg wave. ) DrawTitle (temp) : [ Chan9e colors of old and new screen titles. ) with wv. ls[_bs. bgl A do DrawTitle (SC, cur) : If (par. dt .> dt-ELE) or lpar, ele. bs. mode = O) then DrawCursor (SC. cur) ; ( Draw new cursor. ) begin exit; co~wr_wv(_bs, bg, ‘M not compatible. s, COLORHL) ; end; exit; end; end; Lnc (tom.cur) ; ( Fxgure out if any waves scanning: set scanwave to O if not. ) s := corn,ls[com, cur]; f := false; if s = ,IMY, then for i := 1 to wv. num do ( Report overall screen boundaries and exit. ) if wv. ls[il”. scan. mode s O then begin f := true; Str(sc. bdy[l] ,x, S2); if f = false then s := ,Sc. bdy x , + S2; scanwave := O; str(sc. bdy[2] .x, s2); S:. s+, f + S2; ( If not in middle of a bs scan, reset bs engine to beginning str(sc. kdy[l]. y, 52): (_bs. fg s 0), ) s:=s+, y,+s2; with w, 1s [scanwavel - do str(sc. bdy[2]. y, 52); If (scanwave = O) or (par. scan = O) or l(par, dt = dt_ELE) and S:. S+, ,+S2; (par .ele. bs. mode = O) ) then com_wr (s , COLOIU4ESS ); -bs. fg := O; exit; end: end else if s = ,fu - then ( Full mode ) mcs new := 1; ( Flag to send all MCS commands the first time ) begin for i := 1 to sc. num do ( Walt for scan routxne to update screen. ) if sc. ls[l], sel . 1 then ( Update affected screens. ) FullView(l) ; UpdateV1tals; end for L .= 1 to sc. num do else If s . ,n””, then ( Report total number of screens ) Lf sc ls[il sel = 1 then beg In update(i) , str(sc num, s) , sc-sel-of f, ) co~wr (,Number of screens . 0 + s, COLORMESS) ; end, exxc, end procedure do-se, else if s = ‘rf, then ( Refresh ) ( Screen commands ) begn var UpdateVitals, bdy bdy-tyl>e ( Temp screen llmlts var~able ) for 1 = 1 to sc num do if sc. ls[i]. sel = 1 then s:. s+4y#+s2 ; N Update(i) ; str(gr. bdy[2]. y, s2); m end S:= S+, ,+S2; m else if s = ‘XIII’then ( Remove screens. ) co~wr (s, COLXJRMESS ); begin end; if com_wr_yn( ‘Are You sure’ ) = O then exit: exit; end; for i :‘s sc. num downto 1 do ( Check there are exactly four more entries. ) with sc.ls[i] do if corn.cur + 4 + corn.num then if (sel = 1) and (se.num > 1) then ( Cannot kill only screen. ) begin begin co~err; if i c sc. num then exit; for temp := i + 1 to sc. num do ( Move down other screens. ) end; sc.ls[temp - 11 := sc.ls[templ; ( Read in values. ) dec(sc. num); val(com. ls[com. cur + 1] , bdy[l] .x, dummy) ; if sc. cur >= i then ( Move pointer to correct screen. ) val(com. ls[com. cur + 21, bdY[21 .x, dummy); dec(sc. cur); val(com.ls[com. cur + 31, bdy[ll .Y, dummy) ; if sc. cur = O then ( Keep from disappearing. ) val(com.ls[com. cur + 41, bdY[21 .Y, dunrny); sc. cur := 1; ( Check that values are all valid. ) for temp := 1 to WV. nun do ( Move waves to correct screen. ) if (bdy[l]. x c sc. bdy[ll .x) or (lxiy[21.x > sc. bdy[21 .x) or (bdy[l]. y with wv.ls[templ” do c sc. bdy[ll. y) or (bdy[2]. y > sc. bdY[21. y) or (Lxiy[l].x >= begin IXIY[2].X) or (Lxfy[ll.y >= bdY[21. Y) them-.. if screen >= i then begin dec (screen) ; comwr( ,Bad screen limits. ‘, COLOEHL) ; if screen = O then exit; screen := 1; end; end; ( Resize screens and update everything. ) if osc. scr s= i then ( Move osc to correct screen. ) for i := 1 to sc. num do dec(osc. scr) ; with sc.ls[i] do if osc. scr . 0 then if sel = 1 then Osc. scr := 1; begin end; gr. bdy := ixiy; ( Copy temp. bdy to real thing. ) UpdateAll; ( Refresh screen. ) sc_resize(i) ; exit; end; end UpdateAll; else if s = ‘5s’ then end begin else if s = ‘ti’ then ( Title. ) if sc. sel = 1 then begin for i := 1 to sc. num do if corn.cur = corn.num then if sc.ls[i]. sel = 1 then ( Print titles. ) begin begin do-sc_ss (i ); for i := 1 to sc. num do exit; with sc.ls[i] do end; if sel = 1 then co~err; begin exit; str(i, s); end s := ,Screen , +s +,,; else if s = ‘SZ’ then if ti. on = 1 then begin COn’LWrls + ‘title . , + ti. s, C0L0iU4Ess) if corn.cur = corn.num then else ( Report current screen sizes. ) com_wr(, title off. ,, COL13RMESS) ; begin end; for i := 1 to sc. num do exit; with sc.ls[i] do end; if sel = 1 then inc (tom. cur) ; begin s := corn.ls[com. cur] ; str (i, 52); if (S = ‘on’) or (s = ,off, ) then s := ,Screen ‘ + s2; begin ( Special: turn on/off titles. 1 str(gr. bdy[l) .x, s2); if s = ,on’ then S:= S+ ’X’+S2; te~ := 1 str(gr. bdy[21 .x. 521; else S:=s+ 4,+s2; temp :. 0; str(gr. bdy[ll. Y# S2J; UpdateVitals; for x = 1 to sc. num do temQ : bufstring: wut.h SC ls [1] do begin if sel . 1 then If corn.cur + 2 sc_t.fAX) begin then ( -1 is to account for current screen, which is resized. ) for i :. 1 to sc. nuro do beg in with sc. ls [i] do str(sc_MAX, temp) : if sel = 1 then com_wr [‘Maximum screens . 0 + temp, COLORHL) ; begin exit; if ti. on = 1 then end; begin scr := w: ti. s := s; stepx := (se. ls[wl.9r. bdY[21. x - sc. ls[wl. gr. bdy[ll .x) div numx; DrawScreen (i ); stepy := (se. ls[wl. gr. bdy[21. y - sc. ls[wl. gr. bdy[ll. y) div numy: end foriy:=Otonumy-ldo else forix:. Otonumx-ldo begin begin str (i, s2); with sc. ls[scrl .gr do comwr( ,Screen e + S2 + o title off !‘, COLORHL) ; begin end: bdy[ll. x := sc. ls[wl. gr. bdy[l], x + ix . stepx; end; bdy[2]. x := bdy[l]. x + stepx: DrawVltals; bdy[l]. y := sc, ls[w]. gr. bdy[l], y + iy . stepy; end bdy[2]. y := bdy[l]. y + stepy; end end: else If s . ‘x, then if scr s sc. num then begxn sc_init(scr) ; ( Only initialize new screens. ) temp := tom, cur; sc_resize (scr) ; for i .= 1 to sc. num do if scr . w then ,, if sc. ls[i]. sel = 1 then scr := sc. num +1 ,., begin else do-x(l); inc (scr) : corn.cur :. temp: end; end; UpdateVitals; ‘, end Update (w) ; else if s = #y, then w := sc. num + 1: beg in inc(sc. num, numx . numy - 1); temp := corn.cur; for w := w to sc. num do for x :. 1 to sc. num do Update(w) ; Lf sc. ls[ll. sel = 1 then { if sc. cur s sc. num then begin sc. cur := 1: ( If prior current screen was erased, reset current screen do_y( x), to 1. ) con cur .. temp; ( for w := 1 to wv. num do ( Reassign waves to legitimate screen. ) end; ( if wv, ls(wl~. screen > sc. num then end w.ls[wl’. screen :. sc. cur; else UpdateAll; ) cOm_err, end; end; procedure do_sech, procedure do_sc-ss(w xnteger) ; ( If cursor on COR wave, creates new COR wave with a sech-2 fit of the ( SPllt screen w into sunscreens, ) current wave, based on vertxcal lxmlts, center and fwhm ) Var var dumny ~nteger, ( For val ) 1 integer, 1x, ly lnceger, ( Generic counters ) yscale real, numx, numy ~nteger, ( # of screens Ln x & y dlrectxons ) begin stepx, stepy lnte9Cr. ( Step size xn each d~rect~cm ) if (WV nmn . 0] or (WV lSIWV c“r]fi pat’ dt .> DT_COR) or IW mm = Scr lnt.=ger. ( Screen counter ) maxwaves 1 then exit; if com. cur = com. num then N info-edges (%v.cur, 1) ; ( Calculate old wave’s center & fwhm. ) begin ccl ysccile := in fo_ht [wv.cur) ; ( Calculate height to scale by. ) com_wr (NO_WIDIli, COLORHL) ; lx CreateWave(O, wv. cur); ( Create new wave. ) exit; for i := 1 to wv.ls[wv.curia.par.pt_gl do end; wv.ls[wv. curl” .data[i] :- sech_sq(ptou (wv.cur, i, sc. ls[sc. curl inc (corn.cur) ;

.gr .xaxismode) - info. ctr, info. fwhm) ● Yscale; s :9 corn.ls[com. curl ; in fO_wr(wv. cur, info. fwhm, ‘fwhm’ , 1) ; if s = ,en, then Updatevitals; begin Updatelsc cur) ; en := true; end; if corn.cur . corn.num then begin procedure do_sh: comwr (NO_WIDTW, COI.4XNL ); ( Select type of wave information to show. ) exit; Var end; i : integer; inc (corn.cur) ; s : bufstring; s := corn.ls[com. curl ; sh_type : integer; end; begin ( Read width. ) if corn.cur = corn.num then val(s, r, dtumny); begin if r <= O then cOm_err; begin exit; com_wr (‘Width must be positive! ‘, COLOMiLl ; end; exit; inc(com. cur) ; end; s := com.ls[com. cur] ; if en and (r z 1) then sh_type := O; begin for i := 1 to wv-sh_NAX do com_wr (,Width cannot exceed 1 eV !‘, COLORWL) ; if s = wv_sb_NFd.fE[i 1 then exit: sh_type := i; end; if sh_type = O then w._sel(l)— : ( Read list. ) begin sc_sel-Of f; co~err; if wv. sel = 1 then exit; begin end; for i := 1 to wv. num do w_sel (1) ; with wv.ls[i]” do for i := 1 to wv. num do if sel = 1 then with wv.ls[il” do begin if sel = 1 then s :- ,Wave , + makes tringint (i) + , ,; begin if (scan .mode > O) or ((addwaves. mode = 1) and (addwaves. w = if (sh_type = wv_sb_DLY ) and (par. dt <> ~_ELE) then i )) then co~wr (‘Wave ‘ + makes tringint (i ) + ‘ cannot shOw DLy. ‘J com_wr (s + ,active ! No smooth. ,, COLORNL) COLORIfL ) else if en and (par. dt e. dt_ELE) then else com_wr(s + ,not SLE datatypel No smooth. ‘, COLORWL) par. sh := sb_type; else end; begin wv-sel_Off; com_wr (s + ,smoothing. ..‘, COS.0Rf4ESS); DrawWaVeData; if en then end; SmoothEnergy (i, r) else procedure do_sm; SmoothTime (i, r) ; ( smooth waves. ) datasaved := O; const SC. ls[screen] .sel := 1; ( Mark screen for update. ) NO_WIOllf . 8No width given. See sm in help menu. ‘; end; var end; dummy : integer; ( For val. ) wv_sel-Of f; en : boolean: ( Flag to save energy file (trUe) or regular (false) . ) UpdateVitals; r : real; { Width. ) for i := 1 to sc. num do ( Update affected screens. ) s : bufstring; if sc. ls[i]. sel . 1 then i : integer; ( Wave counter. ) Update (i) ; begin sc_sel_off; en := false; end; ( See if at end of command line; if so, signal error [no width) . ) end: begin procedure do_ss; wv_sel (l) ; ( Create split screen See also sc ss, ) sc_sel_Of f; va r for i := 1 to wv. num do dwrmy : integer; ( For val. ) with !+v,ls[i]’ do 1x, iy : integer; ( Generic counters. ) if sel = 1 then IWILX, n~ : integer; ( # of screens in x & Y dxrectxons. ) begin .stepx, stepy : integer; ( Step size in each direction. ) ScanStop (i) ; scr : integer; ( Screen counter. ) SC. Is[screen] .sel := 1; cemp : bufstring: end: w : integer; ( Wave counter. ) wv-sel_Of f; begin Updatesel; if corn.cur + 2 c> corn.num then end; begin cOm_err; procedure do-s ts; exit; ( Print or change STS (shot-to-shot) mode statw. ) end; inc (com. cur ): function do_sts_err : boolean: vallcom. ls[com. cur 1, numx, dummy); ( Print error message if waves scanning. ) inc (com. cur ); beg in val[com .ls[com. curl , numy, dununy): if bs_on and scanning (dt-ele) then if (numx < 1) or (numy . 1) or (nunw “ nurny s sc_MAX) then begin begin com_wr (,bs ele waves active ! No change, ,, COLORHL) ; str(sc_MAX, templ ; do_sts_err :. true: co~wr (‘Maximum screens = , + temp, COLORHL) ; end exit; else end; do_sts_err := false; scr :. 1; end: stepx := (se. bdY[21. x - sc. bdy[ll .x) div numx; stepy := (sc.lxlY[21. Y - sc. bdy[ll. y) div numy, va r for Iy := O to numy - 1 do dummy : integer; for ix :. Otonumx-ldo i : integer; begin r : real; with sc. ls[scrl .gr do s : bufstrxng: begin begin bdY[ll. x := sc. bdy[ll. x + ix . stepx; if lcom. cur . corn,nun) and {not do_sts_errl then lxlY[21.x := bdy[ll. x + stepx; _bs, sts ,= 1 bdY[ll. Y := Sc. bdy[ll, y + iy . stepy; else bdy[2]. y := bdy[l]. y + stepy; begin end; inc (corn.cur) ; If scr P sc. num then s := corn.ls[com, cur] ; sc_init(scr) , ( Only initialize new screens. ) if s = ‘?$ then ( com_wr (,about to SC-RESIZE’ , COLORDEBUG ); begin if readkey = extended then readkey; ) cOm_wr (,sts , + makes tringint (-bs. sts ), COLORNESS) ; sc_resize (scr) ; exit; inc(scr) ; end end; else if s = ,all, then sc. num :. nunw . numy, begin Lf sc. cur s sc, num then cOm_wr( ,Sts $ + makes tringint (-bs, sts) , COLORMESS) ; sc, c”r := 1; ( If prior current screen was erased, reset current screen com_wr (,sts blank f + makes trmgxnt (_bs. sts_blank) , COL4MU4ESS) ; to 1, ) corn_wr (,sts blank2 , + makes trlngxnt (_bs, sts_blank2 ), for w :. 1 to wv num do ( Reassign waves to legitimate screen. ) COLORMESS ); If W,l SIW]” screen > sc. num then com_wr( ,sts ch f + chr(ord( ,0, ) + -bs sts-ch) , COLLMU.IESS); wv ls[w]’. screen := sc. cur: cOm_wr( ,sts fac $ + makes trxng(-bs. sts_fac, VALNAX, VALDEC1 Lf osc scr > sc num then ( Reassign osc screen ) + t V/div, , COLOPJ4ESS) ; osc, scr = sc cur, cOm_wr (,Press any key to continue COWRHL) , UpdateAll, readkey; end , com_wr( ‘sts vert , + makes trlng(-bs sts-vext, VALNAX, VALDEC) + 9 Vldlv 0, COLORNESS) , procedure do-stop, com-wr( !sts tog , + chr (ord( ,0< 1 + _bs sts-tog) , COLORMESS) , ( Stop scanning one or more waves ) end Vdr else if s = blank, then 1 integer, begin if corn.cur = corn.num then comerr; begin exit; cOm_err; end; exit; inc (corn.cur) ; end; s :- com.ls[com. cur] ; inc (tom. cur) ; if s = ‘?’ then s := corn.ls[com. cur] ; cotuwr (‘sts f4c e + makes tring(_bs. sts_fac, VALMAX, VALDEC) if s = ‘?, then + ~ V/div7 , COLOiOIESS ) com_wr( ,sts blank ‘ + makestringint (_bs. sts_blank) , COLOSMESS) else else begin beiain val (s, r, i); val (s, i, dummy); if r c= O then if (i > O) and (i < NAXPOINTS) then co~err _bs .sts_blank := i else else _bs. sts_fac := r; cOm_err; end; end; end end else if s = ‘vert’ then else if s = ‘blank2 1 then begin begin if corn.cur = tom. nun then if corn.cur = corn.num then begin begin com_err; cOrn_err; exit; exit; end; end; inc (tom. cur) ; inc (tom. cur) ; s := corn.ls[com. curl; s := corn.ls[com. cur] ; if s = 8?8 then if s a ,?, then co~wr( ,sts vert ‘ + makes tring(~s. sts_vert, VALUAX, com_wr (‘sts blank2 ‘ + makestringint L@. stsJlank2 )# VALDEC) + ‘ V/div’, COMI04ESS ) COILXU4ESS ) else else begin begin val (s, r, i); val(s, i, dummy); for i :. TES_VPESOIV_NIN to TES_VPESDIV_MAX do if (i =. 0) and (i . . ILAXPOINTS) then if r <= TEK_VPESDIV [i 1 then _bs. sts_blank2 := i begin else _bs. sts-vert := TES_VPESDIV [i 1; cOm_e rr; com_wr( ,sts vert - + makes tring (_bs. sts_vert, VALMAS, end; VALDEC ) + ‘ V/div’, COLOR14ESS ); end exit; else if s = ‘ch’ then end; begin com.-err; if corn.cur = corn.num then end; begin end cOm_err; else if s = ‘tog’ then exit; begin end; if corn.cur = corn.num then inc(com. cur) : begin s := corn.ls[com. curl : cOm_err: if s = ,?, then exit; COUl_WZ (‘StS ch , + chr(ord(, O, ) + _bs. sts_ch) , COLCISMESSI end; . else inc(com. cur) ; begin s :. corn.ls[com. cur] ; i := ord(s[lll - ord( ’O’); if s = ,7, then if (i , O) and (i c= MAS_CS_14AX) then comwr( ‘sts tog ‘ + chr(ord( ‘O’ ) + _bs. sts-tog), COI.OiwfESS) _bs. sts_ch := i else else begin cOm_err; i := ord(s[l]) - ord(, o,); end; if (i = O) or (i = 1) then end -bs. sts_tog := i else if s = ‘fat’ then else begin cOm_err; if corn.cur = corn.num then end; begin end else if not do_sts_err then beg m begin If wv. sel = 1 then If (s . ‘O, ) or (s . ,off, ) then wv ls[v. w.cur]‘.sel := O; ( Deselect wave selected by wv_sel ) _bs. sts := O If corn.cur = corn.num then else if (s = ,1, ) or (s = ‘on, ) then ws_sv (WS_FN_DF ) _bs. sts := 1 else else ws_sv(cOm. ls[cOm. cur + 1]): begin exit; cOm_err: end exit: else end; begin end; co~err; end; exit; DrawWave Data; end; end: end else ( Wormal format. ) procedure do_sv; begin ( Save waves in normal or energy format; also branch ou’t for WS, fpes ynaesc_respOnse :. 0: saves. ) if wv. sel = 1 the” Va r for w :. 1 to wv. num do s : bufstring: if wv. ls[w]a. sel = 1 then w : integer; SaveWave (w) ; begin end; Wv-sel (l) ; W-sel-of f: if corn.cur . corn.num then DrawWaveData; ( Update waves with save symbol. ) begin end; inc (tom. cur) : s := corn.ls[com. curl; procedure do_tO; if s = ‘en, then ( Set default tO for default or active waves. ) begin ( Save energy format. ) var wv-Sel_Of f: ( Erase any erroneous waves from first wv_sel, ) i : integer; wv-sel [l) ; s : bufstring: ynaesc_respOnse = O; Pos : real; If w--?.sel = 1 then for w := 1 to !+v,num do procedure do_tO_cha”ge (“ : integer; pos : real ); if wv. ls[wl”. sel = 1 then ( Change wave W,S tO to pos, or print if pos < 0. ) Save Energy (w) ; beg in end with WV, lS(W]- do else if s = ,fpes’ then begin begin case par .dt of if corn.cur . com num then Dl_COR : begxn if POS . 0 then ( Flag to print current, ) com_wr (‘Must supply a fllename to save to 8, COLORHL) ; pos := par. cOr, ts, tO exit; else end; begin inc(com. cur) ; par. cOr. ts. tO := POS; fpes_sv(cOm. ls[com. curl ): UpdateCORLimits (9par) ; ( Change start & stop. ) exit, end; end lYT_ELE : else if s . ‘time, then ( time-space version of data, wxthmt If POS . 0 then ( Flag to print current, ) headers. ) POS := par, ele. ts. tO begin else wv_sel_of f, ( Erase any erroneous waves from flrst Wv-sel. ) begin W-sel (l) ; par. ele. ts, tO :. pm; ynaesc-response = 0, ( Update other parameters, ) if wv. sel = 1 then par. ele. ts Pos := par. ele. ts, tO + par, ele. dly . for w =ltownumdo HALFSPEEDOFLIGHT; lf w ls[w]~ sel = 1 then roundoff(par. ele ts, pos, ts step), SaveTNne (WI llmlt (par .s1.sts pos, STAGSNIN, STAGENAXl , end par ele dly . (par ele. ts POS - par ele ts tO) I else if s = ,Ws, then ( Special code save worksheet with standard HALFSPEECOFLIGHT; filename or user-supplied name Note that directory dir does not end, w w ~PPIY to worksheet filename ) else comwr (‘wave , + rnakestringint (w) + ‘ not COR or ELE WaVe! ‘, exit; COLORRL ); end end; else if s = ,CC, then ( Change/print cc default tO. ) ( Print out position if correct wave type, mark screen for beoin update. ) do_tO_get; if (par. dt = OT-COR) or (par .dt = oT_ELE) then if POS >= O then ( POS < 0 is flag to display current. ) begin to. cc := pos; str(pos 1 POW%S : 0 : 0, s); str(tO. cc / POWS : 0 : 0, s); COKWZ (= O then ( Pos < 0 is flag to display current. ) procedure do_tO_get; begin ( Read in tO value. ) pardf [dt_CORl .cor. ts. tO := uos; var UpdateCORLimits (‘Jpardf[dt_CORl ); ( Change start & stop. ) dummy : integer; end; s : bufstring; str(pardf [dt-CORl .cor. ts. tO / POWIS : 0 : 0, s) ; begin cOCwr(, tO cor ‘ + s + ,urn,, COLORMESS) ; if corn.cur = corn.num then exit; begin end pos := ts.pos; else if s = ‘ele S then ( Change/print ele default tO. ) exit; begin end; do_tO-get; inc (tom.cur) ; if Pos >. 0 then ( Pos . 0 is flag to display current. ) s := corn.ls[com. curl : with uardf [dt_ELEl do if 5 = ‘?’ then begin- – pos := -1 ele. ts. tO := POS; else ( Update other parameters. ) begin ele. ts. pos := ele. ts.tO + ele. dly ● HALFSPEEEOPLIGHT: val (s, POS, dummy] ; roundoff (ele. ts.pos, ts. step) ;

pos := pos ● Powrs; limit (ele. ts. POS, STAGSMIN, STAGSMAX) ; limit (Pos, STAG SWIN, STAGSMAX) ; ele. dly :. (ele. ts. pos - ele. ts. tO) I HALFSPEECOFLIGHT; end; end; end; str(pardf [dt_ELE] .ele. ts. tO / POWTS : 0 : 0, s) ; co~wr(’tO ele ‘ + s + ‘ urn’, COL01U4ESS); begin exit; sc_sel_Of f; end; if corn.cur . corn.nun then begin if s . ,cur, then ( Change waves to current position. ) if wv. num = O then pos := ts.pos begin else if s = ‘?‘ then { Print current position of waves. 1 co~err; pos := -1 exit; else ( Assume entry is a number. ) end; begin sc.ls[wv.ls [wv.curl~. screenl .sel :- 1; dec [tom.cur) ; do_tO_change (WV.cur, ts. Pos ); do_tO_ge t; UpdateSel; end; exit; end; wv-sel (1) ; ( Get list of waves. )

inc (corn.cur) ; ( Now assign POS to appropriate waves. ) s := corn.ls[com. curl ; for i := 1 to wv. num do if wv. ls[i]~ .sel = 1 then if s = ‘at, then ( Change/print ac default to. ) do-t O-change (i, Pos ); beain do_tO-get: ( Update screen. ) if POS >. 0 then ( POS < 0 is flag to display current. ) wv-sel-of f; to. ac := Pos: UpdateSel; str(tO. ac / POW1’S : 0 : 0. s); end: com_wr(+tO ac ‘ + s + ‘ urn’, CoLo~ESs): procedure do_ts, end; ( Handle translation stage commands. ) inc (corn.cur) : cons t s := corn.ls[com. cur]; LF . #lO; ( Cotrpller seems to need th>s declaration here rather than in the write (COM2, ACK) ; Keys unit. ) delay (ACKDELAY ); var ( Convert linefeed symbal ‘\ ‘ to real line feed code. ) del : longmt; for w := 1 to length(s) do dummy : integer; If S[W] . ,\f then exit flag : boolean; S[W] := LF; r : real; ( See if *CA or non-#CA comnd. ) s, 52 : bufstrmg; if s[l] = ,#- then w : integer: write (COM2, s + LF) begin else if tom. cur = corn.num then write (COM2, ‘#CA, + S + LF): begxn ( Print current stage position. ) end strlts. pos / PONTS : 0 : VALDECTS, s) ; else if s = ohome V then com_wr( ‘Posxtxon , + s + , urn,, COLDBXESS) ; begin exit; write (COM2, ACK) ; end; delay (ACKDELAY ); inc (tom. cur) ; write (C0M2, ,#CAKM, + LF) ; s := corn.ls[com. curl: Comwr (cOm_wr_MOVINGsTAGE, COLORHL ); if s = ,acc, then if readkey . EKTENDEO then begin readkey; if corn.cur = corn,num then write (COM2, ACK) ; begin delay (ACKDELAY ); cOm_wr (,ts acc , + makes trxngint Its, ace) , COLOF.NESS) ; write (COM2, ,#CAABSL, + LF); exit; ts. pos := o; end; end inc (corn.cur) ; else if s = ,inite then val[com. ls[com curl, ts.ace, dummy); begin if ts. acc .= O then ( Send setup commands. ) ts. acc := TS_ACC-DF; com_wr( 9Initializing stage. 8, COLORNESS) ; write (COM2, ACK) ; write (COM2, #3) ; delay (ACKDEL4Y ); DELAY (1OOO) ; write (COM2, ,#FCAB6, + LF . ,B, + makestringi”t(ts.ace) + LF): write (COM2, #32); ts. wait. int := 100 . ts. vel div ts.ace; DELAY (1OOO); if ts, wait. int < TINT-DF then write (COM2, #301 ; ts. wait. int := TINT_DF; DELAY (1OOO); end write (COM2, ACK) : else if s = ,ack, then DELAY (ACKDELAY ); begin ( Home stage. ) write (COf42. ACK) ; ( cOm_wr (cOm_wr_MOvlNGsTAGE, COLORKL ): delay (ACKDELAY ), write (COM2, ,#CAHM, + LF); end 1 f readkey = EXTBNDED then else if s = ,ampl, then ( Print/change amplitude of wob function, ) readkey; begin write (COM2, ACK) ; if corn.cur = tom. num then ( Set absolute mode. ) beg in write (COM2, ,#CAABSL, + LF) : com_wr (,ts web. ampl o + makes tring(ts, web, mnpl I POW’S, delay (1000) ; VALMAX, VALDEC ) + 8 um. ,, COLORNESS ); write (COM2, ACK) ; exit; ( Set current acceleration and velocity. ) end; delay (ACKDELAY ); Inc (corn.cur) ; write (COM2, ,UFCAB6, + LF + ,Br + makes tringlnt(ts ,acc) + LF) ; val(com ls[com. cur], ts web. ampl, dummy] delay 1ACKDELAY ); tS web, ampl = ts web. arnpl - POWTS; wr1te(COM2, ACK); MakeLookup: ( Update lookup table ) delay (ACKDELAY ); end write (COM2 , ,#FCAB7, + LF + ‘B, + makes trmgmtlts vel) + LFj ; else if s = ,com, then ( delay (ACKDELAY }; begin wrlte(COM2, ACK) ; ) Lf com c“r = com num t!>en ts DOS = o; begin ( Must be a conunand after ‘coma ) end com_err, elSe lf s = ,Xnt, then ( Mlnmmm time constant ) exit, begin if tom. cur = corn.num then val(com. ls[com. curl, ts. wait .sl, dunmy): co~wr( ,ts. wait. int , + makes tringint (ts. wait. int ), COLOI04ESS) if ts. wait. sl <. 0 then else ts. wait. S1 := TSL-DF; begin end; inc [tom.cur) ; val(com. ls[com. curl, ts. wait. int, d-l; else if s = ,step, then ( Stepsize. ) if ts. wait. int . 0 then begin ts. wait. int := TINT_DF; if corn.cur = corn.num then end; begin end comwr(, ts. step # + makes tring (ts. step / POWTS, VALMAKTS, else if s = ‘per’ then ( Print/change period of wob function. ) VALDECTS) + ‘ um’ , COSXNIMESS ); begin exit; if corn.cur . corn.num then end; begin inc(com. cur) ; com_wr (‘ts. web. per ‘ + nkakestring (ts.web. per / PDWTS, val[com.ls [corn.curl , ts. step, dummy) ;

VALMAK, VALDEC) + ‘ um. ‘, COLORMESS) ; ts. step := ts. step ● POWFS; exit; if ts. step c TS_STSPJiIN then end; ts. step := TS_STSPJfIN; inc (corn.cur) ; write (COM2, ACK) ; val(com. ls[com. curl , ts. web. per, dummy) ; delay (ACKDSLAY) ; ts. web. per := ts. web. per ● POWTS; writ: (COM2, ‘#CAPPJ.f:203=’ + makestringint (round (TS_RES-STEP / MakeLookup; ( Update lookup table. ) ts. step) ) + LF) ; end end else if s = ,ph’ then ( Print/change phase of wob function. ) ( else if s s ‘step, then begin begin if COM. cur = corn.num then if corn.cur . corn.num then begin begin ( Print current step. ) comwr( ‘ts. web. ph t + makestring (ts.web. ph, ( str(move. step / PO’ATS : 0 : 0, s); Vti, VALDEC) , COLORMESS) ; com_wr( ’Step = ‘ + s + ‘ urn’, COLOPJ4ESS); exit; exit; end; end; inc (corn.cur) ; ( Read new step. ) val(com. ls[com. curl, ts. web. ph, d-); ( inc(con. cur) ; ts. web. ph := frac(l + frac(ts. web. ph) ); ( KeeP n~er val(com. ls[com. cur] , move. step, dummy] ; between O and 1 only. ) move. step := move. step * POWTS; ( No need to call MakeLgokup -- phase not used there. ) roundoff (move .step, ts. step) ; end limit (move .step, ts. step, STAGR4AK) ; else if s = ‘rd’ then end ) begin else if s = otog, then ( Toggle. ) ( Reopen file for reading. ) begin close (CON2); ( Use current values. ) assign (COM2, ‘COM2’ ); if corn.cur . corn.ngrn then reset (CON2 ); begin ( Read characters until user hits CR. ) do_ts_tog; COIILW (‘cress any key to read next char, Or R~ tO exit.’, exit; COLCN04ESS ); end; while readkey c> CR do inc (corn.cur) ; begin s :- corn.ls[com. cur] ; read(COM2, s[l I); if s = ‘ally, then corq-wr (,ts char = , + makes tringint (ord(s [1] )), COLORNESS) ; begin ( Print or change delay time. ) end; do_t s_dly ; ( Reopen file for writing again. ) exit: close (CON2) ; end; assign (COM2, ‘COM2’ ): ( Check that at least one more entry in command (must provide both rewrite (COM2 ); positions !) ) end if corn.cur = corn.nurn then else if s = ‘s1’ then ( Slope time constant. ) begin begin cocerr; if corn.cur = corn.num then exit; cOm_vr(-ts. wait. sl , + n!akestringint (ts. wait .s1) , COLJ3RMSSSI end; else ( Read positions. ) begin val (s, move .start, dummy) ; inc (corn.cur) ; move. start := move .start ● PDNTS; roundoff (move .start, ts. step) : cOm_wr(e Pos e + s + , Step , + S2 + , u!n,, COLOFu.tESS); limit (move start, STAGEMIN , STAGEMAS ); case readkey of inc (corn.cur ); EXTSNDED : val(com, ls[com curl , move stop, dummy) ; case readkey of move. stop := move. stop ‘ POWTS; XARRONUP : ,,,, roundof f(move. stop, ts. step) ; begin ... 1imi t (move. s top, STAGEMIN, STAGSWAK) ; move. step := move. step . 2; ,. ( Recalculate stage delay. ) If move. step > STAGSMAX then r := tS. POs; ( Save current stage position, ) move. step :. STAGEWAX; ts. pos := move, start: end; move. wait :. 10 . abs(StageDelay (move .stop) ); ( Ignore user input XARROkmOWN: ( rmm arrow ) flag. ) lf move. step > ts. step then ts. pos := r; ( Restore. ) move .step := int( (move, step I ts. stepl ) , ts. step / 2, ( Check if ,dly, occurs next (can also change delay) ) KARRONLEFT: ( Left arrow ) if corn.cur . corn.num then if ts. POS - move. step , = STAGENIN then begin StageMoveWait (ts .POS - move, step) : inc (corn.cur) ; XARROWRIGXT: ( Right arrow ) if corn,ls[com. cur] = ,dly, then if ts .POS + move. step .= STAGSMAK the” do_ts_dly ; StageMoveWait (ts.pos + move. step) : end; end; ( Extended keys. ) ....’ ( Do toggle. ) ESC: ( Exit, ) dolts-tog : begin ~, ,“,.i end write (COM2, ACK) ; ,, else if s = ,vel, then exit flag := TRUE; begin end; if corn.cur = corn.num then end; begin until exit flag . TRUE; cOm_wr (,ts vel o + makes trngint(ts. vel) , CO~l?14ESS) ; end exit; else if s = ‘wobr then ( Print all 3 parameters, ) end; begin inc (corn.cur) ; cOm_wr ($ts, web. au@ , + makes tring (ts ,wob, .wnpl I POW1’S, val(com. ls[com. cur ], ts, vel, dummy); VALMiW, VALDEC) + , um. $, COLOF.MESS) ; if ts. vel <. 0 then com_wr (ots, web. per 8 + makes tring (ts, web. per I POWTS, ts. ve 1 :. TS_VEL_DF VALMAX, VALDEC) + 0 um, ‘8 COWF.MESS); else if Cs. vel >= TS_VEL_MAX then co~wr( ,ts, web. ph , + makes tring(ts. web, ph, ts .vel = TS_VEL_f4AX; VALUAX , VALDEC ), COLORNESS ) ; u write (COM2, ACK) ; end delay (ACKDELAY ); else if s = ,x, then ( Disengage. ) write (COM2, ‘#FCAB7, + LF + ,B, + makes tringmt(ts, vel) + LF) ; begin ts. wait, sl :. 100000000 div ts. vel; write (COM2, ACK) ; end delay (ACKDEUY ); else if s = ,walk, then write (COM2, ~gu, + LF); begin end ( Make sure not interfering with active waves. ) else if scanning (dt_COR) or scannxng (dt_ELE) begin ( Move stage. ) then val (s, r, dummy); begin r := r . POWS; if com_wr_yn (oStage xn use. Stop active waves o) = O then roundoff {r, ts, step) ; exit if (r . STAGEMIN) or (r > STAGEMAX) then else begin begin cOm_err; for w := 1 to ww, num do exit: with W.ls [w]- do end; if (scan mode > O) and (par dt .> dt-POW) then ( Check that no ts-dependent waves scanning ) ScanStop (w) ; >f scanning (dt_COR) or scannln.g (dt-ELE) UpdateAll, then end, beg in end; if com_wr_y” (,Stage xn use StoP active waves, ) = O the” exltflag = FALSE, exit ( Man 100D ) else repeat begin str[ts DOS f POW7Y O VALDECTS S ) for w .ltowvnumdo str[muvi step 1 PO!+TS O VALDECTS S~ 1 with w ls[w]~ do lf lscan. mode > O) and (par. dt <> dt_POW) then ( Remove character from buffer: ) ScanStop (w) ; if readkey E SSTSWOED then updateAll; readke y; end: end; end; StageMoveWait (r) ; procedure do_tw; end; ( ?weak mode: A11ow fast MCS scanning to find weak electron signals. ) end; var dummy : integer; procedure do_ts-dly; p : real; ( Handle ally. ) s : buf string; var t : longint; ( Timekeeping variable. ) dummy : integer: begin s : bufstring; if corn.cur < corn.num then begin begin if corn.cur = corn.num then inc (corn.cur); begin ( Print current delay. ) 5 := corn.ls[com. cur] ; str (round (move .wait), s) ; P := power (tw. timeperpt ); com_wr( ‘move .wait = ‘ + s + ‘ MS’, COLOR+fEsS) ; if s = ,all~ then exit; begin end; com_wr (‘tw. reprate ‘ + nkakestringint (tw. reprate ) + ‘ Hz’, inc(com. cur) ; COILW.MESS ); val(com. ls[com. curl , move. wait, dumw); com_wr (‘tw. shotsperscan ‘ + makes tringint (tw. shotsperscan), end; CO LORMESS ); cOm_wr (,tw. timeperpt , + nmkestring(tw. timeperpt / P, VAIMAX, procedure do-ts_tog; o) + , , + unitPref ix(round(log10 (p) )) + ‘s’ , COLORMESS) ; ( Tog91e between stage positions move. start and move. stop, waiting for end move. wait ms each move. Stops when user hits a key. ) else if s = ,rep< then var begin del : longint; ( Delay. ) if corn.cur . corn.num then s, S2 : buf string; COIUWX (‘tw. reprate , + makestringint (tw. reprate) + , Hz, , sum : real; coLclRMsss) w : integer; else begin begin ( Snsure we don’ t interfere with active waves. ) val (tom. ls[com. cur + 11, tw. reDrate, dunrw) ; if scanning (dt_COR) or scanning ldt-ELE) if tw. reprnte < 1 then then tw. reprate := 1; begin end; i f com_wr~ (,Stage in use. Stop active waves, ) E O then end exit else if s = ‘shots< then else begin begin if tom. cur = corn.mm then for w := 1 to wv. num do com_wr (‘tw. shotsperscan , + makestringint (tw. shotsperscan) , with WV.lSIWI” do COLW.WESS) if (scan. mode s O ) and [Dar. dt .> dt-POW) then else ScanStop (w) ; begin UpdateAll; val (corn.ls[com. cur + 11, tw. shotsperscan, dummy); end; if tw. shotsperscan c 1 then end; tw. shotsperscan := 1 sum :. move. start + move. stop; ( Math trick: add limits together; then else if tw. shotsperscan ~ MAXSHOTSPERSCAW then can toggle between the values by subtracting ts. Pos from it each tw. shotsperscan := !4AXSHOTSPERSCAW; time (see below) . ) end; ( Move to starting position. ) end stagewovewait (move. start) ; else if s . ,time, then conLwr (sToggle: , + makes tringint (move .start / POW1’S) + ‘, ‘ + begin makes tringint (move. stop / POWIS ) + ‘ urn’, COLORMESS) ; if corn.cur = cam. nun then co~wr (4Press any key to exit. ‘, COIJXWESS ): cOm_wr (,tw. timeperpt ‘ + makestring(tw. timeperpt / P, VALU4X, ( Main looP. ) 0) + , , + UnitPrefix lround(log10 (P) )1 + ‘s, , COL01U4ESS) repeat else StageMove (sum - ts. Pos ); begin write (BELL); val (corn.ls[com. cur + 11, tw. timeperpt, dummy) ; delay (round (move .wait) ); tw. timeperpt := MCS_TIMEPERPT [TimebaseToCode (tw. timeperpt ‘ unti 1 keypressed; P) I; ( Force to match acceptable value. ) end; exit; end end: ) else If t.v.sel . 1 then cOm_err: begin exxt; sc-sel_Of f; end; ( Turn onlof f waves and also mark screens affected. Reset taas. ) for i := 1 to w.num do ( Invalidate currently scanning wave if ele datat~e (wI1l resume with wv, ls[i]- do after tweak has ended) : ) if sel . 1 then 1f scanwave > 0 then with sc. 1s [screen] do with W. Is [scanwave]’ do begin if (par. dt = DT-ELE) and lscan. mode > 0) then sel := 1; scan. mode := SCAN_MODE_NEW: on :. v; ( Force xaxis datatype to be same as latest wave turned com_wr (,’Tweak using MCS. Press any key to exit. 8, COLOluiESS) ; on, ) ~c~,new: .1; if v = 1 then ( l.lainloop. ) gr, xaxisdt := par. dt; repeat end; ( Start scan. ) wv-sel_Of f; if MCS_init (0) = false then UpdateSel; exit; end; ( Now wait for user keypress or time to elapse. ) if tom. cur < corn.num then repeat ( Allow chaining of invfvis commands. ) time(t): begin if (t < tw. starttme) then ( Handle wraparound. ) inc (corn.cur) ; dec(tw. starttime, TIMSMAX - tw. steptime) ; s := corn.ls[com. cur]; until (t - tw. start time P tw. steptime) or kemressed; if s = ,inv, then delay (250) ; do_vis(0) ( mwrite(mcs. addr, ‘stat’ , false) ; else if s . ,visr then mwrite(mcs. addr, ‘spar? 2, , false) ; ( Read total area ) do_vis (1 ) ( mread(mcs. addr, 20) ; else co~wr (‘Total counts ‘ + rdbuf, COL0104ESS) ; ) co~err; ( mwrite(mcs. addr, ,scan?< , false) : end; delay (500) ; end; mread(mcs. addr, 10) ; Val (rdbuf, scan. shots, result) ; procedure do_ws: lf scan, shots . par, ele. shotsperscan then ( Only handle ws df rxght now. ) exit; ) begin until keypressed; if corn.cur = com num then beg in ( Remove pressed key from buffer: ) cOm_err: if readkey = EXTENDED then exit; readkey; end; inc (corn cur) ; ( Send full command set next time. ) if corn.ls[com. curl = ,df, then mcs new ,= 1: ws-d f end, else co~err, procedure do-vxs (v : integer ): end; ( TuKn On/off selected waves according to v. Ccmvnmd may be chained, Le ,vis123inv 456 vls789, etc.) procedure do-wv; var ( Create new wave, change wave, pr,nt or change wave var~ables. ) L : integer, var s b“fstr~ng; s : bufstring; begin w : lnte9er; ( Selected wave. ) [ Get wave llst ) begin Wv-sel (11 , lf COm CUr = COm n“m then ( See if at end of convnand llne, otherwise, sign.al error (unknown beg xn word] ) If w num = O then ( I f com cur . com num then Com-wr (‘No waves loaded $, Colorless) begin else Inc [tom cur) , ( Put cursor on mystery word ) com-wr ( Current wave , + makes trxngxnt (W curl , COLORMESS) , ( cOm_err, exit, end; begin wv_sel(l) : ( Get list of waves. ) for w :. 1 to wv. num do if wv. sel . 0 then with W. lsIwI” do exit; if sel = 1 then if corn.cur . corn.num then cOm_wr (‘Wave ‘ + makes tringint (w) + , .sJest , + makes tringint ( Simply switch waves: find first selected wave and use that. ) (par. alert) , COLOSMESS ); for w := 1 to wv. num do wv_sel_Off; if wv.ls[wl’’. sel = 1 then exit; begin end; if wv. ls[wv. curl~. screen = sc. cur then inc (corn.cur) ; EraseCursor (se. cur) ; val(com. ls[com. curl , i, wv. cur :. w; if (i = O) or (i = 1) then for w := w to wv. num do ( Turn off all selections. ) begin wv.ls(wl’. sel := O; for w :. 1 to wv. num do ChangeCurrentWave (O ); ( Includes drawwavedata call. ) with W. 1s [w]” do exit; if sel = 1 then end; par. alert := i; ( Load up next word. ) end inc (corn.cur) ; else s :- com.ls[com. curl ; cOm_err; if s = ‘alert’ then wv-sel_Of f: do-wv-alert end; else if (s = ,area, ) or (s = ‘avg’) or (s = ‘ctr’) or (s = ‘fwhm’) or (s = ‘ht, ) or (s = “width’) then procedure do_wv_bg; begin ( Handle wave background subtraction variables. ) for w := 1 to wv. num do var with W. lsIwI” do durrmrj: integer; if sel = 1 then i : integer; do_wv-inf o (w, s ); s, S2 : bufstring; end temp : integer; else if s = ‘bg’ then ( Background subtraction. ) w : integer; do_wv~ begin else if s = ‘ally’ then ( Delay (electron waves only) . ) for w := 1 to wv. num do do_wv_dly with w.ls Iw]A do else if s = ‘dots’ then ( Change to dots. ) if sel = 1 then do_wv-lines (O ) begin else if s = ‘fn’ then ( Filename. ) temp :. corn.cur; do_wv_fn str(w, 62) ; else if s = ,lines’ then ( Change to lines. ) S2 :. ,Wave , + S2 + , ,; do_w-_lines (1 ) if par. dt <> dt-ELE then else if s = ‘SC, then ( Screen. ) com_wr(s2 + ‘ not ele wave. ‘, COLORHL) do_wv-sc else else if s . ,sh, then ( Choose what kind of information to display in begin wavedata. ) if corn.cur = corn.num then ( Write current background wave. ) do-w.sh begin else if s = ‘skip’ then str(par .ele. bs. mode, s) ; do-w-skip c0rrLwr(s2 + ‘par. ele. bs. mode = ‘ + s, COLDRMESS) ; else if s . ,vstop’ then end do_wv-vs top else else begin co~err; inc (tom. cur) ; vf-sel_Of f; s := corn.ls[com. curl; DrawWaveData; val (s, i, durmny); end; if (i >= 1) and (i <. wv. num) then begin procedure do-wv_alert; ( Change background wave. Checks a few parameters toensure ( Print/change par. alert flag. ) compatibility. ) var with wv.ls[i]” do dummy : integer; if (par. timeperpt = W. 1s [w]A par. timeperpt) and i : integer; (par. pt = wv.ls[w]~. par. pt) w : integer; and (par. ele. bs. mode = 0) and (i . w) then begin wv. ls[w]”. par. ele. bs. mode := i if corn.cur = corn.num then else com_wr (s2 + ‘background wave lncowatible. ,, COLORHL ), par. ele. ts. pos := par. ele. ts. tO + r . WALFSPEEDOFLIGHT, end llmit (par. ele. ts. pos. STAGEf41N, STAGR4AX) ; else if s = ,0, then ( Now assign time delay ) par. ele bs mode := O ( Turn off background mode. ) par. ele. dly := (par. ele. ts. pos - par. ele. ts. tO) / else if s = ‘scaler then HALFSPEEOOFLIGHT: ... rd_real (par. ele. bs. tot, ‘background scaling- , 0, ( Print to screen to be sure user knows. ) LARGEI cOm_wr(s + ,delay , + makes tringi”t (par. ele. dly / POWFS) + else , fs, , COLORMESS) : begin end; cOm_err; end; :..J, exit; DrawWaveData; ( Update info since waves may display ally. ) end: end; end; end; procedure do_wv_f n; corn.cur := temp; ( Print/change filename of waves. ) end; var end; s : bufstring; w : Lnteger: procedure do_wv_dly; begin ( Print/change time delay of electron waves. ) if tom. cur = corn.num then ~,.. var begin ( Print filenames. ) ,.,., dunrny : integer: for w :. 1 to wv. num do ..:,1 r : real; with wv. ls[w]h do s : bufstring; if sel . 1 then w : integer; begin ,., begin sel := O; ,,-, if corn,cur = corn.num then str (w, s) ; begxn ( Print time delay. ) cOm_wr[, Wave 6 + .s + ,: 8 + par, fn, COLOS04ESS); for w :. 1 to wv, num do end; with w.ls IwI’ do exit; if sel = 1 then end; begin inc (corn.cur) ; sel :. O; s := corn.ls[com. cur]; str (w, s) ; for w := 1 to wv. num do s:=, wave, +s +<’; with wv. ls [w]- do if par .dt .> dt_ELE then if sel = 1 them com_wr(s + ,not electron wave. f, begin else sel := O: com_wr (s + ,delay = , + makestringint (par. ele. dly 1 POWFS) par. fn := s; +, fs, , COLOp.14ESS); end; end; UpdateFilenames (dir) ; exit; DrawWaveData; ( Update info since waves may display fn, ) end: end; inc(com. cur) ; val(com, ls[com. curl, r, dumny), procedure do_wv-info (w : integer; S2 : buf string) ; r:. r , POWFS , ( RePOrts information about waves, depending On ,s2, roundof f (r, ts, step I HALFSPEESGFLIGHT) ; ‘area, : Calculates area under wave, for w := 1 to wv, num do ,avg, : Calculates average value (area I x range) wxth w,ls Iw]” do ‘ctr, : Calculates x posxf.io” of .ce”ter. , defined as halfway between If sel = 1 then the two 50% marks as seen from left and right sides of wave. begin ,fWhm J : Calculates width of wave, defined as distance sel := O; between 508 marks from left a“d right sides of wave, Str (w, s) ; ,ht, : Calculates height of wave, defined as max - min value.s, ) s:=, wave, +s +<<; var ( Ensure 1s electron wave ) vfmd Integer; if par dt 0 then x f com cur . tom, nun then com-wr (s + scanning r COLORWL) begin else inc(com cur) , began lf cotn ls[cmn cur] = ,vf~nd, then ( Cdlculate srag.e pusltlon and keep wlth~n lmuts ) vf lnd .1 else DrnwVita15; u dec (corn.cur) ; ( Back up for wV_sel. ) end; o end; 0 procedure do-wv-sc; if w . 0 then ( Print/change screen of waves. ) wv_sel (1) var else dummy : integer; ( Special handling : make only specified wave work. ) i : integer; begin s : bufstring; wv-sel_Off; w : integer: wv. ls[wl~. sel := 1; begin - end; if corn.cur = corn.num then [ Print wave’s screen. ) for w :. 1 to wv. num do begin if wv. ls[w]”. sel = 1 then for w := 1 to wv. num do begin with W. lsIw] “ do if S2 = ‘area’ then if sel = 1 then infO_wr(w, infO_area(w) , ‘area’ , O) cO~wr_wv (w, ‘sc ‘ + makestringint (screen) , COLOR14ESS) ; else if S2 = ‘avg’ then exit; infO_wr(w, inf0_av9(w) , ‘avera9e’, O) end; else if S2 . ‘ht’ then info_wr(w, info_ht (w) , ‘height’, 0) ( Find screen #. ) else inc (corn.cur) ; begin s := corn.ls[com. curl ; info_edges (w, vf ind) ; if s = ,df, then if 62 = ,ctr, then i := O { Flag to use default scheme. ) infO_wr(w, info. ctr, ‘center’, 1) else else if 52 = ,edgel’ then begin info_wr(w, info. edgel, ‘edgel’ , 1) val (s, i, durmny); else if S2 = ‘edger’ then if (i < 1) or (i > sc. num) then in fo-wr(w, in fo. edger, ‘edger’, 1) begin else if 52 = ,fwhm’ then cOm_err; info-wr(w, info. fwhm, ‘fwhm’ , 1) exit; else end; begin end; cOm_err; w := W.num; ( Get out of looP. ) ( Do screen assignment. ) end; sc-sel-of f; end; for w := 1 to wv. num do end; with W. 1s [w]” do wv_sel_Off; if sel . 1 then DrawWaveData; ( Clear ta9S. ) begin end; SC. 1s [screen] .sel := 1; ( Update old screen. ) if i = O then procedure do-wv_lines (1 : inte9er ): screen :a (w - 1 ) mod sc. nun + 1 ( Cycle thru screen numbers { Change waves to lines (1 = 1) or dots (1=0). ) using wave number. ) Var else i : integer; screen := i; begin SC. Is [screen] .sel := 1; ( Must update new screen too. ) if wv. sel = O then if w = w. cur then ( Change screens if current wave changes. ) exit; sc. cur := screen; for i := 1 tO SC~ do SC. 1s [screen] .gr. xaxisdt := par. dt; ( Make screen datatype sc.ls[il. sel := O; reflect latest wave moved to it. ) for i := 1 to wv. num do end; with wv.ls[il” do wv_sel_Of f; if sel = 1 then UpdateSel; begin end; lines := 1; sel := O; procedure do_wv-sb; SC. 1s [screen] .sel := 1; ( Print/change show parameter. ) end; Var for i := 1 to sc_f.f?&do i : integer; if sc. ls[il. sel = 1 then s : bufstring; DrawScreen (i ); w : integer; beg m with W.1S[W]6do if corn.cur = corn.num then If sel . 1 then begin par. skip := >; for w := 1 to wv. num do end with WV, lsIw]A do else if sel = 1 then cOm_err: begin wv_sel_Of f; str (w, s) ; end: com_wr[SWave , + s . 0 par. sh = , + wv_sh_NAME [par. sh ], COLORJ.tESS); end; procedure do_wv_vstop; exit; ( Handle print/ cha”g.e vstop. ) end; var inc (tom. cur) : dumny : integer; s := corn.ls[com. cur]; i : integer; 1 :. 1: w : integer; while (i .= w-sh_MAXl and (s .> wv_sh_NAt4E[ i] ) do begin inc(il; i f com, cur = com. num then Lf i <= w_sh_14AX then begxn begin for w := 1 to wv. num do for w :. 1 to wv. num do with W.ls[w]- do with WV. lSIW]” do if sel = 1 then if sel = 1 then cOm_wr (,Wave , + makes tringint (w) + e vstop 9 + makes tringint begin (par. vstopl , COLORMESS) ; if (i = wv_sh_DLY) and (par. dt <> dt_ELE) WV-sel-of f; then exit; beg in end; str (w, s); inc (corn.cur) : cOm_wr (,Wave , + s + 0 cannot show ally,$, COLORHL) : val(com, ls[com. cur], i, dummy); end if i >= O then else beg in par. sh := %; for w := 1 to wv. num do end; with WV, lSIW]A do DrawWaveData; if sel = 1 then end par, vstop :. i; else end begin else cOm_err; cOm_err; exit; ~_sel_Of f ; end; end; end; procedure do_wv_skip; procedure do_x(scr : integer) : ( Print/change skip parameter. ) ( Handle x axis functions. ) va r var dummy : integer; dummy : Lnteger; L : integer; s, S2 : bufstrmg; w : integer; Ul, U2 : real; begxn begin if corn.cur . corn,num then with sc, ls[scr] ,gr do begin begin for w := 1 to wv. num do If tom. cur = corn,num then with WV. lSIWI” do begin ( Print current x range ) if sel = 1 then str(scr, s); cOm_wr (,Wave o + makes trmglnt (w) + , skip , + makes trxngint cOm_wr (= O then lf S = ,COn”> then begin Togg 1eXAx 1sMode (s.cr, XAXISMODE-CONVERT ) for w =ltowvnumdo else If s . ‘fu, then begin begin sc. ls[scr] .gr. xfullmode := 1; with sc. ls[sc. curl. gr do UpdateVitals; begin U;date (scr); if xh. mode = O then end exit; else if s . ‘nor’ then EraseCursor (sc. cur) ; ToaoleSAxisMode (scr, XAXISMODEJ’JORMAL) Xh. x[l] :n plotarea. xl; else-if s . ‘off’ then %h. x[2] := plOtarea. x2 - 1; begin xh. y[ll := plotarea. yl: xon := 0: Xh. y[z] := plOtarea. y2 - 1; sc_resize (scr) ; UpdateCursor (sc. cur); UpdateVitals: DrawCursor (sc. cur) ; Update (scr); end; end exit; else if s = ‘on’ then end begin else xon := 1: com,err; sc_resize (scr) ; end; UpdateVitals; Update (scr) ; procedure do_y (scr : integer) ; end [ Handle Y axis functions. ) else if s = ,pt’ then Var ToggleXAxisMode (scr, XAXISMODE_POINTS ) dummy : integer; else s, 62 : buf string; begin Vl, V2 : real; Vd (S, III, dtumny): begin if corn.cur . corn.num then with sc.ls[scr] .gr do begin begin cOm_err; if tom. cur . corn.num then exit; begin ( Print current Y range. ) end; str(scr, s) ; inc(com. curl ; com_wr( ’Screen , + s + , Y = ‘ + makes tring (vllim / Dower, val(com. ls[com. cur] , u2, dununy) ; fiDIGITS, MAXYDIGITS ~ 2) + ,, ‘ + nutkestring (v21im / ypower, with sc.ls[scr] .gr do MAXYDIGITS, MAXYDIGITS - 2 ) + , , + yunits, COLQRMESS) ; begin exit; if U1 >= U2 then end; begin inc (corn.cur) ; com_err; s := corn.ls[com. cur]; exit; if s = jabs’ then end; begin xfullmode := O; if sc. 1s [scr] .gr. yaxismode . YAX12f40DE_RELATIVE then ToggleY~isMode (scr ); ullim := ul ● xpower; end u21im := U2 ● xpower: end; else if s = ‘fu’ then UpdateVitals; begin Update (scr ); SC. ls[scr] .gr. yfullmode := 1; end; UpdateVitals; end; Update (scr) ; end ; end else if s = ‘off’ then procedure dosh; begin { Crosshairs commands. ) yon :- O; var sc_resize(scr) ; s : bufstring; UpdateVitals; begin Update (scr) ; if corn.cur = corn.num then end begin else if s = ‘offres” then ToggleCrosshairsMode; rd_int (yof fsetrescale, ,y offset rescale’ , 0, 1) exit; else if s = #on, then end; begin inc (con. cur) ; yon := 1; s := corn.ls[com. curl ; sc_resize (scr) ; if s = ,fu, then UpdateVitals; Update (scr) : end; end wv-sel_Of f; else if s = ,rel, then end begin else if is-mum(s) then if sc. 1s [scrl .gr. yaxismode = YAXISMODE_ABSOLW1’E then ( Change values. ) ToggleYAxisMode (scr) ; begin end val(s, r, dumny); ( Read in value. ) else wv_sel (l) ; beg~n sc_sel_Of f ; val (s, vI, dununy); for i :. 1 to w.num do If corn.cur = corn.num then with w+. ls[i]- do begin if sel = 1 then cOm_err; begin exit: par. yoffset := r; end; sc. ls[screen] .sel := 1: inc (corn.cur) ; end; val(com. ls[com. curl, v2, dunnny); w-sel_Of f ; with sc. ls[scr) .gr do Updatesel; begin end if V1 >= V2 then else begin cOm_err; cOm_err; end: exit; end; procedure do_ysc; yfullmode := O: ( Print/change y scale values of waves, ) vllim := vl ● ypower; va r v21im := v2 ● ypower; dw, i : integer; end; P, r : real; UpdateVitals; s : bufstring; Update (scr) ; begin end; if tom, cur = corn,nwn then end; begin end, cOm_err; exit; procedure do~off; end; ( Print/change Y offset values of waves. ) inc (tom. cur) ; var s := com.ls[com.cur]; dummy, i : integer; if s . ,?, then p, r : real; ( Print values. ) s : bufstring; begin begin wv_sel (l); ( Get wave list. ) If tom. cur = tom. num then for i := 1 to wv. num do begin with wv. ls[i]- do co~err: if sel = 1 then exit; begin end; p := power (par. yscale) ; inc (corn.cur) ; if p <> 1 then ,. s :. corn,ls[com. curl; s := ,x, + PowerOfTenPref lx (round (10910 (P) ) ) , ifs. 8? $ then else ( Print values. ) s: .,,; begxn cOm_wr_wv (i, ,yscale , + makes tring(par, yscale I p, VALMAX, wv-sel (l) ; ( Get wave llst ) VALDEC ) + S , COLORMESS ); for L := 1 towvnumdo end; with wv lslil” do W-sel-of f; If sel . 1 then end begin else If is-nun!(s) then D . nOwer(Das voffset), ( Change values, ) if P ~> 1 t.ilen- begin s = ,x, + PowerOf Ten Prefxx( round (lo910(Pl )) vr.l(s, r, dummy) : ( Read m value ) else wv-sel(ll ; s .,, sc_sel-Of f; cOm_wr_w (l, ‘yoffset + makes trzng (par yoffset I p, VALMAX, for x .ltowvnwndo VALDEC] . S, COLORMESS) w~thwv ls[~]- do if sel . 1 then procedure ClearArea(xl, Yl, x2, Y2 : inte9er); u begin procedure Clea~Y-isStuff (scr : integer); o par. yscale := r; procedure ClipDot (x, Y : real; scr : integer); -P sc. ls [screen] .sel := 1; procedure ClipLine(xl, Yl, x2, Y2 : real; scr : inte9er); end; procedure _col; wv-sel_Of f; procedure createWave(d, oldw : integer]; updateSel; function Dataread(name : integer; numchars : integer; w : inte9er) : end boolean; else function DerivX(w : integer; p : integer; xaxismode : integer) : real; co%e rr; procedure disc; end; procedure -ally; procedure DrawAll; end. procedure DratiuZsOr(SCr : integer); procedure DrawCursorInfo; procedure DrawData(scr : inte9er); procedure DrawMessageBox; 4.3. fpesai pas prgcedure DrawOsc; procedure DrawScreen(scr : integer); procedure DrawTitle(scr : integer); unit F’pesAI; procedure DrawVitals; ($M $4000,0,0 } procedure DraMiaveData; procedure Draw* isStuff(scr : integer); ( History of modifications (please add to BOTIUM of list!): procedure DrawYAxisStuff(scr : inte9er); procedure EraseCursor(scr : integer); Version 1: Segun 2jun94 BJG. procedure EraaeOsc; procedure EraseWaves; Procedures and functions begiming with letters A through I, for the “ procedure Error; program Ppes. please see main program (fpes.uasl for mOre detailed procedure ExitProgram; program modification notes. procedtire fft(var data : fft-array_type; m, isign : integer); ) function PileExists(fn : bufstring) : b-aolean; function Filen8.meStart(s : string) : integer; interface function FileOpenWrite(var f : text: s : string) : boolean; function FindWave(scr : integer) : integer; uses procedure FitEs; FpesVar; procedure FitY(d : integer); procedure fpes_sv(s : bufstring): (procedure ACavg; function fullpath(s : bufstring) : boolean; procedure ACscanInit; ) procedure FullView(i : integer); procedure ADoff(c : integer); function GainCode(adgain : integer) : integer; function ADRead(c : integer) : inte9er; function get-extension(s : bufstring) : bufstring; procedure ADReadAll; procedure GraphicsMode; function ADReadAsm(gain, channel : integer) : integer; procedure Help; function ADReadStrobe : integer; function infO_area(w : integer) : real; procedure AreaFitY; function infO_avg(w : integer) : real; function AreYouSure : boolean; function info-edge(w : integer; PI, P2 : integer; fifty : real) : real; function AutoGen(w : integer) : inte9eX; procedure info-edges(w : integer; vfind : integer); procedure AutoN8me(W : integer); function info_ht(w : integer) : real; function AutoSave(w : integer) : inte9er; procedure info-wr(w : integer; r : real: .s : bufstring; code : integer) ; (procedure BackgroundSubtractionInput: ) procedure InitGraphics; function better-div(a, b : inte9erl : integer; procedure Initialize; procedure Blank; procedure InitializeWave(w : integer); function bs-on : boolean; procedure Init-ts; procedure BsAdapt; procedure Integral; procedure CalibSnergy(n : integer); procedure intelligent_ filename(s : bufstring; var aser : bufstring; var procedure CalibNassl; armm : integer; var ext : bufstring); procedure CalibMass2; procedure IntroduceProgram; procedure ChangeCurrentWave (direction : integer); function is_b91w : integer) : boles.n; procedure ChangePar[w : integer): function is_num(s : bufstring) : b.aolea.n: procedure ChangeParArrow (direction : integer; var ParStr : Par-tYPe-Ptr; Var function is_sel (s : bufstring; sel : integer) : boolean; d, p : integer; w : integer; var changed : boolean) ; procedure ChangeStep(var step : real; direction : inte9er); implemental ion procedure Char_ to_int(var res : integer; var errcOde : ‘nteger); function ChooseColor(w : integer) : word; crt, dos, FpesCom, FpesJR, PpesST, FpesUZ, graph, Keys. DADAT = BASE + 8 ; ( DIA data. ) tDSShel 1, TPDec 1; DIOOAT = BASE + 10: ( DIO data. ) SUPCSR = BASE + 12; ( Supervisory control/status ) procedure ADOf f (c : integer) ; Tt6RCTR . SASE + 14; ( Pacer clock. ) ( Turns off channel c If no other scans using it. ) asm var ( mov ax. 02e7h 40 kHz i : integer; mov &, Tf4RcTR begin Out *, ax ) ( Turn off. ) UOv ax, 2240h ad.ls[c]. on :. 0: mov d%, SUPCSR ( ‘IUrn back on if any other wave is using it. ) Out dx, ax for i :. 1 to wv. num do mov ax, 8000h with wv. ls [i)- do mov d%, CHANCSR if scan. mode P 1 then Out dx, ax case par .dt of mov ax, gain ( Load gain. ) dt_COR : if par, cor. ch = c then ( mov bx, 16 ad. ls[c]. on := 1; imu 1 bx ( Multiply ax by 16 since gain occuoies bits 5&4. ) dt_POW: if par ,Pow. ch = c then add ax, channel ( Add in charnel number ) ad. ls[c]. on := 1; sub ax, 1 ( Adjust by -1 since user refers to 1-8, not o-7. ) end; add ax, 0200h ( Add in other flags. ) ( ...or if osc is using it. ) mov d%, AOCSR with osc do Out d%, ax i f mode = 1 then mov ax, 0000h ad. ls[chl, on := 1; mov dx, CHAWCSR end: Out d%, ax mov ax, OO12h (lOh) ( Preload multiplexer (bit 4 = 1) , function ADRead(c : xnteger) : integer; enable external clock (bit 1 = 1) ) ( Reads AID board channel c. ) mov ax, SUPCSR cons t Out &x, ax ADREADDELAY = 1; ( ms to wait after calling ADReadAsm. ) mov ax, ACCSR ( Wait for multiplexer to settle (bit 8 . begin 0). ) if dev_rd . 1 then @waltl: in ax, ax begin and ah. Olh ADRead := ADReadAsm (GainCode (ad. lsIc I .9ain) , c) ; jnz ‘Jwiitl delay (ADREADDELAY ); mov ax, 000ah (8h) ( Trigger external clock (bit 3 = 1) to end begin conversion. Exterm,l clock nmst be else enabled again (bit 1 = 1) ) ADRead := O; mov dx , SUPCSR end; Out dx, ax mov &, AOCSR ( Conversion done when bit 7 = 1. ) procedure ADReadAll; S+wait2: in ax, dx ( Reads .11 active channels of AID board and saves values in array ADresult. ) and al, 80h var jz 0wait2 i : integer; ( Channel number. ) mov d%, ADDAT ( Read data. ) begxn in ax, dx for i := 1 to AD_MA.Xdo end; if ad, ls[i]. on . 1 then AD, ls[il result := ADRead( l); function AOReadStrobe : integer; assembler; end; ( Reads si9nal using internal clock to take a fast scan of signal coning in Currently set at 40 kHz acquisition rate. ) funct ion ADReadAsm (g.ain, channel : xnteger) : integer; assembler; const ( Performs AID conversion on inPut signal, with external clock signal from ( DT2821 register addresses. ) suitable ‘rrL source (Stanford Box) 16-blt value (only 12 bits valld) BASE = $240; stored in AX is automatically placed in the function result. Channel ACCSR = BASE; ( AID control lstatus, ) (0-15) specifies which channel to read Gain defines the gain of the CHAWCSR = BASE + 2; ( Channel-gain list control lstatus ) channel, O = lx, 1 = 2x, 2 = 4x, 3 = 8X ) ADDAT = BASE + 4 ; ( A/D data, ) const DACSR = BASE + 6 ; ( D/A control fstatus ) ( DT2821 regxster addresses ) OADAT = BASE + 8 ; ( DIA data. ) BASE = $240, OIODAT - BASE + 10; ( DIO data. ) ASCSR = BASE, ( A(D control fstatus ) SUPCSR = BASE + 12, ( Supervisory control lstat”s ) CHANCSR = BASE . 2. ( Channel -gaxn list cont?ollstatus ) TT4RCTR = BASE + 14; ( Pacer clock ) W ADDAT = BASE + 4, ( A(D data ) asm o DACSR = BASE , 6, ( D/A control lscatus ) mov ax, 02e7h ( 40 kHz ) U mov .5X, TNRCTR par. yscale := accum I waccum;

out d%, ax par. yof fset := -vmin ● par. yscale; mov ax, 2240h end; mov d%, SUPCSR (Mesaagedelay( ,area=’ ,accum, 1) : ) Out dR, ax ToggleYaxisMode (w. ls[wv. curl” screen) ; mov ax, 8000h end; mov &, CHANCSR Out dx, ax function AreYouSure : boolean; mov ax, 0230h ( Gain = 8 (bits 5-4 E 11); channel . 1 (bits ( Waits for user to answer yes or no, returning value as a boolean. ) 3-o a 0000). ) begin &, AOCSR case com_wra (,Are You sure’ ) of out d%, ax o : AreYouSure := false: mov ax, OOOOh 1 : AreYouSure := true; mov dx, CWANCSR end; Out d% ax end; mov ax, OOIOh (12h) { Preload multiplexer (bit 4 = 1), enable ex- ternal clock (bit 1 = 1) . ) function AutoGen (w : integer) : integer; mov *, SUPCSR ( Automatically 9enerate new wave based on old if auto. gen = 1, with out dx, ax automatic filename if auto. fn .S 1 (otherwise assigns ‘‘ to fn) . If out mov dx, AOCSR ( Wait for multiplexer to settle (bit 8 = O) .) of roan, removes old waves if auto. rm = 1. If no new wave is created, tlwaitl: in ax, & assigns scan. mode E O to prevent overwriting. Returns # of new wave and ah, Olh created, or O if none. ) jnz @waitl Var ax, 0008h (ah) ( Trigger external clock (bit 3 . 1) to begin s : bufstring; conversion. S%ternal clock must be enabled W2 : integer; again (bit 1 = 1) . ) begin mov d%, SUPCSR if auto. aen . 1 then out d% ax begin - mov &, AOCSR ( conversion done when bit 7 = 1. ) if wv. num = MARWAVSS then 0wait2: in ax, dx begin ( Remove waves first. ) and al, 80h end; jz 8wait2 if wv. num c MAXWAVSS then ( If there’s room now. ] nlov dx, ADMT ( Read data. ) begin in ax, ds inc(wv. num) ; end: WV.ls[w. num]’ := WV. lS[W]-; ( Copy old wave to new. ) wv.ls[wv. num]~ .scan.mode :. O; ( Turn off scan mode for old procedure AreaFitY; wave. } ( Normalizes all visible waves on, current wave’s screen by their areas, Wv.ls[w]”. col := ChooseColor (wv.num) ; ( Use color we would have assigning current wave a yscale of 1. ) given to new wave, since it gets old color. ) var with WV. lsIw1 - do W,P : integer; begin accum, waccum : real; FillChar (data, sizeof (data) , 0) ; begin FillChar(tmp, “sizeof (tmp) , O) ; if wv. num = O then exit: AutoName (w) ; if addwaves. mode = 1 then end; begist [ Rea6sion addwaves nointer. ) comwr (‘Cannot AreaFit Y in Addwaves Mode.’, COLOSJSL): if addwa~es .W = w thin exit; addwaves. w := wv. num; end; ( Reassign cursor. ) sc. 1s [WV. 1s [wv.cur) -. screen] .gr. yaxismode :. YAXISt40DE_ASSOLGTE; if wv. cur . w then Updatevs.imits; begin UpdateY&is (WV. 1s [wv.curl A. screen); wv. cur :. wv. num; accum := 1; ChangeCurrentWave (O ); with wv. ls[wv. curl- do end; for P := 1 to par. pt do ( Reassign background wave pointers. ) accum := accum + data [p] : ( for W2 := 1 towv. num - 1 do for w := 1 to wv. num do with W.ls[w21a do with W.lSIWIA do if par. eie. ~ . w then if (on = 1) and (screen = tw. ls[wv. curl” .screen) then par. ele. bg := wv. num; ) begin AutoGen := wv. num; Waccum := 1; exit; for p := 1 to par. pt do end; waccum :. waccum + data lpl; end else p = power (stagepos) ; AutoGen := O; r := stagepos I p; Wv. ls [w]” scan. mode := O; writelnl ,Stage position for background scan (default = o. r : VALMAX : end: VALDEC , , ,, UnitPrefix (round llogl Olp) )). ‘m) ‘); i f not readonly then procedure AutoName (w : integer) ; begin ( Assigns automatic filename if auto. fn = 1; otherwise assigns 00 as readln2r (r) ; filename, ) stagepos :. r . p; var end; s : bufstring; end; begin if readonly then with w.ls Iw]’ do waitkey; if auto. fn = 1 then DrawAll; begin end: ) str(auto. num, s) : xnc (auto .numl ; function better_div(a, b : integer) : integer; par. fn := auto. ser + s + ‘., + dt_NAME [par. dt 1; ( Computes a div b consistently for a > 0 and a . 0 then par. fn := “; better-div := a div b end; else better_div := (a + 1) div b . I; function AutoSave (w : integer) : inte9er: end; .. ( Automatically save wave if auto. sv = 1: otherwise, turn scan .mode off ,. for wave, Also calls AutoGen. Returns # OE new wave created. ) procedure Blank; -,, begin ( Blanks data in selected waves “sing blankmin, blankmax range. Called if auto, sv . 1 then frorn do-blank. ) begin var if SaveWave (w ) then i, j : integer; A“toSave := AutoGen (w) ; begin end ( Final check that user wants this, ) else if com_wr_yn (,Blank data, ) = O then wv, ls[w]a. scan. mode := 0: exit; end; sc-sel_Of f: ( Blank data, marking screens affected. ) (procedure BackgroundSubtrac tionInput; for i := 1 to wv. num do ( Allows user to change electron scan background subtraction parameters. ) with wv, ls[i]~ do (var if sel = 1 then p : real; ( Power. ) begin { r : real; ( Generic input real. ) if (scan .mode s 01 or (addwaves. w . i) then ( readonly : boolean; ( Flag that scan in progress, so cannot change values, ) cOKwr_wv (i, ,active: cannot blank !o, COLORHL) ( w : integer; { Wave counter ) else (begin begin readonly := false; for j := blankmin to blankmax do ( Check If any electron scan in progress, ) data[j] :. O; ( forw. =ltownumdo sc. ls [screen] ,sel := 1; if lwv. ls[wl-. par. dt = dt-ELE) and lwv. ls[wl”. scan. mode = datasaved := O; 1 ) then end; readonly := true; end; textmode, wv-sel_Of f; clrscr: Updatesel; wrxteln (,Background subtract lon parameters: ,); end; with background do begin function bs-on : boolean; p = power (stagedelay) , ( Checks waves for any par ele. bs mode s O and returns true >f so ) r = stagedelay / P, var write ln (-stage delay (default = ,, r VALMAX VALDEC, o ,, Unit Preflx( 1 integer, round (logl O(p))), ,s )). begin if not readonly then for I =ltowvnumdo !~egln w~th w ls [l]- do readln2r (r) lf (par dt = dt-ELE) and (par ele bs mode > O) then w stagedelay = r - p, begin o end, bs-on . true, 4 exit; parsaved :. O; end; SC. 1s [screen] .sel :E 1; ( Tag screen for update. ) bs-on :. false; end; end; vm-sel_Of f; Updatesel; wrocedure BsAda9t; end; ~ Adapts old-style background-subtracted ele scans to new scheme. For each bglfg wave pair, finds total bg counts and Places in f9 tOt, procedure CalibSnergy (n : integer) ; adds bg into _bs. kg wave, and adds lx! into fg wave. ) ( Accept Point n (1 or 2) in a calibration energy spectrum. ) var var i, j : inte9er; done : boolean; tot : longint; P: real; ( Power. ) begin slope : real; ( Intermediate value. ) sc-sel_Of f; begin with wv. ls[_bs. bgl” do if wv. num . 0 then begin exit; if (_bs. bo < 1) or (_bs. bP > wv. num) or (par. dt <> dt_ELE) or if (wv.ls[wv. cur]” .par. dt <> dt_ELE) or (scan mode > 0 ) or ((addwaves. mode = 1) and (addwaves. w = (wv.ls[wv. curl~ .on = O) or (se. ls[wv.ls[wv .curl”. screenl .gr. Js. bss)) then cursorvisible = O ) then be~in - exit: cOm_wr_w (_bs .bg , ‘not valid for bg. Aborted. ‘, COS.J3RSL); textmode; exit; clrscr: end; write (;POint ,, n, *. Use last info ctr result as point reference? (Y/N) ‘); if (datasaved = 0) or (parsaved . O) then done := false: if com_wr~ (‘bg wave not saved. Overwrite’ ) = O then repeat begin :ase readkey of COILWX (‘bg adapt aborted. ‘, COLOFWESS); $n, , r~?: exit; begin end; with SC. lSIWV. ls[wv. curl” .screenl .gr do par. ele. bs. mode :. 1; ( Set mode. ) if xb. mode = O then par. ele. bs. tot := O; ( Clear for accumulation to come. ) calib. n[n] := PtoU (WV.CUX , CUX50W, XASISMODE_NORM?L) fillchar(data, sizeof (data), O); ( Blank wave. ) else fillcbar(tmp, sizeof (tnw), 0); calib. n[nl := PtoU(wv. cur, UtoP(wv. cur, xh. u[31, O), datasaved := O; ( New data will not have been saved. ) XASISMODEJORMAL ); parsaved := O; done := true; SC. 1s [screen] .sel := 1 ( Tag screen for update. ) end; end; ,Y~, ,Y, : b~gin wv_sel (1 ) ; ( Find participating waves, ) calib. n[n] := Ptotl(wv.cur, UtOP(wv. cur, in fo. ctr, O), %AXISMODE_NORNAL ); ( Adapt. ) done := true: for i :. 1 to wv. num do end; with wv.ls[il” do extended : readkey; ( OnlY look at selected fg waves which are not _bs. bg. ) end; if (sel . 1) and (par. dt = dt_ELE) and (par. ele. bs. mode > O) and until done; (par. ele.bs. mode c= wv. num) and (i <> -bs. kg) then writeln; begin write( ‘Reference time . ,); tot := O; ( Clear accumulator. ) P := power (calib. n[nl ); ( Add bg wave to _bs. bg wave. ) writevalue (calib. n[n] , p, VALDEC, VALNAX, ‘s’ ); with WV. ls[par. ele. bs. model” do writeln; for j := 1 to par. pt do write( ‘Enter energy of calibration point (default = ‘); begin writevalue (calib. c[n] , 1, VALDEC, VALNAX, ‘eV) : ‘): wv.ls[~s.lxr] ”.data[jl := wv.ls[_bs. btrl”.data[jl + readln2r(calib. c [n] ); data[j]; ( Add bg to _bS. bO. ) wv.ls[i]~. data[j] :. wv.ls[il~. data[jl + data[jl; ( Add @ if n . 2 then to fg. ) { Calculate calibration parameters, setting quad factor to O since none was inc(tot, round (data[j 11 ); ( Accumulate b counts. ) calculated (and, presumably, needed) . ) end; beain par. ele. bs. mode := 1; ( Can erase bo wave # now. ) with calib do par. ele. bs. tot := tot; ( Place total counts in fg tot. ) begin wv.ls[_lxs .tg]a. par. ele. bs tot := wv.ls[_bs. @l”. par. ele. slope := (n[Z] - n[l]) / [1 / sqrt(c[21) - 1 / sqrt(c[ll )); bs. tot + tot; ( Add to _bs. bg total. ) setenergycOnvers iOntO := n[ll - slope / sqrt (c[l] ); datasaved := O; setenergyconvers ionlength := slope / sqrt (SLOPEFAC’IDR) : end; p :. power (intl; ( COPY new Parameters to current wave and default parameters. ) wr~teln( $Intercept = ,, int /p: VALMAX : V?J.DEC. o ‘, pardf [dt_ELE] ele. Cal. tO := setenergyconvers iontO; UnltPrefix (round {loglO(p) )), ,s, ); pardf [dt_ELE] .ele. cal. len := setenergyconvers ionlength; p := power (sl); wv. ls[wv. curl -.par. ele. cal. tO :. seteneroyc Onversi Ont O; writeln( ,Slope . ,, S1 / p : VALNAX : VALDEC, - ,, Unit Preflx( wv. ls[w. curl- .par. ele. cal. len := setenergyconvers ionlength: round [logl O(p) )1, ,Dals”2S ): writeln( ,New calibration parameters: ,); end; p := power (setener9yc0nvers iont0 ): waitkey: writeln( ,TO = ,, setenergyconvers lent O / p : VALNAX : VALDEC, , ,, UpdateAll; UnitPrefix (round (log10 (p) )), ‘s’ ); end; p := power (setenergyconvers ionlength) ; wrlteln( ,Length = ,, setenergyconvers ionlength I p : VALMAX : VALDEC, $ ,, procedure ChangeCurrentWave [direction : integer ); unitPrefix (round (log10 (p) )), ‘m’ ): ( Changes the value of wv. cur; updates the wavedata area of screen. ) waitkey; var end; temp : integer; ( Temp storage for sc. cur. ) UpdateAll: begin end: if wv, num = O then exit: procedure Calibf.fassl; if SC. 1s [SC. cur] .gr. cursorvisible = 1 then ( Accept first point in a calibration energy spectrum. ) EraseCursor(sc. cur) ; begxn wv. cur := wv. cur + direction; if wv. num = O then if w. cur . 1 then exit; wv, cur :=.wv. num if (wv. ls[wv. cur]A. par, dt .> dt_MAS) or else if wv. cur > wv. num then (wv.ls[wv. cur]A .on = O) or (Se. ls[wv. ls[vw.cur]”, s.creen].gr, wv, cur :. 1; cursorvisible = O) then tenw := sc. cur; exit; sc. cur := wv. ls[wv. cur] A, screen; ( Force current screen to be one with textmode; current wave. ) clrscr; DrawTitle (temp) : ( Change colors of old and current screen, ) write( ,Enter mass of first calibration point (Da) : ,): DrawTitle (SC, cur) ; readln(calib. c[ll ): UpdateCursor (SC. cur) ; calib, n[l] :. PtOU(wv. cur, sc. ls[wv, ls[wv, cur] ’. screen] .gr, cursorp, ( cOm_wr_scan; ( Print scan info if wave is active, ) XAXISMODE-NORNAL ); DraWaveData; DrawAll; if SC. ls[sc. cur] ,gr, cursorvisible = 1 then end; begin DrawCursorInfo; u procedure Calibt4ass2; DrawCursor (SC. cur) ; ( AcceDt second uoint m a calibration energy spectrum and calculate calibra- end; tion- parameter~, assigning them to the dt~ELE- default. ) end: va r p : real; ( Power. ) procedure ChangePar (w : integer) ; slope : real; ( Intermediate value. ) Var beg Ln changed: boolean; ( Plag indicating if we changed something, If not in if wv, num = O then chr.ngedf mode, will update WV. 1s []6 .parsaved at end. ) exxt; d : integer; ( Current dt, ) if (wv, ls[wv, cur]-. par, dt .> dtJ4AS) or (wv. ls[tw. cur]-. on exit flag boolean; ( Flag to exit loop, ) = O) or (se. ls[w. ls[wv. curl’ .screenl gr cursorvisible = O) then i : integer; ( General integer, ) exit: P. POff Set : Integer; ( Which parameter is being edited, poffset LS textmode; the parameter offset when list scrolls otf-screen, ) clrscr; par_ptr : par_type_ptr; ( Pointer to parameters (defaults or wave) ) . wrlte( ,Enter mass of second calibration point (Da) : ‘); r real; ( General real for data processing ) readln(cal ib, c[21); ~ : bufstrmg; ( General string for data processing ) callb. n[2] := PtoU(wv. cur, SC. lSIWV lSIW cur]’ screen] gr cursorp, Y : 1nte9er; ( Y positxon. ) XAXISMODE_NORNAL ), begxn ( Calculate calibration parameters ) if w = O then with callb do begin with WV. lSIWV curl’ par mas cal do d = dt-MIW; begin par_ptr = ‘Jpardf [d] , 51 :. sqr((sqrt(c [2]] - sqrt(c[l l)) / ln121 - n(l))), end Lnt .= n[l] - sqrt(c[ll I sll, else pardf[dtJ4S] mas cal S1 = s1, begin pardf [dtJIAS] mas cal int = MIt, par_ptr . @wv 1S[W]6 par, wrlteln( ‘New call brdtlon parameters ) d = par-ptr, dt, changed := false; end; end; PAR_FT.GL: exit flag := false; ( if d <> dt_ELE then ) p := 1; begin poffset := O; readln2i (pt_gl ); while not exitflag do if pt_gl c O then begin pt_gl:= o if sc. mode . scJaode_GR then else if pt_gl > MASPOINTS then ShowParams (par~tr, p, w, pof fset) ; ( Draw screen if in graphics pt_gl := NAXPOINTS; mode. ) case d of if kemressed then dt-COR: ( Change stage stop automatically. ) begin-- UpdateCORLimits (par_ptr ]; Y := P - pof fset - 1 + PkRYsTART; dt_MAS: ( Change linked parameters. ) case readkey of mas. scantime := timeperpt ● pt_91; CR: end; if (w II O) or (wv.ls[w] ’’.scamodede = O) then end; with par_ptr” do PRR_scrd4 : begin begin ( if p < USEPJIIN then readln2i (scan) ; Y := CHANGEPARYSTART + D - 1 if scan < 0 then elie scan := O; Y := cfWiGEPARYUSER + P - USERMIN; ) end; iotoxy (cHANGEPAR%VRLUE; Y) ; PAKSCAF-GL : textcolor (LIGKTREP) ; b~gin – changed :E true; readln2i (scan_gl ); case P of if scan_gl < 0 then PAR_ALERT : scan_gl := O; begin end; readln2i (alert) ; PAR-SKIP: if alert < 0 then begin alert := O readln2i (skip) ; else if alert > 1 then if skip c O then alert := 1; skip := O; end; end; PAFLCOKMENT : PAR-VS~P: readvalue (vstop, O); b–gin PP&YOFFSsT: readvalue (yof fset, O); s := ,,; PAILYSCALE: readln(s) ; begin if s c> ‘- then r := yscale; ( Save old value of yscale for talc below: ) comnent := s; readvalue (r, O); end ; ( Rescale yoffset to keep same relative position: ) PAR_FILENANE : if (yoffsetrescale . 1) and (r + O) then begin yoffset := yoffset ● r / yscale; s := “; yscale := r; readln (s); end if s c> ,, then else fn := s; case d of end ; dt-COR: PIWLGEN : case p of begin PkR-C_CHINNEL : readln2i (gen) ; begin if gen < 0 then readln2i (cor. ch) ; gen := O if cor. ch < 1 then else if gen > 1 then cor. ch := 1 gen := 1; else if cor. ch > AD_MAX then end ; cor. ch := AD_MAX: p-m : end; begin PAR-C-SHOTSPERFT : readln2i (pt ); begin if pt < 0 then readln2i Icor. shotsperpt ); pt := o if cor. shotsperpt < 1 then else if pt > NAXPOINTS then cor. shotsperpt := 1; pt := MAXFQINTS ; end; PAR_C_STAGEwOb?J4PL : end; beg m dt_ELE: readvalue [cor, ts, web. ampl, POWTS) ; case p of llmxt lcor. ts web. aupl, STAGEWIN, STAGEMAS) : .4 PAR-E-BSJAST: readvalue (ele. bs. last, 01: end; P.W._E-BS_MODE : .,. ., f“.,, PAR_CJTAGSwobPER , begin begin readln2i (ele .bs mode) : readvalue (cor. ts .wob. per, POWS) ; >f ele. bs. mode . 0 then limit {cor. ts. web. per, STAGENIN, STAGEf4AX) ; ele. bs. mode :. 0 end; else if ele. bs. mode > 1 then PAR_C_STAGEwobPH : ele. bs. mode := 1; beg in end; readvalue (cor. ts. web. ph, O) : pAR-E_BS-~T: readvalue (ele. bs. tot, O); 1imi t (cor, ts, wob, ph, TS-PHASE_MIN, TS_PHASE_MAX ); PAR_ E_CALEV: readvalue (ele. cal. ev, O) ; end; .‘ pAR-E_CALLEf?GTW: readvalue lele. cal. len, O) ; ,,, PAR_C_STAGESTART : PAR_E_CALTO : readvalue(ele .cal. tO, 01 ; begin pAR-E_CALQUAO: readvalue (ele .cal. quad, O) ; readvalue(cor. ts. start, POW1’S); pAR-E_CALQUAD2FF: readvalue (ele. cal. CIUadoff, 01: roundoff lcor. ts. start, ts. step) ; pAR-E_REPRATE : readvalue (ele. repratet 01: limit lcor. ts. start, STAGEf41N, STAGEMAX) ; PAR_E_SHOTSPERSCAN : ( Update number of points, ) begin pt_gl :. 1 + integer (round( (cor. ts. stop - cor. ts. readln2 i (ele. shotsperscan) ; start) / cor. ts. stepl ); if ele. shotsperscan < 1 then end; ele. shotsperscan := 1 PAR_C_STAGESTEP : eke if ele. shotsperscan > MAXSHOTSPERSCAN then begin ele. shotsperscan := NAXSHOTSPERSCAN; readvalue (cor. ts, step, POWTS) ; end: roundof f(cor. ts, step, ts. step) ; pAR-E_sTAGhobAMPL: limit (cor. ts. step, ts. step, STAGEMAX) ; begin ( Update time per point. ) readvalue(ele, ts. web. axnpl, POWTS) ; timeperpt := Cor. ts. step / HALFSPEED3FLIGHT: limit (ele. ts. web. ampl, STAGEMIN, STAGEMPX); UpdateCORLxmits (par_ptr) ; end; ( pt-gl :. 1 + integer (round( (cor ts. stop - cor. ts. PAR-E_ STAGEMobPER : start) I cor. ts. step)); ) begin end: readvalue (ele. ts,web. per, POWrS) : .,,..: PAR-C-STAGESTOP : limit (ele, ts. web. per, STAGEMIN, STAGSMAX) ; >:.; begin end: readvalue (cor. ts. stop, POWTS) ; PAR-E_STAGEwobPH : roundoff (cor, ts. stop, ts. step) : begin limit (cor, ts, stop, STAGEFSIN, STAGEMAX) ; readval”e(ele. ts, web, ph, O) : ( Update number of points. ) limit (ele. ts .wob. ph, TS-PHASE_MIN, TS-PHASE_WAX) ; pt_gl := 1 + integer (round( (cor, ts, stop - cor. ts. end; start) / cor, ts, step)); PAR_ E-STAGEPOS , end; begin PAR_C_STAG ETO : readvalue (cl!?.ts .POS, POWTS) ; beg in roundoff (ele. ts. pos, ts, step}; readvalue(cor, ts. tO, POW1’S); limit (ele. ts. uos, STAGEMIN, STAGSMAX) : roundoff (cor. ts. tO, ts, step) ; ( Update time of FPES. ) limit (cor. ts. tO, STAGEWIN, STAGEMPX) ; ele. dly := (ele. ts. pos - ele. ts. tO) I HALFSPEEWFLIGHT; end: end: PAR-TIMEPERPT : PAR_ E_STAGETO , begin begin readvalue (timeperpt, POWPS) ; readvalue(ele. ts, tO, POWS) ; ( Round to time corresponding to nearest 1 “m ) roundoff(ele, ts to, ts, step) ; roundof f (tlmeperpt, ts, step I HALFSPEECQFLIGHT) , limlt (ele. ts, tO, STAGEMIN, STAGEMAX) , ( Llm,t ) ( Update time of FPES ) llmlt (tlmeperpt, ts step I HALFSPEECOFLIGHT, ele. dly := (ele ts Pos - ele. ts to) / HALFSPEEDOFLIGHT STAGW / HALFSPEECCIFLIGHT1 , end; ( Change stage step, number of poxnts. ) PAR-E-TIMEFPES cor. ts step = tlmeperpt . HALFSPEEDOFLIGHT, begxn pt_gl. 1 + tntegerlround( (cor ts stop - cor cs readvalue(ele ally, POWFS) b.) start) / cor cs step) ) ( Update stage posltlon ) end, ele. ts POS = ele dly , HALFSPEECOFLIGHT + ele r-s tO, roundoff (ele. ts. pos, ts. step) ; readvalue (mas .vert, O) ; limit (ele. ts. nos. STAGEMIN, STAGSMAKI ; PAR-TIME PERPT : { Update dly ~gain ) begin ele. dly :. (ele. ts. pos - ele. ts. tOl / KALFSPEEGCJFLIGHT; readvalue (timeperpt, O) ; end; ( Force to valid timeperpt. ) end; timeperpt := TEK_TIMEPERPTITEK_TIMEPERPT_to_code dt_POW: (timeperpt) 1; case P of ( Change linked parameters. ) P&p-cALINT: readvalue (POW. cal. int, O); pt :. round (mas. scantime I timeperpt ); PA&P-CALSLDPE: readvalue (Pow. cal. 61, O); if pt > WAXPOIWTS then PAR-P_CHANNEL : pt := MAKPOINTS ; begin mas. scantime := timeperpt ● pt; readln2i (pow. ch) ; end; if pow. ch < 1 then end; pow. ch := 1 end; else if pow. ch > ADJ4AX then end; pow. ch := AD_FIAX; end; end; ESC: exitflag := true; PAR_TIMEPERPT: EXTSNDED : begin case readkey of readvalue (timeperpt, O ) ; XARROWUP : if timeDerpt < 0 then if p > 1 then timeperpt :. O; begin end; dec (p) ; end; if (y E PARYSTART) and (pOffset > O) then dt_MAs : dec (pof fset) ; case p of end; P.W_M_CALINT: readvalue (mas. cal. int, O) ; XARROWWWW : PAR_M_CALSLOPE: readvalue (mas. cal. sl, O) ; if p . USEFJfAXDT[d] then PAR_N_C HANNEL : begin begin kc (p) ; readln2i (mas. ch) ; if (y = PARYSTOP) and (poffset . USERNAXDT [d] - PARYS’TOP if mas. ch < 1 then + PARYSTART - 1 ) then mas. ch := 1 inc (uof fset) : else if mas. ch > NAS_CH_MAK then end; - ~S .ch := 14AS_CH_NAX; XARROWLEFT: ChangeParArrow (-1, par_ptr, d, p, w, changed) ; end; XhRROWRIGHT: ChangeParArrow (1, par_ptr, d, P, w, changed) ; PAR-M-DELAY : XEND : begin begin readvalue (mas delay, O) ; P := USE RWAXDT [d] ; if rims.delay < 0 then pof fset :. p - PARYSTOP + PARYSTART - 1; mas. delay := 0: end; end; XHOME : PAR_M_INV : begin begin P := 1; readln2i (mas. inv) ; pof fset := O; if mas. inv . 0 then end; mas. inv := O end; else if mas. inv > 1 then end; mas. inv :. 1; ShowParc.n’s(par~tr, P, w, poffset) ; ( Update screen. ) end; end; PAR_M_SC?N1’IME : sc. mode := sc_mode_TK_OVR; ( Set text -override- flag -- which means begin when Scan is called, if any graphics commands are issued, readvalue (mas. scantime, O) ; nothing will get though except com_wr using COLORHL as color -- if mas. scantime < 0 then i.e. iuportant messages. ) mm. scantime :. timeperpt; Scan; ( Keep active waves happy. ) ( Change linked parameters. ) end; pt :. round (mas. scantime I timePerPt); if not (w = O ) and changed then if pt > t4AXPOIN1’S then WV. 1s [w]” .parsaved := O; pt := NAXFOINTS ; sc. mode := sc_mode_TX: ( Allow screen to redraw again. )

mas. scantime := timeperpt ● pt; UpdateAll; end; end; PAR_M_VERT : procedure Change ParArrow(direction : integer: var par_ptr par-t ype_ptr; var xnc[s .Kap, alrecclon) , d. P : xnteger; w xnteger; var changed : boolean) ; if skip . 0 then ( Increases (direction = 1 I or decreases (directxon . -1 I certain parameters, skip :. 0: given &n formation about them from ChangePar (par_ptr, d, PI Makes changed end; flag = 1 if valid key is pressed. ) else var case d of i : integer: dt_COR : r : real: case p of s : bufstring; PAR-C_CHANNEL : begin begin ( Cannot change if scanning. ) inc[cor, ch, direct ~on) ; if (w s 0) and (WV ls[w]~. scan. mode s O) then if cor. ch . 1 then exit; cor. ch :. 1 changed := true; else if cor. ch > AD_f44x then with par_ptr” do cor. ch :. AO_MAX; case P of end: PAR_ALERT: alert := 1 - alert; PAR_C_SHOTS PERPT , PAR_DT : beg in begin inc (cor. shotsperpt, direction) : d := d + direction; if cor. shotsperpt . 1 then if d . dt_MIN then cor. shotsperpt := 1; d := dt_MA% end; else if d > dt_MAX then PAR-C-STAGESTEP , PAR_TIMEPERPT : d := dt_MIN; ( Change stage step and time per point at the same time. ) if w = O then begin par_ptr := @pardf [d] ( Point to new pardf entry. ) r := cor. ts, step; else if r > 2 . ts. step then

begin r := r + direction ● ts. step; s := fn; ( Save old filename. ) timeperpt := r I HALFSPEEWFLIGHT; par_ptr’ :. pardf [d] ; ( COPY goodies. ) cor. ts. step := r; fn :. s; ( Restore filename, ) ( Uodate number of Qoints, ) ( If using standard file extension, change to retlect dt. ) pt_gl := 1 + round (-(cor,ts. stop - cor. ts. start) / r) : s = get_extenslOn (fn) ; end; for i := dt_MIN to dt_NAS do end; If s = dt_NAME [i] then dt_ELE : tn := r~extension( En) + ‘ ‘ + dt_NAME[dtl ; case p of end; PAR_ E_BS_MODE : end; ele. bs. mode := 1 - ele, bs. mode; PAR-GSN: gen := 1 - gen; PAR_TIMEPERPT: PAR-SCAN : begin begin i := TimebaseToCode (tinwperpt ) + direction: lnc (scan, direction) ; if i = -1 + direction then ( Number did not match any value in If scan < 0 then array. ) scan ,= o: 1 := FICS-TIMEPERPT_MIN end; else if i . MCS-TIMEPERPT_WIN then PAR. SCAN-GL i := MCS_TIMEPERPT_MIN begin else if i s MCS_TIMEPERFT_MAX then inc {scan_gl, direct~on) ; 1 := MCS-TIMEPERPT_MAX : I f scan-gl . 1 then timeperpt := MCS_TIMEPERPT[ i ]; scan_gl := 1; end; end; end; PAR-SH dt-POW : begxn case p of nc(sh, dlrectlon) ; PAR-P-CHANNEL : If (d .> dt_ELE) and (sh = WV-SII-DLY) then beg m Inc(sh, dlrectlon) ; ( Skip this value lf not ele ) mc(pow, ch, d~r.sctxon); if sh . 1 then if pow, ch . 1 then sh = wv_shJAX pow Ch := 1 else lf sh > wv-shJfAX then else lf pow. ch > AD_MAX then sh = 1, POW ch = AD_MAX; end, end, PAR-SKI P end, begin dtJ4AS case P of if c in [,0,..,97] then PAPJJNV: mas. inv := 1 - mas. inv; is-num :. true PA~TIMEPERPT: else is_num := Palse; b;gin end; i :. TEK_TIMEPERPT_to_c ode (timeperpt ) + direction; if i E -1 + direction then ( Number did not match any value in begin array. ) i := 1; i :m TEK-TIMEPERPTJ41N j := 1; else i f i < TEK_TIMEPERPTJ41N then resbuf := , ,; i := TEK_TIMEPERFTJIIN while NOT (is_num(ibbuf [i])) do i := i + 1; else i f i > TEK_TIMEPERPTJiA% then while (isnum(ibbuf [i] )) do i := TEK_TIMEPERFTJfAX; begin – timeperpt := TEK_TIMEPERFT [i ]; resbuf [j] := ibbuf[i]; ( Change linked parameters. ) j := j+l; pt := round (ram. scantime I timePerPt ); i := i+l; if pt > MAXPOINTS then end; pt :u MAXPOINTS; val(resbuf, res, errcode) ; end; NBS. scantime :. pt ● timeperpt; end; PAR_M_csANNEL : function ChooseColor (w : integer) : word; begin ( Looks at wave colors currently in use, and returns a color not already inc (mas. ch, direction) ; used, unless all are taken in which case chooses one from color array if mas. ch . 1 then based on wave number w. ) mas. ch := 1 va r else if mas. ch > MAS_CH_MAX then i : integer; mas. ch := MAS_CH_NAX; sel : array [1 .. COLOPnASl of boolean; ( Array to keep track of chosen end; colors. ) end; begin end; for i := 1 to COLORMAX do { Initialize array. ) end; sel[i] := false; end; for i := 1 to wv. num do ( Flag all colors used. ) sel [anticolor[vnr.ls [i]” .col] ] := true; procedure ChangeStep lvar step : real; direction : integer) ; { Look for a free color. ) ( Increases (direction = 1) or decreases (directiOn = -1) the value Of steP in for i := 1 to COI.42FJ4ASdo stages of 1, 2, 5 ‘ (power of 10) . ) if sel [i] m false then begin begin ( Strip away power of 10 to look only at mantissa: ) ChooseColor := COLOR [i ];

case round (exp(ln(step) - LN_10 ● rounddown(ln(step) / LI_10 + SMALL) )) of exit; 1: end; if direction = 1 then ( No untaken colors; choose based on wave number. )

step := step ● 2 ChooseColor := COLOR [(W - 1) rood COLORMAX + 11; else end; step ;= step / 2; 2: procedure ClearArea (xl, Y1, x2, Y2 : integer) ; if direction = 1 then ( Clears area of screen specified by coordinates. )

step :- step ● 2.5 begin else SetViewPort(xl, Y1, x2 - 1, Y2 - 1, CLIPOFF) ; step := step / 2; ClearViewPort; 5: SetViewPort (O, 0, GetMaXX, GetMa%Y, CLIPOPF) ; if direction = 1 then end;

step := step ● 2 else procedure ClearYAXisStuf f (scr : integer) ; step := step / 2.5; ( Clears area containing Y1.abel, ynumbers and yaxis on screen scr. ) end; begin end; with SC. 1s [scr] .gr do ClearArea(ylabel .xl, ylabel. Y1, yaxis. x2 - 1, ylabel .y2) ; . procedure char_ to_imt (var zes : integer; var errcode : inte9er) ; end; var i, j : integer; procedure ClipDot(x, y : real; scr : integer) ; resbuf : Bufstring; ( Draws dot (on screen scr) only if y coordinate is in plot area. Assumes x coordinate already in range. ) function is_num(c: char) : boolean; begin begin If (y >= sc. ls[scr]. gr. yaxis. Yl) and (Y .= sc. ls[scrl gr yaxis. var Y2 - 1) then c word; ( color ) begin I : integer: if ( dotradius = O ) then s : bufstrng; FutPixel (round(x) , round (y) , GetColor) w : integer; else beg in FillEllipse (round(x) , round(y) . dotradius. dotradius) ; ( Just list colors of specified waves. ) end: If tom. cur = corn.num then end; begin cOm_err: procedure ClipLine(xl, Yl, x2, Y2 : real; scr : integer) ; exit; ( Draws segment of line (if any) which falls within Y coordinate limits end; of plot area on screen scr. Assumes x coordinates already in range. ) inc (tom. cur) ; Var s := corn.ls[com. cur]: a : real; ( Generic real. ) if s = ,?, then slope : real: ( Slope of line. ) begin beain wv_sel (1 ): ( Switch starting and ending coordinates if Y1 s Y2: this makes case evalua- for w :. 1 to wv, num do tion much easier. ) with WV. lSIW]- do if Y1 > Y2 then if sel . 1 then begin cOnl_wr_wv(w, ,Col , + COLOSNAMEICO1 ], COLOPJ4ESSI : a := xl; wv_sel_Of f; xl := x2; exit; x2 := a: end a := Y1; else if s = ,df, then yl := y2; C:=o Y2 :. a; else end; begxn ( Now check to see if llne is at all on screen; do nothing otherwise. ) ( Find integer corresponding tocolor name. ) with sc. ls[scrl .gr do c := o; if (Yl <= yaxis. y2 - 1) and (Y2 >= Yaxls. Yl) then i := 1: begin while (i <. COLOFU4AX) and (c = O) do ( See if x coordinates are equal; if so, clipping routine is trivial. ) if s = COLORNAME[i] then i if xl = x2 then c :. begin else if Y1 . yaxis. yl then inc (i); Y1 := yaxis. yl; ( Couldn, t match. ) if Y2 ~ yaxis. Y2 - 1 then if c = O then Y2 := yaxis. y2 - 1: begin end cOm_err; else exit; begin end; ( See if Y1 off screen, and move it on screen if so. ) end; if V1 . Yaxis .Y1 then wv-sel (l) ; begin - xl := xl + (Yaxls. Yl - Yl) . (x2 - xl) / (Y2 - Yl) ; ( Assign colors, ) Y1 := yaxis. yl; sc-sel-of f; end; for w := 1 to wv, num do ( See If Y2 off screen, and move it on screen If so. ) with W,ls [w]- do >f Y2 > Y.3XIS Y2 - 1 then if sel = 1 then begxn begin x2 := x2 + (Yaxls. yz - 1 - Y2) “ (%2 - xl] f (Y2 - Yll: if c . 0 then Y2 :. yaxis Y2; CO1 := COLOR [(W - 1) mod COLOI04AX + 1] end, else end, Col ,= c; sc ls [screen] .sel ,. 1, ( Draw clipped l,ne ) end, Lxne(round(xll , round (yl) , round (x21 , round (y21 ), W-sel_Of f, end, end, ( Update tagged screens ) for- 1 = 1 to sc num do b.) procedure -CO1. if sc 1s!11 sel = 1 then ( Handle wave color variables ) DrawScreen( 1) , (n sc_sel-Of f; begin DrawVitals; error; end; dataread := false; end procedure CreateWave (d, oldw : integer) ; else ( Crcatea a new wave of data type d and filenmne based on wave oldw. dataread := true; There are two flag conditions on these variables: end; 1. If oldw = O, the filename determined by AutoName is used (or ‘‘ is given if auto. fn = O) . function DerivX (w : integer; P : integer; xaxismode : integer] : real; 2. If d . 0, the datatype of wave oldw is used. If oldw = O also, the ( Calculates differential of x for integration routines, etc. This de- default datatype (dt_NIN) is used. ) pends on xaxistne, and dt of wave. ) var var i : integer; t : real; ( Temporary holder for calculations. ) s : bufstring; begin w : integer; ( Temporary wave number. ) with WV.lSIW]” do begin case xaxismode of if w. num . -aves then XAXISMODE_FOINTS: DerivX :. 1; begin XAXISMODE_NORNAL: com_wr (‘Nemory Full. ‘, COLORWL); case par. dt of exit; dt-COR: DerivX := par. cor. ts. step; end; dt-ELE, dt_POW, dt_MAS: DerivX := Par. timeperpt; w :. wv. num + 1; end; XAXISMODE_COWVERT: ( Generate default wave, or COPY contents of oldw, as specified. ) case par. dt of if (w > 11 and (oldw > O) and (d = O) then dt_COR, dt_POW, dtJfAS: DerivX :. par. timeperpt; begin dt–ELE: wv.lslwl”. Dar := wv. ls[oldwla. par; be~in { Reset” so;e parameters. ) t := p ● par. timeperpt - par. ele. cal. tO; WV. Is [wI” .par. yscale := pardf [WV. lsIw]” .par. dt] .yscale; DerivX := 2 ● SIJJPEFACTOR ● par. timeperpt ● wv. ls[wl’’.payoffsetet := pardf[wv. ls[wl’’.padt]t] .yoffset; sqr(par. ele. cal.len) I (t ● t ● t); end end; else if d > 0 then end; wv.ls[wla. par := pardf[dl end; else end; WV.lSIW]” par := paxdf [dt_MINl; Fillchar(wv. 1s [w]” data, sizeof (WV. 1s [wlA.data) , O) ; procedure disc; Initial izeWave (w) ; ( Set system defaults for wave. ) ( Handle discriminator conunand. ) ( Change filename. ) var if oldw = O then dummy : integer; AutoName (w) r: real; else s: bufstring; begin begin wv. ls[wl”. par. fn := wv. ls[oldwl”. par. fn; if corn.cur = corn.num then NextFileNun I(w); begin end; co~err; ( UpdateVitals; exit; UDdate (sc. cur); ( Update screen (note only One needed since all waves end; are created on sc. cur) . ) inc [corn.cur) ; end; s := corn.ls[com. cur] ; if s = ,?, then function dataread (name : integer; numchars : integer; w : integer) : com_wr( ,disc , + nmkestring (discrim ● 1000, VASMAX, VALDEC) + baolean; , !nV,, COLCJRMSSS ) ( Reads the data from the device ,nmne, into buffer of wave w. ) else var begin .s : bufstring; ( debug ) val (s, r, dummy); ibptr : “chararray; r := r I 1000; begin if r < 0 then ibptr := 6(WV.lSIWl-. tmP); comers

ibrd(name, ibptr”, numchars); ( Numchars is PreciselY ~Own, 2 ● Pt. Data else is read into the char array ibbuf. Other routines can then read the same discrim := r; array as an integer-type array using intbuf ’, which is set in Initialize end; to point to ibbuf. ) end; if (ibsta and ERR) <> 0 then procedure _dly: begin ( Set time delay of waves. ) if par. dt .> DT-ELE then Var coKwr_wv (i, enot ELE !e, COLORHL) dly : real; else dummy : integer; com_wr_wv( i, ,dly o + makes tringint (par, ele .dly / POWFS) + i : integer: , fs, , coLZm.wEss ); s : bufstring; end; step : real: WV_sel_Of f; beoin DrawWaveData; ( Update display. ) If corn.cur = corn.num then end; begin cOm_err; procedure DrawAll; exit; ( Sets UP complete screen display for program. ) end; var Lnc (corn.cur) ; scr : integer; ( Screen counter. ) s .= corn.ls[com. curl: begin ifs= ,? o then i f sc. mode = sc_mode_TX_OVR then ( Print delays -- done at end of routine. 1 exit; wv_sel (1) GraphicsMode; else DrawVitals; begin for scr := 1 to sc. num do sten := O: [ Set to O unless user specifies. ) DrawScreen(scr) ; val (s, ally, dummy) ; ( Read delay time. ) end; dly := dly + POWPS; if corn.cur . corn.num then procedure Drawc”rsor (scr : integer) ; ( Look for optional step. ) ( Draws cursor on screen scr - must call after plot.t.xng data and calling begin UpdateCursor ! ) inc (corn.cur) ; begin s := corn.ls[com. curl; if sc. cur .> scr then if s . ,step, then exit; beg in 1 f sc. mode .> sc_mode_GR then if corn.cur = corn,num then exit; begin with sc. ls[scr] .gr do cOm_err; begin exit; if xh.mode . 0 then end; begin inc (corn.cur) ; xf cursorvisible = 1 then val(com .ls[com. cur] , step, dummy) ; begin step := step . POWFS; ( Save area underneath in bitmap: ) end Get Image (cursorx, c“rsoryl, c“rsorx, c“rsory2, bitmap. ); else ( Draw cursor: ) dec(com. cur) ; ( Point back to before wavelist start, ] SetColor (WHITE) ; end; line (cursorx, cursoryl, cursorx, c“rsory2 ); Wv-sel (l) ; end: end ( Assign delays. ) else for i := 1 to wv. num do with xh do .,., with WV. lS[l I- do begin :*: if (sel = 1) and (Dar. dt = dt-ELE) then ( Save areas underneath crosshairs: ) 1 begin Get Image (x[l] , plotarea, yl, x(1] , plotarea, y2, bitmnp. x[l]a); ( Assign delay by first ensuring ts pos, tlon w,ll be valid. ) GetImage(x[Z] , plotarea, yl, %[2] , plotarea, y2, bitmap, x[2}A); par. ele. ts. pos = par ele. ts. tO + dly . HALFSPEEPOFLIGHT; Get Image (x[3] , plotarea, yl, x[3] , plotarea, y2, bLtmap, x[3] A); limit iwar. ele ts, ~os, STAGENIN, STAGENAX) , Getlmage (plot are.a,xl, y[l] , plotarea, x2, y(l) , bitmap, y[l] -); par el~. dly .= (p~r. ele ts. pos - par. ele. ts. tOl / Getlmage(plotarea xl, Y[2] , plotarea ,x2, y[2] , bitmap .y[2 ]-), HALFSPEEDOFLIGHT, Getlmage (plotarea, xl, y[3] , plotarea x2, y[3] , bitmap Y[316): ( Increment delay ) SetColor (WHITE) , dly ,= dly + step, ( Draw active cr.asshairs: ) end, SecLineStyle (SolxdLn, SolldLn, NormWxdth) end, line (x[wh~ch] , plotarea yl, x[which] , plot.are.a Y2), ( Now print delays ) line(plotarea xl, y[whlch] plotarea x2, y[wh~ch] ); for 1 =ltowvnumdo ( Draw inactive crosshalrs ) with wv lS[l]A do Set LlneStyle (DottedLn, DottedLn, Normwldthl ; Lf sel = 1 then llne(x[3 - which], plotarea yl, x[3 - which] plotarea y2) line (plotarea .x1, Y [3 - which], plotarea. x2, Y[3 - which]): r := PtoU(wv. cur, cursorp, XAXISMODS_NOPJ4AL) ; ( Draw center crosshairs: ) p :. Power(r); Set Lifestyle (CenterLn, CenterLn, NormWidth) : if r < 0 then line(x[3], plotarea. yl, x[31, plOtaren. y2); s := makestring(r / P, 7, 5) line(plotarea. xl, Y[31, plOtarea. x2, Y[311; else ( Reset line style to normal before exiting: ) s: =,, + mnkestring(r / P, 6, 5); SetLine Style (SolidLn, SolidLn, NormWidth) ; outtextxy(xl + 6 ● textsize, Y1 + 2 ● textsize, s + f , + end; UnitPref ix (round ( end; loglo (p) )) + XUNITIYPEIWV. ls[wv. cur]” .par. dt, XAXISNODSJJOSM?LL] end; ( ~~nverted. ) procedure DrawCursorInfo; r :. PtoU (W. cur, Cursorp, XAXISNODE_CONVERT); ( All number lengths are VALMAX. TWO formats: ( Patch to prevent O fs from showing UP as 10”-24 s. ) Cursor mode (xh. mode = O) : i f (xaxisdt = dt_COR) and (abs (r ) c POWFS) then r := o; 01234567890123456789012345678 P := FOWer(r); Point Normal Converted if r < 0 then Xxxx -M. xx us -xxx. Xx kDa ( units are exe.ndes onlY ) s := makestring(r / p, 7, 5) Intensity Relative Int. else XXX. XX%1O-WX -XXX. XX%1OVX s := , , + makes tring(r / P, 6, 5); outtextxy(xl + 17 ● textsize, yl + 2 ● textsize, s + , , + Crosshairs mode (xh.mode . 1 ) : UnitPref ix (round ( loglo (p))) + XUNITIYPEIWV. ls[wv. cur] 6 .par. dt, XASISMODE-CONVERT] 01234567890123456789012345678 ); X: Converted Y: Relative Dif. XXX. XX mev XXX. XXX1O”XX ( Y information. ) ctr. -xxx. sx mev -XXX. XXX1OVX outtextxy(xl, Y1 + 3 ● textsize, ‘Intensity Relative Int. ‘): ) ( Intensity. ) Var r := PtoV (WV. cur, cursorP, xaxismode, YAXISMODE_ABSOLVTE) ; p : real; ( Powerof 1000 of r. ) P := Power(r) ; r : real; ( Generic real. ) if r < 0 then s : bufstring; ( Generic string. ) s := makes tring(r / p, 7, 5) begin else if wv. num . 0 then s := , , + nu!kestring(r / P, 6, 5); exit; if p <> 1 then if sc. mode .> sc_mode_GR then s := s + ,x’ + PowerOfTenPrefix (round (log10 (P) )); exit; outtext~(xl, Y1 + 4 ● textsize, s] ; with sc. ls[sc. cur] .gr do ( Relative intensity. ) begin r := PtoV (W. cur, cursorp, xaxismode, YAX16MODE_RELATIVE) ; SetTextJusti fy (LEFTTSXT, ‘3 VPTEXT): P :=1Power(r); SetTextStYle (DEFAVLTFONr, HORIZDIR, 1 ); if r < 0 then SetColor (WWITE); s := makestring(r / p, 7, 5) with cursorinfo do else begin s :=, $ + makes tring(r / P, 6, 5); ClearArea(xl, Y1, x2, y2) : if p c> 1 then i f xh. mode = O then s := s + ,%, + PowerOfTenPrefix (round (log10 (p) )); begin outtextxy(xl + 13 ● textsize, yl + 4 ● textsize, s) ; if (cursorVisible = 1) and (WV. 1s [wv. curl - screen = sc. cur) then end; ( second check should not be necessary, but doesn’ t hurt ) end begin else ( MC info-tion. ) if mc. s c> “ then ( XII mode ) if length (me. s) < cursorinfo. xmax then with xh do outtextxy(xl, Yl, mc. s) begin else case xaxismode of outtextxy(xl, Yl, copy(mc. s, 1, cursOrinfO. ~x - 21 + XAXISNOO&P02NTS: s := ,Points, ; ,. .’); XAXISMODS_NOSMAL: S := ‘Normal ‘; ( X information. ) XAXISMOOS_CONVERT: s := tConverted, ; outtext%y(xl, Y1 + textsize, -Point Normal Converted’ ); end; ( Point .-) OutTextXY(xl + 5 ● textsize, YI, ,X: , + s) ; str(cursorp, s); case yaxisrnode of outtextxy(xl, Y1 + 2 “ textsize, s); YAXISMODEJESOLUTE: s :. ,Absolute, ; { Normal. ) YAXISMODS_RE1.4TIVE: s := ,Relat ive, ; end. beg m OutTextXY(xl + 17 . textsize, Yl, .Y . + s) ; i f sc. mode <> sc-mode_GR then ( X difference, ) exxt; .,. r :. abs(u [2] - u[l I); with sc. ls[scr] .gr do ,, p := Power(r); beg in ,$<: s := makes tring(r 1 p, VALWAX - 1, VALDEC); for w := 1 to tw. num do i f xaxismode = XAXISMODE_POINTS then if (W. lS[W)- .on = 1) and (wv. ls[w]”. screen . scr) then begxn begin if p <> 1 then SetCOlOr(wv. lsIw I”. co1) ; s := s + ,x, + PowerOfTenPre fix(round(loglO(pl )); GetFill Pattern (ten’@); end SetPillPattern( temp, GetColor) ; else ( Find point limits based on screen limits. ) S:=s+ t - + Unit Prefix (round (logl O(p) )) + XUWITTYPE[ P1 := UtoP (w, ullim, 1) : ( Round UP to nearest point in unit space. ) xaxisdt, xax>smode 1; p2 := UtOP(w, u21im, -1): ( Round down to nearest point in “nit space, ) OutTextXY(xl, Y1 + texts ize, ,Dlf. r + s); { Y difference. ) ( Must pass two tests: if P1 = O, then entire wave is to left of screen r := abs(v[2] - v[l I); boundaries; we can forget it:) p := Power(r); if P1 D O then s := makes tring(r / p, VALf44X - 1, VALDEC) ; begin if p .> 1 then xl := Ptox (w..-.Dll : S:=s +,x, + Pow.erOfTenPref ix(round( log10 (P) )): yl := PtOY(w, pll :

OutTextXY (xl + 17 ● texts ize, Y1 + textSi Ze, s) ; ( Otherwise, if entire wave is to right of screen boundaries, OR vxew ( X center. ) is zoomed in so far that the first point larger than ullim is off r := u[31; the right edge of screen, then we shouldn -t plot either. We check p := Power(r); this by looking at xl: ) s := makes tring(r / P, V.ALMAX, VALDEC) ; if xl < xaxis. x2 - 1 then i f xaxismode = XAXISMODE_POINTS then begin begin ( In business I ) if p .> 1 then if wv. ls[w]”, lines = 1 then ( Draw lines. ) S:=s+ $x, + Power Of Ten Pref ix (roundl log10 (P) )); if lxaxisdt = dt_SLE) and (xaxismode = end XAXISMODE-CONVERTI then ( Go backward for energy. ) else for p := PI downto P2 do S:.s+,, + Unit Prefix (round (logl O(p) I) + XUWITTYPE[ begin xaxisdt, xaxismode ]; x2 := Ptox(w, p) : OutTextXY(xl, Y1 + 2 “ textsize, ‘Ctr. J + s) ; y2 := PtOY (w, p) ; ,-.,! ( Y center. ) ClipLine (xl, Y1, x2, Y2, scr); ‘.,,,i r :=v [3]; xl := x2; ,,, p := Power(r): yl := y2; ,4 4 If r . 0 then end s :. makes tring (r I P, VALMAX, VALDEC) else else for p := P1 to p2 do ..’, s ,= v o + makes tring(r I P, VALWAX - 1, VALDEC); begin if p .> 1 then x2 := Ptox (w, p) : ,.,~. S:=s+ ’x’ + PowerOfTenPref lx (round( log10 (P) )), y2 := PtOY(”, p) ; ,.’, OutTextXY (xl + 16 “ texts ize, Y1 + 2 ‘ texts ize, s) : ClipLine (xl, Y1, x2, Y2, scr); end; xl := x2; end; yl := y2; end; end end; else ( Plot dots, ) if (xaxisdt = dt_ELE) rmd (xax~smode . procedure DrawData (scr : inte9er) ; XAXISMODE_COWVERT) then ( Go backward for emsrgy. ) ( Draw wave data on screen scr. ) for p :. pl dc.wnto p2 do “.sr ClipDot (PtoX(w, p) , PtoY(w, P) , scr) p integer, else P1 integer; forp :.pl top2 do P2 : xnteger, CliPDot(Ptox (w. P), PtoYlw, P) , scr) : temp Fill Pattern’Wpe; end; w xnteger, end; xl real: end; x2 real, end, yl real, end, Y2 real, procedure DrawMessageBox, .

var end; W s : bufstring; ( Draw title if on -- also highlighted if current screen. ) to begin with sc. ls[scr] .ti do o if sc. mode sc_nwde_GR then ClearArea(bdy[ l] .x, bdy[l]. y, bdY[2] .x, kdY[2].Y); exit; .auttextxy ((bdy[l]. x + lxfY[21.x) div 2, kdy[ll. y, temp + ‘: ‘ + s); with osc do end; begin SetColor (WHITE); ( Reset color to default for next operation. ) if mode . 0 then 1 SetTextJustify (LEFT2SXT, TOPTBXT); exit: end; Y :. round (VtoY(AO. ls[ch] result, scr) ); ( Corrpute Y value. ) with SC. 1s [scrl .gr.plotarea do procedure DrawVitals; begin ( Draw all information eXCept screens. ) GetIm-age(xl, Y, x2, Y, bit’); { Save area underneath. ) begin SetColor (WHITE) ; DrawMessageBox; ClipLine(xl, Y, x2, Y, scr); { Draw line. ) DrawNaveData; end; DrawCursorInf o; end; end; end; procedure DrawWaveData; procedure DrawScreen (scr : integer); ( Print wave information. Indicator variables for each wave are as follows: ( Draw axes and belonging waves for screen scr. ) begin -X. XX ●Nis/MOS filename if sc. mode sc_mode_GR then begin exit; if sc mode <> sc_mode_GR then ( Draw screen nuniaer in LL corner. ) exit; with sc. ls[scr] .gr do SetTextJustify (LEFTTEXT, TOPTSXT); ( Make X, Y Point to uPPer lef t corner Of begin string. ) if (xon = 1) or (yen = 1) then SetTextStyle (DEFAULTFONT, HORIZDIR, 1 ); ( Select fant, direction, and ClearArea(ylabel .xl, xlabel. y2 - textsize, Ylabel. xl + textsize, size. ) Xlabel. yz) ; with wavedata do ( Make current screen title highlighted. ) begin if scr = sc. cur then ClearArea(xl, yl, x2, y2) ; SetColor(COLORHL) SetColor (WTfITE); else s := VERSION+ , ,; SetColor (WHITE) ; case _bs. dis of SetTexWustif y (LEFT1’SST, TOFT~T) : O:s:= s+,,; str(scr, temp) : 1: s:=s+’DIS’; if (xon = 1) or (yen = 1) then end; Outtextxy(ylabel .x1, xlabel. y2 - textsize, tern); case bs_on of false .s:= s.,. , beg in true : s :=s+ - BS, ; ( Draw tick marks and numbers ) end; u := ulnum; ( X position in user-space of first tick mark a“d number. ) CaSC _bs StS Of repeat O:s:= s+,,: with xaxis do l:s:=s+’STS’; begin end; x := round (utox(u, scr) ); ( Calculate screen x coordinate. ) OutTextXY (xl, Yl, s) ; line (x, Y1, x. Y2 - 2) : ( Draw tick mark. -2 IS to ensure there is end: a space between end of tick mark and beginning of textunderneath, ) fox w := 1 to wv. num do end; begin OutTextXY (x, xnumbers. Y1, makestring (u I xpower, maxxdigits, s := WaveInfo (w, wavedata. mm% div 2) ; xdecinmls) ); ( makes tring () prevents string from exceeding le”qth SetColor [w. lsIwI”. co1) : MAXXDIGITS . )

if w <= MAXWAVES div 2 then ( First column. ) u ,= “ + Ustep: begin until u s u2num + ustep , SWALL; ( Due to small accumulation of error with x := wavedata .x1; each add, 1 allow a generous margin of error at end, though this is still Y := wavedata. yl + w . textsize: only O. 1% larger than exact end point. ) end else ( Draw x label. ) begin with xlabel do x :. wavedata .x1 + textsize , wavedata .xmax div 2: OutTextXY ((xl + x2) div 2, Y1, xlabelstxing + xunits) ; y :. wavedata. yl + [w - MAXWAVES div 2) + texts ize; end; end; end; OutTextXY(x, Y, s) : end; ( Draw box around active scan wave. ) if (w = scanwave) and (WV. ls[wl”. scan. mode s 0) then procedure DrawYAxisStuf f (scr : integer) ; beg in ( Handles all graphics for y axis on screen scr, )

lme(x, Y - 1, x + textsize ● wavedata. xmax div 2 - 1, Y - 1); var linelx. Y + textsize - 1, x + textsize ● wavedata. ma% div 2 - 1, s : bufstring; ( Generic string. ) y + textsize - 1) ; Y: integer; ( Generic screen Y coordinate. ) li”e (x, y, x, y + textsize - 2); v : real; ( Generic user-space y coordinate, ) line(x + textsize . wavedata. xmax div 2 - 1, y, x + textsize . begin wavedata. xmax div 2 - 1, Y + textsize - 2) ; if sc. mode c> sc_mode_GR then end; exit; end; with sc. ls[scr] .gr do end; begin I-J SetTextJust i fy (RIGRITEXT, CENTERTEXTI ; procedure DrawXAxis Stuf f (scr : xnteger) ; SetTextStyle (DEFAULTFONT, HORIZDIR, 1 ); ( Select font, direction, and ( I{andles all graphics for x axis on screen scr. ) size. ) var SetColor (WHITE) ; L : integer; ( Generic integer. ) s . bufstrlng; ( Generic string. ) ( Draw axis, ) x : integer; ( Generic screen x coordinate. ) with plotarea do u : real; ( Generic user-space x coordinate ) begin ( Note line coords are 1 pixel outside active drawing area In all begin directions, ) if sc mode .> sc_mode-GR then line[xl - 1, Y1 - 1, Xl - 1, Y2); ( Left line. ) exit; line (x2, yl - 1, x2, Y21 ; ( Right line, ) with sc. ls[scrl .gx do end; begin SetTextJustl fy(CSNTERTEXT, TOPTEXT) ; if yon = 1 then SetTextStyle (DEFAULTFON’T, HORIZDIR, 11 : ( Select font, direct.ion, and begin size ) ( Draw tick marks and numbers. ) SetColor (WHITE) ; v := vlnum; ( Y position in user-space of first tick mark and number. ) repeat ( Draw axis ) with yaXIS do with plotarea do beg In begxn ( Note llne coords are 1 pixel outside actxve drawing area in all Y ,. round (VtoY (v, scrl ); directions ) llne (xl + 1, y, X2 - 1, Y) : ( Draw tick mark +1 is to ensure there LS line (xl - 1, yl - 1, x2, Y1 - 1), ( ToP line ) a space between emd of tick mark and beglnnmg of text to the left ) lme (xl - 1, Y2, x2, Y2), ( Bottom line ) end, end, OutText XY(ynumbers X2 - 1, y, makes trlng(v f mower, MAXYDIGITS, ydecunals) ), ( nmkestr~ng( ) prevents string from exceedxng length w if xon . 1 then MAXXDIGITS ) w v :. v + vstep; DrOCedUre EraseWaves; until v > v2num + vstep . SMALL; ( KNe to small accumulation of error with ~ Erase all tagged waves. For each erasure, must move waves above it each add, I allow a generous margin of error at end, though this is still down, if any. Keeps cursor the same unless it was on deleted wave. in only O. 1% larger than exact end point. ) which case, it inherits wave moved into its place, or previ, us wave if none. Marks affected screen. } var ( Draw y label. Note that there seems to be a bug with vertical printing: active : boolean; ( Flag indicating wave is active. ) neither LEFTTSXT nor RIGHTLSXT works properly: LEFTTEXT prints 8 pixels to s : bufstring; the left of expected; RIGHTTEXT prints 1 pixel to the left - i.e. , they w, W2 : integer; ( Wave counters. ) both print at the same position, given an x value. ) begin SetTextJustif y (LEF’ITEXT, CENI’ERTEXT) ; for w :. W. num downto 1 do ( Must count backward to work. SetTextStyle (DEFAWTFONT, vERTDIR, 1 I; if wv.ls[w]”. sel = 1 then with ylabel do begin OutTextXY (x2, (YI + Y2) div 2, ylabelstring + yunits) ; str(w, s); end; ( Check to be sure wave is not active. ) active := false; ( Reset text parameters for next operation. ) if WV.lSIW]”. scan. mode > 0 then SetTextJustif y (LEFTTEKT, ‘IWTEXT); active := true SetTextStyle (DEFA~TFONT, HORIZDIR, 1 ); else if (addwaves. mode = 1 ) and (w = addwaves. w) then end; active := true; end; if active then cOm_wr (,Cannot remove active wave ‘ + s + ‘!,, COI13RHL) procedure EraseCursor (scr : integer] ; else ( Erase cursor on screen scr. Must already have checked for cursorvisible begin = 1, viv.num > 0. ) ( Keep various wave Pointers on correct wave: ) begin if wv. cur >= w then if sc. cur sc_mode-GR then dec (addwaves. w ); exit; if scanwave > w then ( Cannot delete scanning wave. ) ( Restore bitmap(s) recorded in DrawCursor. ) dec (scanwave 1; with sc.ls[scrl .gr do if men. w . w then begin men. w :. 0 ( Turn off man. ) if xh. mode . 0 then else if men. w > w then begin dec (men.w) ; if cursorvisible = 1 then if _bs. bg >. w then Put Image (cursorx, cursoryl, bitmap’, NORMALPGT) dec(_bs, bg); ( Ok if this goes to O. ) end if _bs. fg >= w then else with xh do dec(fis. fg) ; ( Ok if this goes to O. ) begin ( for W2 :. 1 to wv. num do FutImage(x[ll , plotarea. yl, bitm.ap.x[ll”, NOwp~): with WV. 1s [w2]” par do PutImage (x[21 , plotarea. yl, bitrrap.x[21”, NORMALPGT); if dt E dt-ELE then FutImage(x[31, plotarea. yl, bitm.p. x[31”, NOmp~); if ele. bg > w then FutImage (plotarea. xl, Y[ll, bitmap .y[ll’, NO-PUT); dec(ele. kg); ) PutImage (plotarea. xl, Y[2] , bitmap. y[2]”, NOWPUT) ; Sc.ls[wv. ls[w]”. screen] .sel := 1; ( T4g SCI-een. ) FutInLa9e (plotarea. xl, Y[3 1, bitnu.p.y[3 1‘, NORMALPGT); for W2 := w to wv. num - 1 do ( Perform erase. ] end; wv. ls[w2]~ := WV.1S[W2 + 1]”; end; dec(wv, numl ; end; end; WV. ls[w]*. sel := O; ( ?urn off wave tag. ) procedure EraseOsc; end; [ Erase virtual oscilloscope (if on) . 1 ( Patch toprevent cursor from vanishing. ) begin if (wv.num > O) and (wv. cur = O) then if sc. mode <> scDIode_GR then Wv. cur := 1; exit; end; with osc do begin procedure error; if mode = O then ( Prints error message to screen fault is found during ibrd. ) exit; begin FutImage(sc. 1s [scrl .gr. plotarea. xl, Y, bit-, NORKU.PUTI ; if (ibsta and SRR) c> O then end; comwr (-Found an error. Redoing scan. -, COLORHL) ; end; ( begin Textmode; . .,. Wr1teln{#7. Found an error ,) ; dc.ta[> + 1] := data[l + 1]; writ.eln{,ibsta = ,, ibsta); data[i] := t~r; Wrlteln(rxberr = ‘, ~berr), data[i + 1] := tempi, xf iberr = EDUR then writeln (, EDVR ’ ): end; if lberr = ECIC then writeln (, ECIC .Not CIC, -): m := ndiv 2; ,>.: if xberr = ENOL then wrlteln (, SNOL .No Listener>’ ); while (m >= 2) and (j > m) do begin if iberr = EADR then writeln (e EADR .Address error>, ); j:. j-rf,; if iberr = EARG then writeln (o F.ARG .Invalid argument>, ); m :. mdiv 2; if Iberr = ESAC then writeln (r ESAC .Not SYS Ctrl>’ ): end; if iberr = EABO then writeln (, SABO ’ ): j:. j+m; if iberr = SNEB then writeln (, SNEB .No GPIB boards> r); end; if iberr = EOIP then writeln (, EOIP .Async I/0 in prg>, ); Iranax:= 2; if iberr = ECAP then writeln (, ECAP ’ ); while n > ntnax do begin if iberr = EFSO then writeln (e EFSO .File SYS. Error>, ); istep := 2 ● mmax; i f iberr = EBUS then writeln (, EBUS , ) ; Wr := -2.0 + sqrlsin(O.5 . theta)); if iberr = ESRQ then writeln (, ESRQ .SRQ stuck on>’ ); wpi := sin [theta) ; if iberr = STAB then writeln [‘ ETAB

’ ); wr := 1.0; ,..., writeln( ,ibcnt = e, ibcnt) ; W1 := 0.0; delay (2000) ; for ii := 1 to (mnax div 2) do begin Graph icsmode: m:=2. ii-l; DrawAll; for jj := O to (n - m) div istep do begin end; ) i := m+ jj ● istep; end: ]:. i+mmax: tetrpr := wr . data[j] - WL . data[j + 1]; procedure Exit Program; tempi := wr . data[j + 1] + W1 + data [j]; ( Check If user wants to exit, then checks if waves are saved, allowing data[j] := data[i] - tempr; user one more chance to exit if there are unsaved waves. ) data[j + 1] := data[i + 1] - tempi; va r data[il := data[il + temm: I : Integer; datali”+ 1] :. data[l + 1] + ter@L; begin end: if com_wrfl (‘Exit pro9ram’ I = O then wte~ := wr; exxt; wr := wr ● wpr - wi . wpi + wr; exltflag := true: wr:=wi. wpr+ wte~ . wpi + wi; ( Check that all waves are saved. Search until we find one which end; isn, t. ) mnax := istep; for i := 1 to wv. num do end; with W,l SII1- do end; if (datasaved = O) or (parsaved = O) then begin function FileExists (fn : bufstring) : boolean: if com_wr~n (,Not all waves saved. Still exit’ ) = O then ( Checks whether or not file ofn( exxsts, returning TRUE if so, FALSE if exit flag ,= false; not. ) exit; var end; f : file; ( File variable. ) end; begin assign (f, fn); procedure fft (var data : fft_array-type; nn, islgn : Integer) ; ($1-) ( Fast Fourier transform procedure of data. nn is number of points, reset(f) ; isign indicates direction of Fourxer transform, 1 or -1. ) (S1+) va r if IOResult . 0 then 11, jj, n, mn.ax< m, ], lstep, i : integer; begxn wtemp, wr, WIX, wx, WL, theta : real; FlleExlsts .. TRUE; tempr, templ real, close(f) ; begin end n,=2. nn, else ] ,= 1, FileExists . FALSE, ( File never opened Lf 10Result .> 0, ) for xl =ltonndo end; begin 1 .2 ,11-1! (funct Ion fLnd-extensxcm ls string) integer, If (I > i) then begin ( Returns numeric extension. or O if non-numeric ) tempr = data(]), (var tempx = data[] . 11, 1 ;nteger, data[)l . daca[il v Lnteger, d : integer; ( OumnY code. ) ( Look for first wave on screen scr which is visible, ) (Al [beain for w :. 1 to wv. num do N i-:= length(s) - 1; with WV. lSIW]” do -P while (i > 1) and [i > lenuth(s) - 4) and (s [i] <> ‘.’) do if (screen = scrl and (on = 11 then i:= i-l; begin v := o; FindNave := w; if s(i) = ,.’ then exit; val(copy(s, i + 1, length(s) - i), v, d); end; find_extensiOn :. v; ( Give UP: return O. ) end; ) FindWave :n O; end; function FilenameStart (s : string) : integer; ( Finds Position in s where filename part starts; all text to left of this procedure FitBs; point is the path. ) { Scales all bs ele scans by l/tot. ) var var i : integer; i : integer; begin r : real; for i := length(s) downto 1 do begin case s[il of ( Find wave to scale to: use current if valid bs ele; otherwise use ,,<, ,:8 : first one. ) begin r := 1; ( Set as default to avoid /0 error. ) FilenameStart := i + 1; with wv.ls[wv. cur]” do exit; if (uar. dt = dt_ELE) and (Dar. ele. bs mode = 11 then end; r ;= par. ele. ~s. tot - end; else FilenameStart := 1; for i := 1 to wv. num do end; with wv.ls[i]” do if (par, dt . dt_ELE) and (par. ele. bs. mode = 1) then function FileCpenWrite (var f : text; s : string) : boolean; begin ( Opens file for writing using error suppression to detect disk errors r := par. ele. bs. tot; without crashing program. ) ( Avoid /0 error: ) begin if r < 1 then assign (f, s); r:=l {$1-) else rewrite (f ); i := wv. num; ( Trick to get out of loop. ) ($1+) end; if IOResult = O then FileOpenWrite :. trU.3 ( Scale other waves. ) else begin sc-sel-off; ( Clear screen sel tags. ) conwr (‘Cannot owen ‘ + s, COLORWL); for i :. 1 to wv. num do FileOpenWrite :. falSe; with wv.ls[i]- do w end; if (par. dt = dt_ELE) and (par .ele. bs .tnode = 1) then end; begin par. yoffset := O; function FindWave (scr : integer) : inte9er; if par. ele.bs. tot z O then ( Returns number of first visible wave on screen scr. Otherwise returns par. yscale := r / par. ele. bs. tot 0. ) else var par. yscale := O; ( This will signal user that tot = O. ) w : integer; SC. ls[screen] .sel :- 1: ( Tag screen. ) begin sc. 1s [screen] .gr. yaxismode := YAXISMODE_RELATIVE; ( Return O if no waves. ) end; if wv. num = O then UpdateSel; begin end; FindWave := O; exit; procedure FitY (d : integer); end; ( Changes WV. 1s []- par. yoffset and .yscale of each visible wave, ( If current wave on screen, use this in preference to first W. 1s. ) so limits all fit on screen together (like fullview, but in if kv.ls[wv. curl”. screen = scr then relative y mode) . Applies to screen containing wave w only. ) begin ( Using current wave, or first qualifying wave if current wave doesn’ t FindWave := wv. cur; qualify, as a reference, changes yoffset and yscale of other visible exit; waves of datatype d (or all datatypes if d . dt_MIN) so that they all end; have same v limits. ) var ( Work with real Y values. ) x : inte9er; { General counter. ) ( SC. 1s [SC. Curl .gr .yaxismode := YAXISMODE-ASSOLUTE; wref : integer; { Wave reference # ) UpdateVLimits; vrange, Vrangecur : real; ( Temporary vmax - mm. ) UpdateYAxis (SC. cur) ; begin ( Find wave with largest Y range. ) .“? if wv. num = O then ( with wv.ls[wv. cur]~ do ,. exit; vrangecur := vmax - vmin; i f addwaves. mode = 1 then i f vrangecur < 1 then begin vrangecur := 1; ( Prevent yscale from being O; I use stipulation co~wr (,Cannot fit Y %n addwaves mode. 0, COLOSHL) : that vrangecur . 1 to prevent problem of roundoff error making ..: exit; it not exactly O, but still close enough to rake yscale tiny. ) end: ( Scale all other waves to fit this range. ) ( Find all qualifying waves, changing their screens toabsolute mode, ( forw :. 1 tou,v, numdo marking screens for later, and recording first qualifying wave with with WV. ls[w]a do wref. i if on = 1 then sc_sel_Of f; begin wref := O: vrange := vmax - vmin; for i := wv. num dohmto 1 do ( Go backward so wref = first wave. ) if vrange < 1 then with wv. ls[il” do vrange := 1: ( Same idea as above, but now to prevent 1 0. ) if (on = 1) and ((d < dt-MIN) or (par. dt = d)) then ( par. yscale := vrangecur / vrange: begin par. yof fset :. -vmin . par. yscale; wref := i; end; sel := 1; ToggleYAxisMode (SC. cur) ; ) sc. Is [screen] .sel := 1; end; sc, 1s [screen] gr. yaxismode := YAXISMODEJBSOLVTE; end; procedure fpes_sv (s : bufstring) ; ( Switch reference to ww, cur if it qualifles. ) ( Save parameter file for fpes macro to file s. ) if wv. ls[wv. cur]” .sel = 1 then var wref := wv. cur; bg : integer; ( Exit if no waves qualifY. ) f : text; if wref = O then i : integer; exit; begin ( Recalculate wave v limits. ) ( GO thru active files and ensure that if _bs, bg > 0, and there are UpdateVLimits; intervening waves which are mt bs mode, or not ELE datatype, that ( Calculate reference lmxts, ) _bs .bg is decreased appropriately. ) with WV. ls[wref]- do UpdateBg; ( Make sure b is consistent with current waves. ) vrangecur := VIIU.X- vmin; k := -bs .&; ( Assi9n to temp variable. ) if vrangecur . 1 then ~_sel-Of f; vranuecur := 1: ( Prevent Yscale from being O; I use stipulation if h P O then that vrangecur < 1 to prevent problem of roundof f error making begi~ it not exactly 0, but still close enough tomake yscale tiny. ) ( Now 90 through waves up to txd and decrease value of bg for ( Scale all other waves to fit this range. ) every one which is not a bs ELE wave, AI SO, highlight waves for i := 1 to wv, num do whose delc.vs will be written to file, ) with wv. ls [i]” do forx:=lt; bg-ldo if sel = 1 then wxth wv, ls.[i]~ do begin if (par, dt = dt_ELE) and (par. ele. bs, mode z O) then vrange := vmax - vmin: Sel := 1 if vrange . 1 then else vrange := 1; ( Same idea as above, but now to prevent /0. ) declbg) ; par, yscale := vrangecur I vrange; ( COntxnue past bg wave, ) par. yoffset := -vmin “ par. yscale; for x := _bs. bg to wv, num do end; with wv, ls [i]- do ( Now go back to relatlve mode for all screens and update: ) if (par. dt . dt-ELE) and (par, ele, bs, mode > O) then wv-sel-of f, sel := 1; for I := 1 to sc numdo end with SC, lS [l] do else ( Highlight waves for non-bs file, ) if sel = 1 then for i = 1 towvnumdo gr. yaxx smode = YAXISMODE-RELATIVE , with wv. ls [i]- do Updatesel, if par dt . dt_ELE then Sel = 1, ( Make current screen one with current wave (call ChangeCurrentWave in b.) order to update some other variables, too) ) ( Prepare filename, ask for permxsslon to overwr; te if It exists ) to ( ChangeCurrentWave [01. if get_extensxonlsl . then w S:=s+ , . - + FPESJXT; ( Returns file extension of filename s. ) ( if not fullpath (s) then var s := dir + s; ) ( Use home directory instead of data directory. ) i : integer; if fileexists (s) then begin if couwrfl( ‘File , + s + , exists. Overwrite’ ) = O then i := length(s); exit; while (s[i] <> ‘.’1 and (i >= length(s) - 3) do dec(i) ; ( Write file. ) ( Check to ensure file extension exists! ) assign (f, s); if i >= length(s) - 3 then rewrite (f) ; get_extensiOn := COPY (5, i + 1, length(s) - i) writeln(f, bg) ; else for i := 1 to wv. num do get_extensiOn := ‘‘; with wv.ls[il - do end; if sel = 1 then begin procedure Graph icsMode; writeln(f, par. ele. dly / POWFS) ; ( Restore screen towaphicsmode after being initialized (see cOm_wr (*WV , + makes tringint (i ) + ‘ dly saved. ‘, COIXX+MESS ); InitGraphics ) . ) end: begin close(f); SetGraphMode (graphmode); w_sel_Of f; sc. mode := scSode-GR; DrawWaveData; end; end; procedure Selp; function fullpath(s : bufstring) : boolean; ( Displays help screen from file HELP_PW. 1 ( Determines if filename s contains a full path or is just an extension of the var current path. Criteria: e : boolean; ( S%it flag. ) f : text; Return TRUE if s [11 = ‘\‘ (root reference] or s [2] = ‘:’ (drive reference). i : integer; ( General counter. ) Return FALSS otherwise. 1 : integer; ( Line counter. ) ) lines : integer; ( Ma%. lines in help file. ) begin s : bufstring; if (s [11 = ‘\’) or ((length(s) > 1) and (s[21 = ‘: ’1) then begin fullpath := true ( Check to make sure file exists. ) else if FileExists (HELP_FN) = false then fullpath := false; begin end: com_wr( ‘Help file not available. ‘, coIm.HL) ; exit; procedure FullView (i : integer) ; end; ( Quick command to make both x and y axes full-width on screen i. ) begin { Determine number of lines in help file. ) sc. ls[il. gr. xfullmode := 1; assign( f, HSLP_PN) ; sc. ls[il .gr. yfullmode := 1; reset(f) ; update (i); lines := O; end; repeat readln(f, s) ; function GainCode (adgain : integer) : inte9er; inc (lines ); { Calculates gain code used by ADReadAsm: until eof (f) ; adgain GainCode close(f); 1 0 2 16 ( Initialize other variables. ) 4 32 TextMode; 8 48 e := false; ) 1 := 1; begin case adgain of repeat 2: GainCode :. 16; clrscr; 4: GainCode := 32; TextColor [WliITE); S: GainCode := 48; assign (f, HmP_FN) ; else GainCode := O; ( Unity gain for 1, Plus any garbage codes. ) reset(f) ; end; ( Skip lines before current section. ) end: fori:=ltol-ldo readln(f, s) ; function get_extension(s : bufstrin9) : bufstrlng; for i := 1 to HELP_LINESPESPAGE do if not eof (f) then end begin else readln(f, s); begin writeln(s) ; pl := UtoPlw, gr. xh u[2], -l): end: p2 := utoP(w, gr. xh u[l I, 1): ... close(f ); end; textcolor (LIGHT?4AGSNTA) ; for i := P1 top2 do write (,Use up/down, page upldown, homelend to scroll. Press ESC to exit. 8); in fo. area := in fo. area + PtOV(w, i, gr. xaxxsmode, gr .yaxismode)

● DerivX (w, i, gr, xaxismode) ; ( Now wait for user input. ) end; case readkey of in fO_area := info. area; ESC: e := true; end; EXTSNDED : case readkey of function in fO_avg (w : integer) : real; XARROWLX2NN :- ( Calculates the average of wave w. Requires area to be known (call ,, if 1 < lines - HELP_LINESPERPAGE + 1 then info-area) ) inc (l); var ,:., XARROWLIP : dx : real; ( x-axis difference. ) ;,.; if 1 z 1 then begin dec [l); in fO_avg :. O; .... XSND: 1 := lines - HELP-LINESPERPAGE + 1; with W. lsIw]’ do ,>,: XHOME: 1 := 1: if par. pt ~ O then XPAGESONN: begin beg in d% := abs(PtoU(w, par. pt, sc.1.s[screen] .gr. xaxismode) - Pt.aU(w, inc (l, HELP_LINESPERPAGE - 1 ); ..‘J, pmin, sc. 1s [screen] .gr .xaxismode) ); ( Use abs to take into account ifl> lines - HELP-LINESPERPAGE + 1 the” the reversal in orientation for energy space. ) 1 := lineS - HELP-LINESPERPAGE + 1; in fO_area (w) ; end; if d% > 0 then XPAGEUP : in fO_avg :. in fo, area I dx: beg in end; dec(l, HELP-L INESPERPAGE - 1 ); end; iflc 1 then 1 :. 1; function in fo_edge(w : integer; P1, P2 : integer; fifty : real) : real; end; ( Calculates positxon of edge, given point limits P1, P2, and 50% end; intensity value fifty, ) end; var until e; P : integer; DrawAll; xl, x2, yl, y2 : real; end: procedure loop; funct Lon lnfO_area (w : Integer) : real; beg in ( Calculates the area of wave w. Uses variable binning depending on with SC. lSIWV. ls[w]-. screen] .gr do xax~smode and dt. ) begin va r x2 := PtoU(w, P, xaxxsmodel , “,. I integer; Y2 := PtoV(w, p, xaxismode, yaxismode) ; P1, P2 : integer: if (Y1 .= fifty) and (Y2 >. fifty) then begin begin info.area := O; if yl <> y2 the” with WV. lSIW]’ do lnfo_edge := (xl . (Y2 - fxfty) + x2 . (fifty - Y1)) / with SC. ls[screenl do (y2 - yll begin else If (screen = sc cur) and (gr xh. mode = 1) then info-edge :. (xl + x2) I 2, ( Full range. ) P := P2; ( Trick to get out out 100P ) begin end pl = 1, else p2 = par. pt; begxn end xl = x2; else yl = y2; ( Use crosshalrs to specify range ) end, If gr XII u[ll < gr xI> u121 then end, begin end, p 1 = UtOP(W, gr xh u[l], 1), P2 = UtOPIW, gr xh u[21, -1), with sc. ls[hv. ls[wl”. screenl .gr do end; bgin V1 := PtoV(w, P1, xaxismode, yaxismode) ; xl := PtoU(w, PI, xaxismode) ; V2 := VI; VI := PtoV(w, RI, xaxismode, yaxismode) ; for ptemp :. P1 + 1 to P2 do ~ f PI . P2 then begin forp:=pl+ltop2do rtemp :. PtoV (w, ptemp, xaxismode, yaxismode ); loop if rtenm c V1 then else V1 := rtemp; for p := P1 - 1 downto P2 do if rtemp > V2 then loop; V2 :. rtew; end; end; end; fifty := (Vl + V2) / 2; end; procedure info-edges (w : integer; vf ind : inte9er); end; ( calculates the left and right 50% edge positions of wave w, and also if (PI > O) and (Pl <= par. pt) and (P2 > O) and (P2 <= nar. Dt) the center and fwhm (average and difference of edge positions, stor- then ing all in the info record variable. ) begin Var if PI > P2 then fifty : real; ( Switch so ‘for’ loop will work. ) PI, P2, ptemp : integer; begin rtemp : real; pteue := pl; v1, V2 : real; pl := p2; begin P2 := ptemp; with info do end: begin edgel := info-edge (w, PI, P2, fifty); fwhm := 0: edger :n info-edge (w, P2, P1, fifty) ; Ctr := 0: if edgel > edger then edgel := O; ( Switch. ) edger := O; begin with WV.lSIW]A do rtemp := edgel; begin edgel := edger; if (se.num P2 then begin ( Switch so ‘for, loop will work. ) S2 := XUWIITYPE[par. dt, SC. ls[screenl .gr. xaxismodel ; begin if (s2 = ,8) or (code = 0) then ptemp :. pl: begin pl := pz; if P c> 1 then p2 := ptemp; S2 := ,x, + PowerOfTenPrefix (round (log10 [P) )) else w~th wavedata do S* .=,., beg Ln end xl := cursor info. x2 + texts lze: ( Leave one space for readability. ) else x2 :. GetMC&i + 1; ~~:=,. + Un>t Prefix (round (logl O(pl )) + 52; xmax :. (x2 + 1 - xl) div texts~ze, ynmx := MAXWAVES div 2 + 1; cOm_wr_wv (w, s + o 0 + makes tringlr / p, VALMV&, VALDEC) + s2, Y1 :. cursor info. yl; Colorless ); y2 := cursorinfo. yl + ymax . textsize: end; ma%wavenamelength := xnmx div 2 - 14; ( Define number of characters that can be displayed for wave names. ) procedure InitGraphics; end: ( Launch graphics mode. This procedure is copied from Turba Pascal Reference with messagebox do Manual, pp. 138-139 ) beg in var xl := cursor in fo. xl; errorcode : integer; x2 := cursOrinf O.x2; graphdriver : integer; yl :. cursOrinfO. y2; maxcolor : integer; ( debugging only! ) Y2 :. wavedata. y2; beg in ~x := (x2 + 1 - xl) div textsize; graphdriver := DSTECT; ymax := (Y2 + 1 - yl) div textsize; InitGraph (graphdriver, graphmode, ‘D: \BP\BGI’ ); end; errorcode := GraphResult; ( New: add this information to the com block. ) if error code

+------++------+ procedure Initialize; Icursorinfo II ( Gets program running. ) II wavedata Var + ------+ i : integer: Imessagebox I~ begin - ++ -- ++ ----- ++ ------+ -+ ( Set UP graphics housekeeping, Note that I seem to get error messages II ++ II if I ‘ve already printed to text screen before I call InitGraphics. ) Ylabel------>l II II InitGraphics; II II plot area II ynu~ers------> I I II ( Reserve memory for variables. ) II II II Get f.fem(bitmap, im.agesize (O, O, 0, CURSORLENGTH) ): ( Cursor bitmap yaxis------> I II buffer. ) II II II for i := 1 to scm do ( Graphics screen cros.sha~r bitmap b“f fers. ) II ++------+ I with sc. ls[i]. gr do +++-++------~--+-+ begin screen H------> + ------” ------l----+ GetMem(xh. bitmap .x[l] , irnagesize (O, sc.lxiy[l]. y, O, sc +-+----’------l------[----+ bdy[21. y)); I GetMem(xh. bitmap, x[2] , images ize(O, sc, kdy[l] y, O, sc xlabel xnumbers xaxls bdy[21. Y)); ) GetMem(xh, bitmap, x[3], mageslze(O, sc, bdy[l] y, O, sc with cursor xnfo do MY121. YI); begin Getf.fem(xh,b~tmap, y[l], mageslze (se, tx!y[l] x, o, Sc xmax := 29, bdy[21 .x, 0)); wax = 5; GetMem(xh. bitmap .y[2], unages~ze( sc, bdy[l] x, o, Sc xl .= o; b-5Y121 x, 0)): x2 = xnmx . textslze. { Number of characters needed ) GetMem(xh b~tmap y[3] Images ize(sc bdy[l] x, o, Sc yl = o; bdy[2) X, O)); Y2 . ymax . textsxze end, end, for x = 1 to MP.XWAVES do ( Waves ) New(wv. ls[il); pmin := 1;

GetMom(com. tx. buf, corn.tx. num. x ● corn.tx. num. y); ( Com text buffer. ) savemode := O; GetMem(cOm. tx. cOl, 2 “ corn. tx. num. y) : ( COM color buffer. ) screen := sc cur; ( Flace on current screen. ) GetMem(osc. bit, imagesize (se. bdy[l] .x, O, sc. bdy[2] .x, O)); ( Virtual scrm. mode := O; oscilloscope bitmap buffer. ) sel := O; fillchar(tmp, sizeof(’urp) , O) ; ( Declaration odds & ends. ) end; for i :. 1 to COLORMAX do ( color-to-code array. ) ( Other things which should be done for newly loaded fcreated wave. ) anticolor[COLOR[il 1 :=’ i; wv. num := w; { Now safe to increase wave number. ) exitflag := false; w. cur :E w; ( Make cursor point to new wave. ) newworkspace :. 1; ChangeCurrentWave (O ); ( Update screen #. ) ts. pos := o; SC. 1s [se,cur] .gr. cursorvisible := 1; ( Force cursor to be vi- rtacro_override := O; sible for NewCursor. ) NewCursor; ( Place cursor in middle of wave. ) ( Set up com variables: blank out buffers, put cursor in upper left. ) sc.ls[wv.ls [wv. cur] ”.screen] .gr.xaxisdt :=

FillChar (corn.tx. bufA, corn.tx. num. x ● COM. tX. nUM. Y, ‘ ‘); W. 1s [wv.curl” .par. dt; ( Force most recently loaded for i := 1 to corn.tx. num. y do wave to be the screen’s current dt; this is only corn.tx. CO1” [i] := C020RUSER; important if xaxisrnode <> POIN’rS. ) corn.tx. cur. x := 1; end; corn.tx. cur. y := 1; procedure Init-ts; ( Set default comnand to null (in case user initiates session with !! ) ( Initialize translation stage when load new workspace. ) corn.num :. O; begin corn.sv := ‘x’; MakeLookup; ( Recalculate lookup table. ) corn.old := “; if dev_rd . 1 then begin ( See if user wants to disable devices; otherwise open some. ) [ Set current acceleration and velocity. ) textmode; Wite(C0M2, ,#FCAS6J, LF, ‘B, , makestringint(ts.ace) , LF) ; Clrscr ; delay (ACKOSLAY) ; TextColor (wSITE) ; write (COW2, ACK) ; writeln( ‘Disable devices for analysis use only (YeslNo) ?’ ): delay (ACKOELAY ); dev-rd :. -1; write (CON2, ‘tPCAB7’, L@, ,B, , nmkestringint(ts.veil , LF) ; repeat end; case readkey of end; ‘y, , ,Y, : dev-rd := o; ‘n, , ,N’: dev_rd := 1; procedure Integral; EKTSWDED: readkey; ( Crosshairs mode only: Calculates integral (sum, actually) of region bounded end; by x-axis xh, printing result in message box. Currently not set up until dev_rd c> ,-1; to properly integrate in energy-space, so gives error message. ) Var I Ouen channel. to translation stage. ) accum : real; ( Integral. ) if dev_rd . 1 then R: real; ( Power. ) begin pt, pl, pz : integer; ( Point counters. ) 4ssign(c0m2, ‘COMZ’ ) ; s : bufstring; ( String. ) rewrite (coti ); u, ul, U2 : real; ( U-space counter. ) end; begin if wv. num = O then ( Read workspace. ) exit; ws_rd (WS_FN_DF ); with sc.ls[sc. cur] .gr do end; begin if xh. mode . 0 then procedure InitializeWave (w : integer ); begin ( Set wave system parameters to their defaults when a wave is first created or conl-wr( ‘Must be in %h made. ,, COLOfUiL) ; read in. ) exit; begin end; with W. 1s [w]” do if wv.ls[wv. cur]~. screen <> sc. cur then begin begin CO1 := ChooseColor (w); comwr [,Current wave must be on screen. ,, COLZXU-IL); data saved := 1; exit; lines := 1; end; massl := 0; if (xaxisdt = dt_ELE) and (xaxismode . XAX16WODS_CONVERT] on :. 1; then parsaved := 1: begin COILWI (oCannot mtegr.ate in energy space 0, COLORHL ); begin exit; textmode, end; clrscr: ( COPY xh lim~ts to own variables, ) TextColor (WHITE) ; U1 := xh. u[ l]; writeln; U2 := xh. u[2]; writeln: ( Ersure U1 .= u2. ) writeln_ctr (HSAD_WV, CEW) ; if U1 > U2 then write ln_ctr lHEAD_WS, CEW) ; begin writeln; >>.! u := Ul; writeln_ctr( ‘Jeff Greenblatt, , CEN) ; U1 := U2; write ln_ctr (,Gordon Burton, , CEW) : U2 :. u; write ln_ctr (,Martin Zanni -, CSN) ; end; writeln: P1 := UtOP(wv, cur, u1, 1); .. write ln_ctr 8Pata Acquisition and File Comparison Program. ,, CENI ; ,.,,~ p2 := utOP(w, cur, U2, -l): writeln_ctr ,Supports file versions E and later. ,, CEW) ; accum := O; writeln; for pt := P1 to P2 do writeln; accum :. accum + PtoV (W. cur, pt, xaxismode, yaxismode ); writeln; p := Power (accum) : writeln; str(accum I P : VALMAS : VALDEC, s); writeln; com_wr (‘Integral = o + s + ‘x’ + PowerOfTenPref ix(round(Log10 (P) )), writeln_ctr ,Press F2 to get to system control menu, or any other key to start. ,, COLOP.MESS ); CEW) ; end: if readkey EXTEWDED then end; if read~ey = XF2 then SystemControl; procedure intelligent_f ilename (s : buf string; var aser : buf string; var end; anum : integer; var ext : bufstring) : ( Analyzes string s for series, number and extension parts Returns function is_bg (w : integer) : boolean; series in aser, number in anum and extension in ext. ) ( Checks if any wave >s calling w its background wave. ) var va r dash : boolean; i : integer; dummy : Integer; begin i : integer; for i := 1 to wv, num do begin with wv. ls [i]- do ( Get EXT if it exists. ) if (par. dt = dt-ELE) and lpar. ele, bs. mode = w) then ext := act–extension (s) : begin if ext .> 7, then is_bg := true; s := COPY(S, 1, length(s) - length (extl - 1) : ( Omit extension from exit; string. ) end; [ See if we have WUf4 onlY, or SER-WUM. ) is_bg :. false; dash := false: end; for i := length(s) downto 2 ( don’t check for ,-o in first could be a directory symbol ) do function is_num(s : bufstrlng) : boolean; if s[il = ,-, then ( Determines if s is a number. ) begin Var ( Extract auto. ser and auto. num. ) i : integer: aser := copy (s, 1, 1); begin val(copy(s, I + 1, length(s) ), anum, dumny); for i := 1 to length(s) do i := 2: ( Trick to get out of loop ) if ((s [i] . ‘O, j or (s(i] > ,9,)) and (s[i] .> ,+, ) and (s [i] .> dash := true; ‘-’) and (s[i] .> ‘.’) and (s[11 <> ,e, ) and (s(i) .> ‘E, ) then . end; begin ( Just get number: use .auto.ser for series prefix ) is_num := false; if dash . false then exit; begin end; aser . auto ser; Is-num = true; val(copy (s, 1, length(s) , anum, dummy) , end, end, end, functxon is-sel (s bufstrmg; sel integer ) boolean; ( Determines >f s XS a valld sel option (nwnber, !.s11, or ‘sel, ) If procedure Introduce Program, sel = 0, ‘self keyword 1s Invalld (can, t use ‘Sel, in SCLIST) ) ( Print friendly greeting ) begin C,:lst If ls_num (s] or (s . ,all, l or ((sei . 1) and IS . ,se 1411 then CEN = 40, is-sel = true else procedure ReadWaveE(var f : text; w : integer) ; w is_sel :. false; procedure ReadWaveSUpgrade (w : integer) ; b.) end; procedure ReadWaveF (var f : text; w : integer) ; IQ procedure ReadWaveFUpgrade (w : integer) ; end. procedure ReadWaveG (var f : text; w : integer) ; procedure ReadWaveGUpgrade (w : integer) ; procedure ReadWaveH (var f : text; w : integer) ; procedure RendWaveWUpgrade (w : integer) ; 4.4. fpes j r. pas procedure ReadWaveI (var f : text; w : integer) : procedure ReadWaveIUpgrade (w : integer) ; procedure ReadWaveJ (var f : text; w : integer); unit FpesJR; procedure ReadWaveJUpgrade (w : integer) ; ( History of modifications (please add to BOTIOM of list!) : procedure ReadWaveK (var f : text; w : integer) ; procedure rebin; Version 1: Begun 2jun94 SJG. procedure _rescale; function rm_extension(s : bufstring) : bufstring; Procedures and functions begiming with N through Z for the program FPES. function rounddown (r : real) : longint; See FPES (at appropriate version) for more specific program modification procedure roundof f (var r : real; s : real) ; notes. function roundup (r : real) : longint; ) ir@ementatiOn interface uses uses crt, dos, FpesCom, FpesAI, FpesST, FpesUZ, graph, Keys, TPDecl; FpesVar; procedure limit (var r : real: rnin, w : real) ; procedure limit (var r : real; rein, max : real) ; ( Constrains r to lie between min and w limits. ) function Log10 (r : real) : real; begin procedure MakeFilter (res : real); if r < min then procedure MakeLookup: r ;. min function make string (r : real; ma%, dec : integer) : bufstring; else if r > ma% then function makestring2 (r : real; ma%, dec : integer) : bufstring; r := max; function makestringint (r : real) : bufstring; end; procedure MC-rd(s : buf Btrin9) ; function mcs-init (w : integer) : boolean; function LoglO (r : real) : real; procedure MoveCursor (axis, numberofpoints : integer); ( Calculates couunon logarithm of r. ) procedure Mread (name : integer; numchars : integer); begin (procedure Mscan; ) if (r <= O ) then procedure Mwrite (name : inte9er; wbuf : buf string; lffla9 : bOOleanl ; Log10 := ln(-r) I LN-10 procedure Next FileNum (w : integer) ; else procedure NewCursor; Log10 := in(r) / Lt_lO; function NunwtstoCode (r : real) : integer; end; procedure Pause; (procedure PickPeaks; ) procedure MakeFilter (res : real) ; function Power (number : real) : real; ( Sets up Lorentzian filter function with FWWM of res. ) function PowerOfTenPref ix (100power : integer ) : bufstrincf; var procedure PrintWave; i : inteaer; function PtoU (w, P, xaxismode : integer) : real; begin - function PtoV (w, p, xaxismode, yaxismode : integer) : real; res := 4 / (res ● res); ( Putin convenient form for calculation. ) function PtOX (w, P : integer) : real: for i :. 1 to MAKPOIfrrS div 2 +. 1 do function PtOY (w, p : integer) : real; filter[il :=1/ (l+(i-l) *(i-1) ● res); procedure rd_int (var v : integer; mess : buf string; rein, max : integer) ; end; procedure rd_long (var v : longint; mess : bufstring; rein, ma% : longint) ; procedure r~real (var v : real; mess : bufstring; rein, = : real); procedure MakeLookup; procedure rd_str (var v : bufstring; mess : bufstring) ; ( Creates lookup table (ts. lookup) using wob parameters. Form of procedure readroundandlimit (var r : real; min. max : real 1z function is a single cycle of a sine wave added to a line with eq. procedure Readln2i (var i : integer) ; y = x. Phase is not considered until the StageLookup function. ) procedure readln21 (var 1 : lon9int ); var procedure Readln2r (var r : real) ; i : integer; procedure Readln2s (var i : buf string) ; begin procedure readvalue (var r : real; P : real); for i := O to TS_LOOKUP_MAX do function ReadWave (fn : bufstring; waveindex : inte9er; userinPut : ts.lookup[i] := i . ts. web. per / TS_LDDKUP_MAX + b-oolean) : twolean; sin(i . lviOP1 I TS_l.4x-TJP_MAX) - ts. web. arpl; end: lf not FileExists [s) then begxn functxon makes tring(r : real; max, dec Integer) : bufstring: cOm_wr (s + - not found. v, COLOQHL) ; ( Converts real number r mto string with minimum possible length, but having mc. fn := ,,: at least dec decimal places. However. overall length is kept to .= max digits mc. num := O; with truncation occurrin9 from left. so decimal places are not guaranteed. ) ex~t; var end: s : bufstring; mc, fn := s; begin assign (f, s]; str(r : 0 : dec, s); reset (f ): if length(s) s max then mc. num := O; makestrmg := COPY(S, 1, maxi while (not eof (f) ) and [me.num < mc_lO&) do else beg in makes tring := s: xnc (mc .num) ; end; with mc. 1s [mc .num] do readln (f, m, min. max, c, s) ; ( Read mass, ma% and label ) function mnkestring2 (r : real; max, dec : integer) : bufstring; end; ( Converts r intO StSin9 having eXaCtlY Max characters, and dec decimal close(f) ; places; extra characters are padding added on the left. Assumes r has end; been divided by appropriate Power already so that there are no more than 3 digits to left of decimal Point. Note that routine only really function mcs_init (w : integer) : boolean; works if dec > 3; otherwise, for instance, if dec = 3, will encounter ( Set UP MCS for scanning, using abbreviated command sequence if para- situation where r I P > 100 and so truncation will kill first fraction- meters in wave w match those currently in use. If w . 0, this is a al number but not decimal point. ) flag to use the tw (tweak) variables instead, and adds a few more var commands particular to the tw mode. Returns false only if MCS was s : bufstring; not found on the GPIB b“s, ) begin ( 3/18/97: Added conununication with Tektronix 744A scope as well, for str(r : 0 : dec. s); implementation of STS (shot-to-shot) mode, ) cOrn_wr_db( ’-’ +s+ ‘“’l: var if (r > -1) and (r . O) then devname : nbuf; s :. CODY(S, 1, dec + 3) ( 3 extra chars: -0. XXX ) j : integer; else if r- > 1 then s, S2 : bufstring; s :. COPY (S, 1, dec + 2) ( 2 extra chars: -X. XX or O, XXX ) begin else mcs-init := true; s .= COPY (S, 1, dec + 1); ( 1 extra char: X.XX ) if mcs new = 1 then if max > length (s) then beg in makes tring2 := COPY IBLANKLINE, 1, max - length(s) ) + s ( Check that MCS is on GPIB card. ) else devn.ame :. ,mcs S; makes tring2 := s: mcs. addr := ibf ind(devname) ; end; mwrite(mcs, addr, ,clrs, , false) ; ( Clear device, ) if (ibsta and ERR) <> 0 the” function makes trin9intlr : real) : bufstring; begin ( Converts r into integer string. ) error; var mcs_init := false; s : bufstring; exit; begin end; str(r : 0 : 0, s); mwrlte (mcs. addr, ,outp 1, , false) ; ( Direct device output to .gpxb makes tringmt := s; card, ) end; mwrite(mcs. addr, ‘trlv 5, , false) ; ( Trigger level, ) mwrxte(mcs. addr, ,trsl O, , false) ; ( Trigger slope = positive. ) . procedure MC_rd(s : bufstring) , str (-discrim, s) ; ( Read m mc file with name s. ) mwrite(mcs, addr, ,dclv < + .s, false) ; ( Discrlminz.tion level. ) var mwrxte(rncs, addr, ,dcsl 1, , false) ; ( Discrlmxnatlon slope = neg. ) c char; ( Dummy char to handle space between # and string ) mwrite(mcs. addr, ,bckl 0, , false) ; ( Internal clock timebase ) f text; mwrite(mcs, addr, ,left 0<, false); ( Set leftmost bln to 0. ) begin mwrite(mcs. addr, ,botm 0<, false): ( Set bottom bln to O cts. ) ( if not Full Path(s) then lf w > 0 then ( Normal mode ) s,=dir+ s,) w>th w,ls Iw]a do If nc fn = a, then begin beg in mcs. pt .. par pt, mc num = o, mcs. shotsperscan . par ele shotsperscan, exit mcs tImeperpt = par t meperpt, end, ( Undo tweak mode set t~ngs ) mwrite(mcs. addr, ,hscl 7’, false) ; ( Set 1024 bins per screen. ) ( tekwrite(s + ,:scale?’ ); u end mread(tek, sizeof (s2) ); b.) else 62 := ‘,; -P begin ( Tweak mode. ) for j := 1 to ibcnt - 1 do mcs. pt := tw.pt; 62 := S2 + ibbuf[jl; mcs. shotsperacan := tw. shotsperscan; val(s2, _bG. sts_vert, j); ( j is durmny variable. ) mcs. timeperpt :. tw. timeperpt; ( Set vert. offset to -5 div - discrim: )

{ Additional commands for tweak mode. ) str(-5 ● _bs .sts-vert - discrim, 62) ; rewrite (mcs. addr, ~hscl 4‘ , false) ; ( Set bins per screen to 128. ) tekwrite(s + ,:offset , + 82) ; ( mwrite(mcs. addr, ‘him O‘, false); ( Set left limit fOr integra- ( 2 bytes per bin: ) tion to bin O. ) tekwrite( ‘data: width 2‘ ); ( mwrite(mcs. addr, ‘rlim 127’, false): ( Transfer desired number of data points: 1 ( Set right limit to 127 bins, ) str(w. ls[~s. bg]~. par. pt, s) ; end; tekwrite( ’data: start l;stop ‘ + s) ; write (mcs. addr, ,brec , + makes tringint (NumptsToCode (mcs. pt )), ( Use signed binary fonnat with LSB (low byte) transferred false); ( Bins per record. ) first: ) mwrite[mcs. addr. ‘rscn , + makes trino’int (mcs. Bhotsperscan) , false) ; tekwrite (‘data: encdg sribinary ’); ( Records per scan. ) ( Calculate minimum # of bins and set: ) rewrite (mcs. addr. ~bwth ‘ + makes trinaint (TimebaseToCode (mcs j := round (wv. ls[~s. bg]”. par. pt) ; timeperpt) ), false) ; ( Select bin ~idth. ) if j <= 500 then delay (250); ( Give it time. ) j :- 500 else if j <= 1000 then [ STS: Prepare TEK (except in tweak mode) . ) j := 1000 if (w > O) and (_bs. sts = 1) then else if j <= 2500 then begin j := 2500 ( Check that TEK is on GPIB card. ) else devmme :. *tek ‘; j := 5000:

tek :❑ ibf ind (davname) ; str(j, s); if tek < 0 then tekwrite( ‘hor:reco , + S) ; begin ( Set pretxigger to O%: ) com_wr (‘Tek find error. ‘, COLOSHL); tekwrite( ,hor: trig:pos O, ); mcs_init := false; ( Use main sweep: ) exit; tekwrite (,hor:mode main, ); end; ( Set time per division ( = time per pt ● pts per div) : ) ibclr(tek) ; str(wv. ls[~s. bg] ~ par. timeperpt ● TEK_PTPERDIV, 5) ; { Shut off possible acquisition in progress (don’ t use tekwrite (,hor:main:scale , + s) ; tekwrite since this waits for scope to be free first, end; which defeats purpose of shutting off an acquisition! ) ) mcs. new :- O; ( tekset_rd (_bs. sts_ch); ( Record settin9s before chawiw. 1 end mwrite(tek, ,acq: state O’ , true) ; ( No zoom: ) ( When mcs. new = O ... ) tekwrite(’ zoom: state off’ ); else if w > 0 then ( Disable fit to screen: ) ( Selective commands sent if parameters have changed (don, t bother tekwrite( ‘her: fittoscreen off’ ); for w . 0 case, since never more than one tweak going at once! ) ) ( Average multiple scans: ) with WV.lSIW]” do tekwrite (‘acq: mode ave’ ) ; begin ( Number of shots to average: ) if IIICS.timeperpt c> par. timeperpt then str(wv. ls[_bs. bgl A .par. ele. shotsperscan, s) ; begin tekwrite (‘acq:numavg ‘ + .5); mcs. timeperpt := par. timeperpt; ( Stop after set ngmber of scans: ) InWrite (mcs. addr, ‘brec 0 + makes tringint (NumptsToCode (mcs. pt )), tekwrite (‘acq:stopafter seq’ ); false) ; { Bins per record. ) ( Set up string for use by channel commands: ) end; s := ,ch, + chr(ord( ’O’) + _bs. sts_ch); if mcs. shotsperscan + par. ele. shotsperscan then ( Set charnel for data acquisition: ) begin tekwrite( ‘data: source ‘ + s); mcs. shotsperscan := par. ele. shotsperscan; { Turn on channel: ) nwrite(uics. addr, ,rscn , + makes tringint (mcs. shotsperscan) , false) ; tekwrite(’sel:’ + s + ‘ on’); ( Records per scan. ) { Set vert. position to O. ) end; tekwrite(s + ,:pos 0’): if mcs. timeperpt <> par. timeperpt then ( Set vert. scale. ) begin strl_bs. sts_vert, s2) : rncs.timeperpt := par. timeperpt; tekwrite(s + ‘:scale ‘ + 52) : write (mcs. addr, ,bwth , + makes tringint (TimebaseToCode (tncs. ( Read vert. scale, store in _bs. sts_vert. ) timePerPt) ), false); ( Select bin width. ) end; cursoru . Ptou(wv. cur, cursorp - numberofpolnts. xaxlsmode) end; ( Go backward for energy. ) else ( Cmrcnands sent every txme. ) cursoru := PtoU(wv. cur, cursorp + mxmberofpoints, xaxismode) ; ( Make sure cursor is on visible part of x axis: calcdate screen coordi - ... ( STS mode: Start the TEK. ) nates. ) if (w > O) and (_bs. sts = 1) then UpdateCursor (sc. cur) : tekwrite( ,acq: state run, ): DrawCursor (sc cur ); DrawCursor Info: ( STS mode (bs set only) : run toggle mode. ) if (me. auto . 1) and (me. s .> ,,) then if (w > O) and (_bs. sts = 1) and (wv. ls[wl”. par. ele. bs mode = 1 ) and com_wr [MC,s, COLDPJIESS ); (_bs. sts_tog = 1) then end; mwrite(mcs. addr, ‘acmd 2’ , false) end else else with xh do rewrite (mcs. addr, ,acmd 0,, false); begin EraseCursor [SC, cur) ; ( Start the MCS. ) if axis = O then ( mwrite(mcs. addr, ‘clrs< , false) ; ( Clear device twice for good measure. ) begin mwrite(mcs. addr, ,clrs’ , false) : x[which] := x[which] + numberofpoints; rewrite (mcs. addr, ,sscn, , false) ; ( Start the scan. ) if x[which] < plotarea. xl then ,.. mwrite(mcs. addr, ‘1oc1 0’, false) ; ( Allow front panel to remain x[which] :. plotarea. xl w, active while seaming. ) else if x[which] > plotarea. x2 - 1 the” x[which] := plotarea .x2 - 1; if w > 0 then end with WV. lSIWI” do else begin begin Time (scan. start time) ; ( Record start time. ) y[which] := y [which] + munberofpoints; scan. steptime :. 100 + round (mcs. shotsperscan 1 par. ele. if y[which] < plotarea. yl then reprate) ; ( How long to waLt between data reads. ) y[which] :. plotarea. yl end else if y[whichj z plotc.rea. y2 - 1 then else Ylwhichl := plotarea. y2 - 1; begin end: Time (tw. start time) ; UpdateCursor (SC, cur) ; tw. steptime := 100 . round (mcs, shotsperscan I tw. reprate) ; DrawCursor (SC Cur) ; end; DrawCursor Info; ,,.’:: ena: end; :.. end; procedure MoveCursor (axis, numberofpolnts : Integer) ; ( Two functions: procedure reread (name : integer; numchars : integer) ; 1. It xh. mode = O: For axis = O (x), moves cursor a specified number ( Reads a character array from the device name and changes it to a of points along a wave (use numberofpoints = O when changing wave only) For string array rdbuf, ) axis = 1 (Y) , calls ChangeCurrentWave. var 2, If xh. mode = 1: Moves active crosshair corresponding to axis (O = i : integer; ,. x, 1 = Y) and numberofpoints. ) begin begin rdbuf := ,,; with sc. ls[sc. curl. gr do ibrd(name, ibbuf, nwnchars) : [ Numchars IS a auess to how lona the if xh. mode = O then string is. ) , ,, begin rdbuf[Ol := chr(ibcnt - 1) ; ( The length of rdbuf IS set to the number .,., ~f wv. num . 0 then of characters read, ibcnt - 1, ) ,.., exit; if (ibsta and ERR) <, 0 then error: if (axis = O) and (wv. ls[wv. curl’ screen = sc cur) then ( Hust be for i := 1 to ibcnt do leftirxght arrow and wave on current screen Ln order to move. ) rdbuf [i] := Ibbuf [i]; begin end; if cursorvlslble = 1 then EraseCursOr (se. cur) (procedure Mscan; else begin const cursoru . (ulltm + u211m) / 2, MaxIbbuf = $1000; UpdateCursor (SC cur) type end, iobuf = array[l Max Ibb”f] of char, ( calculate new cursor posxtion ) Iolbuf = array[l 200] of integer, if (xaxlsmode = X.4XISMODE-CONVERTI and (xaxisdt = var dt_ELEl then Lbb” f lobuf, devname : nbuf; Str(wv. ls[wv. cur]’ .numpts+lO, stringconv) ; hbuf : iolbuf; rewrite (magic, ,AVGLEN , + stringconv + , ,); i, j, k, scan, result, terr : integer; str(wv. ls[w. cur]” .numscans, stringconv) ; stringconv, c, s,bina : bufstring; mwrite(magic, ‘AVGN , + stringconv + , ,); C2, murblocks : longint; rewrite (magic, ‘AVG START ,); begin delay (100) ; if wv.ls[wv. curl~. saved = O then ( If there is already data in wave message := ,Started MScan, ; make sure users wants to overwrite it. ) DrawMessageBox; ( begin repeat message :. ‘overwrite Bxisting Wave?’ ; result :. O; DrawMessageBox; rmvrite (magic, CAVGLx3NE ,); c :. readkey; mread(magic, 20); if (c = #89) or (c = #121) then ( ,Y, or ‘Y’ ) terr := O; ( begin char_ to_int (result, terr ); message :. /overwriting’ ; if keypressed then DrawMessageBox; begin delay (1000); c := readkey; end if c = S27 then else begin begin message := 3Scan Aborted, ; message :. ,scan Aborted. ‘; DrawMessageBox; DrawMessageBox; delay (2000); delay (1000) ; message := NESSAGEOEFAGLT; message := MESZAGEDEFAULT; DrawAl 1; DrawMessageBox; exit; exit; end; end; end; end; delay (1000) ; message := ‘Starting Mscan’ ; until result a O; Dravnnes6ageBox; message := ,About to read. ,; FillChar (wv.ls[wv. curl A. data, sizeof (wv.ls[w. curl fi.datal ,0); ( Initalize Drawmessagebox; arravs. ) nurrblocks := round(wv. ls[wv. curl ”.numpts/100) ; ( d~vna.ine := ‘magic ‘; str(round( 200*numblocks-1) ,stringconv) ; maaic := ibfind(devname) ; ( Locate device on ggib card. ) mwrite(magic, ,READ -A, O, , + stringconv + , ,); ( ii (ibsta and err) e. O then error; delay (100) ; if magic c O then error; message := ,dataread sent, ; ibclr(magic) ; drawmessagebox; delay (200) ; ( for j := O to round (2*wv.ls[wv. cur]” .nurr@ts/200) do ibclr(magic) ; begin delay (200) ; dataread (magic, 200) ; message :n ,Found Magic Controller’ : for i := 1 to 200 do DrawMessageBox; wv. ls[wv. cur]~. scan[lO*j+i] := wv. ls[wv. cur]” .scan[il; mwrite(magic, ‘ECHO OFF ‘) ; end; ) mwrite(magic, ‘A O ‘); ( textmode; mwrite(magic, ‘N 18 ‘); scan. w := wv. cur; mwite(magic, ‘Z ‘); for j := O to numblocks-1 do mwrite(maaic, ‘F 26 ‘); begin mwritelma~ic; ‘E ‘); writeln (,going into dataread # ,,j ); rewrite hnaaic. ,COf4tLFORMAT— OFF, WORO. BINARY ‘); delay (500) ; rrwrite(ma~ic, ‘COwlf_ELOCKSIZE 200 ‘); dataread (magic, 200) ; nr+rrite(magic, ‘COMM_ORDER LOFIRST ‘); for i := 1 to 100 do delay (100) ; (Ridiculous but have to have it. ) t.w.ls[wv. cur] -.data[j*lOO+il := scan. data[il; ( mwrite(magic, ‘uSING 18 ‘): end; mtrite (magic, ,AVGSNABLE 0N4 ); graphicsmode; delay (100) ; (Same) ( for j := O to numblocks-1 do [ nwrite(magic, ,W 255 ‘); (set offset ) begin ( mwrite(magic, ‘F 19 ‘); ibrd (magic, ibbuf, 200) ; mwrite(ntagic, ‘E ‘); message :. ,ibrding, : str(256 + 16. timebasetocode (w. 1s [wv. curl”. timebase), strin9conv); drawmessagebox; rewrite (magic, ‘W , + stringconv + , ,); for k := 1 to 200 do delay (100) ; wv.ls[W. cur]a. data[k+lOO*j] := wv.ls[wv. cur] A.data[k+lOO*j ] + mwrite(magic, ‘F 16 ‘); wv. ls[wv. cur] -.scan[k] ; nr.mite(magic, ‘E ‘); end; ) ( wv ls[wv. cur] -.saved := O. s :. dir + s; FmdLargest (w. cur) ; inc(vl ; FullVlew; s2 := auto. ser: end; ) if not Full Path(s2) then S2 := dir + s2; procedure rewrite (name : xnteger: wbuf : bufstring: LFFLAG : boolean) ; if (s . .92) and (auto .num .= v) then [ Changes string to character array which i= sent to the auto. num := v + 1; device, mcs. addr. ) const ( Update filename. ) LF = #lO; fn := s + makestringint (v) + 0.0 + ex; var end: wlen, i : integer: end; beg in wlen := length (wbuf ); procedure NewCursor; for i := 1 to wlen do ( Place cursor in middle of wave w cur. ) ibbuf[il := wbuf[il; begin if lfflag then if wv. num = O then begin exit: ibbuf[wlen + 11 := LF; with SC. ls[wv. ls[wv. cur] ~.screen] .gr do inc (wlen) ; cursoru := (PtoU(wv. cur, WV. ls[wv, cur] ~.pmin, xaxxsmodel + end; PtoU(wv. cur, wv.ls[wv. cur] ~.par. pt, xaxismode) ) / 2; Ibwrt (name, ibbuf, wlen) : end; for i := 1 to wlen do ibbuf [i] := , ,; function NumptstoCode (r : real ) : integer; it (ibsta and ERR I <> 0 then ( Converts the numpts number tothe corresponding mcs xnteger. ) com_wr (,Error sending “ o + wbuf + P-8, COLORHL) ; var end; i : inteaer: begin - procedure NextFileNum(w : xnteger) ; for i := MCS_PT_MIN to MCS_FT_NAK do ( Finds current file number and increments. If tile number cannot be if r = MCS_PT[ i] then found (invalid fn) , sets filename to ,‘ ) begin va r NumptsTocode :. i; dumny : integer; exit: ex : bufstrlng: end; i : integer; Nuu@tsToCode :. -1, ( If something doesn< t work, assigns -1, ) s, S2 : bufstring; end: v : integer; begin procedure Pause; with WV. lSIW]” .P8r do ( Suspend operations until user presses a key, ) begin begin ( If using standard file extension, change to reflect dt (otherwise, com_wr (,Paused. Press any key. $, COWRHL) ; keep intact) ) ( Read key, and if extended code, read next char as well, ) ex := get_extensi On( fn) ; if readkey . EXTENDED then for i :. dt_MIN to dtJfAX do readkey; if ex = dt_NAME[i] then end: e% := dt_NANE[dt ]; (procedure PlckPeaks; ( Find current file number, ) var s :. rm_extensx On(fn) ; peak : array [1. .NAKPSAKS] of integer; x := length(s); after : real; while (i > length(s) - 4) and (i > O) and (s [11 .> ‘-’) do before : real; dec (i); ch : char; if (I . O) or (s [11 .> ‘-, ) then count : integer; begin L, I integer; fn .= ‘o; message bufstring; exit, modified boolean; end, ok : boolean, s bufstrlng; ( COmPa?e root with auto ser. updating auto num If they match and temp : real, auto num . v ) w integer, val(copy(s, L + 1, length(s) - L), v, dummy]. s = COPY (S. 1. i), begin If not Full Pactlls) then If (WV num , 0 ) then .

. . . 338 .. , .- . .; -- ..+- .. u +

.2 g a . :

N

a

.Lj

c .8 .

..

E i?

u ‘&

-- beg xn , .. 0; function Power (number : real) : real; repeat ( Calculates power of 1000 which, when dlvlded from number, leaves a mnnt~ssa .: Clrscr ; between 1 and 999.9 ... If number . 0, Power returns 1. ) ,) writeln(, ‘): begin s.! write ln(, PEAK LIST FOR WAVE NUMSER ‘, w, , (,+wavename+, ) ‘): if number = O then write ln(, ,); Power := 1 writeln (-Peak Time (ns) Snergy (ev) Rel. Int. Abs. Int. Sec. else Deriv. ,); Power :. XToTheY(1000, romddown(Log10 (nurrber) / 3 + SNALL)); ( SWALL is . write ln (,------,.~.. added to force function to advance to next power of 1000 prematurely, ,-[ ----’): This is to ensure numbers are less than 1000 (though there is a chance i := O; they may be less than 1) . Preference is for an interval to be O. .0,9 while (i < LINESPERPAGE) do rather than O. .900, especially on vertical axis when displaying begin normalized spectra. ) xnc (i); end; if ((i+j . . NAXPEAKS) and (1+) .= count)) then I write ln((i+j ):4,8 ,, function PowerOfTenPrefix [logpower : integer) : b“fstring; (peak [i+j]. t.imebase + delay time) :9:0, , ,, ( Like UnitPrefix[), b“t produces notation like ,10A-3, rather than S1 un~t ,-; (PtoU(w, peak[i+jll):ll:3,’ ‘, prefixes. If logpower = O, returns a , ) (AbstoRel (w,PtoV(w, peak[i+j l)) ):10:3,’ ,, begin (PtoV(w, peak[i+j])):lO:O, , ‘, if logpower . 0 then (lPtoV(w, peak[i+jl+l) + PtoV(w, peak[i+j l-1) PowerOfTenPrefix := ,, -2. O. PtoV(w, peak[i+j ]))/sqr (timebase) ):10:3); else end: PowerOf Ten Pref ix := ,10A, + makes tring (lcgpower, 4, O) ; ( Extra j :. j + LINESPERPAGE; space added for clarity with “nits succeeding, i.e. , ,10-3 eve . I “se 4 waitkey; digits since this provides room for up to 10 A-999, adequate to indicate until (j >= count) : if there= count); end, ( NASSSCAN ) function PtoU (w, p, xaxismode : xnteger) real, ( end, ( case ) ( Converts point p m wave w to “nit space x coordinate for any xaxxsmode ( md, ( “ith ) (can specify mode other than current one) U depends both on xax~smode and ( end, ( ,f ) dt of wave: ( DrawAll, end, ( ,f ) xax Ismode wave [w]- par dt x axxs dxmens~ons (end, ) ...... ------...... KAXISMODE.POINTS (any ) points temp:=b*b-4’a’ c; b.) WISMODE_NOlU4AL dt_COR distance (urn) if temp . 0 then -P dt-ELE time (ns) temp := O; o dt_MAS time (us) ( else dt-POW time (ms to s) begin ) SAXISMODE_CONUERT dt_COR time Ifs) invsqE := (-b+sqrt(temp) )/ (2*a) ; . dt_ELE energy (eV) if invsqE .> 0 then

dtJfAS mass (Da) PtoU := (1 / (invsqE ● invsqE) ) ● JTOEV . dt_POW no change from KAKISMODE_NOQMAL else ) Ptou :. o; var 1( end: ) t: real; { Conversion variable for time -> energy. ) i end; ) a,b,c, invsqE, temp : real: ( teworary variables ) end; begin dt-POW: ( No change from XAKISMODE_NORJIAL. ) if p < 1 then Ptou := p ● par. timeperpt; begin dt_WAS : ptou := o; PtoU := par. mas .cal. sl ● sqr(p * par. timeperpt + par. mas. delay exit; - par. rnas.cal. int); end; end; with WV.lSIWIA do end; case xaxismode of end; KiIXISMODE_POINTS : PtOu := p; function PtoV (w, p, xaxismode, yaxismode : integer) : real; X?WISWODE_NORiiAL : ( Converts point P in wave w to unit space Y coordinate, for any xaxismodel case par. dt of yaxismode combination (not limited to current ones) . TWO x axis units re- dt_COR : quire resealing of Y axis: energy and mass. Other units have the Y axis

Ptou :- par. cor. ts. start + (p - 1) ● par. cor. ts. step; passed through untouched. dt–ELE. dt–POW:— PtOU := p 9 par. timeperpt; New addition: display-only” background subtraction, that is, if dt_MAS : selected (~s. dis = 1), and w is aR ele wave, PtoV will return

Ptou := p ● par. timeperpt + par. mas. delay; the difference between wave w and the background wave _bs. kg, end; suitably scaled by the wave’s bg. scale factor. ) KAKISNODE-C02?UERT : var case par. dt of terrQ : real; ( Temporary calculations. ) dt_COR : begin

ptou := (par. cor. ts. start + (P - 1) ● par. cOr. ts. step if P c 1 then - par. cor. ts. tO ) / HALPSPEEDDFLIGHT; begin dt_ELE~ ptov :- o; if (par .ele. cal. quad = O) then ( if quad cal factors are ) exit; begin ( not being used, do nornml ) end;

t :. P ● Par. timeperpt - par. ele. cal. to; with WV. lsIw]” do

Ptou := SLOPEFACTOR ● sqr(par. ele. cal. len) / (t ● t); begin w end if (par. dt = Dl_ELE) and (xaxismode = SAXISMODE-CONVERT) then else begin begin tew := PtoU (w, P, xaxismode ); ( t := P g par. timeperpt; if tew > 0 then ( if ( t < 0.2e-6 ) then { MY function doesn’ t work well } tenw := data[pl / (temp ● sqrt(temp)) ( E “ -1.5. ) ( begin { below O. 2US or above 4. 8US, so ) else ( PtOU :- par. ele. cal. eV; ( fix these ranges so fxn doesn’ t crash ) term := O; ( TTaP to avoid imaginaries. ) ( end; end (1998-5-18 EJG: I need to access longer times -- comment this part: ) else if (_bs. dis = 1) and (par. dt = D’LELE) and (par. ele. bs. mode = .- [ if ( t s 4. Se-6 ) then 1) and (_bs. bo <> w) and (_bs. bP > O) and (w.ls[>s. tgl”. par. dt begin - DT_ELE) then Ptou := 0.06: ( Handle bg subtraction display. ) end; ) begin ( if ( t >= 0.2e-6) and (t c= 4.8e-6 ) then ter@ := w-?.ls[_bs .bg]”. par. ele. bs. tot: begin ) if tew > 0 then

t :. p ● par. timeperpt - par. ele. cal. tO; temp := data[pl - wv.ls[_bs. bgl”. data[pl “ mar. ele. bs. tot /

a := par .ele. cal quad ● ELECTROFRtASSKG / 2: temp

b := sqrt (ELEcTRONMAESKG/2) ● (par. ele. cal. len - else

2 ● par. ele. cal. quad ● par. ele. cal. quadoff) : tew := data[p] ; c := par. ele. cal. quad . par. ele. cal. quadoff “ end par. ele. cal. quadoff - t; else t emp . data [p] ; V:=u x f yaxismode = YA.KISMODE_RELATIVE then else PtOV := temp . abs (par. yscale) + par. yof fset cOm_err; else end: PtOV := temp: end; procedure rd_real (vaz v : real; mess : bufstring: min. max : real] ; end; ( Same as rd_int, but for real values. ) var function PtOX [w, p : integer I : real: dumny : integer: ( converts point P in wave w into a screen x coordinate. ) u : real; begin s : bufstring; ptox :. UtoX(PtoUlw, p, sc. ls[wv. ls[wl”. screenl .gr.xaxlsmode), W.ls[wl-. begin screen) ; if tom. cur = corn.num then end; beg in str (v, s); function PtOY (w, p : integer) : real; cOm_wr (mess + , . , + s , COLOSMESS ); ( Converts point P in wave w into a screen y coordinate. ) exit; beg in end; PtOY :. vtoy(ptov(w, p, SC. ls[wv.ls [wl’. screenl .gr. xaxismode, inc (corn.cur) ; Sc. ls[w. ls[wl’. screen] gr, yaxismode) , WV. 1s [wI “. screen) ; val(com. ls[com. cur] , u, duntny); end; if (u >. rein) and (u <= ma% ) then V:=u procedure rd_int (var v : integer; mess : bufstring; rein, max : integer); else ( Either print current value of integer variable v (using message mess 1, cOm_err; .,,1 or change to user, s xnput provxded it falls within range of min and end: ,. max. ) var procedure rd_str(var v : bufstring; mess : bufstring) ; dummy : integer; ( Either print current value of string variable v lusxng message mess) , “ : integer: or change to user, s xnput. ) s : bufstring; begin begin if corn.cur = corn,num then if corn.cur = tom, num then begin beg in com_wr (mess + , . , +v+ ,., , COLORMESS); str (v, s); exit; com_wrlmess + ‘ = 8 + s, CoLOP.MESS) ; end; exit; inc (tom. cur) ; end: v :. Corn.ls[com. cur] ,’,, inc (corn.cur) ; end; val[com. ls[com. cur 1, u, dummy); if (u >= rein) and (u <= max) then procedure readro”ndandlimit [var r : real; mi”, max : real) ; V:. U ( Read value into r from keyboard, round off, a“d constrain it within the else limits min and ma%, ) cOm_err, begin end; readln2r (r) ; r := round(r); procedure rd_long (vu v longnc; mess : bufstring, rein, max : longint ); if r . min then ( Either print current value of longint variable v (using message mess) , r :. min or change to user’s Input provided xt falls within range of min and else if r > max then max. ) r :=max; var end: dummy : integer; “ : longint; procedure readln2i (var x : integer ); s : bufstrmg, ( Only changes the parameter value if a character 1s entered ) begin va r if corn.cur = com num then s : strmg[20] , begin dummy : Integer, str (v. s), begin co~wr (mess + = , + s COLOPJ4ESS) ; readln (s) ; exit, lf S<>, , then end, Val (S, 1, dwruny), mc(com curl , end; val (corn ls[cotn curl u. duirrny) , if (u >= mlnl and [u .= nmxl then procedure readln21 lvar longntl ( Only changes the parameter value if a character is entered. ) begin b.) var ok := TRUE; ‘% s : string [201 ; assign (f, fn); to dummy : integer; reset(f) ; begin readln(f, 5) ; ( Read first line to obtain version #. ) readln(s) ; if s[l] = ‘E, then if s<>, , then ReadWaveE (f, wave index) vd(s, 1, dumny); else if s[l] = ‘F’ then end; ReadWaveF (f, wave index) else if s[l] = ‘G’ then procedure readln2r (var r : real) ; ReadWaveG [f, wave index) ( Only changes the parameter value if a character is entered. ) else if s[l] = ‘H’ then Var ReadWaveH (f, wave index) s : string [201 ; else if s[l] = ‘I’ then dumny : integer; ReadWaveI (f, wave index) begin else if s[l] = ‘J, then readln (s ) ; ReadWaveJ (f, waveindex) if s -=- ) $ then else if s = HEAD_WV then ( Current format. ) val (s, r, dunrny); ReadWaveK (f, waveindex ) end; else begin procedure readln2s (var i : bufstring) ; com_wr (VData forme.t not supported. ‘, COLORHL) ; ( Only changes the parameter value if a character is entered. ) ok := FALSE; var s : bufstring; end: if ok then begin with WV. 1s [waveindexl” do readln [s ) ; begin if s<>’ 4 then par. fn :. fn; ( Assign filename. ) i := s; for i := 1 to par. pt do ( Read data points. ) end; readln(f, data[il ); end; procedure readvalue (var r : real; P : real); close(f); ( Change value of r. If user hits return only, z is unchanged; otherwise, ReadWave :. ok; r is changed after multiplying by proper power conversion P. If P = O, calculates appropriate power of p automatically. ) ( Preserve for posterity: oldest version formats: ) var { else ( oldest format - no letter code. ) dunnny : integer; ( Oun’nnYvariable needed by val. ) { begin s : bufstring; ( Input string. ) Reset(F) ; begin Readln (F, r] ; timebase := MCS_TIMEPERE”r [round (r) 1; if P = O then Readln(F, r) ; numpts := round(r) ; P := Power(r); If SameScanType (waveindexl = FALSE then s := ,,; ok := FALSE readln (s ); else if s <> ,- then begin begin Readln(F, s) ;. val (s, r, dumny); Readln(F, s) ; r:=r *p; Readln(F, S) ; end; end.-, end; if user input and ok and ((Scantne = TIMSSCAW) or (scantype . SN2RGYSCAN) ) then function ReadWave (fn : buf string: wave index : integer; userinRut : begin boolean) : boolean; writeln (‘This file needs the following inf ormc.tion provided: ‘); ( This procedure reads file fn into wv. 1s [waveindexl . Must check that writeln(, Laser wavelength’ ): filename exists first. Data formats E and later are supported. Other writeln(, Ion mass’ ); wave parameters (yscale, etc. ) are not changed. Userinput is a flag writeln(, TO,); indicating whether to accept user input of additional parameters; if writeln(’ Length’ ); FALSE is passed, it is assumed that these parameters are already writeln(, Float voltage, ); known (from ws_rd) . ) writeln(, Ouadratic conmression factor, ): var writeln( ,If these quantities are readily available, press Y, or press any f: text; ( File variable. ) other key to, ): i : integer; ( General counter. ) writiln( ‘exit. ‘); ok : boolean; ( Flag to indicate if load fails. ) case readkey of -y, , #y, : s : bufstring; ( String variable for general use. ) ; ( M nothing. ) else write( ‘Laser wavelength [rim) 1, ok = FALSE, readln [i ); end; case i of xf ok then 213 : p ,= O; begn 266 : p := 1; write IeLaser wavelength [rim]: 0); 299 : p := 2; readln(rl ; 355 : p := 3; laserev := EV?4M / r; ( Convert wavelength to enerov... ) 416 : p :. 4; ( write[ ‘Ion mass (Daltons) : ,); 532 : p := 5; .-.! readln(iomnassl ; else . w.?. write (,TO (ns): ,); found := FALSE readln(t O) : end; write( ‘Length [m) : 0); until (found . TRUE] : readln( leng) : laserev := CODE_lY2_LASEREV [p ]; ,; slope := SLOPEFAC’TOR “ leng ● leng; write (,Ion MASS (Daltons) : ,); !:.. writeln( ,Float voltage (V) : ,); readln( IonMass) ; readln( float) ; writeln( ,Float voltage (V) : ,); delta_e := ELECTRONMASS ● float / leng; readln( flost) ; wxite( ,Quadratic compression factor (ns. eV) (default = O) : 0): delta_e := ELECTROf4MASS . flost / ionmass: readln(s) ; write[ ‘Quadratic corr@ressio” factor (ns, ev) (default = O) : 0); ifs=, ,then readln (s) ; quad := O ifs= $$ then else quad := O val_r (s, wad) : else end: val_r(s, quad) ; end; end; end; ) end; ( wrxteln( ‘File format: o + s) : ) end; ( ,*. , ‘B, , begin begin Readln(F, r) ; timebase := MCS-TIMEPERPT [round (r )1; Readln (P, r) ; timebase := MC S-T IMEPERFT [round (r )]; delaytime := O; delaytime := O; Readln(F, r) ; numPtS := round(r) ; Readln (F, r); nun@s := round(r); If SameScanType (waveindex) = FALSE then If SameScan~e (wave index) = FALSE the” ok := FALSE ok := FALSE else else begin begin Readln(F, s); Readln(P, s); Readln (F, s); Readln(F, s); Readln (F, s); Readln(F, s); Readln (F, tO) ; Readln(P, tO) ; Readln (F, leng) ; slope = SLOPEFACTOR ‘ leng . leng; Readln(F, leng) : slope :. SLOPEFACIWR . leng . leng; end: readln (f, quad) ; If userinput and ok and ((scantype = TIMESCAN) or (scantype = end; ENERGY SCAN )) then if useri”p”t a“d ok and ((sca”type = TIMESCAN) or (scant~e . begin ENERGYSCAN )) then writeln( ‘This tile needs the following information provided: o); begin writeln( , Laser wavelength< ); writeln( ,This file needs the following reformation provided: o); write ln(, Ion mass, ); writelnl , Laser wavelength, ); writeln (, Float voltage< 1; wrxteln( , Ion mass, ) ; wrlteln( ‘ Quadratic compression factor, I; writeln( , Pleat voltage, ); writeln( ,If these quantities are readily available, press Y, or press any writeln{ ,If these quantities are readily .wallable, press Y, or press any other key to, ): other key to, ); wrxtelnl, exit ‘) , witel”(, exit, ,) ; case readkey of case readkey of /y?, ?.f,: , ( Do noth,ng ) ‘Y’, *Y,, ; ( Do nothing ) ( else ( else ok := FALSE, ok = FALSS; end, end; if ok then if ok then begin begxn repeat repeat found = TRUE found = TRUE, write (,Laser wavelength (rim): ‘); 299 : p := 2; readln( i) ; 355 : p :. 3; case i of 416 : p := 4; 213 : p := O; 532 : P := 5; 266 : p := 1; else 299 : p := 2; found := FALSE 355 : p :. 3; end; 416 : p := 4; until (found = TRUE) ; 532 : P := 5; laserev := CODE-TCLLASERSV [p]; else write(’ Ion mass IDaltons) : ‘); found := FALSE readln (ionmass ); end; writeln(, Float voltage (V) : ‘); until (found . TRUE) ; readln (flost ); laserev := CODE_TKLLASEREVIP] ; delta-e := ELECTROWMASS ● flost / ionmass; write (’Ion mass (Daltons) : ,) ; end; readln (ionmass ); end; writeln( ‘Float voltafse (V) : ‘); end; ID, : readln (flost );

delta_e := ELECTROWMASS ● f10at / ionmc.ss; begin ( read all parameters, keeping only those needed. ) end; ( readln(f, s); end; readln(f, s); end; readln(f, r, s) ; numpta :. round(r) ; ( reading s after number skips text t~?: conunentary ) begin ( readln (f, r, s ); timebase := MCS-TIMEPERFT_D [round (r )1; Readln (F, r); timebase := MCS_TIMEFERPT [round( r) ]; If SameScanType (waveindex) . FALSE then delaytime := O; ok := FALSE Readln(F, r); nIXCpts := round(r) ; else If SameScanType (waveindex) = FALSE then begin ok := FALSE readln (f, s) ; else readln (f, 6); begin readln (f, s) ; ReadIn(F, s) ; readln (f, r, s) ; Iaserev :. CODE_TO_LASEREV [round(r) ]; Readln(F, s) ; readln (f, z, s); ionmass :- round(r): Readln(F, s) ; readln (f, to, s); Readln(F, tO) ; readln (f, leng, s) ; slope := SLOPEFACIYJR ● leng ● leng; Readln (F, leng) ; slope := SLQFEFACTOR ● leng ● len9; readln (f, float, s) ; delta_e :. ELECTRONMASS 9 flost / ionmass; readln (f, quad) ; readln (f, quad, S) ; readln(f, s); readln (f, s); end; readln (f, s) ; if userinput and ok and ((scantype = TIMESCAN) or (scantne = readln (f, delay time, s) ; EWERGYSCAW )) then end; begin end; ) writeln (‘This file needs the following information provided: -); end; writeln (‘ Laser wavelength’ ); writelnl’ Ion mass’ ); procedure ReadWaveE (var f : text; w : inte9eX ); writeln i‘ FlOat V01ta9e’ ); ( First FPES format (actually contained a lot of tenure parame- writeln [,If these quantities are readily available, press Y, or press any ters !), read protocol of which was revised 25JAW96 fOr compatibility other key to” ); with new data format ‘G’ . Parameters not contained in file are assigned writeln( ‘exit. ‘); their pardf [dt_ELEl value. ) case readkey of var ‘Y’, ‘y’: : ( Do nothing. ) r : real; { else s : bufstring; ok := FALSE; begin end; with W. 1s [w]” do if ok then begin begin par := pardf [dt-ELE] ; ( Copy over defaults. ) repeat par. comment := ,Data format E (old FPES) .‘; found := TRUE; readln (f, s) ; ( Skip wavename. ) write(’ Laser wavelength (run): ‘); readln( f, s) ; ( Skip ‘update every. ‘ ) readln (i ); readln(f, r, s); par. pt-gl := round(r): case i of readln (f, r, s) : par. timeperpt := MCS_TIMEPERPT [round (r) I; 213 : P := O; readln( f, s) ; ( Skip discrimination level. ) 266 : P := 1; readln( f, s) ; ( Skip time scan flag. ) readln {f. s): ( Sk~p background subtraction flag. ) readln (f, par. cor. ts. tO), readln {f. s) , ( Skip laser energy. ) readln( f, par. tlmeperpt ): readln (f, s); ( Sk~p ion mass. ) readln(f) ; ( Waittime -- now defunct ) ,.,) readln (f, r, s); end; par. ele. cal. tO := r . le-9; ( Convert ns -> s. ) dt-ELE: ,,, ; readln (f, r, s): begin par. ele. cal. len := r . le-2; ( Convert cm -> m. ,) readln (f. Dar.. ele. cal. len) : readln(f, s): ( Skip float. ) readln (f ); ( Skip quad factor ) readln( f, s) ; ( Skip quadratic compression factor. ) readln (f, par. ele. c?,l.tO) ; ~, readln(f, s) : ( Skip vertical scale. ) readln( f ); ( Skip counttotal, ) ... readln (E, s) ; ( Skip horizontal position. ) readln(f, par. ele. cal. ev) : readln(f, s) : ( Skip time offset, ) readln (f, r) ; par. scan_gl := round(r) : readln(f, r, s); par. scan_gl := round(r); readln (f ): ( Skip powe~purrp ) readln( f, s); ( Skip timeFPES. ) readln (f ); ( skip powerprobe ) end; readln( f, par. ele. reprate) : readwaveEupgrade (w) ; readln( f, r) ; Par. ele. shotsperscan :. zm”nd(r) ; end; readln( f, par. ele. ts. posl; readln( f, par. ele. ts. tO): !: ;,. procedure ReadWaveEupgrade (w : integer) ; readln( f, par. ele. ally); . . begin readln( f, par. timeperpt ) ; ,,, ReadWaveFUpgrade (w) ; end; .1 end; dt-POW: ,’ ,! begin procedure ReadWaveF (var f : text; w : integer) ; readln (f, r); par. pow. ch := round(r); ( Added 25 JAN96, this is a ‘screw-up- format which resembles E, readln (f, par. pow, cal. int) ; except contains no parameters (just data) , for files 148-6 thru 148-26 readln (f, par. pow, cal. sl); only, ) readln (f, par. timeperpt ); begin par. scan_gl := pardf [dt_POW) scan_gl; ( Not recorded, with w,ls IwI” do so make de fault., ) begin end; par = pardf [dt_ELEl ; ( COPY over defaults. ) end: par, cmrment := ,Note: Data format F (weird) ., ; end; end, ReadWaveGUpgrade (w) ; readwave Fupgrade (w ): end: end; procedure ReadWaveGUpgrade (w : xnteger ); procedure ReadWaveFupgrade (w : Integer) ; ( Modifies version G wave so is compatible with latest version, 1 begin begin ReadWaveGUpgrade (w) ; with wv. ls[w]A, par do end; begin ...[ alert := pardf[dt] alert; procedure ReadWaveG (var f : text; w ; integer) ; if dt = dt_ELE then ( True new data format, 25 JAN96. ) begin var ele, bs, tot :. pardf [dt] .ele. bs. tot; r real; ele. bs. mode := pardf [dt] .ele, bs. mode; s bufstring; end; begin sh := pardf[dt] .sh: with w,ls Iw]’ do sk>p :. pardf[dt] skip; beg m end; ~eadln (f, par. comment) , ReadWaveHUpgrade (w ); readln (f, par. dt) ; end; readln (f, par. pt_gll ; readln (f, par. yoffset) ; procedure ReadWaveH (var f text; w : Lnteger ), readln (f, par. yscale) : var case par, dt of s : bufstrng; dt-COR begin begxn with w ls[w]~ do readln (f, r) , par cor ch = round(r), begin readln (f, r) par scan-gl = romd (r). readln (f, par alert) , readln (f, r) , par cor shotsperpt = round(r), readln (f, par conunenc ), readln (f, par cor ts start), readln(f, par dtl , readln (f, par cor ts step) readln(f, par pt_gll readln (f, par cox ts stop) , readln (f, par scan-gl j. readln( f, par sh) ; va r readln( f, par skip) ; s : bufstring; readln (f, par. timeperpt ); begin readln( f, par. yof fset) ; with WV. k[W]a do readln( f, par. yscale) ; begin case par .dt of readln( f, par. alert) ; dt_COR: with par. cor do readln (f, par. comnent ); begin readln(f, par. dt) ; readln (f, ch) ; readln (f, par .pt-gl ); readln(f, shotsperpt) ; readln(f, par. scan_gl) ; readln( f, ts. start) ; readln (f, par. sh) ; readln(f, ts. step) ; readln (f, par. skip) ; readln(f, ts. stop) : readln (f, par. timeperpt ); readln(f, ts. tO); readln (f, par. vstop) ; end; readln (f, par. yoffset ); dt_ELE: with Dar. ele do readln (f, par .yscale ); be~in case par. dt of readln(f, s); dt-COR: with par. COX do readln( f, bs. tot) ; begin readln( f, bs. mode) ; readln (f, ch) ; readln( f, cal. ev) ; readln (f, shotsperpt ); readln (f, cal. len); readlnlf, ts. start) ; readln(f, cal. tOl ; readln( f, ts. step); readln (f, ally); readln( f, ts. stop) ; readln (f, reprate); readln(f, ts. tO); readln (f, shotsperscan) ; end; readln (f, ts. POS ); dt_ELE: with par. ele do readln(f, ts. tO); begin end; readln(f, s); dt-POW: with par. pow do readln(f, bs. tot) ; begin readln (f, bs. mode) ; readln (f, ch) ; readln(f, cal. ev) ; readln(f, cal. int) ; readln(f, cal. len) ; readln(f, cal. sl) ; readln(f, cal. tO) ; end; readln(f, ally); dtJlhS: with par. mas do readln (f, reprate) ; begin readln (f, shotsperscan); readln(f, cal. int) ; readln(f, ts. pos); readln(f, cal. s1) ; readln(f, t6. tO); readln (f, ch); end; end; dt-POW: with par. pow do end; begin readln (f ); ( Read blank line separating header from data. ) readln (f, ch) ; end; readln(f, cal. int); ReadWavesUpgrade (w) ; ( upgrade to latest version. ) readln(f, cal. s1) ; end; end; dtJ4AS: with par. IMS do procedure ReadWaveHUpgrade (w : integer) ; begin ( Modifies version H wave so is compatible with latest version. ) zeadln(f, cal. int); begin readln(f, cal .s1) ; with hv.ls[w]”. par do readln (f, ch) ; begin readln (f, delay) ; vstop := pardf [dt ] .vstop; readln (f, inv) ; if dt = dtJ4AS then readln (f, scantime ); begin readln (f, vert ); mas. scantime :. pardf [dtl .nms. scantime; end: mas .vert := pardf [dtl .mas. vert; end; end; readln [f ); ( Read blank line separating header from data. ) end; end; ReadWaveIUpgrade (w) ; ReadWaveIUpgrade (w) ; end; end; procedure ReadWaveI (var f : teXt; w : integer) ; procedure ReadWaveIUpgrade (w : integer) ; ( Modifies version I wave so 1s compatible with latest version, ) sklplabel (f ), readln( f, ts, web. ampl) ; begin skiplabel (f ), readln( f, ts. web. per) : with wv. ls[w]-. par do skiplabel (f ); readln (f, ts. web. ph); begin end; gen := pardf[dt] .ge”, dt_POW: w~th par. Dow do pt := pt_gl; begin scan := scan_gl: skiplabel (f 1: readln( f, ch) ; case dt of skiplabel (f ); readln( f, cal. int) : OT_COR : skiplabel (f ): readln( f, cal. sl); cor. ts. wob := pardf[dt] ,cor, ts, web; end; !Y1’_ELE: dt_MAS: with par. mas do ele. ts. wob := pardf [dt] .ele. ts. web; beg in end; skiplabei (f ); readln( f, cal. int ); end: skiplabel (f I; readln( f, Cal. sl); .>.. ReadWaveJUpgrade (w) ; skiplabel (f ): readln( f, ch) ; ,,,, end: skiplabel (f ): readln( f, delay) : ,:. skiplabel (f ): readln( f, inv) ; procedure ReadWaveJ (var f : text; w : integer) ; skiplabel (f ): readln (f, scantime ); ,,,. var skiplabel (f ); readln (f, vert) : ... s : bufstring; end: begxn end: with w.ls Iw]” do readln (f ); ( Read blank line separating header from data. ) begin end; skiplabel (f ); readln (f, par. alert) : ReadWaveJUpgrade (w) : skiplabel (f ); readln( E, par. comment 1; end; ‘, ,,.,. skiplabel (f ); readln( f, par. dt); skiplabel (f ); readln (f, par. gen) ; procedure ReadWaveJUpgrade (w : integer) ; skiplabel (f ); readln (f, par. pt): ( t40dxfies version J wave so is compatible with latest version, ) skiplabel (f ); readln (f, par .pt_gl I: begin skiplabel (f); readln (f, par. scan) ; with W.ls[”]-. par do skiplabel (f); readln (f, par, scan_gl) ; begin skiplabel (f ): readln (f, par. sh); case dt of skiplabel (f ): readln (f, par, skip) ; VT_ELE : skiplabel (f ); readln (f, par, timeperpt ); begin skiplabel (f ); readln (f, par, vstop) ; ele, cal. quad := pardf [dt] .ele, cal, quad; skiplabel (f ); readln( f, par. yoffset) ; ele, cal. quadoff := pardf[dt] .ele. cal. quad; skiplabel (f ); readln( f, par. yscale) ; end; case par .dt of end; dt_COR: with par, cor do end; begxn end; skiplabel (f ); readln (f, ch) ; skiplabel (f ); readln (f, shots perpt ); procedure ReadWaveK (var f : text; w : integer) ; skiplabel (f ); readln (f, ts, start) ; va r skiplabel If ); readln (f, t.s,step) ; s : bufstring; skiplabel(f) ; readln(f, ts, stopl ; begxn skiplabel(fl ; readln(f, ts. to); with WV. lSIW]A do skiplabel (f) ; readln(f, ts. web, ampll, begin skiplabel (t) ; readln(f, ts. web, per); skiplabel (f) ; reafiln (f, par. alert) , sklplabel (f) ; readln(f, ts, web, ph) ; sklplc.bel (f) ; readln (f, par, comncmt) , end; skiplc.bel (f ); readln (f, par, dt) ; dt-ELE: with par. ele do skiplabel (f) ; readln (f, par, ge”) ; begin skiplabel (f) ; readln(f, par, pt) ; skiplabel (f) ; readln(f, bs, lastl ; skiplabel (f) ; readln (f, par pt_gl) ; sklplabel (f ); readln (f, bs. mode) ; sklplabel (f) ; readl” (f, par. scan) ; skiplabel (f) , readln(f, bs, tot), skiplabel (f) , readln (f, par. scan_gl ), sklplabel (f) readln(f, cal ev) , skiplabel (f) ; readln (f, par sh) ; sklplabel(f ); readln( f, cal len), skiplabel (f ); readln(f, par. skip) , sk>plabel (f) ; readln (f, Cal. to), sklplabel (f) ; readln (f, par. tlmeperpt ), sklplabel (f) , readln(f, ally), sklplabel (f) ; readln(f, par, vstop) skxplabel (f ), readln (f, reprate] sklplabel (f), readln (f, par yoffset ) sklplabel (f I, readln (f, shotsperscanl , sklplabel (f) , readln (f, par yscale) sklplabellf) readln (f, [s Pos), case par dt of sklplabellf) readlnlf, ts to), dt-COR with par cor do begin exit; skiDlabel (f ): readln( f, ch) ; end; ski~label i f )i readlni f; shotsperpt ); inc (corn.cur) ; skiplabel (f ); readln(f, ts. start) ; s := com.ls[com. curl ; skiplabel (f); readln( f, ts. step) ; val (s. bins, j); skiplabel (f); readln(f, ts. stoll); com_wr (,Bins ; + makostringint (bins) , COLQRDEBUG ); skiplabel (f); readln(f, ts. to): if (bins < 1 ) or (bins > MAXPOIWTS ) then skiplabel( f); readln(f, ts. web. anq?l); begin skiplabel (f) ; readln(f, ts. web. per); cOm_err; skiplabel (f); readln (f, ts. web. ph) ; exit; end; end; dt_ELE: with par. ele do W-sel (1); begin sc_sel_Of f; skiplabel(f ); readln( f, bs. last); if co~wr_yn (,Rebin, ) = O then skiplabel If); readln(f, bs. mode); exit; skiplabel (f); readln(f, bs. tot); for w := 1 to wv. num do skiplabel (f) ; readln (f, cal. ev); with WV.lSIW]’ do skiplabel (f); readln(f, cal. len) ; if sel = 1 then skiplabel (f ); readln (f, Cal. tol; begin skiplabel (f); readln(f, cal. quad) ; for i := O to par. pt div bins - 1 do skiplabel (f); readln (f, cal .quadof f ); begin skiplabel (f ); readln (f, dly ); temp := o; skip label (f ); readln (f, reprate ); for j := 1 to bins do

skiplabel (f ); readln(f, shotsperscan); temp := temp + data[i ● bins + j]; skiplabel (f ); readln (f, ts. pos) ; for j := 1 to bins do skip label (f ); readln (f, ts. to); data[i * bins + j] := temp / bins; skip label (f ); readln (f, ts. web. auel) : end; skip label (f ); readln (f, ts. web. per) ; com_wr (,Done rebin’, COLORDEBUG ); skip label (f 1: readln (f, ts. web. ph) ; datasaved := O; end; parsaved := O; dt_POW: with par .Pow do if par. dt . dt_ELE then be~in par. ele. bs, nwde := O; skidabel (f); readln(f, ch) ; SC. ls[screen] .sel := 1; ( tag screen for update. ) ski~label (f); readlnlf, cal. intl ; end; skiplabel (f); readln (f, cal. sl); wv-sel-of f; end; UpdateSel; dt_f.fAS:with par. mas do end; begin skiplabel (f); readln (f, cal. int); procedure -rescale; skiplabel (f ); readln (f, Cal. sl); ( Rescale wave so yscale = 1, yof fset = O. ) skiplabel (f ); readln (f, ch) ; var skiplabel (f ); readln (f, delay) ; i, j : integer; t-i skiplabel (f ); readln (f, inv) ; begin skiplabel (f ); readln (f, scantime) ; wv-sel (1); skip label (f ); readln (f, vert); sc_sel_Off; end; for i :. 1 to wv. num do end; with wv.ls[i]” do readln (f ); ( Read blank line separating header from data. ) if sel . 1 then end; begin end; for j := 1 to par. pt do , data[ j ] := PtoV(i, j, XAXISMODE_POINTS, SC. 1s [screen] .gr.

YAXISMODE) ● sgn (par .YSCale ); orocedure rebin; par. yscale := 1; j Handle dialog for data rebinning funct ion. ) par. yof fset := O; var datasaved := O; bins : integer; parsaved := O; i, j, w : integer; if par. dt . dt_SLE then s : bufstring; par. ele. bs. mode :. O; temp : real: SC. ls[screen] .sel := 1; ( tag screen for update. ) begin end: if corn.cur = corn.num then wv-sel-of f; begin UpdateSel; co~err: end; procedure SaveTime(w : integer) , function r~extension(s : bufstrlngl : bufstrlng: functxon Savewave(w : integer) : boolean; ( Returns filename s without its file extension. ) procedure sc_init(n : integer); var procedure sc_resize(n : integer) ; I integer; procedure sc_sel; . begin procedure sc_sel_off; I :. length(s); procedure Scan; while (s [i] <> ‘.’ ) and IL >= length(s) - 3) do procedure ScanCOR(s : bufstring; t : longint); dec(i); procedure ScanELE(s : bufstring; t : longint); ( Check to ensure file extension exists! ) procedure ScanMAS[s : bufstring; t : longint) ; lf i >= length(s) - 3 then procedure ScanPOW(var t : longint) ; 4. . rm_extensiOn := COPY (S, 1, i - 1); procedure ScanInit (w, blank : integer) ; end; function scanning(d : integer) : boolean; procedure ScanStoplw : integer) ; functxon rounddown (r : real) : longint; procedure ScanStopAll: ( Takes expression to next smallest integer if non-integer, regardless of function sech_sq(pos, fwhm : real) : real; sign. ) procedure SetSnergyConvers ion; begin function sgn(r : real) : real; if (r . O) and (r <> trunc(rll then procedure ShowParams(par_ptr : p.sr-type_ptr; p, w, poffs.et : integer) : rounddowm := trunc (r ) - 1 procedure SkipLabel(var f : text); else procedure Smoothsnergy(w : integer; res : real) ; rounddown := trunc (r); procedure SmoothTime(w : integer; res : real); end; procedure SmoothWiener(w : integer; res : real) : procedure StackWaves; procedure roundof f (vax r : real; s : real I; procedure Stage; ( Rounds off r to nearest multlple of s (can be > or . 1) ] function StageDelay(r : real) : longint; ,. begin functxon StageLookup(r : real) : real; r :. round(r I s) . s: procedure StageMove(r : real); end; procedure StageMoveDelay(w : integer; r : real) ; procedure StageMoveWait(r : real) : function roundup (r : real ) : long int; procedure SystemControl; ( Takes expression to next lar9est integer If non-integer, regardless of procedure tekset_rd(ch : integer); sign. ) procedure tekset_wr; begin function TEK_T1f4EPERFT_ to_code(timeperpt : real) : integer; if (r > O) and (r <> trunc(r)) then procedure tekwrite(wbuf : bufstring); roundup :. trunc (r) . 1 procedure tekwrite_ver(wb”f : b“fstring) : U else procedure TextMode; roundup := trunc (r) ; procedure TidyUp; end; procedure Time (var nowtime : lcmgint) ; function TimebaseToCode(r : real) : integer; end procedure ToggleAddWavesMode(w : integer) ; (procedure ToggleBackgrou”dS”btr?. ctionWod.s; ) procedure ToggleCrossha irsMode; procedure ToggleCrossha irsWhich; 4.5. fpesst pas procedure ToggleSaveMode; procedure ToggleXAxisMode lscr : integer;. mode : integer); procedure ToggleYAxisMode (scr : integer) ; unit Fpes ST; procedure ToggleYOf fsetRescale: ( History of mod> ficatlons (please add to BOTIOM of list,): procedure tx-dr(tx : tx-type_p) ; procedure tx_scr-up(tx : tx_type_p) ; Version 1: Begun 2jun94 BJG. procedure tx-wr(tx : tx_type_p; s : string; CO1 : word; scr : integer) ; procedure tx-wr_ch(tx : tx_type_p; c char) ; Procedures and functions beglnnlng with Y through Z for the program FPES. See FPES (at apprOprlate verslonl fOS more SPeClflc program modxflcatlon implemental Lon notes. ) uses crt, dos, FpesCom, FpesAI, FpesJR, FpesUZ, graph, Keys, TPDecl; lncerface procedure SaveE”ergy(w Integer) , uses ( Wrxte simple energy vs intensity file of wave w ) FpesVar, va r f text, ( File variable ) procedure SaveEnergy[w Xr>teqer) 1 Integer, ( Char counter ) ok : boolean; ( Flag for user input. ) if FileExists (s) then LbJ p : integer; ( Point number. ) if co%wr~aesc (s2 + ,file exists. Overwrite, ) . 1 then m s, .52 : bufstring; ( General string. ) exit; o begin c0nLwr(s2 + ,saved as , + s, COL@J4ESS) ; if wv. num = O then if FileODenWrite (f, s) = false then exit; exit; ( Determine if filename has same directory as dir, edit wavename so for p := 1 to par. pt do that ‘U’ always appears before rest of filename. ) writeln( f, PtoU(w, P, XAXISMODEJorIMl) , ‘ ,, Ptov(w, p, with WV.lSIW]” do KAXISMODE_normal, SC. 1s [se. cur] .gr. YAXISMODE) ); begin close(f) ; str (w, 62); end; S2 := ‘Wave ‘ +s2+ ‘ ‘; end; if par. dt <> dt-ELE then begin function SaveWave (w : integer) : boolean; com_wr (s2 + ‘is not ele datatype; not saved. ,, COLOSML) ; ( Save wave W, asking user’s Permission if file already exists. Return exit: true if saved; false if not. ) end; va r i f get_extension (par. fn) = dt_WAWE [dt_ELEl then f : text; s := rmextension (par. fn) + ,.en, i : integer; else ok : beolean; begin ( Old label method: use U prefix. ) s, 52 : bufstring; i := FilenameStart(par. fII] ; begin if i = 1 then if wv. num . 0 then s := ,u, + copy(par. fn, i, length (par. fn) ) begin else savewave := false; s := copy(par. fn, 1, i - 1) + ‘U’ + copy(par. fn, i, exit; length (par. fn) ); end; end; with W. lsIw1” do if not fullpath(s) then begin s := dir + s; str (w, 62); ok := TRUE; S2 :- ,Wave, +s2+ ,,; if FileExists(s) then s := par. fn; if com_wr~aesc (s2 + ‘file exists. Overwrite’ ) < 1 then if s . ‘‘ then ( Flag indicating user has not chgsen a name yet. ) exit; begin com_wr(s2 + ‘saved as ‘ + s, COIJJPJ4ESS); savewave z= false; if FileOpenWrite (f, s) = false then exit; exit; end; for P :. par. pt downto 1 do if not fullpath(s) then writeln( f, PtoU(w, P, XAXISMODE_convert), ‘ ,, Ptov(w, p, s := dir + s; XAXISMODE-convert, YPIXISMODE_relat ive) ); ok := TRUE; close(f) ; if FileSxists (s) then end; if coLwr_ynrsesc (s2 + ‘file exists. Overwrite’ ) . 1 then end; begin savewave := false; procedure SaveTime (w : integer) ; exit: ( Save wave in time space (work for any datatype) . ) end; var if FileOoenWrite (f, s) = false then f : text; { File variable. ) exit; - i : integer; ( Char counter. 1 co~wr (s2 + ,saved. ,, COLOPJ4ESS ); ok : boolean; ( Flag for user input. ) parsaved :. 1; P : integer; ( Point number. ) datasaved := 1; s, 62 : buf string; ( General string. ) writeln(f, HE&wu) ; begin writeln(f, PASLABEL [PAR_ALSRT] , LkSSL_SWD_CHAR, par. alert) ; if wv. num = O then writeln(f, PARLAEEL [PAPLcoh2wstrr], LnssL_2Nr_csfAR, par. conunent); exit; writeln(f. PARLABEL [PXDT], LhEEL-SND-CHAR, par. dt ); with WV.lSIWI” do writeln (f, PASLAESL [PAFLG2NI, LAESL_5Wr_CHkR, par. gen); begin writeln (f, p~2L[pws-r], L,4ssL_mo_CsAs, par. pt); str (w, s2); writeln (f. PARLAEEL [PAR_FT_GL], LASEL_SWD_CISAR, Par. pt_91 ); .s2 := ,Wave , +s2+ , ,; writeln(f, PAF.LASSL [PMSCAW], LABEI_2FR_CHAR, par. scan) ; s := rmextension(par. fn) + ‘.tire’; writeln(f, PASLkSSL [PmSCAN_GLl, LAEELslm_CWkR, par. scan_gl ); if not fullpath(s) then writeln(f, PARLAE2L[ PAR_SH], LASSL_SND-CHAR, Par. sh); s := dir + s; writeln (f, PASLASSL [PRSKIPI, LP5EL_SNr_CHAR, par. skip); ok := TRUE; writeln (f, pMnssL [pm_Txt42pERpTl, LABEL_END_CHAR. par. timepe~t ); wr>teln (f, PARLABEL [PAR_vsTUP ], I.ABEL_ENO_CHAR, par vs top) ; end; wrlteln( f, PARLABEL[ PAR_YoFFSET] , LABEL_ END_CHAR, par. yof fset I; writeln (f, eDATA. , LABEL_ END_CRARl ; Prepare for data. ) If globalsavemode = O then if globalsavemode = O ther.. wrl t eln (f, PARLABEL [PAR_YSCALEl , LABEL_ SND_CHAR, Par Yscale I begin else savemode := O: wri teln (f, PARLABEL [PAR_YSCALEI , LABEL_ END_CHAR. 11 ; for i:= 1 to par. pt do ( for i := USER141N to USERWAXdt [par. dt 1 do writeln(f, data[il); writeln (f, par. user{ ii); ) end case par. dt of else dt_COR: with par .cor do begin begin savemode := 1; write ln(f, PARLABELDT [DT_COR 1 [PAR_C_CHANNEL ], LABEL_END_CHAR , ch ); for i := 1 to par. pt do write ln [f, PARLABELDT [Ol_COR 1 [PAR_C_SHOTSPERPT 1, LABEL-ENILCIL4R , wrlteln(f, par. yscale “ data[il + par. yoffset) : shotsperpt) ; end; writeln (f, PARLABELDT [oT_COR 1 [PAR_C_STAGESTART 1, LABEL-END_CHAR, ts. s tar t ); close(f) ; writeln(f. PARLABELDT [OT_COR] [PAR_C_STAGESTEP ]o LABEL_ ~_CHAR, ts. s teP), DraW.iaveData; ( Display s flag beside wave, ) write ln(f, PARLABELDT [DT_COR 1 [PAR_C_STAGES~P 1. LAB EL_END_CHAR , tS S tOP ); savewave := true; write ln(f, PARLABELOT [OT_CORl [PAR_C_STAGSTO ], LAsEL_~_cHAR , ts to) ; end; writeln( f, PARLABELOT [Ol_COR ] [PAR_C_STAGFwObAMPL 1, LAB EL_ENl_CK4R , end; ts, web. arpll; wrlteln(f, PARL.4BELDT [OT_COR 1 [PAR_C_STAGEwObPER 1, LAB EL_ ENUcm , procedure sc_init (n : integer) ; ts, web. per); ( Set UP new screen with some default parameters. ) write ln(f, PARLABELOT [DT_COR ] [PAR_C_STAGEwobPHl , LAEEL_END_CHAR , ts .wob Ph ): var end; S2 : bufstring; dt_ELE: with par, ele do begin begin with SC. ls[n] do write ln (f, PARLABELDT [DT_ELEl [PAR_E_BS_LASTl, LABEL_ END-CRAR, bs. last ); begin write ln (f, PARLABEL~ [OT_ELEl [PAR_E-BS_MODE 1, LABEL-END_CHAR, bs. mode) ; mode := sc_mode_GR; write ln (f, PARLABELDT [DT_ELEl [PAR_E-BS.TOT] , LABEL-END-CHAR, bs tot) : sel := o; writeln( f, PARLABELDT [OT_ELEl [PAR_E_CALEV 1, LABEL-END_CfZAR, Cal. ev ); ti. on :. O; wrlteln( f, PARLABELOT [DT_ELEl [PAR_E-CALLENGTH 1, LABEL_END-CSiAR, cal. len ): str (n, 52); write ln(f, PARS-4BELDT [OT_ELEl [PAR_E-CALTO 1, LAB ELJIND_CHAR , cal tO ); ti, s :. ‘Use sc ti to change. 0; wrxteln(f, PARLABELOT [Dl_ELE ] [PAR_ E-CALQUAD 1, LABEL_EWD-CHAR, ca 1.quad) ; end: write lnlf, PARLABELWT [DT_ELE 1 [PAR_ E_CALQUADOFP 1. LAB ELJND-CmR , with sc. ls [n] .gr do cal quadoff) ; begin write ln(f, PARLABELDT [OT-ELE 1 [PAR_ E_TIMEFPES 1, LAB EL_ END_CHAR , dly ); cursoru := O; write ln (f, PARLABEL~ [DT_ELE 1 [PAR_ E_REPRATEl, LAB EL-5ND_cHAR, rep rate ): cursorvisible :. O; writeln( f, PARLABELDT [DT_ELE 1 [PAR_ E_SHOTSPERSCAN 1s LABEL_~D-C~ , ullim := O; shotsperscan) ; u21im := 1; wrlteln (f, PARLABELDT [D’T_ELEl [PAR_ E_STAGEPOS 1, LAB EL_ END_CHAR , ts POS ): vllim := O: writeln( f, PARLABELDT [OT_ELEl [PAR-E_STAGSTO ], LABEL-END-CHAR, tS tO I; v21im := 1; write ln(f, PARLABELDT [DT_ELEl [PAR-E_ STAGSwobAWPL] , LABEL-END-CHAR v xaxisdt := dt-MIN; ts web. ampl) ; xaxismode := XAXISMODE_WORMAL; write ln (f, PARLASELDT [w1’_ELE I [PAR-E-STAG ~obPER ], LABEL-END_CHAR , xfullmode :. 1; ts web. per) : xh. mode := O; wrxteln (f, PARLABELDT [DT-ELE I [PAR-E-STAG EwobPH ], LABEL-END-CHAR, ts wob ph ); xh. which := 1; end; xh. u[l] := ullim; dt_POW: with par, pow do xh. u[2] := u21im; begin xh. v[l] := vllxm; wrlteln (f, PARLABELDT [OT-POW 1 [PAR_P_C HANNEL 1, LABEL-END-CHAR, ch ); xh, v[2] := v21im; write ln (f, PARLABELDT [DT-POWI [PAR_ P-CALINTl , LABELJ?ND_CHAR, Cal. int ); xon := O; wrlteln (f, PARLABELDT [DT-POW 1 [PAR_ P-CALSLOPE ], LABEL-END-CHAR, CCI1 S 1 ); yaxismode :. YAXISMODE-ABSOLUTE, end, vfullmode := 1: dt_MAS. with par mas do begin end, wrltelnlf, PARLABELDT [DT_NAS ] [PAR-M-CALIWTI , LABEL_ END_CRAR, Ca 1 Xnt ), end, wrxteln (f, PAR LABELOT [DT_NAS 1 [PAR-M-CALSLOPE 1, LABEL_ END-CHAR, cal S1 ), wrlteln (f, PAR LABELWT [DT_WAS 1 [PAR-M-CHANNEL 1, LAB EL-END-CIU.R . ch 1: procedure se-resize (n : integer) ; wrxteln (f, PAR LABELDT 1DT_MAS 1 [PAR-M-DELAY 1, LAB EL- END-CKAR, de lay I, ( Reslzes screen n to limlts given by sc lslnl bdy ) write ln (f, PAR LABELDT [DTJ4AS ] [PARJUWV ]. LAB EL- EwD-c~R, lnv ). va r witeln (f, PARLABELDTIOT_NASl [PAR-M-SCAWTIMEI , LABELJND_CHAR SCant me Ic wr~teln (f, PARLABELDT[ DTJ4ASI [PAR-M-VERT] LABEL-END-C!~R. v~rt I begin end, ( Declare title block [if disabled. give no vertical hewht) ) with sc. ls[nl .tido takes UP one character height, give space of Lwo characters between + w begin each for readabi 1ity (hence factor of 3 ) ) U bdy[l]. x := sc. ls[n]. gr. bdy[l] .x; end; N bdy[2]. x :. sc.ls[n] .gr. bdy[2] .x; with yaxis do bdy[ll. Y := sc.ls[n] .gr. bdy[l]. y; begin

if on E 1 then yl :❑ ylabel. Y1 + yon . textcize div 2 + 1 - Yom; ( Ticks centered on number bdy[2] .Y := bdy[l]. y + textsize text. ) else y2 := ylabel. Y2 - yon ● textsize div 2 - 1 + yen; My[z] .y := My[ll. y; mnax := (x2 + 1 - xl) div textsize; end; mnax :. (Y2 + 1 - Yl) div textsize; ( NOW do graphics-specific areas. ) end; with sc. 1s [n] .gr do with xlabel do beain begin

( Declare axis, number and label x & y positions in two stages - first, the xl := Yaxis. xz - xon ● yon ● (NAXXDIGITS div 2 ) ● 0short- dimension, whose sizes are well-defined. .. ) textsize; ( Sndpoint of y axis, minus half the distance taken up with ylabel do by an x number of maximum width. ) begin x2 := bdy[z] .x; xl := Lxfy[ll .x; - :. (x2 + 1 - xl) div textsize; x2 := xl + yon ● textsize; ymax := (Y2 + 1 - Y1) div textsize; end; end; with ynumbers do with %numbera do begin begin xl := ylabel. x2; xl := xlabel. xl; x2 :. xl + yon ● MAXYDIGITS ● textsize; x2 := XIabel .x2 ; end; - := (x2 + 1 - xl) div textsize~ with yaxis do ymax :. (Y2 + 1 - Y1) div textsize; begin maxxnums :. xmax div (MAXXDIGITS + 1) ; xl := ynumbers. x2; ( Calculate maximum number of numbers to be printed along x axis, allow- x2 := xl + yon . text size; ing space of textsize between each number. ) end; end; ( Note reverse order of declarations for the following three entries: } with xaxis do with xlabel do begin begin xl := xlabel. xl + xon ● MAXXDIGITS div 2 ● textsize + 1 - xon:

yz := bdy[21. Y; x2 :. xlabel. x2 - xon ● MAXXDIGITS div 2 ● textsize - 1 + xon;

yl := Y2 - xon ● textsize; mnas := (%2 + 1 - xl) div textsize; end; YIMX := (Y2 + 1 - Y1) div textsize; with xnumbers do end; begin with plotarea do Y2 := xlabel. yl; begin

Y1 := Y2 - xon ● textsize; xl := XUis. xl; end; x2 := xaxis. x2; with xaxis do yl := yaxis. yl: begin y2 := yaxis. y2; y2 := xnumbers .Y1; ma% :.- (x2 + 1 - xl) div textsize; yl := yz - xon * textsize; m := (Y2 + 1 - Yl) div textsize; end; end; ( .. .now we go back to fill in the “long- dimensions, which siwly take up ( Calculate screen coordinates of XII. ) whatever room is left over. ) fori:=lto2do with ylabel do begin begin sh. x[i] := round (UtoX(xh. u[il, n)); yl := sc. ls[n]. ti. bdy[21. y; %h. y[i] := round (VtoY(xh. v[il, n));

y2 := xaxis. yl + xon ● yon ● textsize div 2; end; %max := (x2 + 1 - xl) div textsize; end; m :. (Y2 + 1 - Yl) div textsize; end; end ; with ynumbers do procedure sc_sel: beain ( SX~ineS co-d line for several levels of flags: null, valid wave ;1 := ylabel. yl; number list, or ,all, . Unlike wv_sel above, ‘sel, is not so convenient yz := ylabel. Y2; to implement, since it requires cursor moving around on screen titles, max := (s2 + 1 - xl) div textsize; not all of which may even be visible. So 1,ve settled for this entirely W-W := (Y2 + 1 - Yl) div textsize; adequate contmmnise. maxynums :. ynmx div 3; ( Calculate maximum number of numbers to be printed along Y axis; since each number only Sets wv. sel to O if no waves selected (if wv. num = O, or if sel option returned no tags) ; otherwise, sets to 1 Leaves tom. cur polntlng for i := 1 to sc. num do to last recounlzed word [initial command, -all’ , or last enumeration sc. ls[il. sel := O; list nurber. sc. sel := O; ) end; var dummy : integer: ( rnurmy variable for val. ) (...... exitf lag : boolean; ( Flag for enumeration list. ) NAIN SCANNING ROUTINE ...... ● ...... *...... i : integer; ( wave counter. ) ) s : bufstring; ( Holds current word, ) procedure Scan; ,; begin ( Read A/D card channels, check time elapsed on all waves and read data .: ( Set tags to 0. ) if needed. ) for i := 1 to sc. num do var sc. ls[il. sel := O, s : bufstring; ( ‘wave XXX’ storage. ) if corn.cur = corn.num then t : longint; ( Current time. ) ( Null. ) w : inte9er; ( Wave counter. ) begin begin sc.ls[sc. curl .sel := 1; ScanPQW(t ) ; ( Read AID card, update power scans, draw osc. ) sc. sel := 1; exit; ( Find active wave for scanwave to point to. If unsuccessful, scanwave end; = O. Note that scanwave will continue to point to same active wave inc [corn.cur) ; until WV. 1s []A. scan .done = 1 (because some processes require multiple s := corn.ls[com. curl: passes through this loop before the scan is done -- i. e. starting val (s, i, dummy); electron scan, then reading 30 sec later: redoing scan if data sc. sel := O; transfer is bad, etc. ) ) if (i >= 11 and (i <= sc. num) then if scanwave . 0 then begin W:=l sc. ls[il. sel := 1; else sc. sel := 1; w := scanwave; ( Read in more wave numbers. ) scanwave := O: exitflag := false; while w <= ww. num do while (tom.cur . corn.num) and (not exit flag) do with wv.ls[w]~ do beg in if par .dt .> dt-POW then inc(com. cur) : begin val(com. ls[com. curl, i, din): if scan. mode w 1 then ,;. if (i >= 1) and (i .= sc. num) then begin sc. ls[i], sel := 1 scanwave := w; q else “ := wv, num + 1; ( Trick to get out of loop. ) ., begin end j dec (corn,cur) ; ( Let calling routine figure out what was else meant. ) beg in > exit flag := true; if scan, mode . 1 then ( Reset scan mode to ‘new- posxtion end: before moving on. ) ,: end; begin end scan. mode := SCAN_NODE_NSN: else if s = ,all - then DraWiaveData; ( Erase old scanwave indicator. ) begin end; for i := 1 tosc. num do inc(w) ; ( Go to next wave. ) sc, ls[il. sel := 1; end; sc sel := 1; end end else else inc (w) ; begxn ( Unrecognized word; assume want curxent wave selected. ) SC. lSISC cur] .sel := 1; ( Check that scanwave is still val~d (otherwise indxcates no active sc sel := 1; waves) ) declcom cur) , ( Leave word for calling routine to decipher ) If scanwave > 0 then end, begxn end, str (scanwave, s) ; s =, Wave t+s+ .,; procedure sc-sel-oft, case W, ls[scanw.ave] - par dt of { Clears all sc 1s[] sel tags ) dt_COR ScanCOR (s, t 1, var dt_ELE ScanELE(s, t ) 1 integer, dt_NAS SCafINAS IS, t ) Lxgln ( dt-POW handled already -- see above ) end; scan. accum :. scan. accum + AD. ls[par. cor. ch] result; U end; inc (scan. shots] ; in EraseOsc j exit; .P end; end; ( Add averaged Point value to array, update counters. ) procedure ScanCOR(& : bufstring; t : lon9int) ; inc(par. pt) ; ( Scan. mode values for COR scans: data [par .ptl := data [par .pt] + scan. accum / scan. shots; scAN_t400EJJSW: Nothing done Yet. datasaved := O; ( Set to O after 1st successful point. ) 3: stage still moving. ( scan .accum := O; 2: Taking data. scan. shots :. O; ) 1: Ready to move to next wave. ( See if more points. ) (O: Not scanning. ) ) if par. pt c par .pt_gl then var begin dev’mme : nbuf; ( Device name. ) ( Advance stage. ) j : integer; ( General counter. ) StageMoveDelay (scanWave, par. cor. ts, start + par, pt ● k : integer; ( “ ) par. cor. ts. step); result : integer; ( B009ey variable for val. ) ( com_wr (,Press any key to continue, , COLORSL) ; r : real; ( General real. ) if readkey . ESTSNDED then S2 : bufstring; ( General strings. ) readkey; ) w : integer; ( Wave counter. ) scan. mode := 3; begin exit; with w. 1s [scanwavel n do end; begin ( Update counters. ) ( Done anything yet? ) inc (par. scan) ; i f scan. mode . SCANJ40DEJVJW then ( par. pt := O; ) begin ( See if more scans. ) if scan. cYcle mod (PFtr.SkiD + 1) = O then if par. scan < par. scan_gl then begin - scan. mode := SCAN_MODEJWW ( Start over at big stage move. ) ( Move stage to begiming, reset counters. ) else DrawNaVeData; ( Show new scanmode indicator. ) begin if par. alert = 1 then ( Send ack code. ) begin ( Pause before beginning. ) write (COM2, ACK); comwr (s + ‘press any key to begin. ,, COLORHL) ; if auto. off = 1 then if readkey = SKTSNOED then begin readkey; ( Check all waves for active electron datatypes. If find end; any, keep scan going. Otherwise, turn off. ) str(par. scan + 1, s2); scan. mode := O; com_wr(s + ‘scan ‘ + S2 + ‘ started.’, COLoRMEsS); for w :. 1 to wv. num do StageMoveDelay (scanwave, par. cor. ts. start ); if (wv.ls[w] ”.sc.an.mode > O) and (wv.ls[w]”. par. dt = scan. mode := 3; dt_ELE ) then par. pt := O; scan .mode := 1; Ao. ls[par. cor. ch] .on := 1; end end else else scan. mode := 1; scan. mode := 1; ( Move on to next wave. ) AutoSave (scanwave) ; inc(scan. cycle) ; ~ff (par. cor. ch) ; end ( Par. scan :❑ O; [ Reset counter for next round. ) else if scan. mc.de = 3 then end; ( See if stage is still moving. ) ( UE@=+te screen after each scan number. ) i f t - scan. starttime < scan. stept ime then if auto. cor . 1 then exit begin else FitY (dt-COR) ; ( Includes screen updatd. ) begin do-wv_inf o (scanwave, ,fwbm, ); scan. shots := O; end scan .accum := O; else scan mode := 2: begin end; UpdateVitals; i f scan. mode = 2 then Update (screen) ; begin end; [ Take all shots at one go, updating power scans as well. ) end; if scan. shots c par. cor. shotsperpt then end; begin end; ( Add value to accumulator. ) procedure ScanELE(s : bufstrmg; t : lon9int) , StageMoveDelay (scanwave, par ele. ts .Pos ). ( Handle regular and bs ele scans. ) scan, mode = 4; Var end; accum longint; inc[scan. cycle) ; j. k integer; end; ,,0: bg done, now reassign scanwave with -bs. fg and run this wave. ) Updatesel; Lf lwv. ls[scanwavel-. par. ele. bs. mode = 1) and (_bs. sts = O) and exit; (_bs. fg”= O) then end; begin ( MCS started? ) if scanwave = _bs .bg then if scan. mode = 2 then begin begin W, ls[scanwave l”. scan. mode := 1; ( Skip h wave. ) ( Wait some more? ) exit; if t - scan. start ti”e . scan. steptime then end; exit; _bs. fg := scanwave; ( Store fg wave number for later. ) ( See If MCS is really ready. ) scanwave := -bs, bg: { Do kg wave instead, ) mwrite(mcs. addr, ‘scan?, , false) ; 1 w, 1s [scanwave 1‘ .scan. mode := SCAN_MODE-NEW; ( delay (250); ) :. end: mread(mcs, addr, 10) ; ,,i Val(rdbuf, scan. shots, result) : if (-bs. sts = 1) and (scanwave = -bs. bg) then if scan. shots . par. ele. shotsperscan then WV. ls[scanwave l”. scan .mode := 1: ( Skip b-a wave. ) exit;

str (scanwave, s) ; ( If STS mode, also make sure TEK 1s ready. ) s:. ,wave-+s +,, , if _bs. sts = 1 then with w. 1s [scanwavel’ do begin begin ( See if TEK is really ready. ) ( Has nothing happened yet? ) mwrxte(tek, ,acq: state?< , true) : i f scan mode = SCANJ40DE_NSW then mread( tek, 2 ); begxn if ibbuf [l] .> ,0, then ( Check cycle count. ) exit; If scan cycle mod (par, skxp + 1 ) .> 0 then ( Read data, ) scan ,mode := 1 ( Skip to next wave ) tekwr~te( ,curve?, ): else if dataread(tek, 2 . w.ls[-bs, bg]~, par ,pt, _bs, bg) = false ( Move stage to correct locat Lon. ) then begin begin DratiaVeData; ( Show new scanwave indicator ) com-wr (,Error reading TEK data, Repeat l”g, , COLORHL] ; Lf par alert = 1 then scan mode = 3; ( Re-issue go- command for next pass, ) begin ( Pause whxle waiting to begin ) ex~t; cOm_wr (s + press any key to begin . COLORHL) , end; I f readkey = EXTENDED then end, readkey, end. ( Read MCS data and conf, rm that read was good ) ( str (par scan . 1, s2), ( Com-wr Is + 8readxng ,, COLORMESS ), ) com_wrls + ,scan + S2 + started COLORJ4ESS) ) mwr; te(mcs addr, ‘b~nb~f false) , ( delay (250) ; ) par. ele. shotsperscan / W. 1s [_bs. bg] 6 par .ele. if dataread(mcs .addr, 2 ● par. pt, scanwave) = false then shotsperscan; ( Scale by ratio of shotsperacan, s. ) begin Dar. ele. bS. tOt :* par. ele. bs. tot + oar. ele. bs. last; scan .mode := 3; ( Re-issue ‘go- ccmunand for next pans. ) ~ Print status information - pretend scan 9 is 1 more. ) exit; inc (par. scan) ; end; ScanELE_status; dec (par. scan); sc_sel_off; ( Blank screen selections for update list. ) end; end ( Add data to array, update counters. ) else datasaved := O; ( Set to O after 1st successful scan. ) ( fg wave chores: make next scan kg again. ) for j := 1 to par. pt do _bs. fg := o; data [j] := data[jl + tmp[j]; end inc (par. scan) ; else begin ( Non-bs mode chores : record counts and display. ) if _bs. sts = 1 then par. ele. bs.last := O; ( STS handling: ) for j := 1 to par. pt do begin par. ele. bs.last := par. ele. bs.last + tmp[j]; { Transfer data to kg wave, scaling data appropriately. ) ( Add to total counts of b-g wave. ) with w.ls[_bs. b9]” do par. ele. bs. tot := par. ele. bs. tot + par. ele. bs.l,ast; begin ScanELE-status ; par. ele. bs.last := O; end; for j := 1 to _bs. sts~lank - 1 do { Blank out noise spike. ) tlm[jl := fJ; ( Handle mon wave. ) for j := _bs. sts_blank2 + 1 to par. pt do if men. w > 0 then t-[jl := 0; begin for j := _bs. sts_blank to _bs. sts_blank2 do rnon.tot := O; I begin for j := 1 to par. pt div men. bins do

t- := (32767 ● ● with W. ls[rnon.w]” do - tmp[jl ) ~s. sts-vert -bs. sts_fac; I data[jl := data[jl + temP; begin par. ele. bs. last ~= par. ele. bs. last + tenw; data[j] := O; end; for k := 1 to men. bins do par. ele. bs. tot := par. ele. bs. tot + par. ele. bs.last; data[ j] := data[j] + wv.ls[scanwave] ’’.tmp[

inc (par. scan) ; (j - 1) ● men. bins + k]; SC. ls[screenl .sel :. 1; ( Select screen for uxate. ) men. tot := men. tot + data[jl: end; end; wv.ls[mon. w]”. par. pt := par. pt div men. bins;

( scale counts by shotsperscan ratios: ) w. 1s [men. w] ~.par. timeperpt := par. timeperpt ● mon. bins;

par. ele. bs.last := wv.ls[_bs .h21A. par. ele. bs.last ● with SC.lS [w. 1s [men.w] ‘.screenl .ti do par. ele. shotsperscan / W. 1s [_bs. bo’l6 .par. ele. shOtsperscan; if on = 1 then ( correction for non-toggle mode: record double the number s :- ,Tot , + makestringint (mOn. tot) ; of (bg) counts) : ) end; if par. ele. bs. mode = O then par. ele. bs.last := par. ele. bs.last * 2; ( No more scans? Two ways to terminate: par. ele. bs. tot := par. ele. bs. tot + par. ele. bs.last; 1. if par. sca~gl > 0, par. scan must be >= par. scan_gl; ScanELB_status; 2. if par.vstop > 0, - mst be >= par. vstop. ) end UpdateVLimits; else if (par. ele. bs. mode = 11 and (_bs. sts E 01 then if ((par .vstop > O) and (- z= par. vstop) ) or ((par. scan_gl > ( Non-STS BS handling: ) O) and (par. scan “>= par. scan_91) ) then begin begin if scanwave <> _bs. fg then scan .mode := O; ( We, re on bg wave, so calculate total counts. ) AutoSave (scanwave) ; begin UpdateVitals; par. ele. bs.last := O; U@ate(screen) ; ( Draw final screen. ) for j := 1 to par. pt do end par. ele. bs.last := par. ele. bs.last + -[1]; else ( Add to total counts of kg wave. ) scan. mode := 1; par. ele. bs. tot := par. ele. bs. tot + par. ele. bs. last; ( Get screens ready for update on next Pass. ) ( Now save values in fg wave, set up for fg scan. ) SC. ls[screen] .sel := 1; scanwave := _bs. fg; if men. w > 0 then with W. 1s [scanwave ]- do sc.ls[wv.ls [me. n.wl”.screenl .sel := 1; begin end; par. ele. bs. last := wv. ls[_bs. kg]”. par. ele. bs last “ end; end; S := ,ch, + chr(ord(, O,l + par mas chl ( Set charnel for data acquxsxtxon: ) procedure ScanMM (s : bufstring; t : longlnt 1 ; tekwrite [,data: source , + s) ; ( Scan .mode values for mass scans: ( ‘turn on channel: ) SCAN_MODE-NSW: Nothxng done yet. tekwrite(, sel:, + s + , on,); 2: TEK started. ( Set vert. position and offset to O: 1: Data read; ready to move to next wave. tekwrite(s + ,:offset 0,): ) (0: Not scanning. ) ) tekwrite(s + ,:POS O,); Var ( Read vert. scale, place in par, mas .vert. ) devn.une : nbuf: ( Device name. ) tekwrit={S + I:=ca~e?l ); j : integer: ( General counter. ) mread(tek, sizeof (s) ); k : integer; ( - ) s: =,.; result : integer; ( Boogey variable for val. ) for j := 1 toibcnt - ldo r : real; ( General real. ) s := s + ibbuf[j]; S2 : b“fstring; ( General strings. ) val (s, par. mas. vert, j); ( j 1s dummy variable. ) w : inte9er; ( Wave counter. ) ( 2 bytes per bin: ) begin tekwrite (‘data: width 2, ); .. with W. 1s [scanwavel” do ( Transfer desired number of data points: ) begin str(par. pt, s); ( Has nothing happened yet? ) tekwrite( ,data:start l;stop , + s) ; i f scan. mode = SCAN_FfODEBSW then ( Use signed binary format with LSB (low byte) transferred ,,,’, begin first: ) ~ if scan. cycle mod (par. skip + 1) = O then tekwrite (,data: encdg sribinary, ); begin ( Calculate minimum # of bins and set: ) ( Initialize Tek scope. ) j := round (par .pt) : ) ,..( DrawWaveData: ( Show new scmmmde indicator. ) if j <= 500 then if par. alert = 1 then j := 500 begin ( Pause while waiting to begin. ) else if j .. 1000 then cOm_wr (s + ,press any key to begin. ,, COLORHL) : j := 1000 if readkey = EXTENDED then else if j <. 2500 then readkey; j := 2500 end; else str(par. scan + 1, s2); j :. 5000; com_wr(s + ‘scan ‘ + 52 + ‘ started. ‘, COLORMESS) : str (j, s); ( Check that TEK is on GPIB card, ) tekwrite( ,hor:reco - + s) ; devname := -tek ‘: ( Set pretrigger to O%: ) ,.?.,{ tek := ibfind(devname) : tekwrite( ,hor: trig:pos 0, ); if tek < 0 then ( Check delay parameter to determine whether to we max” { begin or delayed trigger: ) com_wr (,Tek find error. 0, COLORHL) ; if par. mas. delay . 0 then ,,, scan .mode := O: begin DrawwaveDe.ta; ( Erase scanmode indicator, ) ( Use main sweep: ) exit: tekwrite (,hor:mode main< ): e“d: ( Set time per division I = time per pt < Pts per div) : ) lbclr(tekl ; Str (par. timeperpt ● TEK-PTPERDIV, s) ; ( shut off possible acquisition in progress (don’ t use tekwrite( ‘hor:main: scale o + s) ; tekwrite since this waits for scope to be free first, end which defeats purpose of shutting off an acquisltxon! ) ) else tekset-rd(wv. ls[scanwavel” .par. mas. ch) ; ( Record settings begin before changing ) ( Use delayed sweep: ) mwrite(tek, ,acq: state O,, true); tekwrite (,hor :mode delayed, ): ( No zoom: ) ( Set time per division ( = time per pt . pts per d~v] : ) tekwrxte (,zoom. state off, ), str [par. timeperpt . TEK-PTPERDIV, S ), ( Disable fit to screen: ) tekwrlte( ,hor:delay: scale , + s) , tekwrite( ,hor. flttoscreen off rI; ( Set delay time before starting acquxsxtion. ) ( Average multlple scans ) str(par. mas. delay, s); tekwrxte (‘acq mode ave, ), tekwrlte (”hor:delay .txme. runsafter , + .s), ( Number of scans to average. ) end, str (par scan_gl, s) ( Start the scan, ) tekwrxte( ,acq numavg + s) , tekwrxte( ‘acq state run< 1, ( Stop after set nuder of scans, ) f+.) tekwrite(, acq stopafter seq, 1, Tlme(sc?.n start tree), ( Record start txme ) WJ ( set up string for use by channel conumnds ) scan sr.eptmw . 100 , round (par scan-gll d~v TEKREPRATE, ( How long to wait between data reads. ) dec (scan. starttime, TINEMAX - scan. steptime) ; w scan. mode := 2; U end ( Handle power scans. ) 00 else for w := 1 to wv, num do scan. mode := 1; ( Skip to next wave. ) with WV. 15 [w]” do inc (scan. cycle) ; if (scan. mode > O) and (par. dt = dt_POW) then end; begin ( TEK started? ) ( Accumulate signal, update shots. ) if scan. mocle = 2 then scan .accwn := scan .accom + AD. 1s [par .pow. chl .result; begin inc(scan. shots) ; ( Wait some more? ) ( Time toadvance point counter? ) ift - scan. starttime c scan .steptime then ptadv := (t - scan. starttime) div scan. steptime; exit; if ptadv > 0 then ( See if TEK is really ready. ) begin rewrite (tek, ,acq: state?’ , true) ; ( Save averaged power in data array, update counters. ) mread(tek, ,2) ; inc(par. pt); if ibbuf[ll <> ‘O’ then data [par .pt] := scan .accum / scan. shots; exit; if ptadv > 1 then .[ Read data. ) inc (par .pt, ptadv - 1); ( Skip over intervening Points which tekwite( ‘curve?’ ): MY have been lost (due to user tying up cowuter) . ) if dataread (tek, 2 ● par. pt, scanwave) = false then datasaved := O; ( Set to O after 1st successful point. ) begin scan. accum := O; com_wr (‘Error reading TEK data. ‘, COLORffL) : scan. shots := O; scao. mode := O; Time (scan. start time) ; ( Start next point. ) exit; { See if enough points. ) end; if par. pt >. par. pt_gl then ibclr(tek); ( Reset tek for user. ) begin tekset-wr; ( Restore settings. ) ( Indicate scm is finished, UDdate counters, screen. ) ( Add data to array, update counters. ) ican. mode := O; datasaved := O; ( Set to O after 1st successful scan. ) par. pt :. par. pt_gl; ( Snsure points is not larger than ( Transfer data to wave, checking invert flag first: ) ma%. ) if par. mas. inv . 0 then ADOf f (par .pow. ch) ; ( Turn off channel. ) for 5 := 1 to par. pt do str(w, s) ; data [j1 := t~[jl com_wr( ,Wave , + s + , scan cou@leted. ,, COLORMESS) ; else UpdateVitals; for j := 1 to par. pt do Update (screen); data[j] := -tn!p[jl; AutoSave (w) ; scan .mode := O; end; UpdateVitals; end; Update (screen); end; end; end; end; end; procedure ScanInit (w, blank : integer) ; ( Sets needed variables when scan is started. blank is flag to reset procedure ScanPOW (var t : 10n9int ); scm number and blank data. ) ( Read A/D card, update power waves, handle time wraparound, draw osc begin if on. ) with WV. lsIw] - do var begin ptadv : integer; ( Number of points to advance in power scans. ) if blank . 1 then s : bufstring; begin w : inte9er; datasaved :. 1: I Initiallv-. ‘iust blank data so don, t care if begin not saved. )‘ ADReadAll; ( Read active channels on AID card. ) PillChar(data, sizeof (data) , O) ; time (t); ( Read cUrrent time. ) FillChar(trrp, sizeof (t.mp), O) ; DrawOsc; par. scan := O; ( Initialize bg total counts. ) ( Handle time wraparound: Normally t is always larger than start time, if par. dt = dtJ?LE then but if clock has just reset (at 12 AN), will be s~ller. In this case begin we just calculate the amount of time after 12 AN at which we need to par. ele. bs. tot := O; wait, and adjust startt imes accordingly. ) par. ele. bs.last := O; for w := 1 to wv. num do end: with W.lSIWIA do end: if (scan .mode > O) and (t < scan. start time) then scan. cycle :. O; scan. mode .. SCAN_MODE_NEW, ( Update (screen] , ) case par dt of end; DT_COR ( dt_ELE : begin Update [screen) ; ) par. pt := o: dt_POW: .. par. cor. ts, wob := ts.web; begin end; if scan. shots > 0 then ( Evaluate last point. ) PT_ELE : begin par. ele. ts. wob := ts.web: inc(par. pt.): DT_Pow : data [par .pt] := scan, accum / scan. shots; beuin end; iar. pt :. 0; ( if par. pt > 0 then ad. ls[par. pow. ch] .on := 1; ( Activate AID channel. ) par. pt_gl := par. pt; ) scan. steptime := roundl 100 . par. timeperpt) : ADoff (par. pow. ch) ; ( Turn off charnel if no others “si”g it. ) Time (sCan. Start tiMe) ; ( Start runnina imnediatelv. ) ( Update (screen) ; ) cOm_wr (,Wave , + makes tringint (w) ,: seaming. ,, COLORMESS) ; end; end; end; end; end; ,. end; end; .. end: ,.,< procedure ScanStopAl 1: !y function scanning (d : integer) : boolean; ( Stop all waves. ) i ( Determines If any d dt waves are active. ) va r var i : integer; w : integer: begin !,‘! ,,. , begin sc_sel_Of f; .: for w := 1 to W,num do for i :. 1 to wv. nurn do if (wv. ls[wl”. par. dt = d) and (wv. ls[wl”. scan. mode > O) then ScanStop{ i) ; begin UpdateSel; scanning := true; end; exxt; end; function sech_sq(pos, fwbm : real ) : real; scanning := false; ( Returns sechA2 (PO. / fwhm) ) end; const CONU = 1,762747174: ,.,, procedure SccmStop(w : integer) ; d var ,,,, ( Terminate scan in w, if one exists, ) x : real; var begin s : bufstring; ( General string. ) if (fwbm . O) then begin begin if wv, num = O then sech_sq := O; exit; exit; with w.ls IwI” do end; if scan. mode > 0 then x := CONV . pos I fwflm; begin sech-sq := 4 I sqr(exp(x) + exp(-x)); scan, mode := O; end; co~wr-wv (w, ‘done. ‘, COLORf’fESS); case gar. dt of procedure Set EnergyConversion; dt-COi : ( Allows user to input energy conversion factors (PAR_ E_CALLENGTW , ( Data WI1l be a mess lf took more than one scan, because data WI1l PAR-E_CALTO I whxch are applied to all existing ELECTRON waves, ) only be partially overwritten. User will decide if useful, but as var far as number of scans goes, I will report number of COMPLETE P: real; ( General power. ) scans. If only one scan taken, reduces number of poxnts to # s : bufstring; ( General string. ) actually taken ) w : lnte9er; ( Wave counter. ) begin begin ( If par scan > 0 then textmode: par scan-gl = par scan clrscr; else If par Pt > 0 then p := Power (setenergyconvers ionlength) , begin s . ,Enter calibrat~cm length (default . , + makes tring( par scan_ql = 1, setenergyconve rslonlength I p, f.fAXXDIGITS, MAXXDIGITS . 1 ) + , , + par pt-gl = par pt, Un; tPrefix (round (loql O(p) I) + ‘m) ‘, end, ) write ln(sl , ADoff (par cor ch) ( Turn off channel If no others us~ng It ) if macro-override . 0 then begin end: u rcadln (s ); end; a if s .> ,, then for w :.- 1 to wv. num do o begin with wv. ls[w]”. par do val_r (s, setenergyconversionleng th) ; if dt = dt_ELE then

6etenergyconvers ionlength :. setenergyconversionlength ● p; begin end; ele. Cal. len := Betenergyconvers i.anlength; end; ele. cd. tO := setenergycOnvers iOnt O; P := Power (setenergycOnvers iOntO ); ele. cal. quad := setenergyconvers ionquad; s := ‘Enter calibration TO (default m , + makes tring( ele. cal. ~adoff :. setenergyconversioncpado ff; setenergyconvers iontO / P, NAXXDIGITS, MAXXDIGITS - 1 ) + ‘ ‘ + ele. cal. ev := setenergyconvers ionlaserev; UnitPrefix {round (logIO(p) )) + ‘s) :‘; end; writeln(s) ; UpdateAll; if Macro-override . 0 then end; begin readln (s ); function sgn(r : real) : real; if s <> ‘‘ then ( Returns sign of r. ) begin begin val_r (s, setenergycOnvers iOntO ); if r < 0 then aetener9yc0nversi0 nt0 := setenergycOnversiOntO ‘ p; sgn :=1 -1 end: else end; Sgn := 1; P := Power (setenergyconversionquad) ; end; s := ‘Enter calibration quad factor (default . , + makes tring ( setenergyconvers ioncr.tad / P, WAXSDIGITS, procedure showParams (par_ptr : par-type--ptr; p, w, poffset : integer) ; NASXDIGITS - 1) + , , + UnitPrefix (round (logIO(p) )) + ‘eV) :‘; ( Write all ParZuneterS to screen. w is wave number (O if editing writeln(s) ; defaults ). ) if macro_override = O then var begin i : integer; ( Parameter. ) readln (s ); r: real; ( General real. ) if SC> ,, then Y: integer; begin begin val-r (s, setenergyconvers ionquad) ; textmode;

setenergyconversionquad := setenergyconversionquad ● P; Clrscr; end; ( Print header message. ) end; textcolor ILIGSTGREEN); P :. Power (setenergyconvers ioncpaadof f) ; if w . 0 then s := ‘Enter calibration quad factor (default . ‘ + makes tring( wriCeln_ctr( ‘Defaults,, 40) setenerdyconversionquadoff / D, WkSSDIGITS, else if W. 1s [w]a .scan. mode > 0 then f4?WDIGiTS - 1) + ‘ “ + UnitPrefix (round (loglO(p) )) + ‘eV): ‘; wribeln_ctr( ‘wave , + makestringint (w) + , active: REkD ONLY, , 40) writeln(s) ; else if macro_override . 0 then writeluctr( ,Wave , + nmkestringint (w) , 40) ; begin with par_ptr’ do readln(s) ; if (dt >- DT_NIf?) md (dt c. MWAX) then i f SC> ,, then begin begin y :. USERMAXDT [dt] - poffset + PARYSTART - 1; val_r (s, sete.nergyconve rsionquadof f ); if y > PARYSTOP then setenergyconversionrr.iadof f := y := PARYSTOP;

setenergyconversionquadoff ● P; for y := PARYSTART to y do end; begin end; i := poffset + y - PARYSTART + 1; P := Power (set~erwcOnversiOnl aserevl; gotoxy (13ikfiGEpwANE, y); s :- ‘Snter calibration laser energy (default = ‘ + makestring ( if i c USERMIN then setenergyconvers ionlaserev I p, NAXXPIGITS, MAXXDIGITS - 1 ) + , ‘ + textcOlOr(LIGW?GRESN) UnitPref ix(round(log10 (p) )) + ,eV) :‘; else writelnls) ; textcolor (WHITE): i f tnacro_overri* = O then ( Name: ) begin if i < USSRMIN then readln(s) ; write (PARLASEL[il ) if s <> ,t then else begin write (PAALAEELDT[dt] [i] ); val_r (s, setenergyconvers ionlaserev ); setenergyconver sionlaserev := setenergyconversionlaserev “ p: ( Values: ) PAR_ E_ STAG EPOS: WYX tevalue Iele. ts POS, POWTS, VALDECTS, gotoxy (CWANGEPARXVALUE, Y) , VALMAXTS. ‘m,); if i = P then PAR_ E_ STAGETO: Wri tevalue Iele, ts, tO, Fowl%, VALDECTS, VALMAXTS. textcolor ILIGHTRED) ‘m’); else if i < USERMIN then PAR-E-STAGEWObANPL: writevalue (ele. ts. web. ampl. POWrS, textcolor (LIGH’ICREEW) VALDECTS, VAIMAXTS, em 0); else pAR-E_STAG~obpER: writevalue (ele. ts. web. per, POW1’S, textcolor [WHITE) ; VALDECTS , VALWAXTS , ‘m’): case i of PAF.-E-STAG~0bpH: writevalueunitless (ele. ts. web. ph, 0, PAR_ALERT: write (alert I; VALDEC, VALMAKI ; PAR_COMM~: write (comment) : pAR-E_TIMEFpEs: writevalue Ie le. dly, POWFS, VALDECFS, VALMAXFS, PALdt: write (dt_NAWE[dt 1); ,s, ); PAE_FILENAWE: write (fnl : PAR-E-SHOTS PERSCAN: write (ele. shotsperscan ): PAR_GEN: write [gen) ; end; PAE-PT: write (ptl: dt_POW : PAR_ FT_GL: write (pt_gl) : case i of PAP._5CAN: write (scan) ; PAR_ P_CHAWNEL: write (pow. ch ): PAR_SCAN_GL: write (sca”_gl ); PAR_ P_CALIFrT: writevalue(pow. cal. int, O, VALDEC, VALWAX, ,W, ); PAR_SH: write (wv_sh_NAWE[shl ); PAR-P-CALSLOPE: WriteValue (POW. Cal. s1, 0, VALDEC, VAS24AX, ‘w, ); PAR_SKIP: write (skip) : end; PAR_TIMEPERPT : dt_MAS : i f dt .> dt_COR then case i of wri tevalue (timeperpt, O, VALDEC, VALMAX, PAR-W-CALINT: WriteValUe(ms. Cal. int, 0, VALDEC, VALMAK, ‘s’): else PAR-M-CALSLOPE: WriteValUe(~S. cal. s1. O, VALDEC, VALMAX, wri tevalue (t imeperpt, POWPS, VALDECFS, VALMAXFS, Vs, ): ‘Da{sA2, ); PAR_VS’mP: wrltevalueunitless (vStop, O, VALDEC, VALK4X) ; PAR-f4-CHANNEL: write (mas. ch) ; PAR_YOFFSET: writevalueunitless (yof fset, O, VALDEC, VALWAS) : PAR-M_DELAY: writevalue (mas delay. 0. VALDEC, VALMAX, -s, ); PAR_YSCALE: wrltevalueunitless (yscale, O, VALDEC, VALMAX) ; PAR_lLINV: write (mas. inv) ; else pAR_w-sCmIME: writevalue (mas. scant ime, 0, VALDEC, VALMAX, ,s. case dt of ); dt_COR : PAR_M_VERT , Writevalue (mas, vert, O, VALDEC, VALMAX, ‘V/div< ) ; case i of end: PAR_C-STAGESTART: writevalue (cOr. ts. start, POWTS, VALDECTS, end; VALWAXTS, ,m, ); end: PAR_C_STAGESTEP: wr itev.alue (cor. ts. step, POWTS, VALDECTS, end; VALNAKTS, ,m, ); end: PAR_C_STAGESTQP: wri tevalue (cor. ts. s top,POhTS, VALDECTS, ( In order to write text in white, must print somethxng to screen - VALMAXTS, ‘m,); so we put a space in the corner, ) PAR-C_ STAGETO: Wrl teValUe (Cor. ts. tO, POWTS, VALDECTS, VALWAXTS, gotoxy (79, 25); ,m, ); textcolor (WWITE) ; PAR_C_STAGEwObAWPL: wrltevalue (cor. ts. web. awl, POWTS, write(, ,); VALDECTS , VALNAXTS , cm,); end: PAR-C-STAGEwobPER: wricevalue (cor. ts. web. per, POWTS, VALDECTS, VALMAXTS, ,m, ); procedure SkipLabel (var f : text) ; PAR_C-STAGEwObPH: wrltevalueunitless (cor. ts. web. ph, O, ( Reads past label (terminated by LABELJ2JD-CHAR) in w or ws flle. ) VALDEC , VALMAX ); Var PAR_C_CHANNEL: write (cor ch) : c : char; PAR-C-SHOTSPERPT: write (cor. shotsperpt ): begin end; repeat dt-ELE : read (f, c); case i of Unt i1 c = LABELJND_cwAR; PAR-E_ BS_lA4ST: wrltevalueunltless (ele bs. last, O, VALDEC, end; VALNAK ); PAR_ E-B S_MODE: wr 1te (el e bs mode) ; procedure SmoothEnergy (w integer; res real) ; PAR-E_ BS-’T0T, writevalueunlt less (ele. bs. tot, O, VALDEC, ( This 1s taken partly from the procedure SMCXJTH M the TENURE VALMAK ); computer code mplemented by S, Brad forth PAR-E-CALEV. writevalue(ele Cal ev, 0, VALDEC, VALMAX, ‘eV$ ), smoothed data [EO] . sum over i (welghc [EI-EO] . date.[EO] 1 PAR-E-CALLENGTH. wrltevalue lele cal len, O, VALDEC, VALMAX, ...... - ‘m<), sum over L weigh t[E1-EO] PAR-E-CALTO wrlcevalue(ele Cal cO, 0, VALDEC, VALMAX. s, ), ) PAR-E-CALQUAD wrltevalue(ele Cal guad, O, VALDEC, VALMAX, ‘m2/s2 ,), var PAR_ E-CALQUACOFF wrltevalue(ele cal quadoff, 0, VALDEC. VALMAX. slm 1, a real, PAR-E-REPRATE wrltevalue[ele reprate, 0. VALDEC. VALMAX, ‘Hz’ 1. energy, real, factor : real; s : bufstring; i, j : integer; timej : real; max : integer; t_wt : real; ( Total weight. ) maxdE : real; t_wt_y : real; ( Total weight g data. ) min : integer; Wt : real; ( Weight. ) range : integer; begin realdE : real; with WV.lSIW1” do ( root : real: ) begin

t : real; res := res ● le-9; ( IIS -> S. )

totalwave : real; a :=.4 ● Lt_2 I res / res; ( convert fwhm to std. dev. ) totalweight : real; range :. trurtc(SQRTLN-1OO / sqrt (a) / par. timeperpt); Wgt : real; ( set UP limit such that smooth iff weight (ti - tjl >= 0.01 ) begin for j := 1 to par, pt do

a := 4 ● LW_2 / res / res; ( convert fwhm to std. dev. ) begin maxdE := SQRTIJL1OO / sqrt (a); timej := PtoUlw, j, XAXISMODEJJORWAL) ; ( set UP limit such that smooth iff abs (EO - Ei) . maxdE so that if ( range > 1 ) then ( smooth this point 1 ) weight (EO-Ei) >= 0.01 ) begin with WV.lSIWIA do min := j - range; begin if ( min < 1) then

factor := 2 ● SLOPEFAC’F2R ● par. timeperpt ● sqr (par. ele. cal. len) ; min := 1; for j := rauin to par. pt do begin max :=.j + range;

t := j ● par. timeperpt - par. ele. cal. tO; if ( maw > wv.ls[wl”. par. pt ) then ( root := sqrt (slope* (slope+ 4*t*quad) ); ) ma% :. WV. ls[w]”. par. pt; realdE := factor / (t ‘ t ● t); t_wt := 0.0; ( realdE := timebase” ((slope+ root) /t/t/ t+quadltlt* (l-SIOPel ZOOt) ); t-wt~ := 0.0; ( realdE is the differential step in energy. Note that for i := min to max do xealclsf timebase is derivative of E as a function of t ) begin range := trunc (maxdE / realdE) ; wt := weight (PtoU(w, i, SARISNODE_NORMAL) - timej, al ; if range > 1 then begin t_wt := t_wt + Wt; I min := j - range; t_wtfl := t_wtfl + wt ● data [i] ; if min < pmin then end; min := pmin: wv. tenp[j] :. t-wt~ / t_wt ; max := j + range; end if w > par. pt then else max := par. pt; wv. temp[jl := data[jl; totalwave := O .0; end; totalweight := O. O; for j := 1 to par. pt do energy j :. PtoU (w, j, xaxismode_COWVERT) ; data [j] := wv. temp[j]; for i :- min to w do begin end; wgt := weight (PtoU (w, i, xaxismode_CONVERT) - energy j, a ); end;

totalwave :. totalwave + wgt ● data[il : totalweight := totalweight + wgt; procedure SmoothWiener (w : integer; res : real) ; end; ( Performs time-domain smoothing using a Wiener filter method. This wv. te~[jl := totalwave / totalweight; apprOach Itaken from T-E program in S. E. Brad forth’s thesis) con- end sists of a Fourier transform of the energy data, multiplication of the else transformed data by a Lorentzian filter function, and inverse-Pourier wv. tenu[jl := data[jl; transform back to energy space. end: ( looP ) ( Copy data back, blanking out parts below pmin. ) Assumes filter array already set up, since this takes some time to for j := 1 to pmin - 1 do generate and can be used for multiple jobs. ) data[jl := O; var for j := snnin to par. pt do a : f ft_array-type; ( Storage of transformed data. ) data [j] := wv. temp[jl; i, ii : integer; end; begin end; with WV. lsIw] A do begin ( Quick check that points are compatible. wentually may want to procedure SmoothTime (w : integer; res : real); use a padding method so any length wave can be filtered. ) ( Smooth wave w in time. ) if par .pt <> NASPOINTS then va r begin a : real; comwr (‘Wrong number of points, , COLOPJiL) ; i, j : integer; exit; max. ruin : integer; end; range : integer; ( Set up a. ) for x = 1 to MPOI~S do ok := TRUE; a[2 S I - 1] .= data [i]: writeln( , ,); 8[2 . i] .= 0: writeln( ‘Type full width at half maximum (in mev) of Ga”=sxa”, ); . end; writeln( oto be used for smoothing. ,); ( Fourier transform. ) readln(resolutlon) : . . fft (a. WAXPOIWTS, 1): if (resolution .= O) then ( Filter, ) begin for ii .= 1 to MAXPOIWTS div 2 + 1 do begin writeln (,Resolution must be a positive number. ,) ; X:=2 .ii; ok := FALSE: .. -; ali - 11. := all. - 11 . filter [iii; end; ., all} := a[il . filter [iii; until (ok = TRUE) : end; resolution := resolution I 1000. O; ( convert from meV to ev ) for ii :. MAXPOIWTS div 2 + 2 to f.fMPOIWTS do begin ( if (w = 0) then i:=2. xi; for k :. 1 to wv. num do

a[i - 11 := a[i - 11 ● filter [t.U.XPOIWTS - ii + 21; begin a[i] := a[i] . filter [MAXPOIWTS - Ii + 21; SmoothWave (k, resolution) : >: end; wv. ls[k]- .saved :. O; .... ( Inverse Fourier transform. ) end ,~,. fft (a, wAXPOIfWS, -l); else ( Transfer back to wave data. ) begin for i :. 1 to par. pt do SmoothWave (w,resolution) ; ,f’- data[il := a[i ‘ 2 - 11 / MAXPOIWTS; wv. ls[w]~ saved := O: ,.?. end: end; end; end; ( if ) :: ( DrawAll; (procedure SmoothWaves; end var else exit flag : boolean: begin k : integer; write [#7) ; ok : boolean; message := ‘Must be an Energy Scan, <; resolution : real: Drawrnessagebox; w : mte9er: end: begin end; ( procedure SmoothWaves ) if (scan_ .mode = 1) and (scan_. w = wv. cur) then exit; procedure StackWaves; if (scantype = SWERGYSCAN) then ( Stack waves vertically, ) begin va r TextMode; a : real; ( Generxc real, ) write ln(, ,) ; c : char; ( Generic char. ) writeln( ‘Gaussian smoothing of data. ‘); s : bufstring; ( Generic string. ) exltflag := FALSE; w : integer; ( Wave index. ) repeat beg in ok := TRUE; if t+v.num = O then write ln(, ,): exit; wrlteln( ,Whlch wave would You lxke to smooth? (O will smooth all waves) e); a :=0; wrxteln( ,We a negative value to exit. 8); wrlteln; readln (w) ; wrlteln( 8Enter Y spe.cxng between each wave A posxtxve v.al”e indicates wave 1 IS

,’ if (w > wv, numl then on top; ‘);

,.~ begin wrxteln( ,a negative value indicates wave 1 is o“ bottom. Enter O to s“permqmse wrlteln(, ,) : all,); wrlteln( ,Inputted wave number out of range. ,): wrlteln (,waves. Preview off set values WI1l be undcme, ,); ok = FALSE; writeln( ‘Default = , + makes tring (a, MAXXDIGITS, WAXXDIGITS - 1) + , ($ end, + sc. ls[sc. curl .gr. yunits + ,): ,); If (W < O) then readln (s) ; exltflag = TRUE, if s .> I, then until (ok = TRUE) or (exit flag = TRUE), begin if (exltflaq = FALSE) then val-r (s, a), begin a = .3 . sc, ls[sc cur] gr ypower; ~f IW . 01 then end, wrlteln ( Wavename ‘all waves .,) if a >. 0 then ( stack dowrward from 1st WaVe ) else for w := 1 to w nwn do ..+”ave [w]. wavename+( . 1 wrlteln ( Wavename w ls[w]~ par yoffs.?t = a , (wv num - WI I w lsIw]- par yscale repeat else ( Stack “pw.ard from lsc WaVe ) for w := 1 to wv. num do delay (ACKOELAY );

wv. ls[wl’. par. yoffset := -a ● (w - 1) / wv. ls[wl”. par yscale; write (COM2, ,#CAABSL, + LF); UpdateAll; ts. pos := o; end; end; end: ( Extended keys. ) #A#, #a#: procedure stage: ( Allows user to communicate with Aerotech translation stage. ) begin cons t write (COM2, ACK) ; LF . 810: ( Compiler seems to need this declaration here rather than in the delay (ACKOELAY) ; Keys unit. ) end; var ‘c’, *C,: c : char; begin conmwmd : string [801; writeln( ‘Snter command to send (begin with # if not CA-type command) :‘); exitflag : boolean; readln (command) ; 1 : real; write (COM2, ACK) ; P : real; ( Power of 1000. ) delay (ACKDELAY ); readAO : boolean; if comnand[ll . ‘#’ then sum : real; write (COM2, command + LF) x : integer; else begin write (C0M2, ‘*CA’ + conmw.nd + LF); readAD :. false; end; ,H, , ,h, : exitflag := PALSE; textmode; begin Clrscr; Clrscr; { Main looP. ) writeln (‘UP arrow: Double step size. ‘); repeat WRITELN(’ D@n arrow: Halve Step size.’); write( ‘Position = ‘); WRITSLN( ,Lef t arrow: Move stage backward. -); writevalue (ts .POS, POWS, VALDECTS, VALJ4AKTS, ‘m’ ); WEITELN (‘Right arrow: Move stage forward. ‘); write (,. Step size = ‘); WRITELN(’ESC: Sxit. ’); writevalue (move. step, POWM, VALDECTS, VALMAKTS, ‘m’ ); writeln (‘HOME: Home stage and place in absolute mode. ‘); writeln(, . Type H for help. ‘); writeln( ‘A: Send ACK code. ‘); if readAD = true then writeln( ‘C: Send command. ‘); I while not keypressed do WRITELN (‘H: Display this help screen. ,); begin WRITELN(’ I: Initialize. ‘); writeln(ADRead(l) ); WRITELN( ‘P: Change position. ‘); delay (100) ; writeln( ,R: Readldon-t read AID converter. ‘); end; WRITELN( ‘S: Change step size. ‘); case readkey of writeln( ‘T: Toggle stage. ‘); EXTENDED: WRITEIJi (,X: Send disengage co-d (*2A) .‘); case readkey of WRITELN; XARROWOP : end; begin ’1’, ‘i’:

move. step := move. step ● 2; begin if move. step > STAGEMAX then ( Send setup comds. ) move. step := STAGSNAK; writeln(, Set up. Please wait. ,); end; write (COM2, #3) ; XARROWOOWN: ( Down arrow ) DELAY (1OOO) ; if move. step > ts. step then write (COM2, #32) ;

move. step := int( (move .step / ts. step) ) ● ts. step / 2: DELAY (1OOO) ; XARROWLEPT: ( Left arrow ) write (COM2, #30) ; if ts.pos - move. step >= STAGSMIN then DELAY (1OOO) ; StageMove(ts. pOs - MOVe. SteP) : write (CON2, ACK) ; XARROWRIG~: ( Right arrow ) DELAY (ACKOELAY ); if ts.pos + move. step <= STAGENAX then ( Home stage. ) StageMove(ts. pOs + move. Step) ; writeln (,Homing stage. Press RETURN when ready. ‘); KXOMS : write (COM2, ‘#CAHN’ + LF); begin readln; write (COM2, ACK) : write (COM2, ACK) ; delay (ACKDELAYI ; ( Set absolute mode. ) write (CON2, 4#CA194’ + LF); write (COM2, ‘#CAASSL’ + LF) ; writeln (‘Homing stage. Press any key to send AESL command. ,); delay (1000) ; readln; write (COM2, ACK) ; write (COM2, ACK) ; ts. pos := o; end: delay (ACKDEL4Y 1 ; ,p. , ‘p, : ( Change position ) write (COM2, .#EA< + LF); begxn end; write( ‘Enter posltlon (default = ,). ESC: ( S%it. ) writevalue Its .Dos. POWTS, VALDECTS, VALFLAXTS, ‘m< ); begin ,, write in(,):,): write (COM2, ACK) : readvalue (ts .Pos, POW2LS); exitf lag ,= TRUE: roundoff(ts. pos, ts. step) : end: limit (ts .Pos, STAGEKIN, STAGEMAX) ; end; StageMove (ts .Pos) ; until exitflag . TRUE; end; DrawAll; ,R, , -r, : ( Toggle read/don, t read AID converter. ) end; readAD := not readAO: ,s, , ,s, : ( Change step size ) function StageDelay (r : real) : longint: begin ( Calculates delay time for stage to move to position r from ts .Pos. write( ,Enter step size (default = ‘I; If ts ,pos . 0 (always case atstartup, and rarely thereafter) , re- wri tevalue (move. step, POhTS, VALDECTS, VALMAXTS, am 8); turns -delay wh~ch is a flag to have program wait for user input to ,.. write in(-):,); know when stage has stopped moving. Value returned is in 100th of a readvalue (move. step, POW2S) : second. ) roundoff [move .step, ts. step) ; var limit (ts. pos, ts, step, STAGEMAX) : temp : longint; .. end; begin ‘T, , ,t, : ( Toggle stage. ) temp := round (abs(r - ts. pos) . ts. wait, sl) + ts. wait .int; ( Smpirical begin formula. ) write( ‘Enter starting position (default = ‘): if ts. pos > 0 the” writevalue (move. start, PO!+TS, VALDECTS, VALMAXTS, ‘m’ ); stagedelay := temp write in(,):,): else readvalue (move. start, POWTS) ; stagedelay :G -temp; roundoff (move .start, ts. step) ; end; limit (move, start, STAGEMIN , STAGEMAX ); write( ‘Enter ending positxon (default = ‘); function StageLookup (r : real) : real; writevalue (move. stop, PONTS, VALDECTS, VALMAXTS, ‘m, ): ( Looks up r in lookup table ts .wob. lookup to find corresponding write in(,):,); position to sulnnit to stage. ) readvalue (move, stop, POWW. ); var roundoff (move .stop, ts. step) ; i, j, k : integer; .I limit (move. stop, STAGEMIN, STAGSNAXI ; rx, rj : real; write (,Enter time to Walt (default = ‘1; rdiv : real; < wri tevalue (move. wait, POh”TS. VALDECTS, VALMAXTS, ‘s’ ); begin write ln(, ): e); if ts .wob, per < TS_STEP_NIN then readvalue (move. wait, PO!WS) ; ( Do nothing if period is O (prevents /0 error) ) roundoff (move .wait, le-3) ; begin if move. wait . 0 then stage lookup := r; move. wait := O; exit: sum :. move, start + move. stop; ( Math trick: add limits to- end; gether; then can toggle between the values by subtracting { Calculate integer divisor and modulus of lookup posiLio”, ) ts. pos from it each time (see below) ) rdiv := ts. web. per “ (trunc(r I ts. web. eer - ts. web. ph + 11 - 11; writeln( ,Movmg to starting position. Press RET(N?N when ready. o); ( + 1 ensures arg of trunc functxon 1s positive, ) StageMove (move, start) ; r := ts, web, per . frac(r / ts. web. per - ts, web. ph + 1); readln; ( + 1 ensures arg of frac function 1s positive. No need to add back wrlteln( ‘Press any key to exit ,): since frac only keeps fraction anyway, ) repeat ( Inltialxze positions, ) StageMove (sum - ts. pos) ; 1 :.0; write (BELL) , ) := TSJJXJKUPJAX ; delay (round (move .wait “ 10001 ), ( Use binary search to fxnd closest position ) until kenxessed; whxle]-l>ldo ( Remove character from buffer ) begin Lf readkey = EXTENDED then k = (> + ]) dlv 2; readkey; If r . ts lookup [k] then end, ].k ,x, , x ( Send disengage command 14EAI ) else begin 1 = k, b.) wrlteln[, #EA, l, end, m wrlte[COM2, ACK) ( and use mterpol.at~on co calculate fract~onal Lndex posxc>on ) W ri := ts. lookup [ii; begin w rj :. ts. lookup [jl; time (stoptime) ; m

stagelookup := rdiv + ((i ● (rj - r) + j ● (r - ri)) / lrj - xi) / inc lstoptime, del div 10) ; m

TS_LOOIOJPJfAX + ts. wob. ph ) ● ts. wob. per; reneat end; time(t); until key?xessed or (t > stoptime) ; procedure StageHove (r : real) ; if keypressed then ( Sm@y buffer. ) ( Move stage to position r (m) and update ts .P05. ) if readkey = EXTENDED then cons t readkey; LF = *1O; ( For some reason compiler needs this defined again. ) end; var ( delay (dell; ) comnand : bufstring; ( General string. ) end; begin if (r c STAGSM2N) or (r > STAGE24AK) then procedure SystemControl; exit; ( Allow control of some system features (mostly for debugging purposes). ) write (COM2, ACK) ; var ( delay (ACKDSLAY) ; ) exitflag : beolean; ( StageLookup: Correct position using lookup table. ts. step: alter r : real; number of steps sent to ts based on current stepsize. ) w : integer; command := makes tringint (round (StageLookuP (r) / ts. SteP) ); 11, 12 : longint; write (CON2, ,#cAo(, +con’mmd+ ‘)’ +LF); begin ts. pos := r; TextMode; end; exitflag := false; repeat procedure StageMoveDelay (w : integer; r : real); writeln; ( Move stage to position r. If ts. pos = O (the case when Pr09r~ is writeln( ‘System menu. ‘); first started) , automatically waits for user input before continuing. writeln (‘ (A) Turn device reading on/off. ‘); Changes wave [w]” .scan. starttime and steptime so program can stop after writeln (, (S) Toggle debug flag. ,); proper time. ) writeln (‘ (C) Print available memory. ‘); begin writeln(’ (D) Print AD. 1s [].on array. ‘); with w.ls[wl” do writeln (, (E) Print %h info on current screen. ,); begin writeln (, (F) Print some infO on current wave. ‘); Time (scan. starttime) ; writeln (, (G) Write graphics info for current screen. ,); scan, steptime := Sta9eDelaY(r); StageMove (r) ; writeln(’ (X) Exit. ‘) : if scan. steptime < 0 then ( Flag that user must tell when stage case readkey of done movihg. ) ‘a’, ‘A’: begin begin conLwr (cOnLwrJfOVINGSTAGE, COLOFOiL ); dev_rd :. 1 - dev-rd; if readkey - EXTSNDED then writeln (,dev_rd = ,, dev_rd) ; readkey; case dev_rd of scan. steptime := O; { No need to wait. ) o: end; begin end; write (COM2, ACK) ; end; c10se(COM2); end; procedure StageHoveWait (r : real) ; 1: ( Moves stage and waits for calculated length of time. ) begin va r assign (COM2, ,C0M2, ); del : longint: rewrite (COM2) ; sto~time. t : 10nGint; Init_ts; begin- end; end: del := 10 ● StageDelay(r) ; ( Delay in MS. ) StageMove (r ); end; if del < 0 then { Flag to get user’s help. ) ,b’, ‘S, : begin begin cOm_Wr (cOM_Wr_MOVINGSTAGE , COLOEHL) ; debug := 1 - debug; if readkey . SKTSNDSD then writeln( ,Debug . ,, debug) ; readke y; end; end *C, . ,C, : else Ggin ( DO a loop rather than using delay f,unction, to allow user to stop writeln( ,Memavail = a, memavail, , maxavail . +, maxavail) ; early if we”ve got an unnaturally long wait. ) writeln( ,sizeof (se) = ,, sizeof (se) ): write ln(-sizeoflsc. ls[] . .. s~zeof(sc. ls[l l)); wrxteln( 0 then va r with wv. ls[wv. curl” do i : integer; begin begin :..t writeln( ,vmin ,, vmin) ; tekwrxte_ver (s) ; ,, write ln(, vmax 8, vmax); mxead[tek, sizeof(s) - 1): “: end; tekset. s[tekset. numl := ,0; #g, , ,~,: for i := 1 to ibcnt - 1 do ( disregard LF char, ) with sc. ls[sc. cur] .gr do tekset. s [tekset. num] := tekset. s[tekset. num] + ibbuf [i) : begin inc (tekset. num) ; writeln( fcursorp ‘, cursorp) ; ( Check to ensure do not overrun maximum: ) writeln( ,cursoru 8, cursoru) ; if tekset .num > TEKSETJ4AX— then writeln( ,cursorvisible -, cursorvlsible) : begin writeln( ,cursorx ,, cursorx) : com_wr (oExceeded TEKSET_f4PX, ,, COLORHLI ; writeln( ,cursoryl 0, cursoryl ), dec [tekset. nun!); .’! ,( writeln( ,cursory2 8, cursory2 ): end; . I-A ,, ,, writeln( ,maxxnums ‘, maxxnumsl ; end: { writeln( ,ma%ynums 8, maxynums) ; write ln(, ullim ‘, ulllm); begin 1 writeln( ,ulnorm ‘, ulnorm) ; mwrite(tek, ,head on, , true) ; ( Turn on verbose mode so we get entire writeln( ,ulnum ‘, ulnum) ; commands sent upon querying. ) writeln( ,u21im o, u211m) ; tekset. num := 1; writeln( ,u2n0rm 0, u2n0rm) ; set-rec( ,acq: state?, ): writeln( ,u2num ,, u2num) ; tekwrlte_ver (8acq: state O, ); ( Turn off so commands execute faster, ) writeln( ,ustep 8, ustep) ; set-ret ($select: control?, ): ( Read current channel being writeln( ,vllim o, vllxm) ; controlled. ) writeln( ,vlnum 0, vlnum) : set-rec( ,hor: delay: time: runsafter?, ); write ln(, v21im ‘, v211m); set-rec( ‘hor:delay: scale?- ); wrlteln( ,v2num ,, v2num) ; set_rec( ,hor:rnain: scale?, ); wrlteln(fvstep ‘, vstep): set_rec (,hor: mode?, ); waitkey; set-rec( Chor: trig: pos?f ); wrlteln( ,xaxxsdt ‘, xaxlsdt) ; set_rec (-hor: record length?, ); writeln( ,xaxlsmode ,, xaxlsmode) ; s := ,ch, + chr(ord(r O,) + ch); wrlteln( ,xdecmals ,, xdecxmals) ; set_rec (s + ‘:offset? smode) set-ret ( zoom state, ,), write ln(, ydecimals , ydecimals), tekwrlte_ver [,head off z); ( Promptly shut off verbose mode ) b.) write ln(, yfullmode yfullmode) end. wrlteln l,ylabelstrlng ylabelstrlngl C?J procedure tekset_wr; i : integer; ( Writes recorded settings back to tek scope. ) begin var ( Free memory for virtual oscilloscope bitmap buffer. ) i : integer; FreeMem(osc. bit, images ize(sc. txfy[l].x, O, sc.lxly[2] .x, 011; bemin-. ( Pree memory for color list. ) { stop acquisition if in pro9ress4 ) FreeMem(com. tx. col, 2 ● corn.tx. nuin.y) ; mwrite(tek, ,acq: state 0’ , true) ; ( Pree memory for buffer. ) ( Write warning to Tek screen: ) FreeMem(com. tx. buf, corn.tx. num. x ● corn.tx. num. y) ; ( tekwrite( ‘message: box 74,209,474,259’ ); for i := WAXWAVES downto 1 do tekwrite (‘message: show “Restoring settings. Please wait. “‘ ); Dispose (wv.ls [i] ); ( Free wave memory. ) tekwrite (‘message: state on’ ); ) for i := SC_WAX dovmto 1 do ( Restore settings in reverse order: ) ( Deallocate Previously reserved memory, in reverse order. ) for i :. tekset. nun! downto 1 do with sc.ls[il .gr do tekwrite (tekset .s [i] ); begin ( Erase message box: ) FreeMem(xh. bitme.D.Y[31 , imagesize (se.bdy[ll .x, O, sc. ( tekwrite( ‘message: state of f‘ ); ) bdy[z] .x, 0));- - FreeMem(%b. bitrtap.y[2] , imagesize( sc. bdy[ll .x, O, SC. *[21.X, 0)); function TEK_TIMEPERFT_to_code (timepergt : real) : inte9er; FreeMem(xb. bitmap. y[ll , imagesize (se.bdy[l] .x, O, sc. { Find closest code to timeperpt. ) bdy[zl .x, o)); Var FreeMem(xh. bitmap .x[31 , images ize(O, sc.lxly[ll. y, O, sc. i : integer; bdy[21. Y)); begin FreeMem(%h. bitmap .x[21 , image5ize(0, sc. bdy[l]. y, O, sc. for i := TEK_TIMEPERPT_MIN to TEK_TIMEPERFTJfAK - 1 do bdy[21. y)); if (TEK_TIMEPERPT[ i 1 -== timepez’pt ) and (timeperpt . TEK_TIMEPERPT[ i FreeMem(xh .bitmap. x[ll , inu.gesize(O, sc. bdy[l .y, o, Sc. + 1] ● 0.999) then bdY[21.. Y)); begin end; TEK_t imeperpt-to_code := i; FreeMem(bitmaP. imauesize (O, O, 0, CVRSORLENGTR) ) ( Dispose of cursor exit; bitmap memo-ti. ) end; if dev~d = 1 then TEK_t imeperpt_to_code := TEK_TIMEPERFT_MAX; begin – end; write [COM2, ACK) ; ( Send final ACK code. ) close (com2 ); ( Close translation stage charnel. ) procedure tekwrite (wbuf : buf string) ; end: ( Waits to see if tek is free, then calls rewrite. ) CloseGraph; ( free graphics memory (graph unit procedure) and return to text % begin mode. ) w repeat end; mwrite(tek, ,busy?’ , true) ; ~ mread(tek, 2) ; procedure Time (var nowtime : longint ): until ibbuf[ll = ‘O’; var rewrite (tek, wbuf, true) ; hour, minute, second, sec100 : word; end; begin GetTime (Hour, Minute, Second, SeCIOO ); procedure tekwrite_ver (wbuf : bufstring) ; newt ime := hour * 60” * 60 ● 100 + minute ● 60 ● 100 + second ● 100 + ( Waits to see if tek is free, then calls rewrite. ) sec100; begin end; repeat mwrite(tek, ‘busy?’, true) ; function TimebaseToCode (r : real) : integer; mread(tek, 8) ; ( Finds code corresponding to smallest timebase. ) turtil ibbuf [7] = ‘O’; var rewrite (tek, wbuf, true) ; i : integer; end; begin r:=r= (1 + SMALL) ; ( Make little bigger to ensure hit minimum. ) procedure TextWode; for i := MCS_TIMEPERPT_WIN to 14CS_TIMEPSRFT_MAK - 1 do ( Sxits graphics mode ) if (MCS_TIMEPSRPT [i ) .= r) and (r . MCS_TIMEPERPT [i + 11 ) then begin begin restorecrtmode; TimebaseToCode := i; TextColor(WHITE): exit: sc. mode := sc_mode_TX; end; end; TimebaseToCode := MCS_TIMEPERPTJtAX; end; procedure TidyVp; var procedure ToggleAddWavesMode (w : integer 1; ( If addwaves mode is off, turns on for wave w, , f already on, then xh.which := 3 - xh, which: ( Switch between 1 and turn off. ) 2. ) var EraseCursor [SC. cur) ; x : xnteger; Drawc”rsor (SC. cur) ; begin end; if w.num = O then end; exit; x f addwaves. mode = 1 then procedure ToggleSaveUode; begxn ( Toggle between saving data multiplied by yscale or not. ) UpdateAddWaves; ( Add for last time before cpntting. ) begin addwaves. mode := O; globalSaveMode := 1 - globalSaveMode; UpdateVitals; case globalSaveMode of Update (wv. ls[addwaves. wl” screen) ; ( Final screen update, ) o : com_wr (,Reg”lc.r save mode. ,, COLORJfESS ]; end 1 : com_wr (‘Normalized save mode. ,, COLORMESS) ; else end; begin end; if wv. ls [w]” .scan .mode > 0 then begxn procedure ToggleXAxisMode (scr : xnteger; mode : integer) ; cOm_wr (‘Cannot overwrite scan in progress !,, COLORHL) ; ( Toggle x axis among three display modes: XAXISMODE_POINTS, exit; XARISMODE_NORMAL and XAXISMODE_CONVERT. When switching fro” one to the end: other, u-space limits will need to be changed. ) if WV. ls[w]-. datasaved = O then var if co~wr~( ‘Wave not saved. Overwrite V) = O then P: integer; ( Point index. ) exit; PI : integer; ( Point index. ) if (se. ls[wv. ls[wl”. screenl .gr. xaxismode c> XAXISMOOE_POINTS) then p2 : integer; ( Point index. ) coawr (,Not in points mode: no promises 1V, COLORMESS) ; w : integer; ( Wave pointer. ) addwaves. mode := 1; begin addwaves .W := w; ( Find visible wave on screen ser. ) ( Find all screens with val,d waves to add. ) w := Findwave(scr) ; sc-sel-o ff: ( Now take a look at situation. ) for i := 1 to wv. num do with SC. ls[scr] .gr do with wv. ls[il’ do begin if (on = 1) and (par. dt = wv. ls[addwaves .wl”. par dt) if w = O then then xfullmode := 1 sc. ls[screenl .sel := 1; else ( Ensure all selected screens are in relative Y axis mode. ) begin for i := 1 to sc. num do ( Find points corresponding to screen limits. ) with sc. ls[il do if xaxismode = XAXISMODE_POINTS then if (sel = 1) and (gr .yaxismode = YAXISMODE_ABSOLUTE) then begin ToggleYAxisMode (i ); P1 := round (ullim) ; ( Update add waves screen since erased previous data. ) p2 := ro””d(”21m) ; UpdateVitals; if cursorvisible = 1 then Update (w. ls[addwaves. wl ‘ screen) : cursorp := round [cursoru) ; end; end end; else begxn procedure ToggleCrossha lrsMode; pl := UtoP(w, ullim, 1): ( Turn xh mode on or off. ) p2 := uto P(w, “21Mn# -l); begxn if cursorvisible = 1 then EraseCursor (se. cur) : cursorp := UtOP(w, cursoru, O) ; sc. ls[sc. curl. gr ,xh. mode := 1 - sc. ls[sc. curl .gr. xh. end; mode; ( Special handling for movement into energy u“xts. ) UpdateCursor (SC. cur ): If xaxlsdt . dt_ELE then DrawCursor (SC. cur) , begxn DrawCursorInfo, ( Switch limits. ) end; 1 f Xaxl smode = XAXISMODE-CONVERT then begin procedure TOggleCrOsstla lrsWlllch, P = Pl, ( Sw, tch which xh are manipulated by arrow keys ) pl = p2# begxn p2 = P? with sc lSISC curl gr do end, b.) if xh mode . 1 then if mode = WI SMODE_COtWERT then m begin ).x2gln w ( Switch order of limits. ) if sc. mode .> sc_mode_GR then p := pl; exit; pl := pz; ( SetTextJust i fy (LEFTI’2ST, TOPT2XT) ; pz := p; SetTextStYle (DEFAVLTFONT, HORIZOIR, 1 ); ) end; ( Clear s~reen. ) end; ClearArea( tx’. bdy[l] .x, tx-. bdy[l]. y, txA. bdY[2] .x, tx”. bdY[2]. Y); end; ( Fool Pascal into thinking s has length = tx. num. x. ) ( Change mode. ) P := ‘JS; xaxismode := mode; P-111 := chr(tx~. num. x); ( Change dt to current wave if on same screen. ) for v :. 1 to tx”. num. v do if w > 0 then begi~ begin ( Point to start of current line. )

if wv.ls[wl” .screen = sc. cur then P := OltxA. bufn[(y - 1) ● txn. num. x + 11): xaxisdt := wv.ls[w]-. par. dt; ( Copy line into 6. ) ( Assign minimum useful pOint. ) for x :. 1 to txn. nom. x do if PI c wv. ls[w]-. pmin then S[x] := p“[x]: pl := wv. ls[w]~. pmin; ( Print line to screen. ) if cursorp < W. 1s [w]A .pmin then SetColor(t%n .COIA [y] ); cursorp := W. 1s [w]” .pmin; OutTextXY( t%”. bdy[ll .x, tx-. bdy[l] .Y + (y - 1) ● textsize, s); cursoru := PtoU (w, cursorp, xaxismode ); { New cursor position. ) end; end; end; ( Prevent program from crashing (this iS sort of a cOP-Out! ) 1 if (xfullrnode = O) and ((P1 = O) or (P2 = 0) ) then procedure tx_scr_up (t% : tx_type_p) ; xfullmode := 1; ( Scroll text, screen up one line. ) ( Calculate new unit-space limits. ) var if xfullmode = O then i : integer; begin begin ullim :. PtoU(w, PI, xaxismode) ; ( Scroll up character buffer. ) u21im := PtoU(w, P2, xaxismode) ; for i := 1 to tx’. num. x ● (tx”. num. y - 1) do end; tx”. buf” [i] := tx’’.buffi[i + tx’’.nux];]; ( Calculate other vars and redraw. ) ( Blank last line. ) UpdateVitals; FillChar(t%6 .buf”[i + 1] , tx”. num. x, , ~); Update (scr) ; ( Scroll up color list. ) end; for i := 1 to tx”. num. y - 1 do end; tx~. col~[i] := tx~. col’[i + 1]; ( Make last line user input color. ) procedure ToggleYtiisMode (scr : integer); t%” .coI° [i + 1] :. COLORUSER; begin ( Redraw screen. ) sc.ls[scrl .gr. yaxismode := 1 - SC. 1s [scrl .gr. yaxismode; txJlr(tx) ; UpdateVitals; end; Update (scr) ; end; procedure tx_wr (tx : tx_type~; s : string; CO1 : word; scr : integer) ; ( Print string s to tx screen in color CO1. Cursor moves to left side of procedure ToggleYOf fsetRescale; following line unless scr . 0, in which case cursor is left at end of ( Toggle flag to rescale W. 1s [1”.par.yof fset when W. 1s[ 1” .par.yscale is string. (Screen still scrolls as needed to fit entire string on it, but chanaed. ) messages larger than size of screen are truncated) . If CO1 = COLOpXL begin - (highlight color) , a beep will also sound. ) yof fsetrescale := 1 - yoffsetrescale; var if yoffsetrescale = O then i : integer; ( Counter. ) com_Wr( ‘Y offset rescale mode OFF. ,. COLORMESS) nch : integer; ( Max. number of chars allowed. ) else nstart : integer; ( Char to start with on screen. ) co~wr( lY offset rescale mode ON. ‘, COLORNESS) ; nscr : integer; ( Number of liIIeS to scroll. ) end; P: “chararray; begin procedufe txdr (t% : tx_typeJJ); ( Calculate starting character; always starts on lef thand side. ) ( Draw text screen. Algorithm is to create a string for each line, then nstart := tx-. num. x ● ltx’. cur. y - 1) + 1; call graphics routine. For speed, we COPY characters directly into s, ( Calculate max. number of chars allowed in message. Note this is 1 which reguires some pointer tricks. ) line short of box size, unless scr = O -- must allow to scroll up var 1 line. Extra subtraction for scr = O is to force scroll if cursor P : ‘chararray; ( Pointer to chars in buffer. } will end up on next line. Truncate message if needed. ) s : bufstring; ( Holder for each line. ) nch := tx”. num. x 9 (txA. num. y - scr) - 1 + scr; x, y : integer: ( Char counters. ) if length(s) > nch then begin s := COPY(S, 1, rich-2) + ,. .,; ( Little flag to user ‘co indicate lxne was truncated. ) ( scroll screen to flt message, if needed. Second -1 1s to not scroll screen exti+4 llne lf we JUST fill last llne. ) nscr := better_dxv(nstart - 1 + length(s) - nch - 1, tx”. num. x) + 1: if nscr > 0 then ‘< begin 4.6. fpesuz pas ... for i :. 1 to nscr do tx_scr_up (tx) : decltx”. cur. y, nscrl ; unit PpesUZ; dec(nstart, nscr + tx’ .num. x) : ( History of modifications (please add to BOTTOM of list!):

,,4, end; \ ( Set pointer to beginnxng of current line. ) Version 1:Begun 2jun94 BJG. P := @(txA. buf-[nstarf. ]) ; ( COPY message to buffer. ) Procedures and functions beginning with Y through Z for the program FPES. for i := 1 to length(s) do See FPES (at appropriate version) for more specific program modification p~[il := s[i]: notes. ( Change color on affected lines. ) ) for i := O to bett.er_div (len9th(s) - 1. tx”. num. xl dO .’:. tx”. col”[tx”. cur. y + i] := col; interface ( Text screen handling: Only redraw graphics if message is -inportant- -- that is, using COLORHL to draw. Otherwise, don’ t redraw (but uses message still appears in buffer) ) FpesVar; i f (sc. mode .> sc_mode_GR ) and (CO1 = COLORHL ) then begin function UnitPrefix (logpower : integer) : bufstring; sc, mode := sc_mode_TX; ( Allow screen to be redrawn. ) procedure Update lscr : integer) : ‘. ‘4 . . . OrawAll: procedure UpdateAll: , procedure UpdateAddWaves; 1 end; tx_dr (tx) ; procedure UpdateBg: ( Highlight feature. ) procedure UpdateCORLimi ts(par_ptr : par_typeRtr) : if CO1 = COLOPXL then procedure UpdateCursor(scr : integer) : write (BELL) ; procedure UpdateDtConpatibl lity; ( Update cursor location. ) procedure UpdateFilenames [newdir : bufstring); case scr of procedure UpdateMC: o: procedure UpdatePMin; begin procedure UpdateSel; tx”. cur. x := length(s) mod tx’. n~. x + 1; procedure UpdateVitals; inc(tx-. cur. y, length(s) div tx”. num. x); procedure Updatevs.imits; end; procedure UpdateXAxis(scr : integer); 1: procedure UpdateYAxis(scr : integer) ; begin function UtoP(w : integer; u : real; direction : ~nteger) : integer; tx”, cur. x := 1; function Utox(u : real; scr : integer) : real; inc(tx”. cur. y, better -divl length(s) - 1, tx”. num. x) + 1): procedure val_i(s : bufstring: var i : integer) : end; procedure val_r(s : bufstring; vas r : real); end; function VtOY(v : real; scr : integer) : real: ( Make current lxne default user color, ) procedure waitkey; tx”. col”[t%’. cur. yl := COL’2RUSER; functxon WaveInfo(w : xnteger; 1 . integer) : bufstr>ng; end; function Waves Exist : integer; function weight(x , a : real) : real; procedure tx_wr-ch( tx : tx-type_p; c : char); procedure writeengnotation(r : real); ( Replaces character c at current cursor locatxon in text buffer, updateAll procedure write ln_ctr(s : string; POS : integer) ; screen. ) procedure writevalue (r, p : real, dec, mc.x : integer; u : strxng); begxn procedue wrltevalueuni tless (r, P real; dec, max : integer) , ( Erase old character by wrxting in background color: ) procedure ws_df; SetColor (GetBkColor) , procedure ws_inxt, OutTextXY(tx” bdy[ll x + (tx’. cUr x - 1) “ texts lze, tx” bdy[l) Y + procedure ws_rd(s : bufstring) , Itx- cur. y - 1) “ texts lze, tx’ buf”[tx” cur x + (txA cur Y - 11 ‘ procedure WSJ?V(S : bufstring) ; tx~ num. xl), procedure wv-sel (code : integer) , ( Replace character and print to screen in current Ilne color. ) procedure wv-sel_off; txA buf ’[tx’ cur x + (c%” cur Y - 11 ‘ tx” num X] = c, procedure XFull(scr : Integer) Setcolor(tx - Col - [tx A cur y] ), function XToTheY (x, y : real) real, o“tTextxYltxA bdy[ll x + (t%’ cur x - 1) “ textslze. tx” bdy[ll Y + function XtOU(x longxnt, scr integer) real, (JJ procedure YFull(scr xnteger) ItxA cur Y - 1) . texts lze, c). 4 end, function YtOV(y longlnt, scr integer) real, procedure YScaleChange(r : real); YFu1l (scr) ; w procedure YScaleChangeSign; ( Calculate screen coordinates (x and y) from u and v information: ) 4 procedure Zoom; Updatex?i%is (scr) ; N UpdateYAxis (scr) ; implementation ( Update location of cursor, given wv. cur and cursoru information: ) Updatecursor(scr] ; uses end; crt, dos, FpesCOm, PpesAI, FpesJR, FpesST, graph, Keys, TPDecl; ( Draw new screen: ) DrawAll ; function UnitPrefix (logpower : integer) : bufstring; end; ( Returns unit prefix symbol corresponding to exponent logpower. If logpower is outside range of 2iINPOWER .. w2ixPOWER, or it’s not a factor of 3, procedure UpdateAddWaves; returns string ~lOA” + logpower. ) ( Adds together all visible waves of same dt as addwaves. w, begin weighted by their par. yscale and par. yoffset values, and places in case 100power of wave addwaves. w. ) -18: UnitPrefix :- “a’; var -15: UnitPrefix := “f’; j : integer; -12: UnitPrefix := “p’; w : integer; -9: UnitPrefix := “n’; begin -6: UnitPrefix := “u’ ; if addwaves. mode = O then -3: UnitPrefix := “m’; exit; O: UnitPrefix :- “’; Fillchar(wv.ls [addwaves. w] ’.data, sizeof(wv. ls[addwaves .w]”. data), 3: UnitPrefix := ‘k’; o); 6: UnitPrefix := “M’; FillChar(wv .ls[addwaves .wl A.t!rp, sizeof(wv.ls [addwaves. wl”. tmp), O); 9: UnitPrefix := ‘G’; wv. ls[addwaves .w]”. datasaved := O; 12: UnitPrefix := ‘T’; for w := 1 to wv. num do else if (w <> addwaves. w) and (wv.ls[w]-. on = 1) and (wv.ls[w]’’.par. UnitPrefix := PowerOfTenPrefix (looPower) + ‘ ‘; ( ~tra sPace fOr clari- dt = wv.ls[addwaves .w]’’.padt)t) then ty (e.g. ‘10A-33 J-). ) for j := 1 to wv.ls[w]a. par. pt do end; wv.ls[addwaves .wl”. data[jl := wv.ls[addwaves .w]~. data[j] + end; wv. ls[w]’. par. yscale ● w.lsIw]” .data[j] + wv.ls[w] ”.par. yoffset; end; procedure Update (scr : integer); ( Update only screen ser. Must call UpdateVitals beforehand! ) procedure UpdateBg; var ( If _bs. bg > 0, go thru waves to ensure that there are bs waves in s : bufstring; memory, and that _bs. bg points to one. Otherwise, sets _bs. bg to w : integer; ( Wave counter. ) o. ) begin var ( Calculate new u and v limits if in full view mode for that axis: ) i : integer; xFull(scr); begin YFu1l (scr); if (_bs. bg > wv. num) or (_bs. bg . O) then [ Calculate screen coordinates (x and Y) from u and v information: ) _bs. bg := O; Updatetiis (scr) ; if _bs. bg = O then UpdateY*is (scr) ; exit; ( Update location of cursor, given wv. cur and cursoru information: ) ( Check that bg points to a bs ELE wave; otherwise, reset and turn UpdateCursor (scr); off bs mode for all waves. ) ( Draw new screen: ) with wv.ls[_bs. bg]” do DrawScreen (scr) ; if [par. dt e. E7T-ELE) or (par. ele. bs. mode = O) then end; begin -bs. % := O; procedure UpdateAll: for i :. 1 to wv. num do ( Calculates everything needed for proper screen display. should be called with wv.ls[i]” do after every conmmnd which changes some aspect of the screen display or wave if par. dt = dtJLE then data, though if you are clever You can call only a subset of update rou- par. ele. bs. mode := O; tines. ) DrawWaveData; var exit; scr : integer; ( screen counter. ) end; begin ( Go thru waves until we find a bs ELE wave. ) UpdateVitals; for i :. 1 to wv. num do for scr := 1 to sc. num do with wv.ls[i]” do begin if (par. dt = dt_SLE) and (par. ele. bs. mode > O) then ( Calculate new u and v limits if in full view mode for that axis: ) exit; XFull(scr) ; ( No bs waves loaded; turn off bg flag. ) _bsbg = O: end; end, ( Calculate remainxng cursor variables: ) cursoru := u; procedure UpdateCORLimi ts(par_Ptr : par-type-tr); cursorx := round (utoxlcursoru, scr) ); ( Update min 6 max limits of COR wave based on tO and time per point. ) curs0ry2 := round (PtoY[hw. cur, cursorp) I; begin ( Constrain cursor y position to stay on screen: ) with parstr” do if cursory2 c yaxis. yl then w~th cor. ts do cursory2 := yaxis, yl + CURSORLSNGTH begin else if cursory2 , yaxis. y2 - 1 then start := tO - step , (pt_gl - 1) t 2; curs0ry2 := y4xis. y2 - 1: stop := tO + step ● (pt_gl - 1) / 2; cursoryl := cursorY2 - CURSORLIDJG’TH; ( Make cursor extend upward from limit (start, STAGEMIN, STAGSNAX) ; point. ) limit (stop, STAGENIN, STAGSNAX): if cursoryl < yaxis. yl then ( Recalculate pt_gl m case Ilmlts were changed. ) begin pt_gl := round ((stop - start) / step) + 1: cursoryl := curs0ry2: end; curs0ry2 := cursoryl + CURSORLENGTW; ( If tip is above top of plot area, end; just make it point downward. ) end; procedure UpdateCursor(scr : integer): cursorvisible := 1; ( Updates cursor on screen ser. TWO functions: Upda teMC; 1, If xh. mode = O: Provided cursor is on a visible wave, uses end; w. cur and cursoru to calculate corresponding cursorp, cursorx, cursoryl, end cursory2, making sure cursor is on screen and on a legitimate point. If else with xh do cursor cannot be displayed (wave is con@etelY off-screen) . sets cursor- begin vlsible to 0. ( Calculate Position of center xh: ) 2, If xh. mode = 1: Calculate u’s and v’s corresponding to x and Y x(3] := (%[1] + x(2]) div 2; positions of xh. Note x’s and Y’S never change when changxng axxi y[3] := (y[l] + Y[2]) div 2; scales or modes. or switchxnu in and out of xh mode. ) [ Calculate u- and v-snace values of xh: ) var for i :=lto3 do- L : xnteger; ( Generic counter. ) begin u real; ( Temporary u value. ) u[i] := XtOU(x[ i], scr); - begin v[i] := YtOV(y [i], scr); ( If wv, num = O then end; exit; ) end; with sc, ls[scrl. gr do end; if xh. mode . 0 then m begin procedure Update DtConWat ibi 1ity: Lf wv, num = O then ( This mouthful of a procedure sim@ly turns off waves whose datat~es begxn don, t match their screen es datatype (if in NOR or CONV mode) . ) cursorvisible := O; var exit; i : integer; end: begin with wv.ls[wv. curl” do for i := 1 to wv. num do begin with wv, ls [i]- do ( Make sure we scr) then if (xaxismode .> XAXISMODE-POINTS) and (par dt .> xaxisdt) then begxn on :. O; cursorvlslble := 0: end; exit, end; procedure UpdatePilenmnes (newdir : bufstring) ; ( Make sure cursoru IS on visible part of x axis: ) ( Changes recorded file”ame when dxr changes. Should not be called as if cursoru . ullxm then part of standard Update -- slows system! ) cursoru := ulllm var else If cursoru > u211m then x, w : integer; cursoru := u21xm, begin ( Seek closest point of wave which corresponds In u value to cursoru, and for w .. 1 to wv, num do see If this IS vlslble on the screen, otherwise, turn cursor off ) with wv lSIW]A do cursorp = utOPlwv cur, cursoru, O), beg Ln u = Ptou(wv cur, cursorp, xaxismode) , if not Full Path(par fn) then if (u . ulllm) or (u > u211ml then par fn = dir + par. fn, begin 1 = FllenameStart (par. fn) ; cursorvxsble = 0, if copy (par fn, 1, I - 1) = newd~r then exit, par fn = copy(par fn, 1, length (par fn)) , end; else w dir :. newdir; r:=r-num *m; Remove mass from r. ) -4 end; end; -P end; procedure UpdateMC; ( According to cursor position, calculate all eligible nmss combina- begin tions according to mc parameters. } mc. s := ,,; var if wv. num = O then abort : boolean; ( Flag to kill current combination if multiplicity exit; limits are exceeded. ) if wv.ls[w, cur]” .par. dt <> dt_MAS then i : integer; exit; mass : real; ( Find current cursor mass. ) r : real; mass :. PtOU(wv. cur, sc. ls[wv. 1s [wv.cur]”. screen] .gr. cursorp, xax ismode_CONVSRT ); procedure mc_wr; ( Begin iterative search for valid element combinations. ) ( Write element combination to screen and its mass. ) make_comb (1 ); Var if abs (r) <= mc. sens then i : integer; mc.wr; mass : real; i := mc. num - 1; S2, S3 : bufstring; ( Now loop through other possibilities. ) begin while i > 0 do i f abort then with mc.ls[i] do exit; if num > min then if mc. s e- ,, then begin mc. s := mc. s + ‘, ,; ( Add new element. ) dec(num) ; 62 := “; make_comb(i + 1) : qss := o; if abs(r) c= mc. sens then for i := 1 to mc. numdo mc_wr; with mc.ls[i] do i := mc. nn - 1; if num > 0 then end begin else if num > 1 then dec[i); str(num, s3) end; else S3 :- ,$; procedure UpdatePMin; S2 :=s2+s+s3; ( Calculate minimom meaningful point which should be displayed in each wave.

mass :. mass + m ● num; Value is different depending on xaxismode and dt: end: mc. s := mc. s + makestringint (round (mass) ) + , , + 62; XAXISMODLPOINTS, XAXISMODEJfOSJIAL: All points good; pmin := 1. end; XAXISMODE-CONVERT: dt_COR, dt_POW: All points good; pmin :. 1. procedure make_comb (i : integer); dt-ELE: pmin corresponds to first point with energy c par. ( Makes combination of elements of starting with element i. Refraining user [PAR_E_LASERSV] , the largest physically allowed energy. mass is r. ) dt_IONS: pmin corresponds to first point with mass > 0. Var ) j: integer; var begin laserev : real; abart := false; w: integer; r := mass; xaxismode : integer; ( Subtract mass of assigned parts of molecule: ) begin forj:=ltoi-ldo for w :. 1 to wv. num do r := r - mc. ls[j]. m g mc. ls[j]. num; with WV. k [W]A do ( Find max. number of each element remaining: ) begin for j := i to mc. num do pmin :. 1; if (abort = false) and (r > -me. sens) then if (SC. 1s [screen] .gr. xaxismode = SAX12MODE_CONVERTl and (par. dt with mc.ls[jl do = dt_ELE) then begin begin – num :. trunc ((r + mc. sens) / m): ( Find highest valid xaxismode := SC. 1s [screen] .ur. xaxismode: multiple. ) laserev := par. ele. cal. ev; if nun > max then ( Force tobe <= max. ) while (pmin .= par. pt) md (PtoU(w, pmin, xaxismode) > num :. max; laserev) do if num . min then inc [pmin) ; abert := true if pmin > par. pt then ( Shut off wave if no points are valid. ) on :. O; beqln end; with sc. ls[scr]. gr do end, beg in end; [ Error prevention: ) if ullim = u21im then ..’ procedure UpdateSel: if ullim = O then ( Update only those screens selected in sc. 1s [1.sel. ) u21im := 1 Var else i : Integer; u21im := ullim + Sf4ALL . abs(ullim) : begxn ( Calculate axis numbers. ) .-. UpdateVitals; ustep := exp(LW_10 ● rounddown(ln(u21im - ullim) / LW_10 - 2) ): for x := 1 to sc. num do ( Begin guess with a power of 10. at least 2 orders of magnxtude too small. ) if sc. ls[il. sel = 1 then ulnum := ustep ● roundup (ullm I ustep - SMALL) : ( Leftmost number is smal- Update(i) ; lest which is larger than ullun, and a multiple of ustep, ) sc_sel_Of f; u2num := ustep . rounddown(u21im 1 ustep + SMALL) ; ( Rightmost number is end; largest which is smaller than u21im, and a multiple of ustep. ) while (u2num - ulnum) 1 ustep + 1 > maxxnums do ( if number of numbers ,.’. nrocedure Uvdaf.eVi tals: exceeds maximum allowed. ) ,’ ~ Updates p~rameters for all waves which only have to be evaluated once begin per update. Designed to save time when calling Update for several ChangeStep(ustep, 1) ; ( Increase step size. ) screens. ) ulnum :. ustep ● roundup (ullxm I ustep - SMALL) ; begin u2num :. usteD k rounddown(u21im / ustep + SMALL) : updateAddWaves; end; UpdateBg; ( Find largest multiple -of-3 power to units. ) UpdateDt.Compatibility: if abs(ullim) > abs(u21im) then UpdateFilenames (dir) ; xpower := Power (abs (ullim) ) ., I Update PMin; else UpdateVLimi ts; xpower := Power (abs (u21im) ): DrawVitals: ( Calculate number of decimals needed to display numbers (in current units) ) g end; xdecimals := -rounddown (in (ustepl / LN_10 - Logl O(xpower) ); if xdecimals < 0 then p procedure UpdateVLlmx ts; xdecirmls := O; ( Correct for negative t of decimal places! ) ( Fmd largest and smallest V values in each wave. ) ( Update x axis label and units. ) : w var case xaxismode o f w. p : Integer; ( Point xndex. ) XAXISMODE_POIWTS : M v : real: ( Temporary y value. ) begin w : integer: xlabelstring :. VPoints, ; xaxismode, yaxxsmode : integer; xunits :. PowerOf TenPref ix(round(Log10 (xpower) )); begin if %power .> 1 then for w :. 1 to wv. num do xlabelstring := xlabelstring + 8/ e; with w.ls Iw]” do end; begxn XAXISMODS_WORMAL: xaxismode := SC. ls[screenl .gr xaxlsmode: begin yaxismode := sc. 1s [screen] gr. yaxismode; xunits :. Unit Prefix (round (logl Olxpower) )) + XUW1’r3YPE [xaxisdt, vmin := PtoV (w, pmin, xaxlsmode, yaxismode) ; xaxismode ]; vmax := vmmn; case xaxisdt of for p := pmin + 1 to par. pt do dt_COR: xlabelstring :. ‘Distance/ $; begin else xlabelstring .. ,Tlme/4 ; v := Ptov (w, p, xaxlsmode, yaxismodel ; end; if v . vnmn then end; vmin := v; ~ISMODE_CONVERT: if v > vmax then begin vmax := v; xunits := Unit Prefix {ro”nd( logl O(mower) ) ) + XVWITI’YPS [xaxisdt. end; xaxismode ]; end, case xaxxsdt of end, dt_COR, dt_POW: xlabelstri”g ,= ,TIme/ ,, dt_ELE, xlabelstrmg :. ,Energyl o; procedure UpdateXAxis [scr Integer ), dt_WAS: xlabelstring :. ‘Mass /,, ( Calculates needed quant itLes when x lmuts change for screen scr All end; that needs tobe set before calling this routine IS ulllm, u211m, end, xaxlsmode. xaxlsdt ) end, var end, s bufstrlng, ( Generic string ) end, ing for closest point, as when moving between waves, or selecting a peak , procedure UpdateYA%is (scr : integer) ; for normalization. ) s ( Calculates needed quantities when Y limits change for screen scr. All va r 6 that needs to be set before calling this routine is vllim, v21im, P: integer; ( Point index. ) yaxismode. ) pl : integer: ( ~oint with smallest allowed unit value. Var ) s : bufstring; P2 : integer; ( Point with largest allowed unit value. ) begin UP : real; with SC. 1s [scrl .gr do begin begin with w.lsIw]” do ( Error prevention: ) begin if vllim = v21im then { Establish limits to search. ) if vllim = O then if (SC. 1s [w, 1s [w]”. screen] .gr.xaxismode . XAXISMODE-CONVERT) and v21im :. 1 (par. dt . dt_ELE) then else begin

v21im := vllim + SMALL ● abs (vllim) ; pl := par. pt; ( Calculate Y axis numbers. ) p2 := pmin;

vstep := exp(LN-10 ● rounddown(ln(v21im - vllim) / ~_10 - 2) ); end ( Begin guess with a power of 10, at least 2 orders of rragnitude too small. ) else

vlnurn := vstep ● roundup (vllim / vstep - SMALL) ; begin ( Leftmost number is smallest which is larger than vllim, and a multiple of pl := pmin; vstep. ) p2 := par. pt;

v2num := vstep ● ,rounddown(v21im / vstep + SMALL) ; end; ( Rightmost number is largest which is smaller than v21im, and a multiple of ( See if outside limits, returning nearest enduoint or O if so, according vstep. ) to value of direction as outlined above. ) while (v2num” - vlnund / vstep + 1 > n!axynums do ( if number of numbers if u < PtOU(w, pl, sc.ls[wv.ls[w]”. screen] .gr. xaxismode ) then exceeds maximum allowed. ) begin begin if direction = -1 then Changestep(vstep, 1); ( Increase step size. ) utOP := o vlnum :. vsteu ● rounduD (vllim / vstep - SMALL) ; else

v2num :. vstep ● rounddown (v21im / vstep + SMALL) ; utOP := pl ; end; exit; end ( Find largest multiple-o f-3 power to units. ) else if u > PtOU(w, p2, sc.ls[wv.ls[w]” .screen] .gr. xaxismode) then if abs(vllim) > abs(v21im) then begin ypower := Power (abs (vllim) ) if direction . 1 then else utOP := o ypower := Power labs (v21im) ); else I Utoe := p2; ( ~e~g~ number of decimals needed to display numbers. ) exit: :. -rounddown (ln(vsteP) / LN_10 - LorJIO(YIYOWer)1; end; if ydecimals < 0 then ( Find closest point according to direction criterion, using halving w ydecimals := O; ( Correct for negative # of decimal places! ) algorithm to close in on point iteratively. ) while abs(ul - D2) > 1 do ( Update Y axis label and units. ) begin “- - if yaxismode = YAXISMODEJBSOLUTE then P := (P1 + P2) div 2; ylabelstring := ‘Int. ‘ UP := PtoU(w, P. sc. ls[wv. lsIwI” .screenl .gr. xaxismode); else if u c up then ylabelstring := ‘Rel. Int. ‘; p2 := p if ypower <> 1 then else if u > up then ylabelstring := ylabelstring + ‘/‘; pl := p yunits := PowerOfTenPref ix (round (Lo910 (YROwer) )); else ( Equal; can qmit. ) end; begin end; utOP := p; exit; function utop (W : integer; u : real; direction : integer) : inte9er; end; ( Converts unit space x coordinate u to closest point in wave w, according to end; the criterion variable direct ion, which indicates which way to round: case direction of -1: Pick point with next lowest u value. If entire wave > u, return O. -1 : 0: Pick point with closest u value. if u = PtOU(w, p2, sc.ls[wv.ls[w]” .screen] .gr. xaxismode ) then 1: Pick point with next highest u value. If entire wave < u, return O. utOP := p2 Usually. 1 is chosen when searching for the leftmost point which fits on else the screen; -1 is chosen for the rightmost point. O is chosen when search- utOP := pl ; 0 wrxteln(, ,); lf u - Ptou(w, pl, Sc. ls[wv. lslwl’ screen ] gr. xaxismode ) . writeln( ‘Hit to contxnue. zI, Ptou(w, p2, Sc lSIWV, lSIW]” screen] gr .xaxismode) - u then readln; Utoe := pl end; else utOP := p2 : function Wave Info (w : integer; 1 : xnteger) : bufstring; 1: ( Prepare wave information in a string to be used by DrawWaveInfo. 1 is if u = PtoU[w, PI, SC. lSIWV. lsIw]- screen] .gr. xaxismode) then the length of the string to be returned (is padded with spaces) . See Utoe := pl help for format of output string. ) else var Utoe ,= p2 ; i : integer; ( General integer. ) end: out : bufstring; ( Growing output string. ) end; s, 52 : bufstring; ( General strng. ) end; begin with w.ls[w]~ do funcf.xon UtOX(u : real: scr : integer) : real: begin ( Converts unit space x coordinate u to screen x coordinate. Note that value ( Current wave. ) may fall outside of screen boundaries [which is why real value was used) ) if w = wv. cw then begin out :. ,*, with SC. ls[scr] .gr do else utox := xaxis. xl + (u - ullim) ‘ (xaxis .x2 - 1 - xaxis. xl) / out := , J; (u21im - ullim) ; ( -1 is ( Wave number. ) to ensure that points on righthand edge fall INSIDE screen limit. ) Str (w, s) ; end; out := out + s: ( Invisible flag. ) procedure val-i (s : buf string; var i : integer) ; if wv. ls[w]-. on = 1 then ( Integer version of clunky val () procedure which needs a dummy variable I out := out + , , never check (though is used here to set i to O for screw-ups) ) else var out := out + ,i, ; error : integer; ( Error variable for val () ) ( Saved flag, ) begin if (WV, ls[w]-. parsaved = 1) and (WV. lsIw] ‘,datasaved = 1) the” val (s, i, error); begin if error .> 0 then if WV, lSIW]A. savemode = O then i :. O; out :. out + ,s, end; else out := out + ,n, ; ,J procedure val_r(s : bufstring: var r : real) ; end ( Real version clunky val I) procedure which needs a dunmw varxable I never else , check (though is used here to set r to O for screw-ups) ) out := out+, ,;

,’. var ( Screen number. ) .4 error : integer; ( Error variable for val () ) str (screen, s) ; begin out := out + s: val (s, r, error): [ Mode. ) If error .> 0 then if [addwaves mode = 1) and (addwaves. w = w) then r := O; OUt := O“t + ,AO end, else if scan ,mode > 0 then out := out + ,s, functxon VtOY(v : real; scr : integer) : real; else if men. w . w then ( Converts unit space Y coordinate v to screen Y coordinate. Note that value out := out + ,M, may fall outsxde of screen boundaries (which 1s why real value was used) ) else begin out := Out+ , ,; with sc, ls[scrl. gr do ( Background s“btract~on flags: ) vtOY := Yaxis. Y2 - 1 - (v - vlllm) ‘ (yaxis. y2 - 1 - yaxls yl) / If (par. dt . dt-ELE) and (par, ele, b.s,mode = 11 then (v21xm-- vll;m), ( -1 begin IS to ensure that Point S on bottom edge fall INSIDE screen llmlt Note if _bs, bg = w then overall minus sign to expression, compared with Utox This 1s because we out .= Out + ,B, want (0, O) in unit space to correspond to bottom left corner. not toP else left ) Out := out + ‘b, , end, end else procedure waltkey, out := Out+ , ,, ( Prints text message and waits for keypress ) ( SelectlOn flag ) beykn lf w ls[w]~ sel = 1 then out :. out + ‘/’ u else procedure writeln_ctr(s : string; POS : integer) ; 4 out :. Out+ , $; ( Writes string centered on line at position POS. ) m ( Need to fit two more items: label determined by W. 1s [1” par. sh, and begin yscale (if in relative Y axis mode) . First determine amount of dec (POS, length(s) div 2) ; room left with yscale included, then add label, then yscale. ) if POS > 0 then if SC. 1s[w.Is[w]”. screen] .gr.yaxismode = YAXISMODE_RELATIVE then write (copy (BLANWLINE, 1, POS) ); begin writeln(s) ; str(wv.ls[wl ”.ma.r.yscale: 0:2, 621; end; S2 i. ‘ ‘“+”s2; “ end procedure writevalue (r, p : real; dec, nut% : integer; u : string) ; else ( Writes value of dec decimals and maximum length ma% with proper S1 S2 := ,,; prefix and unit string u. p is power of r; if p = O, calculates p auto- maxwavenamelength := 1 - length (out) - length (s2) ; matically. ) ( Label determined by W. 1s [I“par. sh. ) var case par. sh of s: bufstring; ( Tenqmrary string. ) Wv.shxl.l : ( comment. ) begin s := par. conrnent; if p = O then w-sh-DLY : ( Time delay (electron wave only) . ) P := Power(r) ; begin str(r / p : 0 : dec, s); ser(round(par .ele. dly / POWFS) , s) ; if length(s) > w then S:=s+, fs$; s := Copy(s, 1, ma%); end; write (s, , ,, unitPrefix (round (log10 (p) )), u) ; w_sh_FN : ( Filename. First figure out if path is same as current end; directory; if so, print only filename; otherwise, print full path, Then truncate filename to fit on screen, if necessary, in which procedure writevalueunitless (r, p : real; dec, ma% : integer) ; case last two chars will be ‘..‘ to indicate truncation. ) ( Writes value of dec decimals and maximum length u with power-of-ten { begin attached. p is power of r. p . 0 is flag to calculate power automati- i := FilenameStart [Dar. filename) : cally. ) if copy lpar. filenami, 1, i - 1) = dir then Var s :. copy (par. filename, i, length (par. filename) ) . : bufstring; ( Temporary string. ) else ) begin s := par. fn; if p = O then { end; ) P :.=Power(r) ; end; str(r / p : 0 : dec, s); if length(s) > maxwavenamelength then if length(s) > max then Out :. out + COPY (S, 1, maxwavenamelength - 2) + ‘. .‘ s := CODY(S. 1, I&ax): else if p <> l-~hen out :. out + s + COPY (BLANWLINE, 1, maxwaven~elength - length(s) 1; write (s, ‘ (x’, Powe?OfTenPrefix (round (log10 (P) )), ‘) ‘) ( Pad out to maximum length. ) else WaveInfo := out + s2; ( Add in yscale and exit. ) write(s) ; end; end; end; procedure ws-df; fonction WavesBxist : integer; ( Sets up default values in case where workspace read fails. ) ( Return 1 if wv. num > O; O otherwise. ) var begin i, j : integer; if wv. num > 0 then begin WavesBxist := 1 ( Global vars. ) else for i := 1 to AO_hwci do WavesExist := O; ad. ls[i]. gain := 1; end; ad. on :- 1; allsaved := 1; function weight (x , a : real) : real; auto. adv := O; ( Calculate weighting function for smoothing routines. ) auto. bg := 1; begin auto. cor := 1;

weight := exp (-a ● x ● x); auto. fn := 1; end ; auto. gen := O; auto. num :. 1; nrocedure writeengnotation (r : real ); auto. off := O; hgin auto. rm := o; write (r : PAR2NGDIGITS ); auto. Ser := AUlW_S2R_DP; end; auto. sv := o; blankmin := 1; yscale := 1; blankmax := 100: end; _bs, bg := O; with pardf [dt_COR] do -bs. dis := O; begin _bs. sts := O; Pt-gl := 50; _bs. sts_blank := 101; pt := pt_gl; _bs sts_blank2 := 450; scan_gl := 1; -bs, sts-ch := 1; timeperpt := POh”l’SI HALFSPEEW2FL1GHT; -bs. sts_fac := 1: with cor do -bs, sts_vert := 0.02; begin -bs sts_tog := 1; ch := 1; dxr := CD_DF; shotsperpt :. 10: dlscrim := 0.04; ts. start := 29975 .5e-6: dotradius := 1; ts. step := TS_STEP-DF; globalsavemode := O; ts. stop := 30024 .5e-6; mc. fn := ,,; ts, tO := 30000e-6; mc, num := O; ts. web. ampl := O; mc. sens := 1; ts. web. per := O: men. bins := 8: ts. web. ph := O: men. w :. O; end; move. numavg := 10; end: move. start := O; with pardf [dt_ELEl do move. step := POW1’S; begin move. stop := O; IX := MAXPOINTS; move, wait := 0.2; ‘t pt_gl := O: ( DOesn, t matter. ) . osc. ch := 1; scan_gl := O; ( Set for xnfinite scans. ) f osc. scr := 1; timeperpt := MCS_TIMEPERFT [MCS_TIMEPERFT_W IN] ; oeaksecond := O: ( set second derlvatxve level to O ) with ele do ieakthreshold := 0.1; ( set to 10%) begin printdir := CPD_DF; bs. last := O; setenergyconver sionlaserev = 4: bs. mode := O; setenergyconvers ionlength = 1.147: bs. tot := O: setenergyconvers iont O := 247e-9; cal. ev := 4; tO, ac := O; cal. len := setenerovconvers ionlength: to. cc := o; cal. tO := setener&iOnversiOntO; - ts .acc := TS_.4CC_DF ; cal quad :. setenergyconver sionquad; ts, step :. TS_STEP_DF; cal. quadof f := setenergyconvers ionquadof f; ts vel ,= TS_VEL_DF ; dly := O; ts. wait. int := TINT_DF; rep rate := DF_REPRATE; ts, wait, sl := TSL_DP; shotsperscan := 10000; ts web. ampl := O; ts. pos :. 30000e-6: ts. web. per := 0: ts. tO := 30000e-6; ts. web, ph := O; ts. web. ampl := 2,5; tw, dly := -2e-12; ts, web. oer := 10: tw ,pt := t4cS_PT[MCS-PT_MINl : ts. wob.;h := 0,525; tw. reprate := DF-REPR4TE; end: tw shotsperscan := 500; end; tw. tlmeperpt := 40e-9: with pardf [dt_POW] do yoffsetrescale := 1; begin ( Wave default vars. ) IX-91 := NAXPOINTS: for i := dt-MIN to dtJfAX do IX := LX-91; with pardf[il do scan_gl := 1; begin t imeperpt := 1; alert := O; with pow do comment := , , begxn dt .= x; ch = 1, fn . ,<; ,< CLI1 mt ,= O; gen .= 0; Cal, sl := 1, scan = o, end; sh = wv-sh JN . end, skip ,= O; wxth pardf [dtJ.lAS] do Vscop = 0, beczln yoffset = o, it = M?.XPOINTS, pt_gl := O; ( Doesn, t matter, ) sion) , uses defaults in ws-df. ) b.) scam_gl := 1; var 00 timeperpt := le-6; f : text; ( File variable. ) 0 with mas do i, j : integer; begin begin cal. int := O; if FileSxists (s) = false then Cal. sl := 1; begin ch := 1; if nev.wmrkspace = 1 then delay := O; begin inv := O; textmode; scanttie := timeperpt ‘ Pt; Clrscr; vert := O; textcolor (WHITE); end; writeln( ‘Workspace file does not exist; using default values. ,, end; BSLL) ; ( Write screen vars. ) delay (1000) ; sc. cur := 1; ws_df; ( Set defaults. ) sc.ls[sc. curl .gr. bdy := sc. bdy; ( Copy max. limits. ) exit; sc-init (se. cur) ; ( Set default screen parameters. ) end sc. num := O; ( Must set this below sc. cur when calling sc_resize the else first time, to establish xhts correctly. ) begin se–resize (SC. cur ); ( Establish screen coordinates for rest of graph. ) com_wr (,Workspace file does not exist. ,, COLOSSL) ; sc~num :. 1; exit; ws_init; end; end; end; Assign (f, s); procedure ws_init; Reset (f) ; ( Set a few variables to defaults whenever we change workspaces. ) readln(f, s); cons t if s e. H~_WS then LF = 610; { Doesn*t seem to work unless this is declared explicitly. ) begin var if newworkspace = 1 then i : integer; begin beain textmode; ~ Set these to O for first entering program. ) clrscr; if newworkspace = 1 then textcolor (WHITE) ; begin writeln (,Workspace file format incompatible; using default values. , addwaves mode := O; BELL) ; for i := 1 to AD_WAX do delay (1000); ad. ls[i]. on := O; ws-df; ( Set defaults. ) men. tot := O; exit; newworkspace := O; end osc. mode := O; else osc. scr := 1; begin scanwave := O; com_wr (,Workspace file format incompatible. ,, COLORHL) ; wv. num := O; exit; end; end; end; ( Snsure all waves on actual screens. ) ( Read global vars. ) for i := 1 to wv. num do for i := 1 to AD_WAX do with wv. ls[i]” do readln[f, ad. ls [i] gain) ; if screen > sc. nurn then readln(f. ad. on) : screen := sc. cur; readln( f, allsavid); ( Snsure osc on actual screen. ) readln (f, auto. adv) ; if osc. scr > sc. num then readln( f, auto .bg) ; osc. scr := sc. cur; readln (f, auto. cor ): Init_ts; readln(f, auto. fn) ; graph icsmode; readln (f, auto. gen) ; mc_rd (mc. fn) ; readln (f, auto. mm) ; ~,~ := ,.: readln(f, auto. off) ; end; readln (f, auto. m); readln(f, auto. ser) ; procedure ws_rd (s : buf string) ; readln(f, auto. sv) ; ( Reads ws file s from disk, which contains all critical system vars with readln (f, blankmin) ; the exception of wave data itself. If read fails (no file, or bad ver- readln( f, blankmax) ; readln (f, _bs bg) , readln (f, shl ; readln (f, _bs disl , readln [f, skip) ; readln (f, _bs. sts), readln [f, timeperpt ): readln (f, -bs. sts-blank) : readln (f, vstop) ; readln (f, _bs. sts_blank2 ); readln(f, yoffset) : readln (f, _bs. sts_ch) ; readln( f, yscale) ; readln (f, _bs. sts_fac) ; end: readln (f, _bs. sts_vert ): wxth pardf [dt_COR] .cor do readln (f, _bs. sts-tog) ; begin readln (f, debug) ; readln (f, ch) ; readln (f, dir) : readln (f, shotsperpt ); readln (f, discrim) : readln (f, ts. start) ; readln (f, dotradius) ; readln (f, ts. step); readln (f, global savemode) : readln (f, ts. stop); readln (f, mc. auto) ; readln(f, ts. tO); readln(f, mc. fn): readln (f, ts. web. ar@); readln( f, mc. sens) ; readln [f, ts. web. per) ; ... readln( f, men. bins) ; readln (f, ts. web. ph); ..... readln (f, men. w); end; readln( f, move .numavg) ; with pardf [dt_ELE] .ele do readln( f, move. start ): begin readln( f, move. step) ; readln (f, b,s.last); readln( f, move. stop) ; readln( f, bs mode) ; readln(f, move. wait) ; readln( f, bs. tot) ; readln( f, osc. ch) ; readln( f, cal. ev) ; readln( f, osc. scr) ; readln( f, cal. len) ; readln( f, peaks econd) ; readln( f, cal. tO) ; ( readln( f, peakthreshold) : readln( f, cal quad) ; readln (f, prmtdlr) ; readln( f, cal. quadof f ); readln (f, setenergyconvers ionlaserevl ; readln( f, ally); readln (f, setenergyconver sionlength) : readln( f, reprate) ; readln (f, setenergyconvers xont O ): readln( f, shotsperscan) ; ceadln (f, setenergyconve rsxonquad) : readln( f, ts .POS) ; readln (f, setenergyconvers ionquadoff ): readln(f, ts. tO); readln( f, tO ac) : readln(f, ts. web. ampl); readln (f, t.O, cc): readln( f, ts .wob. per) ; readln (f, ts, acc) ; readln (f, ts. web. ph) ; readln (t, ts. step) : end; readln (f, ts, vel) ; with pardf [dt_POW] .POW do readln (f, ts, wait. ret), begin readln (f, ts. wait .sl); readln (f, ch) ; readln (f, ts, web, ampl) ; readln (f, cal. int) ; readln (f, IX, web. per) ; readln (f, cal. sl); readln(f, ts, web. ph), end; readln(f, tw, ally); with pardf [dt_MAS] mas do readln(f, tw. pt); begin readln (f, tw. reprate) ; readln (f, cal. int) ; readln (f, tw, shotsperscan) ; readln(f, cal. sl) ; readln( f, tw. cimeperpt ); readln( f, ch) ; readln(f, yoffsetrescale) ; readln(f, delay) ; ( Read wave default vars ) readln( t, inv) ; for i :. dt-MIN to dtJAX do readln( f, scantime) , with pardf [i] do re.adln(f, vert) ; begin end; readln (f, alert) , ( Read screen vars ) readln (f, comment) ; readln (f, sc, c”r) ; readln (f, dt) : readln (f, sc, num) ; readln (f, fn) ; for L = 1 to sc ““m do begxn readln (f, gen) , with sc. ls [i] do beg>n readln (f, Pt) : readln (f, tx onl, readln (f, pt-gl) readln (f, t~ s), readln (f, scan) , end, readln (f, scan-gl) with sc ls [;] gr do beg~” readln(f, bdy[l) .x); writeln(f, _bs. bg) ; readln(f, bdy[ll. y); writeln(f, _bs. die); readln(f, bdy[21 .x); writeln(f, _bs. sts) ; readln(f, bdY[21 .Y); writeln( f, _bs. sts_blank) ; readln If, xh. mode) ; writeln( f, _bs. sts~lank2) ; readln (f, cursoru ); writeln(f, _bs. sts_ch) ; readln[ f, cursorvisible) ; writeln(f, _bs. sts_fac) ; readln( f, ullim); writeln(f, _bs .sts-vert); readln( f, u21im) ; writeln( f, _bs. sts_tOg) ; readln( f, vllim) ; writeln( f, debug) ; readln( f, v21im) ; writeln( f, dir) ; readln (f, xaxisdt ); writeln(f, discrim) ; readln (f, xaxismode ); writeln (f, dotradius ); readln (f, xfullmode ); writeln (f, global savemode ); readln (f, %on) ; writeln(f, mc. auto) ; readln (f, yaxismode ); writeln(f, mc. fn) ; readln (f, yfullmode ); writeln(f, mc. sens); readln (f, yen) ; writeln(f, men. binsl ; xh. which := 1; writeln(f, men. w) ; xh. u[ll := ullim; writeln (f, move. nunmvg) ; xh. u[21 := u21im; writeln(f, move. start) ; xh. v[l] := vllim; writeln(f, move. step) ; xh. v[21 := v21im; writeln(f, move. stop) ; se-resize (i) ; ( Set up other screen variables. ) writeln(f, move. wait) ; end; writeln(f, osc. ch) ; end; writeln(f, OSC. scr) ; ( Done. ) writeln (f, peaksecond) ; close(f) ; writeln (f, peakthreshold) ; ws_init; writeln (f, printdir) ; end; writeln (f, setenergyconvers ionlaserev) ; writeln (f, setenergyconversionlength) ; procedure ws_sv (s : buf string); writeln (f, setenergycOnvers iOntO ); ( saves system variables useful for startup each time in file s. ) writeln (f, setenergyconvers ioncr.md) ; var writeln (f, .watenergyconver sionquadof f ); f : text; ( File variable. ) writeln(f, tO. ac) ; i, j : integer; writeln(f, tO. cc) ; begin writeln(f, ts.ace); if s c> WS_Fl_DF then ( Only check for existence if not writelq(f, ts. step) ; default file. ) writeln(f, te. vel); if FileS%ists (s) then writeln(f, ts. wait. int) ; if conu.nzfn( ‘Workspace file exists. Overwrite’ ) . 0 then writeln(f, ts. wait. sl) ; exit; writeln( f, ts. web. curp l); if FileODenWrite (f. s) = false then writeln( f, ts. web. per) ; exit; writeln( f, ts.web. ph); ( Write version header. ) writeln(f, tw. ally); writeln (f, HSAD_WS) ; writeln(f, tw.pt) ; ( Write global vars. ) writeln (f, tw. reprate ); for i := 1 to AD_MAX do writeln (f, tw. shotsperscan) ; writeln(f, ad. ls [i] gain) ; writeln(f, tw. timeperpt) ; writeln(f, ad. onl ; writeln(f, yoffsetrescale) ; writeln(f, allsaved) ; ( Write wave default vars. ) writeln(f, auto. adv) ; for i := dt_MIN to dt_!4AX do writeln(f, auto. bg); with pardf [i] do writeln(f, auto. cor) ; begin writeln (f, auto. fn) ; writeln( f, alert) ; writeln[ f, auto .gen) ; writeln (f, comment) ; writeln(f, auto. ntud ; writeln(f, dt) ; writeln(f, auto. off) ; writeln(f, fn) ; writeln(f, auto. rrn); writeln(f, gen) ; writeln(f, auto. ser) ; writeln(f, pt) ; writeln(f, auto. sv) : writeln(f. pt_gl); writeln (f, blankmin) ; writeln(f, scan) ; writeln( f, blankma%) : writeln(f, scan_gl) ; Appendix 1 383

.. c

.. -.. . G A-.. ..u, .

w’ u’w------w-w-w.w. 4Cccc.4.....ccc UIQJaoaao . ...”.. ,4.- 4.4.4+ ..4.4 S4U. utihu 3333333

.: ‘; s := corn.ls[com cur]; #a, , *A, : ( Select all. ) val (s, i, dummy); for i := 1 to wv. nurn do if (i >= 1) and (i <= wv. num) then wv. ls[i]~. sel := 1; begin ,c,, ,C, : ( Clear all. ) wv. ls[il”. sel := 1: for i := 1 to wv. num do Wv. sel := 1; wv. ls[il-. sel := O; [ Read in more wave numbers if code allows us to. ) ,t,, ,T, : ( Toggle all. ) i E code = 1 then for i := 1 to wv. num do begin wv.ls[i]”. sel := 1 - wv. ls[i]”. sel; exit flag := false; end; while (tom.cur < corn.num) and (not exit flag) do DrawWaveData; ( UDdate cursor, tags. ) begin end; inc (tom.cur) ; until exitflau: val(com. ls[com. curl , i, dummy) ; { See if any ~aves selected, returning proper value in WV. sel. ) if (i >= 1) and (i <. wv. num) then for i :. 1 to !.,v.num do wv.ls[il~. sel := 1 if w.ls[i]-. sel = 1 then else begin begin wv. sel := 1; dec (tom.cur) ; ( Let calling routine figure out what meant. ) exit; exit flag := true; end; end; wv. sel :. O; end; end end; else end begin ( Unrecognized word; assume want current wave selected. ) else if s = ,allI then wv.ls[wv. cur]” .sel := 1; begin wv. sel := 1; for i := 1 to wv. num do dec (corn.cur) ; ( Leave word for calling routine to decipher. ) wv.ls[il~. sel := 1; end; I w.sel := 1; end; end { DESUG else if s = ‘sel’ then s := ,vn_sel: ,; begin for i := 1 to wv. num do I com--wr( ‘Select waves: UP/DOWN = move, / = t0991et a = all, c = ‘ with wv.ls[i]” do + , clear, t . toggle all, RS’IWRN = execute, ESC = a~rt. ‘, if sel = 1 then COLORMESS ); s := s + makestringint(i) + ,, ,; exitflag := false; com_wr(copy(s, 1, length(s) - 2) , COLORDSDUG) ; ) drawwavedata; ( Initialize appearance of waves. ) end; repeat Scan; ( Take care of active waves. ) procedure wv_sel_off; if keymressed then ( Turn off all sel tags on waves. ) begin var case readkey of w : integer; sXTEWDED : begin case readkey of for w := 1 to wv. num do sARRoWCoww : wv. ls[w]”. sel := O; if wv. cur < !vv.num then wv. sel := O; inc(wv. cur) end: else Wv. cur := 1; procedure XFU1l (scr : integer) ; xnRRow7JP : ( Calculates largest u limits for currently visible waves. If all waves are if wv. cur > 1 then invisible, then limits don, t change land they don, t matter, either) . ) dec(wv. cur) var else got-one : bolean; ( Flag indicating valid wave found. ) wv. cur := wv. num; U1 : real: ( Tetm30rarY unit variable. ) end; U2 : real; ( Tetiorati unit variable. ) CR: exitflag := true; w : integer; ( Wave index. ) ESC: ( Abort selection: untag all waves. ) begin begin with SC. ls[scr] .gr do for i :. 1 to wv. num do begin wv.ls[il”. sel := 0: if xfulhode . 0 then exitf lag := true; exit; end; ,1, , ,?, : wv. ls[wv. curl” .sel := 1 - w.ls[sw. curl” .sel: ( Find first wave on screen which is visible, calculate its limits. ) gOt_One = false, end; w := 1; end; while (got_ one = false) and (w .= wv num) do with wv lsIw]- do functxon XToTheY (x, y : real ) : real, begxn ( Raises x to the y power, ) if [on = 1 ) and (screen = scr) then begin begin XToTheY := exp(ln(x) . ~); i f (xaxismode = XAXI.9400E_CONVERT I and end; (xaxisdt = dt_ELE) then begin functxon XtoU(x : longint: scr : integer ) : real; u21>m := Ptou(w, pmin, xaxismode) ; ( Calculates unit-space u coordinate, gxven screen coordinate x and if par. pt > 0 then screen number scr. ) ullim := PtoU(w, par, pt, xaxismode) begin else with SC. ls[scr] .gr do ulllm := u21im; xtou := (x - plotarea. xl) ‘ (u21im - ullim) I (plOtarea. x2 - end plotarea. xl - 1) + ullim; else end; begin ullim := Ptou (w, pmin, xaxismode ); procedure YFu1l (scr : integer) : if par. pt > 0 then ( Displays all waves with full Y limits If yfullnmde = 1. ) u21im := Ptou(w, par .pt, xaxismode) va r else got_one : boolean: ( Flag indicating valid wave found. ) u21im := ullim; V1 : real; ( Generic unit variable, ) end; V2 : real; ( Generic unit variable. ) gOt_One :. true; w : inte9er: ( Wave index, ) end; begin W:. w+l; w~th SC, ls[scr] ,gr do end; begin ( Now look for others, expand limits to include them all. ) if yfullmode = O then xf got_one then exit: Eor w :. w to wv. nurndo ( Find first valid wave, record its limits. ) with WV. lSIW]’ do gOt_One := false; begin w := 1; If (on = 1) and (screen = scr) then while (got_one = false) and (w .. wv, num) do begin begin if (xaxismode = XAXISMODE_CONVERT) and (xaxisdt = with W.l SIW]A do dt_ELE) then if (on . 1)and (screen = scr) then begin begin U2 := PtOU(w, pmin, xaxismode ); vllim :. .nnin; if par. pt > 0 then v21im := vmax; U1 := PtOU(w, par pt, xaxismode) gOt_One :. true; else end; U1 ,= U2; inc (w) ; end end; else ( Now look for other waves and expand lxm, ts to include them .11 ) begin if got-one then U1 := PtOU (w, pmln, xaxl smode ); for w := w to wv. num do if par. pt > 0 then with WV, lSIW]A do U2 := PtOU(w, par pt, xaxlsmode) begin else if (On = 1) and (screen = scr) then U2 := Ul; begin end; V1 := vmin; If U1 . ullxm then V2 := vmax; ulllm := ul, xf V1 . vlllm then Lf U2 > u21xm then vllim := v1; u21im :. u2; if V2 > v21Lm then end, v211m := v2, end end, else ( No valld waves, use these defaults ) end begin else ulllm . O; begin ( No waves -- use these llmlts ) w u211m = 1, vlllm . 0, m end, v21im = 1, WI end: if vllim > v21im then b.) end; begin 00 end; r := vllim; a) vllim := v21im; procedure Y. ScaleChange (r : real) ; v21im := r; ( Change yscale of wave W. Cur by r. ) end; var ( Make xh extend to full screen. ) rr : real; ( Temporary ValUe. ) X[l] := plotarea. xl; begin X[2] := plOtarea, x2 - 1; with w.ls[wv. curl” do Y[ll := plotarea. yl; begin Y[21 :H plotarea. y2 - 1; rr := par. yscale + r; UpdateVitals; if rr . 0 then Update (sc. cur) ; rr := rr + r; ( Avoid actually getting to O, which screws up yoffset- end; rescaling. ) end; if yoffsetrescale = 1 then end;

par. yoffset := par. yof fset ● rr / par. yscale; wv. ls[wv. cur]n. par. yscale := rr; end. end; DrawWaveData; end; 4.7. fpesvar. pas procedure YScaleChangeSign; begin if wv. num . 0 then unit fpesvar; exit; ( History of modifications (please add to BOTrOM of list! ): wv. ls[wv. cur]~. par. yscale := -wv. ls[wv. cur]” .par. yscale; DrawWaveData; version 1: Begun 2jun94 EJG.

Constant, type, and variable declarations for the program view. See view function YtOV(y : longint; scr : integer) : real; (at appropriate version) for more specific program modification notes. ( Calculates unit-space u coordinate, given screen coordinate x and screen number scr. ) A note about the coordinate systems: there are three sets of coordinates to describe data positions in different -spaces. - They are: begin g with sc.ls[scrl .gr do YtOV := -(y - plOtarea. y2 + 1) ● (v21im - vllim) / (plOtarea. y2 - (w, P) : wave and point space: w is a “wave- or data set; P is a ‘point- or w plotarea. Y1 . 1) + vllim; bin number. end; (u, v) : unit space: u and v are axis coordinates in real units: for u, it is s time (ns, us) , energy (eV) or mass (amu) ; for v, it is either abso- a w. procedure Zoom; lute intensity (counts ) or relative intensity (arbitrary units) . M ( Only active in xh mode: Make screen kmundaries equal to limits of Which units are in use depends on the display mode: xaxismode_ and Xh. ) ya.xismode keep track of these. w var (x, Y) : screen space: x and y are screen coordinates used to plot graphics. r : real; ( Temporary holder. ) begin These systems are always distinguished by using variable names incorporating with sc. la[sc. cur] .gr do the letters w and p, u and v, or x and y. begin ) if xh. mode . 0 then exit; interface with xh do begin uses xfullmode := O; crt, graph, Keys; yfullmode := O; ullim := u[l I; ( General purpose section** ...... 4. *** ...... ) u21im := u[2]; const if ullim > u21im then -m u 10000: ( Maximum reasonable array wasition for chararrav, begin wordarray. ) r := ullim; AUTC_SER_DF = ,file-, ; ( auto. ser default string. ) ullim := u21im: BLAWKLIWS = s u21im := r; .: end; ( 80 spaces. ) vllim := v[l]; COLORDEBUG = LIGHlWREE2?; ( Default debug message color. ] v21im := v[2]; COLORUS2R = YELLOW; { Default user input color. ) COWRMACRO = LIGHTMAGENTA; ( Default macro color. ) lntbuf_type . array[ 1 f4AKPOINTS] of integer; ( Tenw array for data cOL0PJ4ESS = LIGHTCYAN: ( Default message color. ) transfer during reads. ) cowRHL = LIGHTRED; ( Highlighting color (most rouf.lnes also generate ts_wob_type = record ( Software wob parameters to correct wobble beep when using this color) ) in ts motion. Used by COR, ELE datatypes, also ts. wob main var. ) “. cD_DF = ‘d: \fpes\data\’ ; ( Default data directov. ) arrpl : real; ( ~lit.de. ) .... CPD_DF = ,f: \fpes\prmt\’; ( Default print directory. ) per : real; ( Period. ) DF_REPRATE = 500; ph : real; ( Phase. ) ELECTRONMASS = 5. 4863 E-4; ( MaSS (am) of electron - for energy conver- end; sion. ) wordarray = array[l . ARRAVMAKI of word; ( See chararray ahve. ) ELSCTRON?4ASSKG = 9. 10953 E-31: ( Electron rest mass in kilograms ) xy_type = record ( Screen-space position pair. ) ERR_ DATAFORlfAT = ,Error: Bad data formzt. ,; x, y : integer; ERR_ FILENOTFOUND = ‘Error: file not found. ‘; end; EVNM . 1239. 842447; ( eV. nm conversion factor between laser wavelength and ( Note: the following definitions must be out of order, since they use energy. ) other definitions which would normally follow after them alphabeti- FPES_EKT . ,par, ; cally. ) HALFSPEESOFLIGHT = 1. 49896229e8: ( Half the speed of light in m/s. ) bdY_tYPe = arraY[ 1..21 of xY_tYPe; ( Pair of coordinates describing ;:.., HEAD_WS = ,FPES WORKSPACE, REV. 1998.02.207 ; graphics boundary. ) HEAD_WV = ‘K - FPES WAVS FILE. REV. 20 FEB98 ‘; tx_type = record ,2 HELP_FN = ‘help .par’ ; bdY : arraY [1..21 of %y_twe; ( Screen boundaries. ) ... HELP_LINESPERPAGE = Z4; buf : ‘chararray; ( Pointer to chunk of memory holding text data. ) JTCISV = 6. 24146e18; ( Joules to eV conversion factor ) Col : “wordarray; ( Pointer to color list (1 for each line) ) LABEL_END_CHAR = ‘ :‘: ( Used to terminate label field in w or ws cur : xy_type; ( Current x and y char position. ) files. ) num : xy_twe; ( Max. number of characters in x and y directions. ) LARGE = le38: ( Effective upper bound for range checking. ) end; LARGEIWT = 2147483647; ( Effective longint upper bound, ) tx_type_p = ‘tx_type; LINESPERPAGE . 15; ( for output of peaks ) va r LW.2 = 0.693147181; ( in(2). ) all saved : integer; ( Flag for whether all waves have been saved, ) LN-10 = 2.302585093; ( ln(lO). ) auto : record ( Auto-filename variables. ) MAXPEAKS = 200; ( ten screens of 20 peaks ) adv : real; ( Number of s to advance stage when current ele scan MAKPOIWTS = 1024; ( max. # of data points in a wave. ) is done, Restarts new scan automatically. If O, mode is off. ) NAKPOWER = 12; ( Max. legal exponent in UnitPref ix. ) b9 : inte9er; ( Flag to scale bg and foreground waves. ) MINPOWER = -18; ( Minimum legal exponent in UnitPref lx. ) cor : inte9er; ( Fla9 to scale and calculate fwhm for cor waves. ) powFs . 1.3-15: ( Power for all fs vars. ) fn : integer; ( Flag to generate filenames with new waves. ) POWTS = le-6; ( Power for all ts vars. ) gen : inte9er; ( Flaw to 9enerate new wave when scan done. ) SLOPEFAC~R = 2.842815689 e-12; ( Conversion factor (.w m~-2 s.2) for time num : integer; ( File number counter (for fn = 1 mode) ) to energy in PtOU. ) off : integer; ( Flag to turn off scans if all electron waves are SWALL . le-3; ( Small number to add to rounding expressions to suppress off. ) roundoff error. ) rm : inte9er; ( Flag to remove waves if full. ) SQRTPI = 1.772453851; ( Square root of Pi ) ser : bufstring; ( Series name for files (for fn = 1 mode) ) SQRTLN-2 = 0.832554611; ( Square root of the nat. log of 2 ) sv : inte9er; ( Fla9 to save automatically when scan done. ) SQRTLN-1OO = 2.145966026: ( Sware root Of the nat. low of 100 ) end; TEKREPRATE = 100; ( Max. reP. rate of Tektronix scope (Hz I ) blankmin, blanknmx : integer; ( Current point range to blank using TEKSET_MAK = 30 ; Blank-Data routine. ) TEK-YPTSPERDIV = 3276.8 ; _bs : record ( Background subtraction mode parameters. ) ‘IWOPI = 6.28318539717959; ( 2 ‘ pi. ) bg, fg : integer; ( Background and foreground waves. ) VALDEC = 6: ( Number of decimals for normal values printed. ) dis : integer; ( Flag for bs display mode, ) VALDECFS = 1; ( Number of decimals for fs values, ) sts : lnte9er; ( Fla9 for sts (shot-to-shot) bs mode. ) VALDECTS = 2; ( Number of decimals for ts values. ) sts-blank : integer; ( Number of initial bins to blank to elimi- VALMAK = VALDEC + 2 ; ( M8x number of dxglts for normal values (counts nate noise spike. ) ,-, and ,,, ) ) sts-blank2 : integer; ( Number of final bxns to blank. ) VALMAKFS = 7: ( Number of dxgits for fs values ) sts-ch : integer; ( Channel number on TEK to use for bg scans, ) VALNASTS = 8; ( Number of digits for ts values ) StS-fac : real; ( Conversion factor for scaling TEK and MCS VERSION = ‘Version 6, ; ( Version. ) waves. ) WS_FN-DF = ,WS PAR ‘; sts_tog integer; ( Flag indicating whether to use toggle “ode or type regular mode for data accm”latxon (regular usually means will bufstrlng = strin9 [1001 ; ( General-purpose buffer string ) connect chopper to the inhlblt BNC, so that background scans are chararray = array[l ARRAY144X] of char, ( This definition, together not accumulated) ) with wordarray below, enable a pointer to reference any element of sts-vert real; ( Vertxcal scale used on TEK ) an arbitrary-sized array, when a pointer IS declared as pointxng to end, ct>xs array (much like c does for all poxncer types) For instance, calib record ( Temporary holder of parameters for calxbr.atxng an for p ‘char array, can reference element L with p“ [11 ) electron or Lon spectrum ) u 2 , MAXPOINTS] of real, ( For use in fft c array[ 1 2] of real, ( Converted values (energy or mass) ) fft_diray_type = array[ 1 C.J and dssoclated SmoothEnergy routznes ) n arrayl 1 21 of real, ( Normal values (time) ) end; ( CO1 section (colors ).**k. **k********.* ●***..************.************.) . w debug : integer; ( Flag to disable graphics screen and print debugging const ccl messages. ) COL’3RNAK = 15; ( Max. CO1O2S. ) ccl dev_rd : integer; ( Flag to disable device reading, so can use for COLORNAME : array [1 .. COUOU4AK] of bufstring E (,blue, , ,green, , 8nalYSiS on FC not connected to devices, ) ,cyan, , ,red, , ,magenta, , ,brown, , ,lightgray, , ,darkgray, , dir : bufstring; ( Current directory label. ) ,lightblue’ , ,lightgreen, , flightcyan, , ,light red-, ,lightmagenta, , disc rim : real; ( Discrimination level used for electrons (MCS and ‘yellow’, ,white, ); ( Names of colors in order as shown in Program- TEK) . ) mers reference 7.0, P. 29. For use with user specification of wave exitflag : boolean; ( Flag to end program. ) colors. ) filter : array[l .. MAKPOINTS div 2 + 1] of real; ( Filter function ( Following must be out of order since definition uses COL43r04AX. ) used by SmoothEnergy. ) COLOR : array [1 .. COLORMAS] of word = (LightRed, Yellow, LightGreen, globalsavemode : integer; ( save wave mult by yscale or not. ) LightCyan, LightBlue, LightMagenta, White, Red, Brown, Green, Cyan, info : record ( Vars calculated with info functions. ) Slue, Magenta, LightGray, DarkGray) ; ( List of wave colors area : real; (in order of most to least visible. ) ctr : real; var edgel : real; anticolor : array[l .. COLOKMAX] of integer; ( Color-to-code index. ) edger : real; fwbm : real; [ corn section (command line) ********************************************) end; const macro_override : integer; ( macro override flag ) com_ls_f4AK = 30; ( Maximum number of words in corn. 15[ 1. ) mon : record ( Parameters for mon (itor ) command. ) co~wr_MOVINGSTAGE = ~Moving stage. Press any key when ready. ,; bins : integer; ( Number of bins to add together for tweak wave. ) var tot : real; { Total counts. ) com : record w : integer; ( Tweak wave. ) 1s : array[l .. com_ls_MAK] of bufstring; ( List of words typed by end; user. ) nev.workspace : integer; ( Flag to indicate new workspace (1 ) or not cur : integer; ( Current word being looked at. ) (o). ) num : integer; [ Ntier of words in 1s [1. ) osc : record ( Virtual oscilloscope. ) old : string; ( Last string typed. ) “” bit : pointer; [ Storage for graphics under line. ) Sv : string; ( User input save string. ) ch : integer; ( Channel to display. ) t%: tx_type; ( Text screen variables. ) mode : integer; ( Flag indicating if on. ) ystart : integer; ( Starting line of input. ) scr : integer; ( Screen displayed on. ) end; Y: integer; ( Screen-space Y coordinate. ) ( gr section (graphics screen) ******************************************) end; g peakthreshold : real; ( numerical threshold [O. .1] for peak finding ) const peaks econd : real; ( second derivative value for peak finding ) CURSORLSNG~ = 30 ; ( Length of cursor in pixels. ) w printdir : bufstring; ( Current directory prints are sent to. ) MAKDDTSIZE = 10; ( largest sensible dot size for screen ) setenergyconversionlaserev : real; ( User-specified values to set all ) MAKXDIGITS = 6; ( Max. # of digits for x-axis nurrbers, ) s setenergyconvers ionlength : real; ( energy waves to (see SetEnergyCon- ) NAXYDIGITS = 6; ( Max. # of digits for y-axis numbers. ) setenergycOnvers iOntO : real; KAXISMODEMIN = O; r. setenergyconvers ionquad : real; SAKISMODEMAX = 2; setenergyconversionquadof f : real; XAXISMODE-POINTS = O; ( xaxismode states: display points only. ) w to : record ( Record of ac and cc tO positions -- defaults. ) XAXISMODEJJORMAL = 1; ( -: display normal x unit (time or distance, depen- ac : real; ding on dt. ) cc : real; SAKISNODLCONVERT = 2 ; ( -: display converted x unit (energy, mass or end; time, depending on dt. ) tekset : record YAXISNODE>SOLUTE = O; num : integer; YiUISNODZ_RSLATIVE = 1 ; s : array [1 .. TEKSET_NAXl of bufstring; type end; box = record tw : record ( Parameters for tw (tweak) command. ) Xmax, ynla%: integer; ( Max. x and y character units. ) dly : real: ( Delay position (relative to pardf [dt_ELE] .ele. tO) xl, X2, yl, y2 : integer; ( Screen coordinates defining a box. ) for tweaking. ) end; pt : integer; ( Number of points to read. ) fillPatternType = array [1. .81 of byte; ( ??? ) ;eprate :-real; gr-type = record shotsperscan : integer; ( Records per scan. ) bdy : bdy-tyue; ( hiax. screen boundaries. ) starttime. steptime : longint: { Internal timin9 vars. ) cursorp : integer; ( Point index of cursor. ) timeperpt : real; ( Sin size. ) cursoru : real; ( Unit space x coordinate of cursor. ) end; cursorvisible : integer; ( Flag indicating whether cursor is visi- ynaesc_respOnse : integer: ( Holds last ResponsePull/ResponseYesNo reSUlt. ) ble (1) or not (0). ) yoffsetrescale : integer; ( Flag indicating whether to rescale wave [1”.Par cursorx : integer; ( Screen x coordinate of cursor. ) .yof fset when wave[ ]6 par. yscale is changed. ) cursoryl : integer; ( Screen starting y coordinate of cursor. ) curs0ry2 : integer; ( Screen ending Y coordinate of cursor. ) maxxnums : Integer: ( Max. number of numbers to print along x textsize : mceger; ( Size of graphics character i“ pixels (X axis. ) and Y’ are the same) Used to lay out maxynums : integer; screen correctly regardless of graph>cs plotarea : box; ( Screen limits for plot.txng area. ) mode ) ullim : real; ( Left limit of displayed data (user space) 1 wavedata : lmx; ( Screen limits for wave information. ) ulnorm : real: ( Left normalization position. Used in normalization = INTEGRAL, SELECTED. ) ( mc section (mass calc"lat*r) ...... ) ulnum : real; ( Leftmost number displayed on x axis. ) const u21im : real; ( Right limit of data. ) MC–LABEL-MAX = 10: [ Number of chars in label. ) u2n0rm : real: ( Right normalization position. Used in MCIM?U =-20; ( Number of elements. ) normalization = INTEORAL. ) MC-LINESPERSCREEN = 24; u2num : real; ( Rightmost number displayed on x axis, ) type ustep : real: ( Step size for x axis numbers. ) mc_label = string [MC_LABEL_t4AX] : vllim : real; ( Bottom limit of data. ) Va r vlnwn : real; ( Bottonunost number displayed on Y axis. ) mc : record ( Mass calculator parameters. )

v21im : real; ( Top limit of displayed data. ) auto : integer; ( Flag indicating if on, ) v2num : real; ( Topmost number displayed on Y axis. ) fn : bufstring; ( Name of current mc f~le (so can ws can reload) vstep : real; ( Step size for Y axis numbers. ) 1s : array[l .. MC_t.mx] of record xaxis : box; ( Screen limits for x axis. ) m : integer; ( Mass. ) xaxisdt : integer; ( If xaxismode <> XAXISMODE_POINTS, then this min. max : integer; ( Min and max. number of times can be used, variable tells us which dt can be displayed. ) nun : integer; ( Temporary storage of mass combination. ) xaxismode : integer; ( X axis display format. ) s : mc_label; ( Element label. ) xdecimals : integer; ( Number of decimals to print on x aXis. Depends on end; dt. ) num : Integer: ( Number of elements in 1s [] array. ) xf”llmode : integer; [ Full-scale flag for x axis. ) s : bufstring: ( String printed to cursorinfo box containing xh : record ( Crosshairs. ) current combination (s) ) bitmap : record sens : real; ( Sensitivity of calculator (t of mass units) . ) x, y : array[l 3] of pointer; ( Pointer to storage areas for end; graphics under crosshairs. Defined in InitGraphics. ) end; ( sc section (screen) ...... ) mode : integer; ( Flag indicating whether on or off. ) const u, v : array[l 3] of real; ( Unit-space locatxons of the x and Y SCJ44X = 12; cursor hairs (1 = first, 2 = second, 3 . center. ) sc_mode_GR = O; which : integer; ( Flag indicating which crosshairs the arrows manipu- sc_mode_TX = 1; late: 1 = x[ll, y[l]; 2 = x[21, y[21. ) sc-mode-TX_OVR . 2; ( Text override mode -- to force screen to stay x, Y : array[l 3 ] of longint; ( Screen-space locations. ) in text mode even if graphics comnand issued. This is to allow end; active waves to update, but not redraw, while doing something in xlabel : box; ( Screen limits for x label. ) text mode (such as editing a wave) . ) xlabelstxing : bufstring; ( X axis label (depends on scantype) . ) type xnumbers : box: ( Screen limits for x numbers. ) se-type = record xon : integer: ( Flag to display x axis. ) sel : integer; ( Flag indicating if selected, ) xp.awer : real; ( Power of 1000 to div,de x axis labels by for display. ) ti : record ( Screen title block. ) xunits : bufstring; ( Units for x axis (depends on scant~e) ) MY : bdy_ty9e: ( Screen limits, ) yaxis : box; ( Screen llmits for Y axis. ) on : lnte9er; ( Flag to display. ) yax~.smode : integer; ( Display mode for Y axis. ) s : bufstring; ( Title, ) ydecimals : integer; end; yf”llmode : integer; ( Full scale flag for y .axls. ) ( Screen variables. ?wo twes are possible, indicated by mode, This ylabel : box; ( Screen lim, ts for y label. ) construction is called a variable record: gr and tx share the same ylabelstring : bufstring; space in memory, and therefore only one is valid at a time, ) yon integer; ( Flag to display Y axl S. ) case mode : integer of ypower : real: ( Power of 1000 to d,vide Y axis labels by for display. ) sc_mode_GR : lgr : gr_tne) ; yunxts : bufstring; sc-mode_TX : (tx : tx-tme I; ynumbers box; ( Screen llmits for Y numbers. ) end; end; va r va r sc record b,tmap : po,nter; ( Poxncer to storage area for graphics bdY bdY-tYVe; ( Total screen area llmlts, ) under cursor Def Ined in InltGraphics. ) cur Integer; ( Current screen. ) cursorlnfo : box: ( Screen llmlts m which information about 1s array[l sc_f41&l of sc-tme; ( Screen variables ) a data point 1s plotted ) mode xnteger; ( Overall screen mode sc-mode_GR (normal lY) , or dotradlus xnteger, ( radius of dots on screen ) se-mode-TX (for edit Ing waves, etc ) ) graphmode integer, ( variable needed by graphics rout mes ) num integer, ( Nwnber of actave screens ) maxwavenamelength integer, ( Max length of wavenames displayed ) Sel lnte9er, ( Flag xndlcatxng if anY screens were selecced ) rn.ssagebox box ( Screen llm>ts for graph;cs messages ) end, whenever stage is initialized) . ) ( scan section (overall scanning )**** ***** ***** ****a ***** "*k** ***** **. *b) lookup : array[O TSJJNKUPJ4A%] of real; ( Lookup table for cons t wob function. ) AD-MAX = 8; POS : real; ( Current stage position. ) sCANJ40DEJWW = 5 ; step : real; ( Current- step size of stage. )

TIMSMAX = 100 ● 60 ● 60 ● 24; ( Maximum value returned from time () . ) vel : longint; ( Current velocity (sent at start of program, and var whenever stage is initialized) . ) addwaves : record wait : record ( Waiting parameters for stage motion. ) mode : integer; ( Flag indicating if on. ) int, S1 : longint; ( Intercept and slope. ) w : integer; ( Wave holding added result. ) end; end; wob : ts_wob_type; ( Wobble wob parameters. ) ad : record ( AlD variables. ) end; 1s : array[l .. ADJ.!AX] of record gain : integer; ( Gain factor = 1, 2, 4, 8. ) ( tx section (text 5creen) ********************************************** ) on : integer; ( whether channel is active. ) ( All definitions in general section, due to ordering of other struc- result : integer; ( Storage of A/D result. ) tures which also use them. ) end; on : integer; { Overall flag to read or not. ) ( wv section (waves)******************* ● *********************** ●********) end; const

ibbuf : array[l .. 2 ● MAXPOINTSI of char; { Data transfer array for USERWIN = 16; ( Min. element of wave[ 1A .par. user[ ] . ) GPIB card. ) USERMAK = USERMIN + 15; ( Max. element of wave[ ]” .par. user[ ] . ) intbuf : “intbuf _type; ( Pointer to ibbuf, but integer format. ) CHANGEPARXNAME = 1; ( X position of names in changepar procedure. ) magic : integer; ( Gpib vafiable for magic controller. ) CSANGEPARXVALUE = 40; ( X position of values - ) mcs : record ( SRS Multichannel Scalar variables. These ValUeS are CSANGEPARYSTART . 2; ( Y position of start of parameters - ) kept here so we only need to talk to Scalar when parameters have CHANGEPARYUSER = CHANGEPARYSTART + USERMIN; ( Y position of user changed. ) parameters . ) addr : integer; ( Gpib address. ) dt_COR = 1; ( Values of par. dt. ) new : integer; ( Flag indicating if MCS needs to be initialized. ) dt-ELE = 2; IN,: integer; ( Number of points. ) dt_POW = 3 ; shotsperscan : integer; ( Records per scan. ) dt_NAS = 4 ; timeperpt : real; ( Bin width (s) . ) dt_MIN = 1; end; dt_WAX = 4; rdbuf : bufstring; ( rdbuf : array [l. .$1000] of char; see ibbuf. ) dtJ2ANE : array [dtJ41N .. dt_MAX] of string = (‘cor, , ,ele, , ,POW, , reprate : integer; ( RePrate Of laser (Hz) . ) ,mas, ); scanwave : integer; ( Current wave being scanned. ) MA.S-CH-MAX . 4; ( Max. channel # for par.mas. ch. ) starttime : longint; ( The time the escan starts. ) MAXdt E 4; ( Number of kinds of data types. ) tek : integer; ( Gpib variable for Tektronix scope. ) MAXNOMSCANS = 10000; ( Arbitrary upper limit to NGNSC1’JfS. ) KAXSHOTSPERFT E 32000; ( Arbitrary uPper limit to PAR_C_SHOTSPERFT. ) ( ts section (translation stage) ****************************************) MAXSHOTSPERSCAN = 32000; ( Max. shots per scan on MCS. ) cons t NAXWAVSS = 18; ( max. # of wave8 in memory at a time. ) ACKDELAY = 250; ( Number of MS to wait after sending ACK code. ) MCS_PT_NIN = 1; TIWr_DF = 20; ( SnuYirical minimum time for 8ta9e delay. ) MCS_PT_MAX = 1; w TSJCC-DF = 200000; ( Default acceleration (um sn-2). ) MCSJ’P : array tMCSST_MIN .. MCS_FT_MAX] of integer = (1024) ; TS_LOGKUPJIAX . 32; ( Maximum entzy in lookup table. Should be multi- ( Codes understood by the MCS corresponding to number of points. ) ple of 2 for most efficient lookup. ) MCS_TIMEPERFTJ!IN = O; TS-PHASEJ5AX = 1; ( Range of wob phase parameter. ) MCS_TINEPERPTJAK = 10; TS_PSASEJfIN = O; ( “ ) MCS.-TIMEPERFT : arraY [MCS-T~EpERpTJIN .. MCS_TIMEPERFT_MAX] of TS-RES-STEP = 4e-5; ( Resolution-stepsize product of ts, e.g. res. 40 real = (5e-9, 40e-9, 80e-9, 160e-9, 320e-9, 640e-9, 1.28e-6, = 1 UM, res. 800 . 0.05 W, etc. ) 2. 56e-6, 5.12e-6, 10.24e-6, 20.48e-6) ; ( Codes understood by MCS TS_STEP_DF = le-6; ( Standard step size. ) corresponding to time per point. ) TS-STEPJfIN = TS_RES_STEP / 1024; ( Min. StepSiZe Of tS, at res = ( WV. 1s []” .par. user indices for different datatypes: ) 1024. ) ( Pox all datatypes: ) TS_VSL_DF = 4000; ( Default velocity (9m/sl . ) PAR_ALERT = 1; TS_VSL_MAX = 30000; ( Maximum velocity (urn/s). ) PAILCONMSNP = 2 ; TSL_DF = 100000000 div TS_VSL_DF; ( Slope for timing in 1/100 s per PAF.-m = 3; m. ) P&F ILSNAME = 4; Var PAR_GSN - 5; com2 : text; ( Text file Pointer for translation stage. ) PAF.-FT . 6; move : record ( Stage variables. ) PAR_PT-GL = 7 ; numavg, start, step. stop, wait : real: PAR_scAw = 8; end; PAF.-SCAt_GL . 9; ts : record PAR_SH = 10; acc : longint; ( current acceleration (sent at start of program. and PAR_sKIP = 11; PAR. TIMEPERFT = 12: ‘Translation stage start, , PAR_VSTOP = 13, ‘Translation stage step, , PAR_YOFFSST = 14 ; ‘Translation stage stop< , PAR_YSCALE = 15; ‘Translation stage zero of t.xme-, ( F;r dt_COR. ) ‘Translation stage wobble amdltude, , .,..i .. . PAR–C–CHANNEL = USEIU41N; ‘Translation stage wobble periods , -, PAR-C_SHOTSPERPT = USERMIN + 1 ; ,Translation stage wobble phase-, ‘,, ‘,, ,,, ‘,, 4$, ,,, ,, ), PAR_C_STAGESTART = USElU41N + 2: ( ‘Background wave last scan total’ , PAR_C_STAGESTEP = US ERMIN + 3 ; -Background subtract ion mode, , ,< PAR_C_STAGES’PSP = USERMIN + 4: ,Background wave all scans total, , ,.,1 PAR_C_STAGETO = USERWIN + 5: ‘Calibration maximum energy, , PAR_C_STAG~obAMPL = USERJfIN + 6: ,Calibration length, , PAR_C_STAGSwobPER = USEF.MIN + 7: ‘Calibration time offset z, PAR_C_STAGbObPH = USEQJfIN + 8: ,Repetition rate, , ( For dt_ELE: ) 8Shots per scan- , PAR_ E_BS_IAST = USERMIN ; ‘Translation stage position, , i. PAR_E_BS_MODE = USERMIN + 1 ; ‘Translation stage time zero (tO) ,, ... PAR_ E_BS_T9T = USEFJ41N + 2: ‘Translation stage wobble an’plitu de,, ..,..... PAR_ E_CALEV = USEFUtlN + 3 ; ,Translation stage wobble period, , PAR-E_CALLENGTH = USERMIN + 4: ,Translat ion stage wobble phase, , PAR-E_CALTO = US ERMIN + 5 ; ,Time delay of FPES (ally),, PAR_ E-REPRATE = USEPJ41N + 6 ; ‘Calibration quad factor, , PAR-E_ SHOTSPERSCAN = USERNIN + 7 ; ,Calibration quad offset factor, ), PAR-E-STAGEPOS = USERMIN + 8 ; ( ‘AID channel, PAR-E_STAGETO = USERMIN + 9: ,Calibration intercept n, PAR_ E_STAGEWobANPL = USERMIN + 10; ,Calibration slope<, ‘,, ‘o, 8$, ,,, ‘e, ‘,, ‘a, ‘-, ‘o, ‘$, ,,, ‘5, ‘,), PAR_ E_ STAG SwobPER = US ERMIN + 11 ; ( ‘Calibration intercept v, PAR_ E_ STAGEwobPH = USERMIN + 12; ,Calibration slope, , PAR_ E_TIMEPPES = USERNIN + 13 ; ,Channel, , PAR_ E_CALQUAD = US EFJ41N + 14 ; ,Delay, , PAR_ E-CALQUADOFF = US ERMIN + 15: ,Invert, . ( For dt_POW: ) ,Scan time, , PAR_P_C WEL * US ERMIN ; ,Vertical scale,, ,,, ,,, ,,, ,,, $$, $,, ,$, ,$, $, ) 1; ~ PAR_ P_CALINT = USERNIN + 1 ; -7 PAR-P_CALSLOPE = USERMIN + 2 ; PARDIGITS = 3; ( Number of digits to display in parameters. ) x .. ., ( For dtJfAS: ) PARDECINALS = 5: ( Number of decimals - ) )-J {+,,j PARJ4_CALINT = USERMIN; PARENGDIGITS = 10; ( Number of decimals for engineering notation (4-dig~t PARJ4_CALSLOPE = USERMIN + 1 ; mantissa, 2-digit exponent, ,-, , 8,S, ,E, , ,-, ). ) i PAR-M_CHANNEL = USERMIN + 2 ; PARYSTART . 2; ( For change parameter procedure. ) PAR-M_DELAY = USERNIN + 3 ; PARYSWP = 25; ( . ) PARJf_INV = USERNIN + 4: STAGEWIN = O; ( Minimum translation stage posxtion (m) . ) PAR_M_SCANTIME = USEFJ41N + 5 ; STAGSMAX . 0. 20; ( Maximum translation stage position (m) ) PAR_M_VERT = USERMIN + 6 ; TEKJTPERDIV = 50; ( Labels for use on screen and ln wave files. ) TEK-TIMEPERPTJ41N = 1 ; PARLABEL : array[ 1 ., USEPJfIN - 11 of strxng = TEK-TIMEPERPT_NAX = 32 ; ( ‘Alert (alert) ,, TEK_TIMEPERPT : array [TEK_TIMEPERPT_MIN TEK-TIMEPERFT_MAX ] of ,Comment (cm) ‘, real = (le-11, 2e-11, 4e-11, le-10, 2e-10, 4e-10, le-9, 2e-9, 4e-9, ‘Data type, , le-8, 2e-8, 4e-8, le-7, 2e-7, 4e-7, le-6, 2e-6, 4e-6, le-5, 2e-5, ‘Filename (En) 8, 4e-5, le-4, 2e-4, 4e-4, le-3, 2e-3, 4e-3, le-2, 2e-2, 4e-2, le-1, ‘Generate, , 2e-l); ( s. ) ,Number of Points, , TEK_VPERDIV_NIN = 1 ; ‘Number of points, goal, , TEK-VPERDIV_NAX = 13, ‘Number of scans 0, TEK-VPERDIV : array [TEK_VPERDIV_NIN TEK_VPERDIV_FLAX] of real = ‘Number of scans, goal, , (le-3, 2e-3, 5e-3, le-2, 2e-2, 5e-2, le-1, 2.2-1, 5e-1, 1, 2, 5, ‘Show (sh ),, 10); ( Vldxv, ) ‘Sk>p (skip) , USEFJ4AXDT array [1 dt_NAK] of integer = (USEFJ41N + 8, ,Tlme per Point, , USERNIN + 15, USERM1N + 2, USERMIN + 6 ); ( Max user parameters for v stop, , each dt. ) Y off set,, ~-sh-CM = 1, ( Ccmment ) Y scale, ), wv-sh-OLY = 2, ( Delay (dt-ELE only) ) PARLABELOT array [DT-MIN DT.NAX, USERNIN USEP.MAXI of string = wv-sh_FN = 3, ( Fllena!ne ) [( ‘A/D channel wv-sh_f4A.X = 3, ‘Shots per point W-S h-NANE array(l ~-sh-~1 Of string 131 = (’cm’, ‘ally’. ‘fn’1, ( Names of wv_sh t-s for user interaction. ) end; XVNITTYPE : array [dt_MXN . dt_MAX, XAXISMODEWIN .. XAXISMODSNAX end; 1; ] of string= ((”, “m’, ‘s’), (“, ‘s’, ‘eV’), (“j ‘s’l ‘s’), dt-POW : (,, , ,s, , ,Da, )); ( pow : record type ch : integer; data_type = array [1 . MAXPOINTS] of real; Cal : record par-type = record int : real; ( All datatypes. ) 51 : real; alert : integer; ( Flag to let user start new scan manually. ) end; comment : bufstring; end; ); ( dt: see case statement below. ) dt_MAS : fn : bufstring; ( mm : record gen : integer; ( Flag to generate new wave when scans completed. ) Cal : record pt : integer; ( Number of points in wave so far. ) int : real; pt_gl : integer; ( Goal ngmber of points (for cor, pow scans) -- S1 : real; scanning stops when pt reaches this number. ) end; scan : integer; ( Number of completed scans. ) ch : integer; scan_gl : integer; ( Goal number of scans -- scannin9 stoPs when delay : real; scan reaches this number. ) inv : integer; sh : integer; ( Show code: indicates which variable is displayed in scantime : real; waveinf o box (wv_sb_PN: filename; wv_sh_DLY: delay (electron scan vert : real; only); wv_sh@M: connnent ). ) end; )J skiD : integer; ( Number of cycles to skip between reads. ) end; tim~perpt :-real; par_type_ptr . “par-type; vstOD : real; ( Alternate way of ending scan: when vmax exceeds wave-type E record Vsiop . ) CO1 : word: [ Wave color. ) yoffset : real; data : datitype; ( Data fir waves. ) yscale : real; datasaved : integer; ( Flag indicating whether data information has been ( Variable part. ) saved. ) case dt : integer of lines : integer; ( Flag indicating lines (1) or dots (O) are displayed. ) dt_COR : massl : real; { Storage of first mass point during mass calibration; ( cor : record also a flag (= O) that first mass point bas not been entered yet. ) ch : integer; on : integer; ( Flag to display (1) wave or not (0) . ) shotsperpt : integer; par : par-type; ( Parameters visible to user; see par_t~e. ) ts : record DarSaved : integer; ( Plag indicating if par variables have been wob : ts-wob_type; changed. ) - start : real; pmin : integer; ( Minimum physically meaningfu} point when x axis units step : real: are energy or mass. ) stop : real; savemode : integer; ( Indicates whether saved data is multiplied by par. to : real; yscale or not. ) end; screen : integer; ( Screen wave displays on. ) end; ); scan : record ( Variables needed during a scm. ) dt-ELS : accum : real; ( Accumulator for A/D data (COR & POW) . ) ( ele : record cycle : integer; ( Cycles so far (use with par. skip) . ) bs : record ( Background subtraction variables. ) mode : integer; ( Flag indicating status of scan: O . not scanning; last : real: ( Last scan’s kg counts -- for redo command. 1 1 or more: internal codes depending on dt. See ScanCheck mode : integer; ( Snable/disable flag. ) for details. ) tot : real; { Total kg counts. ) ( nurn : integer; ( Number of scans so far. ) end; ( pt : integer; ( Point number (for dt_COR & dt_POW scans) . ) cal : record ( Energy calibration parameters. ) shots : integer; ( Number of shots so far. ) ev : real; starttime : longint; ( Time (in 1/100 see) of most recent scan number len : real; (dt_ELE, dt_MASS) or point (dt_COR, dt-POW). ) to : real; steptime : longint; ( Time to wait between scans or shots, depending quad : real; on dt (see starttime) . ) quadoff : real: end: end: sel : inte9er; ( Flag indicating selection. ) dly : real; ( ~-probe delay. ) tw : array [1 .. MAXPOINTS] of integer; ( Data from last read -- for reprate : real; background subtraction. ) shotsperscan : iXIte9er; timel : reab ( Storage of 1st time point during mass calibration. ) ts : record vmin : real; ( V value (converted intensity) of smallest point in wave; wob : ts-wob_tYP= : this depends on xaxisrnode (recalculated whenever xaxismode changed) . ) POS : real; vmax : real: ( V value of largest point in wave. See ymin. ) to : real; end; Var s : SearchRec; pardf : array[ 1 dt_MAK] of par_type; ( Default par begin values. ) FindFirst(FILES, ATrRIB, s): w : record ( Waves ) while true do cur : inte9er: ( Current wave. ) beg in 1s : array[ 1 MAKWAVESI of “wave_ type; ( Wave list. ) for i :. 1 to fWJf.fLINESdo num : integer: ( Number of waves loaded. ) begin sel : integer: ( Flag If any waves selected by get_wv. ) if D&sError > 0 then temp : array [1 t4AKP01NTS] of real; ( Sxtra wave for general exit; use (sin, etc.). ) dir_entry(s) ; end; findnext (s) ; end; implementation write( ‘Press any key to continue. ,); case readkey of end. CTRLC : ( Get out. ) begin writeln; exit; 4.8. dosshell pas end; EXTENDED : readkey; end; unit DQSShell; ( Blank out message. ) gotoxy(l, wherey): ( Set of routines designed to simulate 00S commands from within a Pascal write (copy (BLANK, 1, 79)); program. Should be compatible with any program. ) gotoxy(l, wherey) ; end; interface end;

uses procedure dir_entry(s : SearchRec) ; crt, dos, KEYS; ( Print directory entry. ) var a procedure ShellToD3S; ( Main SOUtine. ] dt : DateTime: 52 : string; implementation begin write (s,name, COPY (BLANK, 1, 16 - length (s.namel) ):

const if s.attr and DIRECTORY > 0 then BLANK = $ writeln( ,.DIR>,) ,: else ( 80 chars. ) beg in ERROR = ‘DOS Error. e + BELL: str(s, size, 62); write (s2, copy(BLANK, 1, 12 - length)); procedure cd(s : string): UnpackTime(s. time, dt) : ( Change directory to s.) with dt do begin begin while s[l] = , , do ( Skip spaces. ) str (month + 100, s2); s := CODY(S, 2, length(s)); write (c0py(s2, 2, 2), ,-, ); ($1-) ( ~~n off error checking ) strlday + 100, s2): ChD1r (s) ; write (c0py(s2, 2, 2), ,-, ); ($1+) ( Turn back on. ) write (year, , ‘); if IoResult .> 0 then str (hour + 100, s2); write ln (ERROR) ; write (c0py(s2, 2, 2), ,:, ); end; strlmin + 100, s21; write (copy (s2, 2, 2), ,:, ); procedure dlr_entry(s SearchRec), forward: str(sec + 100, s2): write ln(c0py(s2, 2, 2)); procedure dir, end; ( Pr%nt current directory contents ) end; const end; FILES = ,. .,, AT3’RIB = ANYFILE, ...... ~~N ~o~~NE...... ) NW4L1NES = 23. procedure ShellToDOS; var Var ; nteger, s string, CTRLU = 121; begin CTRLV = #22; writeln (‘Stripped-down EOS shell. Not all DOS commands supported! ,); CTRLW = #23; writeln( ,Type EXIT to return to program. ‘); CTRLX n #24; while true do CTRLY = #25; begin CTRLZ = ;26; getdir(O, s); write (’SHELL , + s + ,>, ); ( Extended keys: ) readln(s) ; XALTA = #30; if (length(a) > 1) and (s[2] = ‘:’) then ( Change drive. ) ~T2 = #48; cd(s) mm = #46; else if COPY(S, 1, 2) = ‘cd’ then ( Change directory. ) x3&T0 = #32; cd(copy(s, 3, length(s))) XALTE = #18; else if s . ~dir’ then ( Print contents of current directory. ) XALTF = #33; dir xAL1-G . #34; else if s = ‘exit’ then XALTH . #35; exit XALTI . #23; else if s c> ‘‘ then XALTJ = #36; writeln (ERROR) ; XALTX = *37; end; Wm = #38; end; XALm = *50; XALTW = +49; end. =~ a #24; XALTP = #25;

wTQ ❑ S16; XALTR = 119; 4.9. keys pas XALTS = #31; xALTr . *20; XAL’3W . *22; unit keys; XA3JrV = *47; XALlw . #17; interface XALTX = #45; XALTY . +21; cons t xAL1-2 = *44: ( Normal keys: ) XALT1 = #120; ACK . #23; ( Service request acknowledge. ) XALT2 = #121; BELL = #7; ( Bell. ) XALT3 = !122; BS = 68; ( Backspace. ) - XALT4 = #123; ESC = #27; ( Escape. ) XALT5 = *124; EXTENDED - #O; ( Sxtended key (see below). ) XALT6 = #125; LF = 010; ( Linefeed. ) XALT7 = :126; CR = !?13; ( Carriage return. ) SALTS = #127; I-I TAB = #9; ( Tab. ) XALT9 = #128; CTRLA = 91; XALTO = #129; C~B = S2; XALTNIWUS = *13 O ; CTRLC = #3; XALTPLUS = S131 ; CTRLD = #4; XARROWDDWN m :80; CTRLE - #5; XARROWLEPT = S75; CTRLF = S6; XARROWRIGXT = #77; CTRLG = #7; XARROWOP = 872; CTRLX = 08; XCTRLARROWLEFT = +115; CTRLI = #9; XCTRLARROWRIGST = #116; CTRLJ = *1O; XCTRLSWO = #l17; CTRLK = S11; x~~OME = S119; CTRLL = *12; XCTRLPAGESOWTJ = #118; CTRLW . *13; XCTRLPAGSUP = *132; CTRLN = #14: XDELSTE = S83 ; CTRLO = *15; XSWD = *79; CTRLP = S16; XF1 = #59: CTRLQ = +17; XF2 = #60; CTRLR = #18; XF3 = *61; CTRLs = #19; XF4 = t62; CTRLT = +20; XF5 = *63; XF6 = #64: SPOLL = $400; 1. Board has been serially polled . ) xFI = #65; EVSNT = $200: (. MI event has occured .1 XF8 = 866: CMPL = $100: (. 1/0 completed .) XF9 = #67; LCIK = $80; (. Local lockout state “) xF1O = *68: RSM = $40; (” Remote state “) XF1l = *133; CIC = $20; (. controller-in-Charge “) XF12 = 9134; Al?4 = $10; (. Attention asserted .)

XHOME = #71; TACS = $8: (● Talker active “) XINSERT = *82; LAcs = $4; [. Listener active “1 XPAGECOWN = *81: DTAS = S2; (e Device trigger State ‘) xPAGEVP = 873 ; CCAS = $1; (- Device clear state “) XSHIPTF1 = #84; XSH1FTF2 = *85: (● Error messages returned in global variable IBERR: ‘) XSHIFTP3 = #86; XSHIFTF4 = $87; EDVR = O; (‘ mS error “) XSHIFTF5 = 888; ECIC = 1; (” Function requires GPIB board to be CIC XSHIFTF6 = 889; “) XSHIFTF7 = 490; ENOL = 2; (. Write function detected no Listeners ,.!. XSHIFTF13 = #91; “) XSHIFTF9 = $92: F.RDR = 3; (” Interface board not addressed correctly “ ) xSHIFTF1O = /93; ERRG = 4: “) .’ (” Invalid argument to function call

,., ; ESAC = 5; (. Function requires GPIB beard to be SAC ,.. , implementation “) .< EAEo = 6: (. 1/0 operation aborted

.,: ~ end, “) ,,, EWEB = 7; (● Non-existent interface board . ‘) EOIP . 10; (. 1/0 operation started before previous 4.10. tpdecl. pas ‘) (. operation completed ‘) . {...... ‘Turbo Pascal Declarations .+.., ., ..***...... ) ECAP . 11; (. No capability for intended operation unxt tpdecl; “) EFSO = 12; (. File system operation error ($1 tpib) ‘) EBUS . 14; (” Command error during device call Interface ‘) Const ESTB = 15; (” Serial Poll status byte lost ‘)

(” GPIB commands: “) ESRQ = 16; (● SRQ remains asserted “) STAB = 20: (* The return buffer is full ‘) UNL = $3f; (. GPIB unlisten command ‘) ELCK = 21; UNT = $Sf; (. GPIB untalk command “) GTL = $01; (. GPIB go to local ●) (. SOS mode bits: ‘1 Ssc = $04; (‘ GPIB selected dev~ce clear ‘) PPC = S05; (’ GPIB Parallel Poll configure “) BIN = $1000; (“ Eight bit compare ‘) GET = $08; (” GPIB 9roup execute trigger “1 XEOS = $800; (“ Send EO1 with EOS byte “) TCT = $09; (” GPIB take control ‘) REOS = $400; [* Terminate read on EOS “1 LLO = $11; (- GPIB local lock out ‘)

DCL = $14, (, GPIB device clear ‘) (” Timeout values and mean Mw.s: “} PPU = $15; (‘ GPIB Parallel poll unconf igure ‘) SPS = $18; (. GPIB serial Poll enable “) TNONE = o; (“ ‘1 SPD = $19; (“ GPIB serial Poll disable “) TIOUS = 1; (’ :Xly:”:;%$ied) ‘) PPE = s60: (“ GPIB parallel poll enable “) T3 OUS = 2, (’ ‘) PPO . slot (’ GPIB parallel Poll disable “) TIOOUS = 3; (’ Timeout of 100 us (ideal) ‘) T300us = 4; (“ Timeout of 300 us (ideal) ‘) I. GPIB status blt vector Tlnw = 5; (“ Timeout of 1 ms (ideal) ‘) T3 IIIS = 6; (“ Timeout of 3 ms (ideal) ‘) ERR = $8000, I. Error detected ‘) T1 Oms . 7, (“ Timeout of 10 ms (ideal) ‘) TIMO = S4000, (, Timeout ‘) T3 Oms = 8; (’ Timeout of 30 ms IIdeal) .) EEND = S2000, [, EOI or EOS detected ‘) TIOOms = 9: (“ Timeout of 100 ms (Ldeal) .) SRQI = $1000, (. SRQ detected by CIC “) T300ms = 10, (. Timeout of 300 ms (ideal) .) RQS = S800, 1. Device needs service .) Tls = 11, (, Timeout of 1 s (Ldeal) .) T3 S . 12; (’ Timeout of 3 s (ideal) ‘) IbcPPollTime= $0019; (● Set the parallel Poll length period. ●) TIOS . 13; (* Timeout of 10 s (ideal ) “) IbcNoEndSitOnEOS= $OOIA; (● Remove EOS from END bit of IBSTA. ‘) % T30s . 14; (’ Timeout of 30 s (ideal) ‘) IbcUnAddr= $OOIB; (* Enable/disable device unaddressing. ‘) a TIOOS = 15; (’ Timeout of 100 s (ideal) ‘) T300s = 16; (*”Timeout of 300 s (ideal) “) (● Constants that can be used (in addition to the ibconf ig constants ) ‘) TIOOO8 . 17; (● Timeout of 1000 s (maximum] “) (” when calling the IBASK function. ‘)

(● IBEVENT Constants ‘) IbaPAD . $0001; (● Primary Address ‘) IbaSAD = $0002; (” Secondary Address “) SventIWAS = 1; IbaTMO = $0003; (● Timeout Value “) EventDCAS = 2; IbaEOT = $0004; (* Send EOI with last data byte? “1 IbaPPC = $0005; (• Parallel Poll Configure ●) (9 Miscellaneous: “) IbaRSADOR = $0006; (● Repeat Addressing ‘) IbBAUTOPOLL = $0007; (• Disable Auto Serial Polling “) S = $08; (* Parallel Poll sense bit “) IbaCICPROT = $0008; 1’ Use the CIC Protocol? “) LF = $OA; (• ASCII linef eed character ‘) IbaIRQ = $0009; (* Use PIo for 1/0 ‘) IbaSC = $OOOA; (• Board is System Controller. “) NO-SAD = O; (● test only the pad ‘) IbaSRE = $OOOB; (* Assert SRE on device calls? ●) ALL-SAD = -1; (• test all secondary addreases of pad ●) IbaEOSrd = $Oooc; (● Terminate reads on EOS. “) IbaSOSwrt = $OOOD; (● Send EOI with EOS character. “)

(● Values for the 488.2 Send comne.nd ●I IbaEOScnQ = $OOOE; (● Use 7 or 8-bit EOS compare. “) IbaEOSchar U $OOOP; (● The EOS character. “) NULLend E 00; (‘ do nothing at the end of a transfer ●) IbaPP2 = $0010; (● Use Parallel Poll Mode 2. ‘) NLend = 01; (‘ send NL with EOI after a transfer ‘) IbaTIMING = $0011; (• NORMAL, HIGH, or VERY_HIGH timing. “) DASend . 02; (* send EOI with the last DAB “) IbaDMA = $0012; (* Use DMA for 1/0. “) IbaReadAdjust = $0013; (• Swap bytes during an ibrd. ●) (g This value is used by the 488.2 Receive command. ●) IbaWriteAdjust = $0014; (• Swap bytes during an ibwrt. ●) IbaSventQueue . $0015; (● Enable/disable tbe event queue. “) STOPend = $0100; (g stop the read on EOI “) IbaSPollBit = $0016; (• Snable/disable the visibility of SPOLL. ‘) IbaSendLLO = $0017; (• Snable/disable the sending of L&O. “) IbaSPollTime = $0018; (● Set the timeout value for serial Polls. “) (* This value is used toterminate a 488.2 address list. It should be ●) IbaPPol lTime = $0019; (9 Set the parallel poll length period “) (* assigned to the pad field of the last entry. “) IbaNoSndBitOnEos = $OOIA; (● Remove EOS from 2ND bit of IBSTA. “) IbaUnAddr = $OOIB; (● Enable/disable device unaddressing. “) # NOAODR = -1; IbaSNA = $0200; (● A device’s access board. “) IbaBaBeAddr = $0201; (* A GPIB board’s base 1/0 address. ●) w (• The following constants are used for the second parameter of the ‘) IbaDnmChannel = $0202; (“ A GPIB baard’s DMA channel. “) ● (● ibconf ig function. They are the .option- selection codes. ) IbaIrqLevel = $0203; (“ A GPIB board’s IRQ level. ‘) 8 IbaBaud = $0204; (● Baud rate used to couanunicate to CT box. “) IbcPAO= $0001; (• Primary Address ‘) IbaParity = $0205; (* Parity setting for CT box. ‘) Ib4AD= $0002 ; (• Secondary Address “) IbaStopBits = $0206; (● Stop bits uBed for communicating to CT. ●) E w Ibel140= $0003 ; (• Timeout Value “) IbaDataBits = $0207; (● Data bits used for communicating to CT. ‘) IbcEOT= $0004; (• Send EOI with last data byte? ●) IbaComPort = $0208; (● SyBtem COM port used for CT box. ‘) IbcPPC= $0005; (* Parallel Poll Configure ●) IbaComIrqLevel . $0209; (● System COM port’s interrupt level. ‘) IbcRSAODR= $0006; (9 Repeat Addressing “) IbaComPortBase = $020A; (* System COM port, s base 1/0 address. “) IbcAUTOPOLL= .$0007; (9 Disable Auto Serial Polling “) IbcCICPROT= $0008: (● Use the CIC Protocol? ‘) (” The following values are used by the iblines function. The integer “ ) IbcIRQa $0009; (* Use PIO for 1/0 “) (* returned by iblines contains: “) IbcSC= $OOOA; (● Board is System Controller. “) (’ The lower byte will contain a ‘monitor- bit mask. If a bit “) IbcSRE= $OOOB; (* AsseXt SSS on device calls? ‘) (“ is set (1 ) in thiB mask, then the corresponding line “) IiwWSrd= $Oooc; (9 Terminate reads on EOS. ‘) (“ can be monitored by the driver. If the bit is clear (0) , ●) IbcEOSwrt = $OOOD; (” Send EOI with S0S character. “) (’ then the line cannot be monitored. ‘) IbcEOScw= $oOOE; (● Use 7 or 8-bit S0S coware. “) (’ The upper byte will contain the status of the bus lines. “) IbcEOSchar= $OOOP; (● The EOS character. “) (“ Each bit corresponds to a certain bus line, and has ●) IbcPP2 = $0010; (g Use Parallel Poll Mode 2. “) (’ a corresponding ‘monitor- bit in the lower byte. “) IbcTIMING= $0011; (‘ NOPJ4AL, HIGH, or VERY_HIGH timing. “) IbcDUA= $0012; (* Use DNA for 1/0. “) ValidSOI = $0080; IbcReadAdjust= $0013; (• SWaP bytes during an ibrd. ‘) ValidAITi = $0040; IbcWriteAdjust= $0014; (• swap bytes during an ibwrt. ‘) ValidSRQ = $0020; IbcSventQueue. $0015; (. Snable/disable the event queue. ●) ValidREN = $0010; IbcSPollBit. $0016; (* Enable/disable the visibility of SIX3LL. “) ValidIPC = $0008; IbcSendLLO= $0017; (● Enable/disable the sending of LI.0. “1 ValidNRFL3 = $0004; IbcSPollTime= $0018; (● Set the timeout value for serial polls. ‘1 ValidNDAC . $0002; ValidDAV = $0001. functaon ibfmd (var bdname) integer, BUSEO1 = S8000; procedure ibgts (bd: integer; v: nte9er ) BusA’I?i = $4000; procedure ibist (bd: integer; v: integer) : BUSSRQ = S2000: procedure iblines (bd: integer; var lxnes: lntegerl : BusREN = S1OOO: procedure ibln [bd: integer; pad: integer; sad: integer; BusIFC = $0800; var listen: integer) : BusNRFD . $0400: procedure ibloc [bd: integer) ; BusNDAC = $0200; procedure ibnil; BusDAV = $0100; procedure itinl (bd: integer: v: integer) : procedure i~ad (bd: integer: v: integer) ; (...... procedure ibpct (bd: integer) ; procedure ibpoke (bd: integer; option: integer; v: integer) ; nbufsize = 7: (● Length of boardldevxce names -- hard-coded in TPIB - ) procedure ibppc (td: integer; v: integer) ; flbufsize = 50: (‘ A generous length for filenames -- the procedure ibrd (bd: integer: var rd: cnt: longInt ); minimum allowed by the handler is 32, procedure ibrda (bd: integer; var rd: cnt: long Int ); ,,, 50 is hard-coded in TPIB . ) procedure ibrdf (bd: integer; var fhmme) ; .. bufsize = 255; (● Length of readlwrite buffer , ) procedure ibrpp (bd: integer; var ppr: integer) ; (...... procedure ibrsc (bd: integer: v: integer) ; procedure ibrsp (bd: integer: var spr: integer) ; Type cbuf E packed array [l. .2551 of char; (. character buffer “) procedure ibrsv (bd: integer: v: integer) : nbu f . packed array[ 1. .7] of char; I” boardldevice name “) procedure ibsad (bd: integer: v: integer) : flbuf = packed arrayll. .501 of char; (* file name “) procedure ibsic (bd: integer) ; AddrList = array [O. .2551 of inte9er: (. 488.2 address list ‘) procedure ibsre (bd: integer; v: integer) ; srqproc = “long Int; (. srq procedure ‘) procedure ibsrq (sxqfunc: srqproc) ; procedure ibstop (bd: integer) ; (...... procedure ibtmo (bd: integer; v: integer) ; i procedure ibtrap (mask: word; v: integer) ; var ~bsta : integer; (g status word procedure ibtrg (Ixl:integer) ; “) procedure ibwait (M: integer; mask: word) ; var iberr : integer; (, GPIB error code procedure ibwrt (txi:integer; var wrt; cnt: 10ng Int) ; “) procedure ibwrta (bd: integer; var wrt; cnt: 10ng Int ) ; “ var ibcnt : inte9er: (‘ number of bytes sent or 00S error procedure ibwrtf (bd: integer: var flname) : ‘) procedure ibxtrc (bd: integer; var rd; cnt: integer) ; var ~bcntl: longlnt; (” number of bytes sent or DOS error procedure ibwrtkey (bd: integer: var wrt: cnt: long Int ): “) procedure ibrdkey (bd: integer: var rd; cnt: long Int I;

(“’’”””””””’’”’”’’’”’” “’’’”””””””’”””’’’’’”” .****...... *...... **.. ) (“”””””””’””””””””’””* The 488.2 entry points ...+.. - ...... ) (. The following variables may be used directly in your application program. ‘ I Var procedure SendCmds (boardID: integer; var buf; cnt: longlnt ); bname : nbuf; (● board name buffer procedure SendSetup (boardID: integer; var llsten:AddrList) : ‘) procedure SendDataBytes (boardID: integer; var buf; cnt: longlnt; bdname : nbuf; (● board or device name buf ter eot_mode: integer) : “) procedure Send (boardID: integer: listener: integer; flname : flbuf: (“ filename buffer “) var databuf; datacnt: long Int; wrt : cbuf; (’ write buffer “) eot_mode: integer) ; rd : cbuf; (“ read buffer ‘) procedure SendList (boardID: integer; var listeners :AddrList: var databuf; datacnt:long Int; (, The GPIB board funCtiOnS declared public by TPIB. OBJ: ‘) eot_mode: integer) ; procedure ReceiveSetup (boardID: integer; talker: &nteger) , procedure ibask (bd: integer: option: integer; var retval. integer) ; procedure RcvRespMsg (boardID: integer; var buf, cnt: long Int; procedure ibbna (bd: integer; var bname) ; eot_mode: xnteger) : procedure lbcac (bd: integer; v: integer) ; procedure Receive (boardID: integer; talker integer, var buf; procedure ibclr (bd: integer) ; cnt:long Int, eot_mode: integer) , procedure ibcmd (bd:lnteger, var cmd; cnc:long Int) ; procedure SendIFC (boardID: xnteger) ; procedure ibcmda (bd: integer, var cmd; cnt:longlnt) , procedure DevClear (boardID: integer; laddr integer ) ; procedure ibconflg (bd: integer; option: integer; v: integer) procedure DevClearL1st (boardID: integer; var laddrs:Addr List) , procedure >bdiag (bd Integer, var rd; cnt :long Int) ; procedure EnableLocal (boardID, Integer; var Iaddrs: AddrL1st ), functxon ibdev (boardID, Lnteger, pad integer; sad integer, tmo: integer; procedure EnableRemote (boardID: integer; var laddrs: AddrLlst ), eot integer, eos, Integer) .lnteger, procedure SetRWLS (boardID: integer; var laddrs AddrLlst) , procedure Ibdma (bd Integer, v nteger) , procedure SendLLO (board ID Lnteger) , procedure Lbeos (bd integer, v integer) , procedure PassControl (board ID Integer, talker lncegerl , procedure lbeot (bd integer, v integer) , procedure ReadStat”sByte (boardID integer, talker Integer, PI ocedure Lbevent (M Lntege, var event nceger) , var result integer) procedure Trigger (boardID: integer; laddr: integer) ; procedure ibsre (bd: integer; v: integer) ; external; procedure TriggerList (boardID: integer; var laddrs :AddrList) ; procedure ibxcq (srqfunc:srqproc); external; procedure PPollConf ig (boardID: integer; laddr: integer; data line: integer; procedure ibstop lbd: integer) ; external; line sense: integer) ; procedure ibtmo (bd: integer; v: integer); external; procedure PPollUnconf ig (boardID: integer; var laddrs: AddrList ); procedure ibtrap (mask: word; v: integer) ; external; procedure PPO1l (boardID: integer; var res-ptr: integer) ; procedure ibtrg (bd: integer); external; procedure ResetSys (boardID: integer; var laddrs: AddrList ); procedure ibwait (bd: integer; nmsk:word) ; external; procedore PindRQS (boardID: integer; var taddrs: AddrList; procedure ibwrt (bd: integer; var wrt; cnt: 10n91nt ); external; var dev_stat: integer) ; procedure ibwrta (bd: integer; var wrt; cnt: longInt ); external; procedure A1lSPO1l (boardID: integer; var taddrs :AddrList; procedure ibwrt f (M: integer; var flname ); external; var res:AddrList) ; procedure ibxtrc (bd: integer; var rd; cnt: integer) ; external; procedure FindLstn (boardID: integer; var pads :AddrList; procedure ibwrtkey (bd: integer; var wrt; cnt: longInt ); external; var result :AddrList; limit: integer) ; procedure ibrdkey (bd: integer; var rd; cnt: longInt ); external; procedure TestSys (boardID: integer; var addrs :AddrList; var result :AddrList ); (“’””’”’’’”’’’””’’””’”” The 488.2 entry points ●***********************) procedure TestSRQ (boardID: integer; var result: integer) ; procedure WaitSRQ (boardID: integer; var result: integer); procedure SendCmds (boardID: integer; var buf; cnt: longInt ); external; procedure SendSetup (baardID: integer; var listen: AddrList ); external; procedure SendDataBytes (boardID: integer; var buf; cnt: longInt; IMPLENFNTATION eot_mode: integer] ; external; procedure Send (boardID: integer; listener: integer; var var databuf; datacnt: longInt; Our_lcv: integer; (• local 100P control variable ‘) eot_mode: integer) ; external; SendList (boardID: integer; var listeners: AddrList; var databuf; datacnt: longInt; (• The GPIB board functions declared public by TPIB. OBJ: “) eot_mode: integer) ; external; Receive Setup (boardID: integer; talker: integer) ; external; Drocedure ibaBk (lxl:integer; option: integer; Var XetVal: integer); external; procedure RCVReBpMS9 (beardID: integer; var buf; cnt: longInt; procedure ibbna (Ixl:integer; var bnarne); external; eot_mode: integer) ; external; procedure ibcac (bd: integer; v: integer) ; external; procedure Receive [boardID: integer; talker: integer; var buf; procedure ibclr (kd: integer) ; external; cnt: longInt; eot_rnode: integer) ; external; procedure ibcmd (bd: integer; var cd; cnt: longInt ); external; procedure SendIPC (boardID: integer); external; procedure ibcmda (bd: integer; var cnul: cnt: longInt ); external; procedure DevClear (boardID: integer; laddr: integer) ; external; procedure ibconf ig (bd: integer; option: integer; v: integer) ; external; procedure DevClearList (boardID: integer; var laddrs: AddrList ); external; procedure ibdiag (M: integer; var rd; cnt: longInt ); external; procedure SnableLocal (boardID: integer; var laddrs: AddrList ); external; function ibdev (boardID: integer; pad: integer; sad: integer; tmo: integer; procedure EnableRemote (beardID: integer; var laddrs: AddrList ); external; . eot: integer; eos: integer] :integer; external; procedure SetRWLS (beardID: integer; var laddrs: AddrList ); external; procedure ibdm (M: integer; v: integer) ; external; procedure SendLLO (boardID: integer) ; external; procedure ibeoB (bd: integer; v: integer) ; external; procedure PassControl (boardID: integer; talker: integer) ; external; procedure ibeot (kd: integer; v: integer) ; external; procedure ReadStatusByte (boardIO: integer; talker: integer; procedure ibevent (bd: integer; var event: integer) ; external; var result: integer) ; external; function ibf ind (var bdname) :integer; external; procedure Trigger (boardID: integer; laddr: integer) ; external; procedure ibgts (bd: integer; v: integer); external; procedure TriggerList (boardID: integer; var laddrs :AddrList ); external; procedure ibi~t (bd: integer; v: integer); external; PPollConf ig (beardID: integer; laddr: integer; data line: integer; procedure iblines (bd: integer; var lines: integer); external; line sense: integer); external; procedure ibln OXI: integer; pad: integer; sad: integer; procedure PPollUnconf ig (boardID: integer; var laddrs :AddrList ); external; var listen: integer) ; external: procedure PPO1l (beardID: integer; var xes_ptr: integer) ; external; procedure ibloc (bd: integer) ; external; procedure ResetSys (boardID: integer; var laddr.s:AddrList ); external; procedure ibnil; external; procedure FindRQS (boardID: integer; var taddrs :AddrList: procedure ibonl (bd: integer; v: integer) ; external; var dev_stat: integer) ; external; procedure ibpad (bd: integer; v: integer) ; external: procedure A1lSPO1l (boardID: integer; var taddrs :AddrList; procedure ibpct (bd: integer); external; var res: AddrList ); external; procedure ibpoke (bd: integer; option: integer; v: integer) : external; procedure FindLstn (boardID: integer; var pads: AddrList; procedure ibppc (M: integer; v: integer) : external: var result: AddrList; limit: integer) ; external; procedure ibrd (k-i:integer; var rd; cnt: longInt ): external; procedure TestSys (beardID: integer; var addrs: AddrList; procedure ibrda (kd: integer: var rd; cnt: longInt ); external: var result :AddrList ); external; procedure ibrdf (kd: integer; var flname) ; external; procedure TestSRQ lbeardID: integer; var result: integer) ; external; procedure ibrpp (kd: integer: var Ppr: integer); external; procedure WaitSRQ (boardID: integer; var result: integer); external; procedure ibrsc (bd: integer; v: integer); external; procedure ibrsp (bd: integer; var spr: integer) ; external: procedure ibrsv (bd: integer; v: integer); external: begin procedure ibsad (lxf:integer; v: integer) ; external; procedure ibsic (bd: integer) : external; ibsta: =0; (” initialize global status variables ● ) .. .. ,, :-

!! :’ -~ .,,, ; :1,

-0

M Id Q

...... -,...... ---- .... ;.2 ,;.,. . ..--.7 “.-.?‘“ , :?3<.5‘: ‘7- : .,. .‘??.. 400

Appendix 2. Femtosecond photoelectron spec- -. trum simulation program (alpine, trans)

The alpine and trans programs are designed to simulate a femtosecond pho-

toelectron spectrum at different pump-probe time delays. The alpine program (named for the similarity of a wavepacket propagating on a potential energy surface to a skier on

an alpine slope) is the main engine, propagating wavepackets and calculating overlap in-

tegrals. trans (named for Fourier transform, the primary operation performed) simply

takes the output from alpine and generates photoelectron spectra at different time de-

lays. Because of the way the simulation works, alpine need only be run once for each

pair of potential surfaces coupled by the probe pulse, and spectra can be obtained at any

time delay needed using trans. The dimensionality of the potentials is also irrelevant to

t rans, so that a 2- or higher-dimensional simulation (using an improved version of al – pine) can be used to generate photoelectron spectra without modification to trans.

1. Theoretical background

Simulations of photoelectron spectra employ a method first described in 1996.1

Although the general approach is the same, significant improvements in the efficiency of

the calculation have been achieved since that time, which were discussed briefly in Ref.

2. These improvements will be covered in more detail at the end of this section.

Three potential surfaces are needed for the simulation: the anion ground state,

anion excited state, and neutral state. In practice, to obtain an accurate photoelectron

spectrum, several neutral states must be included, running a separate propagation for each

one, and summing the results using appropriate cross sections.q The propagation method Appendix 2 401 is based on Kosloff,4’S using a program framework modified from Bradforth.b Wave-

functions are represented on an evenly-spaced grid spanning the interesting portions of all

three potential energy surfaces, and consisting of a number of points equal to a power of

2 (for compatibility with the fast Fourier transform algorithm). Propagation of wavefunc-

tions is carried out using second-order differencing, with a Fourier transform method of

evaluating the kinetic energy term of the Hamiltonian. Details of this scheme may be

found in Bradforth.

The pump pulse couples the anion ground and excited states. Generally, the probe

pulse couples the anion excited state with the neutral state; however, it is also possible to

couple the anion ground state with the neutral state, which is sometimes necessary to

consider since the ground state can be perturbed by a strong pump pulse excitation.T’8

This occurs when a significant population is transferred by the pump pulse to the excited

state. The resulting ground state depletion creates a nonstationary wavepacket there,

causing deviations from the linear approximation to the calculated excited state

wavepacket, as well as creating dynamics on the ground state which have been observed

in the FPES spectra, since the probe pulse has sufficient energy to detach electrons from

the ground state of 12-.These are illustrated, for instance, in Zanni et al.g.

-,- -. -- L.-.-– - .– –– .....–s ---- :— L---- -L-—- mv-- —..—— —..1-- ._.. —l -- ..L- -—:-— 111(3prOpZi&itIOIISZiH5CaITleU(IU1IIILWLISl~pS.1IICPUIIIPPUISC (XJUPICSUlfSZU11OI1

ground (“A”) and excited (“B”) states only, so a Hamiltonian representing this interaction

is used to propagate wavepackets on these two surfaces simultaneous y:

HA ‘~ABE;u@) H= (1) [ ‘~ABEpU (t) ‘B )

(2)

. , .,..— ... , “ ..- , ,,, ,.<...... ,---- - ,,.. .:. 402 Appendix 2 Here HA= TA + VA and HB = TB+ VBare the diagonal Hamiltonians of the ground and I excited states; pm is the transition dipole moment; EPU(t)= EPUsech [)—f:,.e‘apt is the electric field of the pump pulse with maximum amplitude EPU,full width at half- maximum (FWHM) zPU,proportionality factor~= ~ sech-* W = 0.5673, and central fre- quency ~.; !~A> and IYB> are the ground and excited state wavefunctions. Note that the ground state wavefunction must be propagated because the pump pulse can easily transfer a significant population to the excited state (as confirmed experimentally in our spectra), thus prohibiting the use of a perturbative treatment, i.e. assuming h#A> does not change.

Including this extra step is only slightly more demanding numerically, however, because the majority of the calculational effort is spent propagating on the neutral surface, as de- scribed next.

This establishes the formation and evolution of the anion excited state. Generating a photoelectron spectrum involves the interaction of the probe pulse with a nonstationary wavepacket, which is unlike conventional photoelectron spectroscopy where the starting wavepacket is assumed to be in an eigenstate. Therefore, integration over the probe pulse duration must be performed again. Since, in general, the probe pulse is much weaker

(-1/10) than the pump, first-order perturbation theory can be used to describe the process.

Recognizing that the energy of the probe photon hvz is divided between the energy of the neutral (“C”) molecule I?c and the detached photoelectron kinetic energy 8, the total en- ergy of the system E: maybe written as:

E~=EB+hvz=Ec+&. (3) Appendix 2 403 where EB is the energy on surface B. Within this framework, the neutral wavefunction hyc> created by a transition from the anion excited state is given by

Iyc(t; s,At)) =* ~dt’e-i(’’c+’)(’-’’)’fiEP,(t’- At)l y~(t’)), (4) where At is the time delay between pump and probe pulses, as measured from peak inten- sity times; ~Bc is the transition dipole moment between anion excited and neutral states;

Hc = Tc + Vc is the neutral diagonal Hamiltonian, and EP,(t) = .EP,sech ~frpre’”’” is the [ )’ electric field of the probe pulse (maximum amplitude ~Pr, WHM ~Pr, Central frequency

@pJ.

Since, as indicated in the equation, the neutral state is dependent upon the pho- toelectron energy &and time delay At, determining the intensity of photoelectrons I’(s,

At) is tantamount to calculating the corresponding neutral wavefunction intensity in the long-time limit: 10’11

P(e, At) = ~~(vc(t;~,At) IVc(t; @t)) (5)

_ l#BC12 - ~t, m ~tl,eic(t’-r”)lh E *(t” – (t’)) pr At) EP,(t’ – At)(yB(t”) Iei’’c(f’-’’’)’”l~~ (6) h2__ M

_ 1~BC12 - ~Teiflth ‘- (t”– At) EP,(T+ t“ - At)(~c(t”, T) I~E(t” + T)) (7) J [J dt’’Epr* F12 _ tnun 1 where T= t’ – t“ represents time spent on surface C; Xc(t”, T))= e-i~cr’~ WE(t”)) are

wavefunctions evolved on surface C which contribute to the overall [yJc> wavefunction;

.?,+.,:. ‘S2C.’. ?: ‘“s” . .?:-C’-’-.,”:--”-.,‘ .,.. 404 Appendix 2

and tti~ and t~~ have replaced the infinite integral limits of t“,since in practice the propagation needs only to proceed over a finite, dynamically interesting time range.

The bracketed expression on the last line of the equation is the argument of a Fou- rier transform, which yields a powerful method for calculating the entire photoelectron spectrum at arbitrary At, or even probe pulse shape, without rerunning the propagation.

The matrix of overlap integrals between time-dependent wavefunctions on surfaces B and c,

O(t”,7J +c(t”, T)lf#B(t”+ T)) (8) is recorded over the course of the anion excited state propagation. To calculate a photoe- lectron spectrum at a particular At, the integral over t“is evaluated, producing a vector of

T-dependent values. This vector is then simply Fourier transformed to produce the pho- toelectron spectrum P(E, At).

The key advantage of this technique is the great reduction in data storage required for a propagation: rather than storing individual wavefunctions l~c(t”, T)>, which take up a prohibitive amount of disk space, especially, for 2- and higher-dimensional grids, only an overlap matrix is needed, which is independent of grid size. Further savings in storage space, as well as computation time, is achieved by recognizing that

EP,*( t“– At)EP,(T + t“– At) (9) vanishes when T is more than a few times the probe pulse width TP~.Therefore, overlap integrals need only be evaluated for lZl K nTP~,n =3, effectively making the overlap ma- trix size scale linearly with propagation time. In addition, by symmetry,

O(t”, -T)= O*(t” + T, T), (lo) Appendix 2 405 requiring overlap integrals to be calculated for positive (or negative) values of T only, achieving another 50% savings in computation time.

Note that the term e‘U in both the pump and probe electric field expressions is highly oscillatory, and would normally necessitate a very small propagation time step size in order to faithfully reproduce its time dependence. However, this can be avoided by adding the eiu term to the upper state potential energy (for instance, VB in the case of the pump pulse), where it functions as an energy shift to the potential. The propagation time step size is therefore limited only by the maximum kinetic energy of the wavefunctions.

Note that there are also limitations on the spatial grid spacing as a result of the wave- function kinetic energy. These points are discussed extensively by Kosloff.Q1s

Calculations of the wavefunctions l~c(t”, 7)> and overlap matrix elements O(t”,

T) can be conducted in a number of different ways. The approach taken in alpine in- volves a backward time propagation on surface C, so that previous h#B>’s can be inte- grated with calculated l~c>’s while varying T between O and a maximum negative value.

The procedure for carrying out the calculation is as follows. At a time interval Atc:

(11) where zk is the range of possible electron kinetic energies, and fifety is an empirical safety factor (= 0.4), the current l~B(?”)> is placed at the beginning of a queue of previous lYB(t”)> wavefunctions. The current h#E3(t”)>is backward-propagated on the neutral sur- face for one increment of Atc, producing l~c(t”, T= –Ate)>, and an element of the overlap matrix O(t”, T) is evaluated with the queue wavepacket l~B(t” – AtC)>. This process con- tinues until one column of O(t”, T) has been calculated. The oldest wavefunction lYB(f’ –

,2, .? ...... ,, ., .. .,,y ~;,. .-.,-,’ - ,, 406 Appendix 2

nTPJ> is then thrown out of the queue, and the propagation of h@(t”)> resumes on the 1 anion excited state surface.

2. Compiling and execution

Compilation of alpine and trans is straightforward. On a Unix platform such as PC Linux or Silicon Graphics (SGI), the FORTRAN compiler commands f 77 (or f90):

f77 alpine5 .4.1. f –o alpine5 .4.1 and

f77 trans2.2.1. f -o trans2 .2.1 are generally sufficient to create an executable file (the –o option here simply specifies the name of the executable file; without it, the default a. out is assigned). Different compilers become finicky over certain areas of the code, for instance, in the handling of strings or numerical precision. As of this writing, both source files have been successfully compiled and tested on the above-named platforms.

Usually alpine must be run as a “batch” process, since it will use an hour or more of computer time. The typical format for starting alpine as a batch process uses the nice command:

nice +19 alpine5 .4.1 > -junk. out &

Here the lowest priority (+19) has been selected to allow other users full access when logged on. Output has been redirected (>) to the junk. out file. This is not really neces- sary, since the alpine. out fileisalsocreated, containing the same information, but it prevents the window from continuously scrolling with new updates. The & symbol in- Appendix 2 407 structs the computer to run the command as a background process, i.e. it will not be ter- minated when the user logs off.

Because trans only takes a couple minutes to execute, it is typically run di- rectl y:

trans2 .2.1

Output will appear in the command window, with a copy sent to the trans. out file.

3. Input files to alpine

3.1. alpine. inp

This is the main parameter file for alpine. A typical alpine. inp file is shown below (line numbers are not part of the file, but are simply used for reference in the text):

Line #

1 5410 Version header 2 1, 1, 1, 0 Save potential surface A, B, C; save with shifts 3 o, 1, 0, 50 Save wavepacket A, B, C, save interval ( fs ) 4 o, 0 Eigen decomp flag (0/1) and interval (fs; O = auto- matic) . 5 63.5 Reduced mass (amu ) 6 -200, 400, 0 Propagation time rein, max (fs) , step (fs; O = auto- matic) 7 1, 1, 1 Flags to propagate on surfaces A, B, C 8 2, 0, 0.4 Surface to use for C prop (l=A, 2=B) , time step on C (O = automatic) , time step safety factor 9 50 Interval for printing screen statistics (fs) 10 -0.8, 2.7, 50 Chebychev energy rein, max (eV) , safety factor 11 5 Potential shelf (eV) 12 o, 0.0 Surface A vib level, add’1 offset (eV) 13 o, 0, 0 Read wavefunc A from file (0/1), read wavefunc B from file (0/1), reverse momentum of B (0/1) 14 2.0, 10.0, 512 Grid rein,max (angstroms), number of points 15 1.589, 90.0, 1.Od-4, O Pump enerw (W), FWHM(fs), E-mu(m) - use O for no coupling, sech/gauss flag (0,1) 16 100, 3 Probe FWHM (max, fs), multiple of FWHM for limits of C overlap matrix

17 O, 4d-6, 60 tis bdy A flag, factor, num of points 18 o, 0, 10 Ms bdy B flag, factor, num of points

->=-’- - ., 408 Appendix2 19 1 Pot A: 12-(X2SIGMAU+) (MTZ) (O=rO,DO,beta,VO; l=rerwe,wexe,VO; 3=file name ) 20 3.205,110,0.371,-1.014 rO, we, wexe, VO 21 3 Pot B (O=rO,DO,beta,VO; l=re,we,wexe,VO~ 3=file name ) 22 -0.014 Vo 23 3 Pot c: 12(X) (O=rO,DO,beta,VO; l=re,we,wexe,VO; 3=file name) 24 2.855 Vo

Note thattext appearing afterthe relevant dataon each line isignoredby the pro- gram, andso may contain anydesired comments. Inthe example, thenames ofthevari- ables associated witheach input itemis shown.

Line 1 contains a version header. This line is compared with the program variable input_header to determine if alpine can read the file.

Line 2 contains flags indicating whether to save a file with each potential surface

A, B and C (1 indicates yes, and O, no; this code is used for all flag variables in the file), and a flag to include the shifts used for eliminating the oscillatory eiu term in the output copy of the potentials.

Line 3 contains a simikl.r set of flags for saving wavepackets !~A>, l~B> and l~c>, and a time interval (in fs) for saving wavepackets. Note if l~c>’s are saved, the program will stop after one propagation on surface C, since this option is used strictly for diagnos- tic purposes, and saving a set of wavepackets for each C surface propagation would gen- erate a prohibitively large number of files. The wavepacket save interval is automatically rounded to an integer multiple of the base propagation time step (see line 6).

Line 4 contains variables for performing eigenvalue decomposition of l~A>. This function is currently not functional, but this line must contain two “dummy” values such as shown in the example. Appendix 2 409 Line 5 contains the reduced mass of the molecule, in atomic mass units (amu). For a diatomic, this is equal to rn1m2/(m1+m2).

Line 6 contains the time limits and step size of the l~A> and IYB>propagations, in . fs. If O is given for the step size, it will be calculated automatically from information about the grid size and maximum potential energy of the surfaces. It is seldom necessary to override this automatic option.

Line 7 has flags indicating whether IVA>, h#B> and l~c> should be propagated.

Usually l~A> is propagated only if explicit inclusion of a ground state depletion effect is needed. By not propagating l~c>, the program can be used for simple propagation of an- ion wavepackets.

Line 8 allows for specification of which anion surface (1 = A, 2 = B) is to be used to generate l~c>, the time step to use on the C surface, and an additional time step “safety factor.” As with line 6, the time step can be specified as O, meaning it will be automati- cally calculated from potential parameters. The smaller the time step, the larger the range of electron kinetic energy in the photoelectron spectrum. The safety factor (typically

O. 4) is used to reduce the calculated time step and thereby expand the kinetic energy range slightly, to prevent features near the edges of the spectrum from wrapping around to the other side if they are artificially broad due to a short propagation time.

Line 9 contains the interval (in fs) for printing updates to the screen.

Line 10 contains outdated parameters for the Chebychev propagation scheme, now abandoned. Three “dummy” values must appear, such as shown in the example.

Line 11 contains a potential “shelf’ in eV. This is the value each potential surface is truncated to after either reading in or calculating the surface. 410 Appendix 2 Line 12 specifies the initial vibrational level of l~A>, and an additional energy offset to surface A (in eV). This offset generally only used when l~A> is read from a file.

Line 13 contains a flag specifying whether to read l~A> and l~B> from files, and a flag to reverse the initial momentum of !~B>. If read from files, the filenames must be ps iA. inp and ps iB. inp, respectively. The momentum reversal function was added for a special application (taking the final wavefunction of a prior propagation and placing it on a new surface with reversed momentum, to simulate the effect of a wavepacket re- flected off a solvent-induced “wall.”)

Line 14 specifies the grid parameters: minimum and maximum (in ~), and the number of points. Note this number must be a power of 2.

Line 15 provides information about the the pump pulse: photon energy (in eV), full width at half maximum or FWHM (in fs), the product of l$.”pm (in arbitrary units), and a flag to choose between a sech2- or Gaussian-shaped pulse (O or 1, respectively).

Line 16 provides information about the probe pulse: FWHM (in fs), and a factor specifying the maximum duration to propagate l~c>, in multiples of the probe pulse width

(typically 4). Note that this information is only used to determine propagation parameters for l~c>, which defines a maximum possible probe pulse to be used in trans.

Lines 17 and 18 contain absorbing boundary condition parameters for surfaces A and B, respectively. For each, there is a flag specifying whether to use the absorbing boundary, a multiplying factor specifying how quickly the boundary drops to zero (use O to let alpine calculate this automatically), and the number of points over which the ab- sorbing boundary is active. Appendix 2 411 Lines 19 and 20 contain parameters for the A surface potential. Line 19 contains a flag specifying which type of potential function to use, while line 20 contains the pa- rameters for the potential. The format of line 20 depends on what was provided in line

19:

Value I Potential type I Parameters o Morse r. (A),DO(eV), ~ (A-l), Vo (eV)

1 Morse r. (A), we (cm-l), @x. (cm-]), Vo (eV)

2 Not used (was LEPS potential) —

3 Read from file Vo (eV)

Here r. indicates the equilibrium bond distance, Do is the well depth, ~ is the curvature parameter, @is the harmonic frequency, we is the anharmonicity, and VO is the offset energy of the potential (bottom of well assumed O). Note that the two ways of specifying

a Morse potential are equivalent:

B= r~ and D.=~ (12) ‘ y (Dexe “ 4m,xe

where p is the reduced mass. For potentials read from files, the filenames must be pot* . in (* =A, B or C).

Lines 21 and 22 contain the same parameters for surface B.

Lines 23 and 24 contain the same parameters for surface C.

3.2. pot*. in

When a potential surface is specified in alpine. imp to be read from a file, the

filename corresponding to surface A, B or C must be potA. in, potB. i.n or

po tc. in, respectively. The format of the files is identical. Line 1 contains grid pa-

7.7-. .--,,.; ,.. :.:2 --- -. -. :>->- -- 412 Appendix 2 rameters of the potential: minimum and maximum (in ~), and the number of points. Note this number must be a power of 2. These parameters need not match the grid specified in

alpine. inp, as an interpolation feature is built into the program. Subsequent lines contain the potential energy (in eV) for each grid point.

. 3.3. psi*. inp

previously calculated wavefunctions maybe input for l~A> and h#B>, with file- names ps iA. inp and ps i-B. inp, respectively. Each line of the file simply contains one pair of complex numbers indicating the wavefunction amplitude at each grid point, using the standard FORTRAN format:

(-1.0000000000, 1.0000000000) where the first number is the real part, and the second number is the imaginary part.

4. Output files from alpine

The following files are output during an alpine run:

alpine. out contains general information about the propagation parameters and periodic updates on the status of the propagation. It is the same information as printed on the screen during the run.

norm* . out (* = A, B) COntain the norms (!a@@2) of l~A> and l~B>, respec- tive y, calculated at time intervals specified by the update status.

pot* . out (* = A, B, C) contain the potential functions for each surface, if it was specified to be generated in alpine. inp. Each line contains a pair of numbers, dis- tance (in ~) and energy (in eV). Appendix 2 413

psi *. dump (* = A, B) COIItaiII l~A> and IYB>at the final time Step in complex

number format. These are useful for reading back into the propagation code, for instance,

to break a long propagation into manageable pieces. This is accomplished by renaming

the files psi *. inp (see above) and setting the appropriate flags in alpine. inp.

psi* . *: These are files output for each wavefunction several times during a run,

if specified in alpine. inp. The first asterisk denotes a letter (A or B, indicating the

wavefunction IYA>or l~B>), followed by a three-digit number starting at 001, and in- crementing by 1 each save interval. The second asterisk indicates the file type: dump is a complex-number format wavefunction, real contains distance (in ~) and the real part of

the amplitude, sq contains distance (in ~) and squared amplitude, and mom contains in-

verse distance (in ~-1) and the real part of the momentum-space amplitude.

matrix. out contains the matrix of overlap integrals O(t”, T), in complex-

number format, one element to a line. The first line contains the shift of the surface C

potential used by alpine, which must be applied to the calculation in trans to obtain

photoelectron spectra with the proper energy offset.

5. Input files to trans

5.1.trans. inp

The format of the main trans input file, trans. imp, is very simple, as the

following example shows:

Line #

1 2200 Version header 2 4.768, 100 Probe pulse energy (eV) and FWHM (fs) 3 2, 1200, 254 Convolution type, ion beam energy (eV), mass (amu)

.<., ,.~;, ------.. . 414 Appendix 2 4 1.0, 3.0, 0.005 Output spectrum energy minimum, maximum and step size (eV) 50 Time delay (fs) for calculating spectrum 6 100 etc. 7 200 etc.

Aswith alpine .inpabove, text appearingafterthe relevant dataon each line isignored by the program, andsomay contain any desired comments.

Line 1 contains the version header. This line is compared with the program vari- able ivers_trans to determine if trans can read the file.

Line 2 contains the probe pulse energy (eV) and FWHM (fs). Note that the

FWHM cannot be significantly larger than what was specified in alpine, but it may be as small as desired.

Line 3 contains the convolution type, ion beam energy (eV) and ion mass (amu).

Currently, five convolution types are supported:

Convolution type Description Function (see text) o None —

1 Tophat (flat) 1 2 Isotropic G

3 Sin20 (l-r)=

4 COS2e

For convolution :s >0, the following parameters are determined from the ion beam energy and mass:

m~UiOn Uoff= — (13) iqon

Ue– Uecm– Uoff) r = ( (14) 4uoffuecm Appendix 2 415 where the range of the convolution is *2 ~UO#~cm . The energy offset, U.ff, is called aeo f fs et in the program. The convolution functions (unnormalized) are shown above ) in the table.

Line 4 contains the output spectrum energy minimum, maximum and step size, all in eV. These parameters may be arbitrary, as the Fourier transform output is always in- terpolated to fit onto this grid.

Lines 5 and later contain the pump-probe time delays (fs), one to a line. There may be as many time delays as necessary. Calculation of extra time delays is very fast, as the bulk of the computer time is typically spent reading in the matrix. out file.

5.2. matrix. out

In addition, the matrix. out file from alpine is read by trans.

6. Output files from trans

pw* . out contain the photoelectron spectrum for each delay time specified by trans. inp. The asterisk indicates a three-digit number beginning with 001, and in- crementing by 1 for each subsequent file. The format of each line is the electron kinetic energy (in eV) and the intensity (in arbitrary units).

trans. out is simply a copy of what is printed to the screen by trans, indi- cating the progress of the program.

7. References

1 B. J. Greenblatt, M. T. Zanni, and D. M. Neumark, Chem. Phys. Lett. 258, 523

(1996).

...... +, ,. 416 Appendix 2 2 V. S. Batista, M. T. Zanni, B. J. Greenblatt, D. M. Neumark, and W. H. Miller, J.

Chem. Phys. 110,3736 (1999).

3 M. T. Zanni, V. S. Batista, B. J. Greenblatt, W. H. Miller, and D. M. Neumark, J.

Chem. Phys. 110,3748 (1999).

4 R. Kosloff, J. Phys. Chem. 92,2087 (1988).

5 R. Kosloff, Annu. Rev. Phys. Chem. 45, 145 (1994).

6 S. E. Bradforth, Ph.D. Thesis, University of California, Berkeley (1992).

7 U. Banin, A. Bartana, S. Ruhman, and R. Kosloff, J. Chem. Phys. 101, 8461-8481

(1994).

8 A. Bartana, U. Banin, S. Ruhman, and R. Kosloff, Chem. Phys. Lett. 229,211 (1994).

9 M. T. Zanni, T. R. Taylor, B. J. Greenblatt, B. Seep, and D. M. Neumark, J. Chem.

Phys. 107,7613 (1997).

10 C. Meier and V. Engel, J. Chem. Phys. 101,2673 (1994).

11 C. Meier and V. Engel, Phys. Rev. Lett. 73,3207 (1994).

8. Program listings C and saves result in file zpsict. Final transformation to useful information C is handled by another program, transl. f .

8.1. alpine5.4.l.f C 28mr96 BJG: Version 2.1 implemented. Replaces second-order differencimg C propagation scheme with Chehychev polynomial approximation for the upper C state surface only (the first two surfaces are linked by a time-dependent c ALPINE C coupling term which makes this method difficult to implement; plus, tbe huge C majority of the corr@utation time is spent propagating on the upper surface c 1-D femtosecond photcmlectrc.n spectrum simulatoz C anyway) . This approach is taken from R. Koslof f. -Propagation Methods for C Quantum MOleCUlaX Dynamics, “ Amu. Rev. Phys. Chem. 45, 145 (1994) . New sub- ,.., C routine chebprop( ) handles this implementation. ,. .1, c Begun by B. Jefferys Greenblatt, August 1995. c Latest version: see last_date variable. C 7may96 BJG: Version 2.2: Minor change as a test of difference between sech-2 C Adapted from S. E. Brad ferth code ,prop10 -. C and Gaussian pulse shapes on dynamics. Is a permanent upgrade, however, as C allow both twes of shapes to be accessed in input deck. Also changed input C Address: Nemark Research Group C deck filename to alpine. inp, and added a header line with the version number c Department of Chemistry C of alpine, so we know which version we ran simulation under (inpartant) ! c University of California c Berkeley, CA 94720 usA C 8dec96 BJG: Version 3.0 (not a big change from 2.2, but NTZ has made some C Phone: 510-642-7761 or 510-643-9301 C other versions and we don, t want to conflict) . This solves the small energy .:. C E-mail: je ff~radon. cchem. berkeley. edu C offset error by changing the sign of the phase factor in the Chebychev propa - ,, ; C gator. C INPUT: alpine. inp Input deck (see read_ input () for explicit instructions) . c (pot files) Names of potential energy files, if used (see potread) . C 8dec96 BJG: Version 3.1. Makes shifting around of potentials automatic .md c ouTPuT: alpine .out Copy of information printed to screen during run. C transparent; shifts effected in ALPINE are undone in TSANS by passing along c abs. out Absorbing boundary function (if iabs = 1 ) C a parameter. Simply set up potentials with true spacings between, vOA can be c normx. out Norms of wavepackets (X = A, B only) saved at intervals C anywhere (program automatically shifts to make v=O eigenenergy O) . c determined in input deck. g c potx. out Surface X potential function (A = anion ground state, B C 9dec96 EOG: Version 3.2. Timing specified more rationally now, calculates step c = anion excited state, C = neutral) C size necessary for FT, added function to read in arbitrary potential with w c psiX. dump Final wavepackets on surfaces X = A, B only, in raw C automatic interpolation to fit chosen grid. c (complex) format. Intended for the future use of s C 10dec96 BJG: 3.3: Allow recording of momentum representation of wave function a c reading old wavepackets in, in order to continue a w. C in addition to position, if desired. c propagation. x c psiXY. Z Wavepackets on surface X (= A, B only) at time interval N ,, ‘ c Y (. 000, 001, etc. ) . This is only recorded if the C 10dec96 BJG: 3.4: Modified a few lines toallow to comQile on Linux machine. ., c isavpsiX variable in input deck is set. Information c contained in file indicated by Z: sq = square of psi C 15dec96 BJG: 3.4.1: Changed chebprop algorithm in attempt to fix bug when I -“ c vs. position; real = real part of psi vs. position; C using 1024 pts in x grid; however, b“g was in the read_ wer_pot interpolation C routine (made gap in potential, producing wf spike which blew up propagation) c d- = real and i~g parts of psi (no position); mom c = square of psi vs. momentum. c matrix .out Matrix of overlap integrals: time x time. Read by C 15dec96 BJG: 3.4.2: Kept new chebprop, clean up m-msed subroutines (including c Fourier transform program TRANS. C dumping off LEPS capability -- so source code file is gone) , made screen C output produce exact copy in alpine. out, including list of letters with cor - C Notes for this version (add to bottom of list, please) : C responding time delays for saved wavef unct ions. Added some automatic parmne - C ters such as time steps (both on A/B and C surfaces) , option to propagate on B C 26ju195 BJG: This program calculates photoelectron spectrum intensity over a C or A+B, take FPES from surface A or B. c user-specified rmge of electron kinetic energies and delay times. C 20dec96 BJG: 3.4.3: Allowed initial wavepacket from other than v=O eigenlevel, C 18mar96 BJG: Version 2 implemented, This version calculates one matrix con- C Combined anionmorse”f and alpine source files, so code is no” contained in a C taining all dynamical information for full 2D (delay time x eKE) photoelectron C single file, alpinexxx. f. Changed psiXY. Z labeling scheme to numbers C spectrum, This matrix, calculated from first order perturbation theory of the C (psiAOOO. sq, etc. ) C probe pulse, consists of the final wave functions zpsiCl each of which has bee” C promoted co the upper su-face at d~fferent times t and propagated out to the C 24dec96 BJG: 3.4.4: Added” ability to decompose eigenspace of psiA or pslB C same final time tn!ax. A Fourier transform of this matrix multiplied by the C (using Heller scheme: Fcmrier transform of autocorrelation) [16 feb97 : DOeS C envelope function of the probe pulse, which can vary in delay time relatlve C not yet work] C to the probe, followed by c.alc”lat~o” of the norms of zpsiCl (w, x) gives the C photoelectron spectrum P (w) for an arbitrary probe delay (and shape for that C 16 feb97 BJG: 4 0: Swxtch from recording wavepacket matrix to recordxng C matter, ) C overlap matrxx, in anticipation of 2-D mplementation (.TCIBCGGAN -)

C 29apr97 BJG 4 1 Got elgenf”nction decomposltxon working But then reallzed C Currently program uses weak field lm~t for both pulses sxnce thxs elm!inates -P C the need to propagate ZPSIA at al 1 (no change to zpslA) For every tune step C could simply overlap the f~nal wave function with the known Morse C tpsl Cstep on surface B, program executes Inner loop propagation on surface C C elgenfunctlons of the X state and get the populations much more quickly z c Currently it does both -- but with the second approach, there, s no need to & proberange, ireadA, ireadB, irevB c propagate beyond the extend of the PUMP pulse, so this is the one to use. integer f_in, f_Out, f_nOrmA, f_nOrmE, f_mntrix, f-temp, & f_temp2, f_temp3 c 29apr97 BJG: 4.2: Allow reading and writing of wavepackets to do ‘special- common /files/ f_in, f_Out, f_nOrmA, f_n0rm9, f_matrix, f-temp, c propagations like simulating 12 lc02i 16- recurrences at 1.5 PS. & f_temp2, f-temp3 common /norms/ rnorti, znornm, rnormc, HaVA, HavB, HavC c 30j”n97 BJG: 4.3: Allow inhibition of propagation on all surfaces; added A comnon Ipotl zpot (npts, 3 ) C surface energy offset independent of nlevel, to inform surface moving algo- common /pottyp/ ipottypA, ipottypB, ipottypC, isav’potA, isavpotB, c rit.hm that initial wavepacket (read from file) has nonzero kinetic energy; re - & isavpotC, isavpsiA, isavpsiB, ieavpsiC, ieigenA, ieigenB, C arranged order of some input deck parameters. & isavpot_shift common- /zSsis/ zpsiAl (npts) , zpsiBl (npts) C 6ju197 BJG: 5.0: Implemented a dramatic improvement in Per fornmnce, reducing character. 80 input_header, last_date, matrix_header C order of propagation time from quadratic to linear in the length of propawa- common /headers/ input-header, last-data, matrix_header c tion ! storage requirements are roughly doubled, however: now must record both common /version/ ivers_input, iversmtrix C a CO and Cl wave function for several time slices simultaneously. C Begin. c 6ju197 EJG: 5.1: Haven’ t even tested 5.0 yet, but discovered way to halve c storage requirements with no decrease in speed, by recording psi2’s, rather call FFT~rep ! Set up FFT array. c than psi3’s, in queue, and propauatinw C taking overlap every i tCstep stab_ factor = 0.2 ! Stability factor for propagation. C iterations. C Set UP header variables -- for compatibility. Used in alpine. inp, matrix .out. c 13aug97 5JG: 5.1.1: Still debugging; this version prints out, starting with C Must change anytime the file formats change. c pwlol. out, the un-FFT’d spectra for inspection. last_date = ,1999.02.24, C 1997.8.29 EGG: 5.1. swi: special SGI source code version which can get ivers_input . 5410 C around the inability to read strings as input. ivers_matrix = 2200 c 1997.8.29 BJG: 5.2: Again sui compatible, this just adds a few lines around C File variables -- so only have to change file number in one place. c the C prop looPs to calculate the number of Hpsi calls needed (j_n!ax). f_in . 1 C 1997 .10.1 BJG: 5.3: Absorbing boundary conditions added. f_Out . 2 fsorm?l = 3 c 1997 .10.3 BJG: 5.4: Changed double precision to real*8, added FFT_Prep routine f_nOrmE = 4 c to improve alpine performance, other small changes for SGI compatibility. f_matrix = 7 f_temp = 8 c 1999.02.10 BJG: 5.4.1: Modified so aether can read input headers (numerical f-t emp2 = 9 N C code, rather than string) . Had simply ignored them -- not a great idea. f_temp3 = 10

C G16bal variable declarations: C Print greeting.

implicit real*8 (A-H, O-Y) open( f_Out, file = ,alpine. out, ) implicit complex*16 (Z) parameter (npts = 2048, nauto = 2048, NAX_QUSUE = 2561 100 format( ,Welcome to. ...) dimension zpsiAO (npts), zPsiBO (npts), zPsiCO lnPtS), zPsicl (nPts), 110 format(, AL PIN E,) & zpsiqueue(npts, MAX_QUEUE) , zHpsiAl (npts) , zHPsiBl (npts) , 120 format (, I-D femtosecond photoelectron spectrum ,, & zHpsi (npts) , zpsiAori!a (npts) , zovlp(npts) & ,simulator, ) common Iabssl absA(nptsl, absB(npts) 130 format (, by B. Jefferys Greenblatt, ) common /autocorr/ zautoA (nauto ) 140 format (,Last modified ,, a) common /convert/ harev, evwn, aO, amu, emu, ham, amass, atu 141 format (aInput header = ,, i5) common /cOnstO/ zero, zeye, pi, c, twopi, sqrtpij pisqf 142 format (‘Matrix header . -, i5) & alessthanbalf write (*, ●) conunon Iconstll xmas, hb, sechfactor, gauss factor write (*, 100) common /const2 I XOA. xome9A# V13A, ~exeA, dea. xalPhaA, XOBJ write (*, ●) & xomeuB, xwexeB, deB, xalphaB, vOB, xOC, xome9C, xwexeC. deC, write (*, 110) & xalphac, vOC, shelf, vOA_off, vOB_off, vOC_off write (*, ●) common /c0nst31 tstep write (., 120) conunon/const4 lain, ma%, nxpts. dx, npacket, iabsA. nxabsA, absfacA, write (*, ●) & iabsB, nxabsB, absf acB write (*, 130) common /const7/ tpktsav, itpktsav, tcsteP, itCsteP, tcfactor. write I*, ●) & emin, emax, factor, e_shift, tmin, tmax, statstep, Istatstep, write (., 140) last_date & tauto, itauto write (*, 141 ) ivers_input comnon /const8/ hvl, fwhml, dmul, domegal, sechl, itypel, ipropA, write (*, 142 ) ivers_matrix & ipropB, ipropc, icpot. nlevel, Aoffset. Eint, fwW, thresh, write (f_Out, .) write (f_Out, 100) wrxte (f_Out, .) if (sqkmax . tstep .gt. ldO) then write (f_Out, 110) 340 format (a---- ‘THIS PROPAGATION WILL BE UNSTABLE* ....0 ) write (f_Out, “) write (., .) write (f_Out, 120) write (,, 3401 write (f_Out, .) write (., .) write (f_Out, 130) write (f_Out, .) write (f_Out, “) write (f_Out, 340) write (f_out, 14o) last_date write (f-out, ‘) write (f_Out, 141) ivers_input s top ,,: write (f_out, 142) ivers_matrix endi f

C Define some useful constants. 350 format (‘Time limits for current propagation = 0, f8.2, & , to ,, f8 ,2, , fs, ,)

call consto write (*, 350) tmin ● atu, tmax . atu write (f_Out, 350) tmin . atu, tmax . atu C Read input deck. C Calculate autocorrelation parameters. call read_ input () if (ieigeti .eq. 11 then C Write basic information. if (tmin .gt. O) then write (’, ‘) 531 format (etmin cannot be positive for autocorrelation. ,) write (f-out, ‘) write {., 531) write (f_Out, 531) 270 format (’xnin =’, f9.2,2x, ‘xmax =’, f9.2,2x, ‘nxpts =’ji5j 2x. stop & ,*=, , e10 .4) endif write (*, 270) xmin . aO, xmax . aO, nXPts, d% ‘ aO tautomin = -tmin write lf_out, 270) xmin ‘ aO, -% ‘ aO. nXPts, C3X “ aO trange = tmax - tautomin

220 format( ,xmaslamu = ,, f7 .2) C Calculate tauto if . 0, revise interval regardless to equal a multiple of tstep write (+, 220) XTnas I mu C (nint (x + alessthanhalf ) rounds up) write (f-out, 220) Xmas / amu if (tauto ,eq. O) then C Criteria of succesful propagation 9ivcn in KoGloff, J. Comput. Phys. 52, 35 530 format (-(tauto automatic) $) c (1983 I: essentially the max kinetic ener9y representable On a grid with write (f_Out, 530) C spacing dx is given (in au) by pi .pi/(2. xmas. dx. dx) and the write (., 530) C stability criterion iS tstep , ((pi .pi)/(2. xmas. dx’ d.x)+V)<=l. O if (nint(trange / tstep + alessthanhalf) .le, nautol c (actually best at <= 0.2) & then tauto = tstep c 16Dec96 BJG: tsteP now calculated automatically, unless user specif les (tstep else C > 0 in input deck) tauto = tstep . nint( (trange 1 tstepl / nauto + & alessthanhalfl ! Calculate a suitable multiple of tstep. 320 format (aMaximum kinetic energy that can be represented is ‘, endi f & f6.3, ‘ eV.’) endi f sqkmax = 4.9348dO0 / (%mas ‘ d% ‘ dx) itauto = nint(tauto / tstep) write (*, 320 ) sqkmax . harev tauto = tstep . ltauto ! Revise value of ta”to,if mxess.ary, write (f-out, 320) sqkmax ‘ harev itautomln = nint ((tautomin - tmin) / tstep) tautomin = tstep . itautomin + tmin ! Revise value of tautomln if (tstep .eq, O) then tstep = stab-factor / sqkmax 521 format (8Revised time interval for recording autocorrelation ,, 420 format( ,(tstep automatic) ‘) & ,(fs) = 4, f9.5) write (., 420) write (f_out, 521) tauto . atu wrxte (f_out, 420) write (., 521) tauto . atu endl f 522 format (oRevised starting time for recordxng autocorrelr. tlon ,, 300 format (,propagatxon time scel> size = ‘. f6 .3, ‘ fs 1 & ,Ifs) = ,. f9 .5) wr>te (’, 300) tstep ‘ acu write (f-o”;, 522) t.mtomxn * atu write (f-out< 300) tstec “ atu write (., 522) tautorrmn . atu

330 format 1‘Stability at best, assumtng zero pocentlal 1s ‘, f6 3 I C Check that tauto not so small that we w1ll overrun zaucoA durzng run write (., 330) Sqhndx . Cstep write (f_Out, 330) sqkmax ‘ tsteP if (nint(t:anye I tauto + alessthanhalfl gt nauto) then 511 format (,Too many points in autocorrelation. Terminating. o) -b write (f-out, 511) C Set up potential offsets based on photon energy, etc: 10 write (., 511) 0 stop c Make starting eigenenergy at O: endi f vOA_off c - Eint - vOA c Calculate dephasinu constant gatrm, for use in autocorrelation. c Shift B surface down additionally by photon energy: gamn = -5.0 / (trange I tautol ● * 2 vOS-off = vOA_off - hvl 540 format ( ,Dephasing constant = ‘, e14. 8) write (f_Out, 540) gamm c Shift C surface depending on icpot: iCpot = 1: shift down by average of write (*, 540) gannn c range of C potential: endi f if (iCpot .eq. 1) then C calculate interval Parameters, revise real intervals, and print revised vdiff_min s vOC + vOA_off C delays. vdiff_max = zpot (nXpts, 3 ) + vOA_of f vOC_off . vOA_off - (vdiff~in + vdiff~x) / 2 itpktsav = nint (tpktsav / tstep) else

tpktsav . itpktsav ● tstep 500 format( ,Revised interval for saving wavepackets = ‘, c icpot = 2: Shift C surface down additionally by average of closest and & f9.2, ‘ fs.’) c furthest approaches of potentials:

write (*, 500) tpktsav ● atu write (f-out, 500) tpktsav “ atu vdiff_min = vOC + vOB_off vdif f_max . zpot (nxpts, 3 ) - zpot (nxpts, 2) istatstep = nint (statstep / tstep) vOC-off . vOB-off - (vdiff_min + vdiff_max) / 2 statstep = istatstep ● tstep endi f 510 format (‘Revised interval for printing statistics = ‘, & f9.2, ‘ fs.’) C Save the potential surfaces if required, write (*, 510) statstep ● atu write (f-out, 510) statstep “ atu if (isavpot_shift .eq. O) then 150 format (,Saving potentials BEFORE shifting or shelving. -I C Other miscellaneous parameters. write (*, 150) write (f_Out, 150) 280 format (‘hv/eV =’ , f7 .4, 2x, ,fwhm/fs =S, f7 .2, 2x, ,E*mu =8, if (isavpotA .eq. 1) call potlsave (1) & e16.8) if (isavpots eq. 1) call potlsave (2) w write (*, 280) hvl ● harev, fwhml ● atu, dmul ● aO if (isavpOtC .eq. 1) call potlsave (3)

write (f_out, 280) hvl ● harev, fwhml “ atu, dmul “ aO endi f

410 format (‘Surface generating FPES = ‘, al, C Shift potentials and apply shelf condition: L’ Propagate surface A - ‘, il, ‘ B = ‘, il, ‘ C = ‘, il) write (“, 410 ) char (64 + iCpot ), ipropA, ipropB, ipropC do ix = 1, nxpts write (f_out, 410) char (64 + icpot) , ipropA, ipropB, ipropc zpot(ix, 1) = zpot(ix, 1) + vOA_Off if (real (zpot (ix, 1) ) .gt. shelf) zpot(ix, 1) = shelf write (*, ‘) zpot(ix, 2) = zpot(ix, 2) + vOB-off write (f_Out, ‘ ) if (real (zpot(ix, 2) ) .gt. shelf) zpot(ix, 2) = shelf zpot (ix, 3) = zpot (ix, 3 ) + vOC_Of f C Calculate eigenenergy. if (real (zpot(ix, 3)) .gt. shelf) zpot(ix, 3) = shelf enddo

Eint = xomeaA . (nlevel + O. 51 - xwexeA ● (nlevel + & 0.5) .*2 - C DEBUG: Save potentials with shifts in effect. 520 format (‘Initial vibrational level = ‘, i3 J ‘ ~erWY = ‘, & f7.4, ‘ ev’) if (isavpot_shift .eq. 1) then write (*, 520) nlevel, Eint ● harev 151 format (,Saving potentials AFTER shifting and shelving. ,) I write (f_out, 520) nlevel, Eint ● harev write (*, 151) write (f_out, 151) C Add energy offset. if (isavpotA .eq. 1) call potlsave (1) if lisavpotB .eq. 1) call potlsave (2) Eint = Eint + Aoffset if (isavpotc .eq. 1) call potlsave (3) 550 format (‘Additional A offset = ‘, f?.d, ‘ @J. Total Offset = ‘, endif s, f7.4, ‘ eV’) write (“, 550) AOffSet ‘ harev, Eint “ barev C Potential information. write (f_out, 550) Aof fset “ harev, Eint ‘ harev write (., .) e_shift = vOC-off - vOB_off write lf_Out, .) endi f

if (%wexeA eq, O. OdOO ) then 290 format [,Snergy shift passed to matrix .out =- , f13 .6) 230 format (‘xOA ., ,f6 ,2,2x, ‘xomegA =$, f9.2,2x, ‘vOA =r, f6 .3, write [., 290) e_shift . harev & 2x, ,vOA_off =,, f6.3) write (f_out, 290) e_shift + harev write (., 230) XOA , aO, xomegA - harwn, VOA . harev, & vOA_off - harev C Calculate save interval for coverage of full energy range: write (f_out, 230) XOA , aO, xomegA “ harwn, VOA “ harev, :; & vOA_off + harev 190 format (,Energy range of FPES (eV) = ,, f16.8) .,.: else 200 form.at(,Step size needed for full FT (fs) = ‘, f16,81 235 format I,xOA =’ ,f6 .2,2x, ,xomegA =r, f9.2,2x, ‘vOA =-, f6 .3, write (*, 190) harev , (vdiff_max - vdiff_min) & 2x, ,vOA_off =,, f6,3, write (., 200) twopi . atu I (vdiff_max - vdiff-min) & /, 2x, ,wexeA =,, f9,2,2x, ,alphaA =r, f9.3,2x, -DeA =-, f9 .3) write (f_Out, 190) harev g (vdiff-nmx - vdiff_min) 42 write (., 235) xOA ● aO, xomegA + harwm, vOA . harev, write (f_out, 200) f.wopi ● atu / (vdif f_max - vdif f-mini & vOA-off . harev, xwexeA . harwn, xalph8A / aO, deA , harev write (f_out, 235) xOA ‘ aO, xomegA ‘ harm, vOA ‘ harev, C Calculate how often must propagate on upper surface to get wide enough FT: ~::., & vOA_off . harev, xwexeA . harwn, xalphaA 1 aO, deA . harev .. endi f if (tCstep .eq. O) then -,-: tCstep = tCfactor . twopi \ (vdiff-max - vdiff_min) if (%wexeB eq. O. OdOO) then 400 format (, (tcstep automatic) o) 240 format (,xOB =,, f6.2,2x, ,xomegB =,, f9 .2,2x, ,vOB =,, f6 .3, write (., 400) & 2x, ,vOB_off =,, f6 .3) write (f_Out, 400) write (. , 240) XOB . aO, xomegB . harwn, vOB . harev, endi f & VOB-O ff o harev write (f-out, 240) xOB . .aO, xomegB . harwn, vOB ‘ harev, C Recalculate tcstep based on itcstep (must be integer multiple of tstep) : & vOB_off . harev itcstep . int (tCstep I tstep) ! Use int to ensure E small enough (nint else & 245 format (,xOB =, ,f6 ,2,2x, ,xomegB .-, f9 .2,2x, ,vOB =,, f6 .3, c rounds to nearest integer) . & 2x, ,vOB_off =,, f6 .3, tCstep = itCstep , tstep w L /, 2x, ’wexeB =,, f9.2,2x, ,alphaB =,, f9,3,2x, ,DeB .,, f9,3) m write (., 245) xOB . aO, xomegB , harwn, vOB . harev, 210 format( ,Revised step size used for C surface Ifs) = ,, 5 & vOB_off . harev, xwexeB , harwn, xalphaB / aO, deB . harev & flo.4) Q w. write (f_out, 245) xOB “ aO, xome9B ‘ harwn, vOB ‘ harev, write (*, 210) tCstep , atu x & vOB_off ● harev, xwexeB , harwn, xalpbaB / aO, deB . harev write (f-out, 210) tCstep ● atu endi f N C Calculate number of wave functions to store for 2D autocorrelation, termx”ate if (xwexeC .eq. O. OdOO) then C if larger than max: 250 format (,xOC =’, f6.2,2x, ‘xome%C =’, f9.2,2x, ‘vOC =’, & f16 ,8, 2x, ‘vOC-off =’, f6 .3) nwweue = nint IProberange I tcstep) write (., 250) xOC . aO, xomegC . harwn, vOC . ha rev, 460 format( ,num_queue . $, i4, , 14AX_QUEUE = ,, >4) & vOC-off . harev write (., 460 ) num_queue, MAX_QUEUE

write (f-out, 250) xOC ● aO, xomegc . harwn, vOC . harev, write (f-out, 460 ) num_queue, MAX_QUEUE & vOC-off . harev if (num_queue .gt. MAX-QUEUE) then else 470 format (eError condition, Increase MAX-QUEUE in source code. $, 255 format (,xOC =,, f6 .2,2x, ‘xomegc =’, f9 .2,2x, ‘vOC =’, & , Terminating. o) & f16 ,8, 2x, ,vOC-off =,, f6 .3, write (*, 470) & /, 2x, ,wexeC =f, f9.2,2x, ,alphaC =,, f9.3,2x, ,DeC =’, f9 .3) write (f-out, 470) write (., 255 ) xOC , aO, xomegC - harwn, vOC ● harev, s top & vOC-off . harev, xwexec ‘ harwn, xalphaC / aO, deC . harev endl f write (f-out., 255) xOC “ aO, xome9C “ harwn, vOC “ harev, & vOC-off . harev, xwexeC ‘ harwn, xalphac / aO, deC . harev C Print table of letters and corresponding txmes endi f if ((lsavpslA .eq. 1) ,or. (lsavpsl B eq, 1)) then 430 format (,Shelf (eV) = ,, f8 3) write (., 430) shelf * harev write (., .) wrxte (f-out, 430) shelf ‘ harev wrxte (f-out, .)

c Calculate ener9y shift to .PP1% m Fourier transform (depends on lCpotl 445 format (‘Table of delay trees for saved wave functions $) 440 format (,Flle number Delaylfs, ) if (ICpOt eq 1 ) then write (., 445) s e_shlft = vOC_off - vOA_off write (f-out, 4451 N else wrzte (., 440) write (f_Out, 440) -P write (f_matrix, . ) iversmatrix N it = nint(tmin / tstepl + 1 write (f_matrix, . ) num_queue IQ

t = tmin + tstep write (f_matrix, . ) tmin . atu, tCstep ● atu 450 format (4x, i3, 6x, f8.21 write (f_matrix, “ ) e_shif t ‘ harev write (*, 450] o, t . atu write (f_Out, 450) O, t ● atu C Check whether toread wavepacket A from file, or generate from scratch.

4 if (mod (it, itpktsav) .ne. O) then ! Find second save point if (ireadA .eq. 1) then it=it+l call psiread( 1, zpsiAO) t .- t + tstep else goto 4 call initA (tmin, zpsiAO) endi f endi f

npacket = 1 ! Main looP C Generate zpsiAl by second order Runge Kutta. This step is required to 2 write (*, 450) npacket, t ● atu C evaluate the time derivative in 2nd order differencing later on.

write (f-out, 450) npacket, t ● atu npacket = npacket + 1 call rk2 (1, zpsiAO, zpsiAl, zfactor) ! was tmin it = it + itpktsav t . t + itpktsav “ tstep C Check whether to read wavepacket B from file, or start as O. Reverse momentum if (t le. tmax) goto 2 C of wavepacket if requested. endi f if (ireado .eq. 1) then C Generate absorbing boundary functions and save to files. call psiread(2, zpsiBO)

call make_abs if (irevB .eq. 1) then do ix = 1, nXpts 472 format (‘Surface ‘, il, , iabs=’, il, ‘ absfac.’ ,f16.8, ‘ n%abs=’ ,i4) zpsiBO (ix) = dconjg(zpsiBO (ix) ) write (f_out, 472) 1, iabsA, absfacA, n%absA enddo I write (f_out, 472) 2, iabsB, absfacB, ~absB endi f write (u, 472) 1, iabsA, absfacA, nxabsA write (*, 472) 2, iabsB, absfacB, n%absB call rk2 (2, zpsiBO, zpsiBl, zfactor) ! was tmin else if (iabsA .eq. 1) then do iX = 1, nKPts open (f_temP, file= ‘absA. out’ ) zpsiBO (ix) = zero do i = 1, n%absA zpsiBl (ix) = zero . 471 format (f16 .8) enddo write (f-temp, 471) absA(il endi f enddo close (f_temp) C Write initial wavepackets to disk (if surface is selected) . Save initial norm. endif if (iabsB .eq. 1) then if (isavpsiA .eq. 1) then open( f_tem@, file=’ absB. out’ ) call pktsav (zpsiAO, npacket, 1 ) do i = 1, nxabsB endi f write (f_temp, 471) absB(i) if (isavpsiB .eq. 1) then enddo call pktsav (zpsiBO, npacket, 2) close (f_tcmpl endi f endi f npacket . npacket + 1

c ------C Set banner for subsequent output information. c NAIN PROPAGATION CODE c ------write (*, ●)

write (f_Out, ● )

zfactor = -2d0 “ zeye ● tstep / hb npacket . 0 360 format (,Timef fs Norm A Norm B Norm C KE AieV K!? B,, & ,/eV KE C/eV Steps, ) C Open other files for run. write (*, 360) write [f_out, 3601 open lf_nOrti, file = ‘nOrmA. Out’ 1 open (f_nOrmS, file = ‘norti. out’ 1 C Begin tfit (inner) loop. t is time in atu: it is an integer counter (starts at open (f_matrix, file = ‘matrix .Out’ ) C some negative value) used for determining when to save wavepackets. nint = C nearest integer. icount keeps track of wave function labels saved to disk. c write vital information to overlap ~trix f~le (including version headerl t = tmin + tstep enddo Xt = nxnt (tmxn { tstep) + 1 endi f iautocount = 1 if (iabsB .eq. 1) then icount = O do i = 1, nxabsB l_CPIeUe = O 1 POSI tion of last wavepacket n zpsiqueue j . nxpts - n%absB + I i_queue_flag = O 4 Looparound flag initially not set zpsiBl(jl = zpsiBl (31 “ absB(i) enddo C Man looP start. Save wavepackets if it, s time. endi f

3 If (mod (it, itpktsav) .eq. O) then C Zpsic propagation. if (isavpsiA .eq. 1) then call pktsav (zpsiAl, npacket, 1) if ((ipropC .eq. 1) and. (mod(it, itCstep) .eq. O)) then endi f if (isavpslB .eq, 1) then c COPY appropriate surface wave function into zpsic; generate Cl (note: back- call pktsav (zpsi Bl, npacket, 2) C ward propagation !) endi f npacket = npacket + 1 if (iCpot .eq. 1) then endi f do ix . 1,nxpts zpsiCO (ix) = zpsiAl (ix) C zpsiA, zpsiB propagation: both optional. enddo else

ZE = zfactor ● ZEllt) do ix = 1, nxpts zpsiCO (ix) = zpsiBl(ix) if (ipropA eq. 1 ) then enddo call Hpsi (l, t, zpsiAl, zHpsiAl) endi f if (ipropB cq. 1) then call rk2 (3, zpsiCO, zpsicl, -z factor) ! was tmin call Hpsi (2, t, zPSiBl, zHpsiBl) do ix = 1, nxpts c Copy wave function into conjugated queue array, zpslAtemp = zpsiAO (ix) + ZE . zpsi Bl (lx) + & zfactor . zHpsi Al (ix) 1 6-30-97: Shoulcln

enddo C Snd tlit looP. end if endi f t = t + tstep it=it+l C DEBUG: Terminate if isavpsiC = 1: if (t le. tmax) goto 3 N if ((isavpsiC .eq. 1) and. (it .eq. O)) goto 800 C Save final wavepackets on each surface to a file.

C Done C surface propagation. call psidump(l, zpsiAl) call psidump(2, zpsiBl) endi f C Perform FT of autocorrelation array. First must pad remaining terms with O‘s. c Print statistics, write data to norm files. if (ieigenA .eq. 1) then if [mod (it. istatste~) .eq. 0) then 541 format (8Performing FFT of autocorrelation. -, call chk (1, 1, zpsihl, rnormA, HavA) & ,Results saved in eigenA. out. ,) call chk (2, 1, zpsiBl, rnormB, HavB) write (f_Out, 541) 900 format (f9.2, 2x, f6.4, 2x, f6.4, 2x, f6.4, 2x, f7.4, 2x, write (*, 541) & f7.4, 2x, f7.4, 2x, i5) do i . iautocount + 1, nauto

write (•, 900) t ● atu, rnormA, rnorn’Jf, rnomC, HavA “ zautoA(i) = zero & harev I morn% HavB “ harev I rnOr~, HavC ‘ harev I enddo & rnOrmC, nsteps write (f_out, 900) t “ atu, rnorrnA, rnormB, rnormc, HavA ‘ C DEBUG: Save original autocorrelation -- as both real part, and msg. & harev I rnormA, HavB ● harev I rnOrmB, HavC “ harev I & rnOrmC, nsteps open (f_temp, file= te(f_terrp, .) dsqrt(re . re + al . ai) enddo close (f_Out) cl Ose(f_temp) close [f_nOrmA] close (f_nOnnS) C Multlply by smoothing function before taking FFT: close (f_nmtrix]

do I = 1, nauto stop z.autoA(il = zautoA(i) . dcmplx(dexp(gcm.m . i . i)) end enddo c ...... **..***...... C DEBUG: Save smoothed autocorrelation -- as both real part, and mag, subroutine const () c ...... *...... **** . *, ...... open{ f_temp, file=, autoA. sm. real 8) C Defne some weful constants, do i = 1, nauto write (f_temp, .) dreal(zautoA(i) ) indicit real*8 (A-H, o-Y) enddo X!’@licit con@ex+16 (Z) close [f_templ common /convert/ harev, em, aO, am”, emu, ha-, amass, at” common /cOnstO/ zero, zeye, pi, c, twopi, sqrtpi, pisq, open (f_temp, file. SautoA. sm, mag, ) & alessthanhalf do i = 1, nauto comnon /constl/ xmas, hb, sechfactor, gawsfactox :. re = dreal IzautoA( i) ) ., ai = dimag(zautoA(i)) C Set conversion factors. ..: wrlte(f_temp, ●) dsqrt(re . re . ai . ai) enddo harev . 27.211608d0 close (f-temp) em . 8065.479d0 aO = 0,52917706d0 C Take FFT. amu = 1822, 882d0 emu . 9.109534d-31

call FFT(zautoA, nauto, 1) harwn = harev ● evwn amass . 1.66056d-27 C Wrxte results to file - only write positive part since negative freqrs don, t atu = 0.024199d0 C have physical meaning C Set cOns tO, Open (f_temp, file = ,elgenA, out, ) estep = twopi / nauto / ta”to . h.grev zero = dcmplx (O. OdOO, O. OdOO) N 501 format (f9.5, 2x, e16.8) zeye = dcmplx (O. OdOO, 1. OdOO) do i = 1, nauto / 2 pi = dacos (-1. OdOO)

write (f_ten-p, 501) estep . (i - 1), twopi = 2 ● pi & dreal(zautoA( l)) sqrtpi = dsqrt (pi)

enddo pxsq = pi ● pi close (f_temp) alessthanhc,lf = 0,49999 ! Just a little less than half, b“t not so little endi f c that we machine round to O, 5.

C Now take final wave functxon and overlap with known eigenfunctions of X state C Speed of light m cmls a“d hbar in atomic units,

call ovlp(zpsiAl, zpslAl, zaccum) ! Get norm of wave f”nction C = 2, 99792458d10 atemp = dsqrt (dreal (zaccum) ) hb = l,OdO Open (f_teW, file . ‘elgenlxst. out, ) 600 format (i2, 2x, e16 8) C Pulse shape parameters : sechfactor is multiplied by txme inside sech~2 so that do nlevel = O, 10 C relatlve pulse l“tenslty . 0, 5 when time . Ftqto.jI 2 Gauss factor is similar, call lnltA (O, ZPSLAO) ! Use zpsiAO as temp array to hold each e< fn, C but for a gauss ian-shaped pulse, call OVIP( ZPSIA1, ZPSXAO, zaccum) re = dreal {zaccum / atemp) sechfactor = 1 ,762747174dO0 ! = 2 . arccosh(sqrt (2) ) a> = dxmag(zaccum I atemp) gauss factor . -1 .386294361dO0 , = -2 . in(2) wrice(f-temp, 600) nlevel, re - re + al . al 8 Must square result anyway enddo return close (f_temp) end

C Done c ...... ,., subroutine read-input () 3R0 forma t(

read (f_in, . ) ls?.vpslA, lsavpsiB, isavpsiC, tpkt sav close (f-m) tpktsav = tpktsav / atu return read (f-in, . ) ieigen?+, tauto end tauto = tauto I atu c ...... ****...*.*..**...... read (f-in, . ) xmas subroutine potread( ) :; ms = Xmas . anlu c .*, ...... ,*.....*,*,...,.,.*, ,,..,..,*,...... ,,, C reads in potential energy function parameters, then computes (or reads from a read (f_in, , ) tmin, tmax, tstep C file) the value of the function at each grid point, tmin = tmin I a tu tmax = tmax I atu C Potential types available are:

tstep ❑ tstep 1 atu C O: Morse (input Re, De and Be) c 1: Harmonic/Enharmonic (input Re, We, Wexe) If wexe ne. O then uses Morse. read (f_in, , ) ipropA, ipropB, lprOpC c 3: Potential read from file - special format

read (f_in, “ ) iCpOt, tcstep, tCfactOr C Other potentials may be added by modifying the subroutine, tcstep = tCsteP / atu 8 Deal with neg value later. impliclt real.8 (A-H, o.Y) read (f-in, .) statstep implicit complex*16 (Z) statstep = statstep / atu parameter (npts = 2048) common Iconvertl harev, evwm, 40, amu, emu, harm, amass, .atu read (f_in, ‘ ) emin, emax, factor common /cOnst O/ zero, zeye, pi, c, twopi, sqrtpi, pisq, emin = emin I harev & alessthanhalf emnx = emax / harev conmwn /constl/ mnas, hb, sechfact. or, gauss factor common /const21 XOA, xomegA, vOA, xwexeA, dea, xalphaA, XOB, read (f_in, ,) shelf & xomegB, xwexeB, deB, xalphaB, vOB, xOC, xomegc, xwexec, d.ec, shelf = shelf / harev & xalphac, vOC, shelf, vOA_of f, vOB_of f, vOc_of f cormnon/const4 /xmin, xmax, tipts, d%, npacket, iabsA, nxabsA, absfacA, read (f_in, .) nlevel, Aoffset & iabsB, nxabsB, absf acB Aoffset = Aoffset I harev connnon /pot/ zpot (npts, 3 ) Comnon Ipottypl ipottypA, ipOttypB, ipottypc, isavpotA, isavpotB, read (f_in, ‘ ) ireadA, lreadB, irevB & isavpotC, isavpsiA, isavpsi B, isavps XC, Xelgeti, ieigenB, to & isavpot_shift read (f_in, . ) xmi”, xmax, nxpts xnr,eger f-in, f_Out, f_nOrmA, f_nOrmB, f-matrix, f_temp, xmin = xmin I aO & f_temp2, f_temp3 xmax = xmax I aO cormnon 1 files/ f_in, f_Out, f_normA, f_nOrmB, f_matr2x, f-temp, dx = (Xmax - xmin) I nXpts & f_temp2, f-temp3

read (f_ln, .) hvl, fwhml, dmul, itnel C SURFACE A (anion ground state )------hvl = hvl / harev fwhml = fwhml 1 atu C set the potentxal by reading potential type drnul = dmul / ao domegal = hvl I hb read{ f-in, . )ipottypA if (itypel .eq. O) then sechl = sechfactor / fwhml C For each type read relevant parameters: else C (expect XO x“ Angs, omega, and wexe in cm-1 a“d Vo, De m ev, alpha Ln Angs-1 ) sechl = gauss factor / (fwhml < fwhml ) endx f if (lpOttypA .eq, O) then read( f_ln, . )XOA, deA, xalphaA, vOA read (f-in, . ) fwhm2, thresh C convert to au fwhm2 = fwhm2 / atu xOA=XOA/aO proberange = fwhm2 . thresh deA=deA/harev xalphaA=xalphaA. aO read (f_in, 1 ) labsA, absfacA. nxabsA xwexeA=xalphaA. .2/ (2 O.xmas I read lf_in, .I $abs B, absfac B, nxabs B xomegA=dsqrt (4 O.xwexeA, deA) vOA=vOA/harev C Read in potential energy function parameters Call morse(l, xOA, deA, xalphaA, vOA)

call oot:ead () else if lLpoctypA eq, 1) then read( f_xn, . )xOA, xOmegA, xwexeA, vOA C convert to au C SURFACE C (neutral )------xOA=xOA/aO

xomegA=xomegA/harwn read (f-in, ● )ipot typC xwexeAvxwexeA/ha rwn vOA.vOA/harev if (ipottypC .eq. O) then c It Morse. convert potential parameters Co reciprocal bohr and hartrees. .. read (f_in, ● )xOC, dec, xalphac, vOC if (xwexeA .ne. O. OdOO) then xOC.xOC/ aO xalphaA=dsqrt (2.OdOOg xmas ‘xwexeA) deC=deC/harev

deA=xomegAW ● 2/ (4. OdOO ●xwexeAl xalphaC.xalphaC*aO c ipot typA=O xwexec=xalphac+ ●2/ (2,O ●xmas ) call morse 11,xOA, deA, xalphaA, vOA) xomegC=dsqrt (4. O*xwexeC*deC ) else vOC=vOC/harev call harmonic (1,xanas,xOA, xomegA, vOA) call morse (3,xOC, deC, xalphac, vOC) endi f else if (ipottypC .eq. 11 then

else if (ipOttypA .eq. 3 ) then read (f_in, ● )xOC, xomegC, %wexeC, vOC vOA . read_user_pot (1) xOC=xOC/aO xomegC.xomegC /harwn else xwexeC.xwexeC/harwn 100 format ( ‘ Problem with surface A potential type. ‘) vOC=vOC/harev write (*, 100) if (xwexec .ne. O. OdOO) then write If_Out, 100) xalphaC.dsqrt (2.OdOO*xmas*xwexeC) s top deC=xomegC*g21 (4.OdOO*x-+!exeC) endi f ipOttwC.O call morse (3,xOC, deC, XalphaC, vOC) c SURFACE B (anion excited state )------else call harmonic (3,xmas, xOC, xomegC, vOC)

read( f_in, ● )ipottmB endi f

if (ipottypB .eq. O) then else if (ipottypc .eq. 3 ) then

read (f_in, ● )xOB, deB, xalphaB, vOB vOC = read_user_pot (3) xOB.xOB/aO deB.deBlharev else xalphaB=xalphaB*aO 120 format (,Problem with surface C potential type. ,) xwexeB.xalphaB* .2/ (2.Ovanas ) write (*, 120) xomegB=dsqrt (4. O*xwexeB”deB) write (f_Out, 1201 vOB=vOB/harev s top call morse (2,xOB, deB, xalphaB, vOB) endi f else if (ipottypB .eq. 1)then read( f_in, ● )xOB, xomegB, xwexeB, VOB return xOB=xOB/aO end xomegB=xOmegB/harwn xwexeB=xwexeB/harwn c ● **.**************************** ● ***..*****...***************...**********.**. vOB=vOBlharev subroutine harmonic (ipot, xmas, %0, xomeg, VO ) if (%wexeB .ne. O. OdOO) then c ● ********************************* ● +********************.. ● *****.**.*****..*.. xalphaB=dsqrt (2. OdOO ●xmas*%wexeB) C 12/8/96 (BIG) Note shelf moved Co main subroutine. deB.=xome9B*’21 (4.OdOO”xwexeB) ipot typB=O i~licit real”8 (A-H, O-Y) call m0rse(2, xOB, deB, XalphaB, vOB) in@icit cot@ex*16 (Z) else parameter (npts - 2048) call harmonic (2,mnas, xOB, xomegB, vOB) common /convert/ harev, em, aO, amu, emu, harwn, amass, atu endi f common /const2/ xOA, xomegA, vOA, x’#exeA, dea, xalphti, xOB, & xomegB, xwexeB, deB, xalphaB, vOB, XOC, xomegC, %wexeC, dec, else if (ipottypB .eq. 3) then & xalphac, vOC, shelf, vOLoff, vOB-off, vOC_off vOB . reacL-user_POt [2) con’mwnlconst4 Ixmin, mn.nx,nxpts, d%, npacket, iabsA, nxabsA, absf acA, & iabsB, nxabsB, absfacB else common /pot/ zpot (npts, 3) 110 format (,Problem with surface B potential type. ‘1 write (*, 110) 99 format (a. f5.1, a) write (f_OUt, 110) write (6. ‘] stop endi f do 120 ix = 1, nxpts XL=mm+(xx.l). dx else lf (*pot eq, 2 ) then Zpot (1x, xpot) = O. 50dO0 . xm.as . (xomeg . (xi - xO)) .. 2 + VO pot_fn = ,potB, i“, 120 continue else >f (Lpot .eq. 3) then pOt_fn = ,pOtC. In, return endl f end c read{ f_in, “ ) vO, pOt_fn .. VO = VO t harev c ...... *...... ,,...... *...... subroutine morse (ipot, xO, de, xalpha, VO ) 100 fOrmat(, POt = ,, il. , File = ‘. al c ...... ”’*”’...... ”...... ,...... ,.*...,*...... write (f_Out, 100) ipot, pOt_fn

C 12/8/96 (BJG) Note shelf moved to maxn subroutine, wr xte (● , 100) ipot, pOt_fn

impliclt real”8 (A-H, o-Y) .open(f_temp, file = pot_fn) implicit complex.16 (Z) read( f_temp, ‘ ) xmin_temp, xmax-t emp, nXpts-temp parameter (npts = 2048) xmin_teW = xmin_te~ / aO common Iconvertl harev, evv.n, aO, am”, emu, harwn, amss, at” xmax_temp = mnax_temp I aO connnon Iconst2 / XOA, xomegA, vOA, xwexeA, dea, xalphaA, xOB, dx-temp . (xmax_temp - xmin_temp) / nxpts-tew & xomegB, xwexeB, deB, xalphaB, vOB, xOC, xomegC, xwexeC, dec, & xalphac, vOC, shelf, vOA_of f , vOB-of f , vOC_of f do ix = 1, nXpts_temp com’nnon/const41xmin, xmax, IIXpts,&, npacket, iabsA, nxabsA, absfacA, read( f_temp, . I vtemp( ix) & iabsB, nxabsB, abs facB vtemp (ix) = vtemp( ix) / harev + VO cmunon /pot/ zpot (npts, 3 ) ‘./ enddo ..,. close (f_temp) 99 format (a, f5 .1, a) write (6, .) C Interpolate potential to fit current grid ,<

do 120 IX = 1, rlXPtS do lX = 1, IIXpts xl=xmin+(ix-l)*dx x=x.min+(lx-l). dx g zpotl ix, ipot) = de . (1.OdOO - dexp (-xalpha . (xi - xO ))) .. 2 if (x .lt. xmin-te~) then & + Vo zpot(ix, ipot) = vtemp(l) w 120 contxnue else if (x ge. xmax-tenp - dx-temp) then !990222 BJG: Added -d%_temp zpot (ix, ipot) . vf.emp(nxpts-cemp) s return else ~ end ix-temp = Lnt ((x - xmin_temp) / d.x_temp] + 1 x x_temp = xmm_temp + (ix_temp - 1) . dx-te~ ,, c ...... *...... ’” ...... ***...... zpot (ix, xpot ) = (vtemp (Ix-temp) . (x_teW + N ,..) real.8 function read_user_pot (ipot I & dx_temp - x) + vtemp(ix_tenp + 1) . (x - x_temp)) ;..> i c ,,,...,,,.,,.,...”’” ● ****.....*..**...... *....,...... & / dx_temp C Read vO, potential filename from input-deck, then read potential from file, end> E : C save in zpot (ipot) . Perform interpc.1.atlon mtcmmtically. enddo

impliclt real’8 (A-H, O-Y) read-u ser_pot = VO implxcxt complex .16 (Z) return parameter (npts = 2048) end common )converti harev, ewm, aO, amu, em”, harwn, amass, at” common /cons t4/xmin, XII&3x.nXpts, d%, npacket, iabsA, nxabsA, absfacA, c ...... ,..**...... & iabsB, nxabsB, absfacB subroutine initA (tx, zpslA) convnon /pot/ zpot(npts, 31 c ...... integer f_in, f_Out, f-nOrmA, f-norti, f_m.atrxx, f-temp, C Initialize the wave function array o“ anion ground state swface, & f-temp2, f-temp3 common 1 files/ f-n, f-out, f_nOrmA, f-n0rrr5, f_matrix, f_temp, lmpliclt real’8 (A-H, o-Y) & f_temp2, f-temp3 lmpllclt complex .16 (Z) parameter (npts = 2048) character. 80 pot_fn Cormon lConvert/ harev, evwn, ho, amu, em”, harwn, amass, atu real.8 dx-temp, nxpts-temp, vO, vcemp(npts) , comnon /cOnst O/ zero, zeye, PL, c, twop~, scjrtpi, p~sq, & x, xnmn-temp, xmax_temp, x.t emp & alessthanhalf integer Iflle, ix, xx-temp common /constll xmas, hb, sechfactor, gauss factor common /c0nst21 xOA, xomegA, vOA, xwexeA, dea, xalphaA, XOB, ..., C Read potential & xOmegB, xwexeB, deB, xalphaB, vOB, xOC, xomegc, xwexec, dec, & xalphac, vOC, shelf, vOA-Oi f , vOB-of f , vOC-of f readl f_m, . ) VO conunon /cOnsc.3/ tstep lf llpot eq 11 then comnOn/cons t4/mnln, mnax, nxpts, dx, npacket, ;absA, nxabsA, absfacA, pot_fn = ‘potA Ln< & labs B, nxabs B, absfacB common /pottyp/ ipottypA, ipottypB, ipottypc, isavpotA, isavpotB, parameter (npts E 2048) & isavpotC, isavpsiA, isavpsi B, isavpsiC, ieigeti, ieigenB, common /convert/ harev, evwn, aO, amu, em”, harwm, amass, atu & isavpot_shi Et common /cOnst O/ zero, zeye, pi, c, twopi, sqrtpi, pisq, integer f_in, f_OuC, f_nOrmA, f-norti, f_matrix, f-temp, & alessthanhalf & f_temp2, f_temp3 common Iconstl/ xmas, hb, sechfactor, gauss factor conunon / filesl f_in, f-out, f_nOrmA, f_nOrmB, f-matrix, f_temp, Comnc.n lconst21 xOA, xomegA, vOA, xwexeA, dea, xalphaA, xOB, & f_temp2, f_temp3 & xomegB, xwexeB, deB, xalphaB, VOB, xOC, xomegC, xwexec, dec, & xalphaC, vOC, shelf, vOA_off, vOB_off, vOC_off c LOCal declarations: common /c0nst3/ tstep con’anon/const4Ixmin, xmax, ftipts,d%, npacket’, iabsA, nxabsA, abs facA, dimension zpsiA (npts) & iabsB, nxabsB, absf acB c Place the initial wavepacket on surface A. C Local declarations: c If using a fully flexible potential, i.e. , from a file, then need the c initial (ground) wave function of the ground state surface supplied dimension zpsiAO (npts) , zpsiAl (npts) c explicitly: use anionwf subroutine that reads Id wavef unction from file dimension zHpsi(npts) , zpsiAI (npts) c in the fwfnat produced by the FCF program of Ellison. c dimension zHpsiAO (npts), zpSiAI (npts), zHpsiAI (npts ) complex* 16 zf actor_div_4, zfactor_div_2 if (ipottypA .eq. 3) then call anionwf (1, zpsiA) zfactor_div_4 . zfactor I 4. else zfactor-div_2 = zfactor I 2. if (ipottmA .eq. 4) then call psiread (1, zpsiA) call Hpsi (wf, ti, zpsiAO, zHpsi) else do ix . 1, nXpts c if (ipottypA .eq. 1) then zpsiAI (ix) = zpsiAO (ix) + zf actor_div_4 ● zHpsi (ix) c call initWF lzPsiA) enddo c else call Hpsi (wf, ti, zpsiAI, zHp6i) call morsewf (zPsiA) do ix . 1, nKpts c endi f zpsiAl (ix) . zpsiAO (ix) + zfactor_div_2 ● zHpsi (ix) endi f enddo endi f c call Hpsi (wf, ti, zpsiAO, zHpsiAO) C Check the norm and energy of the stationary state on the lower potential c do 20 ix . 1, nXpts

c zpsiAI (ix) = zpsiAO (ix) - zeye ● (tStep I 2. 00d0O) ● zHpsiAO (ix) call chk (1, ti, zPsiA, rsnorm, Have) c & /hb C20 continue write (*, ●) c call Hpsi (wf, ti, zpsiAI, zHpsiAI)

write (f-out, ● ) c do 30 ix = 1, nKPts c zpsiAl(ix) = zpsiAO (ix) - Zeye ● tstep . zHpsiAI (ix) / hb 100 format (‘Norm of initial wavefn is ‘, f12.6) C30 continue write (*, 100) rsnorm write (f_Out, 100) rsnorm return end 110 forma t(’l?nergy (on lower surface] =’, f10.5, 2x, f10 .2, & ‘cm”-l’ ) write (*, 110 ) Have/ rsnorm, Have* harwn/rsnorm write (f_out, 110 ) Have/ rsnorm, Have* harm/ rsnorm

return end implicit real*8 (A-H, O-Y) implicit complex*16 (Z) ~ ...... * ...... *....*...**. . .. . parameter (npts = 2048) subroutine rk2 (wf, zw.iAO, zpsiAl, zfactor) couanon /cOnstO/ zero, zeye, pi, c, twopi, sqrtpi, pisq, c subroutine rk2 (wf, zisiAO, zPsiAl. ti ) & alessthanhalf c ...... common Iconstll xnms, hb, sechfactor, gauss factor C Generate zpsiAl from zpsiAO using second-order Runge Kutt.5 ‘RK2- ) on surface common /const2/ XOA, xomegA, VOA. xwexeA, dea, xalphaA, xOB, c Wf (l-3). & xomegB, %wexeB, deB, xalpbaB, VOB, xOC, xomegC, %wexeC, deC, c 8f13197 note: Made more flexible by including zfactOr as ar9~ent (s0 can & xalphac, vOC, shelf, vOA_Off, vOB_off, vOC_off C propagate backward) : more efficient by calculating fractions of zfactor once. conunonlconst4 Ixrnin,ax, fipts, d%, npacket, iabsA, nxabsA, abs facA, c Got rid of ci -- never used. & iabsB, nxabsB, absf acB

iWliCit real’8 [A-H, O-Y) C Local declarations: implicxt complex” 16 (Z) dxmensxon ZPSIAO (npts) C ward FFT to evaluate 2nd derivative

C Inlt Ial wavefn on surface IS ground harmonic oscillator. Only does the ground implicit real.8 (A-H, O-Y) C state wave function (lowest quantum state) : for higher vibrational wave func - inplicit [email protected] (Z) C tions see the 2-D code. parameter (npts . 2048) common lcOnstO/ zero, zeye. pi, c, twopi, sqrtpi, plsq, 1 f (xomegA eq. O. OdOO ) then & alessthanhalf write (6, .) ‘No initial wavepacket as no omega available, couanon lconstl/ xmas, hb, sechfactor, gauss factor stop cormnon /c0nst3/ tstep endi f conmmn/const41xmin, XI&IX,nxpts, d%, npacket, iabsA, nxabsA, absf acA, xt = xOA & iabsB, nxabsB, absfacB pt = 0. OdOO zat = dcmplx (0.OdOO, %mas . xomegA I 2. OdOO) C Local declarations: gt = -Ihb 1 4. OdOO) . dlog (2 ● dimag (zat) / (PI ● hbl) zgt = dcnwlx (0. OdOO, gt) dimension zpsix(npts) , zpsiK (npts)

c write 12,910) xt, pt, zat, gt C Backward Fourier tr.msform : zpsiX(x) .> zpsiK (k) 910 format (5(lx, e13 .6) ) isign = -1 do 10 ix = 1, nXpts do 10 ix = 1, nxpts xi=xmin+ (ix-1). C3X 10 zpsiK(ix) = zpsix(ix) zarg = zat . (xi - xt) , (xi -xt)+pt *(xi- Xt) + Zgt call FFT (zpsiK, nxpts, isign) zpsiAO (ix) = e%p (zeye , zarg / hb) 10 continue C Compute the second derivative in the momentum domain

return L=nXpts/2 end do20k=0, nXpts-1 if (k le. L) then ~ ...... zpsiK(k + 1) = -k . k . zpsi K(k + 1) / nxpts subroutine Hpsi (iPot, ti, zpsi, zHpsi) else ~ ...... zpsiK(k + 1) . -(nxpts - k) , (nXpts - k) . zpsi K(k + 1) / ‘ C Compute H . psi = ( KE + PE ) . PSI(X). & nxpts endi f implicit real*8 (A-H, O-Y) 20 continue lmplxcit complex’16 (Z) parameter (npts . 2048) C Forward transform : zpsiK (k) => zpsix(x} common lcOnst O/ zero, zeye, pi, c, twopi, sqrtpi, pisq, & alesschanhalf isign = 1 common Iconstll xmas, hb. sechfactor, gauss factor call FFT(zpsiK, nxpts, i.sign) connnon /c0nst3 I tstep common /cons t4/%min, %max, nXpts, d%. npacket, labsA, nxabsA, absfacA, C Scale results & iabsB, nxabsB, absfacB XL = xmax - xmin

C Local declarations: Cl = -0.5dO0 ● hb . hb [ XllUIS

C2 . 4 ● pisq / (xL ● xL) dimension ZPSI (npts) , zHpsi (npts) C= C1*C2 dimension zpsiPE(npts) ,zpsiKE(npts) do 30 ix = 1, nxpts zpslK( ix) = c . zpslKlixl call KEmat (zpsi, ZPSIKE, tl) 30 continue call PRnat (iPot, zpsi, zpsi PE) return do 10 lx = 1, nxpcs end zHpsl (lx) = zpsi PE (lx) + zpsiKE( ix) 10 continue c ...... AS...... ,...... subroutine PSm.-.t (lpot, zpsi%, ZPSIP) return c ...... , e,...... ,,...... , ...... end C Calculate zpot (x) . ZPSIX = zpsl P. Note ZPSLX(l) .-> zpsi X(xO) , zp.slx(nxptsl c <-> Zpslx(xf) , etc c ...... ,,,,..*,.....* subroutine Kl?mat (zPs IX, ZPSIK, t] lWllC>t real.8 (A-H, o-yj ~ ...... xmplxcxt complex .16 (Z) C Computes (-hb ,- 2) I (2 , Xmas)) . Id / d%l ,4 2[ZPSIX1 = ZPSLK Note parameter (npts = 2048) c Zpslx (l) .-> Zpsl(xo). zi~silnxpts) .-> zpsix(xfl etc Uses forward and back- cOmunon/const4 {aln, max. nxpts, dx, npacket, labsA, nxabsA, absfacA, & L?.bsB,nxabsB, absfacB 10 s.pi*l O,lllj common /pot/ zpot (npts, 3 ) do20k=0, j-1 icnt = icnt + 1 C Local declarations: 20 cstore(icntl a exp(s . k) ]=j+j dimension zpsiX(npts) , zpsiP(nPtsl if (j .lt. npts) goto 10

do 10 ix = 1, nXpts return zpsi P(ix) . zpot(ix, ipot) “ zpsix(ix) end 10 cent inue

c ● *******..********** ● *** ***** ** ***99*.** ● *....”.. ****. ”....* ● .....*.... return subroutine FPT (%, n, isign) end c ● . **.. **. ***.. ***.. *.....**..* ...... **** ..**. **......

~ ● ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ● ☛✎✎ *”...... ”... “...... ,, .,..”..* c ● **********.*****.**** ● *** ...... **...... subroutine potlsave (ipot ) C . The fft computes the discrete fast Fourier transform of a .

~ ● ***...... *...*...”****. ● .**.. **** ...... ”””...... *. C ● sequence of n terms. ● C Save potential function ipot (= 1-3) to file. C ● The forward FFT computes ✎ c* y(j)= sum (from k=O to n-1) xlk)*exp(2*pi*i* j*k/n) ● implicit real*8 (A-H, O-Y) C ● the backward FPT computes ✎ implicit complex*16 (Z) C* y(j)= sum (from k=O to n-1) x(k) *exp(-2*pi* i*j*k/n) ✎ parameter (npts = 2048) C* common /convert/ harev, evvm, aO, am, emu, harwn, amass, atu C ● x is a complex array of length n. ✎ comnon/const4 /xmin, xmax, nxpts, dx, npacket, iabsA, nxabsA, absfacA, c* n is a power of 2. n<=16384 ✎ & iabsB, nxabsB, absfacB C ● isign is the direction of the tramsform. If isign >. 0 then. common /pot/ zpot (npts, 3 ) C ● the fft is forward , otherwise backward. . integer f-in, f_Out, f_nOrmA, f_nOrmB, f_rmtrix, f_temp, C*

& f_temp2, f_temp3 C ● Ref. Cooley, Lewis, Welch. The FPT and its applications ● common /files/ f-in, f-out, f-norti, f_nOrmEt f>trix< f-temp, c. IEEE Trans. on Education, vol. E-12 #l; p. 29 . & f_temp2, f_temp3 c ..*** .*9** .....*. *.*.. ***. **. *.. *.*. **.. *.. *... *.**... *."....**

if (ipot .eq. 1) open (f_temp, file = ‘potA. out’ ) C 1997 .10.3 BJG: Note that original implementation, where first call if (ipot. eq. 2) open (f_temp, file = ‘potB. Out’ ) C automatically generates an array of values for use in subsequent calls, if (ipot. eq. 3) open (f_temp, file . ,pOtC. Out, ) C has been moved to a separate function FFT_prep which must be called do 10 ix = 1, nXpts C first! xi. aO*(xmin+ (ix- I)*cLx) a = dreal (zpot (ix, ipot) ) ‘ harev implicit real*8 (A-H, O-Y) write (f-temp, 9301 xi, a parameter (npts=2048 ) 930 format (2x, f8.3, 2x, f20.10) complex*16 v, w, x(npts) , cstore (npts) 10 continue common /fftvarsf cstore

● ● close If_temp) c *.*. .B~t rever=a~, ...... *. return C The x(j) are permuted in such a way that each new place number j is end C the bit reverse of the original placenumber, c ● .*..*...... *.* .**** .**** ...... ” ”*...... j=l subroutine F’FTareP do30i=l, n c ● ....* ..**. ***.. ***..* ● *** .*...... if (i le. j) then C Create array of values to be used by PPT routine; must call this before v = x(j) c any calls to PFT. x(j) = x(i) x(i) = v implicit real*8 (A-H, O-Y) endi f parameter (npts=2048) m.n12 complex’16 s, cstore(npts) 25 continue common /f ftvarsl cstore if (j .gt. m) then j= j-m C The roots of unity exp(pi”i”k/j) for j=l,2,4, ..,n/2 and k=0,1,2, .,1-1 m.ln12 c are computed once and stored in a table. This table is used in subse- if (m .ge. 1) go to 25 C quent calls of fft. else j=j+m pi = 3.14159265358979 dO0 endi f j=l 30 continue icnt = O c ...,...... Mcltrlx multlpl lcatlorl...... end C The roots of unity and the x(j) are multiplied. c ...... ,=1 subroutine chken (ipot, ti, zpsxA, Hav) .,.. icnt = 0 c ...... 40 jj .]+> C Check that energy is conserved during numerical integration of the TDSE, . do50k=l, j icnt = xcnt + 1 implicit real.8 (A-H, O-Y) w = cstore(icnt) m’@xcit [email protected] (z) if (isign ,lt, O) w = dconjg (w) parameter (npts = 2048) do50i=k, n,j] comnon/const41xmin, xrnax,nxpts, d%, npacket, iabsA, nxabsA, absfacA, v=w. x[i+j) & :absB, nxabsB, abs facB x(i + j) = x(i) - v 50 x(i) = x(i) + v C Local declarations: j=jj if (j ,lt, n) goto 40 dimension zpsiA(npts) , zHpsiAlnpts) , psiHpsi (npts)

return call Hpsi (ipot, ti, zpsiA, zHpsiA) end do 10 ix = 1, nxpts psiHpsilix) = dreal(dconjg (zpsiA(ix) ) . zHpsiA(ix) ) c ..,,,*,**’””**””’”” ,, ...... *.** ****...... ******* ...... +...... 10 continue subroutine chk (ipot, ti, zpsiA, rnorm, Ha.?) c ..,,,,,*.****”””””’” ., ...... * **.**...... ,..,.,,,*..******. ● ...... **... call Simpint (nxpts, psiHpsi, CLX, Hav) C Check that norm and energy are conserved. :, return implicit real.8 (A-H, O-Y) end .’( implicit complex .16 (Z) parameter (npts = 2048) c ...... *.*...... g subroutine simpint (nx, f1, d-x, fint ) C Local declarations: c ., ..,....**********. ● ...... w C Sim@son Rule integrator. This subprogram calls the trapezoidal integrator dimension ZPSIA (npts ) C twice. Because of cancellation of errors the result is accurate to the the s C order of (1/n%. *4) Rule valid only when nx odd. Hence for even n% the last a call chknrm (zpsiA, rnorm) C piece of area ““der f1 (n%-l) md f2 (nx) IS added by trapezoidal rule. M. ,. call chken (ipot, ti, zpsiA, Hav) c x ,<,- C Reference ‘Numerical recipes V Press, Flannery, Teukolsky, Vetterling N ; t, return C Cambridge University Press, Cambridge (1986) end i!@iCit real.8 (A-K, O-Y) 4 c .., ...... ’...’***.’” ...... ● *....,....*.....*.. ● ...... sub rout in.? chknrm (ZPS i, rnorm) C Local declarations: c ,...... ~...... ,*...... ● ...... * C Check that the norm 1s conserved during numerical integration of TDSE, parameter (nypts = 2048) dimension fl(nypts) , f2(ny@s) implicit real.8 (A-H, O-Y) implicit complex .16 (Z) C Define: parameter (npts = 2048) ... comnon/cons t4/xmin, xmax, nxpts, dx, npacket, labsA, nxabsA, absfacA, &l. & & iabsB, nxabs B, absf acB dx2 = 2,0dO0 , d% Lxn = O C Local declarations: Lf (n% ,gt, nypts) then dimension ZPSI (npts) , pslsq(npts) write (6, .) 8 simpxnt nx gt. nxpts = 9, nypts endi f do 10 xx = 1, nXpts rps> = dreal (ZPSI (LX) ) if (mod (nx, 2) eq O) then aipsi = dimag (ZPSLI 1%) ) nxl=nx-1 pslsq( ix) = rPSI . rpsl + alpsl . alpsl nx2 = 0.50dO0 - nxl + 1 10 continue fmt = O 50dO0 . dx . (fllnx - 11 + fl(nx)) else call slmplnt (nXpts, psisq, dx, rnorm) nxl = n.x nx2 . 0 50dO0 . nxI + I return fint = O. OdOo end if end c COPY the odd elements of farray into f2. c ...***...... ● .** ***** ...... subroutine zsimpint(nx, zfl, d%, zint) do 10 ix = 1, nxl, 2 c ...*.****...... *...... ixn=ixn+l C Complex Simpson, s rule integrator. 10 f2(ixn) = fl(ix) implicit real.8 {A-H, O-Y) c Now integrate f1, f2 in two pieces. implicit complex*16 (Z)

call trapint (nxl, fl, *1, fintl) C Local declarations: call trapint lnx2, f2, tLx2, fint2)

fint = fint + (4.OdOO ● fintl - fint2) I 3. OdOO parameter (nypts = 2048] dimension zfl (nypts) , zf2 (nypts) return end C Define:

~ .....*** ..**. *.*.. *.. **.*...... *...... **. ** ...*. ”..*...... dxl.dx subroutine trapint (npts, f, CLX, fint) dx2. d% .2. ~ ● .*”** ...... * ....*.***.*..**.* ● ...... ● **..*****...*,,,. ixn . 0.

implicit real*8 (A-H, O-Y) if (n% .gt. n~ts) then write (6, ●) , zsimpint : nx .gt. nypts = ,, nypts C Local declarations: endi f

dimension f (npts ) if ((mod (nx, 2) .eq. O)) then n%l. nx-l C Trapeziodal rule integrator for E (1) - f (npts) .-> f (xO) - f (xf ) . nx2 = 0.50dO0 ● nxl + 1 zint = 0.50dO0 ● CLX g (zfl(nx - 1) + zfl(nx)) fint = O. else n%l. nx

do 100 i = 2, npts - 1 IIX2 = 0.50dO0 ● nxl + 1 fint = fint + f(i) zint = O. OdOO 100 continue endi f

fint = fint + (f(l) + f(npts)) / 2. OdOO C Copy the odd elements of zf 1 array into z f2. N

fint = fint ● .5x do 10 ix . 1, rtxl, 2 return ixn=ixn+l end 10 zf2(ixn) = zfl(ix)

~ .“ ”.*... **. *.”.. **.. ”**...... *****,,,.. c Now integrate zfl, zf2 in two pieces. subroutine ovlp(zpsil, zpsi2, ZOVPI c .*.. **...... **...... *... ..,.,,, *“****.*.* call ztrapint(nxl, zfl, dxl, zintl) C Find the overlap integral. call ztrapint (nx2, zf2, dx2, zint2) Zint = zint + (4.OdOO ● zintl - zint2) / 3. OdOO implicit real’8 (A-H, O-Y) implicit complex*16 (Z) return parameter (npts = 2048) end common/ const4/xmin, xmax, nXpts, d%, npacket, iabsA, nxabsA, absfacA, & iabsB, nxabsB, abs facB c ● ******** **.. *.. *** *.*** **. ** ...... * ...... subroutine ztrapint(npts, zf, &, zint) C Local declarations: c ***** *.*.. *....** ...... *. + ...... **. **... ● ...**.

dimension zpsil (npts) , zpsi2 (nptsl , zprodlnpts) iMPliCit real*13 (A-H, O-Y) iwlicit cowlex*16 (Z) do 10 ix . 1, nXpts cormnon /cOnstO/ zero, zeye, pi, c, twopi, sqrtpi, pisq, zprod(ix) = dconjg (zpsil (ix) ) ‘ zpsi2 (ix) & alessthanhalf 10 cent inue C Local declarations: call zsimpint (nxpts, zprod, dx, ZOVP) dimension zf (npts) return C Trapezoidal rule integrator for f(1) - f(npts) <-> f(xOl - flxf) ifd~cit real.8 (A-H, O-Y) mplxcxt complex.16 (z) zxnt = zero parameter (npts = 2048) common /convert/ harev, evwn, aO, amu, em”, harwn, amass, at” do 100 i = 2, npts - 1 common /cOnstO1 zero, zeye, pi, c, twopi, sqrtpi, pisq, zint = zint + zf (i) & alessthanhalf 100 cent inue conrnOn/cons t41xInin,mm%, nXpts, dx, npacket, iabsA, nxabsA, absfacA, zmt = zint + (zf(l) + zflnpts)) / 2. OdOO & iabsB, nxabsB, abs facB zint = zint . dx integer f_in, f_Out, f-nOrmA, f_nOrmB, f_matrlx, f-te~, & f_tew2, f_temp3 return comnon /files/ f_in, f_Out, f-nOxmA, f_normB, f_matrix, f_twnp, end & f_terrp2, f_temp3

~ ...... C Local declarations: function ZE1 (t ) c ...... **.*...... ”*...... ,....,..,*,*,,.* dimension zpsi (npts) , zpsik(npts) c Returns (complex) value of dipole moment AB ‘ E-field of laser pulse 1 at time C t. Note that cosh term is not squared: I = E-2 = llcosh”2, but this is calcu - C First do position representations: C latmg just E = l/cosh. open(f_temp, file = ‘psi- // char (64 + ipot) II C 8dec96: Modified to not use fZeqUenCY since is always set to O by shifting & char(48 + npkt / 100) // char (48 + mod(npkt 1 10, 10)) c potentials around. & // char(48 + mod(npkt, 10)) // ,.sq-) open(f_temp2, file . ,psi, II char (64 + ipot) II implicit real.8 (A-H, o-y) k char (48 + npkt I 100) 11 char(48 + mod(npkt I 10, 10)) implicit complex*16 (Z) & II char (48 + mod(”pkt, 10)) II ,.real, ) common /convert/ harev, evwn. aO, amu, emu, harwn, amass, atu open (f_temp3, file = ‘psi, // char(64 + ipot) II common /const O1 zero, zeye, pi, c, twopl< sqrtpi, pisqo & char(48 + “pkt / 100) II char(48 + mod(npkt / 10, 10)) & alessthanhalf & // char (48 + mod(npkt, 10)) // ,.du!rpS) common lconst8/ hvl, Ewhml, dmul, domegal, sechl, itypel, ipropA, c open (f_temp, file . ,psi- // char (64 + ipot) II char (65 + & ipropB, ipropC, iCpot, nlevel, AOf fSet, Eint, fwhnt2, thresh, c t, npkt) II ,.sq, ) & proberange, ireadA, ireadB, lrevB c open (f_temp2, file = ‘psi, 1/ char (64 + ipot) II char (65 + c & npkt) II ,.real,) if (itnel .eq. O) then c open (f_temp3, file = ,PSX, II char (64 + ipot) II char (65 + ZE1 = dmul / cosh (sechl . t) c & npkt) // ,.dump, ) else ZE1 = dmul . dexp (sechl . t ‘ t) do ix = 1, nxpts to endi f xi=mnin+ (ix-1). dx xiA . xi . aO c if (itypel .eq. O) then re = dreal (zpsi (ix) ) c zE1 = dmul . cexp (cmplx (-zeye - domegal . t) ) 1 cosh (sechl . t) ai = dimag (zps~( ix) ) c else sq=re”re+ai” ai c ZE1 = dmul , cexp (cmplx (-zeye . domegal . t )) “ dexp(sechl , t . 902 format (2x, f8,3, 2x, f20,10) c & t) write (f_temp, 902) xiA, sq c endi f write (f_temp2, 902 ) xiA, re write (f_temp3, .) -cpsi(ix) return enddo end close (f_temp) close (f_temp2 ) c ...... close [f_temp3 ) subroutine pktsav (zpsi, npkt, xpot ) c ...... C Now do momentum representation: C Save wavepacket xn different file for each shot and each potential surface C selected. Code is PsIXY Z, where do IX = 1, nxpts c zpsik (ix) = zpsi (ix) c X = surface A, B, C, indicated by lpot = 1, 2, 3 enddo c Y = A, B, etc for first, second, etc save mtervc.1 c z = sq (pos; tion and square) call FFT (zpslk, nxpts, -1 ) 1 Backward Fourier transform c real (posit Ion and real part) call chknrm(zps~k, rnorm) 8 Get normalization constant c dump (real and lmaglnary part, useful for reading in later) if (rnorm eq O) then 1 Trap for /0 error c mom (posltlon and square, in momentum representation) (only If enabled] rnorm . 1 c endi f C Also append current wavepacket to w.avepktx out (X = surface A. B, Cl op.n(f-temp, file = PSI II char(64 . ~potl II & char (48 + npkt / 100) /1 char (48 + mod(npkt / 10, 10)) & iabsB, nxabsB, abs facB & // chnr148 + mod(npkt, 10)) // ‘mom, ) integer f-in, f_Out, f_nOrmA, f-norm, f_matrix, f_temp, c open (f_temp, file = ,psi , II char (64 + ipotl II char (65 + & f_temp2, f-temp3 c & npkt) // ,.mom, ) conunon /files/ f_in, f_Out, f_nOrmA, f~OrmB, f_matrix, f_temp, & f_temp2, f-temp3 L . nXPtS / 2 XL = xmnx - %min C Local declarations: C2 = twopi / XL dimension zpsi (“pts) doi=. -L, L-l if (i .lt. O) then open (f_teMP, file= ’psi’ 1/ char (64 + ipot) II ,.inp, ) ix=nxpts+i+l do 100 ix = 1, nxpts

else read (f-temp, ● ) zpsi (ix) ix=i+l 100 continue endi f close (f-temp) xiA=c2*i re = dreal (zpsik(ix) ) return ai = dimag (zpsik(ix) ) end sq=re*re+ai *ai

write (f_temp, 902) xiA, sq / rnorm c ● *************.****************.. ● ....* .** ...... *. ****...... enddo SUBROUTINE ANIONWF (ILEVEL, ZPSI )

close (f-temp) c ● ***.***.************** ● ***** ****. *...... ● *.*** ***** ...... ********** c Anionwf stolen from READFCF8 return c Read the wave fuction off the fort. 4 file of a end c FCF program job (code of Ellison et al. ) c This can actually pull off any wavefunction (excited vibraticmal c states ) from the wave function calculated for the LOWER potential c using that program. To use this feature change ILEVEL from 1 in c calling routine

c This routine is mandatory if the user uses a general potential implicit real*8 (A-if, O-Y) c from a file for the LOWER potential in the wavepacket calculation implicit complex*16 (Z) c

parameter (npts = 2048) IMPLICIT real ● 8 (A-H, O-Y) conumon/const4 /xmin, xnmx, nxpts, d%, npacket, iabsA, nxabsA, absf acA, Implicit Con@ex*16 (z) & iabsB, n%absB, absf acB parameter (npts = 2048) integer f_in, f_Out, faormk, f_nOrmE, f_matrix, f_temp, DIMZNSION NSli(2) ,PcOEFS(2,6) ,XKOUT(75) & f_temp2, f_temp3 DIMENSION v(75,2), NPoT(2), E(2,50), VJ(2,70,50) common /files/ f-in, f-out, f-nornm, f_nOrmB, f_matrix, f-tempfl DIMSNSION ZPSI (npts) & f-temp2, f-temp3 c0mmonlc0nst4 Ixrnin,xmax, I’IXpts,dx, npacket, iabsA, n%absA, abs facA, & iabsB, n%absB, .gbsfacB C Local declarations: c dimension zpsi (npts ) C Read data from file fort. 4 C Lets allow the fort. 4 file to have data about upper surface for com,cmtibility open (f_temp, file= ’psi’ 1/ char (64 + ipot) II ‘out’ ) c do 100 ix = 1, nxpts 0PSN(4, FILE= -fort .4,) write (f_temp, ●) zpsi(ix) READ(4, 900) NOSC 100 cent inue 900 FORNAT(13 ) close (f_tew) IF(NOSC. EQ. 1) THEN READ (4,903) NEN(l), N return ELSE end RSAD(4,905) NSN(l), NEN(2), N SNDIF c ...* *....** ....*** ...... 903 FORMAT (213) subroutine psiree.d (ipot, zpsi ) 905 FORNAT(313) c ..****.*.************ ● ... ** .....****’”... ..**** ...... ● *...... *.**** NXNOT=N+4 C Read in wavepacket in raw form saved by psidump () . RZAOI4,91O) (XKOVT(I), I=l. NXNOT) 910 FORMAT(13(6F12.6. /) ) implicit real*8 (A-H, o-y) RSAO(4,915) NPOT(l), (PCOEFS(l, 1), I=1,6) implicit complex*16 (Z) 915 FORNAT[12, 6F12.6) parameter (npts = 20481 RSAD(4,920) (V(I,l), 1=1, NX220T) contmon/cons t41xmin, xnIc.x,IIXPCS.dx. npacket, iabsA, nxabsA, absfacA, 920 FOPJ4AT( (6P12 .7 )) READ(4 ,925) (E(l, JI, J=l, NSN(l)) C (nlevel suppl>ed in comnon block) 925 FORNAT(20F12 ,71 IF(NOSC, EQ.1) GO TO 10 C Calculate the ground Wavefn for enharmonic oscillator READ(4 ,915) NPOT(2), (PCOEFS (2,1), I=1,6) C Wavefn has following form ( see J. Res. N B.S. A 65, 451 (1961) )

READ(4 ,920) (V(I,2), 1=1, NXNOT) C psi(x) . norm . [K . expval(x) ]-(0. 5.1 K-1)) . e%p(-O.5*K ● expval(xll “.,. READ(4 ,925) (E(2, J), J=l, NSN(2)) C where : expval (x) = exp(-beta+x) 10 W 20 1=1, NEN(l) c norm = sqrt ( beta/gamma (k-1) ) RSAD(4 ,920) (VJ(l, J, I), J=l, N) 20 cON’N~E C This routxne will only calculate lowest wave function of a IF(NOSC. EQ.1) GO ‘TO 40 C Morse potential, for higher states (i.e. v=l I) see the 2d code ~ 30 1=1, NEN(2) READ(4,920) (VJ(2, J, I), J=l, N) C This method of calculating the wave f”nctvans of a Mc,rse oscillator 30 COmlmE C fails when the anharmonicity is very small (i,e, in the limit CLOSE(4) C of a harmonic oscillator) because the gamna function blows up. XH = XKOWT[2) - XKO~(ll C This limit is reached for mildly anharnmnic oscillators if ((xmm. O. 529177 - xkout (l)) ,gt, 0.0005) then C e.g. NCO- where we=2149 cm-l and wexe=12, 5 cm-l. write (6,.) ,xfnin= ,,0.529177 -CSX C In this case it is only a small approximation to use the H.O. write (6,*) ‘first knot at ,,xkout (l) C wavef unct ion for the anion ground vibrational wave Cunct ion .. write (6, ●) ofirst points dent match - Stopping, stop C Need to change two things to be able tocalculate wave functions endi f C with small anharmonicities. 1) Gamma blows us, so get rid of it, if ((xh-0.529177, d%) .gt. O. 0005) then C By trial and error, Anorm = 10d-250 keeps the function in bounds, write (6,.) ‘cLx= ,,0.529177*d% C 2) (AK. e%pval) -.((AK-l) /2) goes out of range. Split it in two write 16, .) ‘knot spacing= ,,xh C and multiply one half by exp[-AX*expval/2) first to keep it in bo””ds. write (6, .) ,Grid sizes dent match - Stopping- S top implicit real.8 (a-h, o-y) endi f implicit complex .16 (z) if (nknot .ne. nxpts) then parameter (npts . 2048) write (6,.) ,nXpts= ,,nxpts character .80 wave file write (6, .) ,nknots= ‘,nknots dimension zpsi(npts) ,argl (100) ,arg2 (100) ,aLeg(O: 100) write (6, .) ,Dont match - St0PPin9’ dimenshm psi”orrn( 100) endi f cOnunOn/c Onst Ol zero, zeye, pi, c, twopi, sqrtpi, pisq, 40 write (., ‘ ) ‘ cONS READING ‘ & alessthanhalf common/ cons t4/xmxn, xmax, tipts, dx, npacket, iabsA, nxabsA, ab.sfacA, C This has stored all needed and uneeded data & iabs B, nxabsB, absfacB c common Iconst21 xOA, xomegA, vOA, xwexeA, dea, xalphaA, xOB, N c Calculate wave function from spline coefficients & xomegB, xwexeB, deB, xalphaB, VOB, xOC, xomegc, xwexeC, deC, c Want the ground state wave function, 1=1: & xalphac, vOC, shelf, vOA_of E, vOB-of f, vOC_of f l= ILEVEL common lconst81 hvl, fwhml, dmul, domegal, sechl, itypel, ipropA, ZPSI(l)=VJ(l, l,I) + VJ(l,2,1)/4 & xpropB, ipropc, iCpot, nlevel, Aof fset, Eint, fwbm2, thresh, ZPSI(N)=VJI1, N,I) + VJ(l, N-1,1)/4 & prOberange, ireadA, ireadB, ir.3vB Do 100 J=2, N-1 ZFSIIJ) =VJ(l, J-1,1)/4 + VJ(l, J,l) + VJ(l, J+l, l)/4 C Form K = we/wexe and calculate gamma Cunctio” of (k-1) 100 CONTINUE c AK . xomegA I xwexeA c Get the correct sign for Wave functxon (+ at beginnmgl c c open(2332, fxle=5fuck. out8) ,... J=O c 0pen(2333, file=, ”Orm, o”t, ) 105 J.J+l lF(real (ZPSI(J)), GT.0) GO TO 110 C evaluate the gamma f“. IF(real (ZFS1(J)). EQ.0) GO TO 105 CQ 106 J=l, N ar9=AK-1 o VJ(l, J, I)=-VJ(l, J,l) c APOLY.l+l/ (12, 0.arg)+l/ (288, arg. arg) - 139/ (51840 .arg. .3) 106 ZPSI(J)=-ZPSI (J) c gak=dsqrt (twop~/.arg) . (arg. .arg) .dexp(-arg) .APOLY 110 CONTINVE c an .100 Anorm . 10d-250 return c Anorm=dsqrt (xalph.aA/gak) end c wrlte(6, .) ,Anorm, gak = ,,Anorm, gak c wrlte(6, .18 Aleg (-1) = ‘,aLeg (0) c ...... subrout kne morsewf (zpsl ) do ;.l, nxpts ...... r=xmn+ldble(l )-1 Ode).dx c MTZS code for nlevel > 0 vlbrataonal wav?functlons on a Morse potential x.r. xoA expval=dexp (-xalphaA”x) absA(i) = dexp(-absfacA ‘ i ‘ i) splitexp = (AK*expval) .. ((AK-1) /4) ‘de%p(-AK” exPval/2) enddo

zpsi li)=dcmplx(Anorm ● lAK. expval)** ([AK-1)/4) ●splitexp, 0.0) endi f c zpsi (i) =cmplx (Anorm . lAK”exPvall *’((AK-1 )12) ’exp(-AK”eXPval /2),0.0) if (iabsB .eq. 1) then

aLeg(0) = 1.0 if (absfacB le. O) absfacB = (tstep / 1.3) ● 0.0005 do iv = 1, nlevel do i = 1, nxabsB arg3 . 1.0 absB(i) = dexp(-absfacB ‘ i “ i) arg4 = 0.0 enddo do j = O, iv-1 endi f arg3 = fact(iv-l) /( fact(j) ’fact (iv-l -j)) *fact (Z*j )/fact (j+l)

arg4 = arg4 + arg3 ● aLeg(iv-j-1) return enddo end aLeg(iv) = AK*expval*aLeg (iV-l) - (AK-2* iv) ●ar94 enddo zpsi (i) = (1/ (AK”expv.al )””nlevel) ‘aLe9(nleve11 “zPSi(i) c write (2332,*) r* 0.529, real(zpsi(i)) 8.2. trans2.2.l.f

899 format (e22.16,2x, e22.16) enddo C TRANS - Fourier transform program to obtain photoelectron spectra from C dynamics matrix generated with ALPINE. call chknrm(zpsi, rnorm) do 11 i = l,nxpts C Author: B. Jeff Greenb$att r . xmin+(i-l)*dx C Start date: March 1996 (for most recent edit, see last_date variable) zpsi(il =zpsi(i)/lrnOrm) “’0.5 C Address: Netunark Research Group c write (2333, g) r* 0.529, real(zpsili)) c Department of Chemistry 11 cent inue c University of California c Berkeley, CA 94720 USA * c c10se(2332) C Phone: 510-642-7761 or 510-643-9301 I c c10se(2333) C E-mail: jef f@radon. cchem. berkeley. edu z— return end C INPOTS : trans. inp Input deck. s c matrix .out Overlap matrix (output from ALPINE) . ~ ● ✎ ✎ ✎ ✎ ✎ *.*.”*.*. ● *. . **..*.*...... ”** ...... ● **.*...... c c OUTPUTS: pwx .out Photoelectron intensity vs. energy (X = 001, 002, ... M real*8 function fact (n) c -- one for each delay time ) ...... *..*...... ””.....**. .“”” ****.**...... **..**.*... . N c c trans. out COPY of what’s printed to screen during run. .C Calculates factorial of n. C Notes for this version (add to bottom of list, please) : integer i C Transl.2: Uses COKreCt power of two in array size of zmatriX (uP to a MEiXiMUM fact = 1 C of nt2halfntax time elements) . Also allows use of a position-dependent mu, do i = l,n C though I am not at all sure if introducing mu (x) at this point in the simula- Eact = dble(i’fact) C tion is theoretically legitimate. enddo return C Transl.3 (8dec96, EJG) : small change to check version header of matrix. out end C file being read, and also to read in an energy shift (eV) to apply to photon C energy, to undo shifts applied in alpine propagation. Also changed name of c ...... ● ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎✎✎☛✎☛✎✎ ● ✎ ✎ ✎ ☛ ☛☛☛✎✎✎✎✎✎ ✎ ✎ ☛ ☛ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ ✎ C input file to ‘trans. inp’ . subroutine make_abs . *....*...**.. .*.*...... ● *.....*****.. ● ...... c C 1.4 (lldec96) BJG: Added pwlist file to outputs, which lists letter with c Generate absorbing boundary functions for A, B surfaces C corresponding delay time.

implicit real’8 (a-h, O-Y) C 1.5 (15dec96) 53G: Eliminated nwrap, nrange parameters -- instead program implicit complex”16 (z I C does the correction automatically. Also dropped mu () from program, eliminated parameter (npts = 2048) C some screen printing. Moved pwlist file to part of main output (dumps to common Iabssl absA(nPts) , absB(nPts) C screen .out] . Updated headers -- now need two (for matrix .out and trans. inp) . common lc0nst3 I tstep commonlcons t4/xmin, wx, nxpts, CLX,npacket, iabsA, nxabsA, absfacA, C 1.6 (20dec961 BJG: Added convolution and regrinding functions (specify & iabsB, nxabsB, absf acB C directly in input deck) . Changed labeling scheme of PWX. out files to numbers C (pwOO1. Out, etc. ). if (iabsA .eq. 1) then if (absfacA .Ie. 0) absfacA = (tsteP I 1.31 “ 0.0005 C 2.0 (16f eb971 BJG: Switched from reading a wave function matrix to an overlap do i = 1, nxabsA C mwtrix, in anticipation of also being able to transform output from 20 C propagation code (‘WBCGGAN- ) 81U197 : Fixed a sporadic bug which seims to write (2, 900) C have had devast.atxng consequences for certain potential surfaces: In calcu - write (2, 901) c lating e_min_pw, used nt2_max. not nt2half_max in e%presslon. SO ipts was 1 write (2, 910) ivers_trans C point larger than it should have been -- thus overflowing memory. Result was write (2, 920) ivers-matrix C that the first delay time spectrum was output correctly, but other were gar - write (2, 930) last_date C bled. Also resulted in a slight (-few meVl shift in energy of outPut write (6, ‘) C spectrum. write (6, 900) write (6, 901) C 2.1 8ju197 BJG: Increased ntlmax to 4096 to handle lar9ex number of time write (6, 910) ivers-trans C delays. write (6, 920) ivers-matrix write (6, 93o) last_date C 2.1.1 I?.IG:OUIIIPun-FFT’d spectrum to file in addition to normal photo- C electron spectrum output. File numbers . psiXYYY .ext, where YYY > C Read the needed data and also define some useful constants. c 100, 903 format (,Reading input deck, ,) C 2.2 8/21/97 BJG: TO make compatible w~th aether (SGI system) , changed write (2, 903) C text reading into integer reading for version numbers of Input decks. write (6, 903) . C This is better in the long run anyway. call const () .,. c 2 .2.1 1999-2-24 BJG: Corrected bug whxch made system crash if the num- C Read in overlap matrix. ,.., C ber of points in the final convoluted array is larger than nener (cur- ,.7 C rently 5121. Now it catches error before kicking You out. Still uses 904 format {,Readina matrix file. ,) ‘:, C version 2200 input deck. write (2, 904) - write (6, 904) C Global variable declarations: call readzmatrix (zmatrix)

xmplicit double precision (A-H, O-Y) c Establish some parameters to “se for workup later on, implicit complex .16 (Z) parameter (nthnax = 4096. nt2max = 512. nt2halfmax = 256, e_min_pw = hv2 - pi , (nt2half_fft - 1) / nt2half_fft & nener = 512) & / tstep dimension zmatrix(ntlmax, nt2halfmax) , et(ntlmax) , e_maxsw = hv2 + pi I tstep & ztemp lnt2max) , ztempl lntlmax) e_step~w = twopi / nt2-fft / tstep common IPWS I PW (nener ), pwconvol Inener ) comnon /convert/ harev, evwn, aO, amu, emu, harwn, amass. atu c Generate automatic parameters, if needed. comnon lcOnst O/ zero, zeye, pi< c, twopi, sqrtpi, pisq common Iconstll xmas, hb if ((e_min ,.eq. O) ,and. (e_max .eq. O) then t+ common lconst4/ ntl, nt2, nt2half, nt2_fft, nt2half-fft, e-rein = e_min_pw & tmin, tstep e-nutx = e_max_pw common /const8/ hv2, fwhnc?, sech2, e_shif t, e_min. e-max, endi f & e_s tep, iconvOl_type, e_i On, rmass, e_min_pw, e-max_pw, if (e_step .eq. O) then & e_s tep_pw, ipts e_step = e_step_pw character .80 last_datc endi f common Iversiont ivers-matrxx, ivers_trans ipts = nint( (e_max - e_min) / e_stepl + 1 , Final “wnber of points C Set headers c Print some parameters. ivers_rratrix = 2200 ..,... xvers_trans = 2200 100 format (,Raw energy range and step sxze (eV) . s, f7 3, 2x, . last_date = ,24 February 1999, t’ f7.3, 2x, f7,4) write (2, 100 ) e_min_pw . harev, e-max-pw . harev,

C Open output file which 1s carbon COPY of what goes to the screen. & e-step_pw ● harev wrxte (., 100) e_mi”aw . harev, e_max_pw , harev, open (2, file = ,crans. out,) & e-s t.?p_p”. ha rev ‘- 110 format (,Final energy range and step size (eV) = !, f7 3, 2x, C Greeting message & f7 ,3, 2X, f7 ,4) wrzte (2, 110) e-m~n . harev, e_max . h.arev, ,..,,, 900 format (,Welcome co TRANS Fourier transform routine for , & e-step . harev .. & ALPINE OUtPUt S. <) wrxte (,, 110) e-mm . harev, e-max . harev, 901 format (,First written by B Jeff Greenblatt, March 1996 r) & e_step , hare” 910 format (,Input deck version = a 15) 120 format (‘Number of points 1“ raw and final arrays . ,, L4, 920 format (,Matrix out version = ,. 15) & 2x, 14) 930 format (,Last date edited = a) “rlte(2, 120) nc2, ipts wxte (2, .) write (., 120) nt2, ipts C FT is real) : if (ipts .gt. nener) then 140 format (‘Number of final points exceeds ‘, i4, ‘ Change ‘, ztemp(nt2half-fft + 1) = zero & ,nener in program. ‘) do it2 = 2, nt2half_fft write (., 140) nener ztemp(nt2-fft - it2 + 2) = dconjg(ztemp(it2) 1 write (2, 140) nener enddo stop endi f C DEBUG: Save un-FFT>d spectrum to file:

130 format (‘Convolution type = ‘, il, ‘ Ion energy = ‘, f7 .1, call openpw(3, ideltat+100) & , eV Mass . ‘, f8 .2, ‘ .wnu’l do i . 1, ipts

write (2, 130) iconvol-type, e_ion ● harev, rmass I amu se = dreal(ztew(i) ) write (•, 130) iconvol_type, e_ion ‘ harev, rmass I amu ai = dimeg(zterr@(i))

write (3, 906) (O + (i - 1) . tstep) ● atu, write (2, ●) & re write (*, ●) enddo close (3) 960 format I‘Table of delay times for spectrum files. ‘) 902 format (,File number Delay (fs) ‘) C Perform fast Fourier transform, reordering pointS resulting fXOnIFFT since write 12, 960) C negative values are stored in second half of matrix. write 12, 902) write (8, 960) call FFT (ztemp, nt2_fft, 1) write (*, 902) do it2 = nt2half_fft + 1, nt2_fft pw(it2 - nt2half_fft) = dreal(ztetrp(it2) ) C Main looP: read in delta t. enddo do it2 . 1, nt2half_fft do ideltat = 1, 99999 pw(it2 + nt2half_fft) = dreal(ztemp(it2) ) read (1, ●, end = 2) deltat enddo 908 format [4x, i3, 6x, f10.2) write (2, 908) ideltat, deltat C Convolute with instrument response function. write (•, 908) ideltat, deltat deltat = deltat / atu call convol ()

c Create E(t) vector to multiply by each column of zmatrix: C Write resulting spectrum to file.

t = tmin call openpw(3, ideltat) do it = 1, ntl do i . 1, ipts et(it) = E2 (t, deltat) 906 format (f14.6, 2x, f14.6) t = t + tstep write (3, 906) (e_min + (i - 1) “ e_step) ‘ harev, enddo L pwconvol (i ) enddo

c Integrate O(tl, t2) ● E(tl)4 E(tl- tz)overtlforeachtz: close (3)

do it2 = 1, nt2half C End loop. do itl = 1, ntl if (itl .lt. it2) then enddo ztemul(itl) = zero else - C Done.

ztempllitl) = zmatrix(itl, it2) ● et(itl) ● & et(itl - it2 + 1) 950 format (,Done. ,) endi f 2 write (2, 950) enddo write I*, 9501 call zsimpint (ntl, ztempl, tstep, z) ztemp(it2) = z close (1) enddo close (2)

C Fill in rest of array with 0’s stop end do it2 = nt2half + 1, nt2half_fft ztemp(it2) = zero c ., .*******”**”****”* ● **************”*””* ...... *..,...... *.. *** ***.*... enddo subroutine const () c .. ..+ ...... *...... c Now duplicate array on negative s Lde, taking complex conjugate (this ‘ensures C Read the needed data and also define some useful constants. Order of C xnput deck: C Begin reading xnput deck, c ivers: Version number of xnput deck. Must ,... c match, or exits. open (1, file. ,trans. inp, ) c hv2 , fwhm2 : Photon energy leV) and FWWM pulse ..:.; c width (f.s) of probe pulse. C Read version header ,. c icOnvOl_type, e_x On, rmass Convolution type (see convol () fn) , c and parameters (eV and amu, respec- read (1, . ) ivers c tively) used by convolution routine. If [ivers ,ne. ivers_trans ) the” c e-mxn, e_max, e_s tep: Range and step size (eV) desired for close(l) -++ c convoluted spectra. e_step = O signals 903 format (‘Version does not match: ,, x5, , sought, ,, i5, ,,-. c to use the same step size as produced k , read. Aborting. ,) c by the Fourier transform; e_min = write (2, 903 ) ivers_trans, ivers c e_max . 0 likewise signals to use write (., 903 ) ivers_trans, ivers c range of Fourier transform (useful if stop c not adding spectra from different endi f c states together) ,,..? c deltat: ~w-prObe delay (fs) AS many lines read (1, ●) hv2, fww ... c of these can be entered as desired. hv2 = hv2 / harev ,, fwhm3 . fwhm2 I atu iMPliCit double precision (A-H, o-y) sech2 . sechfactor / fwhrr2 implicit complex.16 (Z) parameter (ntlmax . 4096, nt2max = 512, “t2h,alfmax = 256, C Read convolution parameters. & nener . 512)

common /convert/ harev, em, aO, amu, mm, harwn, amass, at” read (1, ● ) iconvol_type, e_ion, rmass common lcOnstO/ zero, zeye, pi, c, twopi, sqrtpi, pisq e_ion = e_ion / hare.? conmwn lconstl/ xmas, hb rmass = rmass + amu common /const4/ ntl, nt2, nt2half, nt2_fft, nt2half_fft, & tmin, tstep C Read energy rebinning parameters, common lconst8/ hv2, fwhm2, sech2, e-shift, e-rein, e_max, & e_step, icOnvOl_type, e_i On, rmass, e-ml n_pw, e_max_pw, read (1, ‘ ) e_min, emax, e_step & e-step~w, ipts e_min . e-rein I harev common Iversiont ivers_matrix, lvers-trans e-max . e_max / harev e-step . e_step / harev C Set conversion factors, return N harev = 27.211608d0 end evwn . 8065. 479d0 aO = 0.52917706d0 c ...... amu . 1822 .882d0 subroutine readzmatrix( zmatrix) emu = 9, 109534d-31 c ...... harwn . harev , evwn C Read overlap matrix into zmatrix, Format of file amass = 1.66056d-27 atu = 0.024199d0 C Version: a string indicating which version of alpine produced file,

C Set cOns tO. C nqueue. number of poxnts in shorter time dmension (overlap length)

zero = dcmplx (0,OdOO, 0, OdOO ) C tmin, tstep: initial time (fs) a“d time step (fs) between each wave functxon zeye = dcmplx {0,OdOO, l, OdOO) pi = dacos (-l, OdOO) C e-shift: amount (eV) to shift photon energy i“ input deck, due to sh$f ts twopl = 2 . pl c applled to Potentials in alpine propagation for more .sff~c~ent math, sqrtpi . dsqrt (pi) plsq = pl . pl C Remaxnxng lines: complex format data of matr~x

C Speed of llght xn cmls and hbar In atomic “n~ts lmpllclt double precision (A-H, O-Y) lmplicxt complex,16 (Z) C = 2 99792458d10 parameter (ntlmc.x . 4096, nt2halfmax . 256) hb = 1 OdO dlmenslon zmatrix(ntlmax, nt2he.lfmax) common /convert/ hcirev, em, aO, an”, em”, harwn, amass, at” C Sechfactor 1s mulclpl led by time Inside sech A2 so that relatlve pulse Lntens~- common /cOnst Of zero, zeye, pi c, twop~, sqrtpi, pxsq C tY=05whentlme. Fw ,2 convnon Iconstll xmas, hb -P corrunon fc0nst41 ntl, nt2, nt2half, nt2-fft, “t2half-fft, -P sechfactor = 1 762747174dO0 & tm; n, tstep common /const8/ hv2, fwhm2, sech2, e_shift, e_min, emax, zmatrix(itl, it2) E zero & e-s t.ep, icOnvOl_type, e_i On, rmass, e_minSw, e-max_pw, enddo & e_step_pw, ipts enddo common Iversionl ivers_matrix, ivers-trans C Calculate correct number of wave functions read. C open file and read header information. 1 close (3) open (3, file= ’matrix .out’ ) ntl = itl - 1

read (3, ● ) ivers C Print total wavef unct uans read. if (ivers .ne. ivers_matrix) then 903 format (‘Version does not match: ‘, i5, ‘ sought, ‘, i5, 900 format (’Ntl E ‘, i4) & , read. Aborting. ‘) write (2, 900) ntl write (2, 903 ) ivers_matrix, ivers write (*, 900) ntl write (6, 903 ) ivers_matrix, ivers c10se(3) C Find appropriate power of two size for fft array. stop endi f nt2half_fft = nt2halfmax do while (nt2half .le. nt2half-ff t / 2) read (3, ‘ ) nt2half nt2half_fft = nt2half_fft / 2 905 format (‘Halfnt2 = ‘, i4) enddo write (2, 905) nt2half write (*, 905) nt2half nt2_fft . 2 ● nt2half_fft if (nt2half .gt.nt2halfmax) then 902 format( ‘Halfnt2 exceeds allotted memory (Increase nt2halfmax V, return & ,in source code) . Terminating. ..‘) end write (2, 902)

c ***** ***** ********""""'""*"*''"''"***'''`**"*""**"``""` ● ********************** write (6, 902) g c10se(3) subroutine FFT (x, n, isign ) s top c ● *****************************” ● ********************. ● ************************ w endi f c rD c ● ***************.*** ● *****************.* ● .**.****************** H ● read (3, ● ) tmin, tstep C ● The fft computes the discrete fast Fourier transform of a & ✎ tmin = tmin / atu C ● sequence of n terms. ✎ x tstep = tstep I atu C ● The forward FFT cOmpUteS C* y(j)= sum (from k=O to n-1) x(k) *ew(2*pi*i*j”k/nl ✎ N ✎ read (3, 8, e-shift C ● the backward FFT computes e-shift = e_shift / harev C* y(j)= sum (from k=O to n-l) x(k) ”exp(-z’pi”i’j’klnl ✎ c* . ● C Apply shift to photon energy. C ● x is a comlex array of length n. ● C ● n is a power of 2. n<=16384 hv2 . hv2 + e-shift C ● isign is the direction of the transform. If isign >. 0 then* ● C ● the fft is forward , otherwise backward. C Read data. c* . c* Ref. Cooley, Lewis, Welch. The FFT and its applications ● do itl = 1, ntlmax + 1 ! Loop normally broken at read statement. C* IEEE Trans. on Education, vol. E-12 11; P. 29 ● if (itl .gt. ntlmaxl then c ● *********’**********” ● *****************’’’**” .************** 901 format (‘Ntl exceeds allotted memory (Increase ntlmax ‘, & ,in source code) . Terminating. ..0) implicit double precision (A-H, o-Y) write (2, 901) write (6, 901) C Local declarations: s top end if complex*16 s. v, w, x(n) , cstore(16384) data ntbl/01 C Read in matrix elements, creating diagonal for first nt2 columns: it2max = itl C The roots of unity exp(pi*i*k/j) for j=l,2,4, . .,n/2 and k=0,1,2, ... j-l if (it2nu.x .gt. nt2half) then C are computed once and stored in a table. it2max = nt2half C This table is used in subsequent calls of fft with parameter n.=ntbl endi f do it2 = 1, it2max if [n .gt.ntbl) then read (3, ●, end = 1) zmatrix(itl, it2) ntbl . n enddo pi E 3.14159265358979 dO0 do it2 . it2nta% . 1, nt2half j.1 .cnt . 0 10 S=pl. (o, l)l) E2=1 cosh (sech2 . (t - deltat) ) do20k=0, j-1 /,. xcnt = icnt + 1 return 20 cstore[xcnt) = exp(s - k) end ].j+j .. if (j .lt. n) goto 10 c ...... endi f subroutine openet (if ile, icowt ) c ...... c ...... Bit rever~a~...... c Opens et file. c The x (j ) are permuted in such a waY that each new place number I IS C the bit reverse of the original placenurrber. imlicit dOuble precision (A-H, O-Y) iwlicit car@lex’16 (z) j.1 do30i=l, n open [ifile, file=, et< II char 164 + ico”nt) II ,.outs) if (i .le, j) then v = x(j) return x(j) = x(i) end x(i) = v endi f c ...... m.n12 subroutine openpw( if ile, ico”nt ) 25 cent inue c ...... if (j .gt. m) then c Opens PW file using three-digit file code for icount, j.j.~ mm/2 Implicit double precision (A-IS, O-Y) if (m .ge. 1) go to 25 implicit complex*16 (Z) else j.j+m open(lflle, file= ’pw’ 11 char(48 + icount / 100) // char(48 & endi f & + mod(icount 1 10, 10)) // char(48 + mod(icount, 10)) II & 30 continue ,.out,) w c open (ifile, file=, pw, 1/ ch.ar(64 + icou”t) II ,.cmt, ) ... - c ....+e...... ”CItrlX ~~l~ip~ic~r-~~n...... s C The roots of unity and the X(I) are multiplied return m end w. ,,, ,=1 w ,.: xcnt . 0 c ...... N ‘>.; 40 jj. j+j subroutine convol () do50k= l,] c ...... icnt . icnt + 1 c BJG 19dec96: Revised from convol, f (operated on file) Com.ol”tes raw FFT w . cstore(icnt) c spectrum with an instrument response function; also rebins data to user, s xf (isign .lt. O) w = dcon]g (w) c specifications (e_min, e_max, e_step) . Several convolution types are avail- do50i=k, n,jj c able (iconvol-type) : v=w*x(i+j) x(i + j) = x(i) - v c 0: no convolution, 50 x(i) . x(i) + v c 1: simple tophat distribution, ].jj c 2: isotropic dlstrib”tion i“ magnetic bottle (see B, J. Greenblatt et al , if (I .lt. n) goto 40 c Chem, Phys. Lett. 258, 523 (1996) . c 3: sin”2 distributmn (sideways peaked) return c 4: COS”2 distribution (forward-backward peaked) end impliclt double precision (a-h, o-y) ~ ...... impliclt complex.16 (Z) function E2(t, deltat) parameter (nener . 512) c ...... conunon /pws/ pw(ne”er) , pwconvol (ne”er ) C Returns envelope function of E-field of laser pulse 2 at time t, given delay dmenslon pwtentp [ne”er ) c time deltat Note that cost> term 1s not squared, I = E“2 = llcosh’2, but this common /convert/ harev, em, aO, mm, emu, harwn, amass, at” C Is calculating just E = lfcosh common /const4/ ntl, nt2, nt2half, nt2-fft, ntzhalf-fft, & tmzn, tstep Lmpllclt double preclslon (A-H, O-Y) comvnon /const8/ hv2, fwhm2, s.ech2, e_sh~ ft, qrmn, e-max, mpllclt complex .16 (Z) & e-seep, lconvol-t~e, e-ion, rmass, e_m In_pw, e-m..4x_pw, common !const 8/ hv2. fwhm2, sech2, e_shlft, e_mln, e-ma%, & e-step-p”, ~pts & e-step, lcOnvOl_type, e_l On, rmass, e_mln_pw, e_max_pw. common JParamsl .ak, aeoffset & e-step-pw, Lpcs c First check that distribution type is not O; simply interpolate array to C new grid if so. c ● ...... *..******** ● *****...... function dist (ereal, eapp) E if (iconvol_tYPe eq. O) then c .*.** ...*. ..*.****..** ● ...... call regrid( ) C Return distribution function value (ereal = real eKE, eapp = apparent eKE) return C Convol_tne (in comnon block] specifies which distribution to use; for endi f C details, see comments under convol (1 subroutine. Normalization not required C here, as convol () does its own normalization on each point. C Establish constants (in electron mass units) implicit double precision (a-h, o-y) electronmass . 1 implicit complex*16 (Z) common /const8/ hv2, Ewhnt2, sech2, e_shift, e_min, e_max, C Calculate constants for our distribution function & e_step, icOnvOl_type, e_i On, rmass, e3in_pw, e_max_pw, & e_step_pw, ipts

ak = rmass / (4 ● electronmass ● e_ion) common /paramsl ak, aeoffset aeoffset . e_iOn ● elect ronmass / mass i f (iconvol-type .eq. 1 ) then ! Tophat C Blank out target array. dist . 1 else do j = 1, ipts temp = enpp - aeoffset - ereal pwconvol (j ) = O r = ak ● te~ ● tem / ereal enddo if (r .lt. 1) then i f (iconvol_type .eq. 2 ) then ! Isotropic C Perform convolution. i indexes points in original array (PW); j indexes dist = dsqrt(l - r) c points in new array (Pwconvol ). Erancfe is ran9e of convolution function, else c which changes with energy. anorm is accumulated weight which is then used to if (iconvol-type eq. 3 ) then ! Sin”2 C normalize each convoluted point. dist = (1 - r) ● dsqrt(l - r) else do i . 1, nt2_fft if (iconvol_type .eq. 4) then ! c0s”2 dist = r ● dscfrt(l - r) en . e_min_pw + (i - 1) . e_step_pw ! Energy of original array else erange . dsqrt (en I ak) 900 format (,iconvol_type not supported. ,, j_min = nint ((en + aeof fset - eran9e - e>inl & ‘Terminating. ,) & / e_step) + 1 write (2, 900) j_max = nint ((en + aeof fset + erange - e_min) write (*, 900) & / e_step) s top N endi f C First record distribution function in array and add UP norm. endi f endi f anorm = O else ! Extra trap to ensure don, t drop below zero i“ dsqrt. do j . jsin, j-MaX dist . 0 dist_terrQ = dist (en, eflin + (j - l) “ e-steP) endi f if ((j .ge. 1) and. (j le. ipts)) then endi f pwtemp( j ) = dist_temP end if return anorm = anorrn + dist-temp end enddo

C Now copy weighted and normalized distribution to final array. c ● **.****...********** ● ******.*****.****** ● ************.****.* ● ***** *** .*.....* subroutine regrid () if (anorm .gt. O) then c ● ************************************”’””””’* .**.***.*....*...... *** ● ********. a . pw (i) ● e_step_pw I e_step I anorm c Interpolates PW array, with grid parameters e_min_pw, e_max_pw, e_step_p, do j = j_min, j_max C onto pwconvol array using new grid parameters e_min, e_mc.x, e_step. if ((j .ge. 1) and. (j le. iPts)l then pwconvol (j) = pwconvol (j) + pwtew(j ) ‘ a iI@iCit double precision (a-h, o-y) endi f implicit con@ex*16 [Z) enddo parameter (ntlmax . 4096, nt2max = 512. nt2halfrnax = 256, endi f & nener = 512) common lconst41 ntl, nt2, nt2half, nt2-f ft, nt2half_f ft, enddo & tmin, tstep common /const81 hv2, fwhnif, sech2, e_shift, e_min. e_max, return & e_step, icOnvOl_type, e_iOn, amass, e_min_pw, e_max_pw, end & e_step_pw, ipts common /pwst pw(nener ), pwconvol (nener) end . do 1 = 1, lptS ‘c ...... en = e-rein + (i - 1) . e-step 1 Snergy in new array subroutine ztrapint (npts, zf, dx, zint) 1 = int( (en - e-min_Pwl I e-stepswl + 1 ‘ West old array elem .. en c ...... lf ((j .lt. 1) or. (I ,ge, nt2-fftl) then pwconvol (x ) = O implicit double precxsion (A-H, O-Y) else in’plxcit complex *16 (z) en_pw = e_min_pw + {j - 1) . e-step-pw ! Old array energy common lcOnst Ol zero, zeye, pi, c, twopi, sqrtpi, plsq pwconvol(il = (pw(j) + (en-pw + e_step_pw - en) + h pw(j + 1) ● [en - en_pw) ) I e_stepsw C Local declarations: end if enddo dimension zf (npts)

return C Trapezoidal rule integrator for f (1) - f (npts) <-> f (xO) - f (xf ) end zint = zero c ...... ’’’””’’””’” ...,...... *... ,...... *...*,...*... .,, ,, ...... subroutine zsimpint (nx, zf 1, d%, zint I do 100 i = 2, npts - 1 c ...... ,..,,**~,’’*** ● ****, ...... zint = zint + zf (i) C Complex Simpson’s rule integrator. ,,’,. 100 cent inue .,,., ,, zint = zint + (zf(l) + zf(npts)) / 2,0dO0 ,,, implicit double precision (A-H, O-Y) zint . zint ● dx implicit cOmplex.16 (Z) ,...* return ,,-/ C Local declarations: ,. end

parameter (nypts = 4096) dimension zfl(nypts) , zf2(nypts)

C Define:

Ckl. dx dx2. d% *2. ixn = O.

Lf (n% .gt. nypts) then write (6, .) , zsimpint : nx ,gt, nypts = ,, nypts endi f

if (Imod(nx, 2) .eq, O)) then nxl=nx-1 nx2 = 0.50dO0 . nxl + 1 zint = 0.50dO0 , dx . (zfl(nx - 1) + zfl(nx)) else nxl = nx nx2 = 0.50dO0 . “x1 + 1 zint = O OdOO endx f

C CoPy the odd elements of zfl array into zf2.

do 10 xx = 1, nxl, 2 ixn = ixn + 1 10 zf2(lxn) = zfl (xx)

C Now Integrate zfl, zf2 in two pieces

call ztrapmt(nxl, zfl, dxl, zlntl) call ztraplnt(nx2, zf2, cfx2, zmt2) zint . zinc + (4 OdOO , zintl - z1nt21 I OdOO

return -.

446 Appendix 3. Complete FPES spectra of 12-(Ar). and 12-(C02). clusters

Contained in this Appendix is the complete set of FPES spectra collected for

Chapters 6 and 7. Chapters 4 [Iz-(Ar)G and IZ-(Ar)ZO]and 5 [12-,IZ-(C.02)4 and 12-(C02)16] use segments of the same data set, but the 12-(C02). spectra have been modified to remove background signals more effectively, and the zero of time of most of the spectra has changed slightly. The bare 12-spectra appearing in Chapters 3 and 4 differ from the

12-spectra here, as they were acquired without pulsed deceleration. These 12-spectra are not included. The Iz-(Ar)Gspectra are presented as two sets. The first set had good signal- to-noise, but sparse representation beyond 1.2 ps. The second set, while denser at long time delays, was not suitable for presentation in papers due to poor background subtraction. Cn

0 I.Q q LQ q In C3 l-- 0 1 intensity/Arb. Units

.~m,-..- -- ... .,, . :--,---- ‘X77- “c ,.-%-.>-, -- ! 448 Appendix 3

o 0 o m o m m co m m m m

<

I

m ? o ln&sity/Arb. Units Appendix 3

m

<

o + q q LQ m Y o ln;nsity/Arb. Units

....” . - ,.-, ,.\.$,.,,.--/.— . .$,., .“,.“, .,,, ,. ~ .... ,..,,> ,, 450 Appendix 3

2.12-(Ar)6

First set u

ml N N 0 u) , u) u t-l q- u , ,

I

U) m. u) m- L6 i 0 ln~ensitylArb. Units Appendix 3

o q LQ q q m F o ln~nsity/Arb. Units

., ..... ,.>,,.-.,,... . .,. .“.-” ..”:

452 Appendix 3

Jg

0 q q q q u) m 1- 0 intensity/Arb. Units Appendix 3

0 o o 0 0 0 0 m m ml

I I I

o m u) m m 1.f5 . 7. 0 ln&sity/Arb. Units

,.,-, r. ‘ “;’;7 ,”’ - .:,’-- 454 Second set

J/J o 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 r- u) Lo d- v) N t-i Cn 03

u) u). u). m- G 1--1 0 ln~ensity/Arb. Units Appendix 3

Lc) u) If). ti t-l o intensity/Arb. Units

. :...... -:.$?.- .~-~ ---- . .-, .7 ...... , ..”,,---- ,-. , 5.5 /2 45000 fs

40000 —

25000

20000

17000 G 1.5 15000

13000 w~ 11000

-0.5 0.0 1.0 2.0 3.0 eKEleV Appendix 3

I I [

. . L6 l-i o ln~ensity/Arb. Units

...... ,-.- :.,, “‘,.‘,;.”/-..i ,.*.}:?”-.~. ‘“ .. ::. ,:;... 458

3. 12-(Ar)9

-1

m d- ?$ m d- 1 tj 1

1

0 0 0 0 0 b + N 0 intensity/Arb. Units Appendix 3

0 0 0 0 0 (9 Q@ CN 0 intensity/Arb, Units

.,-,. , .x,.,,. \, ,,., \-.... .-,’:.. .! ,..~....., ,, - -- ,- .~,,~, .:. .. r-,$.4 6.0 .lA

836 fs

736

686

636

586

536

486

436

386

336 0.0 I 0.0 1.0 2.0 3.0 eKE/eV 461 0 C9 m co a co mc1) mU3 m m m mC9 mu) co m * m o u) 7

o CN

o

o.

0 0 0 0“ cd ‘d CN o intensity/Arb. Units

“,-, ---- ...... 6.0

8000 fs

6000

5000

4000

2836

2636

2436

2236

. 2036

1936 0.0 1 0.0 1.0 2.0 3.0 eKE/eV Cn

0 0 0 0“ C9 * a intensity/Arb. Unitsm

,. .-, . ,, ,..{ - <. :..:-,- -,,. .,:‘. .——

464 Appendm 3 0 m

o CN

o 0 0 0 0 0 co * m o intensity/Arb. Units I I 5.5

31fs 6 ,. -19 .,- -44 -69 -94 \

,,’ -119 -144 -194 -244

-0,5 0.0 1,0 2,0 3.0 eKE/eV 466 Appendix 3

m Lc) u). LcF Lf5 ti t-+ o intensity/Arb. Units Appendix 3

5. 12-(Ar)lb

g-) o 0 0 Lo m In d- u) all-l d

0 0 0 0“ (6 + O.i 0 intensity/Arb. Units

. .. ~-.....- ,---, - , .. ...,, -.-:$..-7 - ,.,,-, o m &n o o c c o o 0 0 c c 0 In 0 0 c c 0 m 0 0 c C( u) m N ?

o N

o t-i

o 0 0 0- G * 0 Intensity/Arb. Un;s Appendix 3

6. 12-(Ar)20

n- ti

o (i

> ? s a)

o I+

o 0 0 0 Oo G ‘+ m.i o intensity/Arb. Units

...... -.7 -,, 470 Appendix 3

o ml

> + < Id

o o Oo O.i 0 Intensity/Arb~ Units Appendix 3

I I U) s m

0 0 0. 0- G + 0 intensity/Arb. Un& 472

7.IZ-(COJQ

u) o o o o o o 0 0 0 0 0 0 ml co h co m m

I I 0 o 0 0 0 CD * mi o Intensity/Arb. Units Appendix 3

UY o 0 o o 0 0 0 0 0 g Co UI 0 m m

0 o 0 0 0 Cs5 d- d 0 intensity/Arb. Units

,.,.4 .”....—. . . .. -‘ -3.- ,,.-... ~ . . .,, , f ,.-” ‘ “~ 474 Appendix 3

0 0 0 0 0 C6 d- N 0 intensity/Arb. Units 8. 12-(C02)b

0 o o o 0 co co a) cc) Cy CD e m CN

I I 0 o 0 0 0 ti + o intensity/Arb. Unitsm

-.. -- -T. .- ,. . . -.,.,, . . ..- w<:.LL,,:.:- - ., .,.. , . “ ,:.,., ,. > ,. . ..—

476 Appendix 3

1-

o 0 o 0 C9 ml 0 Intensity/Arb. Units 9. IZ-(C02)9 o O.i

o c o co u u) d

LQ 7

& %! a)

m o

I I 0 0 o 0 0 0 Cfi + o intensity/Arb. Unitsm

.. .,7< --- ,. . . ------.7 478 Appendix 3 0 CN

0 a a m

LQ T

■ -

& ‘+ CD

u) 0

0

0 0. 0 0“ co * 0 intensity/Arb. Unitsm Appendix 3

$ c c c c c o

0 0 o 0 C6 Yi- 0 intensity/Arb. Units

~,?,., ~, ,. . ,,.“.,::? ,““ , , , ::, -, ,’”, .:?:~-: :“ “. ., ::;,., . ,. :,, , .:-:? - 480

10. 12-(C02)12

c c c c c c a cc a a a o 1- u c d 1

LQ 0

I I 0 0 0 0 0. 0 ti ++ 0 intensity/Arb. Unitsm J ( o o 0 o o 0 0 0 0 co 0 0 CD a) co v z

I I I

I

x / I W

+

I I 0 o 0 0 0 Cci + m o intensity/Arb. Units 6.0

AI 5X 4.0 I

200000 fs

. 100000 h g -. G 2.0

15000

0.0 0.0 0.5 1.5 2.0 eI&?eV 0 11. 12-(C02)14

o o m m ml

[ (

I

0 o 0 0. 0 ti + o intensity/Arb. Unitsm

.,7-, -. ,., .,<.,,. ..- , ..,- ,....,.. . +., :.- .,; . /::-,>,.: 0 N

o o o 0 o 0 0 0 0 0 0 0 0 lo 0 0 u) 3 0 m

LQ 7

I I I I I ( & 82 a)

LQ o

0 o o 0 0 Q (0 + o intensity/Arb. UnitsN 485

0 I d Cn o o o o o c 0 u) 0 0 c m 1- 0 1 1

q

7

& 32 cl)

m 0

I

I 0 h Y 0 lnflnsity/Arb. Units

,. -.. .-,,.,. ... “ 4,., : . . -. ~, ,’.,$. o c o o 0 c 0 0 m cc C9 d-

I I I

0 q q q q u) 7 0 ln~nsity/Arb. Units Appendix 3 487 0 CN

o o 0 o o o 0 0 0 0 0 0 0 0 0 0 m m 0 0 co * ml ml N

Lq Y

&

+ cl)

m o

I I I 0 o m If)-. m m LA 7 0 In~nsity/Arb. Units

,:, +,:,.’ ,-: ‘“. ,.,.}2 488

Appendix 4. Publications from graduate work

1. B. J. Greenblatt, M. T. Zanni, and D. M. Neumark, “Femtosecond photoelectron

spectroscopy of 12-(Ar). photodissociation dynamics (n = 6, 9, 12, 16, 20),” J. Chem.

Phys., in preparation.

2. B. J. Greenblatt, M. T. Zanni, and D. M. Neumark, “Femtosecond photoelectron

spectroscopy of 12-(C02). photodissociation dynamics (n = 4,6,9, 12, 14, 16)~’ J.

Chem. Phys., in preparation.

3. M. T. Zanni, B. J. Greenblatt, A. V. Davis and D. M. Neumark, “Photodissociation

studies of 13-using photoelectron spectroscopy,” J. Chem. Phys., in preparation.

4. M. T. Zanni, V. S. Batista, B. J. Greenblatt, W. H. Miller, and D. M. Neumark,

“Femtosecond photoelectron spectroscopy of the 12-anion: Characterization of the

z’ 2ng,,,2 excited state,” J. Chem. Phys., 110,3748(1999).

5. V. S. Batista, M. T. Zanni, B. J. Greenblatt, D. M. Neumark, and W. H. Miller,

“Femtosecond photoelectron spectroscopy of the 12-anion: A semiclassical molecular

dynamics simulation method,” J. Chem. Phys., 110,3736 (1999).

6. M. T. Zanni, B. J. Greenblatt, and D. M. Neumark, “Solvent effects on the vibrational

frequency of Iz- in size-selected 12-(Ar). and 12-(C02). clusters,” J. Chem. Phys. 109,

9648 (1998).

7. M. T. Zanni, L. Lehr, B. J. Greenblatt, R. Weinkauf, and D. M. Neumark, “Dynamics

of charge-transfer-to-solvent precursor states in r(D20). clusters,” Proceedings of the

XIth Ultrafast Conference, Garmisch-Partenkirchen, Germany, in press (1998). Appendix 4 489 8. M. T. Zanni, B. J. Greenblatt, A. V. Davis, and D. M. Neumark, “Photodissociation

dynamics of 13-using femtosecond photoelectron spectroscopy,” Laser Techniques

for State-Selected and State-to-State Chemistry IV, Proc. SPIE, 3271, 196(1998).

9. B. J. Greenblatt, M. T. Zanni, and D. M. Neumark, “Time-resolved studies of dy-

namics in molecular and cluster anions,” Faraday Discuss., 108, 101 (1997).

10. M. T. Zanni, T. R. Taylor, B. J. Greenblatt, B. Seep, and D. M. Neumark, “Charac-

terization of the 12-anion ground state using conventional and femtosecond photoe-

lectron spectroscopy,” J. Chem. Phys., 107,7613 (1997).

11. B. J. Greenblatt, M. T. Zanni, and D. M. Neumark, “Photodissociation of IZ-(Ar)n

Clusters Studied with Anion Femtosecond Photoelectron Spectroscopy,” Science,

276, 1675 (1997).

12. B. J. Greenblatt, M. T. Zanni, and D. M. Neumark, “Photodissociation dynamics of

the 12-anion using femtosecond photoelectron spectroscopy,” Chem. Phys. Lett., 258,

523(1996).

... . ,>,r, ,. ,:,......