Skip to content
This repository has been archived by the owner on Apr 8, 2021. It is now read-only.

Commit

Permalink
Add HWRF fix for running copygb from James Frimmel (#14)
Browse files Browse the repository at this point in the history
* Add HWRF fix for running copygb from James Frimmel

* Change default to compile all libraries

Co-authored-by: Tracy <tracy.hertneky@noaa.gov>
Co-authored-by: Michael Kavulich, Jr <kavulich@ucar.edu>
  • Loading branch information
3 people authored Mar 26, 2020
1 parent c01e9ad commit 93c9f7b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
2 changes: 1 addition & 1 deletion make_ncep_libs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ if [ -z $COMPILER ] ; then echo "ERROR: compiler argument is required"; echo"";
if [ -z $NCEPLIBS_DST_DIR ] ; then echo "ERROR: installdir argument is required"; echo""; usage; fi
if [ -z $OPENMP ] ; then echo "ERROR: openmp argument is required"; echo""; usage; fi
if [ -z $MPI ] ; then MPI=1; fi
if [ -z $APP ] ; then APP=0; fi #APP is an optional argument
if [ -z $APP ] ; then APP=1; fi #APP is an optional argument

# For back compatability, allow APP to be 0 (global) or 1 (all)
if [ "$APP" == "0" ]; then
Expand Down
28 changes: 23 additions & 5 deletions src/w3nco/v2.0.6/src/instrument.f
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ SUBROUTINE INSTRUMENT(K,KALL,TTOT,TMIN,TMAX)
!
! PROGRAM HISTORY LOG:
! 1998-07-16 IREDELL
! 2019-09-17 FRIMEL and KALINA
! DECOMPOSE RETURN STATISTCS IF STATEMENT
!
! USAGE: CALL INSTRUMENT(K,KALL,TTOT,TMIN,TMAX)
! INPUT ARGUMENT LIST:
Expand Down Expand Up @@ -94,11 +96,27 @@ SUBROUTINE INSTRUMENT(K,KALL,TTOT,TMIN,TMAX)
ENDIF
! - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
! RETURN STATISTICS
IF(KA.GE.1.AND.KA.LE.KMAX.AND.KALLS(KA).GT.0) THEN
KALL=KALLS(KA)
TTOT=TTOTS(KA)
TMIN=TMINS(KA)
TMAX=TMAXS(KA)

! FRIMEL and KALINA, DECOMPOSE THE IF STATEMENT, SAFER FOR SOME
! COMPILERS. Since No Guarantee on order of evaluation, and when
! evaluation will stop.
! MAKE SURE KA.GE.1 BEFORE TESTING IF KALLS(KA).GT.0, ELSE
! MAY ENCOUNTER A RUNTIME SIGSEGV SEGEMENTATION FAULT.
! Since Subscript #1 of the array KALLS can have value 0 which
! is less than the lower bound of 1
! IF(KA.GE.1.AND.KA.LE.KMAX.AND.KALLS(KA).GT.0) THEN
IF(KA.GE.1.AND.KA.LE.KMAX) THEN
IF(KALLS(KA).GT.0) THEN
KALL=KALLS(KA)
TTOT=TTOTS(KA)
TMIN=TMINS(KA)
TMAX=TMAXS(KA)
ELSE
KALL=0
TTOT=0
TMIN=0
TMAX=0
ENDIF
ELSE
KALL=0
TTOT=0
Expand Down

0 comments on commit 93c9f7b

Please sign in to comment.