Fort Collins Science Center

You are here:  FAQ's > Operating System & Hardware Issues

SNTEMP (In)Frequently Asked Questions:
Software and Hardware Issues

Back to SNTEMP FAQ

Q42. Is there a handy way to get the outputs to print on "normal" size paper? Or is the best alternative to use the "" delimited data and plunk it into a spreadsheet?

A42. Most printers these days come with either software and/or front-panel hardware to compress the font and/or turn the printing sideways to 132-column print. My guess is that if you read the printer's manual (ugh!) you will discover a way. Sometimes it is possible and desirable to put the appropriate printer "codes" in a file that then a batch file can send to the printer as a set-up command. Let me know if you continue to have trouble and I’ll see what I can do.


Q73. To ensure the local shade file is used, do you have to indicate that a shade file is present and that the global shade model is to be used in the job control file (Record 3, fields 78-79)?

A73. Yes. The wording for this option in the job control update program (JBCNUD) may make more sense than what is in the manual.


Q82. I am not a DOS expert and find it really confusing that SNTEMP overwrites its output files. Wouldn't there be some way to give the output files from different runs an extension so that I could keep track of them.

A82. The batch file for SNTEMPX.BAT shown below contains an enhancement that may prove useful to you and to others. Basically, it adds a third parameter to the command line so that you can enter a DOS filename extension. If you do (with the first two being mandatory), the batch file will rename each existing output file to have a more descriptive table number/name with the file extension you provide. For example, the command line:

SNTEMPX infile N tst

Will run the file "infile" answering No to the "Do you want to change" question, and rename output files to be TABL1-3.tst, TABL8.tst, and so on. Note that running this batch file repeatedly with the same extension will overwrite previous output files with the same extension.

This batch file has not been tested under many problem scenarios, so I can’t vouch for stellar behavior. In particular, it may possibly rename any previously existing output file IF that output file is no longer produced given new combinations of SNTEMP’s T/F output control flags.

ECHO OFF
REM
REM STREAM NETWORK BATCH FILE - EXTENDED
REM V 2.7
REM Modified to add command line extension to output files
REM
IF EXIST ZZFILS DEL ZZFILS
IF !%1==!? GOTO HELP
ECHO -----------------------------------------------------
ECHO STREAM NETWORK TEMPERATURE MODEL VERSION 2.7
IF !%1==! GOTO RNFIL
ECHO %1 >> ZZFILS
IF !%2==! ECHO 1 >> ZZFILS
IF NOT !%2==! ECHO %2 >> ZZFILS
:RNFIL
JBCNUD.EXE
IF NOT EXIST KJOBCN1 GOTO EXIT
IF NOT EXIST ZZFILS GOTO EXIT
IF EXIST KVRSTRG DEL KVRSTRG
IF EXIST KSTRMGM DEL KSTRMGM
STRGEM.EXE
IF NOT EXIST ZZFILS GOTO EXIT
IF EXIST KVRHYDR DEL KVRHYDR
IF EXIST KQSTATS DEL KQSTATS
IF EXIST KHYDROL DEL KHYDROL
HYDROL.EXE
IF NOT EXIST ZZFILS GOTO EXIT
IF EXIST KMERGE DEL KMERGE
IF EXIST KVRMETR DEL KVRMETR
METROL.EXE
IF NOT EXIST ZZFILS GOTO EXIT
IF EXIST KRGRSSN DEL KRGRSSN
IF EXIST KVREGTW DEL KVREGTW
REGTWO.EXE
IF NOT EXIST ZZFILS GOTO EXIT
IF EXIST KTRNSPT DEL KTRNSPT
IF EXIST KVSTATS DEL KVSTATS
IF EXIST KVRTRNS DEL KVRTRNS
TRNSPT.EXE
IF NOT EXIST ZZFILS GOTO EXIT
IF EXIST KVRSTAT DEL KVRSTAT
VSTATS.EXE
ECHO 
ECHO MODEL RUN COMPLETED
if !%3==! goto stop
if exist Tabl10.%3 del tabl10.%3
if exist Tabl1-3.%3 del tabl1-3.%3
if exist Tabl4-5.%3 del tabl4-5.%3
if exist Tabl6.%3 del tabl6.%3
if exist Tabl7.%3 del tabl7.%3
if exist Tabl8.%3 del tabl8.%3
if exist Tabl9.%3 del tabl9.%3
rem
rename kvrjbcn Tabl10.%3
rename kvrstrg Tabl1-3.%3
rename kvrhydr Tabl4-5.%3
rename kvrmetr Tabl6.%3
rename kvregtw Tabl7.%3
rename kvrtrns Tabl8.%3
rename kvrstat Tabl9.%3
GOTO STOP
:HELP
echo.
echo SNTEMP - Stream Network Temperature Model Version 2.7
echo.
echo SYNTAX: SNTEMP JBCNT CHJOB EXT
echo.
echo where: JBCNT = job control file (input)
ECHO CHJOB = Y or y if the job control file needs to
echo be changed, N or n if the job control
echo file should not be changed.
echo EXT = DOS file name extension (max 3 chars)
echo.
echo.
echo.
GOTO STOP
:EXIT
ECHO.
ECHO FATAL ERROR - SNTEMP RUN TERMINATED
ECHO.
:STOP
IF EXIST ZZFILS DEL ZZFILS
ECHO ON


Q138. We're doing a study on a short (2 km) reach that will be affected by a weir. The upstream (H-node) point seems kind of arbitrary, as there is no obvious spot like a dam or a trib. Is there an advantage to putting it as close as possible to the likely upstream extent of the weir effect, vs. putting it several km upstream?

A138. I can think of no real advantage to putting the H node far above the weir. Certainly you would want to minimize data collection upstream. However, having at least some reach upstream would at least give you the opportunity of comparing with and without the weir, changing width and Manning's n, etc., so going up to the farthest influence I suppose is a good idea. [Added 6/2002]


Q139. Is there a way to save the screen view of SSTEMP so that the input values can be retrieved later without having to reenter them? I have been able to save the inputs in the text file, but have had to redo the inputs from scratch each time I need to modify a value.

A139. Saving the values to a text file, and then opening that text file and reading them works pretty well. Have you not gotten that to work? I have noticed some problems, particularly with the units, but double clicking on individual items if necessary seems to fix those. I still need to do some work on this. Make sure you are using version 1.2.3 or later. [Added 6/2002]


Q140. I've requested SNTEMP to fill in three temperature records at a dam node (S) and set the node identifier accordingly with the 'fill' command and have chosen regression #6. The program didn't recognize the missing data for some reason. I'm at a bit of a loss. Any advice? I only have one year's worth of data to work with if that's a possible source of problem.

A140. Choosing regression option #6 may or may not give you confirmation that it actually did anything. Carefully check Table 7 to see what it says. Then rerun without choosing #6 and see if there is a difference. [Added 6/2002]


Q141. I have a validation node at the downstream most location in my network (i.e. a have a 'V' node and a 'E' node at location 0.0), is this not a good idea?

A141. It's fine to put a V node at the end. For clarity, I would recommend putting the V node 0.1 km upstream just to segregate a bit. [Added 6/2002]


Q142. I've now completed my input files and have tried an initial run of SNTEMP. I requested Tables III, V, VI, VII, VIII, IX, and X but only got III, V, VI, and VII to spit out. I had the same problem when I ran the sample data set for the Colorado River. My files check out OK through the TDATCHK program (thanks to the dosxnt.386 file you sent me). Any thoughts on this? Am I not turning something on correctly in the job control file?

A142. I can see no reason for you to get only the tables you said you got unless you accidentally put Ts in the wrong columns. Here are three suggestions. (1) When you start the SNTEMP batch file, do not put the NO at the end. This will let JBCNUD prompt you for output requests and more. Tell the program that you want all output tables. (2) Make sure you are looking for the right output file names. (3) Try the attached batch file replacement that renames output files more logically. [Added 6/2002]


Q143. I'm having problems printing out my reports, and I hoped you might be able to give me some advice on how to best do that. Thanks.

A143. Printing:

  1. Most printers these days come with either software and/or front-panel hardware to compress the font and/or turn the printing sideways to 132-column print. My guess is that if you read the printer's manual (ugh!) you will discover a way. Sometimes it is possible and desirable to put the appropriate printer "codes" in a file that a batch file can then send to the printer as a set-up command. Let me know if you continue to have trouble and I'll see what I can do.
  2. You can of course always bring the files into Word or WordPad, change the margins, font (courier), page layout, etc., and print. Kind of a hassle, but that way you can get exactly what you want. [Added 6/2002]

