Creating, Assigning, Setting Defaults, and Closing a Vam File

To create a Vam file from a Vam configuration file, the command in G7 is

vamcreate <vam configuration filename> <vam filename>

For example, to create the Vam file hist.vam from the configuration file vam.cfg, the command is

vamcreate vam.cfg  hist

The vamcreate command may be abbreviated to vamcr, or:

vamcr vam.cfg hist

At this point, the newly created Vam file has zeroes for all of its data. The following help pages deal with how to put data into it.

The first step is to assign it as a bank. The command is

vam <filename> <letter name of bank>

For example:

vam hist b

will assign hist.vam as bank b. Letters ‘a’ through ‘z’ (except ‘w’) may be used to designate banks. However, it generally is a good practice to leave ‘a’ as the G7 bank which initially was assigned.

In order not to have to continually repeat the bank letter, most commands for working with Vam files use the default Vam file. It is specified by the dvam command

dvam <letter name of bank>

For example:

dvam b

A Vam file already must be assigned as a bank before it can be made the default. However, if several Vam files are assigned, the default can be switched from one to another as often as needed.

To review, the commands

vamcr vam.cfg hist
vam hist b
dvam b

will create an all-zero Vam file as specified by the VAM.CFG file, assign this file as bank b, and make it the default Vam file.

Assigning a Vam file to G7 opens the file for writing as well as reading, though most commands will modify the Vam bank only if it is assigned as the default bank. The operating system ensures that no two programs can have the same file open for writing. Hence, if after looking at model results in the file dyme.vam, we decide to run the model again, we must first close DYME.VAM with the G7 close command. Thus the sequence might be

...
vam dyme c
gr c.out1
...
close c

and we are then free to run the model again and write to the DYME.VAM file.