72 INTEGER,
PARAMETER :: nstrkeys_max = 5
73 INTEGER,
PARAMETER :: nkeys_max = 20
74 LOGICAL :: strdefined(nstrkeys_max),defined(nkeys_max)
75 CHARACTER(20) :: strkeys(nstrkeys_max),keys(nkeys_max)
76 CHARACTER(256) ::
line
77 CHARACTER(CHRLEN) :: rcsidentstring,strvals(nstrkeys_max)
78 CHARACTER(CHRLEN) :: fname
79 INTEGER :: errorflag,nmat,ikeymolw,ikeydens,ikeyspht,ikeysurftens, &
80 ikeytboil,ikeytmelt,imat,ipass,istrkeyname,istrkeyphase, &
82 REAL(RFREAL) :: vals(nkeys_max)
89 rcsidentstring =
'$RCSfile: INRT_ReadMaterialInput.F90,v $ $Revision: 1.5 $'
92 'INRT_ReadMaterialInput.F90' )
102 IF ( nstrkeys > nstrkeys_max )
THEN
103 CALL
errorstop(global,err_exceeds_decl_mem,__line__)
106 strkeys(istrkeyname) =
'NAME'
107 strkeys(istrkeyphase) =
'PHASE'
121 IF ( nkeys > nkeys_max )
THEN
122 CALL
errorstop(global,err_exceeds_decl_mem,__line__)
125 keys(ikeymolw) =
'MOLW'
126 keys(ikeydens) =
'DENS'
127 keys(ikeyspht) =
'SPHT'
128 keys(ikeysurftens) =
'SURFTENS'
129 keys(ikeytboil) =
'TBOIL'
130 keys(ikeytmelt) =
'TMELT'
144 OPEN(if_input,file=trim(fname),
form=
'FORMATTED',
status=
'OLD', &
146 global%error = errorflag
147 IF ( global%error /= err_none )
THEN
148 CALL
errorstop(global,err_file_open,__line__,
'File: '//trim(fname))
155 SELECT CASE ( ipass )
165 READ(if_input,
'(A256)',err=10,
end=86)
line
166 IF ( trim(
line) ==
'# MATERIAL' )
THEN
174 ALLOCATE(global%materials(nmat),stat=errorflag)
175 global%error = errorflag
176 IF ( global%error /= err_none )
THEN
177 CALL
errorstop(global,err_allocate,__line__)
180 nullify(global%materials)
183 global%nMaterials = nmat
193 READ(if_input,
'(A256)',err=10,
end=87)
line
195 IF ( trim(
line) ==
'# MATERIAL' )
THEN
197 material => global%materials(imat)
201 material%molw = -1.0_rfreal
202 material%dens = -1.0_rfreal
203 material%spht = -1.0_rfreal
204 material%surftens = -1.0_rfreal
205 material%Tboil = -1.0_rfreal
206 material%Tmelt = -1.0_rfreal
212 strkeys,vals,strvals,defined,strdefined)
216 IF ( strdefined(istrkeyname) .EQV. .true. )
THEN
217 material%name = trim(strvals(istrkeyname))
219 CALL
errorstop(global,err_val_undefined,__line__)
224 IF ( strdefined(istrkeyphase) .EQV. .true. )
THEN
225 SELECT CASE ( strvals(istrkeyphase)(1:1) )
233 CALL
errorstop(global,err_reached_default,__line__)
239 material%index = imat
243 IF ( defined(ikeymolw) .EQV. .true. )
THEN
244 material%molw = vals(ikeymolw)
246 CALL
errorstop(global,err_val_undefined,__line__,
'MOLW')
249 IF ( defined(ikeydens) .EQV. .true. )
THEN
250 material%dens = vals(ikeydens)
252 IF ( material%phase /= 1 )
THEN
253 CALL
errorstop(global,err_val_undefined,__line__,
'DENS')
257 IF ( defined(ikeyspht) .EQV. .true. )
THEN
258 material%spht = vals(ikeyspht)
260 CALL
errorstop(global,err_val_undefined,__line__,
'SPHT')
263 IF ( defined(ikeysurftens) .EQV. .true. )
THEN
264 material%surftens = vals(ikeysurftens)
267 IF ( defined(ikeytboil) .EQV. .true. )
THEN
268 material%Tboil = vals(ikeytboil)
271 IF ( defined(ikeytmelt) .EQV. .true. )
THEN
272 material%Tmelt = vals(ikeytmelt)
284 CALL
errorstop(global,err_reached_default,__line__)
291 CLOSE(if_input,iostat=errorflag)
292 global%error = errorflag
293 IF ( global%error /= err_none )
THEN
294 CALL
errorstop(global,err_file_close,__line__,
'File: '//trim(fname))
307 CALL
errorstop(global,err_file_read,__line__,
'File: '//trim(fname))
subroutine readbothsection(global, fileID, nvals, nStrVals, keys, strKeys, vals, strVals, defined, strDefined)
CImg< T > & line(const unsigned int y0)
Get a line.
subroutine registerfunction(global, funName, fileName)
int status() const
Obtain the status of the attribute.
subroutine buildfilenameplain(global, dest, ext, fileName)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE form
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine deregisterfunction(global)