[Dart-dev] DART/branches Revision: 12372

dart at ucar.edu dart at ucar.edu
Mon Jan 22 11:34:58 MST 2018


thoar at ucar.edu
2018-01-22 11:34:56 -0700 (Mon, 22 Jan 2018)
310
Updating the svn repo with what has been happening in the git world.
The last git commit was:
commit d1433d6187c2200073c0de1a8f4713ed8aeb9e74 (HEAD -> master, upstream/master, origin/master, origin/HEAD)
Merge: 4b08ddc 48b8892
Author: James McCreight <jamesmcc at ucar.edu>
Date:   Thu Dec 7 13:49:50 2017 -0700




Added: DART/branches/wrfHydro/LICENSE.md
===================================================================
--- DART/branches/wrfHydro/LICENSE.md	                        (rev 0)
+++ DART/branches/wrfHydro/LICENSE.md	2018-01-22 18:34:56 UTC (rev 12372)
@@ -0,0 +1,19 @@
+DART TERMS OF USE
+
+IMPORTANT!
+
+## PLEASE READ THIS SOFTWARE LICENSE AGREEMENT ("LICENSE") CAREFULLY BEFORE DOWNLOADING OR USING THE SOFTWARE. BY DOWNLOADING OR USING THE SOFTWARE, YOU ARE AGREEING TO BE BOUND BY THE TERMS OF THIS LICENSE. IF YOU DO NOT AGREE TO THE TERMS OF THIS LICENSE, YOU ARE NOT AUTHORIZED TO DOWNLOAD OR USE THIS SOFTWARE. ##
+
+1. Copyright. DART software - Copyright © 2004 - 2015 UCAR.
+
+2. License. The software accompanying this License (the "Software") is licensed, not sold, to you by the University Corporation for Atmospheric Research ("UCAR"). You may use, copy, display, perform and redistribute this Software, with or without modification; provided that all redistributions of DART documentation and software, whether in source code or binary form, retain the copyright notice, as included in Section 1 of these terms and all redistributions reference and incorporate Sections 2 - 7 of these Terms of Use.
+
+3. You will clearly identify those software modifications that were not UCAR-developed. None of the following names may be used to endorse or promote any entity or products derived from this Software without specific prior written permission from UCAR: the University Corporation for Atmospheric Research, National Center for Atmospheric Research, UCAR and NCAR.
+
+4. The Software is provided "AS IS" and without warranty of any kind.UCAR EXPRESSLY DISCLAIMS ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, TITLE AND FITNESS FOR A PARTICULAR PURPOSE. NO ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY UCAR OR A UCAR AUTHORIZED REPRESENTATIVE SHALL CREATE A WARRANTY OR IN ANY WAY INCREASE THE SCOPE OF THIS WARRANTY. IN NO EVENT, INCLUDING NEGLIGENCE, SHALL UCAR BE LIABLE FOR ANY INCIDENTAL, SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, LOSS OF USE, DATA OR PROFITS, OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+5. By using this Software, you agree to defend, indemnify and hold harmless UCAR and its subsidiaries, affiliates, officers, trustees and employees from and against any claim, suit or action arising from or in any way related to your use or redistribution of the Software or your violation of these Terms and Conditions, including any liability or expense arising from all claims, losses, damages, suits, judgments, litigation costs and attorneys' fees, of every kind and nature.
+
+6. This License shall be governed by the laws of the United States and the State of Colorado. If for any reason a court of competent jurisdiction finds any provision, or portion thereof, to be unenforceable, the remainder of this License shall continue in full force and effect. This License shall not be governed by the United Nations Convention on Contracts for the International Sale of Goods, the application of which is hereby expressly excluded.
+
+7. No technical support regarding DART software will be provided by UCAR, unless such assistance is expressly agreed to by UCAR and such assistance does not violate U.S. export control regulations.

