From d505428d841cc9794309a0db1ca0121d594e9e5c Mon Sep 17 00:00:00 2001 From: Jason Floyd Date: Thu, 9 Jan 2025 08:40:25 -0500 Subject: [PATCH] FDS Source: Move EXTERNAL_RAMP and _CTRL allocation. Issue #14011 --- Source/main.f90 | 4 ---- Source/read.f90 | 10 ++++++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Source/main.f90 b/Source/main.f90 index 44459ac1161..12bcb0fb23c 100644 --- a/Source/main.f90 +++ b/Source/main.f90 @@ -171,10 +171,6 @@ PROGRAM FDS IF (READ_EXTERNAL) THEN T_EXTERNAL = T_BEGIN + DT_EXTERNAL - ALLOCATE(EXTERNAL_RAMP(N_RAMP)) - EXTERNAL_RAMP = RAMPS%LAST - ALLOCATE(EXTERNAL_CTRL(N_CTRL)) - EXTERNAL_CTRL = CONTROL%INITIAL_STATE LU_EXTERNAL = GET_FILE_NUMBER() IF (DT_EXTERNAL_HEARTBEAT > 0._EB) LU_EXTERNAL_HEARTBEAT = GET_FILE_NUMBER() ENDIF diff --git a/Source/read.f90 b/Source/read.f90 index 6d24ba87c30..1922c450b52 100644 --- a/Source/read.f90 +++ b/Source/read.f90 @@ -10031,6 +10031,7 @@ END SUBROUTINE READ_CLIP SUBROUTINE READ_RAMP +USE CONTROL_VARIABLES, ONLY: N_CTRL,CONTROL REAL(EB) :: X,Z,T,F,TM,INITIAL_VALUE INTEGER :: I,II,NN,N,NUMBER_INTERPOLATION_POINTS,N_RES_RAMP CHARACTER(LABEL_LENGTH) :: DEVC_ID,CTRL_ID,CTRL_ID_DEP,DEVC_ID_DEP @@ -10234,6 +10235,15 @@ SUBROUTINE READ_RAMP CALL SHUTDOWN(MESSAGE) ; RETURN ENDIF +! Allocate and initialized external RAMP and CTRL + +IF (READ_EXTERNAL) THEN + ALLOCATE(EXTERNAL_RAMP(N_RAMP)) + EXTERNAL_RAMP = RAMPS%LAST + ALLOCATE(EXTERNAL_CTRL(N_CTRL)) + EXTERNAL_CTRL = CONTROL%INITIAL_STATE +ENDIF + END SUBROUTINE READ_RAMP