Skip to content

Commit

Permalink
Add a CI_BAIL_EARLY env variable to stop after CalcTearth and PrelimO…
Browse files Browse the repository at this point in the history
…utput
  • Loading branch information
jmarrec committed Dec 10, 2024
1 parent f8f3134 commit 33cecf6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
11 changes: 9 additions & 2 deletions src/Basement/3DBasementHT.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,7 @@ SUBROUTINE GetSimParams(RUNID)
SimParams%F=.1d0
ENDIF
SimParams%IYRS =NumArray(2)

! Override with environment variable for quicker testing
CALL GET_ENVIRONMENT_VARIABLE("CI_BASEMENT_NUMYEARS", EnvVarNumYearsString, EnvVarNumYearsStringLength, EnvVarNumYearsStatus)
SELECT CASE (EnvVarNumYearsStatus)
Expand All @@ -1026,7 +1026,7 @@ SUBROUTINE GetSimParams(RUNID)
SimParams%IYRS = EnvVarNumYears
END IF
END SELECT

IF (SimParams%IYRS <= 0.d0) THEN
CALL ShowSevereError('GetSimParams: Entered "IYRS: Maximum number of yearly iterations:" '// &
'choice is not valid.'// &
Expand Down Expand Up @@ -2266,6 +2266,7 @@ SUBROUTINE BasementSimulator(RUNID,NMAT,CVG,XDIM,YDIM,ZDIM,TG)
REAL(r64) Elapsed_Time
INTEGER IHrStart
INTEGER IHrEnd
INTEGER CI_BAIL_EARLY_STATUS


CALL CPU_TIME(Time_Start)
Expand Down Expand Up @@ -2589,6 +2590,12 @@ SUBROUTINE BasementSimulator(RUNID,NMAT,CVG,XDIM,YDIM,ZDIM,TG)
!*** Echo input data
CALL PrelimOutput(ACEIL,AFLOOR,ARIM,ASILL,AWALL,PERIM,RUNID,TDBH,TDBC)

CALL GET_ENVIRONMENT_VARIABLE("CI_BAIL_EARLY", status=CI_BAIL_EARLY_STATUS)
IF (CI_BAIL_EARLY_STATUS == 0) THEN
print *, 'Exiting early because envionment variable CI_BAIL_EARLY was found'
CALL EXIT(0)
END IF

!*** Initialize temperatures in 3-D domain
!*** T(X,Y,Z)=TG(Z)
READ (GroundTemp,*) RSKY,HHEAT,HMASS,DODPG,(TG(COUNT1), COUNT1=0,NZBGM1)
Expand Down
5 changes: 4 additions & 1 deletion src/Basement/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ if(BUILD_TESTING)
COMMAND $<TARGET_FILE:Basement>
WORKING_DIRECTORY ${TEST_DIR}
)
set_tests_properties("${TEST_NAME}" PROPERTIES FAIL_REGULAR_EXPRESSION "Terminated;Error(s) Detected")
set_tests_properties("${TEST_NAME}" PROPERTIES
FAIL_REGULAR_EXPRESSION "Terminated;Error(s) Detected"
ENVIRONMENT "CI_BAIL_EARLY=1"
)
endmacro()

basement_test(AutoGriddingDepthIsHigh)
Expand Down

0 comments on commit 33cecf6

Please sign in to comment.