Added: DART/branches/wrfHydro/R/PlotEnsTimeSeries.R
===================================================================
--- DART/branches/wrfHydro/R/PlotEnsTimeSeries.R	                        (rev 0)
+++ DART/branches/wrfHydro/R/PlotEnsTimeSeries.R	2018-01-22 18:34:56 UTC (rev 12372)
@@ -0,0 +1,147 @@
+PlotEnsTimeSeries <- function(pinfo) {
+## PlotEnsTimeSeries: Plots time series of ensemble members, mean and truth.
+#
+#
+# PlotEnsTimeSeries is intended to be called by 'plot_ens_time_series'
+# The only input argument is a structure with model-dependent
+# components.
+#
+# USAGE: PlotEnsTimeSeries( pinfo );
+#
+# STRUCTURE COMPONENTS FOR low-order models
+# truth_file      name of netCDF DART file with copy tagged 'true state'
+# diagn_file      name of netCDF DART file with copies tagged 'ensemble mean'
+#                 and 'ensemble spread'
+# var             name of netCDF variable of interest
+# var_inds        indices of variables of interest
+
+# Example 1
+  if(FALSE){
+    library(rwrfhydro)
+    dartPath <-
+      strsplit(grep('wrf_hydro_dart', readLines('~/.wrf_hydro_tools'), value=TRUE),'=')[[1]][2]
+    source(paste0(dartPath,'/R/PlotEnsTimeSeries.R'))
+
+    pinfo <- list()
+    pinfo$truth_file  = 'True_State.nc'
+    pinfo$diagn_file  = 'Prior_Diag.nc'
+    pinfo$model       = 'wrfHydro'      ## not really necessary currently
+
+    pinfo$var         = 'qlink1'
+    ##pinfo$var_inds  = which(trimws(ncdump("../DOMAIN/RouteLink.nc",'gages', q=TRUE))!='')
+    pinfo$var_inds    = c(130,136,157)
+    pinfo$var_ind_name= trimws(ncdump("../DOMAIN/RouteLink.nc",'gages', q=TRUE)[pinfo$var_inds])
+    PlotEnsTimeSeries(pinfo)
+
+    pinfo$var         = 'qBucketMult'
+    pinfo$var_inds    = NA
+    pinfo$var_ind_name= NA
+    PlotEnsTimeSeries(pinfo)
+
+    pinfo$var         = 'qSfcLatRunoffMult'
+    PlotEnsTimeSeries(pinfo)
+
+  }
+  ## Code starts here -----------------------------------------------------------------
+
+  if(!file.exists(pinfo$diagn_file)) stop(paste0("No such file: ", pinfo$diagn_file))
+
+  ## Query the metadata to determine which "copy" is the ensemble mean.
+  ncMeta <- ncdump(pinfo$diagn_file, q=TRUE)
+  varunits <- ncMeta$var[[pinfo$var]]$units
+  nVarDims <- ncMeta$var[[pinfo$var]]$ndims
+  varDims <- unlist(lapply(ncMeta$var[[pinfo$var]]$dim, function(vv) vv$name))
+  nMembers <- ncMeta$dim$copy$len
+  copyNames <- ncdump(pinfo$diagn_file,'CopyMetaData', q=TRUE)
+  ens_mean_index <- which( trimws(copyNames) ==  'ensemble mean')
+  whEnsMems <- grep('ensemble member',copyNames)
+  gregorianOrigin <- "1601-01-01 00:00:00 UTC"
+  time <- as.POSIXct( ncdump(pinfo$diagn_file,'time', q=TRUE) * 24*3600,
+                      origin=gregorianOrigin, tz='UTC')
+
+  ## JLM <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+  ## WOW, going to need to check that this is correct via performing the calculation...
+  # because of issues with ncdf4
+  ## JLM <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+
+  ## If the truth is known, great.
+  ## JLM, deal with truth when we have/fake it
+  #have_truth <- FALSE
+  #if(file.exists(pinfo$truth_file)) {
+  #  have_truth  = TRUE


More information about the Dart-dev mailing list