Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update main_v11.1-ref after dtcenter/MET#2612 #2621

Merged
merged 19 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/jobs/build_docker_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,9 @@ if [ $? != 0 ]; then
cat ${GITHUB_WORKSPACE}/docker_build.log
exit 1
fi

# Copy the log directory from the image
id=$(docker create ${DOCKERHUB_TAG})
time_command docker cp $id:/met/logs met_logs
mv met_logs/*.log ${GITHUB_WORKSPACE}/.
docker rm -v $id
4 changes: 2 additions & 2 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ jobs:
MET_BASE_REPO: ${{ needs.job_control.outputs.met_base_repo }}
MET_BASE_TAG: ${{ needs.job_control.outputs.met_base_tag }}

- name: Copy Docker build log into logs directory
- name: Copy all build log files into logs directory
if: always()
run: cp ${GITHUB_WORKSPACE}/docker_build.log ${RUNNER_WORKSPACE}/logs/
run: cp ${GITHUB_WORKSPACE}/*.log ${RUNNER_WORKSPACE}/logs/

- name: Push Docker Image
run: .github/jobs/push_docker_image.sh
Expand Down
4 changes: 4 additions & 0 deletions docs/Users_Guide/appendixB.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ The following map projections are currently supported in MET:

* Lambert Conformal Projection

* Lambert Azimuthal Equal Area Projection

* Polar Stereographic Projection (Northern)

* Polar Stereographic Projection (Southern)
Expand Down Expand Up @@ -46,6 +48,8 @@ As an example of specifying a Lambert grid, suppose you have a northern hemisphe
To grid = "lambert 614 428 12.190 -133.459 -95.0 12.19058 6367.47 25.0 N";
For a Lambert Azimuthal Equal Area grid, grid specification strings are not supported.

For a Polar Stereographic grid, the syntax is

.. code-block:: none
Expand Down
55 changes: 46 additions & 9 deletions internal/scripts/installation/compile_MET_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
# either PYTHON_MODULE or by setting PYTHON_NAME and PYTHON_VERSION:
# - PYTHON_MODULE (only used if USE_MODULES=TRUE) - format is the name
# of the Python module to load followed by an underscore and then the
# version number (e.g. python_3.8.6, The script will then run "module
# load python/3.8.6")
# version number (e.g. python_3.10.4, The script will then run "module
# load python/3.10.4")
# - PYTHON_NAME = python (or e.g. python3, etc.)
# - PYTHON_VERSION = 3.8.6
# - PYTHON_VERSION = 3.10.4
#
# For a description of these and other variables, visit the MET
# downloads page under "Sample Script For Compiling External
Expand Down Expand Up @@ -64,6 +64,14 @@
# MET_HDF, MET_HDFEOS, MET_FREETYPEINC, MET_FREETYPELIB,
# MET_CAIROINC, MET_CAIROLIB.
#
# Users can speed up the compilation of MET and its dependent libraries
# by adding the following to their environment configuration file:
# export MAKE_ARGS=-j #
# replacing the # with the number of cores to use (integer) or simply
# specifying:
# export MAKE_ARGS=-j
# with no integer argument to start as many processes in parallel as
# possible.
#================================================

# print command, run it, then error and exit if non-zero value is returned
Expand Down Expand Up @@ -276,6 +284,7 @@ echo "COMPILER = $COMPILER"
echo "COMPILER_FAMILY = $COMPILER_FAMILY"
echo "COMPILER_VERSION = $COMPILER_VERSION"
COMPILER_MAJOR_VERSION=`echo $COMPILER_VERSION | cut -d'.' -f1`
COMPILER_MINOR_VERSION=`echo $COMPILER_VERSION | cut -d'.' -f2`

echo
echo "USE_MODULES = ${USE_MODULES}"
Expand Down Expand Up @@ -337,6 +346,22 @@ echo "export F77=${F77}"
echo "export F90=${F90}"
echo

# Figure out what kind of OS is being used
unameOut="$(uname -s)"
case "${unameOut}" in
Linux*) machine=Linux;;
Darwin*) machine=Mac;;
CYGWIN*) machine=Cygwin;;
MINGW*) machine=MinGw;;
*) machine="UNKNOWN:${unameOut}"
esac

if [[ $machine == "Mac" ]]; then
sed_inline="sed -i ''"
else
sed_inline="sed -i''"
fi

# Load Python module

if [ ${USE_MODULES} = "TRUE" ]; then
Expand Down Expand Up @@ -469,17 +494,19 @@ if [ $COMPILE_G2CLIB -eq 1 ]; then
rm -rf ${LIB_DIR}/g2clib/g2clib*
tar -xf ${TAR_DIR}/g2clib*.tar -C ${LIB_DIR}/g2clib
cd ${LIB_DIR}/g2clib/g2clib*

# Sed commands use double-quotes to support variable expansion.
sed -i "s|INC=.*|INC=-I${LIB_DIR}/include -I${LIB_DIR}/include/jasper|g" makefile
$sed_inline "s|INC=.*|INC=-I${LIB_DIR}/include -I${LIB_DIR}/include/jasper|g" makefile

# Allow other compilers besides gcc
sed -i "s|CC=gcc|CC=${CC}|g" makefile
$sed_inline "s|CC=gcc|CC=${CC}|g" makefile

# remove -D__64BIT__ flag because compiling with it has
# shown issues with GRIB/GRIB2 files that are over 2GB in size
# This flag was removed in g2clib 1.6.4
# so this can be removed if the version is updated
sed -i 's/-D__64BIT__//g' makefile
$sed_inline 's/-D__64BIT__//g' makefile

echo "cd `pwd`"
# g2clib appears to compile but causes failure compiling MET if -j argument is used
# so exclude it from this call
Expand Down Expand Up @@ -541,7 +568,7 @@ fi

# Compile NetCDF
if [ $COMPILE_NETCDF -eq 1 ]; then

echo
echo "Compiling HDF5 at `date`"
mkdir -p ${LIB_DIR}/hdf5
Expand All @@ -563,13 +590,18 @@ if [ $COMPILE_NETCDF -eq 1 ]; then
echo "cd `pwd`"
run_cmd "./configure --prefix=${LIB_DIR} CFLAGS=-fPIC CXXFLAGS=-fPIC LDFLAGS=-L${LIB_DIR}/lib CPPFLAGS=-I${LIB_DIR}/include > netcdf-c.configure.log 2>&1"
run_cmd "make ${MAKE_ARGS} install > netcdf-c.make_install.log 2>&1"

echo
echo "Compiling NetCDF-CXX at `date`"
tar -xzf ${TAR_DIR}/netcdf-cxx*.tar.gz -C ${LIB_DIR}/netcdf
cd ${LIB_DIR}/netcdf/netcdf-cxx*
echo "cd `pwd`"
run_cmd "./configure --prefix=${LIB_DIR} LDFLAGS=-L${LIB_DIR}/lib CPPFLAGS=-I${LIB_DIR}/include > netcdf-cxx.configure.log 2>&1"
configure_lib_args=""
if [[ $machine == "Mac" ]]; then
configure_lib_args="-lhdf5_hl -lhdf5 -lz"
fi
run_cmd "./configure --prefix=${LIB_DIR} LDFLAGS=-L${LIB_DIR}/lib CPPFLAGS=-I${LIB_DIR}/include LIBS=\"${LIBS} ${configure_lib_args}\" > netcdf-cxx.configure.log 2>&1"

run_cmd "make ${MAKE_ARGS} install > netcdf-cxx.make_install.log 2>&1"
fi

Expand Down Expand Up @@ -665,6 +697,11 @@ export MET_PYTHON_BIN_EXE=${MET_PYTHON_BIN_EXE:=${MET_PYTHON}/bin/python3}
export MET_PYTHON_LD
export MET_PYTHON_CC
export LDFLAGS="-Wl,--disable-new-dtags"

if [[ $machine == "Mac" ]]; then
export LDFLAGS=""
fi

# https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html
# ${parameter:+word}
# If parameter is null or unset, nothing is substituted, otherwise the expansion of word is substituted.
Expand Down
27 changes: 27 additions & 0 deletions internal/scripts/installation/config/install_met_env.narya
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
export TEST_BASE=/Volumes/d1/jpresto/projects/MET/MET_installation/11.1.0
export COMPILER=gnu_12.3.0
export MET_SUBDIR=${TEST_BASE}
export MET_TARBALL=v11.1.0.tar.gz
export USE_MODULES=FALSE
export MET_PYTHON=/opt/local
export MET_PYTHON_CC=-I${MET_PYTHON}/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10
export MET_PYTHON_LD=`python3-config --ldflags --embed`
export SET_D64BIT=FALSE
export MAKE_ARGS=-j
export CXXFLAGS="-std=c++11"
#export FFLAGS="-std=legacy"

# If you've already compiled these and don't need to compile them again, set the following;
# Otherwise, if you do need to install these libraries, comment out the variables below
export EXTERNAL_LIBS=${TEST_BASE}/external_libs
#export MET_GRIB2CLIB=${EXTERNAL_LIBS}/lib
#export MET_GRIB2CINC=${EXTERNAL_LIBS}/include
#export GRIB2CLIB_NAME=-lgrib2c
#export MET_BUFRLIB=${EXTERNAL_LIBS}/lib
#export BUFRLIB_NAME=-lbufr
#export MET_NETCDF=${EXTERNAL_LIBS}
#export MET_HDF5=${EXTERNAL_LIBS}
#export MET_GSL=${EXTERNAL_LIBS}
#export LIB_JASPER=${EXTERNAL_LIBS}/lib
#export LIB_LIBPNG=${EXTERNAL_LIBS}/lib
#export LIB_Z=${EXTERNAL_LIBS}/lib
4 changes: 0 additions & 4 deletions internal/test_unit/xml/unit_plot_data_plane.xml
Original file line number Diff line number Diff line change
Expand Up @@ -522,9 +522,6 @@
</output>
</test>

<!-- MET #1693 removed support for CF-Compliant LAEA grids.
MET #2565 should restore this supoprt prior to the MET-11.1.0 release.
<test name="plot_data_plane_LAEA_NCCF">
<exec>&MET_BIN;/plot_data_plane</exec>
<param> \
Expand All @@ -538,7 +535,6 @@
<ps>&OUTPUT_DIR;/plot_data_plane/air_temperature_laea_nccf.ps</ps>
</output>
</test>
-->

<test name="plot_data_plane_NCCF_POLAR_STEREO">
<exec>&MET_BIN;/plot_data_plane</exec>
Expand Down
56 changes: 28 additions & 28 deletions src/basic/vx_config/celltype_to_string.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
////////////////////////////////////////////////////////////////////////


#include <string.h>
using namespace std;

#include "celltype_to_string.h"

#include <string.h>

using namespace std;
#include "celltype_to_string.h"


////////////////////////////////////////////////////////////////////////
Expand All @@ -39,7 +39,7 @@ ConcatString celltype_to_string(const CellType t)

{

const char * s = (const char *) nullptr;
const char * s = (const char *) 0;

switch ( t ) {

Expand Down Expand Up @@ -73,7 +73,7 @@ switch ( t ) {
} // switch


return ConcatString (s);
return ( ConcatString (s) );

}

Expand All @@ -85,33 +85,33 @@ bool string_to_celltype(const char * text, CellType & t)

{

if ( strcmp(text, "integer" ) == 0 ) { t = integer; return true; }
else if ( strcmp(text, "floating_point" ) == 0 ) { t = floating_point; return true; }
else if ( strcmp(text, "boolean" ) == 0 ) { t = boolean; return true; }
else if ( strcmp(text, "cell_mark" ) == 0 ) { t = cell_mark; return true; }
else if ( strcmp(text, "op_add" ) == 0 ) { t = op_add; return true; }

else if ( strcmp(text, "op_multiply" ) == 0 ) { t = op_multiply; return true; }
else if ( strcmp(text, "op_divide" ) == 0 ) { t = op_divide; return true; }
else if ( strcmp(text, "op_subtract" ) == 0 ) { t = op_subtract; return true; }
else if ( strcmp(text, "op_power" ) == 0 ) { t = op_power; return true; }
else if ( strcmp(text, "op_square" ) == 0 ) { t = op_square; return true; }

else if ( strcmp(text, "op_negate" ) == 0 ) { t = op_negate; return true; }
else if ( strcmp(text, "op_store" ) == 0 ) { t = op_store; return true; }
else if ( strcmp(text, "op_recall" ) == 0 ) { t = op_recall; return true; }
else if ( strcmp(text, "identifier" ) == 0 ) { t = identifier; return true; }
else if ( strcmp(text, "user_func" ) == 0 ) { t = user_func; return true; }

else if ( strcmp(text, "builtin_func" ) == 0 ) { t = builtin_func; return true; }
else if ( strcmp(text, "local_var" ) == 0 ) { t = local_var; return true; }
else if ( strcmp(text, "character_string") == 0 ) { t = character_string; return true; }
else if ( strcmp(text, "no_cell_type" ) == 0 ) { t = no_cell_type; return true; }
if ( strcmp(text, "integer" ) == 0 ) { t = integer; return ( true ); }
else if ( strcmp(text, "floating_point" ) == 0 ) { t = floating_point; return ( true ); }
else if ( strcmp(text, "boolean" ) == 0 ) { t = boolean; return ( true ); }
else if ( strcmp(text, "cell_mark" ) == 0 ) { t = cell_mark; return ( true ); }
else if ( strcmp(text, "op_add" ) == 0 ) { t = op_add; return ( true ); }

else if ( strcmp(text, "op_multiply" ) == 0 ) { t = op_multiply; return ( true ); }
else if ( strcmp(text, "op_divide" ) == 0 ) { t = op_divide; return ( true ); }
else if ( strcmp(text, "op_subtract" ) == 0 ) { t = op_subtract; return ( true ); }
else if ( strcmp(text, "op_power" ) == 0 ) { t = op_power; return ( true ); }
else if ( strcmp(text, "op_square" ) == 0 ) { t = op_square; return ( true ); }

else if ( strcmp(text, "op_negate" ) == 0 ) { t = op_negate; return ( true ); }
else if ( strcmp(text, "op_store" ) == 0 ) { t = op_store; return ( true ); }
else if ( strcmp(text, "op_recall" ) == 0 ) { t = op_recall; return ( true ); }
else if ( strcmp(text, "identifier" ) == 0 ) { t = identifier; return ( true ); }
else if ( strcmp(text, "user_func" ) == 0 ) { t = user_func; return ( true ); }

else if ( strcmp(text, "builtin_func" ) == 0 ) { t = builtin_func; return ( true ); }
else if ( strcmp(text, "local_var" ) == 0 ) { t = local_var; return ( true ); }
else if ( strcmp(text, "character_string") == 0 ) { t = character_string; return ( true ); }
else if ( strcmp(text, "no_cell_type" ) == 0 ) { t = no_cell_type; return ( true ); }
//
// nope
//

return false;
return ( false );

}

Expand Down
Loading