67 TYPE(t_region
),
DIMENSION(:),
POINTER :: regions
73 CHARACTER(CHRLEN) :: ifilename,rcsidentstring
74 CHARACTER(256) ::
line
75 INTEGER :: errorflag,ipass,ireg,ispec,ispectype,nspecies
76 LOGICAL :: usedsomewhere,unusedsomewhere
83 rcsidentstring =
'$RCSfile: SPEC_ReadInputFile.F90,v $ $Revision: 1.6 $'
85 global => regions(1)%global
88 'SPEC_ReadInputFile.F90')
104 outer:
DO ipass = 1,2
111 OPEN(if_input,file=ifilename,
form=
'FORMATTED',
status=
'UNKNOWN', &
113 global%error = errorflag
114 IF ( global%error /= 0 )
THEN
115 CALL
errorstop(global,err_file_open,__line__,
'File: '//trim(ifilename))
123 READ(if_input,
'(A256)',iostat=errorflag)
line
125 IF ( errorflag > 0 )
THEN
126 CALL
errorstop(global,err_file_read,__line__,
'File: '//trim(ifilename))
127 ELSE IF ( errorflag < 0 )
THEN
133 IF ( ipass == 1 )
THEN
134 SELECT CASE( trim(
line) )
141 ELSE IF ( ipass == 2 )
THEN
142 SELECT CASE( trim(
line) )
143 CASE (
'# SPECIES_TYPE' )
144 ispectype = ispectype + 1
151 CALL
errorstop(global,err_reached_default,__line__)
159 IF ( ipass == 1 )
THEN
160 DO ireg = lbound(regions,1),ubound(regions,1)
161 nspecies = regions(ireg)%specInput%nSpecies
163 IF ( nspecies > 0 )
THEN
164 ALLOCATE(regions(ireg)%specInput%specType(nspecies),stat=errorflag)
165 global%error = errorflag
166 IF ( global%error /= err_none )
THEN
167 CALL
errorstop(global,err_allocate,__line__, &
168 'regions%specInput%specType')
171 DO ispec = 1,nspecies
175 nullify(regions(ireg)%specInput%specType)
184 IF ( ipass == 2 )
THEN
186 usedsomewhere = .false.
187 unusedsomewhere = .false.
189 DO ireg = lbound(regions,1),ubound(regions,1)
190 nspecies = regions(ireg)%specInput%nSpecies
191 IF ( regions(ireg)%specInput%usedFlag )
THEN
193 IF ( ispectype /= nspecies )
THEN
194 CALL
errorstop(global,err_spec_ntypes,__line__)
196 IF ( nspecies == 0 ) regions(ireg)%specInput%usedFlag = .false.
199 IF ( nspecies /= 0 )
THEN
200 CALL
errorstop(global,err_spec_ntypes,__line__)
204 usedsomewhere = usedsomewhere .OR. &
205 regions(ireg)%specInput%usedFlag
206 unusedsomewhere = unusedsomewhere .OR. &
207 .NOT. regions(ireg)%specInput%usedFlag
210 IF (usedsomewhere.AND.unusedsomewhere)
THEN
211 CALL
errorstop( global,err_mp_allornone,__line__ )
214 global%specUsed = usedsomewhere
222 CLOSE(if_input,iostat=errorflag)
223 global%error = errorflag
224 IF ( global%error /= 0 )
THEN
225 CALL
errorstop(global,err_file_close,__line__,
'File: '//trim(ifilename))
CImg< T > & line(const unsigned int y0)
Get a line.
subroutine spec_readspectypesection(regions, iSpecType)
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 spec_readspecsection(regions)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine deregisterfunction(global)