-
Notifications
You must be signed in to change notification settings - Fork 7
/
coord.c
3994 lines (3210 loc) · 120 KB
/
coord.c
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
#include "decs.h"
// this file contains all the coordinate dependent
// parts of the code, except the initial and boundary
// conditions
// static variables with global scope to this file
// could make any or all of these true global if want to change them in, say, init.c
// Notes:
// 1) BCtype[] used below, but should presume BCtype[] could change even if storing X and V. So far use of R0SING and DISKSURFACE is ok since not changing to/from those types.
// OPENMPMARK: Note that previously had many static (so global to this file) variables. However, many were not thread safe since depended upon position or time.
// So need to ensure all statics here are set ONLY in set_coord_() type functions and NOT set in bl_coord() or dxdxp() or other functions that are called by multiple threads.
// Hence all these statics must be constant values in time and space.
// Note that JCM did have the variables set in the right location previously, just didn't have variables defined in right place since wasn't trying to be thread safe.
// Note that Intel Thread Checker didn't catch multiple thread use of myhslope.
///////////////////////
//
// These static variables can only be set in set_coord_parms() type functions, not bl_coord() or dxdxp(). if need to set inside bl_coord() or dxdxp(), then move variable there!
//
///////////////////////
// for defcoord==COMPLEX1TH
static FTYPE der0=9;
//static FTYPE Ri=8.0; // too unresolved for 256x128
static FTYPE Ri=20.0;
// for defcoord==COMPLEX2TH
static FTYPE x2trans;
static FTYPE m2,d2,c2,m3,b3,thetatores;
// for defcoord==JET1COORDS
static FTYPE h0,hf,rh0,myrout,dmyhslope1dr,dmyhslope2dx1,x1in,x1out;
static FTYPE npow;
// for defcoord=JET2COORDS
static FTYPE r1jet,njet,rpjet;
// for defcoord=JET3COORDS
static FTYPE r0jet,rsjet,Qjet;
// for SJETCOORDS
static FTYPE fracphi;
static FTYPE npow2;
static FTYPE cpow2;
static FTYPE rbr;
static FTYPE x1br;
static FTYPE fracdisk;
static FTYPE fracjet;
static FTYPE rsjet;
static FTYPE r0grid;
static FTYPE r0jet;
static FTYPE rjetend;
static FTYPE r0disk;
static FTYPE rdiskend;
static FTYPE jetnu;
static FTYPE x10;
static FTYPE x20;
#define USESJETLOGHOVERR 1
#if(USESJETLOGHOVERR)
static FTYPE torusrmax; // was extern and original located in init.sashatorus.c, but should be inverted as now is so extern is in init.sashatorus.c.
#endif
static FTYPE torusrmax_loc;
// for defcoord=JET6COORDS
static FTYPE ntheta,htheta,rsjet2,r0jet2,rsjet3,r0jet3; // and rs,r0
// for defcoord=BPTHIN1
static FTYPE bp_npow,bp_r1jet,bp_njet,bp_r0jet,bp_rsjet,bp_Qjet, bp_ntheta,bp_htheta,bp_rsjet2,bp_r0jet2,bp_rsjet3,bp_r0jet3, bp_rs, bp_r0,bp_npow2,bp_cpow2,bp_rbr,bp_x1br, bp_h0;
// for defcoord=PULSARCOORDS
static FTYPE hinner,houter;
// for defcoord=JET4COORDS
static FTYPE rs,r0;
// UNI2LOG similar to LOGSINTH with new features and simpler startx/dx and grid growth factor
static int Nstar;
static FTYPE Rstar,Afactor;
// for defcoord=JET5COORDS
static FTYPE AAAA,AAA,BBB,DDD,CCCC,Rj;
static FTYPE ii0;
// for defcoord=SJETCOORDS
static void vofx_sjetcoords( FTYPE *X, FTYPE *V ); //original coordinates
static void vofx_cylindrified( FTYPE *Xin, void (*vofx)(FTYPE*, FTYPE*), FTYPE *Vout ); //coordinate "cylindrifier"
// can call when no dependencies
void set_coord_parms(int defcoordlocal)
{
set_coord_parms_nodeps(defcoordlocal);
set_coord_parms_deps(defcoordlocal);
}
// Things to set that only depend upon defcoord and nothing else
// NOTEMARK: By nothing else, that means things like hslope, R0, Rin, or anything else that user might set in init_grid()
// Otherwise, even if set hslope here for example and then use hslope to set something else, hslope could change and that other parameter would be wrong and coordinates would be mismatched.
void set_coord_parms_nodeps(int defcoordlocal)
{
#if(USEOPENMP)
if(omp_in_parallel()){
dualfprintf(fail_file,"set_coord_parms_nodeps() called in parallel region\n");
myexit(784653446);
}
#endif
// assumes R0, Rin, Rout, and hslope are so general that are set in init.c
if (defcoordlocal == LOGRSINTH) {
}
else if (defcoordlocal == REBECCAGRID) {
}
else if (defcoordlocal == COMPLEX0TH) {
}
else if(defcoordlocal == UNIRSINTH || defcoordlocal == UNIRSINTH2){
}
else if (defcoordlocal == EQMIRROR) {
}
else if(defcoordlocal == COMPLEX1TH) {
}
else if(defcoordlocal == COMPLEX2TH) {
x2trans=0.1; // user settable, must be same as below in dxdxp
}
else if (defcoordlocal == LOGRUNITH) { // uniform theta and log in radius
}
else if (defcoordlocal == JET1COORDS) {
// optimal is npow=10 R0=-3
npow=1.0;
//R0=0.0;
// must be same as in dxdxp()
hf=2.0-0.22;
rh0=40.0;
}
else if (defcoordlocal == JET2COORDS) {
npow=1.0;
// must be same as in dxdxp()
if(1){
r1jet=16.0;
njet=0.3;
rpjet=0.9;
}
else{
r1jet=9.0;
njet=0.3;
rpjet=.9;
}
}
else if (defcoordlocal == JET3COORDS) {
npow=1.0;
// must be same as in dxdxp()
if(0){ // first attempt
r1jet=2.8;
njet=0.3;
r0jet=7.0;
rsjet=21.0;
Qjet=1.7;
}
else if(0){ // chosen to resolve disk then resolve jet
r1jet=2.8;
njet=0.3;
r0jet=20.0;
rsjet=80.0;
Qjet=1.8;
}
else if(1){
r1jet=2.8;
njet=0.3;
r0jet=20.0;
rsjet=80.0;
Qjet=1.3; // chosen to help keep jet resolved even within disk region
}
}
else if (defcoordlocal == SJETCOORDS) {
}
else if (defcoordlocal == JET6COORDS) {
// see jet3coords_checknew.nb
npow=1.0;
/////////////////////
// RADIAL GRID SETUP
/////////////////////
npow=1.0; //don't change it, essentially equivalent to changing cpow2
//radial hyperexponential grid
// npow2=4.0; //power exponent
npow2=10.0; //power exponent
cpow2=1.0; //exponent prefactor (the larger it is, the more hyperexponentiation is)
// rbr = 1E3; //radius at which hyperexponentiation kicks in
rbr = 5E2; //radius at which hyperexponentiation kicks in
// must be same as in dxdxp()
// GODMARK: Note njet here is overwritten by njet later, but could have been different values if setup variable names differently.
if(0){ // first attempt
r1jet=2.8;
njet=0.3;
r0jet=7.0;
rsjet=21.0;
Qjet=1.7;
}
else if(0){ // chosen to resolve disk then resolve jet
r1jet=2.8;
njet=0.3;
r0jet=20.0;
rsjet=80.0;
Qjet=1.8;
}
else if(1){
r1jet=2.8;
njet=0.3;
r0jet=15.0;
rsjet=40.0;
Qjet=1.3; // chosen to help keep jet resolved even within disk region
}
// for switches from normal theta to ramesh theta
rs=40.0; // shift
r0=20.0; // divisor
// for theta1
// hslope=0.3 ; // resolve inner-radial region near equator
r0jet3=20.0; // divisor
rsjet3=0.0; // subtractor
// for theta2
h0=0.3; // inner-radial "hslope" for theta2
// GODMARK: Note that this overwrites above njet!
njet=1.0; // power \theta_j \propto r^{-njet}
// see fix_3dpoledtissue.nb
#if(0)
ntheta=21.0;
htheta=0.15;
rsjet2=5.0;
r0jet2=2.0;
#else
ntheta=5.0;
htheta=0.15;
rsjet2=5.0;
r0jet2=2.0;
#endif
}
else if (defcoordlocal == BPTHIN1) {
// see jet3coords_checknew.nb
bp_npow=1.0;
/////////////////////
// RADIAL GRID SETUP
/////////////////////
bp_npow=1.0; //don't change it, essentially equivalent to changing cpow2
//radial hyperexponential grid
// npow2=4.0; //power exponent
bp_npow2=10.0; //power exponent
bp_cpow2=1.0; //exponent prefactor (the larger it is, the more hyperexponentiation is)
// rbr = 1E3; //radius at which hyperexponentiation kicks in
bp_rbr = 5E2; //radius at which hyperexponentiation kicks in
// must be same as in dxdxp()
// GODMARK: Note njet here is overwritten by njet later, but could have been different values if setup variable names differently.
if(0){ // first attempt
bp_r1jet=2.8;
bp_njet=0.3;
bp_r0jet=7.0;
bp_rsjet=21.0;
bp_Qjet=1.7;
}
else if(0){ // chosen to resolve disk then resolve jet
bp_r1jet=2.8;
bp_njet=0.3;
bp_r0jet=20.0;
bp_rsjet=80.0;
bp_Qjet=1.8;
}
else if(1){
bp_r1jet=2.8;
bp_njet=0.3;
bp_r0jet=15.0;
bp_rsjet=40.0;
bp_Qjet=1.3; // chosen to help keep jet resolved even within disk region
}
// for switches from normal theta to ramesh theta
bp_rs=40.0; // shift
bp_r0=20.0; // divisor
// for theta1
// hslope=0.3 ; // resolve inner-radial region near equator
bp_r0jet3=20.0; // divisor
bp_rsjet3=0.0; // subtractor
// for theta2
bp_h0=0.3; // inner-radial "hslope" for theta2
// GODMARK: Note that this overwrites above njet!
bp_njet=1.0; // power \theta_j \propto r^{-njet}
// see fix_3dpoledtissue.nb
#if(0)
bp_ntheta=21.0;
bp_htheta=0.15;
bp_rsjet2=5.0;
bp_r0jet2=2.0;
#else
bp_ntheta=5.0;
bp_htheta=0.15;
bp_rsjet2=5.0;
bp_r0jet2=2.0;
#endif
}
else if (defcoordlocal == JET5COORDS) {
// exp grid merged with exp-exp grid
// parameters solved using hyperexp_gridnew.nb
// Depends upon Rin, Rout, Rj, totalsize[1], and for below we used Rin=1.2, Rout=10^(10), Rj=200, TS1=256, and ii0,CC,Rj for radial arctan
// Rj probably doesn't have to be the same thing, but for now it is since this is where grid changes alot and after which much lower resolution
#define JET5TOTALSIZE (256)
#define JET5RIN (1.2)
#define JET5ROUT (1.0E10)
// checks
if(totalsize[1]!=JET5TOTALSIZE){
dualfprintf(fail_file,"Current version of JET5COORDS requires totalsize[1]=256\n");
myexit(348766346);
}
// probably don't need to set Rout, but should in case user expects it
Rin=JET5RIN;
Rout=JET5ROUT;
AAAA=1999999.0/10000000.0; // 0.1999999
R0=AAAA; // effectively R0 is AAAA
AAA=0.0413459589685779052930351140071389811117796472908765122327766247871075306910922595355681060060416677474341974954736231119642058094;
// \
// 4691814961939384683077670140242359180355488020296128748293771170061841869426340268505040612342717691948841149166838622798123171255523798596 \
// 5818680547438536476798449141070248313113472199351567812172169767872353912078416440520778774394376979127646837398673038048093220394452697865 \
// 6270959185899435937659309684785579314134506823471357528404980034204759236451791458247221099942310718563615360919275492961171913096250029921 \
// 4602829374292931981963109018352727784709700476977587800651816760158953266217495724111120779750291873137970716049214552447910902507302350084 \
// 8366635098055440220680071046750709751515603946356328254368704921793804765397498748680467740257796496333857261456594221499641719912265168350 \
// 4446757128527854665947791196023009608509876847107243924551220166086198337782848685465542023953471925358173682394567187686793903610577481426 \
// 443229809938992518536215813767712488;
BBB=-11.730265173318042629015657514515818843547237290015385234914265620733433049284290050282184485;
// \
// 2224409622873658975481691490225985175297668826368377571878745806585146061321107420949292473465725043868512923396688827607703073903863397993 \
// 2646469619777851403629789176127509226495862609935541778298333029485043643870849780090683673135501928153917249217151527805740858293313649525 \
// 1577278440925240711864457756461606512526439401436022717818816632223921127138564528631741386676062985954517161211597241100034689634177608896 \
// 2609005653930210512763437351860547338180817425783109360814416873897105930531521949202423966791692201348394578245024979983828552773565452313 \
// 9427391374740569005171185204456464084827678985364372511780199067938494425840793867427758167352923180341529476553568176436448946131066359190 \
// 5940692681151957860911707070494249851557079085990630079038126862565401104450140890585318688339870170091825436768403083368348398427545899255 \
// 91796942327692774760083202686018064712337746785361430187509415618384926325;
DDD=0.055717934049496306640561701541245682756775321774122925900528950779091605796182691888079948813285317249415181430716632182425357598150;
// \
// 9878315509631578902141939586183299923885176395546296181175926730413185041822815279504848229461737912619728960820136753407636343528158363579 \
// 3015197668283754748946354820375719585870499599501931419253237151291548191762172574322092394412311930543039905230389647665970462514296542459 \
// 6284119291308204987329361603064178657563059514526318343174490238136571828705510375083642956288576409110703492926390263521348433706396587719 \
// 4076567127699214794076208495287633220730415894184618889390695112123895752908866508866230483057346798669374527001159485781544411226064994838 \
// 9334249843823760573294461519240571810219944708047592001849464422681300782954876398308748055099942704435601529920984600254710048152168797114 \
// 1500470907761667436213106445853175905130588447192393215135706743963572902579082652204804896110286228839660989062139576983695311500579346405 \
// 67924814417848136324354859648264319;
// control radial arctan
ii0=(FTYPE)(totalsize[1])*0.5;
CCCC=5.0;
Rj=200.0;
// control \theta's arctan
r1jet=2.8;
njet=0.3;
r0jet=20.0;
rsjet=80.0;
Qjet=1.3; // chosen to help keep jet resolved even within disk region
}
else if (defcoordlocal == PULSARCOORDS) {
if(0){// pulsar in force free
// pulsar_grid.nb for theta part and for the radial part:
// see pulsar_gridnew.nb
// for Rout=10^6 and R0=0.786*Rin Rin=4.84, npow=10 gives same dr/r as npow=1 R0=0.9*Rin at r=Rin
npow=1.0;
// must be same as in dxdxp()
r0jet=5.0; // spread in radius over which hslope changes
rsjet=18.0; // location of current sheet beginning for NS pulsar
}
else if(1){ // NS-pulsar in GRMHD
npow=10.0;
r0jet=5.0; // spread in radius over which hslope changes
rsjet=15.0; // location of current sheet beginning for NS pulsar
}
}
else if (defcoordlocal == UNIFORMCOORDS) {
//uniform grid for Cartesian coordinates
}
else if (defcoordlocal == BILOGCYLCOORDS) {
npow=10.0; // exponential rate
}
else if (defcoordlocal == RAMESHCOORDS || defcoordlocal == RAMESHCOORDS_HALFDISK) {
// myhslope=pow( (*r-rsjet)/r0jet , njet);
npow=10.0;
//npow=3.0;
r0jet=2.0; // divisor
njet=0.34; // power \theta_j \propto r^{-njet}
//njet=1.0;
rsjet=0.5; // subtractor
}
else if (defcoordlocal == JET4COORDS ) {
// see net_jet_grid.nb
// for small Rout, should use R0~0 (i.e. instead use R0~-3) or hslope>1
// this coordinate system uses: R0 and npow for radius , hslope for theta1 , rsjet and r0 for switch and switchi , h0, rs, r0, njet for theta2 (as in JET3COORDS)
// npow, R0, rs, r0, hslope, h0, r0jet, rsjet, njet
// for radial grid
npow=1.0;
// npow=10.0;
//npow=3.0;
R0 = -3.0;
// for switches
rs=15.0;
r0=25.0;
// for theta1
hslope=0.3 ; // resolve inner-radial region near equator
// below 2 not used right now
r0jet=15.0; // divisor
rsjet=0.0; // subtractor
// for theta2
njet=0.34; // power \theta_j \propto r^{-njet}
}
else if (defcoordlocal == UNI2LOG) {
if(1){
Nstar = 20; // # of cells between Rin and Rstar (probably Rin=0)
Afactor = 1000.0; // roughly Rout/Rstar
}
else{
// GODMARK
Nstar = 0;
Afactor = 1.01;
}
}
else{
dualfprintf(fail_file,"Shouldn't reach end of set_coord_parms: You set defcoordlocal=%d\n",defcoordlocal);
myexit(1);
}
}
// stuff that depends upon ANYTHING external that might be set by user in init_grid() or by system in init_defgrid(), like R0, Rin, hslope, h_over_r, etc.
void set_coord_parms_deps(int defcoordlocal)
{
#if(USEOPENMP)
if(omp_in_parallel()){
dualfprintf(fail_file,"set_coord_parms_deps() called in parallel region\n");
myexit(784653446);
}
#endif
// assumes R0, Rin, Rout, and hslope are so general that are set in init.c
if (defcoordlocal == LOGRSINTH) {
}
else if (defcoordlocal == REBECCAGRID) {
}
else if (defcoordlocal == COMPLEX0TH) {
}
else if(defcoordlocal == UNIRSINTH || defcoordlocal == UNIRSINTH2){
}
else if (defcoordlocal == EQMIRROR) {
}
else if(defcoordlocal == COMPLEX1TH) {
}
else if(defcoordlocal == COMPLEX2TH) {
thetatores=2.5*h_over_r;
// fixed coefficients
m2=(3.*(-2.*thetatores + M_PI))/(2.*x2trans) + (4.*thetatores)/(-1. + 2.*x2trans);
d2=(2.*thetatores - M_PI + 2.*M_PI*x2trans)/(-2.*pow(x2trans,3.) + 4.*pow(x2trans,4.));
c2=(6.*thetatores - 3.*M_PI + 6.*M_PI*x2trans)/(2.*pow(x2trans,2.) - 4.*pow(x2trans, 3.));
m3=(2.*thetatores)/(1. - 2.*x2trans);
b3=M_PI/2. + thetatores/(-1. + 2.*x2trans);
}
else if (defcoordlocal == LOGRUNITH) { // uniform theta and log in radius
}
else if (defcoordlocal == JET1COORDS) {
h0=hslope;
myrout=Rout;
dmyhslope1dr = (hf-h0)/(myrout-rh0);
dmyhslope2dx1=(hf-h0)/(x1out-x1in);
x1in=log(Rin-R0);
x1out=log(Rout-R0);
}
else if (defcoordlocal == JET2COORDS) {
}
else if (defcoordlocal == JET3COORDS) {
}
else if (defcoordlocal == SJETCOORDS) { // AKMARK
/////////////////////
// RADIAL GRID SETUP
/////////////////////
npow=global_npow; //don't change it, essentially equivalent to changing cpow2
//radial hyperexponential grid
npow2=global_npow2; //power exponent
cpow2=global_cpow2; //exponent prefactor (the larger it is, the more hyperexponentiation is)
rbr = global_rbr; //radius at which hyperexponentiation kicks in
x1br = log( rbr - R0 ) / npow; //the corresponding X[1] value
/////////////////////
//ANGULAR GRID SETUP
/////////////////////
x10 = global_x10;
x20 = global_x20;
//transverse resolution fraction devoted to different components
//(sum should be <1)
fracdisk = global_fracdisk;
fracjet = global_fracjet;
jetnu = global_jetnu; //the nu-parameter that determines jet shape
//subtractor, controls the size of the last few cells close to axis:
//if rsjet = 0, then no modification <- *** default for use with grid cylindrification
//if rsjet ~ 0.5, the grid is nearly vertical rather than monopolar,
// which makes the timestep larger
rsjet = global_rsjet;
//distance at which theta-resolution is *exactly* uniform in the jet grid -- want to have this at BH horizon;
//otherwise, near-uniform near jet axis but less resolution (much) further from it
//the larger r0grid, the larger the thickness of the jet
//to resolve
r0grid = global_r0grid;
//distance at which jet part of the grid becomes monopolar
//should be the same as r0disk to avoid cell crowding at the interface of jet and disk grids
r0jet = global_r0jet;
//distance after which the jet grid collimates according to the usual jet formula
//the larger this distance, the wider is the jet region of the grid
rjetend = global_rjetend;
//distance at which disk part of the grid becomes monopolar
//the larger r0disk, the larger the thickness of the disk
//to resolve
r0disk = global_r0disk;
//distance after which the disk grid collimates to merge with the jet grid
//should be roughly outer edge of the disk
rdiskend = global_rdiskend;
#if(USESJETLOGHOVERR)
torusrmax_loc = torusrmax;
#else
torusrmax_loc = 0.; //if not used, fill with dummy value
#endif
/////////////////////
//PHI GRID SETUP
/////////////////////
if( dofull2pi ) {
fracphi = 1;
}
else {
fracphi = global_fracphi; //phi-extent measured in units of 2*PI, i.e. 0.25 means PI/2
}
}
else if (defcoordlocal == JET6COORDS) {
x1br = log( rbr - R0 ) / npow; //the corresponding X[1] value
}
else if (defcoordlocal == BPTHIN1) {
bp_x1br = log( bp_rbr - R0 ) / bp_npow; //the corresponding X[1] value
}
else if (defcoordlocal == JET5COORDS) {
}
else if (defcoordlocal == PULSARCOORDS) {
if(0){// pulsar in force free
hinner=hslope; // hslope specifies inner hslope
houter=hslope*0.05; // reduce by some arbitrary factor (currently 1/20)
}
else if(1){ // NS-pulsar in GRMHD
hinner=1.9*hslope; // hslope specifies inner hslope
//houter=hslope*0.001; // reduce by some arbitrary factor (currently 1/20)
houter=hslope*1.5; // increase houter up to 2.0
}
}
else if (defcoordlocal == UNIFORMCOORDS) {
}
else if (defcoordlocal == BILOGCYLCOORDS) {
}
else if (defcoordlocal == RAMESHCOORDS || defcoordlocal == RAMESHCOORDS_HALFDISK) {
}
else if (defcoordlocal == JET4COORDS ) {
// for theta2
h0=hslope; // inner-radial "hslope" for theta2
}
else if (defcoordlocal == UNI2LOG) {
if(1){
Rstar = 10.0*1E5/Lunit; // 10km
}
else{
// GODMARK
Rstar = Rin;
}
if(Nstar==0){
if(fabs(Rstar-Rin)>SMALL){
dualfprintf(fail_file,"If Nstar=0 then Rstar=Rin must be set\n");
myexit(9279);
}
}
trifprintf("Rstar = %21.15g Nstar=%d Afactor=%21.15g\n",Rstar,Nstar,Afactor);
}
else{
dualfprintf(fail_file,"Shouldn't reach end of set_coord_parms: You set defcoordlocal=%d\n",defcoordlocal);
myexit(1);
}
}
void write_coord_parms(int defcoordlocal)
{
FILE *out;
int dimen;
#if(USEOPENMP)
if(omp_in_parallel()){
dualfprintf(fail_file,"write_coord_parms_parms() called in parallel region\n");
myexit(784653446);
}
#endif
if(myid==0){
if((out=fopen("coordparms.dat","wt"))==NULL){
dualfprintf(fail_file,"Couldn't write coordparms.dat file\n");
myexit(1);
}
else{
// same for all coords (notice no carraige return)
fprintf(out,"%21.15g %21.15g %21.15g %21.15g %d ",R0,Rin,Rout,hslope,dofull2pi);
if (defcoordlocal == LOGRSINTH) {
}
else if (defcoordlocal == REBECCAGRID) {
}
else if (defcoordlocal == COMPLEX0TH) {
}
else if(defcoordlocal == UNIRSINTH || defcoordlocal == UNIRSINTH2){
}
else if (defcoordlocal == EQMIRROR) {
}
else if(defcoordlocal == COMPLEX1TH) {
}
else if(defcoordlocal == COMPLEX2TH) {
fprintf(out,"%21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g\n",x2trans,thetatores,m2,d2,c2,m3,b3,h_over_r);
}
else if (defcoordlocal == LOGRUNITH) { // uniform theta and log in radius
}
else if (defcoordlocal == JET1COORDS) {
fprintf(out,"%21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g\n",npow,h0,hf,rh0,myrout,dmyhslope1dr,dmyhslope2dx1,x1in,x1out);
}
else if (defcoordlocal == JET2COORDS) {
fprintf(out,"%21.15g %21.15g %21.15g %21.15g\n",npow,r1jet,njet,rpjet);
}
else if (defcoordlocal == JET3COORDS) {
fprintf(out,"%21.15g %21.15g %21.15g %21.15g %21.15g %21.15g\n",npow,r1jet,njet,r0jet,rsjet,Qjet);
}
else if (defcoordlocal == SJETCOORDS) {
fprintf(out,"%21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g\n",npow,r1jet,njet,r0grid,r0jet,rjetend,rsjet,Qjet,fracphi,npow2,cpow2,rbr,x1br,fracdisk,fracjet,r0disk,rdiskend,torusrmax_loc,jetnu,x10,x20);
}
else if (defcoordlocal == JET6COORDS) {
fprintf(out,"%21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g\n",npow,r1jet,njet,r0jet,rsjet,Qjet,ntheta,htheta,rsjet2,r0jet2,rsjet3,r0jet3,rs,r0,npow2,cpow2,rbr,x1br);
}
else if (defcoordlocal == BPTHIN1) {
fprintf(out,"%21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g\n",bp_npow,bp_r1jet,bp_njet,bp_r0jet,bp_rsjet,bp_Qjet,bp_ntheta,bp_htheta,bp_rsjet2,bp_r0jet2,bp_rsjet3,bp_r0jet3,bp_rs,bp_r0,bp_npow2,bp_cpow2,bp_rbr,bp_x1br); // MARKTODO add bp_h0?
}
else if (defcoordlocal == JET5COORDS) {
fprintf(out,"%21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g\n",AAAA,AAA,BBB,DDD,ii0,CCCC,Rj);
fprintf(out,"%21.15g %21.15g %21.15g %21.15g %21.15g\n",r1jet,njet,r0jet,rsjet,Qjet);
}
else if (defcoordlocal == PULSARCOORDS) {
fprintf(out,"%21.15g %21.15g %21.15g %21.15g %21.15g\n",npow,hinner,houter,r0jet,rsjet);
}
else if (defcoordlocal == UNIFORMCOORDS) {
//uniform grid for Cartesian coordinates
DIMENLOOP(dimen) fprintf(out,"%21.15g ",Rin_array[dimen]);
DIMENLOOP(dimen) fprintf(out,"%21.15g ",Rout_array[dimen]);
fprintf(out,"\n");
}
else if (defcoordlocal == BILOGCYLCOORDS) {
fprintf(out,"%21.15g\n",npow);
}
else if (defcoordlocal == RAMESHCOORDS || defcoordlocal == RAMESHCOORDS_HALFDISK) {
fprintf(out,"%21.15g %21.15g %21.15g %21.15g\n",npow,r0jet,njet,rsjet);
}
else if (defcoordlocal == JET4COORDS) {
// npow, rs, r0, h0, r0jet, njet, rsjet
fprintf(out,"%21.15g %21.15g %21.15g %21.15g %21.15g %21.15g %21.15g\n",npow,rs,r0,h0,r0jet,njet,rsjet);
}
else if (defcoordlocal == UNI2LOG) {
fprintf(out,"%d %21.15g %21.15g\n",Nstar,Rstar,Afactor);
}
else{
dualfprintf(fail_file,"Shouldn't reach end of write_coord_parms: You set defcoordlocal=%d\n",defcoordlocal);
myexit(1);
}
fclose(out);
}
}
}
void read_coord_parms(int defcoordlocal)
{
FILE *in;
FTYPE ftemp;
int dimen;
#if(USEOPENMP)
if(omp_in_parallel()){
dualfprintf(fail_file,"read_coord_parms_parms() called in parallel region\n");
myexit(784653446);
}
#endif
if(myid==0){
in=fopen("coordparms.dat","rt");
if(in==NULL){
dualfprintf(fail_file,"Couldn't read coordparms.dat file. I'll assume coded coordinates and let restart header overwrite any global restart parameters\n");
set_coord_parms(defcoord);
}
else{
// don't want to overwrite since restart file sets this
// fscanf(in,HEADER5IN,&ftemp,&ftemp,&ftemp,&ftemp,&ftemp);
// NO: jon_interp.c requires read these in, so assume restart file has equal values to coordparms.dat file
fscanf(in,HEADER4IN,&R0,&Rin,&Rout,&hslope);
fscanf(in,"%d",&dofull2pi);
if (defcoordlocal == LOGRSINTH) {
}
else if (defcoordlocal == REBECCAGRID) {
}
else if (defcoordlocal == COMPLEX0TH) {
}
else if(defcoordlocal == UNIRSINTH || defcoordlocal == UNIRSINTH2){
}
else if (defcoordlocal == EQMIRROR) {
}
else if(defcoordlocal == COMPLEX1TH) {
}
else if(defcoordlocal == COMPLEX2TH) {
fscanf(in,HEADER8IN,&x2trans,&thetatores,&m2,&d2,&c2,&m3,&b3,&h_over_r);
}
else if (defcoordlocal == LOGRUNITH) { // uniform theta and log in radius
}
else if (defcoordlocal == JET1COORDS) {
fscanf(in,HEADER9IN,&npow,&h0,&hf,&rh0,&myrout,&dmyhslope1dr,&dmyhslope2dx1,&x1in,&x1out);
}
else if (defcoordlocal == JET2COORDS) {
fscanf(in,HEADER4IN,&npow,&r1jet,&njet,&rpjet);
}
else if (defcoordlocal == JET3COORDS) {
fscanf(in,HEADER6IN,&npow,&r1jet,&njet,&r0jet,&rsjet,&Qjet);
}
else if (defcoordlocal == SJETCOORDS) {
fscanf(in,HEADER9IN,&npow,&r1jet,&njet,&r0grid,&r0jet,&rjetend,&rsjet,&Qjet,&fracphi);
fscanf(in,HEADER9IN,&npow2,&cpow2,&rbr,&x1br,&fracdisk,&fracjet,&r0disk,&rdiskend,&torusrmax_loc);
fscanf(in,HEADER3IN,&jetnu,&x10,&x20);
}
else if (defcoordlocal == JET6COORDS) {
fscanf(in,HEADER18IN,&npow,&r1jet,&njet,&r0jet,&rsjet,&Qjet,&ntheta,&htheta,&rsjet2,&r0jet2,&rsjet3,&r0jet3,&rs,&r0,&npow2,&cpow2,&rbr,&x1br);
}
else if (defcoordlocal == BPTHIN1) {
fscanf(in,HEADER18IN,&bp_npow,&bp_r1jet,&bp_njet,&bp_r0jet,&bp_rsjet,&bp_Qjet,&bp_ntheta,&bp_htheta,&bp_rsjet2,&bp_r0jet2,&bp_rsjet3,&bp_r0jet3,&bp_rs,&bp_r0,&bp_npow2,&bp_cpow2,&bp_rbr,&bp_x1br);
}
else if (defcoordlocal == JET5COORDS) {
fscanf(in,HEADER7IN,&AAAA,&AAA,&BBB,&DDD,&ii0,&CCCC,&Rj);
fscanf(in,HEADER5IN,&r1jet,&njet,&r0jet,&rsjet,&Qjet);
}
else if (defcoordlocal == PULSARCOORDS) {
fscanf(in,HEADER5IN,&npow,&hinner,&houter,&r0jet,&rsjet);
}
else if (defcoordlocal == UNIFORMCOORDS) {
//uniform grid for Cartesian coordinates
DIMENLOOP(dimen) fscanf(in,HEADERONEIN,&Rin_array[dimen]);
DIMENLOOP(dimen) fscanf(in,HEADERONEIN,&Rout_array[dimen]);
}
else if (defcoordlocal == BILOGCYLCOORDS) {
fscanf(in,HEADERONEIN,&npow);
}
else if (defcoordlocal == RAMESHCOORDS|| defcoordlocal == RAMESHCOORDS_HALFDISK) {
fscanf(in,HEADER4IN,&npow,&r0jet,&njet,&rsjet);
}
else if (defcoordlocal == JET4COORDS) {
fscanf(in,HEADER7IN,&npow,&rs,&r0,&h0,&r0jet,&njet,&rsjet);
// npow, rs, r0, h0, r0jet, njet, rsjet
}
else if (defcoordlocal == UNI2LOG) {
fscanf(in,"%d",&Nstar);
fscanf(in,HEADERONEIN,&Rstar);
fscanf(in,HEADERONEIN,&Afactor);
}
else{
dualfprintf(fail_file,"Shouldn't reach end of read_coord_parms: You set defcoordlocal=%d\n",defcoordlocal);
myexit(1);
}
fclose(in);
}
}
#if(USEMPI)
// broadcast
MPI_Bcast(&R0, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&Rin, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&Rout, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&hslope, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&dofull2pi, 1, MPI_INT, MPIid[0], MPI_COMM_GRMHD);
if (defcoordlocal == LOGRSINTH) {
}
else if (defcoordlocal == REBECCAGRID) {
}
else if (defcoordlocal == COMPLEX0TH) {
}
else if(defcoordlocal == UNIRSINTH || defcoordlocal == UNIRSINTH2){
}
else if (defcoordlocal == EQMIRROR) {
}
else if(defcoordlocal == COMPLEX1TH) {
}
else if(defcoordlocal == COMPLEX2TH) {
MPI_Bcast(&x2trans, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&thetatores, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&m2, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&d2, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&c2, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&m3, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&b3, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
// MPI_Bcast(&h_over_r, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD); // set by pre_init_specific_init() in init.c
}
else if (defcoordlocal == LOGRUNITH) { // uniform theta and log in radius
}
else if (defcoordlocal == JET1COORDS) {
MPI_Bcast(&npow, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&h0, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&hf, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&rh0, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&myrout, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&dmyhslope1dr, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&dmyhslope2dx1, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&x1in, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&x1out, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
}
else if (defcoordlocal == JET2COORDS) {
MPI_Bcast(&npow, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&r1jet, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&njet, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&rpjet, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
}
else if (defcoordlocal == JET3COORDS) {
MPI_Bcast(&npow, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&r1jet, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&njet, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&r0jet, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&rsjet, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&Qjet, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
}
else if (defcoordlocal == SJETCOORDS) {
MPI_Bcast(&npow, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&r1jet, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&njet, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&r0grid, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&r0jet, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&rjetend, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&rsjet, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&Qjet, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
//new params
MPI_Bcast(&fracphi, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&npow2, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&cpow2, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&rbr, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&x1br, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&fracdisk, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&fracjet, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&r0disk, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&rdiskend, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&torusrmax_loc, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&jetnu, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&x10, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&x20, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
}
else if (defcoordlocal == JET6COORDS) {
MPI_Bcast(&npow, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&r1jet, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&njet, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&r0jet, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&rsjet, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&Qjet, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&ntheta, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&htheta, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&rsjet2, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&r0jet2, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&rsjet3, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&r0jet3, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&rs, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&r0, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&npow2, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&cpow2, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&rbr, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&x1br, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
}
else if (defcoordlocal == BPTHIN1) {
MPI_Bcast(&bp_npow, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&bp_r1jet, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&bp_njet, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&bp_r0jet, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&bp_rsjet, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&bp_Qjet, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&bp_ntheta, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&bp_htheta, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&bp_rsjet2, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&bp_r0jet2, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&bp_rsjet3, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&bp_r0jet3, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&bp_rs, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&bp_r0, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&bp_npow2, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&bp_cpow2, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&bp_rbr, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&bp_x1br, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
}
else if (defcoordlocal == JET5COORDS) {
MPI_Bcast(&AAAA, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&AAA, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&BBB, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&DDD, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&ii0, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&CCCC, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&Rj, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&r1jet, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&njet, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&r0jet, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&rsjet, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);
MPI_Bcast(&Qjet, 1, MPI_FTYPE, MPIid[0], MPI_COMM_GRMHD);