TextPad, FORTRAN, IMAGE, and VP programs under Windows 7

TextPad setup:

TextPad is used as an editor for forming a programming environment for FORTRAN as well as handling input files for the IMAGE program. TextPad should be downloaded and installed. The "Tools" keys are used to set up single-key command sequences as follows: 1=Compile, 2=Link, 3=Run FORTRAN, 4=Compile+Array Check. The Tools keys are set up by clicking on Configure, Preferences. An existing implementation of these shortcut keys should be consulted for the exact command sequences to input into the Tools keys.

IMPORTANT POINT FOR DEBUGGING: In the "usual" configuation, the Cntl-3 key for "Run FORTRAN" will send the output to a separate window. If an error occurs during program execution, then oftentimes this window will simply disappear, so that the error message cannot be seen. To avoid this situation, change the setup for this key so that the "Capture Output" box is checked (i.e. using Configure, Preferences, etc.). Then, the output will appear in the Textpad editor window attached below the main editing window, and any error messages that are issued will be clearly visible.

FORTRAN setup:

Gnu FORTRAN is used. This should be downloaded and installed. Special attention to properly link to the libraries might be needed. A variable should be added to SYSTEM VARIABLES called GFORTRAN_UNBUFFERED_ALL with value Y (to accomplish this right click on COMPUTER on the START panel, click on Properties, Advanced System Settings, Environment Variables, and add to the SYSTEM VARIABLES).

IMAGE program setup:

Perform the following steps to set up your computer to run IMAGE:

  1. create folder c:\image, and copy all the image files into the folder. Add this folder to your PATH parameter list (to do that, right click on COMPUTER on the START panel, click on ADVANCED and Environment Variables, and add to the PATH).
  2. associate the filetype .im with \image\im.cmd and similarly for the filetypes .im1, .im2, .im3, .... The im.cmd file contains the lines:
    c:\image\ei.exe %1
    copy c:\image\eisav.rec ei.rec
    
    which sets a standard window size for IM analysis and invokes the EI editor. This standard window size is specified in eisav.rec, which by default contains "eiw.geo 55 46 561 11 "Fixedsys" 15 400 : 512 512 10 10". The first four values here refer to the size and position of the ei editor window, the next two are the fonts in the display of that editor, and the final four (following the colon) refer to the size and position of the graphics window. These values work well for a small size monitor, although for a larger monitor revised values such as "eiw.geo 55 46 761 11 "Fixedsys" 15 400 : 712 712 10 10" might be preferable.
  3. to handle graphics viewing, the IMAGE program uses Irfanview. You should download this program and install it, associating all graphics files with this application.

VP setup:

To use successfully use the windowing aspects of VP, it is necessary be in the "Windows Classic" Theme of Windows 7. To achieve that, right-click on your desktop and choose that Theme. For using VP, associate your EXG file with \vp\vp.exe in the VP folder.

ICONS:

For convenience in program usage, you might want to change the default icons for .exg and .im file (the latter used for executing the IMAGE program). For example, the ICON6.ICO icon in the VP folder, and the TIP2.ICO icon in the IMAGE folder can be used for this purpose. To change the deault icons displays for these filetypes, following the instructions listed at http://www.winhelponline.com/blog/change-file-type-icon-windows-7-vista/ (in addition to these instructions, you will also have to change your permissions status, within the Registry Editor).

POSSIBLE FUTURE VERSION OF THE ABOVE INSTRUCTIONS (for the record)

Before the "Windows Classic Theme" solution for Windows 7 specified above was found, there were a few other partial solutions developed for running VP under Windows 7. These are included here, in case they're needed for a future operating system:

For using IM: Associate the filetype .im with the TextPad editor, and similarly for the filetypes .im1, .im2, .im3, .... Within TextPad, an input file is executed by IMAGE via a TextPad Tools key 5.

For using VP: A good, partial fix for the VP windowsing problem can be achieved by noting that the windowing works reasonably well if the following line is always listed at the top of the ei.rec file that's present in the same folder containing the EXG file that's being executed:

eiw.geo 90 100 930 26 "Fixedsys" 15 400 : 1200 1000 0 0
The first four values here refer to the size and position of the ei editor window, the next two are the fonts in the display of that editor, and the final four (following the colon) refer to the size and position of the graphics window. After the user exits VP, then a new line is written into the ei.rec file; under Windows 7 this new line contains values that are scaled relative to the original ones, so the ei and graphics windows gradually shrink. To avoid this problem, the ei.rec file listed above must be rewritten prior to each execution of VP. To achieve this, and to successfully view your plots in the graphics window, do the following:
  1. create a file eisav.rec in the VP folder, containing the line "eiw.geo 90 100 930 26 "Fixedsys" 15 400 : 1200 1000 0 0". NOTE: this line might have to be changed for the particular windowing environment of your computer, but once you find values that work for a single case then those same values should work for all VP usages.
  2. create a file vp.bat in the VP folder, containing:
    copy c:\eisav.rec ei.rec
    vp %1
    
    and associate this vp.bat file (rather than vp.exe) with your EXG files.
  3. the final few lines in any VP file should be something like
    set left=0 right=6 top=1 bottom=0
    axis inv
    v mixedw.ugh
    view erase page
    
    (the line "view mixedw.ugh" is present here only for a white background on the plot, and is not needed for a black background). The final line uses the "page" option (rather than "fill" as previously generally used). This option is meant to force a display of the entire page, but under Windows 7 the entire page is not seen. Rather, you must adjust the parameters for the right and top values; increasing 'right' causes the image to scale down in size, whereas adjusting 'top' (using positive or negative values) changes the vertical position of the image on the viewing window. It is not necessary to vary 'left' or 'bottom' from their values of 0. It's quite easy to find values for right and top that produce a good view of the plot, and once found then the same values will always work for a given EXG file.

(This solution for VP is not the only possibility, and other solutions may be better to use in the future. For example, one could associate the EXG files with TextPad, and add a Tools key in TextPad to invoke vp.bat. That would avoid use of the EI editor completely, in which case the line in the eisav.rec file could be changed to "eiw.geo 30 30 0 0 "Fixedsys" 15 400 : 1200 1000 0 0". An alternative method, that avoids the use of VP windows entirely, is to run VP with the "nographics quit" options, so that it just acts as a processor and it generates a UGH file. That file could then be converted to Postscript using U-PS, with the latter invokes in a script or by the EXG file itself using a SYS command (see \vp\demopage.exg for an example). That Postscript file could be viewed using GSVIEW, or alternatively, one could convert it to JPG (using a command line of GSVIEW or GSWIN) and then view that using Irfanview).

OLD VERSION OF THE ABOVE INSTRUCTIONS (for the record)

The instructions below are old ones, relevant to running IMAGE on a Windows PC. Perform the following steps to set up your computer to run IMAGE:

  1. create folder c:\image, and copy all the image files into the folder. Add this folder to your PATH parameter list (to do that, go to SYSTEM in the Control Panel, click on ADVANCED and Environment Variables, and add to the PATH). Note that these files should include:
  2. ASSOCIATE the .im file type with the im.cmd command. Note also that there's an ICON defined, tip1.ico or tip2.ico in the image folder, which you can also associate with the .im filetype. You might also want to ASSOCIATE files types .im1, .im2, .im3, ... similarly.
  3. create folder c:\vp, and copy all the vp files into the folder. Add this folder to your PATH. NOTE: be sure that any filename or folder used with .exg files does NOT have blank spaces in its name. In the VP folder, the file U-PS.PRO should have the following lines at the end:
    bare
    hershey
    fill 0.9
    repl
    
  4. ADD the stmprint printer (to accomplish this, go to ADD printer, make it a local printer with TCP/IP port, name stmprint.phys.cmu.edu, HP Jetdirect (single) type interface card, and HP 8100 PS driver).
  5. ensure that your machine has an lpr port installed (do this through the Windows ADD components on the control panel).
  6. To handle graphics viewing, the program uses Irfanview. You must have your PATH specified to include the location of this program. (Or, just place the executable program i_view32.exe into the the folder image). Since, under the old Unix version, the graphics viewers XV and XIM are used, you should for safety define .cmd files in the image folder to redirect the XV or XIM commands to Irfanview. To accomplish this, define the files 'xv.cmd' and 'xim.cmd' in the folder image, and place the following line in both files:
     start /b i_view32 %1 

