Skip to content

Commit

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

* release-v4.0.3:
  Increase length of field names in GRIB tables in g1print from 5 to 7 chars
  Let configure script attempt to locate compiled WRF code or use $WRF_DIR
  Detect WRF-4.0.3 directory in arch/preamble
  Remove -f90= and -cc= options from MPI wrappers
  Correct inconsequential bug in detection of geogrid v4.0.1 output
  Update version number to 4.0.3
  • Loading branch information
mgduda committed Jan 25, 2019
2 parents 99f3ef5 + de0a362 commit 23bd63a
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 51 deletions.
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
WRF Pre-Processing System Version 4.0.2 (9 November 2018)
WRF Pre-Processing System Version 4.0.3

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

Expand Down
6 changes: 6 additions & 0 deletions arch/Config.pl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# the appropriate options for the type of machine, and the OS, and the compiler!

$sw_perl_path = perl;
$sw_wrf_path = "<SET ME>";
$sw_netcdf_path = "";
$sw_netcdff_lib = "";
$sw_phdf5_path = "";
Expand All @@ -29,6 +30,10 @@
{
$sw_perl_path = substr( $ARGV[0], 6);
}
if(substr( $ARGV[0], 1, 7 ) eq "wrfdir=")
{
$sw_wrf_path = substr( $ARGV[0], 8);
}
if(substr( $ARGV[0], 1, 7 ) eq "netcdf=")
{
$sw_netcdf_path = substr( $ARGV[0], 8);
Expand Down Expand Up @@ -296,6 +301,7 @@
}

$_ =~ s:CONFIGURE_NETCDFF_LIB:$sw_netcdff_lib:g;
$_ =~ s:CONFIGURE_WRF_PATH:$sw_wrf_path:g;
@preamble = ( @preamble, $_ ) ;
}
close ARCH_PREAMBLE;
Expand Down
24 changes: 12 additions & 12 deletions arch/configure.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ COMPRESSION_INC = CONFIGURE_COMP_I
FDEFS = CONFIGURE_FDEFS
SFC = ifort
SCC = icc
DM_FC = mpif90 -f90=ifort
DM_CC = mpicc -cc=icc
DM_FC = mpif90
DM_CC = mpicc
FC = CONFIGURE_FC
CC = CONFIGURE_CC
LD = $(FC)
Expand All @@ -85,8 +85,8 @@ COMPRESSION_INC = CONFIGURE_COMP_I
FDEFS = CONFIGURE_FDEFS
SFC = g95
SCC = gcc
DM_FC = mpif90 -f90=g95
DM_CC = mpicc -cc=gcc
DM_FC = mpif90
DM_CC = mpicc
FC = CONFIGURE_FC
CC = CONFIGURE_CC
LD = $(FC)
Expand All @@ -109,8 +109,8 @@ COMPRESSION_INC = CONFIGURE_COMP_I
FDEFS = CONFIGURE_FDEFS
SFC = gfortran
SCC = gcc
DM_FC = mpif90 -f90=gfortran
DM_CC = mpicc -cc=gcc
DM_FC = mpif90
DM_CC = mpicc
FC = CONFIGURE_FC
CC = CONFIGURE_CC
LD = $(FC)
Expand All @@ -132,8 +132,8 @@ COMPRESSION_INC = CONFIGURE_COMP_I
FDEFS = CONFIGURE_FDEFS
SFC = gfortran
SCC = gcc
DM_FC = mpif90 -f90=gfortran
DM_CC = mpicc -cc=gcc
DM_FC = mpif90
DM_CC = mpicc
FC = CONFIGURE_FC
CC = CONFIGURE_CC
LD = $(FC)
Expand Down Expand Up @@ -231,8 +231,8 @@ COMPRESSION_INC = CONFIGURE_COMP_I
FDEFS = CONFIGURE_FDEFS
SFC = ifort
SCC = icc
DM_FC = mpif90 -f90=ifort
DM_CC = mpicc -cc=icc
DM_FC = mpif90
DM_CC = mpicc
FC = CONFIGURE_FC
CC = CONFIGURE_CC
LD = $(FC)
Expand Down Expand Up @@ -328,8 +328,8 @@ COMPRESSION_INC = CONFIGURE_COMP_I
FDEFS = CONFIGURE_FDEFS
SFC = pgf90
SCC = pgcc
DM_FC = mpif90 -f90=pgf90
DM_CC = mpicc -cc=pgcc
DM_FC = mpif90
DM_CC = mpicc
FC = CONFIGURE_FC
CC = CONFIGURE_CC
LD = $(FC)
Expand Down
26 changes: 1 addition & 25 deletions arch/preamble
Original file line number Diff line number Diff line change
Expand Up @@ -32,31 +32,7 @@ PERL = perl

