[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TRNSYS-users] output number beyond the allocated outputs



Hi Matt and all,

 

thanks for your answer. Yes I already tried this. Normally compiling the source code is no problem. Creating new components and so on is no problem.

But this source code was written by someone before me. Maybe it was an older code, which I transformed, because when I complied at first it delivers many errors which I all solved. I was also able to build the code. But when I connect the output so some other element, the error is appearing!

Appended is a copy of one part the code..

 

Maybe someone has time to look at it

 

Thanks,

Marius

 

!************************************************************************

 

!    TRNSYS acess functions (allow to acess TIME etc.)

      USE TrnsysConstants

      USE TrnsysFunctions

 

 

!-----------------------------------------------------------------------------------------------------------------------

!    REQUIRED BY THE MULTI-DLL VERSION OF TRNSYS

!DEC$ATTRIBUTES DLLEXPORT :: TYPE229                                        !SET THE CORRECT TYPE NUMBER HERE

!-----------------------------------------------------------------------------------------------------------------------

!-----------------------------------------------------------------------------------------------------------------------

!    TRNSYS DECLARATIONS

      IMPLICIT NONE                              !REQUIRES THE USER TO DEFINE ALL VARIABLES BEFORE USING THEM

 

      DOUBLE PRECISION XIN    !THE ARRAY FROM WHICH THE INPUTS TO THIS TYPE WILL BE RETRIEVED

      DOUBLE PRECISION OUT  !THE ARRAY WHICH WILL BE USED TO STORE THE OUTPUTS FROM THIS TYPE

      DOUBLE PRECISION TIME !THE CURRENT SIMULATION TIME - YOU MAY USE THIS VARIABLE BUT DO NOT SET IT!

      DOUBLE PRECISION PAR  !THE ARRAY FROM WHICH THE PARAMETERS FOR THIS TYPE WILL BE RETRIEVED

      DOUBLE PRECISION STORED !THE STORAGE ARRAY FOR HOLDING VARIABLES FROM TIMESTEP TO TIMESTEP

      DOUBLE PRECISION T                  !AN ARRAY CONTAINING THE RESULTS FROM THE DIFFERENTIAL EQUATION SOLVER

      DOUBLE PRECISION DTDT            !AN ARRAY CONTAINING THE DERIVATIVES TO BE PASSED TO THE DIFF.EQ. SOLVER

      INTEGER*4 INFO(15)                      !THE INFO ARRAY STORES AND PASSES VALUABLE INFORMATION TO AND FROM THIS TYPE

      INTEGER*4 NP,NI,NOUT,ND           !VARIABLES FOR THE MAXIMUM NUMBER OF PARAMETERS,INPUTS,OUTPUTS AND DERIVATIVES

      INTEGER*4 NPAR,NIN,NDER          !VARIABLES FOR THE CORRECT NUMBER OF PARAMETERS,INPUTS,OUTPUTS AND DERIVATIVES

      INTEGER*4 IUNIT,ITYPE     !THE UNIT NUMBER AND TYPE NUMBER FOR THIS COMPONENT

      INTEGER*4 ICNTRL                        !AN ARRAY FOR HOLDING VALUES OF CONTROL FUNCTIONS WITH THE NEW SOLVER

      INTEGER*4 NSTORED                   !THE NUMBER OF VARIABLES THAT WILL BE PASSED INTO AND OUT OF STORAGE

      CHARACTER*3 OCHECK               !AN ARRAY TO BE FILLED WITH THE CORRECT VARIABLE TYPES FOR THE OUTPUTS

      CHARACTER*3 YCHECK                !AN ARRAY TO BE FILLED WITH THE CORRECT VARIABLE TYPES FOR THE INPUTS

!-----------------------------------------------------------------------------------------------------------------------

 

!-----------------------------------------------------------------------------------------------------------------------

!    USER DECLARATIONS - SET THE MAXIMUM NUMBER OF PARAMETERS (NP), INPUTS (NI),

!    OUTPUTS (NOUT), AND DERIVATIVES (ND) THAT MAY BE SUPPLIED FOR THIS TYPE

      PARAMETER (NP=7,NI=10,NOUT=13,ND=0,NSTORED=0)

