Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into feature_1581_api_p…
Browse files Browse the repository at this point in the history
…oint_obs
  • Loading branch information
Howard Soh committed May 26, 2021
2 parents dce3c13 + a0dcfd9 commit 355e261
Show file tree
Hide file tree
Showing 896 changed files with 1,529 additions and 1,459 deletions.
2 changes: 2 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
- [ ] Will this PR result in changes to the test suite? **[Yes or No]**</br>
If **yes**, describe the new output and/or changes to the existing output:</br>

- [ ] Please complete this pull request review by **[Fill in date]**.</br>

## Pull Request Checklist ##
See the [METplus Workflow](https://dtcenter.github.io/METplus/Contributors_Guide/github_workflow.html) for details.
- [ ] Complete the PR definition above.
Expand Down
10 changes: 5 additions & 5 deletions met/README
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Model Evaluation Tools (MET) TERMS OF USE - IMPORTANT!
================================================================================

Copyright 2020, UCAR/NCAR, NOAA, and CSU/CIRA
Copyright 2021, UCAR/NCAR, NOAA, and CSU/CIRA
Licensed under the Apache License, Version 2.0 (the "License");
You may not use this file except in compliance with the License.
You may obtain a copy of the License at
Expand All @@ -20,8 +20,8 @@ This is the main directory for the Model Evaluation Tools source code release.
================================================================================

For questions, please:
- Refer to the MET User's Guide in the /doc sub-directory.
- Refer to the MET website: http://www.dtcenter.org/met/users
- Refer to the MET User's Guide: https://met.readthedocs.io/en/latest
- Refer to the MET website: http://dtcenter.org/community-code/model-evaluation-tools-met
- Send mail to [email protected].

Dependencies
Expand Down Expand Up @@ -52,7 +52,7 @@ Dependencies

- It is suggested that the following tools be used in conjunction with MET:
- Unified Post-Processor
- http://www.dtcenter.org/wrf-nmm/users
- http://dtcenter.org/community-code/unified-post-processor-upp

NOTE: The required libraries should be compiled with the same set of compilers
to be used in compiling MET.
Expand All @@ -63,7 +63,7 @@ How to compile and run?
For more detailed instructions on building MET and for a list of supported
platforms and compilers, please refer to the MET User's Guide in the doc/
sub-directory, or the MET Online Tutorial:
http://www.dtcenter.org/met/users/support/online_tutorial
http://dtcenter.org/community-code/model-evaluation-tools-met/online-tutorial

- Set the $CXX and $F77 environment variables to specify the C++ and FORTRAN
compilers to be used. If not set, configure will search for compilers and the
Expand Down
13 changes: 8 additions & 5 deletions met/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.69])
AC_INIT([MET], [m4_esyscmd_s(echo ${MET_BUILD_VERSION:-8.1})], [[email protected]], [], [http://www.dtcenter.org/met/users])
AC_INIT([MET], [m4_esyscmd_s(echo ${MET_BUILD_VERSION:-development})], [[email protected]], [], [http://dtcenter.org/community-code/model-evaluation-tools-met])
AC_CONFIG_SRCDIR([src/tools/tc_utils/tc_dland/tc_dland.cc])
AC_CONFIG_HEADERS([config.h])

Expand Down Expand Up @@ -1041,11 +1041,14 @@ CPPFLAGS=$CPPFLAGS' -DMET_BASE="\"$(pkgdatadir)\""'

AC_SUBST(FC_LIBS, [-lgfortran])

# The CXXFLAGS default to "-O2 -g". The optimization is causing
# problems so just set it to "-g" if the user hasn't overridden it
# themselves.
# For GNU compilers, CFLAGS, CXXFLAGS, and FFLAGS default to "-O2 -g".
# The CXXFLAGS "-O2" optimization has caused problems in the past.
# For Intel compilers, "-g" slows down runtimes considerably (MET #1778).
# For development, retain the "-g" option. Otherwise, discard it.

: ${CXXFLAGS="-g"}
AM_COND_IF([ENABLE_DEVELOPMENT], [: ${CFLAGS="-g -O2"}], [: ${CFLAGS="-O2"}])
AM_COND_IF([ENABLE_DEVELOPMENT], [: ${CXXFLAGS="-g"} ], [: ${CXXFLAGS=""}] )
AM_COND_IF([ENABLE_DEVELOPMENT], [: ${FFLAGS="-g -O2"}], [: ${FFLAGS="-O2"}])

# Checks for programs.

Expand Down
2 changes: 1 addition & 1 deletion met/data/copyright_notice.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
// ** Copyright UCAR (c) 1992 - 2019
// ** Copyright UCAR (c) 1992 - 2021
// ** University Corporation for Atmospheric Research (UCAR)
// ** National Center for Atmospheric Research (NCAR)
// ** Research Applications Lab (RAL)
Expand Down
9 changes: 4 additions & 5 deletions met/data/wrappers/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@ SUBDIRS =
wrappersdir = $(pkgdatadir)/wrappers

wrappers_DATA = \
generic_python.py \
generic_pickle.py \
set_python_env.py \
read_tmp_dataplane.py \
write_tmp_dataplane.py \
write_pickle_mpr.py \
read_tmp_ascii.py \
write_tmp_point.py
write_tmp_dataplane.py \
write_tmp_point.py \
write_tmp_mpr.py

EXTRA_DIST = ${wrappers_DATA}

Expand Down
10 changes: 0 additions & 10 deletions met/data/wrappers/generic_pickle.py

This file was deleted.

17 changes: 8 additions & 9 deletions met/data/wrappers/read_tmp_ascii.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
Message_Type, Station_ID, Valid_Time, Lat, Lon, Elevation,
GRIB_Code or Variable_Name, Level, Height, QC_String, Observation_Value
MPR format: See documentation of the MPR line type
Version Date
1.0.0 2021/02/18 David Fillmore Initial version
"""
Expand All @@ -18,25 +20,22 @@

import argparse

point_data = None

def read_tmp_ascii(filename):
"""
Arguments:
filename (string): temporary file created by write_tmp_point.py
filename (string): temporary file created by write_tmp_point.py or write_tmp_mpr.py
Returns:
(list of lists): point data
(list of lists): point or mpr data
"""
print('read_tmp_ascii:' + filename)
f = open(filename, 'r')
lines = f.readlines()
f.close()

global point_data
point_data = [eval(line.strip('\n')) for line in lines]

return point_data
global ascii_data
ascii_data = [eval(line.strip('\n')) for line in lines]
return ascii_data

if __name__ == '__main__':
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
########################################################################
#
# When MET_PYTHON_EXE is not defined, this script initializes
# MET's python runtime environment.
# This script initializes MET's python runtime environment.
#
########################################################################

import os
import sys
import numpy as np
import pickle
33 changes: 0 additions & 33 deletions met/data/wrappers/write_pickle_mpr.py

This file was deleted.

4 changes: 4 additions & 0 deletions met/data/wrappers/write_tmp_dataplane.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
import importlib.util
import netCDF4 as nc

print("Python Script:\t" + repr(sys.argv[0]))
print("User Command:\t" + repr(' '.join(sys.argv[2:])))
print("Temporary File:\t" + repr(sys.argv[1]))

netcdf_filename = sys.argv[1]
pyembed_module_name = sys.argv[2]
sys.argv = sys.argv[2:]
Expand Down
39 changes: 39 additions & 0 deletions met/data/wrappers/write_tmp_mpr.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
########################################################################
#
# Adapted from a script provided by George McCabe
# Adapted by Randy Bullock
#
# usage: /path/to/python write_tmp_mpr.py \
# tmp_output_filename <user_python_script>.py <args>
#
########################################################################

import os
import sys
import importlib.util

print("Python Script:\t" + repr(sys.argv[0]))
print("User Command:\t" + repr(' '.join(sys.argv[2:])))
print("Temporary File:\t" + repr(sys.argv[1]))

tmp_filename = sys.argv[1]
pyembed_module_name = sys.argv[2]
sys.argv = sys.argv[2:]

# append user script dir to system path
pyembed_dir, pyembed_file = os.path.split(pyembed_module_name)
if pyembed_dir:
sys.path.insert(0, pyembed_dir)

if not pyembed_module_name.endswith('.py'):
pyembed_module_name += '.py'

user_base = os.path.basename(pyembed_module_name).replace('.py','')

spec = importlib.util.spec_from_file_location(user_base, pyembed_module_name)
met_in = importlib.util.module_from_spec(spec)
spec.loader.exec_module(met_in)

f = open(tmp_filename, 'w')
for line in met_in.mpr_data:
f.write(str(line) + '\n')
17 changes: 12 additions & 5 deletions met/data/wrappers/write_tmp_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,30 @@
# Adapted by Randy Bullock
#
# usage: /path/to/python write_tmp_point.py \
# tmp_ascii_output_filename <user_python_script>.py <args>
# tmp_output_filename <user_python_script>.py <args>
#
########################################################################

import os
import sys
import importlib.util

print('Python Script:\t', sys.argv[0])
print('User Command:\t', sys.argv[2:])
print('Write Temporary Ascii:\t', sys.argv[1])
print("Python Script:\t" + repr(sys.argv[0]))
print("User Command:\t" + repr(' '.join(sys.argv[2:])))
print("Temporary File:\t" + repr(sys.argv[1]))

tmp_filename = sys.argv[1]

pyembed_module_name = sys.argv[2]
sys.argv = sys.argv[2:]

# append user script dir to system path
pyembed_dir, pyembed_file = os.path.split(pyembed_module_name)
if pyembed_dir:
sys.path.insert(0, pyembed_dir)

if not pyembed_module_name.endswith('.py'):
pyembed_module_name += '.py'

user_base = os.path.basename(pyembed_module_name).replace('.py','')

spec = importlib.util.spec_from_file_location(user_base, pyembed_module_name)
Expand Down
Binary file modified met/docs/Flowchart/MET_flowchart.pptx
Binary file not shown.
Binary file added met/docs/Flowchart/MET_flowchart_v10.0.0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 355e261

Please sign in to comment.