RANLIB = echo

#
# Look for compiled WRF code in one of several directories: WRF-4.0.2, WRF-4.0.1, WRF-4.0, WRF, and WRFV3.
# The need for complicated logic to do this arises from the various names that the WRF code may take
# on, depending on whether it was obtained through a GitHub archive file, as a clone of the GitHub
# repository, or an older WRF v3.x tar file.
# To override the path to the compiled WRF code, just set the WRF_DIR variable after the "endif" below
#
ifneq ($(wildcard $(DEV_TOP)/../WRF-4.0.2), ) # Check for WRF v4.0.2 directory (probably GitHub archive)
WRF_DIR = ../WRF-4.0.2
else
ifneq ($(wildcard $(DEV_TOP)/../WRF-4.0.1), ) # Check for WRF v4.0.1 directory (probably GitHub archive)
WRF_DIR = ../WRF-4.0.1
else
ifneq ($(wildcard $(DEV_TOP)/../WRF-4.0), ) # Check for WRF v4.0 directory (probably GitHub archive)
WRF_DIR = ../WRF-4.0
else
ifneq ($(wildcard $(DEV_TOP)/../WRF), ) # Check for clone of the WRF repository
WRF_DIR = ../WRF
else # Check for old WRF v3.x directory
WRF_DIR = ../WRFV3
endif
endif
endif
endif

WRF_DIR = CONFIGURE_WRF_PATH

WRF_INCLUDE = -I$(WRF_DIR)/external/io_netcdf \
-I$(WRF_DIR)/external/io_grib_share \
Expand Down
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.0
echo Version 4.0.3
echo " "
uname -a
echo " "
Expand Down
41 changes: 40 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,47 @@ if [ $? -eq 0 ] ; then
fi
fi

wrf_dir="none"
standard_wrf_dirs="WRF WRF-4.0.3 WRF-4.0.2 WRF-4.0.1 WRF-4.0 WRFV3"

#
# If no WRF_DIR environment variable is set, try to locate a WRF build in one
# of the expected directory names one directory level up; otherwise, try to use
# the WRF I/O library from the code in $WRF_DIR
#
if [ -z "$WRF_DIR" ]; then
# for d in WRF WRF-4.0.3 WRF-4.0.2 WRF-4.0.1 WRF-4.0 WRFV3; do
for d in ${standard_wrf_dirs}; do
if [ -e ../${d}/external/io_netcdf/libwrfio_nf.a ]; then
echo "Found what looks like a valid WRF I/O library in ../${d}"
wrf_dir="../${d}"
break
fi
done
else
if [ ! -e ${WRF_DIR}/external/io_netcdf/libwrfio_nf.a ]; then
echo ""
echo "Error: The \$WRF_DIR environment variable was set, but the WRF code at"
echo " ${WRF_DIR} doesn't appear to have been successfully compiled"
echo ""
exit
fi

echo "Using WRF I/O library in WRF build identified by \$WRF_DIR: ${WRF_DIR}"
wrf_dir=$WRF_DIR
fi

if [ $wrf_dir == "none" ]; then
echo ""
echo "Error: No compiled WRF code found. Please check that the WRF model has been compiled"
echo " one directory level up (i.e., ../) in a directory named 'WRF', 'WRF-4.0.3', 'WRF-4.0.2', etc.,"
echo " or specify the full path to the compiled WRF model with the environment variable \$WRF_DIR ."
echo ""
exit
fi

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


