SUBROUTINE UTDAT290
!use consts
use global
implicit none  
 
integer :: iz,i,nperc
save

WRITE(LUW_DST,19)
19 FORMAT(1H1,18X,49(1H*),/, &
 18X,' *****              PdM - DST                *****',/, &
 18X,' *****         Duct Storage Model            *****',/, &
 18X,' *****     modified version of LUND-DST      *****',/, &
 18X,' *****     Dr.Ing. Livio MAZZARELLA          *****',/, &
 18X,' *****      Dipartimento di Energetica       *****',/, &
 18X,' *****     Politecnico di Milano - ITALY     *****',/, &
 18X,' *****   Dr. D. PAHUD and Dr. G. HELLSTR™M   *****',/, &
 18X,' *****     LUND INSTITUTE OF TECHNOLOGY      *****',/, &
 18X,' *****    Box 118, S-221 00 LUND - SWEDEN    *****',/, &
 18X,' *****        Version: JANUARY  1996         *****',/, &
 18X,' *****           Dr. D. PAHUD                *****',/, &
 18X,' ***** Laboratory of Energy Systems (LASEN)  *****',/, &
 18X,' ***** Swiss Federal Institute of Technology *****',/, &   
 18X,' *****                EPFL                   *****',/, &   
 18X,' *****   CH - 1015 LAUSANNE - SWITZERLAND    *****',/, &
 18X,' *****        Version: OCTOBER 1996          *****',/, &
 19X,49(1H*),//)
IF (NLAYST == 1) THEN
WRITE(LUW_DST,10) VOLUME,DEEP-DEPTH,DEPTH,RBORE,R0,RLAMR(1), &
                 CR(1),CR(1)*(1.-R0*R0/(R1*R1))
ELSE
WRITE(LUW_DST,400) VOLUME,DEEP-DEPTH,DEPTH,RBORE,R0,CAPSTO, &
                 CAPSTO*(1.-R0*R0/(R1*R1))
DO 410 IZ=1,NLAYST
  WRITE(LUW_DST,401) IZ,THLST(IZ),RLAMR(IZ),CR(IZ)
410   CONTINUE
ENDIF
IF((NPIPES == 0).AND.(LURRB < 0)) THEN
WRITE(LUW_DST,12) RMPIPE
ELSE
IF((NPIPES < 11).AND.(NPIPES > 0)) THEN
WRITE(LUW_DST,13) NPIPES,Rpo,Rpi,DPIPES,Lb,Lpipe,Lgap,Gap,Rful0, &
             Vref,Tref,Reynol ,Tflg,Pflg,RMPIPE
ELSE IF (NPIPES == 11) THEN
WRITE(LUW_DST,113) Rpo,Rpi,DPIPES,Rb,Lb,Lpipe,Lgap,Gap,Rful0, &
             Vref,Tref,Reynol ,Tflg,RMPIPE
ENDIF
ENDIF
IF (IRAFLG == 1) THEN
  WRITE(LUW_DST,*) ' Ra EFFECTS CALCULATED'
  IF (IRAMET == 1) THEN
      WRITE(LUW_DST,*) ' Ra calculated for a U-pipe ', &
        'installation.'
    ELSE
      WRITE(LUW_DST,*) ' Ra calculated for a COAXIAL pipe ', &
        'installation.'
    ENDIF
  IF (LURRB <= 0) THEN
      WRITE(LUW_DST,121) RAPIPE
    ENDIF
ELSE
  WRITE(LUW_DST,*) ' Ra EFFECTS NOT CALCULATED'
ENDIF
IF (LURRB > 0) THEN
  WRITE(LUW_DST,*) ' Flow- and temperature-dependent borehole ', &
    'thermal resistance from file'
ENDIF

WRITE(LUW_DST,14) CW,ROW,ISO,FRISO,THISO,RISLAM,TIMO3/31536000., &
TSTMAX,TSTARG,TGRAD,IPRE,TCMAX,TCMIN,TCPH,TAIRM,ATAIR,TAPH,ILAY
10 FORMAT(' ***DST*** INPUT DATA FOR LUND-DST MODEL',/, &
 ' STORAGE VOLUME ',G11.4,1X,'(m3)',/, &
! ' LENGTH OF EACH BOREHOLE',G11.4,1X,'(m)',/,
 ' DEPTH TO UPPER SURFACE OF STORAGE VOLUME ',G11.4,1X,'(m)',/, &
 ' NUMBER OF BOREHOLES ',G11.4,/, &
 ' BOREHOLE RADIUS ',G11.4,1X,'(m)',/, &
 ' THERMAL CONDUCTIVITY IN STORAGE VOLUME ',G11.4,1X,'(W/mK)',/,  &
 ' VOLUMETRIC HEAT CAPACITY OF GROUND IN STORAGE VOLUME ',G11.4, &
 1X,'(J/m3K)',/, &
 ' EFFECTIVE VOLUMETRIC HEAT CAPACITY IN STORAGE VOLUME ',G11.4, &   
 1X,'(J/m3K)',/,' (THE VOLUME TAKEN BY THE "GHE" HAS NO HEAT', &
 ' CAPACITY IN THE MODEL)')     
400 FORMAT(' ***DST*** INPUT DATA FOR LUND-DST MODEL',/, &
 ' STORAGE VOLUME ',G11.4,1X,'(m3)',/, &
! ' LENGTH OF EACH BOREHOLE',G11.4,1X,'(m)',/,
 ' DEPTH TO UPPER SURFACE OF STORAGE VOLUME ',G11.4,1X,'(m)',/, &
 ' NUMBER OF BOREHOLES ',G11.4,/, &
 ' BOREHOLE RADIUS ',G11.4,1X,'(m)',/,  &
 ' MEAN GROUND VOLUMETRIC HEAT CAPACITY IN STORAGE VOLUME ',G11.4, &
 1X,'(J/m3K)',/, &
 ' EFFECTIVE MEAN VOLUMETRIC HEAT CAP. IN STORAGE VOLUME  ',G11.4, &   
 1X,'(J/m3K)',/,' (THE VOLUME TAKEN BY THE "GHE" HAS NO HEAT', & 
 ' CAPACITY IN THE MODEL)')
401 FORMAT(' LAYER NUMBER ',I3,1X,'IN THE STORAGE VOLUME',/, &
! '   THICKNESS OF GROUND LAYER ',G11.4,1X,'(m)',/,
 '   THERMAL CONDUCTIVITY OF GROUND LAYER ',G11.4,1X,'(W/mK)',/, &
 '   VOLUMETRIC HEAT CAPACITY OF GROUND LAYER ',G11.4,1X, &
 '(J/m3K)')
12 FORMAT(' THERMAL RESISTANCE PIPE-SOIL',G11.4,1X,'(mK/W)')
121 FORMAT(' THERMAL RESISTANCE RA BETWEEN UPWARD AND DOWNWARD',/, &
 ' FLUID ',G11.4,1X,'(mK/W)')
13 FORMAT( &
 ' NUMBER OF U PIPES ',I2,1X,'(-)',/, &
 ' PIPE OUTER RADIUS ',G11.4,1X,'(m)',/, &
 ' PIPE INNER RADIUS ',G11.4,1X,'(m)',/, &
 ' PIPES AXES-TO-AXES HALF DISTANCE ',G11.4,1X,'(m)',/, &
 ' BOREHOLE FILLING MATERIAL THERMAL CONDUCTIVITY ',G11.4,1X, &
 '(W/mK)',/, &
 ' PIPE WALL THERMAL CONDUCTIVITY ',G11.4,1X,'(W/mK)',/, &
 ' AIR GAP THERMAL CONDUCTIVITY ',G11.4,1X,'(W/mK)',/, &
 ' AIR GAP THICKNESS ',G11.4,1X,'(m)',/, &
 ' FOULING THERMAL RESISTANCE ',G11.4,1X,'(m2K/W)',/, &
 ' REFERENCE VOLUMETRIC FLOW RATE ',G11.4,1X,'(m3/s)',/, &
 ' REFERENCE FLUID TEMPERATURE ',G11.4,1X,'(øC)',/, &
 ' CORRESPONDING REYNOLD NUMBER IN PIPE ',G11.4,1X,'(-)',/, &
 ' CONSTANT TEMPERATURE (0)/ FLUX (1) ',I2,1X,/, &
 ' EMISIMMETRIC (0)/ SIMMETRIC (1) ',I2,1X,/, &
 ' ==> THERMAL RESISTANCE PIPE-SOIL',G11.4,1X,'(mK/W)')
113 FORMAT( &
 ' INNER PIPE OUTER RADIUS ',G11.4,1X,'(m)',/, &
 ' INNER PIPE INNER RADIUS ',G11.4,1X,'(m)',/, &
 ' OUTER PIPE INNER RADIUS ',G11.4,1X,'(m)',/, &
 ' OUTER PIPE OUTER RADIUS ',G11.4,1X,'(m)',/, &
 ' BOREHOLE FILLING MATERIAL THERMAL CONDUCTIVITY ',G11.4,1X, &
 '(W/mK)',/, &
 ' PIPE WALL THERMAL CONDUCTIVITY ',G11.4,1X,'(W/mK)',/, &
 ' AIR GAP THERMAL CONDUCTIVITY ',G11.4,1X,'(W/mK)',/, &
 ' AIR GAP THICKNESS ',G11.4,1X,'(m)',/, &
 ' FOULING THERMAL RESISTANCE ',G11.4,1X,'(m2K/W)',/, &
 ' REFERENCE VOLUMETRIC FLOW RATE ',G11.4,1X,'(m3/s)',/, &
 ' REFERENCE FLUID TEMPERATURE ',G11.4,1X,'(øC)',/, &
 ' CORRESPONDING REYNOLD NUMBER IN ANNULUS ',G11.4,1X,'(-)',/, &
 ' CONSTANT TEMPERATURE (0)/ FLUX (1) ',I2,1X,/, &
 ' ==> THERMAL RESISTANCE PIPE-SOIL',G11.4,1X,'(mK/W)')

14 FORMAT( &
! ' VOLUMETRIC HEAT CAPACITY OF FLUID ',G11.4,1X,'(J/m3K)',/,
! ' FLUID MASS DENSITY ',G11.4,1X,'(kg/m3)',/,
 ' INSULATION: NO/SIDE COVER/HORIZONTAL OVERLAP ',I3,/, &
 ' INSULATION: OVERLAP/SIDE FRACTION OF HEIGHT ',G11.4,/, &
 ' INSULATION THICKNESS ',G11.4,1X,'(m)',/, &
 ' INSULATION THERMAL CONDUCTIVITY ',G11.4,1X,'(W/mK)',/, &
 ' MAX DURATION OF SIMULATION ',G11.4,1X,'(YEARS)',/, &
 ' MAX PERMITTED STORAGE TEMPERATURE ',G11.4,1X,'(øC)',/, &
 ' INITIAL GROUND SURFACE TEMPERATURE ',G11.4,1X,'(øC)',/, &
 ' TEMPERATURE GRADIENT IN THE GROUND ',G11.4,1X,'(øC/m)',/, &
 ' NUMBER OF PREHEATING CYCLES ',I3,1X,'(YEARS)',/, &
 ' MAX STORAGE TEMPERATURE DURING PREHEATING ',G11.4,1X,'(øC)',/, &
 ' MIN STORAGE TEMPERATURE DURING PREHEATING ',G11.4,1X,'(øC)',/, &
! ' PHASE DELAY FOR STORAGE TEMP.  (PREHEAT.) ',G11.4,1X,'(S)',/,
! ' ANNUAL AVERAGE AIR TEMPERATURE (PREHEAT.) ',G11.4,1X,'(øC)',/,
! ' ANNUAL AMPLITUDE AIR TEMPERAT. (PREHEAT.) ',G11.4,1X,'(øC)',/,
! ' PHASE DELAY FOR  AIR TEMPERAT. (PREHEAT.) ',G11.4,1X,'(S)',/,
 ' NUMBER OF LAYERS ',I3)
DO 15 I=1,ILAY
WRITE(LUW_DST,18) I,RLAML(I),CL(I),THL(I)
15 CONTINUE
18 FORMAT(' LAYER ',I2,/, &
 '   THERMAL CONDUCTIVITY ',G11.4,1X,'(W/mK)',/, &
 '   VOLUMETRIC HEAT CAPACITY ',G11.4,1X,'(J/m3K)',/, &
 '   THICKNESS ',G11.4,1X,'(m)')

WRITE(LUW_DST,20) NSERIE,NRLOC,NZLOC
20 FORMAT(/, &
 ' NUMBER OF BOREHOLES CONNECTED IN SERIES ',I2,1X,'(-)',/, &
 ' COMPUTATION OF THE LOCAL PROCESS:',/, &
 '   NUMBER OF RADIAL SOLUTIONS   ',I2,1X,'(-)',/, &
 '   NUMBER OF VERTICAL SOLUTIONS ',I2,1X,'(-)')
WRITE(LUW_DST,21)
21 FORMAT('   DEFINITION OF THE RADIAL SUBREGIONS:')
DO 22 I = 1,NRLOC
NPERC = NINT(100*(R(IRLOC(I+1))**2-R(IRLOC(I))**2)/RADIUS**2)
WRITE(LUW_DST,30) I,(IRLOC(I+1)-IRLOC(I)),NPERC
22 CONTINUE
30 FORMAT('     RADIAL   SUBREGION NUMBER ',I2,': ',I3, &
 ' RADIAL MESHES   OR ',I3,'% OF STORE SECTION')
WRITE(LUW_DST,31)
31 FORMAT('   DEFINITION OF THE VERTICAL SUBREGIONS:')
DO 32 I = 1,NZLOC
NPERC = NINT(100*(Z(JZLOC(I+1))-Z(JZLOC(I)))/HEIGHT)
WRITE(LUW_DST,40) I,(JZLOC(I+1)-JZLOC(I)),NPERC
32 CONTINUE
40 FORMAT('     VERTICAL SUBREGION NUMBER ',I2,': ',I3, &
 ' VERTICAL MESHES OR ',I3, &
 '% OF THE VERTICAL EXTENSION OF THE STORE')
IF (NLAYST > 1) THEN
DO 420 IZ=1,NLAYST
  WRITE(LUW_DST,421) NZLOCS(IZ),IZ,THLST(IZ)
420   CONTINUE
END IF
421 FORMAT('   THERE ARE ',I2,' SUBREGIONS IN THE STORAGE GROUND' &
' LAYER ',I2,'. LAYER THICKNESS IN STORE: ',G11.4,' m')

WRITE(LUW_DST,100)
100 FORMAT(/' ***CHS*** INPUT FIELDS FOR GLOBAL PROBLEM')
WRITE(LUW_DST,110)
110 FORMAT(/' INPUT TEMPERATURES  (DEG C)')
CALL PRDST390(T,IDIM,JDIM,IMAX1,JMAX1,RM,ZM,LUW_DST)

WRITE(LUW_DST,120)
120 FORMAT(/' HEAT CONDUCTIVITY  (W/(M*K))')
CALL PRDST390(RLAM,IDIM,JDIM,IMAX1,JMAX1,RM,ZM,LUW_DST)

WRITE(LUW_DST,125)
125 FORMAT(/' VOLUMETRIC HEAT CAPACITY  (J/(M3*K))')
CALL PRDST390(CIN,IDIM,JDIM,IMAX1,JMAX1,RM,ZM,LUW_DST)

WRITE(LUW_DST,130)
130 FORMAT(/' INSULATIONS IN R-DIRECTION  ((M2*K)/W)')
CALL PRDST390(RISOR,IDIM,JDIM,IMAX1,JMAX1,R,ZM,LUW_DST)

WRITE(LUW_DST,140)
140 FORMAT(/' INSULATIONS IN Z-DIRECTION  ((M2*K)/W)')
CALL PRDST390(RISOZ,IDIM,JDIM,IMAX1,JMAX1,RM,Z,LUW_DST)

WRITE(LUW_DST,150)
150 FORMAT(/' STORAGE VOLUME INDICATED BY A NON-ZERO VALUE')
CALL PRVOL90

WRITE(LUW_DST,180)
WRITE(LUW_DST,160)
160 FORMAT(/' ***CHS*** INPUT FIELDS FOR LOCAL PROBLEM')
CALL PRDST290

WRITE(LUW_DST,180)
180 FORMAT(1X,40(1H*))

RETURN
END subroutine utdat290