!-----------------------------------------------------------------------------------------------------------------------

 

!-----------------------------------------------------------------------------------------------------------------------

!    REQUIRED TRNSYS DIMENSIONS

      DIMENSION XIN(NI),OUT(NOUT),PAR(NP),YCHECK(NI),OCHECK(NOUT),

     1      STORED(NSTORED),T(ND),DTDT(ND)

      INTEGER NITEMS

!-----------------------------------------------------------------------------------------------------------------------

!-----------------------------------------------------------------------------------------------------------------------

!    ADD DECLARATIONS AND DEFINITIONS FOR THE USER-VARIABLES HERE

 

! C    PARAMETERS

      DOUBLE PRECISION COP_r       !COP_rated

      DOUBLE PRECISION cp          !heat_capacity_solar_flow

      double precision Qnom

      double precision HWT_r        !Hot Water Temperature at Design Conditions

      double precision CWT_r        !Cooling Water Temperature at Design Conditions

      double precision ChWT_r        !Chilled Water Temperature at Design Conditions#

      double precision P_el_in   !inner Energy Consumption of the chiller

 

! C    INPUTS

      DOUBLE PRECISION HWT_in         !Temperature_Input

      DOUBLE PRECISION m           !Massflow

      double precision CWT_in    ! Cooling Water Temperature

      double precision Qcool_demand      ! Cooling demand

      double precision CWF      ! Cooling Water Flow Rate

      double precision ChWF      ! Cooling Water Flow Rate

      double precision ChWT_in      ! Chilled Water Temperature

      double precision P_el_CW      !electric Power needed by the ChilledWaterCycle

      double precision P_el_HW      !electric power needed by the HotWaterCycle

      double precision P_el_cool    !electric power needed by the CoolWaterycle

     

 

!      OUTPUTS

      double precision Tout         !outlet temperature

      DOUBLE PRECISION Qboil       !Temperature_Ambient

      DOUBLE PRECISION Qsol        !Humidity_relative

      double precision Qheat       !Cooling heat needed

      double precision control

      double precision CWT_out

      double precision ChWT_out

      double precision COP_net       !COP considering electrical consumption

      double precision COP_net2

     

 

! Additional PARAMETERS

     

 

  !     Double precision Psydat(9)   !Data variable to read psychometric data

       double precision load         !Load of Cooling device

       double precision COP

       double precision Qcool       !actual cooling power

       double precision Qwaste

       DOUBLE PRECISION DeltaT      !maximal temperature difference of Hot Water in the absorption chiller

       integer i

 

     

!-----------------------------------------------------------------------------------------------------------------------

!       READ IN THE VALUES OF THE PARAMETERS IN SEQUENTIAL ORDER

      COP_r=PAR(1)

      cp=PAR(2)

      Qnom=Par(3)

      HWT_r=Par(4)

      CWT_r=Par(5)

      ChWT_r=Par(6)

      P_el_in=Par(7)

 

 

!-----------------------------------------------------------------------------------------------------------------------

!    RETRIEVE THE CURRENT VALUES OF THE INPUTS TO THIS MODEL FROM THE XIN ARRAY IN SEQUENTIAL ORDER

 

       HWT_in=XIN(1)

       m=XIN(2)

       CWT_in=XIN(3)

       Qcool_demand=XIN(4)

       CWF=XIN(5)

       ChWT_in=XIN(6)

       ChWF=XIN(7)

       P_el_CW=XIN(8)

       P_el_HW=XIN(9)

       P_el_cool=XIN(10)

      

       IUNIT=INFO(1)

       ITYPE=INFO(2)

 

!-----------------------------------------------------------------------------------------------------------------------

!    SET THE VERSION INFORMATION FOR TRNSYS

      IF(INFO(7).EQ.-2) THEN

       INFO(12)=16

       RETURN 1

      ENDIF

     

!-----------------------------------------------------------------------------------------------------------------------

 

!-----------------------------------------------------------------------------------------------------------------------

