19  double precision :: 
t_aia(1:101)
 
   22  double precision :: 
f_335(1:101)
 
   35  data t_aia / 4. ,  4.05, 4.1,  4.15, 4.2,  4.25, 4.3,  4.35, &
 
   36               4.4,  4.45, 4.5,  4.55, 4.6,  4.65, 4.7,  4.75, &
 
   37               4.8,  4.85, 4.9,  4.95, 5. ,  5.05, 5.1,  5.15, &
 
   38               5.2,  5.25, 5.3,  5.35, 5.4,  5.45, 5.5,  5.55, &
 
   39               5.6,  5.65, 5.7,  5.75, 5.8,  5.85, 5.9,  5.95, &
 
   40               6. ,  6.05, 6.1,  6.15, 6.2,  6.25, 6.3,  6.35, &
 
   41               6.4,  6.45, 6.5,  6.55, 6.6,  6.65, 6.7,  6.75, &
 
   42               6.8,  6.85, 6.9,  6.95, 7. ,  7.05, 7.1,  7.15, &
 
   43               7.2,  7.25, 7.3,  7.35, 7.4,  7.45, 7.5,  7.55, &
 
   44               7.6,  7.65, 7.7,  7.75, 7.8,  7.85, 7.9,  7.95, &
 
   45               8. ,  8.05, 8.1,  8.15, 8.2,  8.25, 8.3,  8.35, &
 
   46               8.4,  8.45, 8.5,  8.55, 8.6,  8.65, 8.7,  8.75, &
 
   47               8.8,  8.85, 8.9,  8.95, 9. /
 
   49  data f_94 / 4.25022959
d-37, 4.35880298
d-36, 3.57054296
d-35, 2.18175426
d-34, & 
 
   50              8.97592571
d-34, 2.68512961
d-33, 7.49559346
d-33, 2.11603751
d-32, &
 
   51              5.39752853
d-32, 1.02935904
d-31, 1.33822307
d-31, 1.40884290
d-31, &
 
   52              1.54933156
d-31, 2.07543102
d-31, 3.42026227
d-31, 6.31171444
d-31, &
 
   53              1.16559416
d-30, 1.95360497
d-30, 2.77818735
d-30, 3.43552578
d-30, &
 
   54              4.04061803
d-30, 4.75470982
d-30, 5.65553769
d-30, 6.70595782
d-30, &
 
   55              7.80680354
d-30, 8.93247715
d-30, 1.02618156
d-29, 1.25979030
d-29, &
 
   56              1.88526483
d-29, 3.62448572
d-29, 7.50553279
d-29, 1.42337571
d-28, &
 
   57              2.37912813
d-28, 3.55232305
d-28, 4.84985757
d-28, 6.20662827
d-28, &
 
   58              7.66193687
d-28, 9.30403645
d-28, 1.10519802
d-27, 1.25786927
d-27, &
 
   59              1.34362634
d-27, 1.33185242
d-27, 1.22302081
d-27, 1.05677973
d-27, &
 
   60              9.23064720
d-28, 8.78570994
d-28, 8.02397416
d-28, 5.87681142
d-28, &
 
   61              3.82272695
d-28, 3.11492649
d-28, 3.85736090
d-28, 5.98893519
d-28, &
 
   62              9.57553548
d-28, 1.46650267
d-27, 2.10365847
d-27, 2.79406671
d-27, &
 
   63              3.39420087
d-27, 3.71077520
d-27, 3.57296767
d-27, 2.95114380
d-27, &
 
   64              2.02913103
d-27, 1.13361825
d-27, 5.13405629
d-28, 2.01305089
d-28, &
 
   65              8.15781482
d-29, 4.28366817
d-29, 3.08701543
d-29, 2.68693906
d-29, &
 
   66              2.51764203
d-29, 2.41773103
d-29, 2.33996083
d-29, 2.26997246
d-29, &
 
   67              2.20316143
d-29, 2.13810001
d-29, 2.07424438
d-29, 2.01149189
d-29, &
 
   68              1.94980213
d-29, 1.88917920
d-29, 1.82963583
d-29, 1.77116920
d-29, &
 
   69              1.71374392
d-29, 1.65740593
d-29, 1.60214447
d-29, 1.54803205
d-29, &
 
   70              1.49510777
d-29, 1.44346818
d-29, 1.39322305
d-29, 1.34441897
d-29, &
 
   71              1.29713709
d-29, 1.25132618
d-29, 1.20686068
d-29, 1.14226584
d-29, &
 
   72              1.09866413
d-29, 1.05635524
d-29, 1.01532444
d-29, 9.75577134
d-30, &
 
   73              9.37102736
d-30, 8.99873335
d-30, 8.63860172
d-30, 8.29051944
d-30, &
 
   76  data f_131 / 3.18403601
d-37,   3.22254703
d-36,   2.61657920
d-35, &
 
   77               1.59575286
d-34,   6.65779556
d-34,   2.07015132
d-33, &
 
   78               6.05768615
d-33,   1.76074833
d-32,   4.52633001
d-32, &
 
   79               8.57121883
d-32,   1.09184271
d-31,   1.10207963
d-31, &
 
   80               1.11371658
d-31,   1.29105226
d-31,   1.80385897
d-31, &
 
   81               3.27295431
d-31,   8.92002136
d-31,   3.15214579
d-30, &
 
   82               9.73440787
d-30,   2.22709702
d-29,   4.01788984
d-29, &
 
   83               6.27471832
d-29,   8.91764995
d-29,   1.18725647
d-28, &
 
   84               1.52888040
d-28,   2.05082946
d-28,   3.47651873
d-28, &
 
   85               8.80482184
d-28,   2.66533063
d-27,   7.05805149
d-27, &
 
   86               1.46072515
d-26,   2.45282476
d-26,   3.55303726
d-26, &
 
   87               4.59075911
d-26,   5.36503515
d-26,   5.68444094
d-26, &
 
   88               5.47222296
d-26,   4.81119761
d-26,   3.85959059
d-26, &
 
   89               2.80383406
d-26,   1.83977650
d-26,   1.11182849
d-26, &
 
   90               6.50748885
d-27,   3.96843481
d-27,   2.61876319
d-27, &
 
   91               1.85525324
d-27,   1.39717024
d-27,   1.11504283
d-27, &
 
   92               9.38169611
d-28,   8.24801234
d-28,   7.43331919
d-28, &
 
   93               6.74537063
d-28,   6.14495760
d-28,   5.70805277
d-28, &
 
   94               5.61219786
d-28,   6.31981777
d-28,   9.19747307
d-28, &
 
   95               1.76795732
d-27,   3.77985446
d-27,   7.43166191
d-27, &
 
   96               1.19785603
d-26,   1.48234676
d-26,   1.36673114
d-26, &
 
   97               9.61047146
d-27,   5.61209353
d-27,   3.04779780
d-27, &
 
   98               1.69378976
d-27,   1.02113491
d-27,   6.82223774
d-28, &
 
   99               5.02099099
d-28,   3.99377760
d-28,   3.36279037
d-28, &
 
  100               2.94767378
d-28,   2.65740865
d-28,   2.44396277
d-28, &
 
  101               2.28003967
d-28,   2.14941419
d-28,   2.04178995
d-28, &
 
  102               1.95031045
d-28,   1.87011994
d-28,   1.79777869
d-28, &
 
  103               1.73093957
d-28,   1.66795789
d-28,   1.60785455
d-28, &
 
  104               1.55002399
d-28,   1.49418229
d-28,   1.44022426
d-28, &
 
  105               1.38807103
d-28,   1.33772767
d-28,   1.28908404
d-28, &
 
  106               1.24196208
d-28,   1.17437501
d-28,   1.12854330
d-28, &
 
  107               1.08410498
d-28,   1.04112003
d-28,   9.99529904
d-29, &
 
  108               9.59358806
d-29,   9.20512291
d-29,   8.83009123
d-29, &
 
  109               8.46817043
d-29,   8.11921928
d-29 /
 
  111  data f_171 / 2.98015581
d-42, 1.24696230
d-40, 3.37614652
d-39, 5.64103034
d-38, &
 
  112               5.20550266
d-37, 2.77785939
d-36, 1.16283616
d-35, 6.50007689
d-35, &
 
  113               9.96177399
d-34, 1.89586076
d-32, 2.10982799
d-31, 1.36946479
d-30, &
 
  114               6.27396553
d-30, 2.29955134
d-29, 7.13430211
d-29, 1.91024282
d-28, &
 
  115               4.35358848
d-28, 7.94807808
d-28, 1.07431875
d-27, 1.08399488
d-27, &
 
  116               9.16212938
d-28, 7.34715770
d-28, 6.59246382
d-28, 9.13541375
d-28, &
 
  117               2.05939035
d-27, 5.08206555
d-27, 1.10148083
d-26, 2.01884662
d-26, &
 
  118               3.13578384
d-26, 4.14367719
d-26, 5.36067711
d-26, 8.74170213
d-26, &
 
  119               1.64161233
d-25, 2.94587860
d-25, 4.76298332
d-25, 6.91765639
d-25, &
 
  120               9.08825111
d-25, 1.08496183
d-24, 1.17440114
d-24, 1.13943939
d-24, &
 
  121               9.71696981
d-25, 7.09593688
d-25, 4.31376399
d-25, 2.12708486
d-25, &
 
  122               8.47429567
d-26, 3.17608104
d-26, 1.95898842
d-26, 1.98064242
d-26, &
 
  123               1.67706555
d-26, 8.99126003
d-27, 3.29773878
d-27, 1.28896127
d-27, &
 
  124               8.51169698
d-28, 7.53520167
d-28, 6.18268143
d-28, 4.30034650
d-28, &
 
  125               2.78152409
d-28, 1.95437088
d-28, 1.65896278
d-28, 1.68740181
d-28, &
 
  126               1.76054383
d-28, 1.63978419
d-28, 1.32880591
d-28, 1.00833205
d-28, &
 
  127               7.82252806
d-29, 6.36181741
d-29, 5.34633869
d-29, 4.58013864
d-29, &
 
  128               3.97833422
d-29, 3.49414760
d-29, 3.09790940
d-29, 2.76786227
d-29, &
 
  129               2.48806269
d-29, 2.24823367
d-29, 2.04016653
d-29, 1.85977413
d-29, &
 
  130               1.70367499
d-29, 1.56966125
d-29, 1.45570643
d-29, 1.35964565
d-29, &
 
  131               1.27879263
d-29, 1.21016980
d-29, 1.15132499
d-29, 1.09959628
d-29, &
 
  132               1.05307482
d-29, 1.01040261
d-29, 9.70657096
d-30, 9.33214234
d-30, &
 
  133               8.97689427
d-30, 8.63761192
d-30, 8.31149879
d-30, 7.85162401
d-30, &
 
  134               7.53828281
d-30, 7.23559452
d-30, 6.94341530
d-30, 6.66137038
d-30, &
 
  135               6.38929156
d-30, 6.12669083
d-30, 5.87346434
d-30, 5.62943622
d-30, & 
 
  138  data f_193 / 6.40066486
d-32, 4.92737300
d-31, 2.95342934
d-30, 1.28061594
d-29, & 
 
  139               3.47747667
d-29, 5.88554792
d-29, 7.72171179
d-29, 9.75609282
d-29, &
 
  140               1.34318963
d-28, 1.96252638
d-28, 2.70163878
d-28, 3.63192965
d-28, &
 
  141               5.28087341
d-28, 8.37821446
d-28, 1.39089159
d-27, 2.31749718
d-27, &
 
  142               3.77510689
d-27, 5.85198594
d-27, 8.26021568
d-27, 1.04870405
d-26, &
 
  143               1.25209374
d-26, 1.47406787
d-26, 1.77174067
d-26, 2.24098537
d-26, &
 
  144               3.05926105
d-26, 4.50018853
d-26, 6.84720216
d-26, 1.00595861
d-25, &
 
  145               1.30759222
d-25, 1.36481773
d-25, 1.15943558
d-25, 1.01467304
d-25, &
 
  146               1.04092532
d-25, 1.15071251
d-25, 1.27416033
d-25, 1.38463476
d-25, &
 
  147               1.47882726
d-25, 1.57041238
d-25, 1.69786224
d-25, 1.94970397
d-25, &
 
  148               2.50332918
d-25, 3.58321431
d-25, 5.18061550
d-25, 6.60405549
d-25, &
 
  149               6.64085365
d-25, 4.83825816
d-25, 2.40545020
d-25, 8.59534098
d-26, &
 
  150               2.90920638
d-26, 1.33204845
d-26, 9.03933926
d-27, 7.78910836
d-27, &
 
  151               7.29342321
d-27, 7.40267022
d-27, 8.05279981
d-27, 8.13829291
d-27, &
 
  152               6.92634262
d-27, 5.12521880
d-27, 3.59527615
d-27, 2.69617560
d-27, &
 
  153               2.84432713
d-27, 5.06697306
d-27, 1.01281903
d-26, 1.63526978
d-26, &
 
  154               2.06759342
d-26, 2.19482312
d-26, 2.10050611
d-26, 1.89837248
d-26, &
 
  155               1.66347131
d-26, 1.43071097
d-26, 1.21518419
d-26, 1.02078343
d-26, &
 
  156               8.46936184
d-27, 6.93015742
d-27, 5.56973237
d-27, 4.38951754
d-27, &
 
  157               3.38456457
d-27, 2.55309556
d-27, 1.88904224
d-27, 1.38057546
d-27, &
 
  158               1.00718330
d-27, 7.43581116
d-28, 5.63562931
d-28, 4.43359435
d-28, &
 
  159               3.63923535
d-28, 3.11248143
d-28, 2.75586846
d-28, 2.50672237
d-28, &
 
  160               2.32419348
d-28, 2.18325682
d-28, 2.06834486
d-28, 1.93497044
d-28, &
 
  161               1.84540751
d-28, 1.76356504
d-28, 1.68741425
d-28, 1.61566157
d-28, &
 
  162               1.54754523
d-28, 1.48249410
d-28, 1.42020176
d-28, 1.36045230
d-28, &
 
  165  data f_211 / 4.74439912
d-42, 1.95251522
d-40, 5.19700194
d-39, 8.53120166
d-38, &
 
  166               7.72745727
d-37, 4.04158559
d-36, 1.64853511
d-35, 8.56295439
d-35, &
 
  167               1.17529722
d-33, 2.16867729
d-32, 2.40472264
d-31, 1.56418133
d-30, &
 
  168               7.20032889
d-30, 2.65838271
d-29, 8.33196904
d-29, 2.26128236
d-28, &
 
  169               5.24295811
d-28, 9.77791121
d-28, 1.35913489
d-27, 1.43957785
d-27, &
 
  170               1.37591544
d-27, 1.49029886
d-27, 2.06183401
d-27, 3.31440622
d-27, &
 
  171               5.42497318
d-27, 8.41100374
d-27, 1.17941366
d-26, 1.49269794
d-26, &
 
  172               1.71506074
d-26, 1.71266353
d-26, 1.51434781
d-26, 1.36766622
d-26, &
 
  173               1.33483562
d-26, 1.36834518
d-26, 1.45829002
d-26, 1.62575306
d-26, &
 
  174               1.88773347
d-26, 2.22026986
d-26, 2.54930499
d-26, 2.80758138
d-26, &
 
  175               3.06176409
d-26, 3.62799792
d-26, 5.13226109
d-26, 8.46260744
d-26, &
 
  176               1.38486586
d-25, 1.86192535
d-25, 1.78007934
d-25, 1.16548409
d-25, &
 
  177               5.89293257
d-26, 2.69952884
d-26, 1.24891081
d-26, 6.41273176
d-27, &
 
  178               4.08282914
d-27, 3.26463328
d-27, 2.76230280
d-27, 2.08986882
d-27, &
 
  179               1.37658470
d-27, 8.48489381
d-28, 5.19304217
d-28, 3.19312514
d-28, &
 
  180               2.02968197
d-28, 1.50171666
d-28, 1.39164218
d-28, 1.42448821
d-28, &
 
  181               1.41714519
d-28, 1.33341059
d-28, 1.20759270
d-28, 1.07259692
d-28, &
 
  182               9.44895400
d-29, 8.29030041
d-29, 7.25440631
d-29, 6.33479483
d-29, &
 
  183               5.51563757
d-29, 4.79002469
d-29, 4.14990482
d-29, 3.59384972
d-29, &
 
  184               3.12010860
d-29, 2.72624742
d-29, 2.40734791
d-29, 2.15543565
d-29, &
 
  185               1.95921688
d-29, 1.80682882
d-29, 1.68695662
d-29, 1.59020936
d-29, &
 
  186               1.50940886
d-29, 1.43956179
d-29, 1.37731622
d-29, 1.32049043
d-29, &
 
  187               1.26771875
d-29, 1.21803879
d-29, 1.17074716
d-29, 1.10507836
d-29, &
 
  188               1.06022834
d-29, 1.01703080
d-29, 9.75436986
d-30, 9.35349257
d-30, &
 
  189               8.96744546
d-30, 8.59527489
d-30, 8.23678940
d-30, 7.89144480
d-30, & 
 
  192  data f_304 / 3.62695850
d-32, 2.79969087
d-31, 1.68340584
d-30, 7.32681440
d-30, &
 
  193               1.99967770
d-29, 3.41296785
d-29, 4.55409104
d-29, 5.94994635
d-29, &
 
  194               8.59864963
d-29, 1.39787633
d-28, 3.17701965
d-28, 1.14474920
d-27, &
 
  195               4.44845958
d-27, 1.54785841
d-26, 4.70265345
d-26, 1.24524365
d-25, &
 
  196               2.81535352
d-25, 5.10093666
d-25, 6.83545307
d-25, 6.82110329
d-25, &
 
  197               5.66886188
d-25, 4.36205513
d-25, 3.29265688
d-25, 2.49802368
d-25, &
 
  198               1.92527113
d-25, 1.51058572
d-25, 1.20596047
d-25, 9.76884267
d-26, &
 
  199               7.89979266
d-26, 6.18224289
d-26, 4.67298332
d-26, 3.57934505
d-26, &
 
  200               2.84535785
d-26, 2.32853022
d-26, 1.95228514
d-26, 1.67880071
d-26, &
 
  201               1.47608785
d-26, 1.32199691
d-26, 1.20070960
d-26, 1.09378177
d-26, &
 
  202               1.00031730
d-26, 9.62434001
d-27, 1.05063954
d-26, 1.27267143
d-26, &
 
  203               1.45923057
d-26, 1.36746707
d-26, 1.03466970
d-26, 6.97647829
d-27, &
 
  204               4.63141039
d-27, 3.19031994
d-27, 2.33373613
d-27, 1.81589079
d-27, &
 
  205               1.48446917
d-27, 1.26611478
d-27, 1.12617468
d-27, 1.03625148
d-27, &
 
  206               9.61400595
d-28, 8.79016231
d-28, 7.82612130
d-28, 6.73762960
d-28, &
 
  207               5.59717956
d-28, 4.53010243
d-28, 3.65712196
d-28, 3.00958686
d-28, &
 
  208               2.54011502
d-28, 2.18102277
d-28, 1.88736437
d-28, 1.63817539
d-28, &
 
  209               1.42283147
d-28, 1.23631916
d-28, 1.07526003
d-28, 9.36797928
d-29, &
 
  210               8.18565660
d-29, 7.18152734
d-29, 6.32523238
d-29, 5.59513985
d-29, &
 
  211               4.96614048
d-29, 4.42518826
d-29, 3.95487628
d-29, 3.54690294
d-29, &
 
  212               3.18953930
