69 INTEGER,
INTENT(IN) :: moduletype,nvarscal
70 REAL(RFREAL),
DIMENSION(:,:),
INTENT(IN) :: cvscal
71 TYPE(t_region
),
POINTER :: pregion
77 CHARACTER(CHRLEN) :: rcsidentstring
78 INTEGER,
PARAMETER :: max_negative_locs = 10
79 INTEGER :: icg,ivarscal,nlocs
80 INTEGER :: loc(max_negative_locs,min_val:max_val)
82 TYPE(t_grid),
POINTER :: pgrid
88 rcsidentstring =
'$RCSfile: RFLU_ScalarCheckPositivity.F90,v $ $Revision: 1.4 $'
90 global => pregion%global
93 'RFLU_ScalarCheckPositivity.F90')
107 cellloop:
DO icg = 1,pgrid%nCells
108 varloop:
DO ivarscal = 1,nvarscal
109 IF ( cvscal(ivarscal,icg) < 0.0_rfreal )
THEN
112 IF ( nlocs == 1 )
THEN
113 WRITE(stdout,
'(A,1X,A)') solver_name, &
114 'Negative positive-definite variables detected!'
116 SELECT CASE ( moduletype )
118 WRITE(stdout,
'(A,3X,A)') solver_name,
'Module: Species.'
120 CALL
errorstop(global,err_reached_default,__line__)
123 IF ( global%flowType == flow_unsteady )
THEN
124 WRITE(stdout,
'(A,3X,A,1X,1PE12.5)') solver_name,
'Current time:', &
127 WRITE(stdout,
'(A,3X,A,1X,I6)') solver_name, &
128 'Current iteration number:', &
132 WRITE(stdout,
'(A,3X,A,1X,I5.5)') solver_name,
'Global region:', &
133 pregion%iRegionGlobal
143 IF ( nlocs <= max_negative_locs )
THEN
144 WRITE(stdout,
'(A,4X,I3,6(1X,E13.6))') solver_name,nlocs, &
145 cvscal(1:nvarscal,icg)
147 loc(nlocs,min_val:max_val) = icg
159 IF ( nlocs > 0 )
THEN
160 IF ( nlocs > max_negative_locs )
THEN
161 WRITE(stdout,
'(A,3X,A,1X,I3,1X,A,1X,I9,1X,A)') solver_name, &
162 'Only wrote the first',max_negative_locs,
'of',nlocs, &
163 'cells with negative positive-definite variables.'
165 locinfo_mode_silent,output_mode_anybody)
168 locinfo_mode_silent,output_mode_anybody)
171 CALL
errorstop(global,err_negative_posdef,__line__)
subroutine rflu_scalarcheckpositivity(pRegion, moduleType, nVarScal, cvScal)
subroutine registerfunction(global, funName, fileName)
subroutine rflu_printlocinfo(pRegion, locUnsorted, nLocUnsorted, locInfoMode, outputMode)
subroutine errorstop(global, errorCode, errorLine, addMessage)
subroutine deregisterfunction(global)