-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathchdatmod.f90
2637 lines (2545 loc) · 90.3 KB
/
chdatmod.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
! Copyright 2021, Christian Hafner
!
! This file is part of OpenMaXwell.
!
! OpenMaXwell is free software: you can redistribute it and/or modify
! it under the terms of the GNU General Public License as published by
! the Free Software Foundation, either version 3 of the License, or
! (at your option) any later version.
! OpenMaXwell is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
! You should have received a copy of the GNU General Public License
! along with OpenMaXwell. If not, see <http://www.gnu.org/licenses/>.
MODULE CHDAT
! Data of boundaries, domains, expansions
USE CHSPL
SAVE
Logical lInverseConn
! external optimizer
Integer(4) jOptP,iOptProc,nOptPar,iOptFile,nOptFit,iOptFit
Real(8) OptFit(100)
Logical lOptBin
! Demo version
Integer(4) maxXGrd,maxYGrd,maxZGrd,maxCol,maxPts,maxStr
! Formula interpreter
Integer(4), Parameter :: mUserForm=10
Integer(4) kUserForm,nUserForm,lUserForm(0:mUserForm),lUserFor
Real(8) cForm(0:8),pForm(0:11),vForm(-10:999),dFormu(mForA),xFormu(mForA)
Complex(8) cCForm(0:8),pCForm(0:11),vCForm(-10:999),cFormu(mForA),zFormu(mForA)
Logical lForWarn
Character(1151) sUserForm(0:mUserForm),sUserFor
Data LForWarn/.true./
! Graphics
Integer(4), Parameter :: mGraPoly=100
Integer(2) ixPoly(mGraPoly),iyPoly(mGraPoly)
Real(8) xPoly(mGraPoly),yPoly(mGraPoly)
Real(8) GRFtime,xMinBas,xMaxBas,xMinExt,xMaxExt
Integer(2) iColorCnt
Logical lLimits
Logical lGRF_Mark,lGRF_PolygonClosed
Character(128) OTitle,TTitle,XTitle,YTitle
Type(xycoord) Poly(mGraPoly)
Real(8) GRChmax,GRChmin,GRCcolorFMin,GRCcolorFMax
Integer(4) nGRC,nxGRC,nyGRC
Integer(2) iGRCLineEndStyle,iGRCxmin,iGRCxmax,iGRCymin,iGRCymax, &
& iGRCbackground,iGRCcolor,iGRCcolorB,iGRCcolorMin,iGRCcolorMax
Logical lGRCused,lGRCallocated,lGRCfill
Integer(2), Allocatable :: iGRCx(:,:),iGRCy(:,:),iGRCc(:,:)
Real(8), Allocatable :: GRCh(:,:)
! OpenGL
Real(8) CHGLxGridLineW,CHGLyGridLineW,CHGLzGridLineW,CHGLxAxisW,CHGLyAxisW,CHGLzAxisW, &
& CHGLxAxisL,CHGLyAxisL,CHGLzAxisL,CHGLVectorScale,CHGLVectorMaxLength,CHGLIsoMinF,CHGLIsoMaxF,CHGLIsoStepF, &
& CHGLExpLen,CHGLSurfaceMinF,CHGLSurfaceMaxF,CHGLSurfaceStepF,rCHGLMovie
Real(8) CHGLlookAt(3),CHGLlookFrom(3),CHGLViewAngle,CHGLViewAspect,CHGLViewNear,CHGLViewFar
Integer(2) iCHGLxGridColor,iCHGLyGridColor,iCHGLzGridColor,iCHGLxVectorColor,iCHGLyVectorColor, &
& iCHGLxAxisColor,iCHGLyAxisColor,iCHGLzAxisColor,iCHGLxVectorStep,iCHGLyVectorStep,iCHGLrColorMin,iCHGLrColorMax, &
& iCHGLwidth,iCHGLheight,iCHGLwidthCurrent,iCHGLheightCurrent
Integer(4) nCHGLlists,iCHGLMovie,nCHGLTube,kCHGLTube,mCHGLTube
Real(8), Allocatable:: CHGLTubeStart(:,:),CHGLTubeR(:),CHGLTubeD(:)
Integer(4), Allocatable:: iCHGLTubeR(:),iCHGLTubeD(:)
Integer(2), Allocatable:: iCHGLTubeColor(:,:)
Logical lCHGLlist(9),lCHGLdoubleSide,lDrawOGL,lOGLavi,lSaveOGLavi,lSaveOGLbmp
Character(20), Parameter :: CHOGLIdent=' CHOGL Version 1.1 '
Character(256) OGLFileName
! boundary data
type CBnd
Real(8) Val(2),Start,Length,sLength,fAmpl,Weight,Weight2
Integer(4) iEdgeOffset,nEdge,kEdge,iSplineOffset,nSpline,iMatOffset,nMat,nMatPts
Integer(2) iCol,iCond,iConn
Integer(2) iLDom,iRDom,iTypB,nBC
Logical lBC(10)
Character(1151) Formula
end type
type CBndEdg
Integer(2) iOrient
Real(8) x,y,r,xa,ya,xb,yb,xo,yo,d
end type
Character(20), Parameter :: CHBndIdent=' CHBND Version 3.0 '
Character(32) TransText(3)
Character(256) BndFileName,ConFileName,MatFileName,GeoFileName,MshFileName
Real(8) sBndPt(0:10000)
Real(8), Allocatable :: wBndPt(:),eBndPt(:),fBndPt(:), &
& eBndPt3D(:),fBndPt3D(:),BndPt3D(:,:,:),BndPt3DF(:),BndPt3DV(:,:),rpGMSH(:,:)
Real(8), Allocatable :: sSpline(:),xSpline(:),ySpline(:),xsSpline(:),ysSpline(:)
Real(8), Allocatable :: sSpl(:),xSpl(:),ySpl(:),xsSpl(:),ysSpl(:)
Integer(2), Allocatable :: iBndPt(:),jBndPt(:),iBndPt3D(:),iObjBndPt3D(:),iEquBndPt3D(:)
Real(8) BndLtot,BndDMax,BndPpW,BndOver,trans(3),errorM,errorMA,errorA,AerrorM,AerrorA,ErrorScale,Condition,vBndNorm(3), &
& vErrStat(6),smallMatDist
Integer(4) kBnd,nBnd,mBnd,kBndEdg,nBndEdg,mBndEdg,kBndSpl,nBndSpl,mBndSpl,kVal,iGetData,nBndEq,nBndEq3D, &
& kBndPt,nBndPt,mBndPt,mBndPtAlloc,nBndPt3D,mBndPt3D,mBndPt3DAlloc,nSegPt,iDraBnd,iFunWeight,nInhBndPt3D,nInhEqu3D, &
& iGMSHbnd1,iGMSHbnd2,iGMSHDom,iGMSHCol
Integer(2) iMMPCon,iDomBnd,iColBnd,iConBnd,iBound,iWhatiBndPt3D
Integer(1), allocatable:: ieGMSH(:),ipGMSH(:)
Logical lInsertBnd,lAskBnd,lCloseNow,lMoveInsert,lTrans,lGet3DMat,lSmoothMat
Type(CBnd), Allocatable :: tBnd(:),tBndAux(:)
Type(CBndEdg), Allocatable :: tBndEdg(:),tBndEdgAux(:)
! domain data
Character(20), Parameter :: CHDomIdent=' CHDOM Version 2.0 '
Character(20), Parameter :: CHProIdent=' CHPRO Version 3.1 '
Complex(8), Allocatable :: eDom(:),uDom(:),sDom(:),tDom(:)
Real(8), Allocatable :: dDom(:),gDom(:),aDom(:,:),bDom(:,:)
Integer(2), Allocatable :: iDom(:),idDom(:,:)
Character(1151), Allocatable :: Dom_Form(:,:),hDom_Form(:,:)
Complex(8) fcFld,gcFld,dcFld,kcFld,kapcFld,cZw,c1Eigen,c2Eigen,c1EigenC,c2EigenC,cxPeriod,cyPeriod,czPeriod, &
& cxPeriodDlg,cyPeriodDlg,czPeriodDlg
Real(8) xPeriod,aEigen,fEigen,Zw0,Kw0,yPeriodVector(3),zPeriodVector(3)
Integer(4) kDom,nDom,mDom,iEigen,nrEigen,niEigen,mmEigen,imEigen,itmEigen,itEigen,nEigenSave, &
& ixySymm,ixzSymm,iyzSymm,nxPeriod,nyPeriod,nzPeriod
Integer(2) iHEGlobal,lMaxFileName,lMaxFileDir
Logical lfcFld,lgcFld,lzPer,lxPeriod,lyPeriod,lzPeriod,lregularPeriod,lEigen,lEigenSave,lWriteRoughFld,lExpFFD,lExcFFD
Character(256) DomFileName,ProFileName,MaxFileName,InpFileName,MaxFileDir
Real(8) Eps01,Mue01
! expansion data
type Expansion
Complex(8) gc
Real(8) Plane(3,0:3),rE(5),O(3),e(3),xO,yO,dmin,depend
Integer(2) nPar,iOff,iConn,iCol,iObj
Integer(2) iDom,iTypE,iHE,iE(6),iS
! iTypE rE1...5
! 0 Connection angle(2D), min x,min y, min z, -
! 1 2D Hankel angle(2D), min r, im x, im y, cut angle
! 2 2D Bessel angle(2D), max r, im x, im y, cut angle
! 3 Plane wave angle(2D), ----
! 4 Rayleigh -----
! 5 Harmonic angle(2D), x-per or re kx, min x, min y, im kx
! 6 3D Hankel min r, im x, im y, im z, cut angle
! 7 3D Bessel max r, im x, im y, im z, cut angle
! 8 Ring r, min angle, sector angle, degree factor, min r
! 9 Line min z, length, degree factor, min r, -
! 10 Spiral dr, dphi, dz, degree factor, min r
! 11 Gauss r, ----
end type
Character(20), Parameter :: CHExpIdent=' CHEXP Version 3.3 '
Complex(8), Allocatable :: ParExp(:,:),ParExpAux(:,:)
Integer(2), Allocatable :: iParExp(:,:),iParExpAux(:,:)
Type(Expansion), Allocatable :: tExp(:),tExpAux(:)
Complex(8) FldExp(10),FldAExp(10)
Real(8) FldPln(3,0:3)
Real(8) dep_delExp,fmin_genExp,fmax_genExp,fact_genExp,finn_genExp,fout_genExp,dinn_genExp,dout_genExp,ainn_genExp, &
& aout_genExp,df_genExp(2),dl_genExp(2),fModExpFac,ExpSumAcc
Integer(4) kB_genExp,nE_genExp,iE_genExp,nS_genExp,iCl_genExp,iCn_genExp,iDm_genExp,iWf_genExp,iWe_genExp, &
& iModExpMin,iModExpMax,iModExpBnd,iModExpDom,iModExpObj,iModExpCol,iModExpCon,iModExpLoop,iModExpWFA,iModExpWFE
Integer(4) kExp,mExp,nExp,kExc,nExc,nRHS,kPar,mPar,nPar,nParN,iGetExpData,kiExp,krExp,iDraExp,nExcit
Integer(2) iDomExp,iColExp,iConExp
Logical lInsertExp,lAskExp,lMMPstat,lMMPBndVal,lDispWarn,lExpTest,lInitSurfWaves
Character(32) siExp(6,0:20),srExp(5,0:20),siObj(5,0:10),srObj(5,0:10)
Character(256) ExpFileName,ParFileName
! object data
type Object
Real(8) Plane(3,0:3),Par(5),GrfRes,O(3),e(3)
Integer(2) iTypO,iCol,iColMin,iColMax,iPar(5)
Integer(4) nGrf,mGrf,iGrf,iMatOffset,nMat,nInhibited
end type
Character(20), Parameter :: CHObjIdent=' CHOBJ Version 1.0 '
Type(Object), Allocatable :: tObj(:),tObjAux(:)
Real(8), Allocatable :: ObjWeb(:,:),ObjWebX(:,:),ObjWebY(:,:),ObjWebZ(:,:),ObjWebV(:,:),ObjWebF(:)
Integer(2), Allocatable :: iObjWeb(:),nxObjWeb(:),nyObjWeb(:),iCObjWeb(:)
Real(8) fGenExpObj
Integer(2) nObjWeb
Integer(4) kObj,mObj,nObj,krObj,kiObj,iDraObj,iObjDra,iGenExpObj,iGenExpIns,iGenExpMinE,iGenExpMaxE,iGenExpMaxM, &
& iGenExpCl,iGenExpCl2,iGenExpCn,iGenExpOb,kInhibit,nInhibit,mInhibit
Logical lInsertObj,lAskObj,lObjMat,lObjMatW0,lObjFlg,lObjHid,lGenExpDel
Character(256) ObjFileName,M3DFileName,D3DFileName
Character(32), Allocatable:: sInhibit(:),sInhibitAlt(:)
! modify object data
Integer(2) icolMobj,iconMobj
Real(8) xminMobj,xmaxMobj,yminMobj,ymaxMobj
! field data
Character(20), Parameter :: CHFldIdent=' CHFLD Version 1.0 '
Character(20), Parameter :: CHFlfIdent=' CHFLF Version 2.0 '
Character(20), Parameter :: CHFltIdent=' CHFLT Version 2.0 '
Character(20), Parameter :: CHPFDIdent=' CHPFD Version 1.0 '
Character(20), Parameter :: CHGrfIdent=' CHGRF Version 1.0 '
Character(20), Parameter :: CHGrtIdent=' CHGRT Version 1.0 '
Complex(8), Parameter :: Ci=(0.0d0,1.0d0)
Integer(2), Parameter :: itE=1,itH=2,itS=3,itD=4,itB=5,itA=6,itV=7,itWe=8,itWh=9,itWt=10,itPe=11,itPh=12,itPt=13,&
& itJ=14,itF=15
Complex(8), Allocatable :: cFld(:,:,:,:),cAuxFld(:,:,:,:)
Real(8), Allocatable :: dFld(:,:,:,:),dAuxFld(:,:,:,:),rFld(:,:,:),drFld(:),rGrd(:,:,:,:)
Integer(2), Allocatable :: iFld(:,:,:)
Integer(4), Allocatable :: irFld(:),jrFld(:),krFld(:)
Complex(8) cSingleFldPoint(10)
Real(8) c678(1:3,1:3),spacecFld(3,0:3), &
& trFld,prFld,dtrFld, &
& rMinFld,rMaxFld,rSumFld,rSum2Fld,ErrFld,Err2Fld, &
& scaleIntensity,scaleArrow,rIsoStep,Grid3D,ArrowLength,PowerFld,FactorFld, &
& rSingleFldPoint(3),dSingleFldPoint(10),fSingleFldPoint(3)
Integer(4) nxcFld,nycFld,nzcFld,ixcFld,iycFld,izcFld,jxcFld,jycFld,jzcFld,ncFld, &
& nxrFld,nyrFld,ixrFld,iyrFld,nsFld,iFFldE,nIterPFD,iQFFD, &
& levPlane,kExpFFD,kColFFD,kConFFD,kDomFFD,kParFFD,idFld(10)
Integer(2) minCIntensity,maxCIntensity,itIntensity, &
& minCArrow,maxCArrow,itArrow
Integer(2) iEx,iEy,iEz,iHx,iHy,iHz,iAx,iAy,iAz,iV, &
& itrFld,iPlane,iSingleFldPoint,iQ_Form
Logical lFLDset0,lxcFld,lycFld,lzcFld,lEcFld,lHcFld,lAcFld,lVcFld,lfcFldAll, &
& lxrFld,lyrFld,lzrFld,larFld,lprFld,lGrid3D,lArrowFill,lIsoFill,lIsoLine, &
& lrGrd,lGetAll,LIQ,literE,&
& lDiffField,lDiffRel,lSingleFldPoint,lSkipFld,lSkipDerFld,lSkipVecFld,lSkipScaFld,lSkipFldHead,lAskFld
Character(256) FldFileName,FlfFileName,FltFileName,PFDFileName,GrfFileName,GrtFileName
Character(1151) Fld_Form(3,4),Fld_Def_Form(0:3,3,4), &
& Grd_Form(3),Grd_Def_Form(0:3,3), &
& Con_Form,Con_Def_Form(0:3),Trns_Form(3),Trns_Def_Form(0:3,3), &
& Q_Form(20,2),Q_Def_Form(0:3,20)
! PFD data
Logical lPFDalloc,lPFDc
Integer(2) iPFDt,iPFDft,nPFDi,nPFDj,nPFDk,nPFDil,nPFDih,nPFDjl,nPFDjh,nPFDkl,nPFDkh,nPFDf, &
& nPFDiEff,nPFDsLayers
Integer(4) nPFDcFld,nPFDsens,kPFDsens,nPFDsource,kPFDsource
Real(8) PFDxmin,PFDxmax,PFDymin,PFDymax,PFDzmin,PFDzmax,PFDdx,PFDdy,PFDdz,PFDfTau,PFDfTmax,PFDpml,PFDfmin,PFDfmax, &
& PFDwmax,PFDwfact,PFDdfact
Integer(2), Allocatable:: iPFDs(:),jPFDs(:),kPFDs(:),iPFDsa(:),jPFDsa(:),kPFDsa(:)
Integer(4), Allocatable:: nPFDsFld(:),nPFDsFlda(:)
Complex(8), Allocatable:: PFDsourceA(:),PFDsourceAa(:)
Real(8), Allocatable:: PFDsensX(:),PFDsensY(:),PFDsensZ(:),PFDsensT(:),PFDsensD(:),dPFDsens(:,:)
Real(8), Allocatable:: PFDsensXa(:),PFDsensYa(:),PFDsensZa(:),PFDsensTa(:),PFDsensDa(:),dPFDsensa(:,:)
Complex(8), Allocatable :: cPFDsens(:,:,:),cPFDsensa(:,:,:)
! integration data
Character(20), Parameter :: CHIntIdent=' CHINT Version 2.0 '
Real(8) currentIntegral,currentIntegralMax,currentIntegralMin,currentIntegralMaxL(3),currentIntegralMinL(3), &
& currentIntegralMax1,currentIntegralMin1,currentIntegralMax1S,currentIntegralMin1S, &
& AccIntegral,XminInt,XmaxInt,YminInt,YmaxInt,rSphInt,PowerInt,FactorInt
Real(8) spaceInt(3,0:3)
Integer(4) IntType,IntField,IntInter,MaxIntIter,IntWhat,IntNx,IntNy,IntOrd,IntErr,IntCall,iBndInt,iObjInt,IntSide
Integer(2) iIntgEc,iIntgHc
Logical lIntgSave,lAbsInt,lebInt,lBndIntgX
Character(256) IntFileName
! PET data
Character(20), Parameter :: CHPETIdent=' CHBAS Version 1.0 '
Complex(8), Allocatable :: pPET(:,:)
Integer(4), Parameter :: mPET=10
Complex(8) ePET(2,mPET),dPET
Real(8) fPET,xPET(mPET),wPET(mPET)
Integer(4) kPETD,kPET,nPET,npPET
Logical lPET
Character(256) PETFileName
Character(1151) sPET(mPET)
! MMP data
Logical lMMPDeterminant
Integer(4) iWorkSpace,iMMPlast
Real(8) rMMPResV(9)
Complex(8) cMMPeigenPhase,cMMPeigenVector(3)
! particle data
type Particle2D
Real(8) r,sMass,Mass,Position(3),Velocity(3),Acceleration(3),Force(3),Friction(2),RandomForce
Integer(2) iBnd,iColPart,iColMirror,iColSurface
end type
type Particle3D
Real(8) r,sMass,Mass,Position(3),Velocity(3),Acceleration(3),Force(3),Friction(2),RandomForce
Integer(2) iObj,iColPart,iColMirror,iColSurface
end type
Integer(4) nParticle2D,nParticle3D
Real(8) ParticleTimeStep,ParticleStepLength,Particle2DMirror(4,3),Particle3DMirror(4,3)
Character(256) PrtFileName
Type(Particle2D), Allocatable :: tParticle2D(:),tParticle2DAux(:)
Type(Particle3D), Allocatable :: tParticle3D(:),tParticle3DAux(:)
! Insert dialog
Integer(4) kInsObj,nInsObj,iAVIdlg
Logical(4) lInsObj
CONTAINS
! Defaults
Subroutine Boundary_Defaults(lCheck)
! set default values for the boundaries
Implicit none
Logical, intent(in) :: lCheck
Logical ldum
ldum=lCheck
call setNameExt(ProFileName,'BND',BndFileName)
call setNameExt(ProFileName,'MAT',MatFileName)
call setNameExt(ProFileName,'GEO',GeoFileName)
call setNameExt(ProFileName,'MSH',MshFileName)
ConFileName='Contour.DAT'C
mBndPtAlloc=-1 ! no memory allocated for the matching points
mBndPt3DAlloc=-1 ! no memory allocated for the 3D matching points
lGRF_Mark=.true.
lGRF_PolygonClosed=.true.
lInsertBnd=.false.
lAskBnd=.true.
lCloseNow=.false.
lMoveInsert=.false.
iBound=0_2
iDomBnd=0_2
iColBnd=0_2
iConBnd=0_2
iDraBnd=0
kVal=1
trans=0.0d0
lTrans=.true.
iWhatiBndPt3D=-1_2
lGet3DMat=.true.
nInhBndPt3D=0
nInhEqu3D=0
vBndNorm(1)=1.0d0
vBndNorm(2:3)=0.0d0
! test: 2 circles
mBnd=2
nBnd=2
kBnd=1
mBndEdg=2
nBndEdg=2
kBndEdg=1
mBndSpl=0
nBndSpl=0
kBndSpl=0
call AllocateBnd(ldum)
if(.not.ldum) then
kBndEdg=0
nBndEdg=0
mBndEdg=0
mBndSpl=0
nBndSpl=0
kBndSpl=0
return
end if
call AllocateBndEdg(ldum)
if(.not.ldum) return
call AllocateBndSpl(ldum)
if(.not.ldum) then
iBound=-9_2
return
end if
tBnd(1)%iTypB=1_2
tBnd(1)%nEdge=1
tBnd(1)%kEdge=1
tBnd(1)%iEdgeOffset=0
tBnd(1)%iSplineOffset=0
tBnd(1)%iMatOffset=0
tBnd(1)%iLDom=1_2
tBnd(1)%iRDom=0_2
tBnd(1)%iCond=0_2
tBnd(1)%iConn=0_2
tBnd(1)%iCol=2_2
tBnd(1)%Weight=1.0d0
tBnd(1)%Weight2=1.0d0
tBnd(1)%val(1)=0.0d0
tBnd(1)%val(2)=0.0d0
tBnd(1)%nSpline=0
tBnd(1)%nMatPts=0
tBnd(1)%nMat=0
tBnd(1)%fAmpl=0.0d0
tBnd(1)%Formula='0'C
tBnd(2)%iTypB=1_2
tBnd(2)%nEdge=1
tBnd(2)%kEdge=1
tBnd(2)%iEdgeOffset=1
tBnd(2)%iSplineOffset=0
tBnd(2)%iMatOffset=0
tBnd(2)%iLDom=0_2
tBnd(2)%iRDom=1_2
tBnd(2)%iCond=0_2
tBnd(2)%iConn=0_2
tBnd(2)%iCol=3_2
tBnd(2)%Weight=1.0d0
tBnd(2)%Weight2=1.0d0
tBnd(2)%val(1)=1.0d0
tBnd(2)%val(2)=0.0d0
tBnd(2)%nSpline=0
tBnd(2)%nMatPts=0
tBnd(2)%nMat=0
tBnd(2)%fAmpl=0.0d0
tBnd(2)%Formula='0'C
tBndEdg(1)%x=0.0d0
tBndEdg(1)%y=0.0d0
tBndEdg(1)%r=0.95d0
tBndEdg(1)%d=0.0d0
tBndEdg(2)%x=0.0d0
tBndEdg(2)%y=0.0d0
tBndEdg(2)%r=0.25d0
tBndEdg(2)%d=0.0d0
iGMSHbnd1=1
iGMSHbnd2=2
iGMSHDom=0
iGMSHCol=0
lInitSurfWaves=.true.
end Subroutine Boundary_Defaults
Subroutine Domain_Defaults(lCheck)
! set default domain + project data
Implicit none
Logical, intent(in) :: lCheck
Logical ldum
ldum=lCheck
call setNameExt(ProFileName,'DOM',DomFileName)
iSpaceRead=3
iPoints2DRead=0
iPoints3DRead=0
! global data
Eps01=1.0d0/Eps0
Mue01=1.0d0/Mue0
Kw0=dsqrt(Mue0*Eps0) ! without omega!
Zw0=dsqrt(Mue0/Eps0)
fcFld=(0.0d0,0.0d0) ! frequency
gcFld=(0.0d0,0.0d0) ! normed propagation constant
dcFld=(1.0d0,0.0d0) ! half period in z direction
c1Eigen=(0.0d0,0.0d0) ! first Eigenvalue search point in the complex plane
c2Eigen=(0.0d0,0.0d0) ! second Eigenvalue search point in the complex plane
c1EigenC=c1Eigen ! clip window for fine search same as for rough search
c2EigenC=c2Eigen
xPeriod=1.0d0 ! cell length for periodic problems
yPeriodVector(1)=0.0d0
yPeriodVector(2)=1.0d0
yPeriodVector(3)=0.0d0
zPeriodVector(1)=0.0d0
zPeriodVector(2)=0.0d0
zPeriodVector(3)=1.0d0
cxPeriod=(0.0d0,0.0d0)! complex constant for periodic problems
cyPeriod=(0.0d0,0.0d0)! complex constant for periodic problems
czPeriod=(0.0d0,0.0d0)! complex constant for periodic problems
CxPeriodDlg=CxPeriod
CyPeriodDlg=CyPeriod
CzPeriodDlg=CzPeriod
aEigen=0.01 ! Eigenvalue stopping criterium 1 (accuracy)
fEigen=0.01 ! Eigenvalue stopping criterium 1 (flatness)
nrEigen=10 ! Eigenvalue points in r direction for the rough search
niEigen=10 ! Eigenvalue points in i direction for the rough search
imEigen=1 ! fine search of 1st minimum only
mmEigen=0 ! no minima found in rough search
itmEigen=100 ! max. Eigenvalue iterations for the fine search
itEigen=0 ! Eigenvalue iterations performed
nEigenSave=0 ! never write eigenvalue search data when lEigenSave is false
ixySymm=0 ! no symmetry with respect to xy plane
ixzSymm=0 ! no symmetry with respect to xz plane
iyzSymm=0 ! no symmetry with respect to yz plane
lfcFld=.false. ! field is not frequency dependent (time dependent)
lgcFld=.true. ! field is 2D (not 3D)
lzPer=.false. ! z-per/2 is not characteristic for z dependence (gamma is used)
lxPeriod=.false. ! geometry is not periodic
lyPeriod=.false. ! geometry is not periodic
lzPeriod=.false. ! geometry is not periodic
lregularPeriod=.true. ! regular periodic cell
lEigen=.false. ! not an Eigenvalue problem
lEigenSave=.true. ! save Eigenvalue search data on file
lWriteRoughFld=.true. ! write rough search data on FLD file if possible
iEigen=1 ! frequency is Eigenvalue
iHEGlobal=0_2 ! Ez modes
! domain data
mDom=1
nDom=1
kDom=1
call AllocateDom(ldum)
if(.not.ldum) return
iDom(0)=0_2
end Subroutine Domain_Defaults
Subroutine Expansion_Defaults(lCheck)
! set default expansion data
Implicit none
Integer(4) k
Logical, intent(in) :: lCheck
Logical ldum
ldum=lCheck
lExpTest=.false.
call setNameExt(ProFileName,'EXP',ExpFileName)
call setNameExt(ProFileName,'PAR',ParFileName)
siExp='Unused'C
srExp='Unused'C
siExp(1,0)='ID number'C ! Connection
siExp(2,0)='XY symmetry'C
siExp(3,0)='XZ symmetry'C
siExp(4,0)='YZ symmetry'C
siExp(5,0)='Max. order'C
siExp(6,0)='Basis type'C
srExp(1,0)='Angle (XY-plane)'C
srExp(2,0)='Min x / Max |x|'C
srExp(3,0)='Min y / Max |y|'C
srExp(4,0)='Min z / Max |z|'C
srExp(5,0)='Fourier factor'C
siExp(1,1)='Minimum order'C ! 2D Hankel
siExp(2,1)='Maximum order n'C
siExp(3,1)='3D->Min. deg. m'C
siExp(4,1)='3D->Max. deg. m'C
siExp(5,1)='Step of order'C
siExp(6,1)='Period for 3D'C
srExp(1,1)='Angle (XY-plane)'C
srExp(2,1)='Minimum radius'C
srExp(3,1)='Imaginary x'C
srExp(4,1)='Imaginary y'C
srExp(5,1)='Cut angle'C
siExp(1,2)='Minimum order'C ! 2D Bessel
siExp(2,2)='Maximum order n'C
siExp(3,2)='3D->Min. deg. m'C
siExp(4,2)='3D->Max. deg. m'C
siExp(5,2)='Step of order'C
siExp(6,2)='3D: Period type'C
srExp(1,2)='Angle (XY-plane)'C
srExp(2,2)='Maximum radius'C
srExp(3,2)='Imaginary x'C
srExp(4,2)='Imaginary y'C
srExp(1,3)='Angle (XY-plane)'C ! Plane wave
srExp(2,3)='Main angle (3D)'C
srExp(3,3)='Sect. angle (3D)'C
siExp(2,3)='Superpos. n (3D)'C
siExp(3,3)='Superpos.ord.(3D)'C
siExp(4,3)='Scaling (<1:no)'C
siExp(1,4)='Trans(0)/Refl(1)'C ! Rayleigh
siExp(2,4)='Maximum x order'C
siExp(3,4)='Minimum x order'C
siExp(4,4)='Scaling (<0:no)'C
srExp(1,4)='Angle must be 0'C
srExp(2,4)='Min y(2D)/z(3D)'C
srExp(3,4)='Real(CxPeriod)'C
srExp(4,4)='Imag(CxPeriod)'C
siExp(1,5)='x type'C ! Harmonic
siExp(2,5)='y type'C
siExp(3,5)='Minimum order'C
siExp(4,5)='Maximum order'C
siExp(5,5)='Step of order'C
siExp(6,5)='z type'C
srExp(1,5)='Angle (XY-plane)'C
srExp(2,5)='x-per./2 | kx/k0'C
srExp(3,5)='Min x / Max |x|'C
srExp(4,5)='Min y / Max |y|'C
srExp(5,5)='Imag(kx/k0)'C
siExp(1,6)='Minimum order n'C ! 3D Hankel
siExp(2,6)='Maximum order n'C
siExp(3,6)='Minimum degree m'C
siExp(4,6)='Maximum degree m'C
srExp(1,6)='Minimum radius'C
srExp(2,6)='Imaginary x'C
srExp(3,6)='Imaginary y'C
srExp(4,6)='Imaginary z'C
srExp(5,6)='Cut angle'C
siExp(1,7)='Minimum order n'C ! 3D Bessel
siExp(2,7)='Maximum order n'C
siExp(3,7)='Minimum degree m'C
siExp(4,7)='Maximum degree m'C
srExp(1,7)='Maximum radius'C
srExp(2,7)='Imaginary x'C
srExp(3,7)='Imaginary y'C
srExp(4,7)='Imaginary z'C
siExp(1,8:10)='Minimum order n'C ! Line multipoles
siExp(2,8:10)='Maximum order n'C
siExp(3,8:10)='Minimum degree m'C
siExp(4,8:10)='Maximum degree m'C
siExp(5,8)='Step of degree'C
siExp(5,9:10)='Step of order'C
siExp(6,8:10)='N multipoles'C
srExp(1,8)='Ring radius'C ! Ring Hankel
srExp(2,8)='Minimum angle'C
srExp(3,8)='Sector angle'C
srExp(4,8)='Degree factor'C
srExp(5,8)='Minimum radius'C
srExp(1,9)='Minimum z'C ! Line Hankel
srExp(2,9)='Length'C
srExp(3,9)='Degree factor'C
srExp(4,9)='Minimum radius'C
srExp(1,10)='Delta r'C ! Spiral Hankel
srExp(2,10)='Delta phi'C
srExp(3,10)='Delta z'C
srExp(4,10)='Degree factor'C
srExp(5,10)='Minimum radius'C
siExp(1,11)='Order n or -1'C ! 3D Gaussian beam
srExp(1,11)='Radius or v/c'C
srExp(2,11)='EBeam min.dist.'C
siExp(1,12)='N layers'C ! 2D monopole for multilayer
siExp(2,12)='Bottom layer type'C
siExp(3,12)='Top layer type'C
srExp(1,12)='Sommerfeld k'C
srExp(2,12)='Integration acc.'C
srExp(3,12)='Imaginary x'C
srExp(4,12)='Imaginary y'C
siExp(1,13)='N layers'C ! 3D dipole for multilayer
siExp(2,13)='Bottom layer type'C
siExp(3,13)='Top layer type'C
siExp(4,13)='Hor/vert/both:0/1/2'C
srExp(1,13)='Sommerfeld k'C
srExp(2,13)='Integration acc.'C
srExp(3,13)='Imaginary x'C
srExp(4,13)='Imaginary y'C
srExp(5,13)='Imaginary z'C
kiExp=1
krExp=1
lInsertExp=.true.
lAskExp=.true.
lDispWarn=.true.
iDomExp=0_2
iColExp=0_2
iConExp=0_2
iDraExp=0
kExc=1
nExc=1
nRHS=1
kExp=1
nExp=3
mExp=100
call AllocateExp(ldum)
if(.not.ldum) return
do kExp=1,nExp
tExp(kExp)%iTypE=1
tExp(kExp)%iDom=1
tExp(kExp)%iConn=0
tExp(kExp)%iCol=1
tExp(kExp)%iObj=0
tExp(kExp)%nPar=1
tExp(kExp)%iHE=2
tExp(kExp)%iS=0
tExp(kExp)%iE(1:6)=0
tExp(kExp)%iE(2)=0
tExp(kExp)%iE(5)=1
tExp(kExp)%rE(1:5)=0.0d0
tExp(kExp)%depend=1.0d100
tExp(kExp)%gc=gcFld
tExp(kExp)%Plane(1:3,0:3)=0.0d0
tExp(kExp)%Plane(1,1)=1.0d0
tExp(kExp)%Plane(2,2)=1.0d0
tExp(kExp)%Plane(3,3)=1.0d0
if(tExp(kExp)%iTypE.ne.10) then
tExp(kExp)%xo=tExp(kExp)%Plane(1,0)
tExp(kExp)%yo=tExp(kExp)%Plane(2,0)
else
tExp(kExp)%xo=1.0d0
tExp(kExp)%yo=0.0d0
end if
tExp(kExp)%O=0.0d0
tExp(kExp)%e=0.0d0
tExp(kExp)%e(1)=1.0d0
end do
kExp=1
tExp(2)%iTypE=2
tExp(1)%iOff=0
nPar=tExp(1)%nPar
do k=2,nExp
tExp(k)%iOff=tExp(k-1)%iOff+tExp(k-1)%nPar
nPar=nPar+tExp(k)%nPar
end do
mPar=100
kPar=1
call AllocatePar(ldum)
if(.not.ldum) return
dep_delExp=1.0d0
fmin_genExp=0.0d0
fmax_genExp=0.0d0
fact_genExp=0.0d0
finn_genExp=0.0d0
fout_genExp=0.0d0
dinn_genExp=1.0d0
dout_genExp=1.0d0
ainn_genExp=15.0d0
aout_genExp=15.0d0
df_genExp(1:2)=0.0d0
dl_genExp(1:2)=0.0d0
kB_genExp=1
nE_genExp=0
iE_genExp=1
nS_genExp=1000
iCl_genExp=-1
iCn_genExp=-32001
iDm_genExp=0
iWf_genExp=0
iWe_genExp=3
fModExpFac=1.0d0
ExpSumAcc=4.0d0
iModExpMin=1
iModExpMax=nExp-nExc
iModExpBnd=0
iModExpDom=0
iModExpObj=0
iModExpCol=0
iModExpCon=0
iModExpLoop=1
iModExpWFA=1
iModExpWFE=1
lInitSurfWaves=.true.
end Subroutine Expansion_Defaults
Subroutine Object_Defaults(lCheck)
! set default object data
Implicit none
Logical, intent(in) :: lCheck
Logical ldum
ldum=lCheck
iObjDra=0
lCHGLdoubleSide=.true.
if((iObjDra.eq.3).or.(iObjDra.eq.4)) lCHGLdoubleSide=.false.
lObjMat=.false.
lObjMatW0=.false.
lObjFlg=.false.
lObjHid=.true.
lGRCused=.not.lObjHid
lGet3DMat=.true.
call setNameExt(ProFileName,'3DO',ObjFileName)
call setNameExt(ProFileName,'3DM',M3DFileName)
call setNameExt(ProFileName,'3DD',D3DFileName)
srObj='Unused'C
siObj='Unused'C
srObj(1,0)='Minimum angle'C
srObj(2,0)='Sector angle'C
srObj(4,0)='Mat.Pt.aspect ratio'C
srObj(1,1)='Minimum z'C
srObj(2,1)='Length'C
srObj(4,1)='Mat.Pt.aspect ratio'C
srObj(1,2)='Delta r'C
srObj(2,2)='Delta phi'C
srObj(3,2)='Delta z'C
srObj(4,2)='Mat.Pt.aspect ratio'C
srObj(1,3)='Match.pt.side length'C
srObj(2,3)='Multipole density'C
srObj(3,3)='Multipole distance'C
srObj(1,4)='X side length'C
srObj(2,4)='Y side length'C
srObj(3,4)='Match.pt.side length'C
srObj(4,4)='Multipole density'C
srObj(5,4)='Multipole distance'C
srObj(1,5)='Minimum z'C
srObj(2,5)='Delta z'C
srObj(3,5)='Multipole distance'C
srObj(4,5)='Mat.Pt.aspect ratio'C
siObj(1,0:2)='Min.boundary'C
siObj(2,0:3)='Max.boundary'C
siObj(3,0:2)='Min.expansion'C
siObj(4,0:2)='Max.expansion'C
siObj(5,0:2)='Max.multipoles'C
siObj(1,3:4)='Use data of boundary'C
siObj(2,3:4)='Max. multipoles per side'C
siObj(3,3:4)='Max. multipole order and degree'C
siObj(1,5)='Min.boundary'C
siObj(2,5)='Max.boundary'C
siObj(3,5)='Min.expansion'C
siObj(4,5)='Max.expansion'C
siObj(5,5)='Max.multipoles'C
krObj=1
kiObj=1
lInsertObj=.true.
lAskObj=.true.
fGenExpObj=0.0d0
iGenExpObj=0
iGenExpIns=-1
iGenExpMinE=0
iGenExpMaxE=-1
iGenExpMaxM=-32000
iGenExpCl=0
iGenExpCl2=-1
iGenExpCn=0
iGenExpOb=0
lGenExpDel=.true.
kObj=1
nObj=1
mObj=10
iDraObj=kObj
call AllocateObj(ldum)
if(.not.ldum) return
do kObj=1,nObj
tObj(kObj)%iTypO=1
tObj(kObj)%nInhibited=0
tObj(kObj)%iCol=1
tObj(kObj)%iColMin=30
tObj(kObj)%iColMax=90
tObj(kObj)%iPar(1:2)=1
tObj(kObj)%iPar(3:5)=0
tObj(kObj)%GrfRes=0.1d0
tObj(kObj)%Par(1)=0.0d0
tObj(kObj)%Par(2)=1.0d0
tObj(kObj)%Par(3)=0.0d0
tObj(kObj)%Par(4)=1.0d0
tObj(kObj)%Par(5)=0.0d0
tObj(kObj)%O(1:3)=0.0d0
tObj(kObj)%e(1:3)=0.0d0
tObj(kObj)%e(1)=1.0d0
tObj(kObj)%Plane(1:3,0:3)=0.0d0
tObj(kObj)%Plane(1,1)=1.0d0
tObj(kObj)%Plane(2,2)=1.0d0
tObj(kObj)%Plane(3,3)=1.0d0
end do
kObj=1
icolMobj=2_2
iconMobj=-1_2
xminMobj=-1.0d0
xmaxMobj=1.0d0
yminMobj=-1.0d0
ymaxMobj=1.0d0
mInhibit=0
nInhibit=0
kInhibit=0
end Subroutine Object_Defaults
Subroutine Particle_Defaults(lCheck)
! set default particle data
Implicit none
Logical, intent(in) :: lCheck
Logical ldum
ldum=lCheck
call setNameExt(ProFileName,'PRT',PrtFileName)
nParticle2D=0_4
nParticle3D=0_4
ParticleTimeStep=1.0d0
ParticleStepLength=2.0d100
Particle2DMirror(1:3,1:2)=0.0d0 ! mirror origin, tangent, normal vectors in the xy plane
Particle2DMirror(2,1)=1.0d0
Particle2DMirror(3,2)=1.0d0
Particle3DMirror(1:4,1:3)=0.0d0 ! mirror origin, tangent1, tangent2, normal vectors in the xyz space
Particle3DMirror(2,1)=1.0d0
Particle3DMirror(3,2)=1.0d0
Particle3DMirror(4,3)=1.0d0
end Subroutine Particle_Defaults
! Allocations
Subroutine AddInhibit(loc,s,ldum)
Implicit none
Logical ldum
Integer(4) loc,idum
Character(32) s
lGet3DMat=.true.
ldum=.false.
if(mInhibit.lt.1) then
if(Allocated(sInhibit)) DeAllocate(sInhibit)
if(Allocated(sInhibitAlt)) DeAllocate(sInhibitAlt)
nInhibit=0
kInhibit=0
end if
if((loc.lt.1).or.(loc.gt.nInhibit+1)) return
if(nInhibit.gt.0) then
if(Allocated(sInhibitAlt)) DeAllocate(sInhibitAlt)
Allocate(sInhibitAlt(nInhibit),stat=idum)
if(idum.ne.0) then
idum=MessageBoxQQ('Memory allocation for sInhibitAlt failed!'C,'Allocate inhibit'C, &
MB$OK.or.MB$IconExclamation)
if(Allocated(sInhibit)) DeAllocate(sInhibit)
if(Allocated(sInhibitAlt)) DeAllocate(sInhibitAlt)
nInhibit=0
mInhibit=0
return
end if
sInhibitAlt=sInhibit
end if
nInhibit=nInhibit+1
if(nInhibit.gt.mInhibit) then
if(Allocated(sInhibit)) DeAllocate(sInhibit)
Allocate(sInhibit(nInhibit),stat=idum)
if(idum.ne.0) then
idum=MessageBoxQQ('Memory allocation for sInhibit failed!'C,'Allocate inhibit'C, &
MB$OK.or.MB$IconExclamation)
if(Allocated(sInhibit)) DeAllocate(sInhibit)
if(Allocated(sInhibitAlt)) DeAllocate(sInhibitAlt)
nInhibit=0
mInhibit=0
return
end if
mInhibit=max(mInhibit,nInhibit)
end if
if(loc.gt.1) sInhibit(1:loc-1)=sInhibitAlt(1:loc-1)
sInhibit(loc)=s
if(loc.lt.nInhibit) sInhibit(loc+1:nInhibit)=sInhibitAlt(loc:nInhibit-1)
if(Allocated(sInhibitAlt)) DeAllocate(sInhibitAlt)
ldum=.true.
end Subroutine AddInhibit
Subroutine DelInhibit(loc)
Implicit none
Integer(4) loc
lGet3DMat=.true.
if(loc.gt.nInhibit) return
if((loc.eq.0).or.(-loc.ge.nInhibit)) then
nInhibit=0
else if(loc.lt.0) then
sInhibit(1:nInhibit+loc)=sInhibit(-loc+1:nInhibit)
nInhibit=nInhibit+loc
else
sInhibit(loc:nInhibit-1)=sInhibit(loc+1:nInhibit)
nInhibit=nInhibit-1
end if
end Subroutine DelInhibit
Subroutine AllocateBnd(ldum)
Implicit none
Integer(4) idum
Logical ldum
ldum=.false.
if(Allocated(tBnd)) DeAllocate(tBnd)
mBnd=max(mBnd,0)
Allocate(tBnd(0:mBnd),stat=idum)
if(idum.ne.0) then
idum=MessageBoxQQ('Memory allocation for tBnd failed!'C,'Allocate boundary'C, &
MB$OK.or.MB$IconExclamation)
kBnd=0
nBnd=0
mBnd=0
return
end if
ldum=.true.
end Subroutine AllocateBnd
Subroutine AllocateBndSpl(ldum)
Implicit none
Integer(4) idum
Logical ldum
ldum=.false.
if(Allocated(sSpline)) DeAllocate(sSpline)
if(Allocated(xSpline)) DeAllocate(xSpline)
if(Allocated(ySpline)) DeAllocate(ySpline)
if(Allocated(xsSpline)) DeAllocate(xsSpline)
if(Allocated(ysSpline)) DeAllocate(ysSpline)
mBndSpl=max(mBndSpl,0)
Allocate(sSpline(0:mBndSpl),xSpline(0:mBndSpl),ySpline(0:mBndSpl),xsSpline(0:mBndSpl),ysSpline(0:mBndSpl),stat=idum)
if(idum.ne.0) then
idum=MessageBoxQQ('Memory allocation for splines failed!'C,'Allocate boundary'C, &
MB$OK.or.MB$IconExclamation)
kBndSpl=0
nBndSpl=0
mBndSpl=0
return
end if
nBndSpl=mBndSpl
ldum=.true.
end Subroutine AllocateBndSpl
Subroutine AllocateBndEdg(ldum)
Implicit none
Integer(4) idum
Logical ldum
ldum=.false.
if(Allocated(tBndEdg)) DeAllocate(tBndEdg)
mBndEdg=max(mBndEdg,0)
Allocate(tBndEdg(0:mBndEdg),stat=idum)
if(idum.ne.0) then
idum=MessageBoxQQ('Memory allocation for tBnd failed!'C,'Allocate boundary'C, &
MB$OK.or.MB$IconExclamation)
kBndEdg=0
nBndEdg=0
mBndEdg=0
return
end if
ldum=.true.
end Subroutine
Subroutine AllocateBndPt(ldum)
Implicit none
Integer(4) idum
Logical ldum
ldum=.false.
if(mBndPt.gt.10000) then
idum=MessageBoxQQ('Memory allocation for BndPt failed!'C,'Too many matching points!'C, &
MB$OK.or.MB$IconExclamation)
return
end if
ldum=.true.
if(mBndPt.eq.mBndPtAlloc) return ! the requested amount of memory is already allocated
mBndPt=max(mBndPt,0)
if(Allocated(wBndPt)) DeAllocate(wBndPt)
if(Allocated(eBndPt)) DeAllocate(eBndPt)
if(Allocated(fBndPt)) DeAllocate(fBndPt)
if(Allocated(iBndPt)) DeAllocate(iBndPt)
if(Allocated(jBndPt)) DeAllocate(jBndPt)
Allocate(wBndPt(0:mBndPt),eBndPt(0:mBndPt),fBndPt(0:mBndPt),iBndPt(0:mBndPt),jBndPt(0:mBndPt),stat=idum)
if(idum.ne.0) then
idum=MessageBoxQQ('Memory allocation for BndPt failed!'C,'Allocate boundary points'C, &
MB$OK.or.MB$IconExclamation)
if(Allocated(wBndPt)) DeAllocate(wBndPt)
if(Allocated(eBndPt)) DeAllocate(eBndPt)
if(Allocated(fBndPt)) DeAllocate(fBndPt)
if(Allocated(iBndPt)) DeAllocate(iBndPt)
if(Allocated(jBndPt)) DeAllocate(jBndPt)
kBndPt=0
nBndPt=0
mBndPt=0
mBndPtAlloc=-1
ldum=.false.