Skip to content

Commit

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

* release-v4.3.1:
  Fix print format in g2print.F by using an explicit format statement rather than list-directed output
  Add FCCOMPAT flags to postamble and throughout Makefiles when compiling Fortran
  Allow configure script to define new FCCOMPAT flags for newer GNU compilers
  Add newer variables to HRRR var list
  Fix incorrect argument rank in calls to ext_*_get_dom_ti_* in input_module.F
  Fix incorrect argument rank in calls to ext_*_put_dom_ti_* in output_module.F
  Update version number to 4.3.1
  • Loading branch information
mgduda committed Nov 5, 2021
2 parents 89f559c + d9467d3 commit 7d7a080
Show file tree
Hide file tree
Showing 14 changed files with 97 additions and 32 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.3
WRF Pre-Processing System Version 4.3.1

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

Expand Down
4 changes: 4 additions & 0 deletions arch/configure.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ CC = CONFIGURE_CC
LD = $(FC)
FFLAGS = -ffree-form -O -fconvert=big-endian -frecord-marker=4
F77FLAGS = -ffixed-form -O -fconvert=big-endian -frecord-marker=4
FCCOMPAT = CONFIGURE_COMPAT_FLAGS
FCSUFFIX =
FNGFLAGS = $(FFLAGS)
LDFLAGS =
Expand All @@ -182,6 +183,7 @@ CC = CONFIGURE_CC
LD = $(FC)
FFLAGS = -ffree-form -O -fconvert=big-endian -frecord-marker=4
F77FLAGS = -ffixed-form -O -fconvert=big-endian -frecord-marker=4
FCCOMPAT = CONFIGURE_COMPAT_FLAGS
FCSUFFIX =
FNGFLAGS = $(FFLAGS)
LDFLAGS =
Expand Down Expand Up @@ -452,6 +454,7 @@ CC = CONFIGURE_CC
LD = $(FC)
FFLAGS = -ffree-form -O -fconvert=big-endian -frecord-marker=4
F77FLAGS = -ffixed-form -O -fconvert=big-endian -frecord-marker=4
FCCOMPAT = CONFIGURE_COMPAT_FLAGS
FCSUFFIX =
FNGFLAGS = $(FFLAGS)
LDFLAGS =
Expand All @@ -477,6 +480,7 @@ CC = CONFIGURE_CC
LD = $(FC)
FFLAGS = -ffree-form -O -fconvert=big-endian -frecord-marker=4
F77FLAGS = -ffixed-form -O -fconvert=big-endian -frecord-marker=4
FCCOMPAT = CONFIGURE_COMPAT_FLAGS
FCSUFFIX =
FNGFLAGS = $(FFLAGS)
# For a WRF OpenMP build, add the gomp library for WPS
Expand Down
4 changes: 2 additions & 2 deletions arch/postamble
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ AR = ar ru

.f.o:
$(RM) $@ $*.mod
$(FC) $(F77FLAGS) -c $< $(WRF_INCLUDE)
$(FC) $(F77FLAGS) $(FCCOMPAT) -c $< $(WRF_INCLUDE)

.F.o:
$(RM) $@ $*.mod
$(CPP) $(CPPFLAGS) $(FDEFS) $(WRF_INCLUDE) $< > $*.f90
$(FC) $(FFLAGS) -c $*.f90 $(WRF_INCLUDE)
$(FC) $(FFLAGS) $(FCCOMPAT) -c $*.f90 $(WRF_INCLUDE)
# $(RM) $*.f90
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.2
echo Version 4.3.1
echo " "
uname -a
echo " "
Expand Down
37 changes: 37 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -458,3 +458,40 @@ EOF

fi
fi


#
# Check for newer GNU Fortran compilers that require the use of the following:
# -fallow-argument-mismatch
#
cat > gnu_flag_test.F90 << EOF
program gnu_flag_test
#ifdef __GNUC__
#if __GNUC__ > 9
call exit(1) ! A GNU extension, but at this point we know this is a GNU compiler
#endif
#endif
end program gnu_flag_test
EOF

# The above test program gives exit status 1 iff we are using the GNU Fortran
# compiler with a major version greater than 9

