Minor bug in TMPBEIS4

Need help running SMOKE? If so, first search existing topics under this category, and if your issue is new, post a new topic. PLEASE READ before posting

Describe your issue in detail

COMPUTE_SEASON_FUNCTION environment variable is really only supported when using PX-LSM input data (PX_VERSION = Y). COMPUTE_SEASON_FUNCTION is set to Y by default. If PX_VERSION is set to N by user then TMPBEIS4 seg faults when it tries to use soil temperature data it hasn’t read in since PX_VERSION is set to N.

What version of the SMOKE software are you using?

version 5+

What steps have you taken to resolve this issue already?

I moved the PX_VERSION ENVYN statement higher in tmpbeis4.f; right before the COMPUTE_SEASON_FUNCTION env var is checked and added an error check. Here is what the code looks like:

C… Check if using PX version of MCIP

    PX_VERSION = ENVYN( 'PX_VERSION', 'MCIP is PX version?',
 &                      .FALSE., IOS)
    IF ( IOS .GT. 0 ) THEN
        CALL M3EXIT( PROGNAME,0,0, 'Bad env vble "PX_VERSION"', 2 )
    END IF

C… Check to compute season function from MCIP soil temperature
MESG = ‘Compute season function from soil temperature?’
SEASON_CALC = ENVYN( ‘COMPUTE_SEASON_FUNCTION’, MESG, .TRUE., IOS)

    IF ( .NOT. PX_VERSION .AND. SEASON_CALC ) THEN
      MESG = "ERROR: COMPUTE_SEASON_FUNCTION only supported when" //
 &       " PX-LSM input data is used.  If PX not used then set" //
 &       " COMPUTE_SEASON_FUNCTION to N"
      CALL M3EXIT( PROGNAME, 0, 0, MESG, 2 )
    ENDIF

Also recommend updating SMOKE Users Guide to mention this limitation with COMPUTE_SEASON_FUNCTION. Also may want to mention that PX is a 2-layer LSM.

Thank you recommending this bug fix and update to the documentation and bug fix for TMPBEIS4.