Skip to content

Commit

Permalink
Merge branch 'release-v4.4'
Browse files Browse the repository at this point in the history
This merge finalizes the v4.4 release by adding changes from the 'release-v4.4'
branch onto the 'master' branch.

* release-v4.4: (22 commits)
  Update version number to 4.4
  adding capability to turn off subgrid processing using subgrid_ratio_x=0 or subgrid_ratio_y=0
  Updating/adding METGRID.TBL entries for Thompson AA microphysics scheme
  Fixing domain dx and dy in calc_dfdx and calc_dfdy
  Fixing bug in calc_dfdx and calc_dfdy
  drainage_map
  tile-drainage-map
  Remove METGRID.TBL.NMM and METGRID.TBL.NMM.rap files
  adding subgrid shifting fix into metgrid
  No more NMM support available in WRF model
  Added bathymetry section to GEOGRID.TBL.ARW
  If internal GRIB2 libs will be compiled, don't show user NO_GRIB2 config options
  Add 'grib2' to the top-level .gitignore file
  Fix dependencies in ungrib/src/Makefile to allow just g2print to be compiled
  Update ungrib Makefile to support internally-compiled GRIB2 libs
  Modify Config.pl to set INTERNAL_GRIB2_PATH in preamble based on grib2dir argument
  Modify configure script to recognize --build-grib2-libs option
  Add .gitignore in external/ to ignore files created when building GRIB2 libs
  Add Makefile in the external directory
  Fix compilation errors in JasPer library with GNU 9.2.0 compilers on macOS
  ...
  • Loading branch information
mgduda committed Apr 27, 2022
2 parents 7d7a080 + 77d2cc3 commit 884c1d1
Show file tree
Hide file tree
Showing 1,062 changed files with 361,590 additions and 1,395 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ ungrib.exe
metgrid.exe
configure.wps
configure.wps.backup

# Compiled GRIB2 libraries if --build-grib2-libs option is given to configure script
grib2
9 changes: 4 additions & 5 deletions README
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
WRF Pre-Processing System Version 4.3.1
WRF Pre-Processing System Version 4.4

http://www2.mmm.ucar.edu/wrf/users/

The WRF Pre-Processing System (WPS) is a collection
of Fortran and C programs that provides data used as
input to the real.exe and real_nmm.exe programs. There
are three main programs and a number of auxiliary
programs that are part of WPS. Both the ARW and NMM
dynamical cores in WRF are supported by WPS.
input to the real.exe program. There are three main
programs and a number of auxiliary programs that
are part of WPS.

For questions and help to run the program, please see the
User's Guide at http://www2.mmm.ucar.edu/wrf/users/docs/user_guide_v4/contents.html
Expand Down
80 changes: 47 additions & 33 deletions arch/Config.pl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
$sw_netcdf_path = "";
$sw_netcdff_lib = "";
$sw_phdf5_path = "";
$sw_grib2_path = "";
$sw_jasperlib_path = "";
$sw_jasperinc_path = "";
$sw_ldflags = "";
Expand Down Expand Up @@ -61,47 +62,59 @@
# separated by ! instead. Replace with spaces here.
$sw_ldflags =~ s/!/ /g ;
}
if(substr( $ARGV[0], 1, 9 ) eq "grib2dir=")
{
$sw_grib2_path = substr( $ARGV[0], 10 );
}
shift @ARGV;
} # end while

# The jasper library is required to build Grib2 I/O. User must set
# environment variables JASPERLIB and JASPERINC to paths to library and
# include files to enable this feature prior to running configure.
if($ENV{JASPERLIB} && $ENV{JASPERINC})
if ($sw_grib2_path eq "")
{
printf "Found Jasper environment variables for GRIB2 support...\n";
printf(" \$JASPERLIB = %s\n",$ENV{JASPERLIB});
printf(" \$JASPERINC = %s\n",$ENV{JASPERINC});
$sw_jasperlib_path = "-L$ENV{JASPERLIB} -ljasper -lpng -lz";
$sw_jasperinc_path = "-I$ENV{JASPERINC}";
# The jasper library is required to build Grib2 I/O. User must set
# environment variables JASPERLIB and JASPERINC to paths to library and
# include files to enable this feature prior to running configure.
if($ENV{JASPERLIB} && $ENV{JASPERINC})
{
printf "Found Jasper environment variables for GRIB2 support...\n";
printf(" \$JASPERLIB = %s\n",$ENV{JASPERLIB});
printf(" \$JASPERINC = %s\n",$ENV{JASPERINC});
$sw_jasperlib_path = "-L$ENV{JASPERLIB} -ljasper -lpng -lz";
$sw_jasperinc_path = "-I$ENV{JASPERINC}";
}
else
{

$tmp1 = '/usr/local/jasper';
if (-e $tmp1) {
$sw_jasperlib_path = '-L/usr/local/jasper/lib -ljasper -L/usr/local/libpng -lpng12 -lpng -L/usr/local/zlib/lib -lz' ;
$sw_jasperinc_path = '-I/usr/local/zlib/include -I/usr/local/jasper/include -I/usr/local/libpng/' ;
printf "\$JASPERLIB or \$JASPERINC not found in environment. Using /usr/local for library paths...\n";
}
else {
$tmp1 = '/opt/local/lib';
if (-e $tmp1) {
$sw_jasperlib_path = '-L/opt/local/lib -ljasper -lpng -lz';
$sw_jasperinc_path = '-I/opt/local/include';
printf "\$JASPERLIB or \$JASPERINC not found in environment. Using /opt/local for library paths...\n";
}
else {
$sw_jasperlib_path = '-L/glade/u/home/wrfhelp/UNGRIB_LIBRARIES/lib -ljasper -lpng -lz';
$sw_jasperinc_path = '-I/glade/u/home/wrfhelp/UNGRIB_LIBRARIES/include';
printf "\$JASPERLIB or \$JASPERINC not found in environment. Using default values for library paths...\n";
}
}
}
@platforms = ('serial', 'serial_NO_GRIB2', 'dmpar', 'dmpar_NO_GRIB2');
}
else
{

$tmp1 = '/usr/local/jasper';
if (-e $tmp1) {
$sw_jasperlib_path = '-L/usr/local/jasper/lib -ljasper -L/usr/local/libpng -lpng12 -lpng -L/usr/local/zlib/lib -lz' ;
$sw_jasperinc_path = '-I/usr/local/zlib/include -I/usr/local/jasper/include -I/usr/local/libpng/' ;
printf "\$JASPERLIB or \$JASPERINC not found in environment. Using /usr/local for library paths...\n";
}
else {
$tmp1 = '/opt/local/lib';
if (-e $tmp1) {
$sw_jasperlib_path = '-L/opt/local/lib -ljasper -lpng -lz';
$sw_jasperinc_path = '-I/opt/local/include';
printf "\$JASPERLIB or \$JASPERINC not found in environment. Using /opt/local for library paths...\n";
}
else {
$sw_jasperlib_path = '-L/glade/u/home/wrfhelp/UNGRIB_LIBRARIES/lib -ljasper -lpng -lz';
$sw_jasperinc_path = '-I/glade/u/home/wrfhelp/UNGRIB_LIBRARIES/include';
printf "\$JASPERLIB or \$JASPERINC not found in environment. Using default values for library paths...\n";
}
}
$sw_jasperlib_path = '-L$(INTERNAL_GRIB2_PATH)/lib -ljasper -lpng -lz';
$sw_jasperinc_path = '-I$(INTERNAL_GRIB2_PATH)/include';
@platforms = ('serial', 'dmpar');
}