FC=`grep ^SFC configure.wps | cut -d"=" -f2-`
FFLAGS=`grep ^FFLAGS configure.wps | cut -d"=" -f2-`
$FC ${FFLAGS} gnu_flag_test.F90 -o gnu_flag_test > /dev/null 2>&1
if [ -f ./gnu_flag_test ]; then
./gnu_flag_test > /dev/null 2>&1
if [ $? -eq 1 ]; then
compat="-fallow-argument-mismatch"
fi
rm gnu_flag_test
else
printf "*** Failed to compile the gnu_flag_test program!\n"
printf " This may be because the selected build option does not work correctly.\n"
fi
rm gnu_flag_test.F90

sed "s/CONFIGURE_COMPAT_FLAGS/${compat}/" configure.wps > configure.wps.tmp
mv configure.wps.tmp configure.wps

12 changes: 6 additions & 6 deletions geogrid/src/output_module.F
Original file line number Diff line number Diff line change
Expand Up @@ -1429,21 +1429,21 @@ subroutine ext_put_dom_ti_integer_scalar(var_name, var_value)
#ifdef IO_BINARY
if (io_form_output == BINARY) then
call ext_int_put_dom_ti_integer(handle, trim(var_name), &
var_value, &
(/ var_value /), &
1, istatus)
end if
#endif
#ifdef IO_NETCDF
if (io_form_output == NETCDF) then
call ext_ncd_put_dom_ti_integer(handle, trim(var_name), &
var_value, &
(/ var_value /), &
1, istatus)
end if
#endif
#ifdef IO_GRIB1
if (io_form_output == GRIB1) then
call ext_gr1_put_dom_ti_integer(handle, trim(var_name), &
var_value, &
(/ var_value /), &
1, istatus)
end if
#endif
Expand Down Expand Up @@ -1516,21 +1516,21 @@ subroutine ext_put_dom_ti_real_scalar(var_name, var_value)
#ifdef IO_BINARY
if (io_form_output == BINARY) then
call ext_int_put_dom_ti_real(handle, trim(var_name), &
var_value, &
(/ var_value /), &
1, istatus)
end if
#endif
#ifdef IO_NETCDF
if (io_form_output == NETCDF) then
call ext_ncd_put_dom_ti_real(handle, trim(var_name), &
var_value, &
(/ var_value /), &
1, istatus)
end if
#endif
#ifdef IO_GRIB1
if (io_form_output == GRIB1) then
call ext_gr1_put_dom_ti_real(handle, trim(var_name), &
var_value, &
(/ var_value /), &
1, istatus)
end if
#endif
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.3', '0000-00-00_00:00:00', grid_type, dynopt, &
call output_init(which_domain, 'OUTPUT FROM GEOGRID V4.3.1', '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
22 changes: 15 additions & 7 deletions metgrid/src/input_module.F
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,9 @@ 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.3') /= 0) then
if (index(title,'GEOGRID V4.3.1') /= 0) then
wps_version = 4.31
else if (index(title,'GEOGRID V4.3') /= 0) then
wps_version = 4.3
else if (index(title,'GEOGRID V4.2') /= 0) then
wps_version = 4.2
Expand Down Expand Up @@ -633,25 +635,26 @@ subroutine ext_get_dom_ti_integer_scalar(var_name, var_value, suppress_errors)

! Local variables
integer :: istatus, outcount
integer, dimension(1) :: var_value_arr

#ifdef IO_BINARY
if (io_form_input == BINARY) then
call ext_int_get_dom_ti_integer(handle, trim(var_name), &
var_value, &
var_value_arr, &
1, outcount, istatus)
end if
#endif
#ifdef IO_NETCDF
if (io_form_input == NETCDF) then
call ext_ncd_get_dom_ti_integer(handle, trim(var_name), &
var_value, &
var_value_arr, &
1, outcount, istatus)
end if
#endif
#ifdef IO_GRIB1
if (io_form_input == GRIB1) then
call ext_gr1_get_dom_ti_integer(handle, trim(var_name), &
var_value, &
var_value_arr, &
1, outcount, istatus)
end if
#endif
Expand All @@ -662,6 +665,8 @@ subroutine ext_get_dom_ti_integer_scalar(var_name, var_value, suppress_errors)
call mprintf((istatus /= 0),ERROR,'Error while reading domain time-independent attribute.')
end if

var_value = var_value_arr(1)

end subroutine ext_get_dom_ti_integer_scalar


Expand Down Expand Up @@ -724,31 +729,34 @@ subroutine ext_get_dom_ti_real_scalar(var_name, var_value)

! Local variables
integer :: istatus, outcount
real, dimension(1) :: var_value_arr

#ifdef IO_BINARY
if (io_form_input == BINARY) then
call ext_int_get_dom_ti_real(handle, trim(var_name), &
var_value, &
var_value_arr, &
1, outcount, istatus)
end if
#endif
#ifdef IO_NETCDF
if (io_form_input == NETCDF) then
call ext_ncd_get_dom_ti_real(handle, trim(var_name), &
var_value, &
var_value_arr, &
1, outcount, istatus)
end if
#endif
#ifdef IO_GRIB1
if (io_form_input == GRIB1) then
call ext_gr1_get_dom_ti_real(handle, trim(var_name), &
var_value, &
var_value_arr, &
1, outcount, istatus)
end if
#endif

call mprintf((istatus /= 0),ERROR,'Error while reading domain time-independent attribute.')

var_value = var_value_arr(1)

end subroutine ext_get_dom_ti_real_scalar


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.3'
title = 'OUTPUT FROM METGRID V4.3.1'

! Initialize the output module for this domain and time
call mprintf(.true.,LOGFILE,'Initializing output module.')
Expand Down
6 changes: 3 additions & 3 deletions ungrib/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ g2print.exe: filelist.o gridinfo.o g2print.o
g2print.o: table.o gridinfo.o filelist.o module_datarray.o \
ngl/g2/gribmod.o ngl/g2/params.o g2print.F
$(CPP) $(CPPFLAGS) $*.F > $*.f90
$(FC) -c $(FFLAGS) $(FCSUFFIX) $*.f90 -I. -I./ngl/g2
$(FC) -c $(FFLAGS) $(FCSUFFIX) $(FCCOMPAT) $*.f90 -I. -I./ngl/g2
# $(RM) $*.f90

rd_grib2.o: ngl/g2/gribmod.o module_debug.o table.o gridinfo.o ngl/g2/params.o new_storage.o \
rd_grib2.F
$(CPP) $(CPPFLAGS) $*.F > $*.f90
$(FC) -c $(F77FLAGS) $(FCSUFFIX) $*.f90 -I. -I./ngl/g2
$(FC) -c $(F77FLAGS) $(FCSUFFIX) $(FCCOMPAT) $*.f90 -I. -I./ngl/g2
# $(RM) $*.f90

datint.o: misc_definitions_module.o module_debug.o gridinfo.o new_storage.o datint.F
Expand All @@ -88,7 +88,7 @@ read_namelist.o: misc_definitions_module.o module_debug.o read_namelist.F

.F.o:
$(CPP) $(CPPFLAGS) $(FDEFS) $< > $*.f90
$(FC) -c $(FFLAGS) $*.f90
$(FC) -c $(FFLAGS) $(FCCOMPAT) $*.f90
# $(RM) $*.f90

.c.o:
Expand Down
8 changes: 4 additions & 4 deletions ungrib/src/g2print.F
Original file line number Diff line number Diff line change
Expand Up @@ -488,10 +488,10 @@ SUBROUTINE r_grib2(junit, gribflnm, hdate, &
write (6,*) ' ',map%source

if (debug_level .le. 50) then
write(6,*) '---------------------------------------------------------------------------------------'
write(6,*) ' rec Prod Cat Param Lvl Lvl Lvl Prod Name Time Fcst'
write(6,*) ' num Disc num code one two Templ hour'
write(6,*) '---------------------------------------------------------------------------------------'
write(6,'(a)') '---------------------------------------------------------------------------------------'
write(6,'(a)') ' rec Prod Cat Param Lvl Lvl Lvl Prod Name Time Fcst'
write(6,'(a)') ' num Disc num code one two Templ hour'
write(6,'(a)') '---------------------------------------------------------------------------------------'
endif


Expand Down
4 changes: 2 additions & 2 deletions ungrib/src/ngl/g2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ superclean: clean

.F.o:
$(CPP) $(FDEFS) $*.F > $*.f90
$(FC) -c $(F77FLAGS) $*.f90
$(FC) -c $(F77FLAGS) $(FCCOMPAT) $*.f90
/bin/rm -f $*.f90

.f.o:
$(FC) -c $(F77FLAGS) $*.f
$(FC) -c $(F77FLAGS) $(FCCOMPAT) $*.f

.c.o:
$(CC) -c $(CFLAGS) $(CFLAGS2) $<
22 changes: 19 additions & 3 deletions ungrib/src/ngl/g2/params.f
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module params
!
!$$$

integer,parameter :: MAXPARAM=801
integer,parameter :: MAXPARAM=816

type gribparam
integer :: g1tblver
Expand Down Expand Up @@ -431,7 +431,7 @@ module params
data paramlist(370) /gribparam(2,160,0,4,198,'CSUSF')/
data paramlist(371) /gribparam(2,162,0,5,195,'CSULF')/
data paramlist(372) /gribparam(2,163,0,5,196,'CSDLF')/
data paramlist(373) /gribparam(2,164,0,4,199,'CFNSF')/
data paramlist(373) /gribparam(2,164,0,4,199,'CFNSF')/ ! used as Fire Radiative Power in HRRR
data paramlist(374) /gribparam(2,165,0,5,197,'CFNLF')/
data paramlist(375) /gribparam(2,166,0,4,200,'VBDSF')/
data paramlist(376) /gribparam(2,167,0,4,201,'VDDSF')/
Expand Down Expand Up @@ -857,7 +857,7 @@ module params
data paramlist(790) /gribparam(2,238,0,1,42,'SNOWC')/
data paramlist(791) /gribparam(2,204,0,4,7,'DSWRF')/
! Added 04/6/19 for HRRR fields.
! table version, grib1 value, grib2 desc, grib2 category, grib2num, abbreviation
! table version, grib1 value, grib2 disc, grib2 category, grib2num, abbreviation
data paramlist(792) /gribparam(2,255,0,1,31,'HAIL')/
data paramlist(793) /gribparam(2,255,0,1,82,'CIMIXR')/
data paramlist(794) /gribparam(2,253,0,2,30,'FRICV')/
Expand All @@ -868,6 +868,22 @@ module params
data paramlist(799) /gribparam(2,155,2,0,10,'GFLUX')/
data paramlist(800) /gribparam(2,235,1,0,6,'SSRUN')/
data paramlist(801) /gribparam(2,234,1,0,5,'BGRUN')/
! Added 08/16/21 for more HRRR fields.
data paramlist(802) /gribparam(2,255,0,1,100,'SPNCR')/
data paramlist(803) /gribparam(2,255,0,6,28,'NCONCD')/
data paramlist(804) /gribparam(2,255,0,6,29,'NCCICE')/
data paramlist(805) /gribparam(2,255,0,6,32,'FRACCC')/
data paramlist(806) /gribparam(2,255,0,7,204,'EFHL')/
data paramlist(807) /gribparam(2,255,0,7,205,'ESP')/
data paramlist(808) /gribparam(2,255,0,7,206,'CANGLE')/
data paramlist(809) /gribparam(2,255,0,20,0,'MASSDEN')/ ! smoke
data paramlist(810) /gribparam(2,255,0,20,1,'COLMD')/ ! smoke
data paramlist(811) /gribparam(2,255,0,17,1,'LTPINX')/
data paramlist(812) /gribparam(2,255,2,0,231,'VEGMIN')/
data paramlist(813) /gribparam(2,255,2,0,232,'VEGMAX')/
data paramlist(814) /gribparam(2,255,0,6,18,'TCOLWO')/
data paramlist(815) /gribparam(2,255,0,6,19,'TCOLIO')/
data paramlist(816) /gribparam(2,255,0,16,201,'RADARVIL')/
contains
Expand Down
2 changes: 1 addition & 1 deletion ungrib/src/ngl/w3/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ clean:

.f.o:
$(RM) $*.o
$(FC) $(F77FLAGS) -c $<
$(FC) $(F77FLAGS) $(FCCOMPAT) -c $<

.c.o:
$(RM) $*.o
Expand Down

0 comments on commit 7d7a080

Please sign in to comment.