MODEL OPERATIONS MANUAL FOR PHASE 4.3 For phase 4.3, calculations to determine the input data are performed within the preprocessor, so that data can be read into the model in a more raw form. For instance, in 4.1, fertilizer applications calculated as a percentage of the reference applications in a spreadsheet. These factors are then used to multiply all of the fertilizer special actions. In 4.3, the inputs of manure, fertilizer, atmospheric deposition, mineralization, and nutrient management acres are are considered in a preprocessor that then determines the factors relative to the calibration run. The main advantages to this approach are less manual manipulation of the data and a lower level of knowledge required to perform a model run. CALIBRATION RUN OPERATIONS The calibration run must be preprocessed, run, and postprocessed before any scenarios can be run. The processing of the other scenarios is dependent on the calibration parameters and output. #1 RUN PREPROCESSOR 0 Go to /work/wsm/pp/bin/ type pre0_make_base_binary.exe Makes the binary file that contains mineralization rates and fertilzer for the calibration run. #2 RUN PREPROCESSOR 1 Go to /work/wsm/pp/bin/ type pre1_make_scenario_binary.com calib Makes the binary file that contains loading and bmp information describing the calibration run. #3 RUN PREPROCESSOR 2 Go to /work/wsm/pp/bin/ type pre2_calc_nutrient_management.com calib Calculates the new scenario fertilizer information taking into account land use and nutrient management information. #4 RUN HSPF Go to /work/wsm/scripts/ If you have a smaller hard drive and need to save space, type run1_post3.com calib Runs the entire watershed and deletes the hourly concentration files after converting them to daily and calculating the daily loads. Takes longer to run. If you have plenty of space type run1.com calib Runs the entire watershed leaving the hourly load files intact. #5 RUN POSTPROCESSOR 0 Go to /work/wsm/pp/bin/ type post0_make_calraw.exe Makes the binary file that contains the calibration loads which are used for comparison in the postprocessing of other scenarios. You are now ready to start running scenarios. If you want the loads from the calibration run, you can run postprocessors 1, [3], 4, and 5. Do not run postprocessor 2 and you can only run 3 if you ran the calibration using run1.com rather than run1_post3.com Output for the calibration run will appear in /work/wsm/pp/tables/calib/ SCENARIO OPERATIONS The following instructions will detail the necessary steps in performing a model run. Wherever the word '$scen' appears in the text, it means that you should substitute the name of the scenario that you are running. For consistency, each scenario name should be short and begin with an 's' followed by a 2 digit number. The reference scenario is 's01ref', the 1998 progress is 's04pr98'. For example, to carry out instruction #1 below for the 1998 progress run, type: z1_make_scenario_subdir.com s04pr98 #1 MAKE DIRECTORY STRUCTURE Go to /work/wsm/pp/setup/ type z1_make_scenario_subdir.com $scen This creates all the directories needed to run the model and pre- and post-process the data. This step is the one that creates the new scenario name ( run time 15 seconds ) #2 MAKE DATA FILES All data files are comma delimeted, and with few exceptions, must contain values for all statesegs and not repeat any statesegs. Any lines that begin with 999 or 9999 are treated as comment lines and are not read. Examples of all of these files are in /work/wsm/pp/data/calib/ The required data files are as follows: atm_$scen_wm_wet.csv, atm_$scen_cd_wet.csv, atm_$scen_wm_dry.csv, and atm_$scen_cd_dry.csv - files to express the change in atmospherically deposited nutrients during the warm and cold seasons, for wet and dry deposition. Some of the values are meaningless. (e.g. there is no dry Organic N deposition in the model) col1 - segment col2-6 - fractions of NH3, NO3, ORGN, PO4, and ORGP relative to baseline. land_use_$scen.csv - land use by stateseg in acres. col1-3 - stateseg, state, seg col4-13 - forest, hitil, lotil, pasture, pervious urban, hay, mixed open, impervious urban, manure, water, { total - optional } manure_$scen.csv - manure applications in lb/ac by stateseg, land use, constituent, and month. col1 - stateseg col2 - year (not read) col3 - land use { 'hitil', 'lotil', 'hay', 'pasture' } must be exact col4 - constituent { 'nh3', 'no3', 'orgn', 'po4', 'orgp' } must be exact col5 - 16 monthly lb/ac load of manure applied ( values are from cbp manure pre-processor access database ) masslinks_$scen.csv - BMP factors by stateseg, land use, and constituent col1-3 - stateseg, state, seg col4-12 - Nitrogen pass-through efficiencies for forest, hitil, lotil, pasture, pervious urban, hay, mixed open, impervious urban, manure. col13-21 - Phosphorus . . . col22-30 - Sediment . . . n_nut_man_acres_$scen.csv - acres in nitrogen nutrient management by stateseg and land use -- same format as the land use file col1-3 - stateseg, state, seg col4-13 - forest, hitil, lotil, pasture, pervious urban, hay, mixed open, impervious urban, manure, water p_nut_man_acres_$scen.csv - acres in phosphorus nutrient management by stateseg and land use -- same format as the land use file col1-3 - stateseg, state, seg col4-13 - forest, hitil, lotil, pasture, pervious urban, hay, mixed open, impervious urban, manure, water pointsource_$scen.csv - point sources for this scenario by state, seg, cell, month, and constituent Some statesegs will not be included in this file and repeated statesegs will be summed. This allows for the loading file for the water quality cells to be used for watershed model input as well. col1 - state ( 2 letter abrv. ) col2 - segment col3 - cell (not read) col4 - month ( 1-12 ) col5-6 - BOD and DO ( not read ) col7 - flow (mgd) col8-12 nutrient loads in lb/day - nh3, no3, orgn, po4, orgp septic_$scen.csv - septic loads of nitrate to the edge of stream in lb/day col1 - stateseg col2 - nitrate lb/day All files should be stored in /work/wsm/pp/data/$scen/ #3 RUN PREPROCESSORS All preprocessor script files are found in the directory /work/wsm/pp/bin/ the source code is in /work/wsm/pp/presrc/ If you ever need to rerun the calibration, you will need to rerun preprocessor 0. To to this type pre0_make_base_binary.exe this step will only be necessary if you replace the calibration data. If you accidentally run it again, it will not matter. ( run time - several minutes ) Steps for all scenarios: type pre1_make_scenario_binary.com $scen ( run time - several minutes ) reads in all information that defines a watershed model scenario and stores it in binary format troubleshooting - read unexpected character => bad data file format - error on write => probably permission problem type pre2_calc_nutrient_management.com $scen ( run time - 10 seconds ) calculates nutrient management reductions in fertilizer and manure. All of the nutrient management rules are contained in this executable. factors to alter the pqual section are also computed in this section. this processor writes four types of files 1. balance files - stored in the data area, these files contain nutrient input and uptake information by stateseg and landuse. 2. derived application binary - stored in data area, contains the fertilizer applications by month 3. binary file - all of the data is re-written to the large data binary created in pre1 4. poofed manure file - manure that cannot be used on cropland under nutrient management. 5. CBEMP info - written to /work/wsm/util/pin - used by ping to assign loads to the CBEMP, contains land use, septic and atdep troubleshooting - crash probably due to permission problem type pre3_change_uci_files.com $scen creates new uci files in the new scenario directory using the calibration UCI files and the information in the scenario binary and derived application binary files that were produced during the last two steps. ( run time - 30 seconds ) troubleshooting - if crash occurs, could be bad data, such as a negative number or could be that the uci file is changed. check the data and the input file where crash occured and fix the problem. type pre4_change_wdms.com $scen copies untouched calibration wdm files to the scenario directory under /work/wsm/wdm/freshwdm/ then changes the wdms to include the new point sources repeated year by year. When a run is performed, this changed wdm is copied from the ./freshwdm/ directory to the /$basin/$scen/ directory so that the wdm created during this preprocessor step is not changed during model runs. ( run time - one minute ) type pre5_atdep_wdm_modification.com $scen changes the atmospheric deposition in the wdms according to the atm_$scen_cd.csv and atm_$scen_wm.com files. Runs like pre4 If you get a crash during this processor, you may have corrupted the WDMs for this scenario. Fix the problem and then rerun pre4 and pre5. ( run time - five minutes ) #4 RUN THE FIRST SCENARIO RUN All uci files can be run with a single command in the directory /work/wsm/scripts/ type run1.com $scen if you have lots of storage or type run1_post3.com $scen if you are worried about storage space Total run time approx 12 hours. troubleshooting - If you get crashes or strange results, make sure that you are able to overwrite any existing files. This includes WDMs, echo files, output files, and pltgen files. Most of the obscure reasons for crashing have been fixed, but check the echo file for errors as the first step in fixing a crash. check for completeness: type check.com $scen This will only take a few seconds, and you should get no run-time messages. If any are written, you have missing echo files meaning the run was not successful after running the check.com program, cd to /work/wsm/scripts/check_echo/ and read the file all_echs.$scen Check this file carefully, every second line must read 'End of Job' If this is not the case, you have an error. Also check that all the dates and times in the file are during the time that you performed the first run. If some are earlier times, those UCI files did not run this time. #5 RUN THE FIRST TWO POSTPROCESSORS All postprocessor script files are found in the directory /work/wsm/pp/bin/ the source code is in /work/wsm/pp/postsrc/ As with the preprocessors, if you have rerun the calibration, you will need to rerun postprocessor 0. To do this type post0_make_calraw.exe If you run this accidentally, a new file will be written but there will be no changes. ( run time - 10 minutes ) Steps for all scenarios: type post1_edge_of_stream_loads.com $scen reads all of the pltgens for the different land uses and forms the data structure of daily and annual loads. It also compares the edge-of-stream loads to the calibration run and prepares bed sediment reduction factors. ( run time - 10 minutes ) type post2_bed_fix.com alters the uci files according to the bed sediment reduction factors found in the previous processor. ( run time - 20 seconds ) #6 RUN THE SECOND SCENARIO RUN As in step #4, either type run2.com $scen or type run2_post3.com $scen ( run time about 8 hours ) the only difference between run1 and run2 is that bfl is not rerun since there is no bed sediment to change. check the echo files by typing > check.com $scen This will create the file all_echs.$scen in the ./scripts/check_echo/ directory review this file as in step #4 #7 RUN THE LAST THREE POSTPROCESSORS All postprocessor script files are found in the directory /work/wsm/pp/bin/ the source code is in /work/wsm/pp/postsrc/ Steps for all scenarios: If you used run2.com type post3_make_new_load_files.com $scen This takes the hourly pltgens for flow and concentration and converts them to daily load pltgens that are read by the CBEMP preprocessor and postprocessor 4 ( run time - 90 minutes ) If you used run2_post3.com -- skip this step. If you try to run post3, you will get a crash, but it will not cause a problem. type post4_delivered_loads.com $scen Reads the pltgens created in the previous processor to determine the annual delivered loads and compares them to the edge-of-stream loads to detemine the delivery factors. ( run time - a few minutes ) type post5_final_delivered_loads.com $scen Combines all of the previous information and writes the tables in the /work/wsm/pp/tables/$scen/ directory. ( run time - 30 seconds )