$validresponse = 0 ;
# added this from the WRF Config.pl by John M.
@platforms = ('serial', 'serial_NO_GRIB2', 'dmpar', 'dmpar_NO_GRIB2');
# Display the choices to the user and get selection
until ($validresponse)
{
Expand Down Expand Up @@ -208,7 +221,7 @@
{
if($paropt eq 'serial')
{
if($ENV{JASPERLIB} && $ENV{JASPERINC})
if(($ENV{JASPERLIB} && $ENV{JASPERINC}) || $sw_grib2_path ne "")
{
$sw_compL = $sw_jasperlib_path;
$sw_compI = $sw_jasperinc_path;
Expand Down Expand Up @@ -236,7 +249,7 @@
}
if($paropt eq 'dmpar')
{
if($ENV{JASPERLIB} && $ENV{JASPERINC})
if(($ENV{JASPERLIB} && $ENV{JASPERINC}) || $sw_grib2_path ne "")
{
$sw_compL = $sw_jasperlib_path;
$sw_compI = $sw_jasperinc_path;
Expand Down Expand Up @@ -302,6 +315,7 @@

$_ =~ s:CONFIGURE_NETCDFF_LIB:$sw_netcdff_lib:g;
$_ =~ s:CONFIGURE_WRF_PATH:$sw_wrf_path:g;
$_ =~ s:CONFIGURE_GRIB2_PATH:$sw_grib2_path:g;
@preamble = ( @preamble, $_ ) ;
}
close ARCH_PREAMBLE;
Expand Down
2 changes: 2 additions & 0 deletions arch/preamble
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,5 @@ COMPRESSION_LIBS = # intentionally left blank, fill in COMPRESSION_LIBS below

COMPRESSION_INC = # intentionally left blank, fill in COMPRESSION_INC below

INTERNAL_GRIB2_PATH = CONFIGURE_GRIB2_PATH

2 changes: 1 addition & 1 deletion compile
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ endif
# Print out WPS version, system info, and compiler/version
echo "============================================================================================== "
echo " "
echo Version 4.3.1
echo Version 4.4
echo " "
uname -a
echo " "
Expand Down
28 changes: 25 additions & 3 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,21 @@

#
# Check for command-line arguments
# At present, the only supported argument is --nowrf, which disables checks to
# find the path to the compiled WRF model.
# At present, the only supported arguments are:
# --nowrf : disables checks to find the path to the compiled WRF model
# --build-grib2-libs : compiles zlib, libpng, and JasPer libraries from
# source in the external/ directory and installs
# the libraries in grib2/
#
nowrf=0
build_grib2=0
for arg in $@; do
if [ "${arg}" = "--nowrf" ]; then
nowrf=1
elif [ "${arg}" = "--build-grib2-libs" ]; then
build_grib2=1
else
printf "Unrecognized option %s\n" ${arg}
fi
done

Expand Down Expand Up @@ -216,8 +224,22 @@ the WRF I/O libraries:
EOF
fi

grib2dir=""
if [ ${build_grib2} -eq 1 ]; then
grib2dir="${PWD}/grib2"

cat << EOF
********************************************************************************
The zlib, libpng, and JasPer libraries will be compiled from source and
installed in ${grib2dir} .
The environment variables JASPERLIB and JASPERINC will be ignored.
********************************************************************************
EOF
fi

# Found perl, so proceed with configuration
perl arch/Config.pl -perl=$PERL -netcdf=$NETCDF -netcdff=$NETCDFF -os=$os -mach=$mach -wrfdir=$wrf_dir
perl arch/Config.pl -perl=$PERL -netcdf=$NETCDF -netcdff=$NETCDFF -os=$os -mach=$mach -wrfdir=$wrf_dir -grib2dir=$grib2dir


#Checking cross-compiling capability for some particular environment
Expand Down
Loading

0 comments on commit 884c1d1

Please sign in to comment.