Q237. In the KVRTMP output file, there is a column right after node type that includes an F, in my case the F's show up after a V node.  What do these represent?

A237. F flag.  I'm a bit stumped on this one, but my supposition is that you actually have this F in the hydrology node input file in column 18.  The F means that you will not get output listed for this node as described on page III-71 of Information Paper16. 


Q238. I'm just starting to try running SNTEMP on my computer and am very unfamiliar with DOS. I have a DOS for Dummies book coming in the mail but it is taking awhile and I really want to continue with the IF 312 lessons while I have the time. I'm following the instructions in topic #19. The KVRFJOB.DAT file seems to run OK, but no verification or output tables are given and I can't seem to find them anywhere. I checked the job control file and the T's appear to be in the right place to produce the tables. Any suggestions?
Follow-up - Actually I just had a look and found all the tables. I had checked before but I don't think I had changed the job control file at that time to specify that I wanted the tables creates. I still don't have any .OUT files, but all the tables are there as .LST files. So as long as that is normal, I think I have things more or less under control.
Followup2 - OK that worked (all the tables are now available as .LST or .OUT files). I was looking for the .OUT files because in topic #19 under the heading Test Data Sets it says after running the batch file.....you may compare the resulting files with their corresponding .OUT files. Above that it does say that the LIST utility is good for viewing the output files, but I wasn't sure how to use that utility. Anyways I think I can at least run the model now - thanks for the help.

A238. I am sure DOS is intimidating at first, but it really turns out to be not that hard once you learn a few basics.  You will likely need to figure out the DOS Dir command to get your listings of files, but you will find that you can also use the Windows Explorer for that, but you may need to press Refresh every now and then.  I also highly recommend learning to use a utility like List, which I believe is included somewhere in the SNTEMP utilities group.  If you cannot find it, let me know.  It will really simplify your life when you get used to it.

In any event, let's take a look at your problem.  How are you starting SNTEMP?  It should be something like

            SNTEMP KVRFJOB.DAT

Then you say it seems to run OK.  Does that mean that you see text come to the screen for each of the seven programs running in the batch file?  I'll assume so.  If true, the output files then will go into your folder but you must look at them using List (or Type or WordPad).  There are lots of tricks to make this workflow easier, but let's get the basics down first and make sure that you've got SNTEMP working OK on your computer. 
Follow-up- I'm not sure why you were expecting OUT files unless you had already figured out the advanced use of the batch file.
SYNTAX:   SNTEMP JBCNT CHJOB EXT
where:    JBCNT = job control file (input)
               CHJOB = Y or y if the job control file needs to be changed, N or n if the job
                         control file should not be changed.
                EXT   = DOS file name extension (maximum 3 chars)

This means, for example, that if you type at the DOS command line:
            SNTEMP  KVRFJOB.DAT  N  OUT
and DOS finds all the files and programs it needs, you should get a series of OUT files for the tables you have requested.


Q239. Sorry to bother you again, but I've been working on this problem all day so far and I can't get it. I'm running the Tdatchk on the jobfile.bad file I got off of the SNTEMP website. I have fixed all of the problems listed in your answers for the topic but still have one error. It is for the hydrology node file. It says:

ERROR_ - EOF reading Hydrology Node File

ERROR: Invalid number of instruction lines for a validation node!
Approximately at line           18 in HYDNODE.BAD
But in the file there is no line 18, the data ends on line 17.

I tried running SNTEMP but it terminates before completing. It says that the hydrology nodes indicated in the hydrology files and the number indicated in the job control file. It says there are 12 in the job control file but only 8 in the hydrology files. But I checked both the hydrology node file and hydrology data file and both have 15 nodes.

The model also encounters and EOF when looking in the hydrology node for the Green River S  1S2  661.3 but I checked and that is the first node in the hydrology file.

A239. I’m not sure exactly, but my strong suspicion is that you've got a bad value in column 19 on at least one node in your hydrology node file.  This column (see page III-71 in Information Paper16) indicates how many of the following lines to skip before picking up the next node.  This is sort of confusing because SNTEMP really doesn't do anything with these intervening records -- it was designed to interface with another program you need not know about.  Anyway, it sounds like it is trying to read too many lines and then reaches the end before finding everything it expects.