#Checking cross-compiling capability for some particular environment
Expand Down
2 changes: 1 addition & 1 deletion geogrid/src/process_tile_module.F
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ subroutine process_tile(which_domain, grid_type, dynopt, &
end if

! Initialize the output module now that we have the corner point lats/lons
call output_init(which_domain, 'OUTPUT FROM GEOGRID V4.0.2', '0000-00-00_00:00:00', grid_type, dynopt, &
call output_init(which_domain, 'OUTPUT FROM GEOGRID V4.0.3', '0000-00-00_00:00:00', grid_type, dynopt, &
corner_lats, corner_lons, &
start_dom_i, end_dom_i, start_dom_j, end_dom_j, &
start_patch_i, end_patch_i, start_patch_j, end_patch_j, &
Expand Down
6 changes: 4 additions & 2 deletions metgrid/src/input_module.F
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,11 @@ subroutine read_global_attrs(title, start_date, grid_type, dyn_opt,
#endif

call ext_get_dom_ti_char ('TITLE', title)
if (index(title,'GEOGRID V4.0.2') /= 0) then
wps_version = 4.02
if (index(title,'GEOGRID V4.0.3') /= 0) then
wps_version = 4.03
else if (index(title,'GEOGRID V4.0.2') /= 0) then
wps_version = 4.02
else if (index(title,'GEOGRID V4.0.1') /= 0) then
wps_version = 4.01
else if (index(title,'GEOGRID V4.0') /= 0) then
wps_version = 4.0
Expand Down
2 changes: 1 addition & 1 deletion metgrid/src/process_domain_module.F
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ subroutine process_single_met_time(do_const_processing, &
! now we simply output every field from the storage module.
!

title = 'OUTPUT FROM METGRID V4.0.2'
title = 'OUTPUT FROM METGRID V4.0.3'

! Initialize the output module for this domain and time
call mprintf(.true.,LOGFILE,'Initializing output module.')
Expand Down
17 changes: 10 additions & 7 deletions ungrib/src/g1print.F
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
! Usage: "g1print [-v] [-V] filename"
!
! Originally from gribscan.
! January 2019: Length of field changed from 5 to 7.
!
program g1print
use module_grib
Expand All @@ -24,14 +25,14 @@ end subroutine parse_args
integer :: ierr, igherr
integer :: cc
character(len=100) :: fmt = '(I4,1X, &
& I3,1x, A5,1x, &
& I3,1x, A7,1x, &
& I4, &
& 2(1x,I4),2x,I4.4,2("-",I2.2),"_",I2.2,":",&
& I2.2, 1x, "+", i3.2)'
logical :: ivb = .FALSE.
logical :: idb = .FALSE.
integer :: year
character(len=5) :: field
character(len=7) :: field
integer :: ec_rec_len

ec_rec_len = 0
Expand Down Expand Up @@ -270,12 +271,12 @@ subroutine fieldname(ptv, centerid, procid, param, subc, field)
! procid - process id
! param - parameter number
! subc - sub center
! field - 5-character field name (returned)
! field - 7-character field name (returned)
integer, intent(in) :: ptv, centerid, procid, param, subc
logical :: first=.true.
character (len=5), intent(out) :: field
character(len=5) :: table2(255), table129(255), afwa(255), ecmwf(255), &
character (len=7), intent(out) :: field
character(len=7) :: table2(255), table129(255), afwa(255), ecmwf(255), &
table130(255), table131(255), table132(255)
common /paramids/ table2, table129, table130, table131, table132, afwa, ecmwf
Expand Down Expand Up @@ -311,7 +312,7 @@ subroutine fieldname(ptv, centerid, procid, param, subc, field)
end subroutine fieldname
!
subroutine init_tables
character(len=5) :: table2(255), table129(255), afwa(255), ecmwf(255), &
character(len=7) :: table2(255), table129(255), afwa(255), ecmwf(255), &
table130(255), table131(255), table132(255)
common /paramids/ table2, table129, table130, table131, table132, afwa, ecmwf
Expand Down Expand Up @@ -499,11 +500,13 @@ subroutine init_tables
ecmwf(238) = 'TSN '
ecmwf(239) = 'CSF '
ecmwf(240) = 'LSF '
ecmwf(246) = 'CLWC '
ecmwf(247) = 'CIWC '
ecmwf(248) = 'CC '
end subroutine init_tables
block data ptables
character(len=5) :: table2(255), table129(255), afwa(255), ecmwf(255), &
character(len=7) :: table2(255), table129(255), afwa(255), ecmwf(255), &
table130(255), table131(255), table132(255)
common /paramids/ table2, table129, table130, table131, table132, afwa, ecmwf
Expand Down

0 comments on commit 23bd63a

Please sign in to comment.