read_data.F [SRC] [CPP] [JOB] [SCAN]
SOURCES / INOUT



   1 | include(dom.inc)
   2 | 
   3 |       SUBROUTINE read_data
   4 | 
   5 | !       ================================================================!
   6 | !                                                                       !
   7 | !       read_data.F   : Reads all data from input files and allocates   !
   8 | !                       global vectors.                                 !
   9 | !                                                                       !
  10 | !       out           : Global vectors with initialized data obtained   !
  11 | !                       from *.in files.                                !
  12 | !                                                                       !
  13 | !       author        : J. AMAYA & D. Poitou                            !
  14 | !                                                                       !
  15 | !       ================================================================!
  16 | 
  17 |         USE mod_pmm
  18 |         USE mod_prissma
  19 |         USE mod_inout
  20 | 
  21 |         IMPLICIT NONE
  22 | 
  23 |         INCLUDE 'dom_constants.h'
  24 | 
  25 |         DOM_REAL     :: MEM, MEM2
  26 |         DOM_INT      :: ios
  27 |         CHARACTER*80 :: clfacefile,  gdatafile
  28 |         CHARACTER*80 :: trackfile, tabfile
  29 | 
  30 | !       -------------------!
  31 | !         Read input files !
  32 | !       -------------------!
  33 |         WRITE(*,*) " PRISSMA: Setting file names"
  34 | 
  35 |         clfacefile = path(1:len_trim(path))//'/CLFaces.in'
  36 |         gdatafile  = path(1:len_trim(path))//'/Global.in'
  37 |         trackfile  = path(1:len_trim(path))//'/Track.in'
  38 | 
  39 |         WRITE(*,*) " PRISSMA: Opening files"
  40 |         OPEN(FILE_GDATA, FILE=gdatafile , FORM='UNFORMATTED')
  41 |         OPEN(FILE_CLFAC, FILE=clfacefile, FORM='UNFORMATTED')
  42 |         OPEN(FILE_TRACK, FILE=trackfile , FORM='FORMATTED', IOSTAT =ios,&
  43 |      &       STATUS='old')
  44 | 
  45 | !       -----------------!
  46 | !       Read global data !
  47 | !       -----------------!
  48 | 
  49 |         READ(FILE_GDATA) i_dom_ncells, i_dom_nnodes,                    &
  50 |      &                   i_dom_nfaces, i_dom_nfacesmax, ndir
  51 | 
  52 |         nallbandes = 371
  53 | 
  54 |         READ(FILE_CLFAC) i_dom_nbfaces
  55 | 
  56 |         IF ((mediumtype.eq.'TFSCK').or.(mediumtype.eq.'TFSK')) THEN
  57 |           tabfile = pathspec(1:len_trim(pathspec))//'/table.dat'
  58 |           OPEN(FILE_TAB,FILE=tabfile,FORM='FORMATTED')
  59 |           READ(FILE_TAB,*) nkabs
  60 |           CLOSE(FILE_TAB)
  61 |         ELSEIF (mediumtype.eq.'GRAY') THEN
  62 |           nkabs = 1
  63 |         ELSEIF (mediumtype.eq.'WSGG') THEN
  64 |           nkabs = ngg
  65 |         ELSE
  66 |           nkabs = Nq_kabs
  67 |         ENDIF
  68 | 
  69 | !       ------------!
  70 | !       Read probes !
  71 | !       ------------!
  72 |         i_dom_nprobes = 0
  73 |         IF(ios.eq.0) THEN
  74 | 
  75 |          READ(FILE_TRACK,*) i_dom_nprobes
  76 |          PRINT*, "Trackfile found with :", i_dom_nprobes, "probes"
  77 | 
  78 |         ENDIF
  79 | 
  80 | 
  81 | !       ------------------!
  82 | !         Close all files !
  83 | !       ------------------!
  84 |         CLOSE(FILE_CLFAC)
  85 |         CLOSE(FILE_GDATA)
  86 |         CLOSE(FILE_TRACK)
  87 | 
  88 |         MEM  = Memtot * i_dom_ncells / 100000
  89 |         MEM2 = MEM*pmm_n_p
  90 | !$      MEM  = MEM / i_dom_nthread
  91 |         IF(i_dom_npart.eq.1) THEN
  92 |           PRINT*, " >> Approximative maximal memory usage : "
  93 |           IF(MEM.ge.1024) THEN
  94 |             PRINT*, " >> ",     MEM/1024,"Gb per slave"
  95 |             PRINT*, " >> ",     MEM2/1024,"Gb total memory"
  96 |           ELSE
  97 |             PRINT*, " >> ",     MEM, "Mb per slave"
  98 |             PRINT*, " >> ",     MEM2,"Mb total memory"
  99 |           ENDIF
 100 |         ENDIF
 101 | 
 102 |       END SUBROUTINE read_data