00001 subroutine processor
00002
00003 use global
00004 use model
00005 use myFunctions
00006
00007
00008 implicit none
00009
00010
00011 integer i
00012
00013 integer myP,myD
00014
00015 integer dummy,dummySkip
00016
00017 integer startIndex,endIndex
00018
00019
00020 integer realTimeIter
00021 integer physicsIter
00022 integer physicsGroup
00023 integer pseudoTimeIter
00024 integer domainIter
00025 integer domainGroup
00026
00027
00028 integer,pointer :: IM(:,:,:,:)
00029
00030
00031 real(8) ptNorm,ptNormPrev,ptNormIni
00032 real(8) serNormCurrent,serNormPrevious
00033
00034 real(8) dTauTest,dtauBackup
00035
00036
00037
00038
00039
00040
00041
00042
00043 allocate(mymodel%pVec(numberOfPhysics))
00044
00045
00046
00047
00048
00049 pVec=>mymodel%pVec
00050
00051
00052
00053
00054 do i=1,size(pVec)
00055 pVec(i)=i
00056 end do
00057
00058 myModel%endIndex=0
00059
00060
00061
00062
00063
00064
00065 do myP=1,size(pVec)
00066
00067 currentPhysics=pVec(myP)
00068
00069 myModel%endIndex(currentPhysics)=1
00070 myModel%physics(currentPhysics)%endIndex=0
00071
00072
00073 numberOfDomains=>mymodel%physics(currentPhysics)%numberOfdomains
00074
00075
00076 allocate(mymodel%physics(currentPhysics)%dVec(numberOfDomains))
00077
00078
00079
00080
00081 dVec=>mymodel%physics(currentPhysics)%dVec
00082
00083
00084 do i=1,size(dVec)
00085
00086 dVec(i)=i
00087
00088 myModel%physics(currentPhysics)%endIndex(i)=1
00089
00090
00091
00092 end do
00093
00094
00095
00096 end do
00097
00098
00099
00100
00101
00102 910 FORMAT((E18.10))
00103
00104 911 FORMAT((I6,1X,F20.12))
00105
00106
00107 if (readInitialGuess.eqv.yes) then
00108
00109 Open (4400,File='x.dat',Status='unknown')
00110
00111
00112
00113
00114 read(4400,910)yPTO
00115
00116 close(4400)
00117
00118 end if
00119
00120
00121
00122
00123 call currentSet
00124
00125
00126 myModel%physics(1)%physicalParameters(1)=myModel%physics(1)%physicalParametersFinal(1)
00127
00128 call continuation
00129
00130 call postprocessor
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147 y=yPTO
00148
00149
00150 Open (4402,File='normPT.dat',Status='unknown')
00151 Open (4404,File='dtau.dat',Status='unknown')
00152
00153 dt=0.0001d0
00154
00155 dtau=0.01d0
00156
00157
00158
00159 gssolver=off
00160
00161
00162
00163 tempy=yPTO
00164
00165
00166
00167
00168 yPTO=y
00169
00170 serNormCurrent=dsqrt(dot_product(discrete(0),discrete(0)))
00171
00172 yPTO=tempy
00173
00174 dummyskip=0
00175
00176 serNormPrevious=serNormCurrent
00177
00178
00179 call solverParameters
00180
00181
00182 ptNormPrev=1.d0
00183 ptNormIni=1.d0
00184
00185
00186 do i=1,maxPseudoTimeIter
00187
00188 print*,'==================i',i
00189 newtonsuccess=0
00190 call modelSolver
00191
00192
00193 yPTO=y-yPTO
00194 ptNorm=dsqrt(dot_product(yPTO,yPTO))
00195
00196 write(4402,911)i,ptNorm
00197 write(4404,911)i,dtau
00198
00199 print*,'pseudo time norm=',ptNorm
00200
00201 if (i.eq.1) ptNormIni=ptNorm
00202
00203 yPTO=y
00204
00205 serNormCurrent=dsqrt(dot_product(discrete(0),discrete(0)))
00206
00207
00208
00209
00210
00211
00212
00213 print*,'old dtau=',dtau
00214
00215
00216
00217
00218
00219
00220 ptNormPrev=ptNorm
00221
00222 print*,'new dtau=',dtau
00223
00224
00225
00226 if (ptNorm/ptNormIni.le.1e-5) then
00227
00228
00229 print*,'pt converged'
00230 exit
00231
00232 end if
00233
00234 serNormPrevious=serNormCurrent
00235
00236
00237 if (mod(i,10).eq.0) call postprocessor
00238
00239
00240
00241
00242 end do
00243
00244 close(4402)
00245 close(4404)
00246
00247
00248
00249
00250
00251
00252 Open (4400,File='x.dat',Status='unknown')
00253
00254
00255
00256 if (newtonSuccess.eq.1) WRITE(4400,910)y
00257
00258 close(4400)
00259
00260
00261 return
00262
00263
00264
00265
00266
00267
00268
00269 call currentSet
00270
00271
00272
00273 call DBGcheckFlag(0)
00274
00275
00276 call DBGsqIni(0)
00277
00278
00279 call DBGcheckBC(0)
00280
00281
00282 call DBGtestDiscrete(0,1)
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292 return
00293
00294
00295
00296
00297
00298
00299 do realTimeIter=1,maxRealTimeIter
00300
00301
00302
00303 do physicsIter=1,maxPhysicsIter
00304
00305
00306 do physicsGroup=1,maxPhysicsGroup
00307
00308 pVec=>myModel%pg(physicsGroup)%pVec
00309
00310
00311
00312 if (allocated(myModel%pVec)) deallocate(myModel%pVec)
00313
00314 allocate(myModel%pVec(size(pVec)))
00315
00316 pVec=>myModel%pVec
00317 pVec=myModel%pg(physicsGroup)%pVec
00318
00319
00320
00321
00322 do pseudoTimeIter=1,maxPseudoTimeIter
00323
00324
00325
00326
00327
00328 call physicsRule
00329
00330
00331
00332 do domainIter=1,maxDomainIter
00333
00334
00335 do domainGroup=1,maxDomainGroup
00336
00337
00338
00339
00340
00341 call modelSolver
00342
00343
00344
00345
00346 end do
00347
00348
00349
00350
00351
00352
00353 end do
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363 end do
00364
00365
00366
00367 end do
00368
00369
00370
00371
00372 end do
00373
00374
00375
00376
00377
00378 end do
00379
00380
00381
00382
00383
00384
00385
00386
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399 end subroutine processor