!    DO ALL THE VERY LAST CALL OF THE SIMULATION MANIPULATIONS HERE

      IF (INFO(8).EQ.-1) THEN

       RETURN 1

      ENDIF

!-----------------------------------------------------------------------------------------------------------------------

 

!-----------------------------------------------------------------------------------------------------------------------

!    PERFORM ANY 'AFTER-ITERATION' MANIPULATIONS THAT ARE REQUIRED HERE

!    e.g. save variables to storage array for the next timestep

      IF (INFO(13).GT.0) THEN

       NITEMS=0

!    STORED(1)=... (if NITEMS > 0)

!        CALL setStorageVars(STORED,NITEMS,INFO)

       RETURN 1

      ENDIF

!

!-----------------------------------------------------------------------------------------------------------------------

 

!-----------------------------------------------------------------------------------------------------------------------

!    DO ALL THE VERY FIRST CALL OF THE SIMULATION MANIPULATIONS HERE

      IF (INFO(7).EQ.-1) THEN

 

!       SET SOME INFO ARRAY VARIABLES TO TELL THE TRNSYS ENGINE HOW THIS TYPE IS TO WORK

         INFO(6)=NOUT

         INFO(9)=1

       INFO(10)=0            !STORAGE FOR VERSION 16 HAS BEEN CHANGED

      

 

!       SET THE REQUIRED NUMBER OF INPUTS, PARAMETERS AND DERIVATIVES THAT THE USER SHOULD SUPPLY IN THE INPUT FILE

!       IN SOME CASES, THE NUMBER OF VARIABLES MAY DEPEND ON THE VALUE OF PARAMETERS TO THIS MODEL....

         NIN=NI

         NPAR=NP

         NDER=ND

 

!       CALL THE TYPE CHECK SUBROUTINE TO COMPARE WHAT THIS COMPONENT REQUIRES TO WHAT IS SUPPLIED IN

!       THE TRNSYS INPUT FILE

       CALL TYPECK(1,INFO,NIN,NPAR,NDER)

 

!       SET THE NUMBER OF STORAGE SPOTS NEEDED FOR THIS COMPONENT

         NITEMS=0

!    CALL setStorageSize(NITEMS,INFO)

 

!       RETURN TO THE CALLING PROGRAM

         RETURN 1

 

      ENDIF

 

!-----------------------------------------------------------------------------------------------------------------------

 

!-----------------------------------------------------------------------------------------------------------------------

!    DO ALL OF THE INITIAL TIMESTEP MANIPULATIONS HERE - THERE ARE NO ITERATIONS AT THE INTIAL TIME

      IF (TIME .LT. (getSimulationStartTime() +

     1  getSimulationTimeStep()/2.D0)) THEN

 

!       SET THE UNIT NUMBER FOR FUTURE CALLS

         IUNIT=INFO(1)

         ITYPE=INFO(2)

 

!       CHECK THE PARAMETERS FOR PROBLEMS AND RETURN FROM THE SUBROUTINE IF AN ERROR IS FOUND

!         IF(...) CALL TYPECK(-4,INFO,0,"BAD PARAMETER #",0)

 

!       PERFORM ANY REQUIRED CALCULATIONS TO SET THE INITIAL VALUES OF THE OUTPUTS HERE

!                       M1signal

 

      OUT(1)=180

      OUT(2)=0

      OUT(3)=0

      OUT(4)=0

      OUT(5)=0

      OUT(6)=0

      OUT(7)=37

      OUT(8)=0

      OUT(9)=0

      OUT(10)=0

      OUT(11)=0

      OUT(12)=0

      OUT(13)=0

     

     

!       PERFORM ANY REQUIRED CALCULATIONS TO SET THE INITIAL STORAGE VARIABLES HERE

         NITEMS=0

!              STORED(1)=...

 

!       PUT THE STORED ARRAY IN THE GLOBAL STORED ARRAY

!         CALL setStorageVars(STORED,NITEMS,INFO)

 

!       RETURN TO THE CALLING PROGRAM

         RETURN 1

 

      ENDIF

 

!-----------------------------------------------------------------------------------------------------------------------

!    *** ITS AN ITERATIVE CALL TO THIS COMPONENT ***

!-----------------------------------------------------------------------------------------------------------------------

 

 

!-----------------------------------------------------------------------------------------------------------------------

!    RETRIEVE THE VALUES IN THE STORAGE ARRAY FOR THIS ITERATION

!      NITEMS=

! CALL getStorageVars(STORED,NITEMS,INFO)

!      STORED(1)=

!-----------------------------------------------------------------------------------------------------------------------

!-----------------------------------------------------------------------------------------------------------------------

!    CHECK THE INPUTS FOR PROBLEMS

!      IF(...) CALL TYPECK(-3,INFO,'BAD INPUT #',0,0)

! IF(IERROR.GT.0) RETURN 1

!-----------------------------------------------------------------------------------------------------------------------

!-----------------------------------------------------------------------------------------------------------------------

!    *** PERFORM ALL THE CALCULATION HERE FOR THIS MODEL. ***

!----------------------------------------------------------------------!-------------------------------------------------

 

 


Von: Matt Duffy [mailto:duffy@tess-inc.com]
Gesendet: Donnerstag, 29. April 2010 16:
49
An: Marius Müller
Betreff: Re: [TRNSYS-users] output number beyond the allocated outputs

 

Dear Marius,

I apologize if this is redundant and you have already tried this, but did you allocated the proper number of outputs to the OUT array. Consider the source code for Type3 as an example.

 


  
C    SET THE MAXIMUM NUMBER OF PARAMETERS(NP),INPUTS(NI),OUTPUTS(NOUT),AND DERIVATIVES(ND)
C    THAT MAY BE SUPPLIED FOR THIS TYPE
      PARAMETER (NPMAX=16,NI=3,NO=4,ND=0)

C    REQUIRED TRNSYS DIMENSIONS
      DIMENSION XIN(NI),OUT(NO),PAR(NPMAX),YCHECK(NI),OCHECK(NO)



Best regards,

Matt Duffy

----- Original Message -----
From: "Marius Müller" <m.mueller@solitem.de>
Sent: Thu, April 29, 2010 6:19
Subject: [TRNSYS-users] output number beyond the allocated outputs

Hello everyone,

I have a problem that trnsys delivers an error when I have too many outputs. Or something like that:

The listed input referenced an output number beyond the allocated outputs 
for the connected type.

 

The error was already mentioned by someone, but the answer is not working.

Maybe someone can help,

 

Thanks,

Marius

 

 

PS Here is what they wrote

 

Dear Olivier,
 
The problem is that the component is not setting the number of outputs 
in the INFO array.
The component runs fine if you add the line
INFO(6) = 3
after the ENDIF corresponding to the checking  for INFO(7) = -2.
My recommendation is that you update the component to a fully TRNSYS16 
component. Please follow the instructions in the manual 'Volume 
8-Programmer's guide'.
Best regards,
 
Diego
 
Olivier Guillemot wrote:
> for sure...
> thanks
> olivier
> keilholz, werner a écrit :
>> Dear Oliver,
>> I'm not sure what you attempt to do, but this error sounds as if you
>> declared more outputs in a type than the type actually handles.
>> Which type are you trying to use ?  Maybe you should show us the 
>> Proforma
>> you made ?
>> 
>> Werner
>> 
>> -----Message d'origine-----
>> De : [EMAIL PROTECTED]
>> [EMAIL PROTECTED] De la part de Olivier 
>> Guillemot
>> Envoyé : vendredi 7 juillet 2006 08:51
>> À : trnsys-users@engr.wisc.edu
>> Objet : [TRNSYS-users] Error message
>> 
>> Hi,
>> 
>> I tried to create a new proforma from a fortran code founded on 
>> http://sel.me.wisc.edu/trnsys but I have the following error : The 
>> listed input referenced an output number beyond the allocated outputs 
>> for the connected type.
>> 
>> Do you have any idea?
>> 
>> regards,

>> olivier

 


_______________________________________________
TRNSYS-users mailing list
TRNSYS-users@cae.wisc.edu
https://www-old.cae.wisc.edu/mailman/listinfo/trnsys-users