VERY OLD VERSION OF THE ABOVE INSTRUCTIONS (for the record)

Historically the IM program for image analysis ran on a Unix system. Currently it is generally run on a Windows PC, using the file setup described below.

  1. Obtain the file image.exe from the public directory of Randy's Andrew Unix account. To do this, issue the following command from your own Andrew Unix account:
    cp ~feenstra/public/image.exe .
    Place the image.exe file into your main Windows directory, which below is assumed to be named WINNT.
  2. Also in the WINNT directory place the following files associated with the EI editor:
     ei.* eiuser.pro eiwhite.col eicolor.mnu 
    Note that the eiuser.pro file has been modified here in order to run IM using the F5 and F6 keys, by adding the following lines to the end of the eiuser.pro file:
     F5={SAVE ^ SY > image < %N } F6={SAVE ^ SY image < %N } 
    Also, in the top part of this file, the line starting with 'HELP' has been modified to include '5=IM 6=IM+'. In this way, you can simply press the F5 key and IM will run on the batch file which you're currently editing. If you press F6 then IM will also run on that batch file, and the output from IM is directed to the EI window (terminate that with F3).
  3. In order to achieve uniform, convenient window sizes when running IM, you can use the following command file im.cmd, placed in the WINNT directory, and containing the commands:
     ei.exe %1 copy c:\WINNT\eisav.rec ei.rec 
    and you'll also need the following file eisav.rec, also placed in the WINNT directory:
     eiw.geo 55 46 561 11 "fixedsys" 15 400 : 512 512 10 10 
    Then, ASSOCIATE the .im file type with the im.cmd command. Note also that there's an ICON defined, tip1.ico or tip2.ico, which you can also associate with the .im filetype.
  4. To handle graphics viewing, the program uses Irfanview. You must have your PATH specified to include the location of this program. (Or, just place the executable program i_view32.exe into the WINNT directory or whichever similar directory is automatically in your path). Since, under the old Unix version, the graphics viewers XV and XIM are used, you should for safety define .cmd files in the WINNT directory to redirect the XV or XIM commands to Irfanview. To accomplish this, define the files 'xv.cmd' and 'xim.cmd' in WINNT, and place the following line in both files:
     start /b i_view32 %1 
  5. To handle line plots, the program uses VP. Again those files must be in your path, or put them into the WINNT directory or a similar one. In this case a number of VP files must be included in that directory:
     vp.* vpugh*.* *.pro *.fnt *.ini profile.exg userprof.exg 
  6. One possible incompatibility may arise between the PC and Unix versions of IM, if you transfer the entire contents of an old directory from Unix to the PC and then run a .im file. In the former version of IM, when the 'di' command is executed it created a file called 'xim.cmd' which stored the contents of the call which invoked XIM. However, this SAVE filename is now used in the new versions of IM to redirect the call invoking XIM to one invoking Irfanview. Thus, in the new version, the file which stores the XIM command is called 'ximc.cmd', and there's no problem. However, to avoid any conflict, you must delete any files named 'xim.cmd' from any directories which you transfer over from Unix to the PC.

In Unix, the record length for sequential direct access files can be set to 1, and the program uses whatever length is necessary. On the PC an explicit value must be set for this parameter. Also, to ensure compatibility between Unix and PC this parameter must be set to byte units. This can be accomplished in the compiler options by the switch: /assume:byterecl (default is 4-byte units).

Additional notes:
1. be sure to place file DEFAULT.UGH in the WINNT directory, since this is needed to produce a viewable color lookup table within VP. (NOTE: the colors are wrong, but at least they're viewable. To achieve proper colors probably a different file than DEFAULT.UGH is needed, and input in the first 'restart' command in an .exg file. Also, for ugh-ps, by default images are rended in a gray scale. To achieve some other lookup table, a .vlt file must be constructed with that lookup table (see GIFTOUIM reference file for details)).
2. When using .exg files, the folders they reside in should NOT have any blank spaces in their names.
3. For automatic output of spectra, the file utops.cmd (and utops_color.cmd) must be in the WINNT directory. Also, in the VP directory, the file U-PS.PRO should have the following lines at the end:

bare
hershey
fill 0.9
repl