From 9888866313df948cd52e9d582b6b435b3be3ecb7 Mon Sep 17 00:00:00 2001 From: "K. Jennings" <32177682+SnowHydrology@users.noreply.github.com> Date: Tue, 9 Aug 2022 11:25:27 -0400 Subject: [PATCH 1/7] updated readme/install docs and fixed fcheck flag --- INSTALL.md | 27 +++++++++++++++++-------- README.md | 55 +++++++++----------------------------------------- build/Makefile | 6 +++--- 3 files changed, 31 insertions(+), 57 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 0755725..775c1f6 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,14 +1,25 @@ -# Installation instructions +# Installation and example instructions -1. Clone the online github repository either from the main git repo source (https://github.com/NOAA-OWP/snow17.git) or your fork of it. - cmd: `clone [github source]` +1. Clone the online GitHub repository either from the main git repo source (https://github.com/NOAA-OWP/snow17.git) or your fork of it -- e.g., `git clone https://github.com/NOAA-OWP/snow17.git` 2. Change directory to the build directory: `cd snow17/build/` -3. Copy `Makefile` to `Makefile.local` and edit the local version to update the compiler and paths if necessary to match the resources on your system. -4. Run `make -f Makefile.local` to compile the program and generate the executable, which will be found in `snow17/bin/` -5. There is a test case in the `snow17/test_cases/` directory. To run it, first cd to the directory and unpack the example: `tar -xzvf ex1.tgz`. -6. cd into `ex1/run/` directory and run the shell script (`./runSnow17.csh`) or type `../../../bin/snow17.exe namelist.HHWM8` into your command line -7. Check the example output in `snow17/test_cases/ex1//output/` +3. Copy `Makefile` to `Makefile.local` (`cp Makefile Makefile.local`) and edit the local version to update the compiler and paths if necessary to match the resources on your system. +4. Run `make -f MakefileLocal` to compile the program and generate the executable, which will be found in `snow17/bin/` +5. There is a test case in the `snow17/test_cases/` directory. To run it, first cd to the directory (`cd ../test_cases/`) and unpack the example: `tar -xzvf ex1.tgz`. +6. `cd ex1/run/` to get to the run directory and then execute the shell script (`./runSnow17.csh`) or type `../../../bin/snow17.exe namelist.bmi.HHWM8` into your command line +7. Check the example in the output folder (`cd ../output/`) +TL;DR: +``` +git clone https://github.com/NOAA-OWP/snow17.git +cd snow17/build/ +cp Makefile MakefileLocal # edit to match your compiler and system resources +make -f MakefileLocal +cd ../test_cases/ +tar -xzvf ex1.tgz +cd ex1/run/ +./runSnow17.csh # or ../../../bin/snow17.exe namelist.bmi.HHWM8 +cd ../output/ # to view output data +``` Note that the ex1/ example is part of the repo. The unpacked directory and test contents will not be included in a push back to the online repo. To the program for other purposes, create new input files and output directories outside of the `snow17/` repository directory, and link to the executable in `snow17/bin/`. diff --git a/README.md b/README.md index a23c89f..a63772a 100644 --- a/README.md +++ b/README.md @@ -4,18 +4,15 @@ Snow17 is a snow accumulation and melt model that has been used by the National Weather Service since the late 1970s for operational streamflow forecasting. It is a temperature-index model that was first described in Anderson (1973) before being incorporated into the NWS River Forecasting System (NWSRFS) and more recently the NWS Community Hydrologic Prediction System (CHPS). The version of the Snow17 model maintained in this directory is formulated from original NWS FORTRAN code to be compatible with -the NextGen simulation and forecasting framework. +the [Next Generation Water Resources Modeling Framework](https://github.com/NOAA-OWP/ngen) (NextGen). - - **Technology stack**: The model code is written in FORTRAN with a driver that incorporates Basic Model Interface (BMI) commands to enable Snow17 to be run as a module within the NextGen framework. - is intended as standalone or as a module in a framework or other ecosystem. It has been compiled using gnu, pgi and intel compilers. - - **Status**: Beta (runs but has not been extensively tested; validates against the orginal repository version listed below, which has been extensively used)) - - **Links**: This code was adapted from source code included in https://github.com/NCAR/NWS_hydro_models -- a version used in federally-funded streamflow forecasting research at NCAR. The original source code for that effort was obtained from the NWS Office of Hydrology around 2013. The code has since been copied and adapted into other research repositories. + - **Technology stack**: The model code is written in Fortran with a driver that incorporates [Basic Model Interface](https://csdms.colorado.edu/wiki/BMI) (BMI) commands to enable Snow17 to be run in standalone mode or as a module within the NextGen framework (or other BMI-based systems). It has been compiled using GNU, PGI, and Intel compilers. + - **Status**: Beta (runs but has not been extensively tested; validates against the orginal repository version listed below, which has been extensively used) + - **Links**: This code was adapted from source code included in https://github.com/NCAR/NWS_hydro_models -- a version used in federally funded streamflow forecasting research at NCAR. The original source code for that effort was obtained from the NWS Office of Hydrology around 2013. The code has since been copied and adapted into other research repositories. ## Dependencies -TBA: Describe any dependencies that must be installed for this software to work. -This includes programming languages, databases or other storage mechanisms, build tools, frameworks, and so forth. -If specific versions of other software are required, or known not to work, call that out. +There are no current dependencies except for a Fortran-compatible compiler (e.g., GFortran) ## Installation @@ -27,21 +24,20 @@ TBA: If the software is configurable, describe it in detail, either here or in ## How to test the software -Run the included test case example -- see INSTALL.md +Run the included test case example -- see the [INSTALL](INSTALL.md) document. ## Known issues The restart capability has not been implemented, but will be shortly. -The software has so far only been tested with the gfortran compiler (on Cheyenne at NCAR) +The software has so far only been tested with the GFortran compiler (on Cheyenne at NCAR) ## Getting help -Currently, questions may be sent to Andy Wood (andywood@ucar.edu). If there are concerns or bug fixes, etc., please file an issue in this repository's Issue Tracker. ## Getting involved -We encourage community involvement in code development. For more info, please check out our CONTRIBUTING document. +We encourage community involvement in code development. For more info, please check out our [CONTRIBUTING](CONTRIBUTING.md) document. ---- @@ -56,37 +52,4 @@ We encourage community involvement in code development. For more info, please ch If you wish to use or adapt the code in this repository, please make sure that your new repository credits this one as the original source of the code. ### References - - Anderson, E. A., 1973: National Weather Service River Forecast System-Snow Accumulation and Ablation Model. NOAA Tech. Memo. NWS Hydro-17, U.S. National Weather Service. [Avail- able from Office of Hydrologic Development, NOAA/NWS, 1325 East–West Highway, Silver Spring, MD 20910.] - -### Related projects - -### Books, papers, talks, or other sources that have meaningful impact or influence on this project - - ----- ----- - -#### OWP Open Source Project Template Instructions - -1. Create a new project. -2. [Copy these files into the new project](#installation) -3. Update the README, replacing the contents below as prescribed. -4. Add any libraries, assets, or hard dependencies whose source code will be included - in the project's repository to the _Exceptions_ section in the [TERMS](TERMS.md). - - If no exceptions are needed, remove that section from TERMS. -5. If working with an existing code base, answer the questions on the [open source checklist](opensource-checklist.md) -6. Delete these instructions and everything up to the _Project Title_ from the README. -7. Write some great software and tell people about it. - -> Keep the README fresh! It's the first thing people see and will make the initial impression. - -## Installation - -To install all of the template files, run the following script from the root of your project's directory: - -``` -bash -c "$(curl -s https://raw.githubusercontent.com/NOAA-OWP/owp-open-source-project-template/open_source_template.sh)" -``` - ----- - + - Anderson, E. A., 1973: National Weather Service River Forecast System-Snow Accumulation and Ablation Model. NOAA Tech. Memo. NWS Hydro-17, U.S. National Weather Service. [Avail- able from Office of Hydrologic Development, NOAA/NWS, 1325 East–West Highway, Silver Spring, MD 20910.] \ No newline at end of file diff --git a/build/Makefile b/build/Makefile index 919433d..16479e6 100644 --- a/build/Makefile +++ b/build/Makefile @@ -45,9 +45,9 @@ endif # --- Define flags ifeq "$(FC)" "gfortran" - FLAGS_DEBUG = -static -Wall -g -ffree-line-length-none -cpp -fcheckall - FLAGS = -O3 -fdefault-real-8 -fno-align-commons -ffree-line-length-none -cpp -fcheckall - FLAGS2 = -O3 -fdefault-real-8 -fno-align-commons -ffree-line-length-none -cpp -fcheckall + FLAGS_DEBUG = -static -Wall -g -ffree-line-length-none -cpp -fcheck=all + FLAGS = -O3 -fdefault-real-8 -fno-align-commons -ffree-line-length-none -cpp -fcheck=all + FLAGS2 = -O3 -fdefault-real-8 -fno-align-commons -ffree-line-length-none -cpp -fcheck=all endif ifeq "$(FC)" "ifort" From 4b03fbf3110ee1894b608a0f43773a953dc7cec7 Mon Sep 17 00:00:00 2001 From: "K. Jennings" <32177682+SnowHydrology@users.noreply.github.com> Date: Tue, 9 Aug 2022 11:27:33 -0400 Subject: [PATCH 2/7] removing redundant ex1 dir --- .../ex1/input/params/snow17_params.HHWM8.txt | 26 ------------------- test_cases/ex1/run/namelist.bmi.HHWM8 | 26 ------------------- test_cases/ex1/run/runSnow17.csh | 9 ------- test_cases/ex1/state/README | 2 -- 4 files changed, 63 deletions(-) delete mode 100644 test_cases/ex1/input/params/snow17_params.HHWM8.txt delete mode 100644 test_cases/ex1/run/namelist.bmi.HHWM8 delete mode 100755 test_cases/ex1/run/runSnow17.csh delete mode 100644 test_cases/ex1/state/README diff --git a/test_cases/ex1/input/params/snow17_params.HHWM8.txt b/test_cases/ex1/input/params/snow17_params.HHWM8.txt deleted file mode 100644 index 098c997..0000000 --- a/test_cases/ex1/input/params/snow17_params.HHWM8.txt +++ /dev/null @@ -1,26 +0,0 @@ -hru_id HHWM8IL HHWM8IU -hru_area 2994.7 1271.3 -latitude 47.78 47.78 -elev 1612.50 2153.35 -scf 2.15177 1.86124 -mfmax 0.930472 0.754924 -mfmin 0.137 0.160 -uadj 0.003103 0.208042 -si 1515.00 1515.00 -pxtemp 0.713424 0.220934 -nmf 0.150 0.150 -tipm 0.200 0.050 -mbase 0.000 0.000 -plwhc 0.030 0.030 -daygm 0.300 0.200 -adc1 0.050 0.050 -adc2 0.090 0.090 -adc3 0.160 0.160 -adc4 0.310 0.310 -adc5 0.540 0.540 -adc6 0.740 0.740 -adc7 0.840 0.840 -adc8 0.890 0.890 -adc9 0.930 0.930 -adc10 0.970 0.970 -adc11 1.000 1.000 diff --git a/test_cases/ex1/run/namelist.bmi.HHWM8 b/test_cases/ex1/run/namelist.bmi.HHWM8 deleted file mode 100644 index 16f76b0..0000000 --- a/test_cases/ex1/run/namelist.bmi.HHWM8 +++ /dev/null @@ -1,26 +0,0 @@ -&SNOW17_CONTROL -! === run control file for snow17bmi v. 1.x === - -! -- basin config and path information -main_id = "HHWM8" ! basin label or gage id -n_hrus = 2 ! number of sub-areas in model -forcing_root = "../input/forcing/forcing.snow17bmi." -output_root = "../output/output.snow17bmi." -snow17_param_file = "../input/params/snow17_params.HHWM8.txt" -output_hrus = 1 ! output HRU results? (1=yes; 0=no) - -! -- run period information -start_datehr = 1970010112 ! start date time, backward looking (check) -end_datehr = 2015123112 ! end date time -model_timestep = 86400 ! in seconds (86400 seconds = 1 day) - -! -- state start/write flags and files -warm_start_run = 0 ! is this run started from a state file? (no=0 yes=1) -write_states = 1 ! write restart/state files for 'warm_start' runs (no=0 yes=1) - -! -- filenames only needed if warm_start_run = 1 -snow_state_in_root = "../state/snow17_states." ! input state filename root - -! -- filenames only needed if write_states = 1 -snow_state_out_root = "../state/snow17_states." ! output states filename root -/ diff --git a/test_cases/ex1/run/runSnow17.csh b/test_cases/ex1/run/runSnow17.csh deleted file mode 100755 index 13fef4f..0000000 --- a/test_cases/ex1/run/runSnow17.csh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/csh -# A. Wood, 2016; updated May 2022 for snow only version using BMI - -# Run general distributed snow17 code, which loops over lumped code version for multiple model areas and -# writes an additional combined (basin mean) output file - -# To run the snow17/sac model, just execute this script (or else the command below) - -../../../bin/snow17.exe namelist.bmi.HHWM8 diff --git a/test_cases/ex1/state/README b/test_cases/ex1/state/README deleted file mode 100644 index 6de873b..0000000 --- a/test_cases/ex1/state/README +++ /dev/null @@ -1,2 +0,0 @@ -state file output contains states for all days in the run, arranges one row per day -state file input has same format, and can contain any number of dates From c241ad82161f87d2bc1cf28e73e3fbafffcc66a0 Mon Sep 17 00:00:00 2001 From: "K. Jennings" <32177682+SnowHydrology@users.noreply.github.com> Date: Wed, 10 Aug 2022 09:57:51 -0400 Subject: [PATCH 3/7] removing unused link and dir --- doc/Screenshot.png | Bin 826051 -> 0 bytes src/driver/noah-owp-modular.lnk | 1 - 2 files changed, 1 deletion(-) delete mode 100644 doc/Screenshot.png delete mode 120000 src/driver/noah-owp-modular.lnk diff --git a/doc/Screenshot.png b/doc/Screenshot.png deleted file mode 100644 index 3300f400320ce1005f3fd48c13341f8252dc729f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 826051 zcmeFYbzEG{vM!9f1q%*AgS)%C6WrYgcXtB8T|;npcXxMp2<|R($=>Il`|f+r+28m6 zf9JPmW=*eEtE;=KtDcexSCA7&gu{UY0Rcgjln_w@0f9*a0f7U9f%<6aaQ9^T_|aw| zEUX|YEKH=}05G+%HUR;V2v1CgR#9HY44G_a&kVv0a}q)n^?;`QQl|iMq)$TXAA~9_ zq)<)00}}=L=@Sh&*VkWLMd;OEFli71+T~*eMe(8G+2-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