read_data.F [SRC] [CPP] [JOB] [SCAN]
SEQCODE / INOUTSOURCES/INOUT [=]



   1 | include(dom.inc)
   2 | 
   3 |        SUBROUTINE READ_DATA(mediumtype,datastatus,neighs,nfcelt,KCO,    &
   4 |      &           DCO,KC,DC,KH,DH,xc, yc, zc, V, k_scat, kabs_gray,S,    &
   5 |      &           epsil,xfc, yfc, zfc, Tf, norm,celldata,mu, eta, ksi, w,&
   6 |      &           critconv,alpha,ncells,I_SCHEME,ndir,nbounds,end_prog,  &
   7 |      &           all_WVNB, all_DWVNB, alpha_wsgg, k_wsgg,homosyst,      &
   8 |      &           nfacemax,pathway,maxlen,s_s,path,pathspec,outpath,     &
   9 |      &           ntbands)
  10 | 
  11 |        IMPLICIT NONE
  12 | 
  13 |        INCLUDE 'dom_constants.h'
  14 | 
  15 |        CHARACTER*15 :: mediumtype,datastatus
  16 |        CHARACTER*15 :: spascheme
  17 |        CHARACTER*3  :: homosyst
  18 |        CHARACTER*80 :: path
  19 |        CHARACTER*80 :: pathspec
  20 |        CHARACTER*80 :: outpath
  21 | 
  22 |        DOM_INT  :: ncells,nfacemax,ntbands
  23 |        DOM_INT  :: I_SCHEME, patch
  24 |        DOM_INT  :: ndir
  25 |        DOM_INT  :: nbounds
  26 |        DOM_INT  :: i, j, k, i2, icell
  27 |        DOM_INT  :: end_prog, n, i_bande, iquad, k_cell, k_coef
  28 |        DOM_REAL   :: critconv
  29 |        DOM_REAL   :: alpha
  30 | 
  31 |        DOM_REAL, DIMENSION(ndir) ::  mu, eta, ksi, w
  32 |        DOM_REAL, DIMENSION(ntbands) :: all_WVNB,all_DWVNB
  33 |        DOM_REAL, DIMENSION(ngg) :: k_wsgg
  34 |        DOM_REAL, DIMENSION(ngg,6) :: alpha_wsgg
  35 |        DOM_REAL, DIMENSION(14,ntbands) :: KCO,DCO,KC,DC,KH,DH
  36 | 
  37 |        DOM_INT, DIMENSION(ndir,ncells) :: pathway
  38 |        DOM_REAL, DIMENSION(ndir,ncells) ::  maxlen
  39 |        DOM_REAL, DIMENSION(ndir,ncells,nfacemax) :: s_s
  40 |        DOM_INT, DIMENSION(ncells,2*nfacemax) :: neighs
  41 |        DOM_INT, DIMENSION(ncells) :: nfcelt
  42 |        DOM_REAL, DIMENSION(ncells) :: xc, yc, zc, V, k_scat, kabs_gray
  43 |        DOM_REAL, DIMENSION(ncells,nfacemax) :: S, epsil, xfc, yfc, zfc, Tf
  44 |        DOM_REAL, DIMENSION(ncells,nfacemax,3) ::  norm
  45 |        DOM_REAL, DIMENSION(ncells,8) :: celldata
  46 | 
  47 |        CHARACTER*80 :: c2cfile, ccellsfile, cfacesfile
  48 |        CHARACTER*80 :: normfile, volafile, progfile
  49 |        CHARACTER*80 :: emisfile, kextfile, propfile
  50 |        CHARACTER*80 :: quadfile, clpropfile, clfacefile
  51 |        CHARACTER*80 :: lspecfile, sspecfile, snbwnfile, wsggfile
  52 | 
  53 |        end_prog=0
  54 | 
  55 |        !--------------------------!
  56 |        ! Lecture du fichier INPUT !
  57 |        !--------------------------!
  58 | 
  59 |        OPEN(UNIT=1,FILE='prissma.choices')
  60 | 
  61 |        READ(1,*) path
  62 |        READ(1,*) pathspec
  63 |        READ(1,*) outpath
  64 |        READ(1,*) datastatus
  65 |        READ(1,*) spascheme
  66 |        READ(1,*) mediumtype
  67 |        READ(1,*)
  68 |        READ(1,*) critconv
  69 |        READ(1,*) homosyst
  70 | 
  71 |        CLOSE(1)
  72 | 
  73 |        c2cfile    = path(1:len_trim(path))//'/Cell2cells.in'
  74 |        ccellsfile = path(1:len_trim(path))//'/Centercells.in'
  75 |        normfile   = path(1:len_trim(path))//'/Normals.in'
  76 |        volafile   = path(1:len_trim(path))//'/Volumesareas.in'
  77 |        emisfile   = path(1:len_trim(path))//'/Emissivities.in'
  78 |        kextfile   = path(1:len_trim(path))//'/K_Extinction.in'
  79 |        clpropfile = path(1:len_trim(path))//'/CLProperties.in'
  80 |        cfacesfile = path(1:len_trim(path))//'/Centerfaces.in'
  81 |        progfile   = path(1:len_trim(path))//'/Progress.in'
  82 |        propfile   = path(1:len_trim(path))//'/Properties.in'
  83 |        quadfile   = path(1:len_trim(path))//'/Quadrature.in'
  84 |        lspecfile  = path(1:len_trim(path))//'/L_SPEC.in'
  85 |        sspecfile  = path(1:len_trim(path))//'/S_SPEC.in'
  86 |        clfacefile = path(1:len_trim(path))//'/CLFaces.in'
  87 | 
  88 |        snbwnfile  = pathspec(1:len_trim(pathspec))//'/SNBWN'
  89 |        wsggfile   = pathspec(1:len_trim(pathspec))//                    &
  90 |      &              '/WSGG_Soufiani_Djavdan_H20_CO2'
  91 | 
  92 |        !----------------------------------------!
  93 |        ! CHOIX DU SCHEMA DE DERIVATION SPATIALE !
  94 |        !----------------------------------------!
  95 | 
  96 |        IF (spascheme==DMFS) THEN
  97 |           alpha=0.5
  98 |           I_SCHEME=1
  99 |        ELSE IF (spascheme==SMFS) THEN
 100 |           alpha=1.0
 101 |           I_SCHEME=1
 102 |        ELSE IF (spascheme==EXPON) THEN
 103 |           alpha=0.0
 104 |           I_SCHEME=2
 105 |        ELSE
 106 |           end_prog=1
 107 |        ENDIF
 108 | 
 109 |        !--------------------------------!
 110 |        ! Read quadrature data from file !
 111 |        !--------------------------------!
 112 | 
 113 |        OPEN(UNIT=5,FILE=quadfile,FORM='unformatted')
 114 | 
 115 |        DO i=1,ndir
 116 |           READ(5) mu(i),eta(i),ksi(i),w(i)
 117 |        ENDDO
 118 | 
 119 |        CLOSE(5)
 120 | 
 121 |        !----------------------------------------!
 122 |        ! CHOIX DU SCHEMA DE DERIVATION SPATIALE !
 123 |        !----------------------------------------!
 124 | 
 125 |        IF (spascheme==DMFS) THEN
 126 |           alpha=0.5
 127 |           I_SCHEME=1
 128 |        ELSE IF (spascheme==SMFS) THEN
 129 |           alpha=1.0
 130 |           I_SCHEME=1
 131 |        ELSE IF (spascheme==EXPON) THEN
 132 |           alpha=0.0
 133 |           I_SCHEME=2
 134 |        ELSE
 135 |           end_prog=1
 136 |        ENDIF
 137 | 
 138 |        !------------------!
 139 |        ! Read input files !
 140 |        !------------------!
 141 | 
 142 |        OPEN(UNIT=11,FILE=c2cfile,FORM='unformatted')
 143 |        OPEN(UNIT=12,FILE=cfacesfile,FORM='unformatted')
 144 |        OPEN(UNIT=20,FILE=ccellsfile,FORM='unformatted')
 145 |        OPEN(UNIT=22,FILE=emisfile,FORM='unformatted')
 146 |        OPEN(UNIT=24,FILE=kextfile,FORM='unformatted')
 147 |        OPEN(UNIT=25,FILE=propfile,FORM='unformatted')
 148 |        OPEN(UNIT=27,FILE=clpropfile,FORM='unformatted')
 149 |        OPEN(UNIT=28,FILE=clfacefile,FORM='unformatted')
 150 |        OPEN(UNIT=30,FILE=normfile,FORM='unformatted')
 151 |        OPEN(UNIT=40,FILE=volafile,FORM='unformatted')
 152 |        OPEN(UNIT=50,FILE=progfile,FORM='unformatted')
 153 | 
 154 | 
 155 |        DO i=1,ncells
 156 | 
 157 |           READ(11) icell,nfcelt(icell),(neighs(icell,j),                 &
 158 |      &         j=1,(2*nfcelt(icell)))
 159 | 
 160 |           READ(12) icell,nfcelt(icell),(xfc(icell,i2),yfc(icell,i2),     &
 161 |      &       zfc(icell,i2),i2=1,nfcelt(icell))
 162 | 
 163 |           READ(20) icell,xc(icell),yc(icell),zc(icell)
 164 | 
 165 |           READ(22) icell,nfcelt(icell),(epsil(icell,j),                  &
 166 |      &                                  j=1,nfcelt(icell))
 167 | 
 168 |           READ(24) icell,kabs_gray(icell),k_scat(icell)
 169 | 
 170 |           READ(25) icell, (celldata(icell,j),j=1,8)
 171 | 
 172 |           READ(27) icell,nfcelt(icell),(Tf(icell,j),patch,               &
 173 |      &                                  j=1,nfcelt(icell))
 174 | 
 175 |           READ(30) icell,nfcelt(icell),((norm(icell,j,k),k=1,3),         &
 176 |      &       j=1,nfcelt(icell))
 177 | 
 178 |           READ(40) icell,nfcelt(icell),V(icell),(S(icell,j),             &
 179 |      &       j=1,nfcelt(icell))
 180 | 
 181 |        ENDDO
 182 | 
 183 |        DO i=1, ndir
 184 |           READ(50) (pathway(i,n), n=1,ncells)
 185 |        ENDDO
 186 | 
 187 |        READ(28) nbounds
 188 | 
 189 |        !----------------------------------!
 190 |        ! Read spectral data for each band !
 191 |        !----------------------------------!
 192 | 
 193 |        IF (mediumtype.ne.'GRAY') THEN
 194 |           OPEN(UNIT=49,FILE=snbwnfile)
 195 |           i_bande=1
 196 |           DO WHILE (i_bande .le. ntbands)
 197 |              READ(49,*) all_WVNB(i_bande),all_DWVNB(i_bande)
 198 |              IF (all_WVNB(i_bande).LT.0.) THEN
 199 |                 i_bande=ntbands !arret de la boucle
 200 |              ENDIF
 201 |              i_bande=i_bande+1
 202 |           ENDDO
 203 |           CLOSE(49)
 204 |        ENDIF
 205 | 
 206 |        !-------------------------!
 207 |        ! Read data for WSGG case !
 208 |        !-------------------------!
 209 | 
 210 |        IF ( mediumtype.eq.'WSGG') THEN
 211 |          OPEN(UNIT=51,FILE=wsggfile)
 212 |          READ(51,*)
 213 |          DO i=1,ngg
 214 |            READ(51,*) k_wsgg(i),alpha_wsgg(i,1),alpha_wsgg(i,2),        &
 215 |      &                alpha_wsgg(i,3),alpha_wsgg(i,4),alpha_wsgg(i,5),  &
 216 |      &                alpha_wsgg(i,6)
 217 |          ENDDO
 218 |        ENDIF
 219 | 
 220 |        !--------------------------------------------!
 221 |        ! Read data for exponential band integration !
 222 |        !--------------------------------------------!
 223 |        IF (spascheme==EXPON) THEN
 224 | 
 225 |          OPEN(UNIT=240,FILE=lspecfile,FORM='unformatted')
 226 |          OPEN(UNIT=260,FILE=sspecfile,FORM='unformatted')
 227 | 
 228 |          s_s =0.
 229 |          DO iquad=1,ndir
 230 | 
 231 |            READ(240) (maxlen(iquad,k_cell), k_cell=1,ncells)
 232 |            READ(260) ((s_s(iquad,k_cell,k_coef),k_cell=1,ncells),       &
 233 |      &              k_coef=1,4)
 234 | 
 235 |          ENDDO
 236 | 
 237 |          CLOSE(240)
 238 |          CLOSE(260)
 239 | 
 240 |        ENDIF
 241 | 
 242 |        !-----------------!
 243 |        ! Close all files !
 244 |        !-----------------!
 245 | 
 246 |        CLOSE(11)
 247 |        CLOSE(12)
 248 |        CLOSE(20)
 249 |        CLOSE(21)
 250 |        CLOSE(22)
 251 |        CLOSE(24)
 252 |        CLOSE(25)
 253 |        CLOSE(27)
 254 |        CLOSE(28)
 255 |        CLOSE(30)
 256 |        CLOSE(40)
 257 |        CLOSE(50)
 258 | 
 259 |        !-----------------------------------!
 260 |        ! Read spectral properties of gases !
 261 |        !-----------------------------------!
 262 | 
 263 |        CALL PARAM(KCO,KC,KH,DCO,DC,DH,pathspec,ntbands)
 264 | 
 265 |        END SUBROUTINE READ_DATA