#!/usr/bin/perl # # # Any Units in SGS # local($myurl)=$ENV{HTTP_URI}; local($version) = "4.0"; local($release) = 4; local($remouthost) = $ENV{'REMOTE_HOST'}; local($localuser)=1; local(%Units) = ( "c", "3e10", "G", "6.670e-8", "k", "1.38062e-16", "R", "8.3143e7", "SolarRadius", "6.9599e10", "SolarMass", "1.989e33", "SolarLuminocity", "3.826e33", "AU", "1.495979e13", "pc", "3.085678e18", "min", "60.", "hour", "3600.", "day", "86400.", "yr", "3.15567e7", ); local(%basic_defaults) = ( "AP", "600", "APchoice", "A-semimajoraxis(Solarradii)", "Mass1", "12", "M2q", "9", "MQchoice", "M2-secondarymass(Solarmasses)", "Ecc", "0", "Topt", "1.5e10", "BMuchoice1", "B1-initialmagneticfieldof1-stcompactstar(G)", "BMuchoice2", "B2-initialmagneticfieldof2-ndcompactstar(G)", "BMuinit1", "1e12", "BMuinit2", "1e12", ); local(%kick_defaults) = ( "Kick1", "0", "Kick2", "0", "KickDirectionChoice", "uniformrandomdirection", "KickPhi1", "0", "KickPhi2", "0", "KickTheta1", "90", "KickTheta2", "90", "KickPhiOrb1", "0", "KickPhiOrb2", "0", ); local(%branches_defaults) = ( "StellarWindChoice", "low", "AcceptMatterByNormalStarChoice", "partiallynonconservative", "AccretionDecayChoice", "no", "WDDecayChoice", "no", "NSDecayChoice", "no", "CESuperAccretionChoice", "Eddington", ); local(%additional_defaults) = ( "AlphaCE", "1", "Mbhchoice", "pre-SNmassforBHformation(Solarmasses)", "Mbh", "35", "Kbh", "0.3", "Mov", "2.5", "TdissWD", "1e10", "TdissNS", "1e8", "PinitChoice", "WD-momentumconserwation,NS-userdefined", "Pinit1", "1e-3", "Pinit2", "1e-3", ); # # Column definition - before %output_defaults. # local(%columns) = ( "col01", "on", "col02", "on", "col03", "on", "col04", "on", "col05", "on", "col06", "on", "col07", "on", "col08", "on", "col09", "on", "col10", "on", "col11", "on", "col12", "on", "col13", "on", "col14", "on", "col15", "on", "col16", "on", "col17", "on", "col18", "on", "col19", "on", "col20", "on", "col21", "on", "col22", "on", "col23", "on", "col24", "on", "col25", "on", "col26", "on", "col27", "on", ); local(%columns_help) = ( "col01", "duration", "col02", "time", "col03", "masses", "col04", "semimajor_axes", "col05", "orbital_period", "col06", "eccentricity", "col07", "common_envelope", "col08", "magnetic_breaking", "col09", "mass_loss_rate", "col10", "accretion_rate", "col11", "stellar_radius", "col12", "R_Roche_lobe", "col13", "liminosity", "col14", "wind_velocity", "col15", "mass_core", "col16", "binary_type", "col17", "mass_transfer_mode", "col18", "period", "col19", "magnetic_momentum", "col20", "magnetic_field", "col21", "R_stop", "col22", "R_y", "col23", "R_G", "col24", "R_cor", "col25", "R_l", "col26", "potential_duration", "col27", "velocity", ); local(%columns_bynaryonly) = ( "col01", "N", "col02", "N", "col03", "N", "col04", "Y", "col05", "Y", "col06", "Y", "col07", "Y", "col08", "Y", "col09", "N", "col10", "N", "col11", "N", "col12", "Y", "col13", "N", "col14", "N", "col15", "N", "col16", "Y", "col17", "Y", "col18", "N", "col19", "N", "col20", "N", "col21", "N", "col22", "N", "col23", "N", "col24", "N", "col25", "N", "col26", "Y", "col27", "N", ); local(%columns_names) = ( "col01", "Duration", "col02", "Time", "col03", "Masses", "col04", "A", "col05", "P_orb", "col06", "ecc", "col07", "CE", "col08", "Magn.Breaking", "col09", "Mass_Loss", "col10", "Accreting_Rate", "col11", "Radii", "col12", "R_Roche_Lobe", "col13", "Luminosity", "col14", "Wind_Veloc.", "col15", "M_Cores", "col16", "Type", "col17", "Mode", "col18", "Period", "col19", "Magnet.Moment.", "col20", "Surface_B", "col21", "Rstop", "col22", "Ry", "col23", "RG", "col24", "R_corot", "col25", "R_Light_Cyl", "col26", "Potent._dT", "col27", "Velocity", ); local(%output_defaults) = ( "label", "", "OutputChoice", "Output-Image", "OutRowsChoice", "Showsystemstateatthestagebeginning", %columns, ); local(%save_defaults) = ( "title", "", "comment", "", "saved-version", $version, "saved-release", $release, ); # # form_params = \Sum all param for form # local(%form_params) = ( %basic_defaults, %kick_defaults, %branches_defaults, %additional_defaults, %output_defaults, %save_defaults, 'whereIam', 'MainMenu', 'binary', 'Y', ); # # Selection - Choices # local($select) = " selected"; local(%APchoiceValue) = ( "A-semimajoraxis(Solarradii)", 0, "A-semimajoraxis(cm)", 1, "P-orbitalperiod(s)", 2, "P-orbitalperiod(h)", 3, "P-orbitalperiod(day)", 4, "P-orbitalperiod(yr)", 5, ); local(@APchoiceTitle) = ( "A - semimajor axis (Solar radii)", "A - semimajor axis (cm)", "P - orbital period (s)", "P - orbital period (h)", "P - orbital period (day)", "P - orbital period (yr)", ); local(@APchoiceSelection) = ( "", "", "", "", "", "" ); local(%MQchoiceValue) = ( "q=M2/M1", 0, "M2-secondarymass(Solarmasses)", 1, ); local(@MQchoiceTitle) = ( "q = M2/M1", "M2 - secondary mass (Solar masses)", ); local(@MQchoiceSelection) = ( "", "" ); local(%BMuchoice1Value) = ( "B1-initialmagneticfieldof1-stcompactstar(G)", 0, "Mu1-initialmagneticmomentumof1-stcompactstar(Gcm^3)", 1, ); local(@BMuchoice1Title) = ( "B1 - initial magnetic field of 1-st compact star (G)", "Mu1 - initial magnetic momentum of 1-st compact star (G cm^3)", ); local(@BMuchoice1Selection) = ( "", "" ); local(%BMuchoice1Title) = ( "B2-initialmagneticfieldof2-ndcompactstar(G)", "B2 - initial magnetic field of 2-nd compact star (G)", "Mu2-initialmagneticmomentumof2-ndcompactstar(Gcm^3)", "Mu2 - initial magnetic momentum of 2-nd compact star (G cm^3)", ); local(%BMuchoice2Value) = ( "B2-initialmagneticfieldof2-ndcompactstar(G)", 0, "Mu2-initialmagneticmomentumof2-ndcompactstar(Gcm^3)", 1, ); local(@BMuchoice2Title) = ( "B2 - initial magnetic field of 2-nd compact star (G)", "Mu2 - initial magnetic momentum of 2-nd compact star (G cm^3)", ); local(@BMuchoice2Selection) = ( "", "" ); local(%KickDirectionChoiceValue) = ( "uniformrandomdirection", 0, "user defined direction", 1, ); local(@KickDirectionChoiceTitle) = ( "uniform random direction", "user defined direction", ); local(@KickDirectionChoiceSelection) = ( "", "" ); local(%StellarWindChoiceValue) = ( "high", 0, "low", 1, ); local(@StellarWindChoiceTitle) = ( "high", "low", ); local(@StellarWindChoiceSelection) = ( "", "" ); local(%AccretionDecayChoiceValue) = ( "yes", 0, "no", 1, ); local(@AccretionDecayChoiceTitle) = ( "yes", "no", ); local(@AccretionDecayChoiceSelection) = ( "", "" ); local(%WDDecayChoiceValue) = ( "yes", 0, "no", 1, ); local(@WDDecayChoiceTitle) = ( "yes", "no", ); local(@WDDecayChoiceSelection) = ( "", "" ); local(%NSDecayChoiceValue) = ( "yes", 0, "no", 1, ); local(@NSDecayChoiceTitle) = ( "yes", "no", ); local(@NSDecayChoiceSelection) = ( "", "" ); local(%CESuperAccretionChoiceValue) = ( "Eddington", 0, "nolimit", 1, ); local(@CESuperAccretionChoiceTitle) = ( "Eddington", "nolimit", ); local(@CESuperAccretionChoiceSelection) = ( "", "" ); local(%AcceptMatterByNormalStarChoiceValue) = ( "conservative", 0, "fullynonconservative", 1, "partiallynonconservative", 2, ); local(@AcceptMatterByNormalStarChoiceTitle) = ( "conservative", "fully nonconservative", "partially nonconservative", ); local(@AcceptMatterByNormalStarChoiceSelection) = ( "", "", "" ); local(%MbhchoiceValue) = ( "initialmassforBHformation(Solarmasses)", 0, "pre-SNmassforBHformation(Solarmasses)", 1, ); local(@MbhchoiceTitle) = ( "initial mass for BH formation (Solar masses)", "pre-SN mass for BH formation (Solar masses)", ); local(@MbhchoiceSelection) = ( "", "" ); local(%PinitChoiceValue) = ( "both-momentumconservation", 0, "WD-momentumconserwation,NS-userdefined", 1, "WD-userdefined,NS-momentumconserwation", 2, "both-userdefined", 3, ); local(@PinitChoiceTitle) = ( "both - momentum conservation", "WD - momentum conserwation, NS - user defined", "WD - user defined, NS - momentum conserwation", "both - user defined", ); local(@PinitChoiceSelection) = ( "", "", "", "" ); local(%OutRowsChoiceValue) = ( "Showsystemstateatthestagebeginning", 0, "Showsystemstateatthestageend", 1, "Showsystemstateatbothstagebeginningandend", 2, ); local(@OutRowsChoiceTitle) = ( "Show system state at the stage beginning", "Show system state at the stage end", "Show system state at both stage beginning and end", ); local(@OutRowsChoiceSelection) = ( "", "", "" ); local(%OutputChoiceValue) = ( "Output-TextTable", 0, "Output-Image", 1, "ViewScriptOutput(fordebug)", 2, "ViewImageInput(fordebug)", 3, ); local(@OutputChoiceTitle) = ( "Output - Text Table", "Output - Image", "View Script Output (for debug)", "View Image Input (for debug)", ); local(@OutputChoiceSelection) = ( "", "", "", "" ); local(%Value) = ( "", 0, "", 1, ); local(@Title) = ( "", "", ); local(@Selection) = ( "", "" ); local(%Value) = ( "", 0, "", 1, ); local(@Title) = ( "", "", ); local(@Selection) = ( "", "" ); local(%Value) = ( "", 0, "", 1, ); local(@Title) = ( "", "", ); local(@Selection) = ( "", "" ); local(%Value) = ( "", 0, "", 1, ); local(@Title) = ( "", "", ); local(@Selection) = ( "", "" ); #---------------------------------------------------------------------- local($descr_base) = "/sciwork/scenario/description.html"; local($outhelp_base) = "/sciwork/scenario/outputhelp.html"; local(%errors) = ( "AP", 0, "Mass1", 0, "M2q", 0, "Ecc", 0, "Topt", 0, "BMuinit1", 0, "BMuinit2", 0, "Kick1", 0, "Kick2", 0, "KickPhi1", 0, "KickPhi2", 0, "KickTheta1", 0, "KickTheta2", 0, "KickPhiOrb1", 0, "KickPhiOrb2", 0, "Mbh", 0, "AlphaCE", 0, "Kbh", 0, "Mov", 0, "TdissWD", 0, "TdissNS", 0, "Pinit1", 0, "Pinit2", 0, ); local(@form_selection) = ( @APchoiceSelection, @MQchoiceSelection, @BMuchoice1Selection, @BMuchoice2Selection ); local(%arguments); local($myname) = "main_form.4.0.y.cgi"; # (split( '/', $0 ))[-1]; #----- New in 4.0.2.html --------------------------------------------# local($counter_all,$counter_remout,$counter_w); # MainA calls Counter #--------------------------------------------------------------------# # # # Main Program # # # #--------------------------------------------------------------------# &parse_input; if ( $arguments{'action'} eq '' ) { $form_params{'whereIam'} = "MainMenu"; &printMainMenu; } elsif ( $arguments{'action'} eq 'Top' ) { &get_params; if( $form_params{'saved-version'} eq "" ) { $form_params{'saved-version'} = "4.0"; } if( $form_params{'saved-release'} eq "" ) { $form_params{'saved-release'} = 2; } &correct_params; $form_params{'whereIam'} = "MainMenu"; &printMainMenu; } elsif ( $arguments{'action'} eq 'BasicParameters' || $arguments{'action'} eq 'Single' || $arguments{'action'} eq 'Binary' ) { &get_params; $form_params{'whereIam'} = "BasicMenu"; if ( $arguments{'action'} eq "Single" ) { $form_params{'binary'}='N'; } elsif( $arguments{'action'} eq "Binary" ) { $form_params{'binary'}='Y'; } &printBasicParametersMenu; } elsif ( $arguments{'action'} eq 'KickVelocity' ) { &get_params; $form_params{'whereIam'} = "KickMenu"; &printKickVelocityMenu; } elsif ( $arguments{'action'} eq 'ScenarioBranches' ) { &get_params; $form_params{'whereIam'} = "BranchesMenu"; &printScenarioBranchesMenu; } elsif ( $arguments{'action'} eq 'AdditionalParameters' ) { &get_params; $form_params{'whereIam'} = "AdditionalMenu"; &printAdditionalParametersMenu; } elsif ( $arguments{'action'} eq 'OutputParameters' ) { &get_params; $form_params{'whereIam'} = "OutputMenu"; &printOutputParametersMenu; } elsif ( $arguments{'action'} eq 'AllOn' or $arguments{'action'} eq 'AllOff' ) { &get_params; $form_params{'whereIam'} = "OutputMenu"; if( $arguments{'action'} eq 'AllOn' ) { foreach ( keys(%columns) ){ $form_params{$_} = "on"; } } else { foreach ( keys(%columns) ){ $form_params{$_} = ""; } } &printOutputParametersMenu; } elsif ( $arguments{'action'} eq 'Start' ) { &get_params; # $form_params{'whereIam'} = ""; if( $form_params{'saved-version'} eq "" ) { $form_params{'saved-version'} = "4.0"; } if( $form_params{'saved-release'} eq "" ) { $form_params{'saved-release'} = 2; } &correct_params; if( not &ValidateBasicParameters ) { $form_params{'whereIam'} = "BasicMenu"; &printBasicParametersMenu( "Error Parameter" ); } elsif( not &ValidateKickVelocity ) { $form_params{'whereIam'} = "KickVelocityMenu"; &printKickVelocityMenu( "Error Parameter" ); } elsif( not &ValidateAdditionalParameters ) { $form_params{'whereIam'} = "AdditionalMenu"; &printAdditionalParametersMenu( "Error Parameter" ); } else { if ( $form_params{'OutputChoice'} eq 'Output-Image' or $form_params{'OutputChoice'} eq 'Output-TextTable' ) { &Index; } if ( $form_params{'OutputChoice'} eq 'Output-Image' ) { $| = 1; print "Content-type: image/gif\n"; print "Window-target: w1\n"; print "Cache-control: no-store\n"; print "Pragma: no-cache\n"; print "\n"; $| = 0; } else { &start_out_to_win( "Results of calculation", "Results-Table" ); $| = 1; print STDOUT < Scenario Machine 4.0.y.beta
results of calculation