The other possibility that comes to mind is that the number of hydrology nodes in the job file (from records 5 and 6) is somehow wrong.  SNTEMP is VERY picky about having numbers be in the correct columns, and right justified, i.e. flush to the right in that field (except for numbers with decimals).  Checking Table 10 can help locate some of these kinds of errors.


Q240. I am using SNTEMP to model temperatures in a section of the X. River.  I had the model running fine (all routines) and then added calibration (K) nodes in the two tributaries (I added the K nodes in since I have temperature data but very little information on the tributary geometry – this forces the inflow temperatures from the tributaries which are not a major concern).  My problem is now the VSTATS sub-model fails to run through to completion with the following message given in Table IX of the KVRSTAT file.
 
$$$-VALIDATION TEMPERATURE FILE PASSED FROM 'TRNSPT' PROGRAMOUT-OF-SEQUENCE.  THE STREAM ID DATAFOR THE  1YEAR,  2 TIME PERIOD,
 AND  1 NODE(        BIGHILLK    3.4 calibration temperatures use J. fork              )  DOES NOT MATCH THE INITIAL STREAM
 ID DATA OF  (      S F S.   17.7 SFSC4                                         ).
 
Any suggestions on how to use the K nodes without this problem?

A240. Well, you sort of got me on this one.  I've seen lots of messages like this, but never from VSTATS.  It usually means that you have one or more nodes out of order, probably in either your hydrology node file or hydrology data file.  Other possibilities include the wrong number of nodes in your job control file (likely K nodes) or possibly in your geometry file.  Last, I'd check the number if 'linkage' nodes if you have them, in your hydrology node file.  Assuming you have none, double-check the column positions.
 
Try running the TDATCHK program and see if it can sort out the problem.


Q241. I have reviewed the contents of the IF 312 course material, and am now at the stage where I am ready to start building input files (at least the stream geometry file).  I have one question; when I build the input files, do I just type in the information with the required character spaces in an application like MS Notepad or WordPad and save as a text (txt) file?  I have looked around IF 312 for information on file format but have been unable to locate it.  Any help is appreciated. 

A241. As for file format, welcome to the old DOS/Fortran world.  There are essentially two main ways to go here, neither simple nor error free. 

The first is to use the practice data files (VRF) as a guide to follow.  This can be done in any word processing program that will save the files as plain text.  WordPad is fine except that its default is an RTF file.  Be careful of that.  Neither Notepad nor WordPad show column/line numbers, which are really handy to have.  You can download some freeware from the web that does show line and column numbers.  NotesPad (note the extra s) is one that I use occasionally, but it also has some of its own bad habits.  If you find a good one, let me know.  Also, watch out for extra blank lines getting added at the bottom of your files.

The other main technique is to use Excel.  This can have significant advantages, but only if you are good with it.  You must then write each file as a space-delimited PRN file -- no tabs allowed.  Column widths can be adjusted, though you may not need to do this because I believe 8 is the default (but please double-check as I have not done this in a long time).  Be careful about formatting for decimal places.

No matter what, always double-check everything because getting your first run to work is always the most difficult task.  SNTEMP remains very picky.  Be sure to use TDATCHK.  This will check for tabs and extra blank lines, as well as many other potential errors.


Q242. I am at the point where I am creating the job control file (all my other files have been created), and I have just a few questions on some inputs that I am a little confused about.

  1. In the job control file, I am not sure what to put into the file for the entry “total number of nodes in the system; may be 0” (record 4, field 73 – 80). Do I want to put in the total number of nodes, or 0? Why would one want to put in 0 as opposed to the total number of nodes? If one enters 0, what does that do to the output?
  2. Record 6, field 73 – 80: Same as above.  What is the difference, in model operation and output, between entering 0 and the number of nodes in the system.

A242. Excellent questions.  I obviously didn't include the rationale for entering zero and this is confusing anyway.

Here's the way the software works.  Whoever wrote SNTEMP must have been frustrated at not being able to accurately count nodes in all these various files; it is certainly a pain to do so.  So they finessed the software to count the nodes instead of requiring the number to appear in the Job Control File.  Unfortunately, they didn't seem to do this consistently.  So where I indicate that you can put in a zero if you wish, the code does the node counting for you.  If not, you have to count them yourself -- and get it right.  If you do the counting and get the number wrong, SNTEMP will protest.  Otherwise, there is no difference in operation of the model.