d-29, 2.87720933
d-29, 2.60186750
d-29, 2.36011522
d-29, &
 
  213               2.14717806
d-29, 1.95905217
d-29, 1.79287981
d-29, 1.64562262
d-29, &
 
  214               1.51489425
d-29, 1.39876064
d-29, 1.29496850
d-29, 1.18665438
d-29, &
 
  215               1.10240474
d-29, 1.02643099
d-29, 9.57780996
d-30, 8.95465151
d-30, &
 
  216               8.38950190
d-30, 7.87283711
d-30, 7.40136507
d-30, 6.96804279
d-30, & 
 
  219  data f_335 / 2.46882661
d-32, 1.89476632
d-31, 1.13216502
d-30, 4.89532008
d-30, & 
 
  220               1.32745970
d-29, 2.25390335
d-29, 3.00511672
d-29, 3.96035934
d-29, &
 
  221               5.77977656
d-29, 8.58600736
d-29, 1.14083000
d-28, 1.48644411
d-28, &
 
  222               2.15788823
d-28, 3.51628877
d-28, 6.12200698
d-28, 1.08184987
d-27, &
 
  223               1.85590697
d-27, 2.91679107
d-27, 3.94405396
d-27, 4.63610680
d-27, &
 
  224               5.13824456
d-27, 5.66602209
d-27, 6.30009232
d-27, 7.03422868
d-27, &
 
  225               7.77973918
d-27, 8.32371831
d-27, 8.56724316
d-27, 8.62601374
d-27, &
 
  226               8.13308844
d-27, 6.53188216
d-27, 4.55197029
d-27, 3.57590087
d-27, &
 
  227               3.59571707
d-27, 4.03502770
d-27, 4.54366411
d-27, 4.96914990
d-27, &
 
  228               5.24601170
d-27, 5.39979250
d-27, 5.43023669
d-27, 5.26235042
d-27, &
 
  229               4.91585495
d-27, 4.52628362
d-27, 4.13385020
d-27, 3.67538967
d-27, &
 
  230               3.39939742
d-27, 3.81284533
d-27, 5.02332701
d-27, 6.19438602
d-27, &
 
  231               6.49613071
d-27, 6.04010475
d-27, 5.24664275
d-27, 4.37225997
d-27, &
 
  232               3.52957182
d-27, 2.76212276
d-27, 2.08473158
d-27, 1.50850518
d-27, &
 
  233               1.04602472
d-27, 7.13091243
d-28, 5.34289645
d-28, 5.21079581
d-28, &
 
  234               6.22246365
d-28, 6.99555864
d-28, 6.29665489
d-28, 4.45077026
d-28, &
 
  235               2.67046793
d-28, 1.52774686
d-28, 9.18061770
d-29, 6.09116074
d-29, &
 
  236               4.48562572
d-29, 3.59463696
d-29, 3.05820218
d-29, 2.70766652
d-29, &
 
  237               2.46144034
d-29, 2.27758450
d-29, 2.13331183
d-29, 2.01537836
d-29, &
 
  238               1.91566180
d-29, 1.82893912
d-29, 1.75167748
d-29, 1.68136168
d-29, &
 
  239               1.61615595
d-29, 1.55481846
d-29, 1.49643236
d-29, 1.44046656
d-29, &
 
  240               1.38657085
d-29, 1.33459068
d-29, 1.28447380
d-29, 1.23615682
d-29, &
 
  241               1.18963296
d-29, 1.14478976
d-29, 1.10146637
d-29, 1.04039479
d-29, &
 
  242               9.98611410
d-30, 9.58205147
d-30, 9.19202009
d-30, 8.81551313
d-30, &
 
  243               8.45252127
d-30, 8.10224764
d-30, 7.76469090
d-30, 7.43954323
d-30, &
 
  249  data t_iris / 4.        , 4.1       , 4.2       , 4.3       , 4.40000001, &
 
  250                4.50000001, 4.60000001, 4.70000001, 4.80000001, 4.90000001, &
 
  251                5.00000001, 5.10000002, 5.20000002, 5.30000002, 5.40000002, &
 
  252                5.50000002, 5.60000002, 5.70000003, 5.80000003, 5.90000003, &
 
  253                6.00000003, 6.10000003, 6.20000003, 6.30000003, 6.40000004, &
 
  254                6.50000004, 6.60000004, 6.70000004, 6.80000004, 6.90000004, &
 
  255                7.00000004, 7.10000005, 7.20000005, 7.30000005, 7.40000005, &
 
  256                7.50000005, 7.60000005, 7.70000006, 7.80000006, 7.90000006, &
 
  259  data f_1354 / 0.00000000
d+00, 0.00000000
d+00, 0.00000000
d+00, 0.00000000
d+00, &
 
  260                0.00000000
d+00, 0.00000000
d+00, 0.00000000
d+00, 0.00000000
d+00, &
 
  261                0.00000000
d+00, 0.00000000
d+00, 0.00000000
d+00, 0.00000000
d+00, &
 
  262                0.00000000
d+00, 0.00000000
d+00, 0.00000000
d+00, 0.00000000
d+00, &
 
  263                0.00000000
d+00, 0.00000000
d+00, 0.00000000
d+00, 0.00000000
d+00, &
 
  264                0.00000000
d+00, 0.00000000
d+00, 0.00000000
d+00, 1.09503647
d-39, &
 
  265                5.47214550
d-36, 2.42433983
d-33, 2.75295034
d-31, 1.21929718
d-29, &
 
  266                2.48392125
d-28, 2.33268145
d-27, 8.68623633
d-27, 1.00166284
d-26, &
 
  267                3.63126633
d-27, 7.45174807
d-28, 1.38224064
d-28, 2.69270994
d-29, &
 
  268                5.53314977
d-30, 1.15313092
d-30, 2.34195788
d-31, 4.48242942
d-32, &
 
  274  data t_eis1 / 1.99526231
d+05, 2.23872114
d+05, 2.51188643
d+05, 2.81838293
d+05, & 
 
  275                3.16227766
d+05, 3.54813389
d+05, 3.98107171
d+05, 4.46683592
d+05, &
 
  276                5.01187234
d+05, 5.62341325
d+05, 6.30957344
d+05, 7.07945784
d+05, &
 
  277                7.94328235
d+05, 8.91250938
d+05, 1.00000000
d+06, 1.12201845
d+06, &
 
  278                1.25892541
d+06, 1.41253754
d+06, 1.58489319
d+06, 1.77827941
d+06, &
 
  279                1.99526231
d+06, 2.23872114
d+06, 2.51188643
d+06, 2.81838293
d+06, &
 
  280                3.16227766
d+06, 3.54813389
d+06, 3.98107171
d+06, 4.46683592
d+06, &
 
  281                5.01187234
d+06, 5.62341325
d+06, 6.30957344
d+06, 7.07945784
d+06, &
 
  282                7.94328235
d+06, 8.91250938
d+06, 1.00000000
d+07, 1.12201845
d+07, &
 
  283                1.25892541
d+07, 1.41253754
d+07, 1.58489319
d+07, 1.77827941
d+07, &
 
  284                1.99526231
d+07, 2.23872114
d+07, 2.51188643
d+07, 2.81838293
d+07, &
 
  285                3.16227766
d+07, 3.54813389
d+07, 3.98107171
d+07, 4.46683592
d+07, &
 
  286                5.01187234
d+07, 5.62341325
d+07, 6.30957344
d+07, 7.07945784
d+07, &
 
  287                7.94328235
d+07, 8.91250938
d+07, 1.00000000
d+08, 1.12201845
d+08, &
 
  288                1.25892541
d+08, 1.41253754
d+08, 1.58489319
d+08, 1.77827941
d+08 /
 
  290  data t_eis2 / 1.99526231
d+06, 2.23872114
d+06, 2.51188643
d+06, 2.81838293
d+06, & 
 
  291                3.16227766
d+06, 3.54813389
d+06, 3.98107171
d+06, 4.46683592
d+06, &
 
  292                5.01187234
d+06, 5.62341325
d+06, 6.30957344
d+06, 7.07945784
d+06, &
 
  293                7.94328235
d+06, 8.91250938
d+06, 1.00000000
d+07, 1.12201845
d+07, &
 
  294                1.25892541
d+07, 1.41253754
d+07, 1.58489319
d+07, 1.77827941
d+07, &
 
  295                1.99526231
d+07, 2.23872114
d+07, 2.51188643
d+07, 2.81838293
d+07, &
 
  296                3.16227766
d+07, 3.54813389
d+07, 3.98107171
d+07, 4.46683592
d+07, &
 
  297                5.01187234
d+07, 5.62341325
d+07, 6.30957344
d+07, 7.07945784
d+07, &
 
  298                7.94328235
d+07, 8.91250938
d+07, 1.00000000
d+08, 1.12201845
d+08, &
 
  299                1.25892541
d+08, 1.41253754
d+08, 1.58489319
d+08, 1.77827941
d+08, &
 
  300                1.99526231
d+08, 2.23872114
d+08, 2.51188643
d+08, 2.81838293
d+08, &
 
  301                3.16227766
d+08, 3.54813389
d+08, 3.98107171
d+08, 4.46683592
d+08, &
 
  302                5.01187234
d+08, 5.62341325
d+08, 6.30957344
d+08, 7.07945784
d+08, &
 
  303                7.94328235
d+08, 8.91250938
d+08, 1.00000000
d+09, 1.12201845
d+09, &
 
  304                1.25892541
d+09, 1.41253754
d+09, 1.58489319
d+09, 1.77827941
d+09 /
 
  306  data f_263 /  0.00000000
d+00, 0.00000000
d+00, 0.00000000
d+00, 0.00000000
d+00, & 
 
  307                0.00000000
d+00, 0.00000000
d+00, 0.00000000
d+00, 0.00000000
d+00, &
 
  308                0.00000000
d+00, 4.46454917
d-45, 3.26774829
d-42, 1.25292566
d-39, &
 
  309                2.66922338
d-37, 3.28497742
d-35, 2.38677554
d-33, 1.03937729
d-31, &
 
  310                2.75075687
d-30, 4.47961733
d-29, 4.46729177
d-28, 2.64862689
d-27, &
 
  311                8.90863800
d-27, 1.72437548
d-26, 2.22217752
d-26, 2.27999477
d-26, &
 
  312                2.08264363
d-26, 1.78226687
d-26, 1.45821699
d-26, 1.14675379
d-26, &
 
  313                8.63082492
d-27, 6.15925429
d-27, 4.11252514
d-27, 2.51530564
d-27, &
 
  314                1.37090986
d-27, 6.42443134
d-28, 2.48392636
d-28, 7.59187874
d-29, &
 
  315                1.77852938
d-29, 3.23945221
d-30, 4.90533903
d-31, 6.75458158
d-32, &
 
  316                9.06878868
d-33, 1.23927474
d-33, 1.75769395
d-34, 2.60710914
d-35, &
 
  317                4.04318030
d-36, 6.53500581
d-37, 1.09365022
d-37, 1.88383322
d-38, &
 
  318                3.31425233
d-39, 5.90964084
d-40, 1.06147549
d-40, 1.90706170
d-41, &
 
  319                3.41331584
d-42, 6.07310718
d-43, 1.07364738
d-43, 1.89085498
d-44, &
 
  320                3.32598922
d-45, 5.87125640
d-46, 0.00000000
d+00, 0.00000000
d+00 /
 
  322  data f_264 /  0.00000000
d+00, 2.81670057
d-46, 1.28007268
d-43, 2.54586603
d-41, & 
 
  323                2.67887256
d-39, 1.68413285
d-37, 6.85702304
d-36, 1.91797284
d-34, &
 
  324                3.84675839
d-33, 5.69939170
d-32, 6.36224608
d-31, 5.39176489
d-30, &
 
  325                3.45478458
d-29, 1.64848693
d-28, 5.71476364
d-28, 1.39909997
d-27, &
 
  326                2.37743056
d-27, 2.86712530
d-27, 2.65206348
d-27, 2.07175767
d-27, &
 
  327                1.47866767
d-27, 1.01087374
d-27, 6.79605811
d-28, 4.54746770
d-28, &
 
  328                3.04351751
d-28, 2.03639149
d-28, 1.35940991
d-28, 9.01451939
d-29, &
 
  329                5.91289972
d-29, 3.81821178
d-29, 2.41434696
d-29, 1.48871220
d-29, &
 
  330                8.93362094
d-30, 5.21097445
d-30, 2.95964719
d-30, 1.64278748
d-30, &
 
  331                8.95571660
d-31, 4.82096011
d-31, 2.57390991
d-31, 1.36821781
d-31, &
 
  332                7.27136350
d-32, 3.87019426
d-32, 2.06883430
d-32, 1.11228884
d-32, &
 
  333                6.01883313
d-33, 3.27790676
d-33, 1.79805012
d-33, 9.93085346
d-34, &
 
  334                5.52139556
d-34, 3.08881387
d-34, 1.73890315
d-34, 9.84434964
d-35, &
 
  335                5.60603378
d-35, 3.20626492
d-35, 1.84111068
d-35, 0.00000000
d+00, &
 
  336                0.00000000
d+00, 0.00000000
d+00, 0.00000000
d+00, 0.00000000
d+00 /
 
  338  data f_192 /  0.00000000
d+00, 0.00000000
d+00, 0.00000000
d+00, 4.35772105
d-44, & 
 
  339                1.26162319
d-41, 1.97471205
d-39, 1.83409019
d-37, 1.08206288
d-35, &
 
  340                4.27914363
d-34, 1.17943846
d-32, 2.32565755
d-31, 3.33087991
d-30, &
 
  341                3.47013260
d-29, 2.60375866
d-28, 1.37737127
d-27, 5.01053913
d-27, &
 
  342                1.23479810
d-26, 2.11310542
d-26, 2.71831513
d-26, 2.89851163
d-26, &
 
  343                2.77312376
d-26, 2.50025229
d-26, 2.18323661
d-26, 1.86980322
d-26, &
 
  344                1.58035034
d-26, 1.31985651
d-26, 1.08733133
d-26, 8.81804906
d-27, &
 
  345                7.00417973
d-27, 5.43356567
d-27, 4.09857884
d-27, 2.99651764
d-27, &
 
  346                2.11902962
d-27, 1.45014127
d-27, 9.62291023
d-28, 6.21548647
d-28, &
 
  347                3.92807578
d-28, 2.44230375
d-28, 1.50167782
d-28, 9.17611405
d-29, &
 
  348                5.58707641
d-29, 3.40570915
d-29, 2.08030862
d-29, 1.27588676
d-29, &
 
  349                7.86535588
d-30, 4.87646151
d-30, 3.03888897
d-30, 1.90578649
d-30, &
 
  350                1.20195947
d-30, 7.61955060
d-31, 4.85602199
d-31, 3.11049969
d-31, &
 
  351                2.00087065
d-31, 1.29223740
d-31, 8.37422008
d-32, 0.00000000
d+00, &
 
  352                0.00000000
d+00, 0.00000000
d+00, 0.00000000
d+00, 0.00000000
d+00 /
 
  354  data f_255 /  0.00000000
d+00, 0.00000000
d+00, 0.00000000
d+00, 1.76014287
d-44, & 
 
  355                5.07057938
d-42, 7.90473970
d-40, 7.31852999
d-38, 4.30709255
d-36, &
 
  356                1.70009061
d-34, 4.67925160
d-33, 9.21703546
d-32, 1.31918676
d-30, &
 
  357                1.37393161
d-29, 1.03102379
d-28, 5.45694018
d-28, 1.98699648
d-27, &
 
  358                4.90346776
d-27, 8.40524725
d-27, 1.08321456
d-26, 1.15714525
d-26, &
 
  359                1.10905152
d-26, 1.00155023
d-26, 8.75799161
d-27, 7.50935839
d-27, &
 
  360                6.35253533
d-27, 5.30919268
d-27, 4.37669455
d-27, 3.55185164
d-27, &
 
  361                2.82347055
d-27, 2.19257595
d-27, 1.65589541
d-27, 1.21224987
d-27, &
 
  362                8.58395132
d-28, 5.88163935
d-28, 3.90721447
d-28, 2.52593407
d-28, &
 
  363                1.59739995
d-28, 9.93802874
d-29, 6.11343388
d-29, 3.73711135
d-29, &
 
  364                2.27618743
d-29, 1.38793199
d-29, 8.48060787
d-30, 5.20305940
d-30, &
 
  365                3.20867365
d-30, 1.99011277
d-30, 1.24064551
d-30, 7.78310544
d-31, &
 
  366                4.91013681
d-31, 3.11338381
d-31, 1.98451675
d-31, 1.27135460
d-31, &
 
  367                8.17917486
d-32, 5.28280497
d-32, 3.42357159
d-32, 0.00000000
d+00, &
 
  368                0.00000000
d+00, 0.00000000
d+00, 0.00000000
d+00, 0.00000000
d+00 /
 
  373      integer, 
intent(in)          :: ixI^L, ixO^L
 
  374      double precision, 
intent(in) :: w(ixI^S,nw)
 
  375      double precision, 
intent(in) :: x(ixI^S,1:ndim)
 
  376      double precision, 
intent(out):: res(ixI^S)
 
 
  383    procedure(
get_subr1), 
pointer, 
nopass :: get_rho => null()
 
  384    procedure(
get_subr1), 
pointer, 
nopass :: get_pthermal => null()
 
  385    procedure(
get_subr1), 
pointer, 
nopass :: get_var_rfactor => null()
 
 
  392    subroutine get_line_info(wl,ion,mass,logTe,line_center,spatial_px,spectral_px,sigma_PSF,width_slit)
 
  404      integer, 
intent(in) :: wl
 
  405      integer, 
intent(out) :: mass
 
  406      character(len=30), 
intent(out) :: ion
 
  407      double precision, 
intent(out) :: logTe,line_center,spatial_px,spectral_px
 
  408      double precision, 
intent(out) :: sigma_PSF,width_slit
 
  487        line_center=262.976d0
 
  496        line_center=263.765d0
 
  505        line_center=192.028d0
 
  514        line_center=255.113d0
 
  520        call mpistop(
"No information about this line")
 
 
  526    subroutine get_euv(wl,ixI^L,ixO^L,w,x,fl,flux)
 
  533      integer, 
intent(in) :: wl
 
  534      integer, 
intent(in) :: ixI^L, ixO^L
 
  535      double precision, 
intent(in) :: x(ixI^S,1:ndim)
 
  536      double precision, 
intent(in) :: w(ixI^S,1:nw)
 
  538      double precision, 
intent(out) :: flux(ixI^S)
 
  541      double precision, 
allocatable :: t_table(:),f_table(:)
 
  542      integer :: ix^D,iTt,i
 
  543      double precision :: pth(ixI^S),Te(ixI^S),Ne(ixI^S)
 
  544      double precision :: logT,logGT,GT
 
  550        allocate(t_table(1:n_table))
 
  551        allocate(f_table(1:n_table))
 
  556        allocate(t_table(1:n_table))
 
  557        allocate(f_table(1:n_table))
 
  562        allocate(t_table(1:n_table))
 
  563        allocate(f_table(1:n_table))
 
  568        allocate(t_table(1:n_table))
 
  569        allocate(f_table(1:n_table))
 
  574        allocate(t_table(1:n_table))
 
  575        allocate(f_table(1:n_table))
 
  580        allocate(t_table(1:n_table))
 
  581        allocate(f_table(1:n_table))
 
  586        allocate(t_table(1:n_table))
 
  587        allocate(f_table(1:n_table))
 
  592        allocate(t_table(1:n_table))
 
  593        allocate(f_table(1:n_table))
 
  598        allocate(t_table(1:n_table))
 
  599        allocate(f_table(1:n_table))
 
  604        allocate(t_table(1:n_table))
 
  605        allocate(f_table(1:n_table))
 
  610        allocate(t_table(1:n_table))
 
  611        allocate(f_table(1:n_table))
 
  616        allocate(t_table(1:n_table))
 
  617        allocate(f_table(1:n_table))
 
  623        call mpistop(
"Unknown wavelength")
 
  625      call fl%get_pthermal(w,x,ixi^l,ixo^l,pth)
 
  626      call fl%get_rho(w,x,ixi^l,ixo^l,ne)
 
  627      call fl%get_var_Rfactor(w,x,ixi^l,ixo^l,te)
 
  631        flux(ixo^s)=ne(ixo^s)**2
 
  634        flux(ixo^s)=ne(ixo^s)**2
 
  638      case(94,131,171,193,211,304,335,1354)
 
  641          if(f_table(i) .gt. 1.d-99) 
then 
  642            f_table(i)=log10(f_table(i))
 
  648        {
do ix^db=ixomin^db,ixomax^db\}
 
  650          if (logt>=t_table(1) .and. logt<=t_table(n_table)) 
then 
  652              if (logt>=t_table(itt) .and. logt<t_table(itt+1)) 
then 
  653                loggt=f_table(itt)*(logt-t_table(itt+1))/(t_table(itt)-t_table(itt+1))+&
 
  654                      f_table(itt+1)*(logt-t_table(itt))/(t_table(itt+1)-t_table(itt))
 
  657            flux(ix^d)=flux(ix^d)*(10**(loggt))
 
  658            if(flux(ix^d)<smalldouble) flux(ix^d)=0.d0
 
  665        {
do ix^db=ixomin^db,ixomax^db\}
 
  666          if (te(ix^d)>=t_table(1) .and. te(ix^d)<=t_table(n_table)) 
then 
  668              if (te(ix^d)>=t_table(itt) .and. te(ix^d)<t_table(itt+1)) 
then 
  669                gt=f_table(itt)*(te(ix^d)-t_table(itt+1))/(t_table(itt)-t_table(itt+1))+&
 
  670                   f_table(itt+1)*(te(ix^d)-t_table(itt))/(t_table(itt+1)-t_table(itt))
 
  673            flux(ix^d)=flux(ix^d)*gt
 
  674            if(flux(ix^d)<smalldouble) flux(ix^d)=0.d0
 
  681      deallocate(t_table,f_table)
 
 
  684    subroutine get_sxr(ixI^L,ixO^L,w,x,fl,flux,El,Eu)
 
  691      integer, 
intent(in)           :: ixI^L,ixO^L
 
  692      integer, 
intent(in)           :: El,Eu
 
  693      double precision, 
intent(in)  :: x(ixI^S,1:ndim)
 
  694      double precision, 
intent(in)  :: w(ixI^S,nw)
 
  696      double precision, 
intent(out) :: flux(ixI^S)
 
  698      integer :: ix^D,ixO^D
 
  700      double precision :: I0,kb,keV,dE,Ei
 
  701      double precision :: pth(ixI^S),Te(ixI^S),kbT(ixI^S)
 
  702      double precision :: Ne(ixI^S),gff(ixI^S),fi(ixI^S)
 
  703      double precision :: EM(ixI^S)
 
  709      nume=floor((eu-el)/de)
 
  710      call fl%get_pthermal(w,x,ixi^l,ixo^l,pth)
 
  711      call fl%get_rho(w,x,ixi^l,ixo^l,ne)
 
  712      call fl%get_var_Rfactor(w,x,ixi^l,ixo^l,te)
 
  716        em(ixo^s)=(ne(ixo^s))**2*1.d6 
 
  719        em(ixo^s)=(ne(ixo^s))**2
 
  721      kbt(ixo^s)=kb*te(ixo^s)/kev
 
  726        {
do ix^db=ixomin^db,ixomax^db\}
 
  727          if (kbt(ix^d)>0.01*ei) 
then 
  728            if(kbt(ix^d)<ei) gff(ix^d)=(kbt(ix^d)/ei)**0.4
 
  729            fi(ix^d)=(em(ix^d)*gff(ix^d))*dexp(-ei/(kbt(ix^d)))/(ei*dsqrt(kbt(ix^d)))
 
  734        flux(ixo^s)=flux(ixo^s)+fi(ixo^s)*de
 
  736      flux(ixo^s)=flux(ixo^s)*i0
 
 
  743      double precision, 
intent(in) :: xbox^L
 
  745      double precision, 
intent(out) :: eflux
 
  747      double precision :: dxb^D,xb^L
 
  748      integer :: iigrid,igrid,j
 
  749      integer :: ixO^L,ixI^L,ix^D
 
  750      double precision :: eflux_grid,eflux_pe
 
  757      do iigrid=1,igridstail; igrid=igrids(iigrid);
 
  761        call get_goes_flux_grid(ixi^l,ixo^l,ps(igrid)%w,ps(igrid)%x,ps(igrid)%dvolume(ixi^s),xbox^l,xb^l,fl,eflux_grid)
 
  762        eflux_pe=eflux_pe+eflux_grid
 
  764      call mpi_allreduce(eflux_pe,eflux,1,mpi_double_precision,mpi_sum,
icomm,
ierrmpi)
 
 
  770      integer, 
intent(in)           :: ixI^L,ixO^L
 
  771      double precision, 
intent(in)  :: x(ixI^S,1:ndim),dV(ixI^S)
 
  772      double precision, 
intent(in)  :: w(ixI^S,nw)
 
  773      double precision, 
intent(in)  :: xbox^L,xb^L
 
  775      double precision, 
intent(out) :: eflux_grid
 
  777      integer :: ix^D,ixO^D,ixb^L
 
  778      integer :: iE,numE,j,inbox
 
  779      double precision :: I0,kb,keV,dE,Ei,El,Eu,A_cgs
 
  780      double precision :: pth(ixI^S),Te(ixI^S),kbT(ixI^S)
 
  781      double precision :: Ne(ixI^S),EM(ixI^S)
 
  782      double precision :: gff,fi,erg_SI
 
  786      {
if (xbmin^d<xboxmax^d .and. xbmax^d>xboxmin^d) inbox=inbox+1\}
 
  788      if (inbox==ndim) 
then 
  790        ^d&ixbmin^d=ixomin^d;
 
  791        ^d&ixbmax^d=ixomax^d;
 
  792        {
if (xbmax^d>xboxmax^d) ixbmax^d=ixomax^d-ceiling((xbmax^d-xboxmax^d)/
dxlevel(^d))\}
 
  793        {
if (xbmin^d<xboxmin^d) ixbmin^d=ceiling((xboxmin^d-xbmin^d)/
dxlevel(^d))+ixomin^d\}
 
  800        el=const_h*const_c/(8.d0*a_cgs)/kev 
 
  801        eu=const_h*const_c/(1.d0*a_cgs)/kev 
 
  803        nume=floor((eu-el)/de)
 
  804        call fl%get_pthermal(w,x,ixi^l,ixb^l,pth)
 
  805        call fl%get_rho(w,x,ixi^l,ixb^l,ne)
 
  806        call fl%get_var_Rfactor(w,x,ixi^l,ixb^l,te)
 
  810          em(ixb^s)=(i0*(ne(ixb^s))**2)*dv(ixb^s)*(
unit_length*1.d2)**3 
 
  813          em(ixb^s)=(i0*(ne(ixb^s))**2)*dv(ixb^s)*
unit_length**3
 
  815        kbt(ixb^s)=kb*te(ixb^s)/kev
 
  820          {
do ix^db=ixbmin^db,ixbmax^db\}
 
  821            if (kbt(ix^d)>1.d-2*ei) 
then 
  822              if(kbt(ix^d)<ei) 
then 
  823                gff=(kbt(ix^d)/ei)**0.4
 
  827              fi=(em(ix^d)*gff)*dexp(-ei/(kbt(ix^d)))/(ei*dsqrt(kbt(ix^d)))
 
  828              eflux_grid=eflux_grid+fi*de*ei
 
  832        eflux_grid=eflux_grid*kev*erg_si
 
 
  841      integer, 
intent(in) :: qunit
 
  843      character(20) :: datatype
 
  846      character (30) :: ion
 
  847      double precision :: logTe,lineCent,sigma_PSF,spaceRsl,wlRsl,wslit
 
  848      double precision :: xslit,arcsec
 
  850      datatype=
'spectrum_euv' 
  854      if (
mype==0) print *, 
'###################################################' 
  857        if (
mype==0) print *, 
'Systhesizing EUV spectrum (observed by IRIS).' 
  858      case (263,264,192,255)
 
  859        if (
mype==0) print *, 
'Systhesizing EUV spectrum (observed by Hinode/EIS).' 
  861        call mpistop(
'Wrong wavelength!')
 
  865        call mpistop(
'Wrong spectrum window!')
 
  868      if (
mype==0) 
write(*,
'(a,f8.3,a)') 
' Wavelength: ',linecent,
' Angstrom' 
  869      if (
mype==0) print *, 
'Unit of EUV flux: DN s^-1 pixel^-1' 
  873          write(*,
'(a,f5.3,a,f5.1,a)') 
' Supposed pixel: ',wlrsl,
' Angstrom x ',spacersl*725.0, 
' km' 
  874          print *, 
'Unit of wavelength: Angstrom (0.1 nm) ' 
  876            write(*,
'(a,f8.1,a)') 
' Unit of length: ',
unit_length/1.d6,
' Mm' 
  878            write(*,
'(a,f8.1,a)') 
' Unit of length: ',
unit_length/1.d8,
' Mm' 
  880          write(*,
'(a,f8.1,a)') 
' Supposed width of slit: ',wslit*725.0,
' km' 
  885          print *, 
'Unit of wavelength: Angstrom (0.1 nm) ' 
  887            write(*,
'(a,f5.3,a,f5.1,a)') 
' Pixel: ',wlrsl,
' Angstrom x ',spacersl*725.0, 
' km' 
  888            print *, 
'Unit of length: arcsec (~725 km)' 
  889            write(*,
'(a,f8.1,a)') 
' Location of slit: xI1 = ',
location_slit,
' arcsec' 
  890            write(*,
'(a,f8.1,a)') 
' Width of slit: ',wslit,
' arcsec' 
  893              if (
mype==0) 
write(*,
'(a,f8.1,a)') 
' Unit of length: ',
unit_length/1.d6,
' Mm' 
  895              if (
mype==0) 
write(*,
'(a,f8.1,a)') 
' Unit of length: ',
unit_length/1.d8,
' Mm' 
  897            write(*,
'(a,f8.1,a)') 
' Location of slit: xI1 = ',
location_slit,
' Unit_length' 
  898            write(*,
'(a,f8.1,a)') 
' Width of slit: ',wslit*725.d0,
' km' 
  901        if (
mype==0) print *, 
'Direction of the slit: parallel to xI2 vector' 
  905          call mpistop(
"EUV spectrum synthesis: support for sperical coordinates is to be added!")
 
  909      if (
mype==0) print *, 
'###################################################' 
 
  915      integer, 
intent(in) :: qunit
 
  916      character(20), 
intent(in) :: datatype
 
  919      integer :: numWL,numXS,iwL,ixS,numWI,numS
 
  920      double precision :: dwLg,xSmin,xSmax,wLmin,wLmax
 
  921      double precision, 
allocatable :: wL(:),xS(:),dwL(:),dxS(:)
 
  922      double precision, 
allocatable :: wI(:,:,:),spectra(:,:),spectra_rc(:,:)
 
  923      integer :: strtype,nstrb,nbb,nuni,nstr,bnx
 
  924      double precision :: qs,dxfirst,dxmid,lenstr
 
  926      integer :: iigrid,igrid,j,dir_loc
 
  927      double precision :: xbmin(1:ndim),xbmax(1:ndim)
 
  930      numwl=4*int((spectrum_window_max-spectrum_window_min)/(4.d0*dwlg))
 
  931      wlmin=(spectrum_window_max+spectrum_window_min)/2.d0-dwlg*numwl/2
 
  932      wlmax=(spectrum_window_max+spectrum_window_min)/2.d0+dwlg*numwl/2
 
  933      allocate(wl(numwl),dwl(numwl))
 
  936        wl(iwl)=wlmin+iwl*dwlg-half*dwlg
 
  939      select case(direction_slit)
 
  941        numxs=domain_nx1*2**(refine_max_level-1)
 
  946        strtype=stretch_type(1)
 
  947        nstrb=nstretchedblocks_baselevel(1)
 
  948        qs=qstretch_baselevel(1)
 
  949        if (mype==0) print *, 
'Direction of the slit: x' 
  951        numxs=domain_nx2*2**(refine_max_level-1)
 
  956        strtype=stretch_type(2)
 
  957        nstrb=nstretchedblocks_baselevel(2)
 
  958        qs=qstretch_baselevel(2)
 
  959        if (mype==0) print *, 
'Direction of the slit: y' 
  961        numxs=domain_nx3*2**(refine_max_level-1)
 
  966        strtype=stretch_type(3)
 
  967        nstrb=nstretchedblocks_baselevel(3)
 
  968        qs=qstretch_baselevel(3)
 
  969        if (mype==0) print *, 
'Direction of the slit: z' 
  971        call mpistop(
'Wrong direction_slit')
 
  974      allocate(xs(numxs),dxs(numxs),spectra(numwl,numxs),spectra_rc(numwl,numxs))
 
  976      allocate(wi(numwl,numxs,numwi))
 
  980        dxs(:)=(xsmax-xsmin)/numxs
 
  982          xs(ixs)=xsmin+dxs(ixs)*(ixs-half)
 
  985        qs=qs**(one/2**(refine_max_level-1))
 
  986        dxfirst=(xsmax-xsmin)*(one-qs)/(one-qs**numxs)
 
  989          dxs(ixs)=dxfirst*qs**(ixs-1)
 
  990          xs(ixs)=dxs(1)/(one-qs)*(one-qs**(ixs-1))+half*dxs(ixs)
 
  996        lenstr=(xsmax-xsmin)/(2.d0+nuni*(one-qs)/(one-qs**nstr))
 
  997        dxfirst=(xsmax-xsmin)/(dble(nuni)+2.d0/(one-qs)*(one-qs**nstr))
 
 1000        nstr=nstr*2**(refine_max_level-1)
 
 1001        nuni=nuni*2**(refine_max_level-1)
 
 1002        qs=qs**(one/2**(refine_max_level-1))
 
 1003        dxfirst=lenstr*(one-qs)/(one-qs**nstr)
 
 1004        dxmid=dxmid/2**(refine_max_level-1)
 
 1006        if(nuni .gt. 0) 
then 
 1007          do ixs=nstr+1,nstr+nuni
 
 1009            xs(ixs)=lenstr+(dble(ixs)-0.5d0-nstr)*dxs(ixs)+xsmin
 
 1014          dxs(ixs)=dxfirst*qs**(nstr-ixs)
 
 1015          xs(ixs)=xsmin+lenstr-dxs(ixs)*half-dxfirst*(one-qs**(nstr-ixs))/(one-qs)
 
 1018        do ixs=nstr+nuni+1,numxs
 
 1019          dxs(ixs)=dxfirst*qs**(ixs-nstr-nuni-1)
 
 1020          xs(ixs)=xsmax-lenstr+dxs(ixs)*half+dxfirst*(one-qs**(ixs-nstr-nuni-1))/(one-qs)
 
 1023        call mpistop(
"unknown stretch type")
 
 1026      if (los_phi==0 .and. los_theta==90 .and. direction_slit==2) 
then 
 1029      else if (los_phi==0 .and. los_theta==90 .and. direction_slit==3) 
then 
 1032      else if (los_phi==90 .and. los_theta==90 .and. direction_slit==1) 
then 
 1035      else if (los_phi==90 .and. los_theta==90 .and. direction_slit==3) 
then 
 1038      else if (los_theta==0 .and. direction_slit==1) 
then 
 1041      else if (los_theta==0 .and. direction_slit==2) 
then 
 1045        call mpistop(
'Wrong combination of LOS and slit direction!')
 
 1048      if (dir_loc==1) 
then 
 1049        if (location_slit>xprobmax1 .or. location_slit<xprobmin1) 
then 
 1050          call mpistop(
'Wrong value for location_slit!')
 
 1052        if(mype==0) 
write(*,
'(a,f8.1,a)') 
' Location of slit: x = ',location_slit,
' Unit_length' 
 1053      else if (dir_loc==2) 
then 
 1054        if (location_slit>xprobmax2 .or. location_slit<xprobmin2) 
then 
 1055          call mpistop(
'Wrong value for location_slit!')
 
 1057        if(mype==0) 
write(*,
'(a,f8.1,a)') 
' Location of slit: y = ',location_slit,
' Unit_length' 
 1059        if (location_slit>xprobmax3 .or. location_slit<xprobmin3) 
then 
 1060          call mpistop(
'Wrong value for location_slit!')
 
 1062        if(mype==0) 
write(*,
'(a,f8.1,a)') 
' Location of slit: z = ',location_slit,
' Unit_length' 
 1067      do iigrid=1,igridstail; igrid=igrids(iigrid);
 
 1068        ^d&xbmin(^d)=rnode(rpxmin^d_,igrid);
 
 1069        ^d&xbmax(^d)=rnode(rpxmax^d_,igrid);
 
 1070        if (location_slit>=xbmin(dir_loc) .and. location_slit<xbmax(dir_loc)) 
then 
 1076      call mpi_allreduce(spectra,spectra_rc,nums,mpi_double_precision, &
 
 1077                         mpi_sum,icomm,ierrmpi)
 
 1080          if (spectra_rc(iwl,ixs)>smalldouble) 
then 
 1081            wi(iwl,ixs,1)=spectra_rc(iwl,ixs)
 
 1088      call output_data(qunit,wl,xs,dwl,dxs,wi,numwl,numxs,numwi,datatype)
 
 1090      deallocate(wl,xs,dwl,dxs,spectra,spectra_rc,wi)
 
 
 1097      integer, 
intent(in) :: igrid,numWL,numXS,dir_loc
 
 1099      double precision, 
intent(in) :: wL(numWL),dwL(numWL)
 
 1100      double precision, 
intent(inout) :: spectra(numWL,numXS)
 
 1102      integer :: direction_LOS
 
 1103      integer :: ixO^L,ixI^L,ix^D,ixOnew
 
 1104      double precision, 
allocatable :: flux(:^D&),v(:^D&),pth(:^D&),Te(:^D&),rho(:^D&)
 
 1105      double precision :: wlc,wlwd
 
 1108      double precision :: logTe,lineCent
 
 1109      character (30) :: ion
 
 1110      double precision :: spaceRsl,wlRsl,sigma_PSF,wslit
 
 1112      integer :: levelg,rft,ixSmin,ixSmax,iwL
 
 1113      double precision :: flux_pix,dL
 
 1115      call get_line_info(spectrum_wl,ion,mass,logte,linecent,spacersl,wlrsl,sigma_psf,wslit)
 
 1117      if (los_phi==0 .and. los_theta==90) 
then 
 1119      else if (los_phi==90 .and. los_theta==90) 
then 
 1125      ^d&ixomin^d=ixmlo^d\
 
 1126      ^d&ixomax^d=ixmhi^d\
 
 1127      ^d&iximin^d=ixglo^d\
 
 1128      ^d&iximax^d=ixghi^d\
 
 1129      allocate(flux(ixi^s),v(ixi^s),pth(ixi^s),te(ixi^s),rho(ixi^s))
 
 1132      if (dir_loc==1) 
then 
 1133        do ix1=ixomin1,ixomax1
 
 1134          if (location_slit>=(ps(igrid)%x(ix^d,1)-
half*ps(igrid)%dx(ix^d,1)) .and. &
 
 1135              location_slit<(ps(igrid)%x(ix^d,1)+
half*ps(igrid)%dx(ix^d,1))) 
then 
 1141      else if (dir_loc==2) 
then 
 1142        do ix2=ixomin2,ixomax2
 
 1143          if (location_slit>=(ps(igrid)%x(ix^d,2)-
half*ps(igrid)%dx(ix^d,2)) .and. &
 
 1144              location_slit<(ps(igrid)%x(ix^d,2)+
half*ps(igrid)%dx(ix^d,2))) 
then 
 1151        do ix3=ixomin3,ixomax3
 
 1152          if (location_slit>=(ps(igrid)%x(ix^d,3)-
half*ps(igrid)%dx(ix^d,3)) .and. &
 
 1153              location_slit<(ps(igrid)%x(ix^d,3)+
half*ps(igrid)%dx(ix^d,3))) 
then 
 1161      call get_euv(spectrum_wl,ixi^l,ixo^l,ps(igrid)%w,ps(igrid)%x,fl,flux)
 
 1162      flux(ixo^s)=flux(ixo^s)/instrument_resolution_factor**2   
 
 1163      call fl%get_rho(ps(igrid)%w,ps(igrid)%x,ixi^l,ixo^l,rho)
 
 1164      v(ixo^s)=-ps(igrid)%w(ixo^s,iw_mom(direction_los))/rho(ixo^s)
 
 1165      call fl%get_pthermal(ps(igrid)%w,ps(igrid)%x,ixi^l,ixo^l,pth)
 
 1166      call fl%get_var_Rfactor(ps(igrid)%w,ps(igrid)%x,ixi^l,ixo^l,te)
 
 1167      te(ixo^s)=pth(ixo^s)/(te(ixo^s)*rho(ixo^s))
 
 1170      levelg=ps(igrid)%level
 
 1171      rft=2**(refine_max_level-levelg)
 
 1173      {
do ix^d=ixomin^d,ixomax^d\}
 
 1176            wlc=linecent*(1.d0+v(ix^d)*unit_velocity*1.d2/
const_c)
 
 1178            wlc=linecent*(1.d0+v(ix^d)*unit_velocity/
const_c)
 
 1180          wlwd=sqrt(
kb_cgs*te(ix^d)*unit_temperature/(mass*
mp_cgs))
 
 1183          select case(direction_slit)
 
 1185            ixsmin=(block_nx1*(node(pig1_,igrid)-1)+(ix1-ixomin1))*rft+1
 
 1186            ixsmax=(block_nx1*(node(pig1_,igrid)-1)+(ix1-ixomin1+1))*rft
 
 1188            ixsmin=(block_nx2*(node(pig2_,igrid)-1)+(ix2-ixomin2))*rft+1
 
 1189            ixsmax=(block_nx2*(node(pig2_,igrid)-1)+(ix2-ixomin2+1))*rft
 
 1191            ixsmin=(block_nx3*(node(pig3_,igrid)-1)+(ix3-ixomin3))*rft+1
 
 1192            ixsmax=(block_nx3*(node(pig3_,igrid)-1)+(ix3-ixomin3+1))*rft
 
 1195          select case(direction_los)
 
 1197            dl=ps(igrid)%dx(ix^d,1)*unit_length
 
 1199            dl=ps(igrid)%dx(ix^d,2)*unit_length
 
 1201            dl=ps(igrid)%dx(ix^d,3)*unit_length
 
 1203          if (si_unit) dl=dl*1.d2
 
 1206            flux_pix=flux(ix^d)*wlrsl*dl*exp(-(wl(iwl)-wlc)**2/(2*wlwd**2))/(sqrt(2*
dpi)*wlwd)
 
 1208              flux_pix=flux_pix*wslit/spacersl
 
 1209              spectra(iwl,ixsmin:ixsmax)=spectra(iwl,ixsmin:ixsmax)+flux_pix
 
 1215      deallocate(flux,v,pth,te,rho)
 
 
 1221      integer, 
intent(in) :: qunit
 
 1222      character(20), 
intent(in) :: datatype
 
 1225      integer :: numWL,numXS,iwL,ixS,numWI,ix^D
 
 1226      double precision :: dwLg,dxSg,xSmin,xSmax,xScent,wLmin,wLmax
 
 1227      double precision, 
allocatable :: wL(:),xS(:),dwL(:),dxS(:)
 
 1228      double precision, 
allocatable :: wI(:,:,:),spectra(:,:),spectra_rc(:,:)
 
 1229      double precision :: vec_cor(1:3),xI_cor(1:2)
 
 1230      double precision :: res,r_loc,r_max
 
 1233      character (30) :: ion
 
 1234      double precision :: logTe,lineCent,sigma_PSF,spaceRsl,wlRsl,wslit
 
 1235      double precision :: unitv,arcsec,RHESSI_rsl,pixel
 
 1236      integer :: iigrid,igrid,i,j,numS
 
 1237      double precision :: xLmin,xLmax,xslit
 
 1248        xsmin=-abs(xprobmax1)
 
 1249        xsmax=abs(xprobmax1)
 
 1252          if (ix1==1) vec_cor(1)=xprobmin1
 
 1253          if (ix1==2) vec_cor(1)=xprobmax1
 
 1255            if (ix2==1) vec_cor(2)=xprobmin2
 
 1256            if (ix2==2) vec_cor(2)=xprobmax2
 
 1258              if (ix3==1) vec_cor(3)=xprobmin3
 
 1259              if (ix3==2) vec_cor(3)=xprobmax3
 
 1261                r_loc=(vec_cor(1)-x_origin(1))**2
 
 1262                r_loc=r_loc+(vec_cor(2)-x_origin(2))**2
 
 1263                r_loc=r_loc+(vec_cor(3)-x_origin(3))**2
 
 1265                if (ix1==1 .and. ix2==1 .and. ix3==1) 
then 
 1268                  r_max=max(r_max,r_loc)
 
 1272                if (ix1==1 .and. ix2==1 .and. ix3==1) 
then 
 1276                  xsmin=min(xsmin,xi_cor(2))
 
 1277                  xsmax=max(xsmax,xi_cor(2))
 
 1288      xscent=(xsmin+xsmax)/2.d0
 
 1292        arcsec=7.25d5/unit_length
 
 1294        arcsec=7.25d7/unit_length
 
 1296      call get_line_info(spectrum_wl,ion,mass,logte,linecent,spacersl,wlrsl,sigma_psf,wslit)
 
 1297      dxsg=spacersl*arcsec
 
 1298      numxs=ceiling((xsmax-xscent)/dxsg)
 
 1299      xsmin=xscent-numxs*dxsg
 
 1300      xsmax=xscent+numxs*dxsg
 
 1303      numwl=2*int((spectrum_window_max-spectrum_window_min)/(2.d0*dwlg))
 
 1304      wlmin=(spectrum_window_max+spectrum_window_min)/2.d0-dwlg*numwl/2
 
 1305      wlmax=(spectrum_window_max+spectrum_window_min)/2.d0+dwlg*numwl/2
 
 1306      allocate(wl(numwl),dwl(numwl),xs(numxs),dxs(numxs))
 
 1308      allocate(wi(numwl,numxs,numwi),spectra(numwl,numxs),spectra_rc(numwl,numxs))
 
 1310        wl(iwl)=wlmin+iwl*dwlg-half*dwlg
 
 1314        xs(ixs)=xsmin+dxsg*(ixs-half)
 
 1320      do iigrid=1,igridstail; igrid=igrids(iigrid);
 
 1322          if (ix1==1) vec_cor(1)=rnode(rpxmin1_,igrid)
 
 1323          if (ix1==2) vec_cor(1)=rnode(rpxmax1_,igrid)
 
 1325            if (ix2==1) vec_cor(2)=rnode(rpxmin2_,igrid)
 
 1326            if (ix2==2) vec_cor(2)=rnode(rpxmax2_,igrid)
 
 1328              if (ix3==1) vec_cor(3)=rnode(rpxmin3_,igrid)
 
 1329              if (ix3==2) vec_cor(3)=rnode(rpxmax3_,igrid)
 
 1331              if (ix1==1 .and. ix2==1 .and. ix3==1) 
then 
 1335                xlmin=min(xlmin,xi_cor(1))
 
 1336                xlmax=max(xlmax,xi_cor(1))
 
 1342        if (activate_unit_arcsec) 
then  
 1343          xslit=location_slit*arcsec
 
 1347        if (xslit>=xlmin-wslit*arcsec .and. xslit<=xlmax+wslit*arcsec) 
then 
 1353      call mpi_allreduce(spectra,spectra_rc,nums,mpi_double_precision, &
 
 1354                         mpi_sum,icomm,ierrmpi)
 
 1357          if (spectra_rc(iwl,ixs)>smalldouble) 
then 
 1358            wi(iwl,ixs,1)=spectra_rc(iwl,ixs)
 
 1365      if (activate_unit_arcsec) 
then  
 1370      call output_data(qunit,wl,xs,dwl,dxs,wi,numwl,numxs,numwi,datatype)
 
 1372      deallocate(wl,xs,dwl,dxs,spectra,spectra_rc,wi)
 
 
 1378      integer, 
intent(in) :: igrid,numWL,numXS
 
 1379      double precision, 
intent(in) :: wL(numWL),xS(numXS)
 
 1380      double precision, 
intent(in) :: dwLg,dxSg
 
 1381      double precision, 
intent(inout) :: spectra(numWL,numXS)
 
 1384      integer :: ixO^L,ixI^L,ix^D,ixOnew,j
 
 1385      double precision, 
allocatable :: flux(:^D&),v(:^D&),pth(:^D&),Te(:^D&),rho(:^D&)
 
 1386      double precision :: wlc,wlwd,res,dst_slit,xslit,arcsec
 
 1387      double precision :: vloc(1:3),xloc(1:3),dxloc(1:3),xIloc(1:2),dxIloc(1:2)
 
 1388      integer :: nSubC^D,iSubC^D,iwL,ixS,ixSmin,ixSmax,iwLmin,iwLmax,nwL
 
 1389      double precision :: slit_width,dxSubC^D,xerf^L,fluxSubC
 
 1390      double precision :: xSubC(1:3),xCent(1:2)
 
 1393      double precision :: logTe,lineCent
 
 1394      character (30) :: ion
 
 1395      double precision :: spaceRsl,wlRsl,sigma_PSF,wslit
 
 1396      double precision :: sigma_wl,sigma_xs,factor
 
 1399        arcsec=7.25d5/unit_length
 
 1401        arcsec=7.25d7/unit_length
 
 1403      if (activate_unit_arcsec) 
then  
 1404        xslit=location_slit*arcsec
 
 1409      call get_line_info(spectrum_wl,ion,mass,logte,linecent,spacersl,wlrsl,sigma_psf,wslit)
 
 1411      ^d&ixomin^d=ixmlo^d\
 
 1412      ^d&ixomax^d=ixmhi^d\
 
 1413      ^d&iximin^d=ixglo^d\
 
 1414      ^d&iximax^d=ixghi^d\
 
 1415      allocate(flux(ixi^s),v(ixi^s),pth(ixi^s),te(ixi^s),rho(ixi^s))
 
 1417      call get_euv(spectrum_wl,ixi^l,ixo^l,ps(igrid)%w,ps(igrid)%x,fl,flux)
 
 1418      flux(ixo^s)=flux(ixo^s)/instrument_resolution_factor**2   
 
 1419      call fl%get_pthermal(ps(igrid)%w,ps(igrid)%x,ixi^l,ixo^l,pth)
 
 1420      call fl%get_rho(ps(igrid)%w,ps(igrid)%x,ixi^l,ixo^l,rho)
 
 1421      call fl%get_var_Rfactor(ps(igrid)%w,ps(igrid)%x,ixi^l,ixo^l,te)
 
 1422      te(ixo^s)=pth(ixo^s)/(te(ixo^s)*rho(ixo^s))
 
 1423      {
do ix^d=ixomin^d,ixomax^d\}
 
 1425          vloc(j)=ps(igrid)%w(ix^d,iw_mom(j))/rho(ix^d)
 
 1433      slit_width=wslit*arcsec
 
 1434      sigma_wl=sigma_psf*dwlg
 
 1435      sigma_xs=sigma_psf*dxsg
 
 1436      {
do ix^d=ixomin^d,ixomax^d\}
 
 1437        if (flux(ix^d)>smalldouble) 
then 
 1438          xloc(1:3)=ps(igrid)%x(ix^d,1:3)
 
 1439          dxloc(1:3)=ps(igrid)%dx(ix^d,1:3)
 
 1443          if (xiloc(1)>=xslit-half*(slit_width+dxiloc(1)) .and. & 
 
 1444              xiloc(1)<=xslit+half*(slit_width+dxiloc(1))) 
then 
 1446            ^d&nsubc^d=max(nsubc^d,ceiling(ps(igrid)%dx(ix^dd,^d)*abs(
vec_xi1(^d))/(slit_width/16.d0)));
 
 1447            ^d&nsubc^d=max(nsubc^d,ceiling(ps(igrid)%dx(ix^dd,^d)*abs(
vec_xi2(^d))/(dxsg/4.d0)));
 
 1448            ^d&dxsubc^d=ps(igrid)%dx(ix^dd,^d)/nsubc^d;
 
 1451              fluxsubc=flux(ix^d)*dxsubc1*dxsubc2*dxsubc3*unit_length*1.d2/dxsg/dxsg  
 
 1452              wlc=linecent*(1.d0+v(ix^d)*unit_velocity*1.d2/const_c)
 
 1454              fluxsubc=flux(ix^d)*dxsubc1*dxsubc2*dxsubc3*unit_length/dxsg/dxsg  
 
 1455              wlc=linecent*(1.d0+v(ix^d)*unit_velocity/const_c)
 
 1457            wlwd=sqrt(kb_cgs*te(ix^d)*unit_temperature/(mass*mp_cgs))
 
 1458            wlwd=wlwd*linecent/const_c
 
 1460            {
do isubc^d=1,nsubc^d\}
 
 1461              ^d&xsubc(^d)=xloc(^d)-half*dxloc(^d)+(isubc^d-half)*dxsubc^d;
 
 1463              dst_slit=abs(xcent(1)-xslit)  
 
 1464              if (dst_slit<=half*slit_width) 
then 
 1465                ixs=floor((xcent(2)-(xs(1)-half*dxsg))/dxsg)+1
 
 1467                ixsmax=min(ixs+3,numxs)
 
 1468                iwl=floor((wlc-(wl(1)-half*dwlg))/dwlg)+1
 
 1469                nwl=3*ceiling(wlwd/dwlg+1)
 
 1470                iwlmin=max(1,iwl-nwl)
 
 1471                iwlmax=min(iwl+nwl,numwl)
 
 1473                do iwl=iwlmin,iwlmax
 
 1474                  do ixs=ixsmin,ixsmax
 
 1475                    xerfmin1=(wl(iwl)-half*dwlg-wlc)/sqrt(2.d0*(sigma_wl**2+wlwd**2))
 
 1476                    xerfmax1=(wl(iwl)+half*dwlg-wlc)/sqrt(2.d0*(sigma_wl**2+wlwd**2))
 
 1477                    xerfmin2=(xs(ixs)-half*dxsg-xcent(2))/(sqrt(2.d0)*sigma_xs)
 
 1478                    xerfmax2=(xs(ixs)+half*dxsg-xcent(2))/(sqrt(2.d0)*sigma_xs)
 
 1479                    factor=(erfc(xerfmin1)-erfc(xerfmax1))*(erfc(xerfmin2)-erfc(xerfmax2))/4.d0
 
 1480                    spectra(iwl,ixs)=spectra(iwl,ixs)+fluxsubc*factor
 
 1490      deallocate(flux,v,pth,te)
 
 
 1498      integer, 
intent(in) :: qunit
 
 1500      character(20) :: datatype
 
 1503      character (30) :: ion
 
 1504      double precision :: logTe,lineCent,sigma_PSF,spaceRsl,wlRsl,wslit
 
 1505      double precision :: t0,t1
 
 1508      datatype=
'image_euv' 
 1512        print *, 
'###################################################' 
 1513        print *, 
'Systhesizing EUV image' 
 1514        write(*,
'(a,f8.3,a)') 
' Wavelength: ',linecent,
' Angstrom' 
 1515        print *, 
'Unit of EUV flux: DN s^-1 pixel^-1' 
 1521          write(*,
'(a,f7.1,a,f7.1,a,f5.1,a,f5.1,a)') 
' Supposed Pixel: ',spacersl*725.0,
' km x ',spacersl*725.0, & 
 
 1522                                                     ' km  (', spacersl, 
' arcsec x ', spacersl, 
' arcsec)' 
 1524            write(*,
'(a,f8.1,a)') 
' Unit of length: ',
unit_length/1.d6,
' Mm' 
 1526            write(*,
'(a,f8.1,a)') 
' Unit of length: ',
unit_length/1.d8,
' Mm' 
 1536          call mpistop(
'ERROR: Wrong LOS for synthesizing emission!')
 
 1540          write(*,
'(a,f7.1,a,f7.1,a,f5.1,a,f5.1,a)') 
' Pixel: ',spacersl*725.0,
' km x ',spacersl*725.0, 
' km  (', &
 
 1541                                                                  spacersl, 
' arcsec x ', spacersl, 
' arcsec)' 
 1543            print *, 
'Unit of length: arcsec (~725 km)' 
 1546              write(*,
'(a,f8.1,a)') 
' Unit of length: ',
unit_length/1.d6,
' Mm' 
 1548              write(*,
'(a,f8.1,a)') 
' Unit of length: ',
unit_length/1.d8,
' Mm' 
 1554                                                     '] of the simulation box is located at [X=0,Y=0] of the image' 
 1557          if (
mype==0) 
write(*,
'(a,f6.3,f8.3,f8.3,a)') 
' Mapping: R=0 of the simulation box is located at [X=0,Y=0] of the image' 
 1560          call mpistop(
"EUV synthesis: this coordinate is not supported!")
 
 1565      if (
mype==0) print *, 
'time comsuming: ',t1-t0,
' s' 
 1566      if (
mype==0) print *, 
'###################################################' 
 
 1573      integer, 
intent(in) :: qunit
 
 1575      character(20) :: datatype
 
 1576      double precision :: RHESSI_rsl
 
 1577      double precision :: t0,t1
 
 1580      datatype=
'image_sxr' 
 1584        print *, 
'###################################################' 
 1585        print *, 
'Systhesizing SXR image (observed at 1 AU).' 
 1592          print *, 
'Unit of SXR flux: photons cm^-2 s^-1 pixel^-1' 
 1593          write(*,
'(a,f5.1,a,f5.1,a,f5.1,a,f5.1,a)') 
' Supposed Pixel: ',rhessi_rsl*0.725, 
' Mm x ',rhessi_rsl*0.725, &
 
 1594                                                     ' Mm  (', rhessi_rsl, 
' arcsec x ', rhessi_rsl, 
' arcsec)' 
 1596            write(*,
'(a,f8.1,a)') 
' Unit of length: ',
unit_length/1.d6,
' Mm' 
 1598            write(*,
'(a,f8.1,a)') 
' Unit of length: ',
unit_length/1.d8,
' Mm' 
 1608          call mpistop(
'ERROR: Wrong LOS for synthesizing emission!')
 
 1612          print *, 
'Unit of SXR flux: photons cm^-2 s^-1 pixel^-1' 
 1613          write(*,
'(a,f5.1,a,f5.1,a,f5.1,a,f5.1,a)') 
' Pixel: ',rhessi_rsl*0.725, 
' Mm x ',rhessi_rsl*0.725, &
 
 1614                                                      ' Mm  (', rhessi_rsl, 
' arcsec x ', rhessi_rsl, 
' arcsec)' 
 1616            print *, 
'Unit of length: arcsec (~725 km)' 
 1619              write(*,
'(a,f8.1,a)') 
' Unit of length: ',
unit_length/1.d6,
' Mm' 
 1621              write(*,
'(a,f8.1,a)') 
' Unit of length: ',
unit_length/1.d8,
' Mm' 
 1627                                                     '] of the simulation box is located at [X=0,Y=0] of the image' 
 1630          if (
mype==0) 
write(*,
'(a,f6.3,f8.3,f8.3,a)') 
' Mapping: R=0 of the simulation box is located at [X=0,Y=0] of the image' 
 1633          call mpistop(
"SXR synthesis: this coordinate is not supported!")
 
 1638      if (
mype==0) print *, 
'time comsuming:',t1-t0
 
 1639      if (
mype==0) print *, 
'###################################################' 
 
 1646      integer, 
intent(in) :: qunit
 
 1648      character(20) :: datatype
 
 1649      double precision :: LASCO_rsl
 
 1651      if (
mype==0) print *, 
'###################################################' 
 1655        if (
mype==0) print *, 
'Systhesizing white light image (observed by LASCO/C1).' 
 1658        if (
mype==0) print *, 
'Systhesizing white light image (observed by LASCO/C2).' 
 1661        if (
mype==0) print *, 
'Systhesizing white light image (observed by LASCO/C3).' 
 1663        call mpistop(
'Whitelight synthesis: instrument is not supported!')
 
 1666      if (
mype==0) 
write(*,
'(a,f5.1,a,f5.1,a,f5.1,a,f5.1,a)') 
' Pixel: ',lasco_rsl*0.725,
' Mm x ',lasco_rsl*0.725, 
' Mm  (', &
 
 1667                                                                lasco_rsl, 
' arcsec x ', lasco_rsl, 
' arcsec) ' 
 1668      if (
mype==0) print *, 
'Unit of white light flux: average Sun brightness' 
 1670      datatype=
'image_whitelight' 
 1674          print *, 
'Unit of length: arcsec (~725 km)' 
 1677            if (
mype==0) 
write(*,
'(a,f8.1,a)') 
' Unit of length: ',
unit_length/1.d6,
' Mm' 
 1679            if (
mype==0) 
write(*,
'(a,f8.1,a)') 
' Unit of length: ',
unit_length/1.d8,
' Mm' 
 1685        if (
mype==0) 
write(*,
'(a,f6.3,f8.3,f8.3,a)') 
' Mapping: R=0 of the simulation box is located at [X=0,Y=0] of the image' 
 1688        call mpistop(
"Whitelight synthesis: this coordinate is not supported!")
 
 1691      if (
mype==0) print *, 
'###################################################' 
 
 1701      integer, 
intent(in) :: qunit
 
 1702      character(20), 
intent(in) :: datatype
 
 1705      double precision :: dx^D
 
 1706      integer :: numX^D,ix^D
 
 1707      double precision, 
allocatable :: EUV(:,:),EUVs(:,:),Dpl(:,:),Dpls(:,:)
 
 1708      double precision, 
allocatable :: SXR(:,:),SXRs(:,:),wI(:,:,:)
 
 1709      double precision, 
allocatable :: xI1(:),xI2(:),dxI1(:),dxI2(:),dxIi
 
 1710      integer :: numXI1,numXI2,numSI,numWI
 
 1711      double precision :: xI^L
 
 1712      integer :: iigrid,igrid,i,j
 
 1713      double precision, 
allocatable :: xIF1(:),xIF2(:),dxIF1(:),dxIF2(:)
 
 1714      integer :: nXIF1,nXIF2
 
 1715      double precision :: xIF^L
 
 1717      double precision :: unitv,arcsec,RHESSI_rsl
 
 1718      integer :: strtype^D,nstrb^D,nbb^D,nuni^D,nstr^D,bnx^D
 
 1719      double precision :: qs^D,dxfirst^D,dxmid^D,lenstr^D
 
 1743        if (
mype==0) 
write(*,
'(a)') 
' LOS vector: [-1.00  0.00  0.00]' 
 1744        if (
mype==0) 
write(*,
'(a)') 
' xI1 vector: [ 0.00  1.00  0.00]' 
 1745        if (
mype==0) 
write(*,
'(a)') 
' xI2 vector: [ 0.00  0.00  1.00]' 
 1763        if (
mype==0) 
write(*,
'(a)') 
' LOS vector: [ 0.00 -1.00  0.00]' 
 1764        if (
mype==0) 
write(*,
'(a)') 
' xI1 vector: [-1.00  0.00  0.00]' 
 1765        if (
mype==0) 
write(*,
'(a)') 
' xI2 vector: [ 0.00  0.00  1.00]' 
 1783        if (
mype==0) 
write(*,
'(a)') 
' LOS vector: [ 0.00  0.00 -1.00]' 
 1784        if (
mype==0) 
write(*,
'(a)') 
' xI1 vector: [ 1.00  0.00  0.00]' 
 1785        if (
mype==0) 
write(*,
'(a)') 
' xI2 vector: [ 0.00  1.00  0.00]' 
 1787      allocate(xif1(nxif1),xif2(nxif2),dxif1(nxif1),dxif2(nxif2))
 
 1790      select case(strtype1)
 
 1792        dxif1(:)=(xifmax1-xifmin1)/nxif1
 
 1794          xif1(ix1)=xifmin1+dxif1(ix1)*(ix1-
half)
 
 1798        dxfirst1=(xifmax1-xifmin1)*(
one-qs1)/(
one-qs1**nxif1)
 
 1801          dxif1(ix1)=dxfirst1*qs1**(ix1-1)
 
 1802          xif1(ix1)=dxif1(1)/(
one-qs1)*(
one-qs1**(ix1-1))+
half*dxif1(ix1)
 
 1807        nuni1=nbb1-nstrb1*bnx1
 
 1808        lenstr1=(xifmax1-xifmin1)/(2.d0+nuni1*(
one-qs1)/(
one-qs1**nstr1))
 
 1809        dxfirst1=(xifmax1-xifmin1)/(dble(nuni1)+2.d0/(
one-qs1)*(
one-qs1**nstr1))
 
 1815        dxfirst1=lenstr1*(
one-qs1)/(
one-qs1**nstr1)
 
 1818        if(nuni1 .gt. 0) 
then 
 1819          do ix1=nstr1+1,nstr1+nuni1
 
 1821            xif1(ix1)=lenstr1+(dble(ix1)-0.5d0-nstr1)*dxif1(ix1)+xifmin1
 
 1826          dxif1(ix1)=dxfirst1*qs1**(nstr1-ix1)
 
 1827          xif1(ix1)=xifmin1+lenstr1-dxif1(ix1)*
half-dxfirst1*(
one-qs1**(nstr1-ix1))/(
one-qs1)
 
 1830        do ix1=nstr1+nuni1+1,nxif1
 
 1831          dxif1(ix1)=dxfirst1*qs1**(ix1-nstr1-nuni1-1)
 
 1832          xif1(ix1)=xifmax1-lenstr1+dxif1(ix1)*
half+dxfirst1*(
one-qs1**(ix1-nstr1-nuni1-1))/(
one-qs1)
 
 1835        call mpistop(
"unknown stretch type")
 
 1838      select case(strtype2)
 
 1840        dxif2(:)=(xifmax2-xifmin2)/nxif2
 
 1842          xif2(ix2)=xifmin2+dxif2(ix2)*(ix2-
half)
 
 1846        dxfirst2=(xifmax2-xifmin2)*(
one-qs2)/(
one-qs2**nxif2)
 
 1849          dxif2(ix2)=dxfirst2*qs2**(ix2-1)
 
 1850          xif2(ix2)=dxif2(1)/(
one-qs2)*(
one-qs2**(ix2-1))+
half*dxif2(ix2)
 
 1855        nuni2=nbb2-nstrb2*bnx2
 
 1856        lenstr2=(xifmax2-xifmin2)/(2.d0+nuni2*(
one-qs2)/(
one-qs2**nstr2))
 
 1857        dxfirst2=(xifmax2-xifmin2)/(dble(nuni2)+2.d0/(
one-qs2)*(
one-qs2**nstr2))
 
 1863        dxfirst2=lenstr2*(
one-qs2)/(
one-qs2**nstr2)
 
 1866        if(nuni2 .gt. 0) 
then 
 1867          do ix2=nstr2+1,nstr2+nuni2
 
 1869            xif2(ix2)=lenstr2+(dble(ix2)-0.5d0-nstr2)*dxif2(ix2)+xifmin2
 
 1874          dxif2(ix2)=dxfirst2*qs2**(nstr2-ix2)
 
 1875          xif2(ix2)=xifmin2+lenstr2-dxif2(ix2)*
half-dxfirst2*(
one-qs2**(nstr2-ix2))/(
one-qs2)
 
 1878        do ix2=nstr2+nuni2+1,nxif2
 
 1879          dxif2(ix2)=dxfirst2*qs2**(ix2-nstr2-nuni2-1)
 
 1880          xif2(ix2)=xifmax2-lenstr2+dxif2(ix2)*
half+dxfirst2*(
one-qs2**(ix2-nstr2-nuni2-1))/(
one-qs2)
 
 1883        call mpistop(
"unknown stretch type")
 
 1887      if (datatype==
'image_euv') 
then 
 1894        allocate(wi(nxif1,nxif2,numwi))
 
 1895        allocate(euvs(nxif1,nxif2),euv(nxif1,nxif2))
 
 1896        allocate(dpl(nxif1,nxif2),dpls(nxif1,nxif2))
 
 1901        do iigrid=1,igridstail; igrid=igrids(iigrid);
 
 1905        call mpi_allreduce(euvs,euv,numsi,mpi_double_precision, &
 
 1907        call mpi_allreduce(dpls,dpl,numsi,mpi_double_precision, &
 
 1912            if(euv(ix1,ix2)/=0) 
then 
 1913              dpl(ix1,ix2)=(dpl(ix1,ix2)/euv(ix1,ix2))*unitv
 
 1923        call output_data(qunit,xif1,xif2,dxif1,dxif2,wi,nxif1,nxif2,numwi,datatype)
 
 1924        deallocate(wi,euv,euvs,dpl,dpls)
 
 1928      if (datatype==
'image_sxr') 
then 
 1936        allocate(wi(nxif1,nxif2,numwi))
 
 1937        allocate(sxrs(nxif1,nxif2),sxr(nxif1,nxif2))
 
 1940        do iigrid=1,igridstail; igrid=igrids(iigrid);
 
 1944        call mpi_allreduce(sxrs,sxr,numsi,mpi_double_precision, &
 
 1947        sxr=sxr*(rhessi_rsl*arcsec)**2 
 
 1955        call output_data(qunit,xif1,xif2,dxif1,dxif2,wi,nxif1,nxif2,numwi,datatype)
 
 1956        deallocate(wi,sxr,sxrs)
 
 1959      deallocate(xif1,xif2,dxif1,dxif2)
 
 
 1966      integer, 
intent(in) :: igrid,nXIF1,nXIF2
 
 1967      double precision, 
intent(in) :: xIF1(nXIF1),xIF2(nXIF2)
 
 1968      double precision, 
intent(in) :: dxIF1(nXIF1),dxIF2(nXIF2)
 
 1970      double precision, 
intent(out) :: SXR(nXIF1,nXIF2)
 
 1972      integer :: ixO^L,ixO^D,ixI^L,ix^D,i,j
 
 1973      double precision :: xb^L,xd^D
 
 1974      double precision, 
allocatable :: flux(:^D&)
 
 1975      double precision, 
allocatable :: dxb1(:^D&),dxb2(:^D&),dxb3(:^D&)
 
 1976      double precision, 
allocatable :: SXRg(:,:),xg1(:),xg2(:),dxg1(:),dxg2(:)
 
 1977      integer :: levelg,nXg1,nXg2,iXgmin1,iXgmax1,iXgmin2,iXgmax2,rft,iXg^D
 
 1978      double precision :: SXRt,xc^L,xg^L,r2,area_1AU
 
 1979      integer :: ixP^L,ixP^D
 
 1980      integer :: direction_LOS
 
 1990      ^d&ixomin^d=ixmlo^d\
 
 1991      ^d&ixomax^d=ixmhi^d\
 
 1992      ^d&iximin^d=
ixglo^d\
 
 1993      ^d&iximax^d=
ixghi^d\
 
 1997      allocate(flux(ixi^s))
 
 1998      allocate(dxb1(ixi^s),dxb2(ixi^s),dxb3(ixi^s))
 
 1999      dxb1(ixo^s)=ps(igrid)%dx(ixo^s,1)
 
 2000      dxb2(ixo^s)=ps(igrid)%dx(ixo^s,2)
 
 2001      dxb3(ixo^s)=ps(igrid)%dx(ixo^s,3)
 
 2006      levelg=ps(igrid)%level
 
 2010      select case(direction_los)
 
 2021      allocate(sxrg(nxg1,nxg2),xg1(nxg1),xg2(nxg2),dxg1(nxg1),dxg2(nxg2))
 
 2027      select case(direction_los)
 
 2029        do ix2=ixomin2,ixomax2
 
 2030          ixgmin1=(ix2-1)*rft+1
 
 2032          do ix3=ixomin3,ixomax3
 
 2033            ixgmin2=(ix3-1)*rft+1
 
 2036            do ix1=ixomin1,ixomax1
 
 2039            sxrg(ixgmin1:ixgmax1,ixgmin2:ixgmax2)=sxrt
 
 2043        do ix3=ixomin3,ixomax3
 
 2044          ixgmin1=(ix3-1)*rft+1
 
 2046          do ix1=ixomin1,ixomax1
 
 2047            ixgmin2=(ix1-1)*rft+1
 
 2050            do ix2=ixomin2,ixomax2
 
 2053            sxrg(ixgmin1:ixgmax1,ixgmin2:ixgmax2)=sxrt
 
 2057        do ix1=ixomin1,ixomax1
 
 2058          ixgmin1=(ix1-1)*rft+1
 
 2060          do ix2=ixomin2,ixomax2
 
 2061            ixgmin2=(ix2-1)*rft+1
 
 2064            do ix3=ixomin3,ixomax3
 
 2067            sxrg(ixgmin1:ixgmax1,ixgmin2:ixgmax2)=sxrt
 
 2077      select case(direction_los)
 
 2079        ixgmin1=(ixomin2-1)*rft+1
 
 2081        ixgmin2=(ixomin3-1)*rft+1
 
 2084        ixgmin1=(ixomin3-1)*rft+1
 
 2086        ixgmin2=(ixomin1-1)*rft+1
 
 2089        ixgmin1=(ixomin1-1)*rft+1
 
 2091        ixgmin2=(ixomin2-1)*rft+1
 
 2095      select case(direction_los)
 
 2097        ixpmin1=(
node(pig2_,igrid)-1)*rft*block_nx2+1
 
 2098        ixpmax1=
node(pig2_,igrid)*rft*block_nx2
 
 2099        ixpmin2=(
node(pig3_,igrid)-1)*rft*block_nx3+1
 
 2100        ixpmax2=
node(pig3_,igrid)*rft*block_nx3
 
 2102        ixpmin1=(
node(pig3_,igrid)-1)*rft*block_nx3+1
 
 2103        ixpmax1=
node(pig3_,igrid)*rft*block_nx3
 
 2104        ixpmin2=(
node(pig1_,igrid)-1)*rft*block_nx1+1
 
 2105        ixpmax2=
node(pig1_,igrid)*rft*block_nx1
 
 2107        ixpmin1=(
node(pig1_,igrid)-1)*rft*block_nx1+1
 
 2108        ixpmax1=
node(pig1_,igrid)*rft*block_nx1
 
 2109        ixpmin2=(
node(pig2_,igrid)-1)*rft*block_nx2+1
 
 2110        ixpmax2=
node(pig2_,igrid)*rft*block_nx2
 
 2112      xg1(ixgmin1:ixgmax1)=xif1(ixpmin1:ixpmax1)
 
 2113      xg2(ixgmin2:ixgmax2)=xif2(ixpmin2:ixpmax2)
 
 2114      dxg1(ixgmin1:ixgmax1)=dxif1(ixpmin1:ixpmax1)
 
 2115      dxg2(ixgmin2:ixgmax2)=dxif2(ixpmin2:ixpmax2)
 
 2116      sxr(ixpmin1:ixpmax1,ixpmin2:ixpmax2)=sxr(ixpmin1:ixpmax1,ixpmin2:ixpmax2)+&
 
 2117                                           sxrg(ixgmin1:ixgmax1,ixgmin2:ixgmax2)
 
 2119      deallocate(flux,dxb1,dxb2,dxb3,sxrg,xg1,xg2,dxg1,dxg2)
 
 
 2126      integer, 
intent(in) :: igrid,nXIF1,nXIF2
 
 2127      double precision, 
intent(in) :: xIF1(nXIF1),xIF2(nXIF2)
 
 2128      double precision, 
intent(in) :: dxIF1(nXIF1),dxIF2(nXIF2)
 
 2130      double precision, 
intent(out) :: EUV(nXIF1,nXIF2),Dpl(nXIF1,nXIF2)
 
 2132      integer :: ixO^L,ixO^D,ixI^L,ix^D,i,j
 
 2133      double precision :: xb^L,xd^D
 
 2134      double precision, 
allocatable :: flux(:^D&),v(:^D&),rho(:^D&)
 
 2135      double precision, 
allocatable :: dxb1(:^D&),dxb2(:^D&),dxb3(:^D&)
 
 2136      double precision, 
allocatable :: EUVg(:,:),Fvg(:,:),xg1(:),xg2(:),dxg1(:),dxg2(:)
 
 2137      integer :: levelg,nXg1,nXg2,iXgmin1,iXgmax1,iXgmin2,iXgmax2,rft,iXg^D
 
 2138      double precision :: EUVt,Fvt,xc^L,xg^L,r2
 
 2139      integer :: ixP^L,ixP^D
 
 2140      integer :: direction_LOS
 
 2150      ^d&ixomin^d=ixmlo^d\
 
 2151      ^d&ixomax^d=ixmhi^d\
 
 2152      ^d&iximin^d=
ixglo^d\
 
 2153      ^d&iximax^d=
ixghi^d\
 
 2157      allocate(flux(ixi^s),v(ixi^s),rho(ixi^s))
 
 2158      allocate(dxb1(ixi^s),dxb2(ixi^s),dxb3(ixi^s))
 
 2159      dxb1(ixo^s)=ps(igrid)%dx(ixo^s,1)
 
 2160      dxb2(ixo^s)=ps(igrid)%dx(ixo^s,2)
 
 2161      dxb3(ixo^s)=ps(igrid)%dx(ixo^s,3)
 
 2165      call fl%get_rho(ps(igrid)%w,ps(igrid)%x,ixi^l,ixo^l,rho)
 
 2166      v(ixo^s)=-ps(igrid)%w(ixo^s,iw_mom(direction_los))/rho(ixo^s)
 
 2170      levelg=ps(igrid)%level
 
 2174      select case(direction_los)
 
 2185      allocate(euvg(nxg1,nxg2),fvg(nxg1,nxg2),xg1(nxg1),xg2(nxg2),dxg1(nxg1),dxg2(nxg2))
 
 2192      select case(direction_los)
 
 2194        do ix2=ixomin2,ixomax2
 
 2195          ixgmin1=(ix2-1)*rft+1
 
 2197          do ix3=ixomin3,ixomax3
 
 2198            ixgmin2=(ix3-1)*rft+1
 
 2202            do ix1=ixomin1,ixomax1
 
 2206            euvg(ixgmin1:ixgmax1,ixgmin2:ixgmax2)=euvt
 
 2207            fvg(ixgmin1:ixgmax1,ixgmin2:ixgmax2)=fvt
 
 2211        do ix3=ixomin3,ixomax3
 
 2212          ixgmin1=(ix3-1)*rft+1
 
 2214          do ix1=ixomin1,ixomax1
 
 2215            ixgmin2=(ix1-1)*rft+1
 
 2219            do ix2=ixomin2,ixomax2
 
 2223            euvg(ixgmin1:ixgmax1,ixgmin2:ixgmax2)=euvt
 
 2224            fvg(ixgmin1:ixgmax1,ixgmin2:ixgmax2)=fvt
 
 2228        do ix1=ixomin1,ixomax1
 
 2229          ixgmin1=(ix1-1)*rft+1
 
 2231          do ix2=ixomin2,ixomax2
 
 2232            ixgmin2=(ix2-1)*rft+1
 
 2236            do ix3=ixomin3,ixomax3
 
 2240            euvg(ixgmin1:ixgmax1,ixgmin2:ixgmax2)=euvt
 
 2241            fvg(ixgmin1:ixgmax1,ixgmin2:ixgmax2)=fvt
 
 2252      select case(direction_los)
 
 2254        ixgmin1=(ixomin2-1)*rft+1
 
 2256        ixgmin2=(ixomin3-1)*rft+1
 
 2259        ixgmin1=(ixomin3-1)*rft+1
 
 2261        ixgmin2=(ixomin1-1)*rft+1
 
 2264        ixgmin1=(ixomin1-1)*rft+1
 
 2266        ixgmin2=(ixomin2-1)*rft+1
 
 2270      select case(direction_los)
 
 2272        ixpmin1=(
node(pig2_,igrid)-1)*rft*block_nx2+1
 
 2273        ixpmax1=
node(pig2_,igrid)*rft*block_nx2
 
 2274        ixpmin2=(
node(pig3_,igrid)-1)*rft*block_nx3+1
 
 2275        ixpmax2=
node(pig3_,igrid)*rft*block_nx3
 
 2277        ixpmin1=(
node(pig3_,igrid)-1)*rft*block_nx3+1
 
 2278        ixpmax1=
node(pig3_,igrid)*rft*block_nx3
 
 2279        ixpmin2=(
node(pig1_,igrid)-1)*rft*block_nx1+1
 
 2280        ixpmax2=
node(pig1_,igrid)*rft*block_nx1
 
 2282        ixpmin1=(
node(pig1_,igrid)-1)*rft*block_nx1+1
 
 2283        ixpmax1=
node(pig1_,igrid)*rft*block_nx1
 
 2284        ixpmin2=(
node(pig2_,igrid)-1)*rft*block_nx2+1
 
 2285        ixpmax2=
node(pig2_,igrid)*rft*block_nx2
 
 2287      xg1(ixgmin1:ixgmax1)=xif1(ixpmin1:ixpmax1)
 
 2288      xg2(ixgmin2:ixgmax2)=xif2(ixpmin2:ixpmax2)
 
 2289      dxg1(ixgmin1:ixgmax1)=dxif1(ixpmin1:ixpmax1)
 
 2290      dxg2(ixgmin2:ixgmax2)=dxif2(ixpmin2:ixpmax2)
 
 2291      euv(ixpmin1:ixpmax1,ixpmin2:ixpmax2)=euv(ixpmin1:ixpmax1,ixpmin2:ixpmax2)+&
 
 2292                                           euvg(ixgmin1:ixgmax1,ixgmin2:ixgmax2)
 
 2293      dpl(ixpmin1:ixpmax1,ixpmin2:ixpmax2)=dpl(ixpmin1:ixpmax1,ixpmin2:ixpmax2)+&
 
 2294                                           fvg(ixgmin1:ixgmax1,ixgmin2:ixgmax2)
 
 2296      deallocate(flux,v,dxb1,dxb2,dxb3,euvg,fvg,xg1,xg2,dxg1,dxg2)
 
 
 2306      integer, 
intent(in) :: qunit
 
 2308      character(20), 
intent(in) :: datatype
 
 2310      integer :: ix^D,numXI1,numXI2,numWI
 
 2311      double precision :: xImin1,xImax1,xImin2,xImax2,xIcent1,xIcent2,dxI
 
 2312      double precision, 
allocatable :: xI1(:),xI2(:),dxI1(:),dxI2(:)
 
 2313      double precision, 
allocatable :: wI(:,:,:),wIs(:,:,:),EM(:,:),WLB(:,:,:)
 
 2314      double precision :: vec_temp1(1:3),vec_temp2(1:3)
 
 2315      double precision :: vec_z(1:3),vec_cor(1:3),xI_cor(1:2)
 
 2316      double precision :: res,LOS_psi,r_max,r_loc
 
 2319      character (30) :: ion
 
 2320      double precision :: logTe,lineCent,sigma_PSF,spaceRsl,wlRsl,wslit
 
 2321      double precision :: arcsec,RHESSI_rsl,LASCO_rsl,pixel,R_occult,smallflux
 
 2322      integer :: iigrid,igrid,i,j,numSI,iw
 
 2334        ximin1=-abs(xprobmax1)
 
 2335        ximin2=-abs(xprobmax1)
 
 2336        ximax1=abs(xprobmax1)
 
 2337        ximax2=abs(xprobmax1)
 
 2341          if (ix1==1) vec_cor(1)=xprobmin1
 
 2342          if (ix1==2) vec_cor(1)=xprobmax1
 
 2344            if (ix2==1) vec_cor(2)=xprobmin2
 
 2345            if (ix2==2) vec_cor(2)=xprobmax2
 
 2347              if (ix3==1) vec_cor(3)=xprobmin3
 
 2348              if (ix3==2) vec_cor(3)=xprobmax3
 
 2351                r_loc=r_loc+(vec_cor(2)-
x_origin(2))**2
 
 2352                r_loc=r_loc+(vec_cor(3)-
x_origin(3))**2
 
 2354                if (ix1==1 .and. ix2==1 .and. ix3==1) 
then 
 2357                  r_max=max(r_max,r_loc)
 
 2361                if (ix1==1 .and. ix2==1 .and. ix3==1) 
then 
 2367                  ximin1=min(ximin1,xi_cor(1))
 
 2368                  ximax1=max(ximax1,xi_cor(1))
 
 2369                  ximin2=min(ximin2,xi_cor(2))
 
 2370                  ximax2=max(ximax2,xi_cor(2))
 
 2383      xicent1=(ximin1+ximax1)/2.d0
 
 2384      xicent2=(ximin2+ximax2)/2.d0
 
 2392      if (datatype==
'image_euv') 
then 
 2396      else if (datatype==
'image_sxr') 
then 
 2398        dxi=rhessi_rsl*arcsec
 
 2400      else if (datatype==
'image_whitelight') 
then 
 2411          call mpistop(
'Whitelight synthesis: instrument is not supported!')
 
 2413        dxi=lasco_rsl*arcsec
 
 2418      numxi1=8*ceiling((ximax1-xicent1)/dxi/8.d0)
 
 2419      ximin1=xicent1-numxi1*dxi
 
 2420      ximax1=xicent1+numxi1*dxi
 
 2422      numxi2=8*ceiling((ximax2-xicent2)/dxi/8.d0)
 
 2423      ximin2=xicent2-numxi2*dxi
 
 2424      ximax2=xicent2+numxi2*dxi
 
 2426      allocate(xi1(numxi1),xi2(numxi2),dxi1(numxi1),dxi2(numxi2))
 
 2428        xi1(ix1)=ximin1+dxi*(ix1-
half)
 
 2432        xi2(ix2)=ximin2+dxi*(ix2-
half)
 
 2437      if (datatype==
'image_euv' .or. datatype==
'image_sxr') 
then 
 2439        allocate(wi(numxi1,numxi2,numwi),wis(numxi1,numxi2,numwi),em(numxi1,numxi2))
 
 2444          do iigrid=1,igridstail; igrid=igrids(iigrid);
 
 2448          do iigrid=1,igridstail; igrid=igrids(iigrid);
 
 2454            if (em(ix1,ix2)>smallflux) wis(ix1,ix2,1)=em(ix1,ix2)
 
 2457        numsi=numxi1*numxi2*numwi
 
 2458        call mpi_allreduce(wis,wi,numsi,mpi_double_precision,mpi_sum,
icomm,
ierrmpi)
 
 2465        call output_data(qunit,xi1,xi2,dxi1,dxi2,wi,numxi1,numxi2,numwi,datatype)
 
 2466        deallocate(wi,wis,em)
 
 2467      else if (datatype==
'image_whitelight') 
then 
 2469        allocate(wi(numxi1,numxi2,numwi),wis(numxi1,numxi2,numwi),wlb(numxi1,numxi2,numwi))
 
 2474          do iigrid=1,igridstail; igrid=igrids(iigrid);
 
 2480            if (wlb(ix1,ix2,1)>smallflux) 
then  
 2481              wis(ix1,ix2,1)=wlb(ix1,ix2,1)
 
 2482              wis(ix1,ix2,2)=wlb(ix1,ix2,2)
 
 2486        numsi=numxi1*numxi2*numwi
 
 2487        call mpi_allreduce(wis,wi,numsi,mpi_double_precision,mpi_sum,
icomm,
ierrmpi)
 
 2494        call output_data(qunit,xi1,xi2,dxi1,dxi2,wi,numxi1,numxi2,numwi,datatype)
 
 2495        deallocate(wi,wis,wlb)
 
 2498      deallocate(xi1,xi2,dxi1,dxi2)
 
 
 2503      integer, 
intent(in) :: igrid,numXI1,numXI2
 
 2504      double precision, 
intent(in) :: xI1(numXI1),xI2(numXI2)
 
 2505      double precision, 
intent(in) :: dxI
 
 2507      character(20), 
intent(in) :: datatype
 
 2508      double precision, 
intent(inout) :: EM(numXI1,numXI2)
 
 2510      integer :: ixO^L,ixO^D,ixI^L,ix^D,i,j
 
 2511      double precision :: xb^L,xd^D
 
 2512      double precision, 
allocatable :: flux(:^D&)
 
 2513      double precision :: res
 
 2514      integer :: ixP^L,ixP^D,nSubC^D,iSubC^D
 
 2515      double precision :: xSubP1,xSubP2,dxSubP,xerf^L,fluxsubC
 
 2516      double precision :: xSubC(1:3),dxSubC^D,xCent(1:2)
 
 2519      double precision :: logTe
 
 2520      character (30) :: ion
 
 2521      double precision :: lineCent
 
 2522      double precision :: sigma_PSF,spaceRsl,wlRsl,sigma0,factor,wslit
 
 2523      double precision :: arcsec,pixel,RHESSI_rsl,area_1AU
 
 2524      double precision :: aa,bb
 
 2526      ^d&ixomin^d=ixmlo^d\
 
 2527      ^d&ixomax^d=ixmhi^d\
 
 2528      ^d&iximin^d=ixglo^d\
 
 2529      ^d&iximax^d=ixghi^d\
 
 2530      ^d&xbmin^d=rnode(rpxmin^d_,igrid)\
 
 2531      ^d&xbmax^d=rnode(rpxmax^d_,igrid)\
 
 2534        arcsec=7.25d5/unit_length
 
 2536        arcsec=7.25d7/unit_length
 
 2539      allocate(flux(ixi^s))
 
 2540      if (datatype==
'image_euv') 
then 
 2542        call get_euv(wavelength,ixi^l,ixo^l,ps(igrid)%w,ps(igrid)%x,fl,flux)
 
 2543        flux(ixo^s)=flux(ixo^s)/instrument_resolution_factor**2   
 
 2544        call get_line_info(wavelength,ion,mass,logte,linecent,spacersl,wlrsl,sigma_psf,wslit)
 
 2545        pixel=spacersl*arcsec
 
 2546        sigma0=sigma_psf*pixel
 
 2547      else if (datatype==
'image_sxr') 
then 
 2549        call get_sxr(ixi^l,ixo^l,ps(igrid)%w,ps(igrid)%x,fl,flux,emin_sxr,emax_sxr) 
 
 2550        rhessi_rsl=2.3d0/instrument_resolution_factor
 
 2552        pixel=rhessi_rsl*arcsec
 
 2553        sigma0=sigma_psf*pixel
 
 2558      {
do ix^d=ixomin^d,ixomax^d\}
 
 2560        ^d&nsubc^d=max(nsubc^d,ceiling(ps(igrid)%dx(ix^dd,^d)*abs(
vec_xi1(^d))/(dxi/2.d0)));
 
 2561        ^d&nsubc^d=max(nsubc^d,ceiling(ps(igrid)%dx(ix^dd,^d)*abs(
vec_xi2(^d))/(dxi/2.d0)));
 
 2562        ^d&dxsubc^d=ps(igrid)%dx(ix^dd,^d)/nsubc^d;
 
 2563        if (datatype==
'image_euv') 
then 
 2565            fluxsubc=flux(ix^d)*dxsubc1*dxsubc2*dxsubc3*unit_length*1.d2/dxi/dxi  
 
 2567            fluxsubc=flux(ix^d)*dxsubc1*dxsubc2*dxsubc3*unit_length/dxi/dxi  
 
 2569        else if (datatype==
'image_sxr') 
then 
 2571          fluxsubc=flux(ix^d)*dxsubc1*dxsubc2*dxsubc3*unit_length**3/area_1au
 
 2573        if (fluxsubc>smalldouble) 
then 
 2575          {
do isubc^d=1,nsubc^d\}
 
 2576            ^d&xsubc(^d)=ps(igrid)%x(ix^dd,^d)-half*ps(igrid)%dx(ix^dd,^d)+(isubc^d-half)*dxsubc^d;
 
 2580            ixp1=floor((xcent(1)-(xi1(1)-half*dxi))/dxi)+1
 
 2581            ixp2=floor((xcent(2)-(xi2(1)-half*dxi))/dxi)+1
 
 2582            ixpmin1=max(1,ixp1-3)
 
 2583            ixpmax1=min(ixp1+3,numxi1)
 
 2584            ixpmin2=max(1,ixp2-3)
 
 2585            ixpmax2=min(ixp2+3,numxi2)
 
 2586            do ixp1=ixpmin1,ixpmax1
 
 2587              do ixp2=ixpmin2,ixpmax2
 
 2588                xerfmin1=((xi1(ixp1)-half*dxi)-xcent(1))/(sqrt(2.d0)*sigma0) 
 
 2589                xerfmax1=((xi1(ixp1)+half*dxi)-xcent(1))/(sqrt(2.d0)*sigma0)
 
 2590                xerfmin2=((xi2(ixp2)-half*dxi)-xcent(2))/(sqrt(2.d0)*sigma0)
 
 2591                xerfmax2=((xi2(ixp2)+half*dxi)-xcent(2))/(sqrt(2.d0)*sigma0)
 
 2592                factor=(erfc(xerfmin1)-erfc(xerfmax1))*(erfc(xerfmin2)-erfc(xerfmax2))/4.d0
 
 2593                em(ixp1,ixp2)=em(ixp1,ixp2)+fluxsubc*factor
 
 
 2604      integer, 
intent(in) :: igrid,numXI1,numXI2
 
 2605      double precision, 
intent(in) :: xI1(numXI1),xI2(numXI2)
 
 2606      double precision, 
intent(in) :: dxI
 
 2608      character(20), 
intent(in) :: datatype
 
 2609      double precision, 
intent(inout) :: EM(numXI1,numXI2)
 
 2611      integer :: ixO^L,ixO^D,ixI^L,ix^D,i,j
 
 2612      double precision, 
allocatable :: flux(:^D&),Ne(:^D&)
 
 2613      integer :: ixP^L,ixP^D,nSubC^D,iSubC^D
 
 2614      double precision :: xSubP1,xSubP2,dxSubP,xerf^L,fluxsubC,RsubC
 
 2615      double precision :: TBsubC,PBsubC
 
 2616      double precision :: xSubC(1:3),dxSubC^D,xCent(1:2),xSubC_car(1:3)
 
 2617      double precision :: R_thick,dotp,dvolume,R_occult,Rc
 
 2618      double precision :: dxl(1:3),x_sph(1:3),dx_sph(1:3)
 
 2619      double precision :: unitv_r(1:3),unitv_theta(1:3),unitv_phi(1:3)
 
 2620      logical :: sun_back_side,emit
 
 2623      double precision :: logTe
 
 2624      character (30) :: ion
 
 2625      double precision :: lineCent
 
 2626      double precision :: sigma_PSF,spaceRsl,wlRsl,sigma0,factor,wslit
 
 2627      double precision :: RHESSI_rsl,area_1AU,arcsec,pixel
 
 2629      ^d&ixomin^d=ixmlo^d;
 
 2630      ^d&ixomax^d=ixmhi^d;
 
 2631      ^d&iximin^d=ixglo^d;
 
 2632      ^d&iximax^d=ixghi^d;
 
 2635        arcsec=7.25d5/unit_length
 
 2637        arcsec=7.25d7/unit_length
 
 2640      allocate(flux(ixi^s))
 
 2641      if (datatype==
'image_euv') 
then 
 2643        call get_euv(wavelength,ixi^l,ixo^l,ps(igrid)%w,ps(igrid)%x,fl,flux)
 
 2644        flux(ixo^s)=flux(ixo^s)/instrument_resolution_factor**2   
 
 2645        call get_line_info(wavelength,ion,mass,logte,linecent,spacersl,wlrsl,sigma_psf,wslit)
 
 2646        pixel=spacersl*arcsec
 
 2647        sigma0=sigma_psf*pixel
 
 2648      else if (datatype==
'image_sxr') 
then 
 2650        call get_sxr(ixi^l,ixo^l,ps(igrid)%w,ps(igrid)%x,fl,flux,emin_sxr,emax_sxr) 
 
 2651        rhessi_rsl=2.3d0/instrument_resolution_factor
 
 2653        pixel=rhessi_rsl*arcsec
 
 2654        sigma0=sigma_psf*pixel
 
 2659      r_thick=r_opt_thick*const_rsun/unit_length
 
 2660      {
do ix^d=ixomin^d,ixomax^d\}
 
 2661        x_sph(1:3)=ps(igrid)%x(ix^d,1:3)
 
 2662        dx_sph(1:3)=ps(igrid)%dx(ix^d,1:3)
 
 2664        dxl(2)=x_sph(1)*dx_sph(2) 
 
 2665        dxl(3)=x_sph(1)*dsin(x_sph(2))*dx_sph(3) 
 
 2670        nsubc1=max(nsubc1,ceiling(dxl(1)*abs(dotp)/(dxi/2.d0)))
 
 2672        nsubc1=max(nsubc1,ceiling(dxl(1)*abs(dotp)/(dxi/2.d0)))
 
 2674        nsubc2=max(nsubc2,ceiling(dxl(2)*abs(dotp)/(dxi/2.d0)))
 
 2676        nsubc2=max(nsubc2,ceiling(dxl(2)*abs(dotp)/(dxi/2.d0)))
 
 2678        nsubc3=max(nsubc3,ceiling(dxl(3)*abs(dotp)/(dxi/2.d0)))
 
 2680        nsubc3=max(nsubc3,ceiling(dxl(3)*abs(dotp)/(dxi/2.d0)))
 
 2685          xsubc(1)=x_sph(1)-half*dx_sph(1)+(isubc1-half)*dx_sph(1)/nsubc1
 
 2687          dxsubc1=dx_sph(1)/nsubc1 
 
 2690            xsubc(2)=x_sph(2)-half*dx_sph(2)+(isubc2-half)*dx_sph(2)/nsubc2
 
 2691            dxsubc2=xsubc(1)*dx_sph(2)/nsubc2 
 
 2692            dxsubc3=xsubc(1)*dsin(xsubc(2))*dx_sph(3)/nsubc3  
 
 2693            dvolume=dxsubc1*dxsubc2*dxsubc3
 
 2694            if (datatype==
'image_euv') 
then 
 2696                fluxsubc=flux(ix^d)*dvolume*unit_length*1.d2/dxi/dxi  
 
 2698                fluxsubc=flux(ix^d)*dvolume*unit_length/dxi/dxi  
 
 2700            else if (datatype==
'image_sxr') 
then 
 2702              fluxsubc=flux(ix^d)*dvolume*unit_length**3/area_1au
 
 2705            if (fluxsubc>smalldouble) 
then 
 2708                xsubc(3)=x_sph(3)-half*dx_sph(3)+(isubc3-half)*dx_sph(3)/nsubc3
 
 2710                rc=dsqrt(xcent(1)**2+xcent(2)**2) 
 
 2715                sun_back_side=.true.
 
 2716                if (dotp<0.d0) sun_back_side=.false.
 
 2718                if (sun_back_side) 
then 
 2720                  if (rc>r_thick) emit=.true.
 
 2723                  if (xsubc(1)<=r_thick) emit=.false.
 
 2729                  ixp1=floor((xcent(1)-(xi1(1)-half*dxi))/dxi)+1
 
 2730                  ixp2=floor((xcent(2)-(xi2(1)-half*dxi))/dxi)+1
 
 2731                  ixpmin1=max(1,ixp1-3)
 
 2732                  ixpmax1=min(ixp1+3,numxi1)
 
 2733                  ixpmin2=max(1,ixp2-3)
 
 2734                  ixpmax2=min(ixp2+3,numxi2)
 
 2735                  do ixp1=ixpmin1,ixpmax1
 
 2736                    do ixp2=ixpmin2,ixpmax2
 
 2737                      xerfmin1=((xi1(ixp1)-half*dxi)-xcent(1))/(sqrt(2.d0)*sigma0)
 
 2738                      xerfmax1=((xi1(ixp1)+half*dxi)-xcent(1))/(sqrt(2.d0)*sigma0)
 
 2739                      xerfmin2=((xi2(ixp2)-half*dxi)-xcent(2))/(sqrt(2.d0)*sigma0)
 
 2740                      xerfmax2=((xi2(ixp2)+half*dxi)-xcent(2))/(sqrt(2.d0)*sigma0)
 
 2741                      factor=(erfc(xerfmin1)-erfc(xerfmax1))*(erfc(xerfmin2)-erfc(xerfmax2))/4.d0
 
 2742                      em(ixp1,ixp2)=em(ixp1,ixp2)+fluxsubc*factor
 
 
 2757      integer, 
intent(in) :: igrid,numXI1,numXI2,numWI
 
 2758      double precision, 
intent(in) :: xI1(numXI1),xI2(numXI2)
 
 2759      double precision, 
intent(in) :: dxI
 
 2761      character(20), 
intent(in) :: datatype
 
 2762      double precision, 
intent(inout) :: WLB(numXI1,numXI2,numWI)
 
 2764      integer :: ixO^L,ixO^D,ixI^L,ix^D,i,j
 
 2765      double precision, 
allocatable :: flux(:^D&),Ne(:^D&)
 
 2766      integer :: ixP^L,ixP^D,nSubC^D,iSubC^D
 
 2767      double precision :: xSubP1,xSubP2,dxSubP,xerf^L,fluxsubC,RsubC
 
 2768      double precision :: sigma_PSF,sigma0,arcsec,pixel,LASCO_rsl
 
 2769      double precision :: A,B,C,D,Rc,Ne0,TBsubC,PBsubC,factor
 
 2770      double precision :: R_thick,dotp,dvolume,R_occult
 
 2771      double precision :: xSubC(1:3),dxSubC^D,xCent(1:2),xSubC_car(1:3)
 
 2772      double precision :: dxl(1:3),x_sph(1:3),dx_sph(1:3)
 
 2773      double precision :: unitv_r(1:3),unitv_theta(1:3),unitv_phi(1:3)
 
 2776      ^d&ixomin^d=ixmlo^d;
 
 2777      ^d&ixomax^d=ixmhi^d;
 
 2778      ^d&iximin^d=ixglo^d;
 
 2779      ^d&iximax^d=ixghi^d;
 
 2782        arcsec=7.25d5/unit_length
 
 2784        arcsec=7.25d7/unit_length
 
 2788      if (whitelight_instrument==
'LASCO/C1') 
then 
 2789        lasco_rsl=5.6d0/instrument_resolution_factor
 
 2791      else if (whitelight_instrument==
'LASCO/C2') 
then 
 2792        lasco_rsl=11.4d0/instrument_resolution_factor
 
 2794      else if (whitelight_instrument==
'LASCO/C3') 
then 
 2795        lasco_rsl=56.d0/instrument_resolution_factor
 
 2798      if (r_occultor>1.d0) r_occult=r_occultor
 
 2799      r_occult=r_occult*const_rsun/unit_length
 
 2800      call fl%get_rho(ps(igrid)%w,ps(igrid)%x,ixi^l,ixo^l,ne)
 
 2802      pixel=lasco_rsl*arcsec
 
 2803      sigma0=sigma_psf*pixel
 
 2806      r_thick=r_opt_thick*const_rsun/unit_length
 
 2807      {
do ix^d=ixomin^d,ixomax^d\}
 
 2808        x_sph(1:3)=ps(igrid)%x(ix^d,1:3)
 
 2809        dx_sph(1:3)=ps(igrid)%dx(ix^d,1:3)
 
 2811        dxl(2)=x_sph(1)*dx_sph(2) 
 
 2812        dxl(3)=x_sph(1)*dsin(x_sph(2))*dx_sph(3) 
 
 2813        ne0=ne(ix^d)*unit_numberdensity
 
 2818        nsubc1=max(nsubc1,ceiling(dxl(1)*abs(dotp)/(dxi/2.d0)))
 
 2820        nsubc1=max(nsubc1,ceiling(dxl(1)*abs(dotp)/(dxi/2.d0)))
 
 2822        nsubc2=max(nsubc2,ceiling(dxl(2)*abs(dotp)/(dxi/2.d0)))
 
 2824        nsubc2=max(nsubc2,ceiling(dxl(2)*abs(dotp)/(dxi/2.d0)))
 
 2826        nsubc3=max(nsubc3,ceiling(dxl(3)*abs(dotp)/(dxi/2.d0)))
 
 2828        nsubc3=max(nsubc3,ceiling(dxl(3)*abs(dotp)/(dxi/2.d0)))
 
 2833          xsubc(1)=x_sph(1)-half*dx_sph(1)+(isubc1-half)*dx_sph(1)/nsubc1
 
 2835          dxsubc1=dx_sph(1)/nsubc1 
 
 2839            xsubc(2)=x_sph(2)-half*dx_sph(2)+(isubc2-half)*dx_sph(2)/nsubc2
 
 2840            dxsubc2=xsubc(1)*dx_sph(2)/nsubc2 
 
 2841            dxsubc3=xsubc(1)*dsin(xsubc(2))*dx_sph(3)/nsubc3  
 
 2842            dvolume=dxsubc1*dxsubc2*dxsubc3
 
 2845              xsubc(3)=x_sph(3)-half*dx_sph(3)+(isubc3-half)*dx_sph(3)/nsubc3
 
 2847              rc=dsqrt(xcent(1)**2+xcent(2)**2) 
 
 2850              if (rc>r_occult) 
then  
 2854                tbsubc=tbsubc*dvolume*unit_length/dxi/dxi
 
 2855                pbsubc=pbsubc*dvolume*unit_length/dxi/dxi
 
 2856                if (tbsubc<1.d-20) emit=.false.
 
 2861                ixp1=floor((xcent(1)-(xi1(1)-half*dxi))/dxi)+1
 
 2862                ixp2=floor((xcent(2)-(xi2(1)-half*dxi))/dxi)+1
 
 2863                ixpmin1=max(1,ixp1-3)
 
 2864                ixpmax1=min(ixp1+3,numxi1)
 
 2865                ixpmin2=max(1,ixp2-3)
 
 2866                ixpmax2=min(ixp2+3,numxi2)
 
 2867                do ixp1=ixpmin1,ixpmax1
 
 2868                  do ixp2=ixpmin2,ixpmax2
 
 2869                    xerfmin1=((xi1(ixp1)-half*dxi)-xcent(1))/(sqrt(2.d0)*sigma0)
 
 2870                    xerfmax1=((xi1(ixp1)+half*dxi)-xcent(1))/(sqrt(2.d0)*sigma0)
 
 2871                    xerfmin2=((xi2(ixp2)-half*dxi)-xcent(2))/(sqrt(2.d0)*sigma0)
 
 2872                    xerfmax2=((xi2(ixp2)+half*dxi)-xcent(2))/(sqrt(2.d0)*sigma0)
 
 2873                    factor=(erfc(xerfmin1)-erfc(xerfmax1))*(erfc(xerfmin2)-erfc(xerfmax2))/4.d0
 
 2874                    wlb(ixp1,ixp2,1)=wlb(ixp1,ixp2,1)+tbsubc*factor
 
 2875                    wlb(ixp1,ixp2,2)=wlb(ixp1,ixp2,2)+pbsubc*factor
 
 
 2891      double precision, 
intent(in) :: Rl
 
 2892      double precision, 
intent(inout) :: A,B,C,D
 
 2894      double precision :: sinO,cosO,sinO2,cosO2,tmp
 
 2899      coso=abs(dsqrt(coso2))
 
 2900      tmp=log((1.d0+sino)/coso)
 
 2902      b=-(1.d0-3.d0*sino2-(coso2/sino)*(1.d0+3.d0*sino2)*tmp)/8.d0
 
 2903      c=4.d0/3.d0-coso-coso*coso2/3.d0
 
 2904      d=(5.d0+sino2-(coso2/sino)*(5.d0-sino2)*tmp)/8.d0
 
 
 2910      double precision, 
intent(in) :: Rl,Rin,Ne,A,B,C,D
 
 2911      double precision, 
intent(inout) :: fluxTB,fluxPB
 
 2913      double precision :: const,u,Bt,Br,PB,TB,sinchi2
 
 2916      const=1.24878d-25/(1.d0-u/3.d0)
 
 2918      bt=const*(c+u*(d-c))
 
 2919      pb=const*sinchi2*((a+u*(b-a)))
 
 
 2928      double precision, 
intent(in) :: x_sph(1:3)
 
 2929      double precision, 
intent(inout) :: unitv_r(1:3),unitv_theta(1:3),unitv_phi(1:3)
 
 2931      unitv_r(1)=dsin(x_sph(2))*dcos(x_sph(3))
 
 2932      unitv_r(2)=dsin(x_sph(2))*dsin(x_sph(3))
 
 2933      unitv_r(3)=dcos(x_sph(2))
 
 2934      unitv_theta(1)=dcos(x_sph(2))*dcos(x_sph(3))
 
 2935      unitv_theta(2)=dcos(x_sph(2))*dsin(x_sph(3))
 
 2936      unitv_theta(3)=-dsin(x_sph(2))
 
 2937      unitv_phi(1)=-dsin(x_sph(3))
 
 2938      unitv_phi(2)=dcos(x_sph(3))
 
 
 2943    subroutine output_data(qunit,xO1,xO2,dxO1,dxO2,wO,nXO1,nXO2,nWO,datatype)
 
 2947      integer, 
intent(in) :: qunit,nXO1,nXO2,nWO
 
 2948      double precision, 
intent(in) :: dxO1(nxO1),dxO2(nxO2)
 
 2949      double precision, 
intent(in) :: xO1(nXO1),xO2(nxO2)
 
 2950      double precision, 
intent(inout) :: wO(nXO1,nXO2,nWO)
 
 2951      character(20), 
intent(in) :: datatype
 
 2953      integer :: nPiece,nP1,nP2,nC1,nC2,nWC
 
 2954      integer :: piece_nmax1,piece_nmax2,ix1,ix2,j,ipc,ixc1,ixc2
 
 2955      double precision, 
allocatable :: xC(:,:,:,:),wC(:,:,:,:),dxC(:,:,:,:)
 
 2961            if (abs(wo(ix1,ix2,j))<smalldouble) wo(ix1,ix2,j)=zero
 
 2968        if (datatype==
'image_euv' .or. datatype==
'image_sxr') 
then 
 2970            piece_nmax1=block_nx2
 
 2971            piece_nmax2=block_nx3
 
 2973            piece_nmax1=block_nx3
 
 2974            piece_nmax2=block_nx1
 
 2976            piece_nmax1=block_nx1
 
 2977            piece_nmax2=block_nx2
 
 2979        else if (datatype==
'spectrum_euv') 
then 
 2982            piece_nmax2=block_nx1
 
 2984            piece_nmax2=block_nx2
 
 2986            piece_nmax2=block_nx3
 
 2993      loopn1: 
do j=piece_nmax1,1,-1
 
 2994        if(mod(nxo1,j)==0) 
then 
 2999      loopn2: 
do j=piece_nmax2,1,-1
 
 3000        if(mod(nxo2,j)==0) 
then 
 3013        case(
'EIvtuCCmpi',
'ESvtuCCmpi',
'SIvtuCCmpi',
'WIvtuCCmpi')
 
 3015          allocate(xc(npiece,nc1,nc2,2))
 
 3016          allocate(dxc(npiece,nc1,nc2,2))
 
 3017          allocate(wc(npiece,nc1,nc2,nwo))
 
 3021                ix1=mod(ipc-1,np1)*nc1+ixc1
 
 3022                ix2=floor(1.0*(ipc-1)/np1)*nc2+ixc2
 
 3023                xc(ipc,ixc1,ixc2,1)=xo1(ix1)
 
 3024                xc(ipc,ixc1,ixc2,2)=xo2(ix2)
 
 3025                dxc(ipc,ixc1,ixc2,1)=dxo1(ix1)
 
 3026                dxc(ipc,ixc1,ixc2,2)=dxo2(ix2)
 
 3028                  wc(ipc,ixc1,ixc2,j)=wo(ix1,ix2,j)
 
 3035          deallocate(xc,dxc,wc)
 
 3036        case(
'EIvtiCCmpi',
'ESvtiCCmpi',
'SIvtiCCmpi',
'WIvtiCCmpi')
 
 3038            call mpistop(
"Error in synthesize emission: vti is not supported for dat resolution")
 
 3040            call write_image_vticc(qunit,xo1,xo2,dxo1,dxo2,wo,nxo1,nxo2,nwo,nc1,nc2)
 
 3043          call mpistop(
"Error in synthesize emission: Unknown convert_type")
 
 
 3049    subroutine write_image_vticc(qunit,xO1,xO2,dxO1,dxO2,wO,nXO1,nXO2,nWO,nC1,nC2)
 
 3053      integer, 
intent(in) :: qunit,nXO1,nXO2,nWO,nC1,nC2
 
 3054      double precision, 
intent(in) :: xO1(nXO1),xO2(nxO2)
 
 3055      double precision, 
intent(in) :: dxO1(nxO1),dxO2(nxO2)
 
 3056      double precision, 
intent(in) :: wO(nXO1,nXO2,nWO)
 
 3058      double precision :: origin(1:3), spacing(1:3)
 
 3059      integer :: wholeExtent(1:6),extent(1:6)
 
 3060      integer :: nP1,nP2,iP1,iP2,iw
 
 3061      integer :: ixC1,ixC2,ixCmin1,ixCmax1,ixCmin2,ixCmax2
 
 3065      character (70) :: subname,wname,vname,nameL,nameS
 
 3066      character (len=std_len) :: filename
 
 3068      double precision :: logTe
 
 3069      character (30) :: ion
 
 3070      double precision :: line_center
 
 3071      double precision :: spatial_rsl,spectral_rsl,sigma_PSF,wslit
 
 3074      origin(1)=xo1(1)-0.5d0*dxo1(1)
 
 3075      origin(2)=xo2(1)-0.5d0*dxo2(1)
 
 3094        inquire(qunit,opened=fileopen)
 
 3095        if(.not.fileopen)
then 
 3100            write(filename,
'(a,i4.4,a)') trim(
filename_euv),filenr,
".vti" 
 3102            write(filename,
'(a,i4.4,a)') trim(
filename_sxr),filenr,
".vti" 
 3108          open(qunit,file=filename,status=
'unknown',form=
'formatted')
 
 3112        write(qunit,
'(a)')
'<?xml version="1.0"?>' 
 3113        write(qunit,
'(a)',advance=
'no') 
'<VTKFile type="ImageData"' 
 3114        write(qunit,
'(a)')
' version="0.1" byte_order="LittleEndian">' 
 3115        write(qunit,
'(a,3(1pe14.6),a,6(i10),a,3(1pe14.6),a)')
'  <ImageData Origin="',&
 
 3116              origin,
'" WholeExtent="',wholeextent,
'" Spacing="',spacing,
'">' 
 3118        write(qunit,
'(a)')
'<FieldData>' 
 3119        write(qunit,
'(2a)')
'<DataArray type="Float32" Name="TIME" ',&
 
 3120                           'NumberOfTuples="1" format="ascii">' 
 3122        write(qunit,
'(a)')
'</DataArray>' 
 3124          write(qunit,
'(2a)')
'<DataArray type="Float32" Name="logT" ',&
 
 3125                             'NumberOfTuples="1" format="ascii">' 
 3126          write(qunit,*) real(logte)
 
 3127          write(qunit,
'(a)')
'</DataArray>' 
 3129        write(qunit,
'(a)')
'</FieldData>' 
 3134            extent(1)=(ip1-1)*nc1
 
 3136            extent(3)=(ip2-1)*nc2
 
 3142            write(qunit,
'(a,6(i10),a)') &
 
 3143                  '<Piece Extent="',extent,
'">' 
 3144            write(qunit,
'(a)')
'<CellData>' 
 3165                if (iw==1) 
write(vname,
'(a)')
'B' 
 3166                if (iw==2) 
write(vname,
'(a)')
'pB' 
 3174              write(qunit,
'(a,a,a)')&
 
 3175                '<DataArray type="Float64" Name="',trim(vname),
'" format="ascii">' 
 3176              write(qunit,
'(200(1pe14.6))') ((wo(ixc1,ixc2,iw),ixc1=ixcmin1,ixcmax1),ixc2=ixcmin2,ixcmax2)
 
 3177              write(qunit,
'(a)')
'</DataArray>' 
 3179            write(qunit,
'(a)')
'</CellData>' 
 3180            write(qunit,
'(a)')
'</Piece>' 
 3184        write(qunit,
'(a)')
'</ImageData>' 
 3185        write(qunit,
'(a)')
'</VTKFile>' 
 
 3195      integer, 
intent(in) :: qunit
 
 3196      integer, 
intent(in) :: nPiece,nC1,nC2,nWC
 
 3197      double precision, 
intent(in) :: xC(nPiece,nC1,nC2,2),dxC(nPiece,nc1,nc2,2)
 
 3198      double precision, 
intent(in) :: wC(nPiece,nC1,nC2,nWC)
 
 3199      character(20), 
intent(in) :: datatype
 
 3202      double precision :: xP(nPiece,nC1+1,nC2+1,2)
 
 3205      character (70) :: subname,wname,vname,nameL,nameS
 
 3206      character (len=std_len) :: filename
 
 3207      integer :: ixC1,ixC2,ixP,ix1,ix2,j
 
 3208      integer :: nc,np,icel,VTK_type
 
 3210      double precision :: logTe
 
 3211      character (30) :: ion
 
 3212      double precision :: line_center
 
 3213      double precision :: spatial_rsl,spectral_rsl,sigma_PSF,wslit
 
 3223            if (ix1<np1) xp(ixp,ix1,ix2,1)=xc(ixp,ix1,1,1)-0.5d0*dxc(ixp,ix1,1,1)
 
 3224            if (ix1==np1) xp(ixp,ix1,ix2,1)=xc(ixp,ix1-1,1,1)+0.5d0*dxc(ixp,ix1-1,1,1)
 
 3225            if (ix2<np2) xp(ixp,ix1,ix2,2)=xc(ixp,1,ix2,2)-0.5d0*dxc(ixp,1,ix2,2)
 
 3226            if (ix2==np2) xp(ixp,ix1,ix2,2)=xc(ixp,1,ix2-1,2)+0.5d0*dxc(ixp,1,ix2-1,2)
 
 3231      if (datatype==
'image_euv') 
then 
 3233      else if (datatype==
'spectrum_euv') 
then 
 3238        inquire(qunit,opened=fileopen)
 
 3239        if(.not.fileopen)
then 
 3243          if (datatype==
'image_euv') 
then 
 3244            write(filename,
'(a,i4.4,a)') trim(
filename_euv),filenr,
".vtu" 
 3245          else if (datatype==
'image_sxr') 
then 
 3246            write(filename,
'(a,i4.4,a)') trim(
filename_sxr),filenr,
".vtu" 
 3247          else if (datatype==
'image_whitelight') 
then 
 3249          else if (datatype==
'spectrum_euv') 
then 
 3252          open(qunit,file=filename,status=
'unknown',form=
'formatted')
 
 3255        write(qunit,
'(a)')
'<?xml version="1.0"?>' 
 3256        write(qunit,
'(a)',advance=
'no') 
'<VTKFile type="UnstructuredGrid"' 
 3257        write(qunit,
'(a)')
' version="0.1" byte_order="LittleEndian">' 
 3258        write(qunit,
'(a)')
'<UnstructuredGrid>' 
 3259        write(qunit,
'(a)')
'<FieldData>' 
 3260        write(qunit,
'(2a)')
'<DataArray type="Float32" Name="TIME" ',&
 
 3261                           'NumberOfTuples="1" format="ascii">' 
 3263        write(qunit,
'(a)')
'</DataArray>' 
 3264        if (datatype==
'image_euv' .or. datatype==
'spectrum_euv') 
then 
 3265          write(qunit,
'(2a)')
'<DataArray type="Float32" Name="logT" ',&
 
 3266                             'NumberOfTuples="1" format="ascii">' 
 3267          write(qunit,*) real(logte)
 
 3268          write(qunit,
'(a)')
'</DataArray>' 
 3270        write(qunit,
'(a)')
'</FieldData>' 
 3272          write(qunit,
'(a,i7,a,i7,a)') &
 
 3273                '<Piece NumberOfPoints="',np,
'" NumberOfCells="',nc,
'">' 
 3274          write(qunit,
'(a)')
'<CellData>' 
 3276            if (datatype==
'image_euv') 
then 
 3287            else if (datatype==
'image_sxr') 
then 
 3295            else if (datatype==
'image_whitelight') 
then 
 3296              write(vname,
'(a)')
'whitelight' 
 3297            else if (datatype==
'spectrum_euv') 
then 
 3304            write(qunit,
'(a,a,a)')&
 
 3305              '<DataArray type="Float64" Name="',trim(vname),
'" format="ascii">' 
 3306            write(qunit,
'(200(1pe14.6))') ((wc(ixp,ixc1,ixc2,j),ixc1=1,nc1),ixc2=1,nc2)
 
 3307            write(qunit,
'(a)')
'</DataArray>' 
 3309          write(qunit,
'(a)')
'</CellData>' 
 3310          write(qunit,
'(a)')
'<Points>' 
 3311          write(qunit,
'(a)')
'<DataArray type="Float32" NumberOfComponents="3" format="ascii">' 
 3316                  write(qunit,
'(3(1pe14.6))') 0.d0,xp(ixp,ix1,ix2,1),xp(ixp,ix1,ix2,2)
 
 3318                  write(qunit,
'(3(1pe14.6))') xp(ixp,ix1,ix2,2),0.d0,xp(ixp,ix1,ix2,1)
 
 3320                  write(qunit,
'(3(1pe14.6))') xp(ixp,ix1,ix2,1),xp(ixp,ix1,ix2,2),0.d0
 
 3324                  write(qunit,
'(3(1pe14.6))') 0.d0,xp(ixp,ix1,ix2,1),xp(ixp,ix1,ix2,2)
 
 3326                  write(qunit,
'(3(1pe14.6))') xp(ixp,ix1,ix2,2),0.d0,xp(ixp,ix1,ix2,1)
 
 3328                  write(qunit,
'(3(1pe14.6))') xp(ixp,ix1,ix2,1),xp(ixp,ix1,ix2,2),0.d0
 
 3331                write(qunit,
'(3(1pe14.6))') xp(ixp,ix1,ix2,1),xp(ixp,ix1,ix2,2),0.d0
 
 3335          write(qunit,
'(a)')
'</DataArray>' 
 3336          write(qunit,
'(a)')
'</Points>' 
 3338          write(qunit,
'(a)')
'<Cells>' 
 3339          write(qunit,
'(a)')
'<DataArray type="Int32" Name="connectivity" format="ascii">' 
 3342              write(qunit,
'(4(i7))') ix1-1+(ix2-1)*np1,ix1+(ix2-1)*np1,&
 
 3343                                     ix1-1+ix2*np1,ix1+ix2*np1
 
 3346          write(qunit,
'(a)')
'</DataArray>' 
 3348          write(qunit,
'(a)')
'<DataArray type="Int32" Name="offsets" format="ascii">' 
 3350            write(qunit,
'(i7)') icel*(2**2)
 
 3352          write(qunit,
'(a)')
'</DataArray>' 
 3354          write(qunit,
'(a)')
'<DataArray type="Int32" Name="types" format="ascii">' 
 3358            write(qunit,
'(i2)') vtk_type
 
 3360          write(qunit,
'(a)')
'</DataArray>' 
 3361          write(qunit,
'(a)')
'</Cells>' 
 3362          write(qunit,
'(a)')
'</Piece>' 
 3364        write(qunit,
'(a)')
'</UnstructuredGrid>' 
 3365        write(qunit,
'(a)')
'</VTKFile>' 
 
 3371      double precision, 
intent(in) :: vec1(1:3),vec2(1:3)
 
 3372      double precision, 
intent(out) :: res
 
 3374      res=vec1(1)*vec2(1)+vec1(2)*vec2(2)+vec1(3)*vec2(3)
 
 
 3379      double precision, 
intent(in) :: vec_in1(1:3),vec_in2(1:3)
 
 3380      double precision, 
intent(out) :: vec_out(1:3)
 
 3382      vec_out(1)=vec_in1(2)*vec_in2(3)-vec_in1(3)*vec_in2(2)
 
 3383      vec_out(2)=vec_in1(3)*vec_in2(1)-vec_in1(1)*vec_in2(3)
 
 3384      vec_out(3)=vec_in1(1)*vec_in2(2)-vec_in1(2)*vec_in2(1)
 
 
 3390      double precision :: LOS_psi
 
 3391      double precision :: vec_car(1:3),vec_z(1:3),vec_temp1(1:3),vec_temp2(1:3)
 
 3392      double precision :: vec_LOS_sph(1:3),vec_xI1_sph(1:3),vec_xI2_sph(1:3)
 
 3396      vec_los(2)=dpi*los_theta/180.d0
 
 3407      if (los_theta==zero) 
then 
 3409        vec_temp1(2)=dpi/2.d0
 
 3410        vec_temp1(3)=dpi*los_phi/180.d0
 
 3424      los_psi=dpi*image_rotate/180.d0
 
 3425      vec_xi1=vec_temp1*cos(los_psi)-vec_temp2*sin(los_psi)
 
 3426      vec_xi2=vec_temp2*cos(los_psi)+vec_temp1*sin(los_psi)
 
 3437      vec_los_sph(2:3)=vec_los_sph(2:3)*180.d0/dpi
 
 3438      vec_xi1_sph(2:3)=vec_xi1_sph(2:3)*180.d0/dpi
 
 3439      vec_xi2_sph(2:3)=vec_xi2_sph(2:3)*180.d0/dpi
 
 3441      if (mype==0) 
write(*,
'(a,f3.1,f6.1,f6.1,a)') 
' LOS vector (spherial): [',vec_los_sph(1),vec_los_sph(2),vec_los_sph(3),
']' 
 3442      if (mype==0) 
write(*,
'(a,f3.1,f6.1,f6.1,a)') 
' xI1 vector (spherial): [',vec_xi1_sph(1),vec_xi1_sph(2),vec_xi1_sph(3),
']' 
 3443      if (mype==0) 
write(*,
'(a,f3.1,f6.1,f6.1,a)') 
' xI2 vector (spherial): [',vec_xi2_sph(1),vec_xi2_sph(2),vec_xi2_sph(3),
']' 
 
 3449      double precision, 
intent(in) :: vec_sph(1:3)
 
 3450      double precision, 
intent(inout) :: vec_car(1:3)
 
 3452      vec_car(1)=vec_sph(1)*dsin(vec_sph(2))*dcos(vec_sph(3))
 
 3453      vec_car(2)=vec_sph(1)*dsin(vec_sph(2))*dsin(vec_sph(3))
 
 3454      vec_car(3)=vec_sph(1)*dcos(vec_sph(2))
 
 
 3460      double precision, 
intent(in) :: vec_car(1:3)
 
 3461      double precision, 
intent(inout) :: vec_sph(1:3)
 
 3463      vec_sph(1)=dsqrt(vec_car(1)**2+vec_car(2)**2+vec_car(3)**2)
 
 3464      vec_sph(2)=dacos(vec_car(3)/vec_sph(1))
 
 3465      vec_sph(3)=atan2(vec_car(2),vec_car(3))
 
 
 3471      double precision :: LOS_psi
 
 3472      double precision :: vec_z(1:3),vec_temp1(1:3),vec_temp2(1:3)
 
 3475      vec_los(1)=-cos(dpi*los_phi/180.d0)*sin(dpi*los_theta/180.d0)
 
 3476      vec_los(2)=-sin(dpi*los_phi/180.d0)*sin(dpi*los_theta/180.d0)
 
 3477      vec_los(3)=-cos(dpi*los_theta/180.d0)
 
 3483      if (los_theta==zero) 
then 
 3484        vec_xi1(1)=cos(dpi*los_phi/180.d0)
 
 3485        vec_xi1(2)=sin(dpi*los_phi/180.d0)
 
 3493      los_psi=dpi*image_rotate/180.d0
 
 3494      vec_xi1=vec_temp1*cos(los_psi)-vec_temp2*sin(los_psi)
 
 3495      vec_xi2=vec_temp2*cos(los_psi)+vec_temp1*sin(los_psi)
 
 
 3509      double precision, 
intent(in) :: x_3D_sph(1:3)
 
 3510      double precision, 
intent(inout) :: x_image(1:2)
 
 3511      double precision :: res,res_origin
 
 3512      double precision :: x_3D(1:3)
 
 
 3523      double precision, 
intent(in) :: x_3D(1:3)
 
 3524      double precision, 
intent(inout) :: x_image(1:2)
 
 3525      double precision :: res,res_origin
 
 3529      x_image(1)=res-res_origin
 
 3532      x_image(2)=res-res_origin
 
 
subroutine, public mpistop(message)
Exit MPI-AMRVAC with an error message.
Module for physical and numeric constants.
double precision, parameter const_rsun
double precision, parameter kb_cgs
Boltzmann constant in cgs.
double precision, parameter half
double precision, parameter one
double precision, parameter dpi
Pi.
double precision, parameter zero
some frequently used numbers
double precision, parameter smalldouble
double precision, parameter mp_cgs
Proton mass in cgs.
double precision, parameter const_c
Module with geometry-related routines (e.g., divergence, curl)
integer, parameter spherical
integer, parameter cartesian
This module contains definitions of global parameters and variables and some generic functions/subrou...
character(len=std_len) filename_sxr
Base file name for synthetic SXR emission output.
integer spectrum_wl
wave length for spectrum
integer ixghi
Upper index of grid block arrays.
logical activate_unit_arcsec
use arcsec as length unit of images/spectra
character(len=std_len) filename_spectrum
Base file name for synthetic EUV spectrum output.
double precision global_time
The global simulation time.
integer snapshotini
Resume from the snapshot with this index.
character(len=std_len) filename_euv
Base file name for synthetic EUV emission output.
double precision unit_numberdensity
Physical scaling factor for number density.
character(len=std_len) filename_whitelight
Base file name for synthetic white light.
character(len=std_len) convert_type
Which format to use when converting.
integer, parameter rpxmin
double precision unit_length
Physical scaling factor for length.
double precision location_slit
location of the slit
double precision time_convert_factor
Conversion factor for time unit.
integer icomm
The MPI communicator.
character(len=std_len) whitelight_instrument
white light observation instrument
integer mype
The rank of the current MPI task.
double precision, dimension(:), allocatable, parameter d
integer ierrmpi
A global MPI error return code.
logical autoconvert
If true, already convert to output format during the run.
integer snapshotnext
IO: snapshot and collapsed views output numbers/labels.
logical dat_resolution
resolution of the images
double precision r_occultor
the white light emission below it (unit=Rsun) is not visible
integer, dimension(ndim) nstretchedblocks_baselevel
(even) number of (symmetrically) stretched blocks at AMR level 1, per dimension
double precision, dimension(^nd) qstretch_baselevel
stretch factor between cells at AMR level 1, per dimension
double precision unit_velocity
Physical scaling factor for velocity.
double precision, dimension(:,:), allocatable rnode
Corner coordinates.
double precision unit_temperature
Physical scaling factor for temperature.
logical si_unit
Use SI units (.true.) or use cgs units (.false.)
double precision los_theta
direction of the line of sight (LOS)
double precision spectrum_window_max
integer wavelength
wavelength for output
integer, dimension(ndim) stretch_type
What kind of stretching is used per dimension.
double precision, dimension(^nd) dxlevel
store unstretched cell size of current level
integer, parameter rpxmax
logical big_image
big image
double precision instrument_resolution_factor
times for enhancing spatial resolution for EUV image/spectra
double precision spectrum_window_min
spectral window
integer refine_max_level
Maximal number of AMR levels.
integer direction_slit
direction of the slit (for dat resolution only)
double precision, dimension(1:3) x_origin
where the is the origin (X=0,Y=0) of image
integer, dimension(:,:), allocatable node
integer, parameter ixglo
Lower index of grid block arrays (always 1)
This module defines the procedures of a physics module. It contains function pointers for the various...
double precision, dimension(1:3) vec_los
subroutine get_goes_flux_grid(ixil, ixol, w, x, dv, xboxl, xbl, fl, eflux_grid)
subroutine integrate_spectra_cartesian(igrid, wl, dwlg, xs, dxsg, spectra, numwl, numxs, fl)
subroutine get_spectrum_datresol(qunit, datatype, fl)
double precision, dimension(1:101) f_304
double precision, dimension(1:101) f_193
double precision, dimension(1:60) f_264
double precision, dimension(1:60) f_263
subroutine get_euv_image(qunit, fl)
double precision, dimension(1:60) t_eis1
subroutine get_sxr(ixil, ixol, w, x, fl, flux, el, eu)
subroutine get_unit_vector_spherical(x_sph, unitv_r, unitv_theta, unitv_phi)
double precision, dimension(1:101) f_131
subroutine get_line_info(wl, ion, mass, logte, line_center, spatial_px, spectral_px, sigma_psf, width_slit)
double precision, dimension(1:60) f_255
double precision, dimension(1:101) t_aia
subroutine write_image_vtucc(qunit, xc, wc, dxc, npiece, nc1, nc2, nwc, datatype)
subroutine get_cor_image(x_3d, x_image)
subroutine get_thomson_parameters(rl, a, b, c, d)
subroutine integrate_euv_datresol(igrid, nxif1, nxif2, xif1, xif2, dxif1, dxif2, fl, euv, dpl)
double precision, dimension(1:60) t_eis2
double precision, dimension(1:101) f_171
double precision, dimension(1:101) f_94
subroutine integrate_spectra_datresol(igrid, wl, dwl, spectra, numwl, numxs, dir_loc, fl)
double precision, dimension(1:3) vec_xi1
subroutine get_spectrum(qunit, datatype, fl)
subroutine cartesian_to_spherical(vec_car, vec_sph)
subroutine get_cor_image_spherical(x_3d_sph, x_image)
subroutine dot_product_loc(vec1, vec2, res)
subroutine integrate_emission_spherical(igrid, numxi1, numxi2, xi1, xi2, dxi, fl, datatype, em)
subroutine get_image(qunit, datatype, fl)
subroutine integrate_emission_cartesian(igrid, numxi1, numxi2, xi1, xi2, dxi, fl, datatype, em)
subroutine init_vectors_spherical()
subroutine write_image_vticc(qunit, xo1, xo2, dxo1, dxo2, wo, nxo1, nxo2, nwo, nc1, nc2)
subroutine get_sxr_image(qunit, fl)
subroutine init_vectors_cartesian()
double precision, dimension(1:60) f_192
subroutine get_whitelight_thomson(rl, rin, ne, a, b, c, d, fluxtb, fluxpb)
subroutine get_image_datresol(qunit, datatype, fl)
subroutine get_goes_sxr_flux(xboxl, fl, eflux)
subroutine integrate_whitelight_spherical(igrid, numxi1, numxi2, numwi, xi1, xi2, dxi, fl, datatype, wlb)
double precision, dimension(1:3) vec_xi2
double precision, dimension(1:41) f_1354
subroutine cross_product_loc(vec_in1, vec_in2, vec_out)
subroutine integrate_sxr_datresol(igrid, nxif1, nxif2, xif1, xif2, dxif1, dxif2, fl, sxr)
double precision, dimension(1:101) f_335
subroutine output_data(qunit, xo1, xo2, dxo1, dxo2, wo, nxo1, nxo2, nwo, datatype)
double precision, dimension(1:41) t_iris
subroutine get_euv_spectrum(qunit, fl)
double precision, dimension(1:101) f_211
subroutine get_whitelight_image(qunit, fl)
subroutine get_euv(wl, ixil, ixol, w, x, fl, flux)
subroutine spherical_to_cartesian(vec_sph, vec_car)