If you have some comments or find errors please fill free to send a letter to us.

EOM if( $form_params{'OutputChoice'} eq 'Output-TextTable' ) { print STDOUT " \n"; } else { print STDOUT "\n
\n";
         }

         $| = 0;
      }

      &StartProgram;

      if( $form_params{'OutputChoice'} eq 'Output-TextTable' )
      {
         print STDOUT < 
  
EOM &end_out; } elsif( $form_params{'OutputChoice'} eq 'ViewScriptOutput(fordebug)' or $form_params{'OutputChoice'} eq 'ViewImageInput(fordebug)' ) { print STDOUT <
EOM &end_out; } } } elsif ( $arguments{'action'} eq 'Save' ) { &get_params; $form_params{'whereIam'} = "SaveMenu"; &printSaveMenu; } elsif ( $arguments{'action'} eq 'Cancel' ) # from SaveMenu { # Button Save is only in Main Menu &get_params; # vosstanovit' comment & title $form_params{'whereIam'} = "MainMenu"; &printMainMenu; } elsif ( $arguments{'action'} eq 'OK' ) # from SaveMenu { # Button Save is only in Main Menu &get_params; # vosstanovit' comment & title &printSaveFile; #$form_params{'whereIam'} = "MainMenu"; #&printMainMenu; } elsif ( $arguments{'action'} eq 'Default' ) { &get_params; #$form_params{'whereIam'} = ""; &reset_params; if ( $form_params{'whereIam'} eq 'MainMenu' ) { &printMainMenu; } elsif ( $form_params{'whereIam'} eq 'BasicMenu' ) { &printBasicParametersMenu; } elsif ( $form_params{'whereIam'} eq 'KickVelocityMenu' ) { &printKickVelocityMenu; } elsif ( $form_params{'whereIam'} eq 'BranchesMenu' ) { &printScenarioBranchesMenu; } elsif ( $form_params{'whereIam'} eq 'AdditionalMenu' ) { &printAdditionalParametersMenu; } elsif ( $form_params{'whereIam'} eq 'OutputMenu' ) { &printOutputParametersMenu; } } else { &get_params; &start_out( "Just a test" ); print STDOUT "

DEBUG OUTPUT

\n"; print STDOUT "
\n"; &test_params; print STDOUT "
\n"; &end_out; } #--------------------------------------------------------------------# # # # Subroutines # # # #--------------------------------------------------------------------# sub Index { open INDEX, "index index.4.0.x|"; read INDEX, $counter_w, 30; close INDEX; $counter_w =~ /^(.*)\s(.*)\n/; $counter_all=$1; $counter_remout=$2; } sub ReadIndex { open INDEX, "index.4.0.x"; read INDEX, $counter_w, 30; close INDEX; $counter_w =~ /^(.*)\s(.*)\n/; $counter_all=$1; $counter_remout=$2; } sub start_out { local($title) = $_[0]; $| = 1; print "Content-type: text/html\nPragma: no-cache\n\n"; print "\n"; print "\n"; print "\n"; print "", $title, "\n"; print "\n"; print "\n"; $| = 0; } sub start_out_to_win { local($title, $winname); if( $form_params{'label'} eq '' ) { $title = $_[0]; $winname = $_[1]; } else { $title = $_[0]." ($form_params{'label'})"; $winname = $form_params{'label'}; } $| = 1; print "Content-type: text/html\n"; print "Window-target: $winname\n\n"; print "\n"; print "\n"; print "\n"; print "", $title, "\n"; print "\n"; print "\n"; $| = 0; } sub end_out { $| = 1; print STDOUT <
This page was produced by The Evolution Track Constructor, a WWW interface script written by Sergey Nazin <leng\@sai.msu.su> for The Scenario Machine Code
Copyright ©1996 All Rights Reserved.
EOM $| = 0; } sub parse_input { foreach ( split( /&/, <> ) ) { local($index,$value) = m/(.+)=(.*)/; if( $index ne "title" && $index ne "comment" ) { $value =~ tr/+/ /; while( $value =~ m/%(\w\w)/ ){ $value = $` . chr(hex($1)) . $'; } $value =~ s/\s//g; $arguments{$index} = $value; } else { $value =~ tr/+/ /; while( $value =~ m/%(\w\w)/ ){ $value = $` . chr(hex($1)) . $'; } # $value =~ s/\s//g; $arguments{$index} = $value; } } } sub get_params { foreach ( keys(%form_params) ){ $form_params{$_} = $arguments{$_}; } } sub test_params { foreach (keys(%arguments)){ print "$_ = \"$arguments{$_}\"
\n"; } } sub correct_params { if( $form_params{'saved-release'} < 3 ) { # WDDecayChoice. # $form_params{'WDDecayChoice'} = "yes"; # NSDecayChoice. # $form_params{'NSDecayChoice'} = "yes"; } if( $form_params{'saved-release'} < 4 ) { # Initialy Binary/Single. # $form_params{'binary'} = "Y"; } $form_params{'saved-version'} = $version; $form_params{'saved-release'} = $release; } sub reset_params { if ( $form_params{'whereIam'} eq 'MainMenu' ) { foreach ( keys(%basic_defaults) ){ $form_params{$_} = $basic_defaults{$_}; } foreach ( keys(%kick_defaults) ){ $form_params{$_} = $kick_defaults{$_}; } foreach ( keys(%branches_defaults) ){ $form_params{$_} = $branches_defaults{$_}; } foreach ( keys(%additional_defaults) ){ $form_params{$_} = $additional_defaults{$_}; } foreach ( keys(%output_defaults) ){ $form_params{$_} = $output_defaults{$_}; } } elsif ( $form_params{'whereIam'} eq 'BasicMenu' ) { foreach ( keys(%basic_defaults) ){ $form_params{$_} = $basic_defaults{$_}; } } elsif ( $form_params{'whereIam'} eq 'KickVelocityMenu' ) { foreach ( keys(%kick_defaults) ){ $form_params{$_} = $kick_defaults{$_}; } } elsif ( $form_params{'whereIam'} eq 'BranchesMenu' ) { foreach ( keys(%branches_defaults) ){ $form_params{$_} = $branches_defaults{$_}; } } elsif ( $form_params{'whereIam'} eq 'AdditionalMenu' ) { foreach ( keys(%additional_defaults) ){ $form_params{$_} = $additional_defaults{$_}; } } elsif ( $form_params{'whereIam'} eq 'OutputMenu' ) { foreach ( keys(%output_defaults) ){ $form_params{$_} = $output_defaults{$_}; } } } sub printMainMenu { &setChoice; &start_out( "Scenario Machine: Main Menu" ); &printHeader; &printBegForm; &printTopKey; &printMainMenuKey; &printEndForm; &end_out; } sub printBasicParametersMenu { &setChoice; &start_out( "Scenario Machine: Basic Parameters" ); &printHeader; &printBegForm; &printSubmenuKey; &printBasicParametersKey; &printEndForm; &end_out; } sub printKickVelocityMenu { &setChoice; &start_out( "Scenario Machine: Kick Velocity" ); &printHeader; &printBegForm; &printSubmenuKey; &printKickVelocityKey; &printEndForm; &end_out; } sub printScenarioBranchesMenu { &setChoice; &start_out( "Scenario Machine: Scenario Branches" ); &printHeader; &printBegForm; &printSubmenuKey; &printScenarioBranchesKey; &printEndForm; &end_out; } sub printAdditionalParametersMenu { &setChoice; &start_out( "Scenario Machine: Additional Parameters" ); &printHeader; &printBegForm; &printSubmenuKey; &printAdditionalParametersKey; &printEndForm; &end_out; } sub printOutputParametersMenu { &setChoice; &start_out( "Scenario Machine: Output Parameters" ); &printHeader; &printBegForm; &printSubmenuKey; &printOutputParametersKey; &printEndForm; &end_out; } sub setChoice { local($i); # APchoice # for ($i=0; $i<@APchoiceSelection; $i++) { $APchoiceSelection[$i] = ""; } $APchoiceSelection[$APchoiceValue{$form_params{'APchoice'}}] = $select; # MQchoice # for ($i=0; $i<@MQchoiceSelection; $i++) { $MQchoiceSelection[$i] = ""; } $MQchoiceSelection[$MQchoiceValue{$form_params{'MQchoice'}}] = $select; # BMuchoice # for ($i=0; $i<@BMuchoice1Selection; $i++) { $BMuchoice1Selection[$i] = ""; } $BMuchoice1Selection[$BMuchoice1Value{$form_params{'BMuchoice1'}}] = $select; for ($i=0; $i<@BMuchoice2Selection; $i++) { $BMuchoice2Selection[$i] = ""; } $BMuchoice2Selection[$BMuchoice2Value{$form_params{'BMuchoice2'}}] = $select; # KickDirectionChoice # for ($i=0; $i<@KickDirectionChoiceSelection; $i++) { $KickDirectionChoiceSelection[$i] = ""; } $KickDirectionChoiceSelection[$KickDirectionChoiceValue{$form_params{'KickDirectionChoice'}}] = $select; # StellarWindChoice. # for ($i=0; $i<@StellarWindChoiceSelection; $i++) { $StellarWindChoiceSelection[$i] = ""; } $StellarWindChoiceSelection[$StellarWindChoiceValue{$form_params{'StellarWindChoice'}}] = $select; # AccretionDecayChoice. # for ($i=0; $i<@AccretionDecayChoiceSelection; $i++) { $AccretionDecayChoiceSelection[$i] = ""; } $AccretionDecayChoiceSelection[$AccretionDecayChoiceValue{$form_params{'AccretionDecayChoice'}}] = $select; # WDDecayChoice. # for ($i=0; $i<@WDDecayChoiceSelection; $i++) { $WDDecayChoiceSelection[$i] = ""; } $WDDecayChoiceSelection[$WDDecayChoiceValue{$form_params{'WDDecayChoice'}}] = $select; # NSDecayChoice. # for ($i=0; $i<@NSDecayChoiceSelection; $i++) { $NSDecayChoiceSelection[$i] = ""; } $NSDecayChoiceSelection[$NSDecayChoiceValue{$form_params{'NSDecayChoice'}}] = $select; # CESuperAccretionChoice. # for ($i=0; $i<@CESuperAccretionChoiceSelection; $i++) { $CESuperAccretionChoiceSelection[$i] = ""; } $CESuperAccretionChoiceSelection[$CESuperAccretionChoiceValue{$form_params{'CESuperAccretionChoice'}}] = $select; # AcceptMatterByNormalStarChoice. # for ($i=0; $i<@AcceptMatterByNormalStarChoiceSelection; $i++) { $AcceptMatterByNormalStarChoiceSelection[$i] = ""; } $AcceptMatterByNormalStarChoiceSelection[$AcceptMatterByNormalStarChoiceValue{$form_params{'AcceptMatterByNormalStarChoice'}}] = $select; # Mbhchoice. # for ($i=0; $i<@MbhchoiceSelection; $i++) { $MbhchoiceSelection[$i] = ""; } $MbhchoiceSelection[$MbhchoiceValue{$form_params{'Mbhchoice'}}] = $select; # PinitChoice. # for ($i=0; $i<@PinitChoiceSelection; $i++) { $PinitChoiceSelection[$i] = ""; } $PinitChoiceSelection[$PinitChoiceValue{$form_params{'PinitChoice'}}] = $select; # OutRowsChoice. # for ($i=0; $i<@OutRowsChoiceSelection; $i++) { $OutRowsChoiceSelection[$i] = ""; } $OutRowsChoiceSelection[$OutRowsChoiceValue{$form_params{'OutRowsChoice'}}] = $select; # OutputChoice. # for ($i=0; $i<@OutputChoiceSelection; $i++) { $OutputChoiceSelection[$i] = ""; } $OutputChoiceSelection[$OutputChoiceValue{$form_params{'OutputChoice'}}] = $select; ## . ## # for ($i=0; $i<@Selection; $i++) # { $Selection[$i] = ""; } # $Selection[$Value{$form_params{''}}] = $select; # } sub printChoice { local($i, $p1, $p2); $p1 = $_[1]; $p2 = $_[2]; print STDOUT " \n"; } sub printHidden { local($keyname, $i); print STDOUT "\n\n\n"; if ( $form_params{'whereIam'} eq "MainMenu" ) { foreach $keyname ( keys(%form_params) ) { print STDOUT "\n"; } } elsif ( $form_params{'whereIam'} eq "BasicMenu" ) { foreach $keyname ( keys(%form_params) ) { if( ! exists $basic_defaults{$keyname} ) { print STDOUT "\n"; } } } elsif ( $form_params{'whereIam'} eq "KickMenu" ) { foreach $keyname ( keys(%form_params) ) { if( ! exists $kick_defaults{$keyname} ) { print STDOUT "\n"; } } } elsif ( $form_params{'whereIam'} eq "BranchesMenu" ) { foreach $keyname ( keys(%form_params) ) { if( ! exists $branches_defaults{$keyname} ) { print STDOUT "\n"; } } } elsif ( $form_params{'whereIam'} eq "AdditionalMenu" ) { foreach $keyname ( keys(%form_params) ) { if( ! exists $additional_defaults{$keyname} ) { print STDOUT "\n"; } } } elsif ( $form_params{'whereIam'} eq "OutputMenu" ) { foreach $keyname ( keys(%form_params) ) { if( ! exists $output_defaults{$keyname} ) { print STDOUT "\n"; } } } elsif ( $form_params{'whereIam'} eq "SaveMenu" ) { print STDOUT "\n"; print STDOUT "\n"; foreach $keyname ( keys(%form_params) ) { if( ! exists $save_defaults{$keyname} ) { print STDOUT "\n"; } } } } sub printBegForm { print STDOUT <

EOM } sub printEndForm { &printHidden; print STDOUT < EOM } sub printHeader { print STDOUT < Scenario Machine 4.0.x.beta
evolution track constructor

If you have some comments or find errors please fill free to send a letter to us. EOM } sub printTopKey { print STDOUT <
EOM if( $localuser ) { print STDOUT ' '; } print STDOUT <

EOM } sub printSubmenuKey { print STDOUT <
EOM if( $localuser ) { print STDOUT ' '; } print STDOUT "\n\n"; if( $form_params{'whereIam'} eq 'BasicMenu' ) { if( $form_params{'binary'} eq 'Y' ) { print STDOUT ' '; } else { print STDOUT ' '; } } print STDOUT "\n
\n"; } sub printMainMenuKey { &ReadIndex; print STDOUT <
Main Menu





EOM if( $localuser ) { print STDOUT $counter_all,"/",$counter_remout; } else { print STDOUT $counter_all; } print STDOUT < calls since Dec 1, 1996
EOM } sub printBasicParametersKey { local($len); print STDOUT <
BASIC Initial Parameters EOM # A/P if( $form_params{'binary'} eq 'Y' ) { print STDOUT < EOM $len = @APchoiceSelection; &printChoice( APchoice, \@APchoiceTitle, \@APchoiceSelection, $len ); print STDOUT <More info... EOM } else { print STDOUT "\n"; print STDOUT "\n"; } # M1 print STDOUT < M1 - primary mass (Solar masses) More info... EOM # M2/q if( $form_params{'binary'} eq 'Y' ) { print STDOUT < EOM $len = @MQchoiceSelection; &printChoice( MQchoice, \@MQchoiceTitle, \@MQchoiceSelection, $len ); print STDOUT < More info... EOM } else { print STDOUT "\n"; print STDOUT "\n"; } # Ecc if( $form_params{'binary'} eq 'Y' ) { print STDOUT < E - orbital eccentricity More info... EOM } else { print STDOUT "\n"; } # Topt print STDOUT < T - evolution time (yr) More info... EOM # B1/mu1 print STDOUT < EOM $len = @BMuchoice1Selection; &printChoice( BMuchoice1, \@BMuchoice1Title, \@BMuchoice1Selection, $len ); print STDOUT < More info... EOM # B2/mu2 if( $form_params{'binary'} eq 'Y' ) { print STDOUT < EOM $len = @BMuchoice2Selection; &printChoice( BMuchoice2, \@BMuchoice2Title, \@BMuchoice2Selection, $len ); print STDOUT < More info... EOM } else { print STDOUT "\n"; print STDOUT "\n"; } print STDOUT "\n
\n"; } sub printKickVelocityKey { print STDOUT <
EOM if( $form_params{'binary'} eq 'Y' ) { print STDOUT < EOM if( $form_params{'binary'} eq 'Y' ) { print STDOUT < EOM if( $form_params{'binary'} eq 'Y' ) { print STDOUT <
Kick Velocity
for 1-st NS/BH for 2-nd NS/BH Short Description:  
EOM } else { print STDOUT " \n"; print STDOUT " \n"; } print STDOUT < kick velocity (km/s) More info...
EOM $len = @KickDirectionChoiceSelection; &printChoice( KickDirectionChoice, \@KickDirectionChoiceTitle, \@KickDirectionChoiceSelection, $len ); print STDOUT < kick direction More info...
EOM } else { print STDOUT " \n"; print STDOUT " \n"; } print STDOUT < Phi-angle of kick velocity (degree) More info...
EOM } else { print STDOUT " \n"; print STDOUT " \n"; } print STDOUT < Theta-angle of kick velocity (degree) More info... EOM if( $form_params{'binary'} eq 'Y' ) { print STDOUT < Orbital place of SN explosion for e > 0 (degree) More info... EOM } else { print STDOUT " \n"; print STDOUT " \n"; } print STDOUT < EOM } sub printScenarioBranchesKey { print STDOUT <
Scenario versions
Short Description : Versions  
Normal star mass loss: EOM $len = @StellarWindChoiceSelection; &printChoice( StellarWindChoice, \@StellarWindChoiceTitle, \@StellarWindChoiceSelection, $len ); print STDOUT < More info...
White Dwarfs Magnetic field decay: EOM $len = @WDDecayChoiceSelection; &printChoice( WDDecayChoice, \@WDDecayChoiceTitle, \@WDDecayChoiceSelection, $len ); print STDOUT < More info...
Neutron Star Magnetic field decay: EOM $len = @NSDecayChoiceSelection; &printChoice( NSDecayChoice, \@NSDecayChoiceTitle, \@NSDecayChoiceSelection, $len ); print STDOUT < More info...
Magnetic field accretion decay: EOM $len = @AccretionDecayChoiceSelection; &printChoice( AccretionDecayChoice, \@AccretionDecayChoiceTitle, \@AccretionDecayChoiceSelection, $len ); print STDOUT < More info... EOM if( $form_params{'binary'} eq 'Y' ) { print STDOUT < Maximal accretion rate into CE: EOM $len = @CESuperAccretionChoiceSelection; &printChoice( CESuperAccretionChoice, \@CESuperAccretionChoiceTitle, \@CESuperAccretionChoiceSelection, $len ); print STDOUT < More info...
Matter acception by normal star during accretion: EOM $len = @AcceptMatterByNormalStarChoiceSelection; &printChoice( AcceptMatterByNormalStarChoice, \@AcceptMatterByNormalStarChoiceTitle, \@AcceptMatterByNormalStarChoiceSelection, $len ); print STDOUT < More info... EOM } else { print STDOUT " \n"; print STDOUT " \n"; } print STDOUT < EOM } sub printAdditionalParametersKey { print STDOUT <
EOM if( $form_params{'WDDecayChoice'} eq "yes" ){ print STDOUT < EOM } else { print STDOUT < EOM } if( $form_params{'NSDecayChoice'} eq "yes" ){ print STDOUT < EOM } else { print STDOUT < EOM } if( $form_params{'binary'} eq 'Y' ) { print STDOUT < EOM } print STDOUT < EOM } sub printOutputParametersKey { print STDOUT <

Output parameters

Window label:

What type of Output?

EOM $len = @OutputChoiceSelection; if(!$localuser) { $len=2; } &printChoice( OutputChoice, \@OutputChoiceTitle, \@OutputChoiceSelection, $len ); print STDOUT <Which rows to show? EOM $len = @OutRowsChoiceSelection; &printChoice( OutRowsChoice, \@OutRowsChoiceTitle, \@OutRowsChoiceSelection, $len ); print STDOUT <Which columns to show?
Additional Scenario Parameters
Value : Short Description :   EOM if( $form_params{'binary'} eq 'Y' ) { print STDOUT < common envelope efficiency More info... EOM } else { print STDOUT " \n"; } print STDOUT < EOM $len = @MbhchoiceSelection; &printChoice( Mbhchoice, \@MbhchoiceTitle, \@MbhchoiceSelection, $len ); print STDOUT < More info...
collapse mass fraction More info...
Oppenheimer-Volkoff limit (Solar masses) More info...
time of magnetic field decay for WD (yr) More info...
time of magnetic field decay NS (yr) More info...
initial spin period:
EOM $len = @PinitChoiceSelection; &printChoice( PinitChoice, \@PinitChoiceTitle, \@PinitChoiceSelection, $len ); print STDOUT < More info...
More info... EOM } else { print STDOUT < initial spin period:
EOM $len = @PinitChoiceSelection; &printChoice( PinitChoice, \@PinitChoiceTitle, \@PinitChoiceSelection, $len ); print STDOUT < More info...
EOM local($colcount) = 0; local($col,$i); for( $i = "01"; exists $columns{ "col".$i }; $i++ ) { $col = "col".$i; if( $form_params{'binary'} eq 'N' && $columns_bynaryonly{$col} eq 'Y' ) { print STDOUT "\n"; } else { if( ($colcount - 4*int($colcount/4)) == 0 ) { print STDOUT "\n"; $colcount = 0; } if( $form_params{$col} eq "on" ) { print STDOUT "
 $columns_names{$col}\n"; } else { print STDOUT " $columns_names{$col}\n"; } $colcount++; } } print STDOUT < EOM } sub WaoDeb { if(-f "/tmp/waolog") { open(WAOLOG,">>/tmp/waolog"); } else { open(WAOLOG,">/tmp/waolog"); } print WAOLOG @_; close(WAOLOG); } sub printPictureOutParamForm { $| = 1; print STDOUT <

There is no parameters for output type IMAGE




EOM $| = 0; } sub ValidateBasicParameters { foreach ( keys(%errors) ){ $form_params{$_} *= 1; } $errors{'AP'} = 1 if( $form_params{'AP'} <= 0 ); $errors{'Mass1'} = 1 if( $form_params{'Mass1'} < 0.1 || $form_params{'Mass1'} > 120 ); if( $form_params{'MQchoice'} eq 'q=M2/M1' ) { $errors{'M2q'} = 1 if( $form_params{'M2q'} <= 0.1/120 || $form_params{'M2q'} > 1 ); } else { $errors{'M2q'} = 1 if( $form_params{'M2q'} < 0.1 || $form_params{'M2q'} > $form_params{'Mass1'} ); } $errors{'Ecc'} = 1 if( $form_params{'Ecc'} < 0 || $form_params{'Ecc'} >= 1 ); $errors{'Topt'} = 1 if( $form_params{'Topt'} < 0 || $form_params{'Topt'} > 2e10 ); if( $form_params{'BMuchoice1'} eq 'B1-initialmagneticfieldof1-stcompactstar(G)' ) { $errors{'BMuinit1'} = 1 if( $form_params{'BMuinit1'} < 1e8 || $form_params{'BMuinit1'} > 1e15 ); } else { $errors{'BMuinit1'} = 1 if( $form_params{'BMuinit1'} < 1e22 || $form_params{'BMuinit1'} > 1e55 ); } if( $form_params{'BMuchoice2'} eq 'B2-initialmagneticfieldof2-ndcompactstar(G)' ) { $errors{'BMuinit2'} = 1 if( $form_params{'BMuinit2'} < 1e8 || $form_params{'BMuinit2'} > 1e15 ); } else { $errors{'BMuinit2'} = 1 if( $form_params{'BMuinit2'} < 1e22 || $form_params{'BMuinit2'} > 1e55 ); } foreach ( keys(%errors) ){ if( $errors{$_} == 1 ){ return "0"; } } return ("1"); } sub ValidateKickVelocity { foreach ( keys(%errors) ){ $form_params{$_} *= 1; } $errors{'Kick1'} = 1 if( $form_params{'Kick1'} < 0 || $form_params{'Kick1'} > 299000 ); $errors{'Kick2'} = 1 if( $form_params{'Kick2'} < 0 || $form_params{'Kick2'} > 299000 ); $errors{'KickPhi1'}= 1 if( $form_params{'KickPhi1'} < 0 || $form_params{'KickPhi1'} > 360 ); $errors{'KickPhi2'}= 1 if( $form_params{'KickPhi2'} < 0 || $form_params{'KickPhi2'} > 360 ); $errors{'KickTheta1'}= 1 if( $form_params{'KickTheta1'} < 0 || $form_params{'KickTheta1'} > 360 ); $errors{'KickTheta2'}= 1 if( $form_params{'KickTheta2'} < 0 || $form_params{'KickTheta2'} > 360 ); $errors{'KickPhiOrb1'}= 1 if( $form_params{'KickPhiOrb1'} < 0 || $form_params{'KickPhiOrb1'} > 360 ); $errors{'KickPhiOrb2'}= 1 if( $form_params{'KickPhiOrb2'} < 0 || $form_params{'KickPhiOrb2'} > 360 ); foreach ( keys(%errors) ){ if( $errors{$_} == 1 ){ return "0"; } } return ("1"); } sub ValidateAdditionalParameters { foreach ( keys(%errors) ){ $form_params{$_} *= 1; } $errors{'AlphaCE'} = 1 if( $form_params{'AlphaCE'} < 0 ); $errors{'Mbh'} = 1 if( $form_params{'Mbh'} < 0 ); $errors{'Kbh'} = 1 if( $form_params{'Kbh'} <= 0 || $form_params{'Kbh'} > 1 ); $errors{'Mov'} = 1 if( $form_params{'Mov'} < 1.3 || $form_params{'Mov'} > 5 ); $errors{'TdissWD'} = 1 if( $form_params{'TdissWD'} < 1e6 ); $errors{'TdissNS'} = 1 if( $form_params{'TdissNS'} < 1e6 ); $errors{'Pinit1'} = 1 if( $form_params{'Pinit1'} < 1e-3 ); $errors{'Pinit2'} = 1 if( $form_params{'Pinit2'} < 1e-3 ); foreach ( keys(%errors) ){ if( $errors{$_} == 1 ){ return "0"; } } return ("1"); } sub StartProgram { local($M1) = $form_params{'Mass1'}; local($M2) = ($form_params{'MQchoice'} eq "q=M2/M1" )? ($form_params{'M2q'}*$form_params{'Mass1'}): ($form_params{'M2q'}); local($A); if ($form_params{'APchoice'} eq "A-semimajoraxis(Solarradii)" ) { $A = $form_params{'AP'}; } elsif ($form_params{'APchoice'} eq "A-semimajoraxis(cm)" ) { $A = $form_params{'AP'} / $Units{'Solarradii'}; } elsif ($form_params{'APchoice'} eq "P-orbitalperiod(s)" ) { $A = ( ($form_params{'AP'}/10056.)**2 * ($M1+$M2) )**(1./3.); } elsif ($form_params{'APchoice'} eq "P-orbitalperiod(h)" ) { $A = ( ($form_params{'AP'}*$Units{'hour'}/10056.)**2 * ($M1+$M2) )**(1./3.); } elsif ($form_params{'APchoice'} eq "P-orbitalperiod(day)" ) { $A = ( ($form_params{'AP'}*$Units{'day'}/10056.)**2 * ($M1+$M2) )**(1./3.); } elsif ($form_params{'APchoice'} eq "P-orbitalperiod(yr)" ) { $A = ( ($form_params{'AP'}*$Units{'yr'}/10056.)**2 * ($M1+$M2) )**(1./3.); } local($E) = $form_params{'Ecc'}; local($chMu1) = ( $form_params{'BMuchoice1'} eq 'B1-initialmagneticfieldof1-stcompactstar(G)' )?"F":"T"; local($chMu2) = ( $form_params{'BMuchoice2'} eq 'B2-initialmagneticfieldof2-ndcompactstar(G)' )?"F":"T"; local($BMu1, $BMu2) = ($form_params{'BMuinit1'}, $form_params{'BMuinit2'}); local($useWDP0) = ( ($form_params{'PinitChoice'} eq 'WD-userdefined,NS-momentumconserwation') or ($form_params{'PinitChoice'} eq 'both-userdefined') )?"T":"F"; local($useNSP0) = ( ($form_params{'PinitChoice'} eq 'WD-momentumconserwation,NS-userdefined') or ($form_params{'PinitChoice'} eq 'both-userdefined') )?"T":"F"; local($P1, $P2) = ($form_params{'Pinit1'}, $form_params{'Pinit2'}); local($T) = $form_params{'Topt'}; local($RandomKickDirection) = ( $form_params{'KickDirectionChoice'} eq 'uniformrandomdirection' )?"T":"F"; local($KICK1, $KICK2) = ($form_params{'Kick1'}, $form_params{'Kick2'}); local($KICKPHI1, $KICKPHI2) = ($form_params{'KickPhi1'}, $form_params{'KickPhi2'}); local($KICKTHETA1, $KICKTHETA2) = ($form_params{'KickTheta1'}, $form_params{'KickTheta2'}); local($KICKPHIORB1, $KICKPHIORB2) = ($form_params{'KickPhiOrb1'}, $form_params{'KickPhiOrb2'}); local($TauWD) = $form_params{'TdissWD'}/1000000.; local($TauNS) = $form_params{'TdissNS'}/1000000.; local($MBH) = $form_params{'Mbh'}; local($MBHT) = ($form_params{'Mbhchoice'} eq "initialmassforBHformation(Solarmasses)")? (0):(1); local($ALCE) = $form_params{'AlphaCE'}; local($KBH) = $form_params{'Kbh'}; local($MLT) = ( $form_params{'StellarWindChoice'} eq 'high' )?(1):(0); local($MOV) = $form_params{'Mov'}; local($ACCRDECAY) = ($form_params{'AccretionDecayChoice'} eq "yes" )? (1):(0); local($WDDECAY) = ($form_params{'WDDecayChoice'} eq "yes" )? (T):(F); local($NSDECAY) = ($form_params{'NSDecayChoice'} eq "yes" )? (T):(F); local($CESUPERACCRETION) = ( $form_params{'CESuperAccretionChoice'} eq "Eddington" )? (0):(1); local($MSACCR); if( $form_params{'AcceptMatterByNormalStarChoice'} eq "conservative" ) { $MSACCR = 0; } elsif( $form_params{'AcceptMatterByNormalStarChoice'} eq "fullynonconservative" ) { $MSACCR = 1; } else { $MSACCR = 2; } if( $form_params{'OutRows'} eq 'Showsystemstateatthestagebeginning' ) { local($PRBEG,$PREND) = ( "T", "F" ); } elsif( $form_params{'OutRows'} eq 'Showsystemstateatthestageend' ) { local($PRBEG,$PREND) = ( "F", "T" ); } else { local($PRBEG,$PREND) = ( "T", "T" ); } #WAO print STDOUT "Somethiong\n"; if( $form_params{'OutputChoice'} eq 'Output-TextTable' ){ open TO_PROGRAM, "| ./MainA_Table";} elsif ( $form_params{'OutputChoice'} eq 'Output-Image' ) { open TO_PROGRAM, "| ./MainA_Picture";} elsif( $form_params{'OutputChoice'} eq 'ViewScriptOutput(fordebug)' ) { open TO_PROGRAM, "| ./MainA_View";} elsif( $form_params{'OutputChoice'} eq 'ViewImageInput(fordebug)' ) { open TO_PROGRAM, "| ./MainA_ViewInput";} else { print STDOUT "no OutputChoise\n";} local($BINARY) = ($form_params{'binary'} eq "Y" )?("T"):("F"); print TO_PROGRAM <
Please enter Title and Comments




Title


Comments


    

EOM } sub printSaveFile { $| = 1; print STDOUT < Scenario Machine: Saved Version
Scenario Machine: Saved Version



$form_params{'title'}

$form_params{'comment'}


  EOM $| = 0; &printHidden; $| = 1; print STDOUT <
EOM $| = 0; } __END__