Remember to use TDATCHK liberally and try not to get too frustrated.


Q243. Just one other thing, it looks like all the input files have to have the .dat extension.  Since my text editor, Notespad, doesn't have an option to save to .dat I assume I can just change the extension in windows explorer and it should work. Good assumption?

A243. Actually, there is no requirement that the extension, if any, be ".dat", but I would encourage you to use some scheme of your choosing: .txt for example.  I don't remember Notespad well enough, but strongly suspect that if you just type in .DAT it will accept that.  If not, you can probably force it to do so by typing the file name surrounded by double quotes.  I would not recommend something where you always have to change the names in Explorer.  That would be an extra place to introduce errors.


Q244.

  1. I notice in the example job control file for the Upper Colorado, that all records (records 5 and 6) that detail the number of each type of node, i.e. "Number of B nodes", etc. have a value of zero, except for "number of V nodes" (record 6, field 33-40), which has a value of 1.  Why is that?  Does SNTEMP code count these individual nodes as well when zero is entered, and if so why then is a 1 entered for the "number of V nodes"?
  2. If modeling for only one year, then is input for both "starting year sequence number of output" (record 6, field 41-48) and "last year sequence number of output" (record 6, field 49-56) the value "1"?
  3. Finally, if no shade value was created, because shade values were entered into the geometry file, then is the entry for record 11, field 33-48 left blank?

A244.

  1. I don't know the answer for sure, but must assume that in each case on those records, a zero was sufficient.  Whether zero is sufficient for V nodes would be easy to test.  Fortunately, of all the error messages SNTEMP may generate, those dealing with node counts are some of the easiest to understand.
  2. Yes
  3. It doesn't matter because it will be ignored.

Q245. Has anyone ever written a post-processor to handle the large amount of data SNTEMP kicks out? I ran the TMPFIT program and that does some of the leg work but before I start importing all of this into Excel I thought I'd ask.

A245. Good question.  The answer is "sort of".  As you may know, there is one table that we added many years ago that can be quote delimited.  Check the T/F switches for, I think, Table 11.  If you put a double quote (") instead of a ‘T’, you get a handily formatted file.  It was at the time intended for Lotus 1-2-3, and may be a bit more of a hassle to import into Excel.

You may not know that we developed some nice macros for Lotus 1-2-3 that imported the SNTEMP output and then let you look at single locations through time or multiple locations through space.  I actually don't remember everything that this did, but you could find the worksheet buried in the SNTEMP utility download as KT2123.  Whether Excel would correctly interpret the macros is doubtful, but you could try.

Other than these approaches, we have just done ad hoc work with the files.  Chances are others have developed some applications but I don't explicitly know.


Q246. I would like to get SNTEMP output for the following items in a delimited ASCII file

DATE
STREAM NAME
NODE TYPE
STREAM DISTANCE
DAILY PREDICTED WATER TEMPERATURE
DAILY MAXIMUM PREDICTED WATER TEMPERATURE

in a format that would look something like the following (order of columns is not important and any date format will work)

06/14/2005     YAKIMA RIVER     O     89.8      11.5     12.7

The only output file I am familiar with is KVRTRNS. Is there a way to select specific items and output them to a delimited ASCII file as described above?

A246. We did add an option that should work for you.  Check the updated model input format in the IF 312 class notes.  You should see an option in the job control file (or if you manually run SNTEMP) that produces an additional output file called KVRTMP (which is also Table 11 if I remember correctly).  You have the option of putting a T in the job control file for pure ASCII or a " (double quote mark) if you want quote delimited -- which was best for Lotus 123 but not quite as good for Excel.  I believe this is column 14 on line 3.  A bit of experimentation should resolve what the best for what you want is.  It might not give exactly what you asked for, but you should be able to solve your problem with not much work.  Once in Excel, you can sort the data however you wish, i.e., by space or by time.

[Updated 5/2007]

Top of Page
Skip navigation and continue to the page title

Accessibility FOIA Privacy Policies and Notices

Take Pride in America home page. FirstGov button U.S. Department of the Interior | U.S. Geological Survey
URL: http://www.fort.usgs.gov/products/Publications/4037/faq_software.asp
Page Contact Information: AskFORT@usgs.gov
Page Last Modified: 1:07:20 PM