initbc.F [SRC] [CPP] [JOB] [SCAN]
TOOLS / INITBC / SRC



   1 | include(dom.inc)
   2 | 
   3 |       PROGRAM initbc
   4 | 
   5 | !       ================================================================!
   6 | !                                                                       !
   7 | !       initbc.F  : Creates boundary conditions for PRISSMA             !
   8 | !                                                                       !
   9 | !       author    : J. AMAYA (february 2008)                            !
  10 | !                                                                       !
  11 | !       ================================================================!
  12 | 
  13 |         IMPLICIT NONE
  14 | 
  15 |         include 'dom_constants.h'
  16 | 
  17 |         DOM_INT      :: ntcells, ntnodes, ntfaces, ntfacesmax
  18 |         DOM_INT      :: i, j, k, icell, patch, cellnfaces, nbfaces
  19 | 
  20 |         DOM_REAL     :: r, d
  21 |         DOM_REAL     :: emissivity, T
  22 | 
  23 |         CHARACTER*80 :: clpropfile, cefacefile, emisfile
  24 |         CHARACTER*80 :: gdatafile, path, cldatfile, clfacfile
  25 | 
  26 |         DOM_REAL     :: x, y, z
  27 |         DOM_REAL     :: L_ref, R_ref, x_ref, y_ref, z_ref
  28 | 
  29 |         DOM_REAL, ALLOCATABLE, DIMENSION(:,:) :: xfc, yfc, zfc
  30 |         DOM_REAL, ALLOCATABLE, DIMENSION(:,:) :: Tw, newepsil
  31 |         DOM_INT , ALLOCATABLE, DIMENSION(:,:) :: facepatch
  32 | 
  33 | !       ------------------!
  34 | !       Read choices file !
  35 | !       ------------------!
  36 | 
  37 |         OPEN (FILE_CHCS , FILE='initbc.choices', FORM='FORMATTED')
  38 |         READ (FILE_CHCS,*) path
  39 |         CLOSE(FILE_CHCS)
  40 | 
  41 | !       -----------!
  42 | !       Open files !
  43 | !       -----------!
  44 | 
  45 |         clpropfile = path(1:len_trim(path))//'/CLProperties.in'
  46 |         emisfile   = path(1:len_trim(path))//'/Emissivities.in'
  47 |         cefacefile = path(1:len_trim(path))//'/Centerfaces.in'
  48 |         gdatafile  = path(1:len_trim(path))//'/Global.in'
  49 |         cldatfile  = path(1:len_trim(path))//'/CLdata.in'
  50 |         clfacfile  = path(1:len_trim(path))//'/CLFaces.in' 
  51 | 
  52 |         OPEN(FILE_CLPRO, FILE=clpropfile, FORM='UNFORMATTED')
  53 |         OPEN(FILE_CFACE, FILE=cefacefile, FORM='UNFORMATTED')
  54 |         OPEN(FILE_GDATA, FILE=gdatafile , FORM='UNFORMATTED')
  55 |         OPEN(FILE_CLFAC, FILE=clfacfile , FORM='UNFORMATTED')
  56 | !       OPEN(FILE_EMIS , FILE=emisfile  , FORM='UNFORMATTED')
  57 | 
  58 | !       ----------------------!
  59 | !       Read Global mesh data !
  60 | !       ----------------------!
  61 | 
  62 |         WRITE(*,*) " Reading Global data."
  63 | 
  64 |         READ(FILE_GDATA) ntcells, ntnodes, ntfaces, ntfacesmax
  65 |         CLOSE(FILE_GDATA)
  66 |  
  67 | !       -----------------!
  68 | !       Allocate vectors !
  69 | !       -----------------!
  70 | 
  71 |         ALLOCATE(xfc      (ntfacesmax,ntcells))
  72 |         ALLOCATE(yfc      (ntfacesmax,ntcells))
  73 |         ALLOCATE(zfc      (ntfacesmax,ntcells))
  74 |         ALLOCATE(Tw       (ntfacesmax,ntcells))
  75 |         ALLOCATE(newepsil (ntfacesmax,ntcells))
  76 |         ALLOCATE(facepatch(ntfacesmax,ntcells))
  77 | 
  78 | !       ---------------------------!
  79 | !       Read properties from files !
  80 | !       ---------------------------!
  81 | 
  82 |         WRITE(*,*) " Reading Boundary data"
  83 | 
  84 |         DO j=1, ntcells
  85 | 
  86 |           READ(FILE_CFACE) icell, cellnfaces,                           &
  87 |      &                     (xfc(i,j), yfc(i,j), zfc(i,j),i=1,cellnfaces)
  88 |           READ(FILE_CLPRO) icell, cellnfaces,                           &
  89 |      &                     (Tw(i,j), facepatch(i,j), i=1, cellnfaces)
  90 | !         READ(FILE_EMIS)  icell, cellnfaces,(epsil(i,j),i=1,cellnfaces)
  91 | !         print*, " cell: ",j,"/",ntcells,":",epsil(:,j)
  92 | 
  93 |         ENDDO
  94 | 
  95 | !       --------------------!
  96 | !       Set boundary values !
  97 | !       --------------------!
  98 | 
  99 |         WRITE(*,*) " Writing the new boundary conditions"
 100 | 
 101 |         CLOSE(FILE_CLPRO)
 102 | !       CLOSE(FILE_EMIS )
 103 |         CLOSE(FILE_CFACE)
 104 | 
 105 |         newepsil = -1.
 106 |         Tw       = 0.
 107 | 
 108 |         OPEN(FILE_CLPRO, FILE=clpropfile, FORM='UNFORMATTED')
 109 |         OPEN(FILE_CFACE, FILE=cefacefile, FORM='UNFORMATTED')
 110 |         OPEN(FILE_EMIS , FILE=emisfile  , FORM='UNFORMATTED')
 111 |         OPEN(FILE_CLDAT, FILE=cldatfile , FORM='UNFORMATTED')
 112 | 
 113 |         nbfaces = 0
 114 | 
 115 |         DO j=1, ntcells
 116 | 
 117 |           READ(FILE_CFACE) icell, cellnfaces
 118 | 
 119 |           DO i=1, cellnfaces
 120 | 
 121 |             patch = facepatch(i,j)
 122 | 
 123 |             IF (patch.ne.0) THEN
 124 | 
 125 | !             --------------------------!
 126 | !             by default emessivity = 1 !
 127 | !             --------------------------!
 128 |               newepsil(i,j) = 1.
 129 | 
 130 |               x = xfc(i,j)
 131 |               y = yfc(i,j)
 132 |               z = zfc(i,j)
 133 | 
 134 |               include 'clperso.inc'
 135 | 
 136 |               newepsil(i,j) = emissivity
 137 |               Tw(i,j)    = T
 138 | 
 139 |               WRITE(FILE_CLDAT) j, i, emissivity, T
 140 |               nbfaces = nbfaces + 1
 141 |             ENDIF
 142 | 
 143 |           ENDDO
 144 | 
 145 | !         -------------------------!
 146 | !         Write new values to file !
 147 | !         -------------------------!
 148 | 
 149 |           WRITE(FILE_CLPRO) icell, cellnfaces,                          &
 150 |      &                      (Tw(i,j), facepatch(i,j), i=1, cellnfaces)
 151 | !         print*, " cell: ",j,"/",ntcells,":",newepsil(:,j)
 152 |           WRITE(FILE_EMIS) icell, cellnfaces,                           &
 153 |      &                     (newepsil(i,j),i=1,cellnfaces)
 154 | 
 155 |         ENDDO
 156 | 
 157 |         OPEN(FILE_CLFAC, FILE=clfacfile , FORM='UNFORMATTED')
 158 |         WRITE(FILE_CLFAC) nbfaces
 159 |         CLOSE(FILE_CLFAC)
 160 |  
 161 |         CLOSE(FILE_CLPRO)
 162 |         CLOSE(FILE_CFACE)
 163 |         CLOSE(FILE_CLDAT)
 164 | 
 165 | 
 166 |         WRITE(*,*) " initbc: Succesful run!"
 167 | 
 168 |       END PROGRAM initbc


initbc.F could be called by:
initbc.F [TOOLS/INITBC/SRC] - 3 - 166
initbc [TOOLS/SCRIPTS] - 37 - 38 - 39 - 49
Makefile [TOOLS/INITBC] - 46 - 51 - 57 - 89