1 | include(dom.inc)
2 |
3 | PROGRAM solinit_avbp
4 |
5 | ! ==================================================================!
6 | ! !
7 | ! convertion.F : Convert PRISSMA's iniatial solution files !
8 | ! from avbp2prissma : ascii -> bin !
9 | ! !
10 | ! author : D. POITOU (april 2010) !
11 | ! !
12 | ! ==================================================================!
13 |
14 | IMPLICIT NONE
15 |
16 | include 'dom_constants.h'
17 |
18 | DOM_INT, PARAMETER :: FILE_KSCA2 = 210
19 | DOM_INT, PARAMETER :: FILE_PROP2 = 229
20 |
21 | CHARACTER*80 :: path
22 | CHARACTER*80 :: propfile,propfile2
23 | CHARACTER*80 :: kscafile,kscafile2
24 | CHARACTER*80 :: gdatafile
25 |
26 | DOM_INT :: ntcells, ntnodes, ntfaces,ntfacesmax,ndirs
27 | DOM_INT :: icell,i,j,k,l,m,convtype,nfaces,cellnodes
28 | DOM_INT :: fnnodes,nbfaces,datas
29 |
30 | DOM_REAL :: Th,Ph,Kh
31 | DOM_REAL :: xc,yc,zc,a,b,c
32 | DOM_REAL, DIMENSION(8) :: celldata
33 | DOM_REAL :: VOL,k_scat,kabs_gray
34 | DOM_REAL :: mu,eta,ksi,omega
35 | DOM_INT, DIMENSION(10) :: inode
36 |
37 | DOM_INT, ALLOCATABLE, DIMENSION(:,:) :: neighb
38 | DOM_REAL, ALLOCATABLE, DIMENSION(:) :: x,y,z,surf,epsil,tem
39 | DOM_INT, ALLOCATABLE, DIMENSION(:) :: iface,patch,prog
40 |
41 | ! ------------------!
42 | ! Read choices file !
43 | ! ------------------!
44 |
45 | OPEN (FILE_CHCS , FILE='avbp2prissma.choices', FORM='FORMATTED')
46 | READ (FILE_CHCS,*)
47 | READ (FILE_CHCS,*)
48 | READ (FILE_CHCS,*)
49 | READ (FILE_CHCS,*)
50 | READ (FILE_CHCS,*)
51 | READ (FILE_CHCS,*) path ! Path for infiles *.in
52 | CLOSE(FILE_CHCS)
53 |
54 | ! ---------------!
55 | ! Set file names !
56 | ! ---------------!
57 |
58 | gdatafile = path(1:len_trim(path))//'/Global.in'
59 | propfile = path(1:len_trim(path))//'/Properties.in'
60 | propfile2 = path(1:len_trim(path))//'/Properties.txt'
61 | kscafile = path(1:len_trim(path))//'/K_Extinction.in'
62 | kscafile2 = path(1:len_trim(path))//'/K_Extinction.txt'
63 |
64 | ! ------------------------------------!
65 | ! Open binary/ascii Global data files !
66 | ! ------------------------------------!
67 |
68 | OPEN(FILE_GDATA, FILE=gdatafile , FORM='UNFORMATTED')
69 |
70 | ! ------------------------!
71 | ! Open binary input files !
72 | ! ------------------------!
73 |
74 | OPEN(FILE_PROP, FILE=propfile, FORM='unformatted')
75 | OPEN(FILE_KSCA, FILE=kscafile, FORM='unformatted')
76 |
77 | ! ------------------------!
78 | ! Open ascii input files !
79 | ! ------------------------!
80 |
81 | OPEN(FILE_PROP2, FILE=propfile2, FORM='formatted')
82 | OPEN(FILE_KSCA2, FILE=kscafile2, FORM='formatted')
83 |
84 | ! ----------------------!
85 | ! Transform Global data !
86 | ! ----------------------!
87 |
88 | READ(FILE_GDATA) ntcells, ntnodes, ntfaces,ntfacesmax, ndirs
89 |
90 | CLOSE(FILE_GDATA)
91 |
92 | ! ----------------------!
93 | ! Transform output data !
94 | ! ----------------------!
95 |
96 |
97 | DO j=1,ntnodes
98 |
99 | READ(FILE_PROP2,*) i,(celldata(l),l=1,8)
100 | WRITE(FILE_PROP) i,(celldata(l),l=1,8)
101 |
102 | READ(FILE_KSCA2,*) i,kabs_gray,k_scat
103 | WRITE(FILE_KSCA) i,kabs_gray,k_scat
104 |
105 | ENDDO
106 |
107 | print*,'Conversion ascii2bin done!'
108 |
109 | ! ----------------!
110 | ! Close all files !
111 | ! ----------------!
112 | CLOSE(FILE_PROP)
113 | CLOSE(FILE_KSCA)
114 | CLOSE(FILE_PROP2)
115 | CLOSE(FILE_KSCA2)
116 |
117 | END PROGRAM solinit_avbp
solinit_avbp.F could be called by: