00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #include "load_data.hpp"
00039 #include "kalbach.hpp"
00040 #include "record_types.hpp"
00041 #include "endl_formats.hpp"
00042 #include "mf4classes.hpp"
00043 #include "mf5classes.hpp"
00044 #include "mf6classes.hpp"
00045 #include "mf6_gammas.hpp"
00046 #include "mf12classes.hpp"
00047 #include "mf13classes.hpp"
00048 #include "mf14classes.hpp"
00049 #include "mf14table.hpp"
00050 #include "messaging.hpp"
00051 #include "multiplicity.hpp"
00052 #include "charge.hpp"
00053
00054 extern ENDLClass ENDL;
00055 extern GlobalParameterClass Global;
00056 extern C55_gammas C55;
00057
00058
00059 void LoadData( int F, int T )
00060 {
00061 try {
00062
00063 if ( T==5 )
00064 {
00065 Unimplemented("LoadData",
00066 "general particle production has no ENDL equivalent.");
00067 }
00068 else if ( F==1 )
00069 {
00070
00071 if ( T < 400 )
00072 {
00073 SevereError("LoadData",pastenum("MF = ",F)+" not used.");
00074 }
00075 }
00076 else if ( F==2 )
00077 {}
00078 else if ( F==3 )
00079 {
00080 mf3_file inFile;
00081 inFile.open(F, T);
00082 LoadMF3Data( inFile );
00083 Info("LoadData","Closing file "+endf_file_name(F,T)+"...");
00084 inFile.close();
00085 }
00086 else if( !ENDL.write_file )
00087 {
00088
00089 return;
00090 }
00091 else if ( F==4 )
00092 {
00093 mf4_file inFile;
00094 inFile.open(F, T);
00095 LoadMF4Data( inFile );
00096 Info("LoadData","Closing file "+endf_file_name(F,T)+"...");
00097 inFile.close();
00098 }
00099 else if ( F==5 )
00100 {
00101 mf5_file inFile;
00102 inFile.open(F, T);
00103 LoadMF5Data( inFile );
00104 Info("LoadData","Closing file "+endf_file_name(F,T)+"...");
00105 inFile.close();
00106 }
00107 else if ( F==6 )
00108 {
00109 mf6_file inFile;
00110 inFile.open(F, T);
00111 LoadMF6Data( inFile );
00112 Info("LoadData","Closing file "+endf_file_name(F,T)+"...");
00113 inFile.close();
00114 }
00115 else if ( F==7 )
00116 {
00117 Unimplemented("LoadData",pastenum("MF = ",F)+" not implemeted yet.");
00118 }
00119 else if ( F==8 )
00120 {
00121 Info("LoadData",
00122 "ENDL does not support Radio and fission-product decay data, "+
00123 pastenum("MF = ",F));
00124 }
00125 else if ( F==9 )
00126 {
00127 Unimplemented("LoadData",
00128 "fete does not yet translate Multiplicities for radio nuclide prod, "+
00129 pastenum("MF = ",F));
00130 }
00131 else if ( F==10 )
00132 {
00133 Unimplemented("LoadData",
00134 "fete does not yet translate Cross sections for radio nuclide prod, "+
00135 pastenum("MF = ",F));
00136 }
00137 else if ( ( F==12 ) || ( F==13 ) )
00138 {
00139 if( Global.Value( "skip_gammas" ) <= 0.0 )
00140 {
00141 if( T > 4 )
00142 {
00143 mf12_file inFile;
00144 inFile.open(F, T);
00145 LoadGammaData( inFile );
00146 Info("LoadData","Closing file "+endf_file_name(F,T)+"...");
00147 inFile.close();
00148 }
00149 else
00150 {
00151 mf13_file inFile;
00152 inFile.open(F, T);
00153 LoadMF13Data( inFile );
00154 Info("LoadData","Closing file "+endf_file_name(F,T)+"...");
00155 inFile.close();
00156 }
00157 }
00158 }
00159 else if ( F==14 )
00160 {
00161
00162 }
00163 else if ( F==15 )
00164 {
00165
00166 }
00167 else if ( F==23 )
00168 {
00169 Warning("LoadData",pastenum("MF = ",F)+" not implemeted yet.");
00170 }
00171 else if ( F==27 )
00172 {
00173 Warning("LoadData",pastenum("MF = ",F)+" not implemeted yet.");
00174 }
00175 else if ( F==30 )
00176 {
00177 Unimplemented("LoadData","ENDL does not support covariances yet, "
00178 +pastenum("MF = ",F)+" not implemented.");
00179 }
00180 else if ( F==31 )
00181 {
00182 Unimplemented("LoadData","ENDL does not support covariances yet, "
00183 +pastenum("MF = ",F)+" not implemented.");
00184 }
00185 else if ( F==32 )
00186 {
00187 Unimplemented("LoadData","ENDL does not support covariances yet, "
00188 +pastenum("MF = ",F)+" not implemented.");
00189 }
00190 else if ( F==33 )
00191 {
00192 Unimplemented("LoadData","ENDL does not support covariances yet, "
00193 +pastenum("MF = ",F)+" not implemented.");
00194 }
00195 else if ( F==34 )
00196 {
00197 Unimplemented("LoadData","ENDL does not support covariances yet, "
00198 +pastenum("MF = ",F)+" not implemented.");
00199 }
00200 else if ( F==35 )
00201 {
00202 Unimplemented("LoadData","ENDL does not support covariances yet, "
00203 +pastenum("MF = ",F)+" not implemented.");
00204 }
00205 else if ( F==39 )
00206 {
00207 Unimplemented("LoadData","ENDL does not support covariances yet, "
00208 +pastenum("MF = ",F)+" not implemented.");
00209 }
00210 else if ( F==40 )
00211 {
00212 Unimplemented("LoadData","ENDL does not support covariances yet, "
00213 +pastenum("MF = ",F)+" not implemented.");
00214 }
00215 else
00216 {
00217 SevereError("LoadData",pastenum("MF = ",F)+" not valid.");
00218 }
00219 }
00220 catch (string str) {
00221 cerr << "fete LoadData: " << str <<
00222 ", abort processing of this file." << endl;
00223 return;
00224 }
00225
00226
00227 ENDL.set_s_number();
00228
00229
00230 ENDL.set_QValue();
00231 }
00232
00233
00234
00235 void LoadMF1Data( int T, mf1_file& inFile )
00236 {
00237 Warning( "LoadMF1Data", "Use of this function is deprecated. Use LoadFissionData instead." );
00238 LoadFissionData( );
00239 }
00240
00241
00242 bool MF1MTExists( int MT ){
00243 mf1_file inFile;
00244 inFile.open( 1, MT, false );
00245 return inFile;
00246 }
00247
00248
00249
00250
00251
00252 void LoadFissionData( )
00253 {
00254 int LNU;
00255 int ZA;
00256 double AWR;
00257 bool got_nubar_prompt = false;
00258 bool got_nubar_delayed = false;
00259
00260
00261 if ( Global.Value("fission_Q") != 0.0 )
00262 {
00263
00264 if( MF1MTExists( 458 ) )
00265 {
00266 Info("LoadFissionData","Processing energy release due to fission (MT = 458) file.");
00267 Info("LoadFissionData","Computing Q values based on (MT = 458) file.");
00268 mt458_file Q_file;
00269 Q_file.open( 1, 458 );
00270 double QM = Q_file.reduce_Q( ENDL.QM/ENDL.eV2MeV );
00271 ENDL.reaction( 0, QM, QM );
00272 Info("LoadFissionData","Closing file "+endf_file_name(1,458)+"...");
00273 Q_file.close();
00274 }
00275 else Info("LoadFissionData","No delayed decay energy (MT = 458) file.");
00276 }
00277
00278
00279 ENDL.res_za = 99120;
00280
00281
00282 if ( MF1MTExists( 460 ) ) Info("LoadFissionData","Skipping post-fission beta-delayed gamma data (MT = 460) file.");
00283
00284
00285 if ( MF1MTExists( 455 ) )
00286 {
00287 Info("LoadFissionData","Processing delayed fission nubar (MT = 455) file.");
00288 mf1_file inFile;
00289 inFile.open( 1, 455 );
00290 inFile.read_line1(&ZA, &AWR, &LNU);
00291 fission_delay fiss_delay;
00292 fiss_delay.manager(inFile);
00293 got_nubar_delayed = true;
00294 Info("LoadFissionData","Closing file "+endf_file_name(1,455)+"...");
00295
00296 ENDL.set_yo( 0 );
00297 ENDL.set_s_number( 0 );
00298 ENDL.set_x1( 0.0 );
00299 }
00300 else Info("LoadFissionData","No delayed fission nubar (MT = 455) file.");
00301
00302
00303 if ( MF1MTExists( 456 ) )
00304 {
00305 Info("LoadFissionData","Processing prompt fission nubar (MT = 456) file.");
00306 mf1_file inFile;
00307 inFile.open( 1, 456 );
00308 inFile.read_line1(&ZA, &AWR, &LNU);
00309 multiplicity multiple;
00310
00311 int NR, NP;
00312 inFile.mult_head(
00313 &NR,
00314 &NP
00315 );
00316 inFile.get_regions( NR, multiple.NBT, multiple.INT );
00317 multiple.read_data( NP, inFile );
00318 ENDL.set_yo(1);
00319 if ( ENDL.write_file ) multiple.write_endl( 7 );
00320 got_nubar_prompt = true;
00321 Info("LoadFissionData","Closing file "+endf_file_name(1,456)+"...");
00322
00323 ENDL.set_yo( 0 );
00324 ENDL.set_s_number( 0 );
00325 }
00326 else Info("LoadFissionData","No prompt fission nubar (MT = 456) file.");
00327
00328
00329 if ( MF1MTExists( 452 ) )
00330 {
00331 if ( got_nubar_prompt && got_nubar_delayed )
00332 {
00333 Info("LoadFissionData","Skipping total fission nubar (MT = 452), it is redundant so not worth processing.");
00334 }
00335 else
00336 {
00337 Info("LoadFissionData","Processing total fission nubar (MT = 452) file.");
00338 mf1_file inFile;
00339 inFile.open( 1, 452 );
00340 inFile.read_line1(&ZA, &AWR, &LNU);
00341 multiplicity multiple;
00342
00343 int NR, NP;
00344 inFile.mult_head(
00345 &NR,
00346 &NP
00347 );
00348 inFile.get_regions( NR, multiple.NBT, multiple.INT );
00349 multiple.read_data( NP, inFile );
00350 ENDL.set_yo( 1 );
00351 ENDL.set_s_number( 17 );
00352 if ( ENDL.write_file ) multiple.write_endl( 7 );
00353 Info("LoadFissionData","Closing file "+endf_file_name(1,452)+"...");
00354
00355 ENDL.set_yo( 0 );
00356 ENDL.set_s_number( 0 );
00357 }
00358 }
00359 else Info("LoadFissionData","No total fission nubar (MT = 452).");
00360
00361 }
00362
00363
00364 void LoadMF3Data( mf3_file& inFile )
00365 {
00366
00367 one_d_table xs;
00368
00369 int ZA;
00370 double AWR;
00371 double QM, QI;
00372 int LR,NR, NP;
00373
00374
00375 inFile.read_line1(&ZA, &AWR);
00376
00377
00378 inFile.read_line2(
00379 &QM,
00380 &QI,
00381 &LR,
00382 &NR,
00383 &NP
00384 );
00385
00386
00387 ENDL.reaction( LR, QM, QI );
00388
00389
00390 if ( ENDL.T == 18 ) LoadFissionData( );
00391
00392 if ( !ENDL.write_file )
00393 {
00394 Info("LoadMF3Data",pastenum("Skipping mf: ",ENDL.F)+pastenum(" mt: ",ENDL.T));
00395 return;
00396 }
00397
00398
00399
00400 if ( NR != 1 ) SevereError("LoadMF3Data","Expected single region, was this file preprocessed?");
00401
00402 inFile.get_regions( NR, xs.NBT, xs.INT );
00403
00404 xs.read_data( NP, inFile, ENDL.Max_E_in );
00405
00406 if ( ENDL.write_file )
00407 {
00408
00409 xs.unique();
00410 xs.widen_jumps();
00411 xs.write_endl( 0 );
00412 }
00413
00414
00415
00416 if( ENDL.T != 18 ) ENDL.get_resid( );
00417 }
00418
00419
00420 void LoadMF4Data( mf4_file& inFile )
00421 {
00422 int ZA, LVT, LTT;
00423 int LI, LCT;
00424 int NK,NM;
00425 double AWR;
00426 int ZAP, NR, NE;
00427
00428 inFile.read_line1(
00429 &ZA,
00430 &AWR,
00431 &LVT,
00432 <T
00433 );
00434 inFile.read_line2(
00435 &LI,
00436 &LCT,
00437 &NK,
00438 &NM
00439 );
00440
00441
00442 if( ( ENDL.angles_CM && ( LCT != 2 ) ) ||
00443 ( !ENDL.angles_CM && ( LCT != 1 ) ) )
00444 {
00445 Warning( "LoadMF4Data", " wrong frame " + pastenum("LCT = ",LCT) );
00446
00447
00448 }
00449
00450 if( LVT == 1)
00451 {
00452
00453 inFile.skip(NK);
00454 }
00455
00456
00457 ZAP=ENDL.get_ZAP( ENDL.T );
00458 ENDL.set_outgoing_ZA( ZAP );
00459
00460 if ( !ENDL.write_file )
00461 {
00462 Info("LoadMF4Data",pastenum("Skipping mf: ",ENDL.F)+pastenum(" mt: ",ENDL.T));
00463 return;
00464 }
00465
00466
00467
00468
00469 if ( LTT==0 )
00470 {
00471 two_d_isotropic isotropic;
00472 if ( LI != 1 )
00473 {
00474 Unimplemented("LoadMF4Data","Need new code for "+pastenum("LTT = ",LTT)
00475 +pastenum(" LVT = ",LVT)+pastenum(" LI = ",LI));
00476 return;
00477 }
00478 Info("LoadMF4Data","Doing mf4 isotropic");
00479 isotropic.expand_data( ENDL.T );
00480 if ( ENDL.write_file )
00481 {
00482 isotropic.widen_jumps();
00483 isotropic.write_endl(1);
00484 if ( ( ENDL.res_za <= 2004 ) && ( ENDL.S != 9 ) )
00485 {
00486 ENDL.outgoing_particle = 10 + ENDL.za_to_yo( ENDL.res_za );
00487 isotropic.write_endl(1);
00488 }
00489 }
00490 }
00491
00492
00493 else if ( LTT==1 )
00494 {
00495 Info("LoadMF4Data","Doing mf4 Legendre");
00496 two_d_Legendre Legendre;
00497
00498 inFile.read_line3(
00499 &NR,
00500 &NE
00501 );
00502
00503 inFile.get_regions(NR, Legendre.NBT, Legendre.INT);
00504
00505 Legendre.expand_data( inFile, NE, ENDL.F );
00506 Legendre.widen_jumps();
00507 Legendre.renorm();
00508 if (ENDL.write_file)
00509 {
00510 Legendre.write_endl(1);
00511
00512 if ( ( ENDL.T == 2 ) && ( ENDL.res_za <= 2004 ) )
00513 {
00514 ENDL.outgoing_particle = 10 + ENDL.za_to_yo( ENDL.res_za );
00515 Legendre.mirror();
00516 Legendre.write_endl(1);
00517 }
00518 }
00519 }
00520
00521 else if ( LTT==2 )
00522 {
00523 Info("LoadMF4Data","Doing mf4 table");
00524 mf4_table Tabular;
00525 Tabular.master( inFile );
00526 return;
00527 }
00528 else if ( LTT==3 )
00529 {
00530 Info("LoadMF4Data","Doing mixed mf4");
00531 mixed_mf4 mixed_data;
00532 mixed_data.master( inFile );
00533 }
00534 else
00535 {
00536 SevereError("LoadMF4Data",pastenum("LTT = ",LTT)
00537 +" in MF4 data is impossible!");
00538 }
00539 }
00540
00541
00542 void LoadMF5Data( mf5_file& inFile )
00543 {
00544 int ZA;
00545 int LF;
00546 int NK;
00547 double AWR,U;
00548 int ZAP,NR, NP;
00549
00550
00551 inFile.read_line1(&ZA, &AWR, &NK);
00552
00553
00554 ZAP=ENDL.get_ZAP(ENDL.T);
00555 ENDL.set_outgoing_ZA( ZAP );
00556
00557 if ( !ENDL.write_file )
00558 {
00559 Info("LoadMF5Data",pastenum("Skipping mf: ",ENDL.F)+pastenum(" mt: ",ENDL.T));
00560 return;
00561 }
00562
00563 if( NK > 1)
00564 {
00565 Info("LoadMF5Data","Doing mf5 multiple models");
00566 add_them_up add_them( NK );
00567 add_them.manager( inFile );
00568 }
00569 else
00570 {
00571
00572 inFile.read_line2(&U, &LF, &NR, &NP);
00573
00574 if ( LF == 1 )
00575 {
00576 Info("LoadMF5Data","Doing mf5 table");
00577 mf5_table Arbitrary;
00578 Arbitrary.read_data(inFile, NR, NP );
00579 if (ENDL.write_file)
00580 {
00581 if( Arbitrary.duplicate_Ein ){
00582 Arbitrary.widen_jumps( );
00583 }
00584 Arbitrary.renorm();
00585 Arbitrary.write_endl(4);
00586 }
00587 return;
00588 }
00589 else if ( LF == 5 )
00590 {
00591 Unimplemented("LoadMF5Data","Need new code for LF=5");
00592 return;
00593 }
00594 else if ( LF == 7 )
00595 {
00596 Info("LoadMF5Data","Doing mf5 Maxwell");
00597 two_d_Maxwell Maxwell(U);
00598 Maxwell.read_data(inFile, NR, NP );
00599 Maxwell.make_list();
00600 if (ENDL.write_file)
00601 {
00602 if( Maxwell.duplicate_Ein ){
00603 Maxwell.widen_jumps( );
00604 }
00605 Maxwell.renorm();
00606 Maxwell.write_endl(4);
00607 }
00608 return;
00609 }
00610 else if ( LF == 9 )
00611 {
00612 Info("LoadMF5Data","Doing mf5 evaporation");
00613 two_d_evap evap(U);
00614 evap.read_data(inFile, NR, NP );
00615 evap.make_list();
00616 if (ENDL.write_file)
00617 {
00618 if( evap.duplicate_Ein ){
00619 evap.widen_jumps( );
00620 }
00621 evap.renorm();
00622 evap.write_endl(4);
00623 }
00624 return;
00625 }
00626 else if ( LF == 11 )
00627 {
00628 Info("LoadMF5Data","Doing mf5 Watt");
00629 two_d_Watt Watt(U);
00630 Watt.read_data(inFile, NR, NP );
00631 Watt.make_list();
00632 if (ENDL.write_file)
00633 {
00634 if( Watt.duplicate_Ein ){
00635 Watt.widen_jumps( );
00636 }
00637 Watt.renorm();
00638 Watt.write_endl(4);
00639 }
00640 return;
00641 }
00642 else if ( LF == 12 )
00643 {
00644 Info("LoadMF5Data","Doing mf5 Madland");
00645 two_d_Madland Madland;
00646 Madland.read_data(inFile, NR, NP );
00647 Madland.make_list();
00648 if (ENDL.write_file)
00649 {
00650 if( Madland.duplicate_Ein ){
00651 Madland.widen_jumps( );
00652 }
00653 Madland.renorm();
00654 Madland.write_endl(4);
00655 }
00656 return;
00657 }
00658 else
00659 {
00660 SevereError("LoadMF5Data",pastenum("There is no model for LF = ",LF));
00661 }
00662 }
00663 }
00664
00665
00666 void LoadMF6Data( mf6_file& inFile )
00667 {
00668 int ZA, LCT, NK;
00669 double AWR;
00670 int ZAP, LIP, LAW, NR_1,NR_2, NP;
00671 double AWP;
00672 int LANG, LEP, NE;
00673
00674 bool make_i3 = ( ENDL.C == 46 )? false : true;
00675
00676 bool res_copy = false;
00677
00678 inFile.read_line1(
00679 &ZA,
00680 &AWR,
00681 &LCT,
00682 &NK
00683 );
00684
00685 int prev_ZAP = -1;
00686 int X4_count;
00687
00688 for(int iNK = 0; iNK < NK; ++iNK)
00689 {
00690 inFile.particle_line1(
00691 &ZAP,
00692 &AWP,
00693 &LIP,
00694 &LAW,
00695 &NR_1,
00696 &NP
00697 );
00698 ENDL .set_outgoing_ZA( ZAP );
00699
00700
00701 if( ( ENDL.current_za == ENDL.res_za ) && ( ZAP == ENDL.res_za ) )
00702 {
00703 ENDL.outgoing_particle += 10;
00704 }
00705
00706
00707 if( prev_ZAP == ENDL.res_za )
00708 {
00709 ENDL.write_file = true;
00710 }
00711
00712 if ( !ENDL.write_file )
00713 {
00714 Info("LoadMF6Data", pastenum("Skipping mf: ",ENDL.F)+
00715 pastenum(" mt: ",ENDL.T)
00716 +pastenum(" ZAP: ",ZAP));
00717
00718 if( ( iNK == NK-1 ) || ( ENDL.C < 0 ) )
00719 {
00720 return;
00721 }
00722 }
00723
00724 if( ZAP == prev_ZAP )
00725 {
00726
00727 ENDL.append = true;
00728 ++X4_count;
00729 ENDL.X[4] = X4_count;
00730 }
00731 else
00732 {
00733 ENDL.append = false;
00734 X4_count = 0;
00735 }
00736
00737
00738 multiplicity multiple;
00739 int this_multiple = 0;
00740
00741
00742 inFile.get_regions(NR_1, multiple.NBT, multiple.INT);
00743
00744 multiple.read_data( NP, inFile );
00745
00746 if ( !ENDL.write_file )
00747 {
00748
00749 if( ENDL.outgoing_particle > 100 ) this_multiple = 1;
00750 }
00751 else if( ( ZAP == 0 ) && ( LAW > 0 ) )
00752 {
00753
00754
00755 multiple.set_min_mult(0.0);
00756
00757
00758 multiple.write_endl(9);
00759 }
00760 else if( ( ENDL.T == 18 ) && ( ZAP == 1 ) )
00761 {
00762
00763 multiple.write_endl(7);
00764 }
00765 else if( ENDL.T != 5 )
00766 {
00767
00768
00769 if ( !multiple.check_const_mult( ENDL.yo_mult( ) ) )
00770 {
00771 Warning("LoadMF6Data", "Found non-constant or incorrect multiplicity for a reaction requiring constant multiplicity, so overwriting");
00772 multiple.set_mult( ENDL.yo_mult( ) );
00773 }
00774 this_multiple = multiple.get_mult( );
00775
00776 if( ( this_multiple > 1 ) && ( this_multiple*ZAP == ENDL.current_za ) )
00777 {
00778 res_copy = true;
00779 }
00780
00781 if( ( X4_count == 0 ) && ( this_multiple < ENDL.yo_mult() ) )
00782 {
00783 X4_count = 1;
00784 ENDL.X[4] = X4_count;
00785 }
00786 }
00787
00788 if ( LAW == 0 )
00789 {
00790 if ( ENDL.write_file )
00791 {
00792 multiple.write_endl( 9 );
00793 }
00794 }
00795 else if ( LAW == 1 )
00796 {
00797
00798 inFile.get_model(
00799 &LANG,
00800 &LEP,
00801 &NR_2,
00802 &NE
00803 );
00804
00805 if(LANG == 1)
00806 {
00807 if( ( ZAP == 0 ) && make_i3 )
00808 {
00809 Info("LoadMF6Data","Doing i=3 gammas");
00810 mf6_gammas gammas;
00811 gammas.read_data( inFile, LEP, NR_2, NE );
00812 }
00813 else
00814 {
00815 Info("LoadMF6Data",pastenum("Doing mf6 Legendre for ZAP=",ZAP));
00816 mf6_Legendre Legendre;
00817
00818
00819 if( make_i3 && ( iNK > 0 ) && ENDL.write_file )
00820 {
00821 Warning("LoadMF6Data", "mixing types of double differential data");
00822 }
00823
00824 Legendre.master( inFile, LEP, NR_2, NE, res_copy );
00825 if( ENDL.write_file )
00826 {
00827 make_i3 = false;
00828 }
00829 }
00830 }
00831 else if(LANG == 2)
00832 {
00833 Info("LoadMF6Data",pastenum("Doing mf6 Kalbach for ZAP=",ZAP));
00834
00835 if( ( LCT != 2 ) && ( LCT != 3 ) )
00836 {
00837 Warning("LoadMF6Data",
00838 pastenum("Kalbach data must be center-of-mass coordinates. Evaluation uses LCT=",LCT)+
00839 ". Since this makes no sense, we are treating it as center-of-mass data.");
00840 LCT=2;
00841 }
00842 if(LEP != 1)
00843 {
00844 SevereError("LoadMF6Data","Implement Kalbach for non-histogram data.");
00845 }
00846
00847 three_d_Kalbach Kalbach( ZA, ENDL.yo_to_za( ENDL.incident_particle ), ZAP, this_multiple );
00848
00849 inFile.get_regions(NR_2, Kalbach.NBT, Kalbach.INT);
00850 Kalbach.expand_data(NE, inFile);
00851 if ( ENDL.write_file )
00852 {
00853 Kalbach.renorm();
00854 Kalbach.write_endl( );
00855 if( res_copy )
00856 {
00857
00858 ENDL.outgoing_particle += 10;
00859 Kalbach.write_endl( );
00860 }
00861 }
00862 }
00863 else
00864 {
00865 Unimplemented("LoadMF6Data",pastenum("LANG = ",LANG)+" not implemented");
00866 }
00867 }
00868 else if ( LAW == 2 )
00869 {
00870
00871 Info("LoadMF6Data","Doing general mf6 2-body");
00872 if( LCT != 2 )
00873 {
00874 SevereError("LoadMF6Data","Expected center-of-mass coordinates");
00875 }
00876 gen_mf4 mu_dist;
00877 mu_dist.master( inFile );
00878 make_i3 = false;
00879 }
00880 else if ( LAW == 5 )
00881 {
00882 Info("LoadMF6Data",pastenum("Doing charged-particle scattering for ZAP=",ZAP));
00883 two_d_charge mu_dist;
00884 mu_dist.master( inFile );
00885 }
00886 else if ( LAW == 6 )
00887 {
00888
00889 Info("LoadMF6Data",pastenum("Doing mf6 N-body phase-space model for ZAP=",ZAP));
00890 phase_space phase( 1, ZA, ZAP );
00891 phase.expand_data( inFile, multiple );
00892 if ( ENDL.write_file )
00893 {
00894 phase.write_endl( );
00895 if( res_copy )
00896 {
00897
00898 ENDL.outgoing_particle += 10;
00899 phase.write_endl( );
00900 }
00901 }
00902 }
00903 else if ( LAW == 7 )
00904 {
00905
00906 if ( ENDL.write_file )
00907 Info("LoadMF6Data",pastenum("Doing mf6 ENDL-type angle-energy table for ZAP=",ZAP));
00908 if( LCT != 1 )
00909 {
00910 SevereError("LoadMF6Data","Expected laboratory coordinates");
00911 }
00912 ENDL_table table;
00913 table.read_data( inFile, ZAP, multiple );
00914 if ( ENDL.write_file )
00915 {
00916 table.write_endl( );
00917 if( res_copy )
00918 {
00919
00920 ENDL.outgoing_particle += 10;
00921 table.write_endl( );
00922 }
00923 }
00924 }
00925 else if ( ( LAW == 3 ) &&
00926 (
00927 (
00928 ( ENDL.C == 11 ) ||
00929 ( ENDL.C == 40 ) ||
00930 ( ENDL.C == 41 ) ||
00931 ( ENDL.C == 42 ) ||
00932 ( ENDL.C == 44 ) ||
00933 ( ENDL.C == 45 )
00934 ) && ( ENDL.S == 1 )
00935 )
00936 )
00937 {
00938
00939 two_d_isotropic isotropic;
00940 Info("LoadMF6Data",pastenum("Doing mf4 isotropic for ZAP=",ZAP));
00941 isotropic.expand_data( ENDL.T );
00942 if ( ENDL.write_file )
00943 {
00944 isotropic.write_endl(1);
00945 }
00946 make_i3 = false;
00947 }
00948 else if ( ( LAW == 4 ) && ( ENDL.current_za == ENDL.res_za ) )
00949 {
00950
00951 }
00952 else
00953 {
00954 Unimplemented("LoadMF6Data",pastenum("Implement LAW ",LAW));
00955 return;
00956 }
00957 prev_ZAP = ZAP;
00958
00959 if ( ENDL.T != 5 )
00960 {
00961 ENDL.current_za -= this_multiple * ZAP;
00962 }
00963 }
00964
00965 ENDL.X[4] = 0;
00966 }
00967
00968
00969 void LoadGammaData( mf12_file& inFile )
00970 {
00971 if ( !ENDL.write_file )
00972 {
00973 Info("LoadGammaData",pastenum("Skipping mf: ",ENDL.F)+pastenum(" mt: ",ENDL.T));
00974 return;
00975 }
00976
00977 int ZA;
00978 double AWR;
00979 int LO,LG,mf12_NK;
00980
00981 ENDL.set_yo( 7 );
00982
00983
00984 int mf14_LI, mf14_LTT;
00985 int mf14_NK, mf14_NI;
00986 mf14_file angle_file;
00987 angle_file.open( 14, ENDL.T );
00988 if( angle_file )
00989 {
00990 Info("LoadGammaData","Loading angular distributions from the MF=14 file.");
00991
00992 angle_file.first_line(
00993 &ZA,
00994 &AWR,
00995 &mf14_LI,
00996 &mf14_LTT,
00997 &mf14_NK,
00998 &mf14_NI
00999 );
01000 }
01001 else
01002 {
01003 Info("LoadGammaData","All gammas are emitted isotropicly.");
01004 mf14_LI = 1;
01005 }
01006
01007 inFile.read_line1(
01008 &ZA,
01009 &AWR,
01010 &LO,
01011 &LG,
01012 &mf12_NK
01013 );
01014
01015
01016
01017
01018 if ( ( LO == 1 ) || ( ENDL.F == 13 ) )
01019 {
01020
01021
01022 if( mf14_LI == 1 )
01023 {
01024 Info("LoadGammaData","Doing mf12 discrete table");
01025 MF12_list e_dist;
01026 e_dist.master( AWR, mf12_NK, &inFile );
01027 }
01028
01029
01030 else if ( mf14_LTT == 1 )
01031 {
01032
01033 if( Global.Value( "split_gammas" ) > 0 )
01034 {
01035 Info("LoadGammaData","Splitting discrete & continuum gammas");
01036 MF14_split e_dist;
01037 e_dist.master( AWR, mf12_NK, &inFile, &angle_file );
01038 }
01039 else
01040 {
01041
01042 Info("LoadGammaData","MF14 Legendre expansions for gammas");
01043 int max_order = angle_file.get_order( mf14_NK, mf14_NI );
01044 angle_file.close();
01045 Info("LoadData","Closing file "+endf_file_name(14,ENDL.T)+"...");
01046 angle_file.open( 14, ENDL.T );
01047 MF14_list e_dist( mf14_NI, mf14_NK, max_order, &inFile, &angle_file );
01048 e_dist.master( mf12_NK );
01049 }
01050 }
01051
01052
01053 else
01054 {
01055
01056
01057 if( ( mf14_NK == 1 ) && ( mf14_NI == 0 ) )
01058 {
01059 Info("LoadGammaData","Doing mf4 table for 1 line");
01060 mf4_table Tabular;
01061 Tabular.master( angle_file );
01062 }
01063
01064
01065 else
01066 {
01067 Info("LoadGammaData","Doing mf14 table for multiple lines");
01068 MF14_table Tabular;
01069 Tabular.master( inFile, angle_file, mf12_NK, mf14_NK );
01070 }
01071 }
01072 }
01073
01074
01075 else if ( LO == 2 )
01076 {
01077 if( mf14_LI == 1 )
01078 {
01079 Info("LoadGammaData","Doing mf12 deexcitation");
01080 MF12_deexcite e_dist;
01081 e_dist.master( AWR, LG, inFile );
01082 }
01083 else
01084 {
01085 Unimplemented("LoadGammaData","Implement anisotropic gammas for deexcitation");
01086 }
01087 }
01088 else
01089 {
01090 SevereError("LoadGammaData",
01091 pastenum("There is no LO = ",LO)+" option for MF=12 data!!");
01092 }
01093
01094
01095 }
01096
01097
01098 void LoadMF13Data( mf13_file& inFile )
01099 {
01100 int ZA;
01101 double AWR;
01102 int NK;
01103
01104
01105 inFile.read_line1(
01106 &ZA,
01107 &AWR,
01108 &NK
01109 );
01110
01111
01112 ENDL.set_x0( 0.0 );
01113 ENDL.set_I_number( 0 );
01114 if ( !ENDL.write_file )
01115 {
01116 Info("LoadMF13Data",pastenum("Skipping mf: ",ENDL.F)+pastenum(" mt: ",ENDL.T));
01117 return;
01118 }
01119 if( ENDL.T == 3 )
01120 {
01121 Info("LoadMF13Data","Doing mf13 table for mt3");
01122 C55.MT3_gammas.master(NK, inFile);
01123 C55.has_MT3 = true;
01124 }
01125 else if( ENDL.T == 4 )
01126 {
01127 Info("LoadMF13Data","Doing mf13 table for mt4");
01128 C55.MT4_gammas.master(NK, inFile);
01129 C55.has_MT4 = true;
01130 }
01131 else
01132 {
01133 Warning("LoadMF13Data","Write new code for gamma multiplicity.");
01134 }
01135 }