#!/usr/local/bin/perl # when running on convex # /usr/sbin/perl # when running on indigo4 # FUNCTION: get the information for an NMR-SAHRC entry from GAUSSIAN output # AUTHOR: A. Dransfeld # INSTALLED on /usr/local 1997-09-12 A.D. $version = "g94bc2sharc V 1.4.1k 1996-09-12Rev1997-06-05 A.Dransfeld"; # as coordinates start tag # a.d._patch x 1996-10-21 # ... working on avoiding LONGLINES (perturbing at ftp, etc.) # a.d._patch k 1997-09-10 exact (fixed-format) match of "Isotropic" line # a.d._patch i 1997-05-11 integrate SHARCID (see. format 2.0 Def.) # a.d._patch_j_1997-05-13 small g in basis set spec. # + HF is default (no kw required for nmr_bas # -> g2s_method{} # a.d._patch_h_1997-06-05 accept IGAIM method # # check #_BUGgy with PERL5.x lines # # date for sharc_e_id generated with # SUBROUTINE: set_sharc_e_date $usageline = "USAGE g94bc2sharc_1.4i fn (fn.out is evaluated)\n"; #__ REQUIRED ADJUSTMENTS: # A) - CHECK which perl # [ adjust first line ] # - lock for DIRS&ENVIRONMENT to adjust to your computer pool # B) is $sharc_punch_dir the folder where YOU want the entries to go to ? # $sharc_punch_dir = "/usr/convex/cluster/Sharc/"; # where the copy # # of the .sharc file goes # - CHECK ls -l /usr/convex/cluster/Sharc/ # [ change permissions ] # #__ Switches # C) set mode = batch if you include this skript in a 'batch job' $punch = "active"; # "inactive" switches off punching to Arc dir # "active"/"inactive"(for test purposes) # The keyword sharc=test switches $punch to "inactive" # $mode = "interactive"; # "batch" switches off Warnings to screen # "batch"/"interactive" if($mode eq "batch") { $verbose = 0; }else{ $verbose = 3; # verbose > 0 for debugging and postprocessing if($verbose > 0){print "\nVERBOSE $verbose\n";} } # verbose -> actions # # 1 Warnings # # 2 title + Warnings (title = comment and command line) # # 3 applied conversions + title + Warnings # # 4 NICS + applied conversions + title + Warnings # # 5 VARIABLE_"property" + applied conversions + title + Warnings # # 6 TMP_"property" + VARIABLE_"property" + conversions + title + Warnings # # 10 all messages # # Supported GAUSSIAN output Versions: # an GAUSSIAN94B # or GAUSSIAN94B1 "HP-PARisc-HPUX-G94RevB.1" # or GAUSSIAN94C output # MUST include a line with "HP-PARisc-HPUX-G94RevC.3" # running on FAU-CCC-HP or FAU-RRZE-GSM # MUST include a line with "SGI-G94RevC.3" # running on FAU-IOC-INDIGO4 ? INDIGO2 ? #_PROJECTED for 1.5 # additional <!PROPERTY=POPU_NAO!> # #_DEBUGGED in 1.4.1 large sigmas are accepted a.d._1997-09-10 #_NEW_in V 1.3.1 <!PROPERTY= ...!> xxx <!/PRORPERTY=...> # inside <!MODELED= ...!> tag # insead of separately outside #FIX_1996-09-04 = V 1.3 _NO_ .sharc file if _NO_ NMR data in "batch" mode #_NEW_in_V1.2: - $verbose for differenciated masses of debug feedback # - prevent punching to archive when # a) sharc=test is specified # b) no NMR data is obtained # c) multi d basis set coding e.g. 6-311+G(3d,p) # d) CHI tensor as in NMR-SAHRC format definition # #_NEW_in_V1.1: - CHI_ANISOTROPY for the Anisotropy of the suszeptibility tensor # - accepting more than more @gen_bas specifying line # - add Fe,Co,Ni as allowed atoms # - BUG in ALL versions before CHI seems to have taken CHI_ANISO # (--> check 'old CHI' carefully) # #_NEW_in_V0.9: - $mode for switching between interactive/batch mode # - transformation of basis sets in $G94_comments # as already in $G94_keywords # - NO shifts -> NO archiving # #_NEW_in_V0.8: "Job cpu time" is registered # # additional features w.r.t. 0.6: # recorgnize gen-basis sets applied by @genbas "atFile" as implem.in CCC ER # FUNCTION: # 1) analyze which GAUSSIAN Version has been run # 2) transfer the results of a "GAUSSIAN94x calculation # into sharc format as specified at http://www.ccc.uni-erlangen.de/sharc/ # # RESULTS go into the associative array %value # e.g. $value{"1 A_nuc_char"} = the nuclear charge of the 1st Atom # or $value{"6 X"} = the X coordinate of the 6st Atom # and $value{"22 GIAO-G94 ZY"} = the ZY tensor element of the magnetic # shielding tensor calculated with GIAO-G94 # for the 22nd Atom. # HEADER information is in: # $opt_method # Method of geometry optimization # $nmr_program # Program for NMR calculation # $nmr_approach # RHF or DFT # $nmr_basis # Basis set for NMR calculation # $charge # Charge of the molecule # $stoichiometry # Stoichiometry # $point_group # Symmetry # PERMISSION information is in: # $sharc_contributor $sharc_permission $sharc_group # CHECK information is in: # $version # the version of this skript # $E_nuc_rep_energy # nuclear repulsion energy # SUPPLEMENTARY DATA # # # ___________ warnings should be in .sharc and create a '.s-punch' file.-) # WARNINGS: # #_test (activate these parts for debug purposes) #_test_V (activate these parts for debug purposes, essential Values) #_style (discussion of writing style) # Constants: # One Bohr equals 0.5291772 angstroems $bohr = 0.5291772; #__DEFAULTS and start values $n_atoms = 0; $n_x = 0; $genbas = "unknown"; $opt_method = "unknown"; $scf_program = "unknown"; $nmr_program = "unknown"; $charge = "10"; $nmr_approach = "RHF"; $G94termination = "unknown"; $point_group = "C1"; $sharc_contributor = "dransfld"; # taken from environment in batch mode #_patch 1996-10-23 changed default from THUMBPEEPR -> OPEN_GROUP $sharc_permission = "OPEN_GROUP"; # taken from comment line in batch $sharc_group = "ccc_erlangen"; # taken from environment in batch # for attached data: $text_prop_POPU_NAO_counter = 0; $text_prop_MO_ENE_counter = 0; #__lists (assoc. arrays) #------------- @coord --------------------------------------------------- #------------- [De]coding of coordinates @coord = ("O","X","Y","Z"); # "O" is $coord[0] #------------- @tensor -------------------------------------------------- #------------- [De]coding of tensor elements @tensor = ("O","XX","XY","XZ","YX","YY","YZ","ZX","ZY","ZZ"); # "O" is magic value #------------- %atom_name ----------------------------------------------- #------------- A_nuc_char_2_name pairs #%atom_name = ("0","Bq", "1","H", "2","He", "3","Li", "4","Be", "5","B", "6","C", "7","N", "8","O", "9","F", "10","Ne", "11","Na", "12","Mg", "13","Al", "14","Si", "15","P", "16","S", "17","Cl ", "18","Ar"); #test print " $atom_name{12} \n"; $atom_name{"-1"} = "Bq"; # this is NOT clean but necessary #new_1996-03-12 $atom_name{"0"} = "Bq"; $atom_name{"1"} = "H"; $atom_name{"2"} = "He"; $atom_name{"3"} = "Li"; $atom_name{"4"} = "Be"; $atom_name{"5"} = "B"; $atom_name{"6"} = "C"; $atom_name{"7"} = "N"; $atom_name{"8"} = "O"; $atom_name{"9"} = "F"; $atom_name{"10"} = "Ne"; $atom_name{"11"} = "Na"; $atom_name{"12"} = "Mg"; $atom_name{"13"} = "Al"; $atom_name{"14"} = "Si"; $atom_name{"15"} = "P"; $atom_name{"16"} = "S"; $atom_name{"17"} = "Cl"; $atom_name{"18"} = "Ar"; #test print " $atom_name{12} \n"; $atom_name{"19"} = "K"; $atom_name{"20"} = "Ca"; $atom_name{"22"} = "Ti"; $atom_name{"26"} = "Fe"; $atom_name{"27"} = "Co"; $atom_name{"28"} = "Ni"; $atom_name{"31"} = "Ga"; $atom_name{"32"} = "Ge"; $atom_name{"33"} = "As"; $atom_name{"34"} = "Se"; $atom_name{"35"} = "Br"; $atom_name{"36"} = "Kr"; #------------- %remark2sharc_perm --------------------------------------- # transforming permissions mentioned in the comment to proper SHARC terms $remark2sharc_perm{"test"} = "TEST"; # since 1.2c $remark2sharc_perm{"contributr"} = "CONTRIBUTR"; $remark2sharc_perm{"contributor"} = "CONTRIBUTR"; # as misspell alias $remark2sharc_perm{"private"} = "CONTRIBUTR"; # as alias $remark2sharc_perm{"quitprivat"} = "QUITPRIVAT"; $remark2sharc_perm{"pvrs"} = "QUITPRIVAT"; # as alias $remark2sharc_perm{"group"} = "GROUP_ONLY"; $remark2sharc_perm{"group_only"} = "GROUP_ONLY"; $remark2sharc_perm{"group-only"} = "GROUP_ONLY"; # as misspell alias # === to be replaced when used in other research groups === $remark2sharc_perm{"ccc"} = "GROUP_ONLY"; # as LOCAL alias # === to be replaced when used in other research groups === $remark2sharc_perm{"thumbpeepr"} = "THUMBPEEPR"; $remark2sharc_perm{"thumbpeeper"} = "THUMBPEEPR"; # as misspell alias $remark2sharc_perm{"open_group"} = "OPEN_GROUP"; $remark2sharc_perm{"open-group"} = "OPEN_GROUP"; # as misspell alias $remark2sharc_perm{"open"} = "OPEN_GROUP"; # - - - default - - - = OPEN_GROUP $remark2sharc_perm{"every_body"} = "EVERY_BODY"; $remark2sharc_perm{"every-body"} = "EVERY_BODY"; # as misspell alias $remark2sharc_perm{"everybody"} = "EVERY_BODY"; # as misspell alias $remark2sharc_perm{"all"} = "EVERY_BODY"; # as alias #_ list of allowed METHOD keywords #------------- %g2s_basis_set ------------------------------------------- #------ Gaussian_2_Sharc pairs # the space at the end is essential #a.d._patch_j_1997-05-13 recognize DFT Methods $g2s_method{"B3LYP"} = "B3LYP"; $g2s_method{"b3LYP"} = "B3LYP"; $g2s_method{"B3lyp"} = "B3LYP"; $g2s_method{"b3lyp"} = "B3LYP"; $g2s_method{"RB3LYP"} = "B3LYP"; # anyway covered by previous $g2s_method{"rb3lyp"} = "B3LYP"; # anyway covered by previous $g2s_method{"Becke3LYP"} = "B3LYP"; $g2s_method{"becke3lyp"} = "B3LYP"; $g2s_method{"BLYP"} = "BLYP"; $g2s_method{"BLYp"} = "BLYP"; $g2s_method{"BLyp"} = "BLYP"; $g2s_method{"Blyp"} = "BLYP"; $g2s_method{"blyp"} = "BLYP"; $g2s_method{"blyP"} = "BLYP"; $g2s_method{"blYP"} = "BLYP"; $g2s_method{"bLYP"} = "BLYP"; $g2s_method{"RBLYP"} = "BLYP"; # anyway covered by previous $g2s_method{"Rblyp"} = "BLYP"; # anyway covered by previous $g2s_method{"rBLYP"} = "BLYP"; # anyway covered by previous $g2s_method{"rblyp"} = "BLYP"; # anyway covered by previous #_ list of allowed BASIS sets #------------- %g2s_basis_set ------------------------------------------- #------ Gaussian_2_Sharc pairs # the space at the end is essential #a.d._patch_j_1997-05-13 allow g in place of G $g2s_basis_set{"gen "} = "MIX-unknown"; $g2s_basis_set{"GEN "} = "MIX-unknown"; $g2s_basis_set{"STO-3G "} = "STO-3G"; $g2s_basis_set{"3-21G "} = "3-21G"; $g2s_basis_set{"3-21g "} = "3-21G"; $g2s_basis_set{"3-21G* "} = "MIX-1"; $g2s_basis_set{"3-21g* "} = "MIX-1"; $g2s_basis_set{"3-21+G* "} = "MIX-21"; #new_1996-05-24 $g2s_basis_set{"3-21+g* "} = "MIX-21"; $g2s_basis_set{"6-31G "} = "6-31G"; #ok $g2s_basis_set{"6-31g "} = "6-31G"; # $g2s_basis_set{"6-31G* "} = "6-31GD"; #ok $g2s_basis_set{"6-31g* "} = "6-31GD"; $g2s_basis_set{"6-31G(d) "} = "6-31GD"; #ok $g2s_basis_set{"6-31g(d) "} = "6-31GD"; $g2s_basis_set{"6-31G(D) "} = "6-31GD"; #ok $g2s_basis_set{"6-31g(D) "} = "6-31GD"; $g2s_basis_set{"6-31G** "} = "6-31GDP"; #new_1996-03-02 Pok $g2s_basis_set{"6-31g** "} = "6-31GDP"; $g2s_basis_set{"6-31G(d,p) "} = "6-31GDP"; #new_1996-03-02 Pok $g2s_basis_set{"6-31g(d,p) "} = "6-31GDP"; # $g2s_basis_set{"6-31G(D,P) "} = "6-31GDP"; #new_1996-03-02 Pok $g2s_basis_set{"6-31g(D,P) "} = "6-31GDP"; $g2s_basis_set{"6-31+G* "} = "6-31+GD"; #ok $g2s_basis_set{"6-31+g* "} = "6-31+GD"; $g2s_basis_set{"6-31+G(d) "} = "6-31+GD"; #ok $g2s_basis_set{"6-31+g(d) "} = "6-31+GD"; $g2s_basis_set{"6-31+G(D) "} = "6-31+GD"; #ok $g2s_basis_set{"6-31+g(D) "} = "6-31+GD"; $g2s_basis_set{"6-31+G** "} = "6-31+GDP"; #ok $g2s_basis_set{"6-31+g** "} = "6-31+GDP"; $g2s_basis_set{"6-31+G(d,p) "} = "6-31+GDP"; #ok $g2s_basis_set{"6-31+g(d,p) "} = "6-31+GDP"; $g2s_basis_set{"6-31+G(D,P) "} = "6-31+GDP"; #ok $g2s_basis_set{"6-31+g(D,P) "} = "6-31+GDP"; $g2s_basis_set{"6-31++G* "} = "6-31++GD"; #ok $g2s_basis_set{"6-31++g* "} = "6-31++GD"; # $g2s_basis_set{"6-31++G(d) "} = "6-31++GD"; #ok $g2s_basis_set{"6-31++g(d) "} = "6-31++GD"; $g2s_basis_set{"6-31++G(D) "} = "6-31++GD"; #ok $g2s_basis_set{"6-31++g(D) "} = "6-31++GD"; $g2s_basis_set{"6-31++G** "} = "6-31++GDP"; #ok $g2s_basis_set{"6-31++g** "} = "6-31++GDP"; $g2s_basis_set{"6-31++G(d,p) "} = "6-31++GDP"; #ok $g2s_basis_set{"6-31++g(d,p) "} = "6-31++GDP"; $g2s_basis_set{"6-31++G(D,P) "} = "6-31++GDP"; #ok $g2s_basis_set{"6-31++g(D,P) "} = "6-31++GDP"; # $g2s_basis_set{"6-311G* "} = "6-311GD"; #ok $g2s_basis_set{"6-311g* "} = "6-311GD"; $g2s_basis_set{"6-311G(d) "} = "6-311GD"; #ok $g2s_basis_set{"6-311g(d) "} = "6-311GD"; $g2s_basis_set{"6-311G(D) "} = "6-311GD"; #ok $g2s_basis_set{"6-311g(D) "} = "6-311GD"; $g2s_basis_set{"6-311G** "} = "6-311GDP"; #new_1996-03-05 $g2s_basis_set{"6-311g** "} = "6-311GDP"; $g2s_basis_set{"6-311G(d,p) "} = "6-311GDP"; #new_1996-03-05 $g2s_basis_set{"6-311g(d,p) "} = "6-311GDP"; # $g2s_basis_set{"6-311G(D,P) "} = "6-311GDP"; #new_1996-03-05 $g2s_basis_set{"6-311g(D,P) "} = "6-311GDP"; $g2s_basis_set{"6-311+G* "} = "6-311+GD"; #ok $g2s_basis_set{"6-311+g* "} = "6-311+GD"; $g2s_basis_set{"6-311+G(d) "} = "6-311+GD"; #ok $g2s_basis_set{"6-311+g(d) "} = "6-311+GD"; $g2s_basis_set{"6-311+G(D) "} = "6-311+GD"; #ok $g2s_basis_set{"6-311+g(D) "} = "6-311+GD"; $g2s_basis_set{"6-311+G** "} = "6-311+GDP"; #ok $g2s_basis_set{"6-311+g** "} = "6-311+GDP"; # $g2s_basis_set{"6-311+G(d,p) "} = "6-311+GDP"; #ok $g2s_basis_set{"6-311+g(d,p) "} = "6-311+GDP"; $g2s_basis_set{"6-311+G(D,P) "} = "6-311+GDP"; #ok $g2s_basis_set{"6-311+g(D,P) "} = "6-311+GDP"; # $g2s_basis_set{"LANL1DZ "} = "LANL1DZ"; #ok $g2s_basis_set{"LANL2DZ "} = "LANL2DZ"; $g2s_basis_set{"6-31G(2d,p) "} = "6-31G2DP"; #new_1996-08-06 $g2s_basis_set{"6-31g(2d,p) "} = "6-31G2DP"; $g2s_basis_set{"6-31G(3d,p) "} = "6-31G3DP"; #new_1996-08-06 $g2s_basis_set{"6-31g(3d,p) "} = "6-31G3DP"; $g2s_basis_set{"6-311G(2d,p) "} = "6-311G2DP"; #new_1996-08-06 $g2s_basis_set{"6-311g(2d,p) "} = "6-311G2DP"; $g2s_basis_set{"6-311G(3d,p) "} = "6-311G3DP"; #new_1996-08-06 $g2s_basis_set{"6-311g(3d,p) "} = "6-311G3DP"; $g2s_basis_set{"6-311+G(2d,p) "} = "6-311+G2DP"; #new_1996-08-06 $g2s_basis_set{"6-311+g(2d,p) "} = "6-311+G2DP"; $g2s_basis_set{"6-311+G(3d,p) "} = "6-311+G3DP"; #new_1996-08-06 $g2s_basis_set{"6-311+g(3d,p) "} = "6-311+G3DP"; ##$g2s_basis_set{"dzp "} = "dzp"; #$g2s_basis_set{"tzp"} = "tzp"; ##$g2s_basis_set{"B-II"} = "B2"; #$g2s_basis_set{"B-III"} = "B3"; #_test #foreach $basis_set_keyword (sort keys %g2s_basis_set){ # print "G94_keyword: $basis_set_keyword --> $g2s_basis_set{$basis_set_keyword} \n"; #} #_/test # #_tags #- BIG versions # $stars_bar = "**************************************************"; $stars_bar = "***************************************"; #- INDI Version #__ SUB_ROUTINES: (START) # # ------------------------------ if($verbose > 10){print "Loading SUBroutine set_sharc_e_date \n";} #_ SUBROUTINE sub set_sharc_e_date { # SUB_NAME: set_sharc_e_date # SUB_AUTHOR: A. Dransfeld # SUB_VERSION: 0.2 1997-05-12 # SUB_FUNCTION: generate the sharc_e_date with gmtime # (based on Function time) # the sharc_e_date format has the advantage of comrising only # of characters allowed for a file name (on Mac AND UNIX) # RETURNS: nothing #GLOBAL verbose, sharc_e_date local ($flag) = "Flag-SR_set_sharc_e_date"; local ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst); # if($verbose > 10) {print "$flag\-0 hallo<\n";}; ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time); #PATCH_ad_1997-05-07 $mon++; # auf 19zz-0m-0d ergaenzen if($mon < 10) {$mon = join("","0",$mon);}; if($mday < 10) {$mday = join("","0",$mday);}; #test print "Sec $sec , Min $min , Hour $hour \n"; # make sec, min and hour a two digit string if($sec < 10) {$sec = join("","0",$sec);}; if($min < 10) {$min = join("","0",$min);}; if($hour < 10) {$hour = join("","0",$hour);}; $sharc_e_date = join("","19",$year,"-",$mon,"-",$mday,"GMT",$hour,$min,$sec); if($verbose > 10) {print "$flag\-1 $sharc_e_date<\n";}; } #_END sub set_sharc_e_date #__ SUB_ROUTINES: (END) #__ Main Program (START) # --- &set_sharc_e_date; #__Find out the __sharc_contributor__ open (IN, "whoami|"); $sharc_contributor = <IN>; chop($sharc_contributor); #_test print "X-test: $sharc_contributor"; close(IN); #_rem sharc_contributor=root makes no_n_sense.-> #FIX_1996-09-04(start) if($mode eq "batch") { ( $#ARGV >= 0) || exit; # ... without comment } else { $tmp = "You should give me the name of the file to be evaluated"; ( $#ARGV >= 0) || die "Usage $0 fn \n ( $tmp ) \n" ; } #FIX_1996-09-04(end) #-! check for getting at least one argument #-! this should never occur if the script is used in a batch process .-) $read_output_file = "$ARGV[0]\.out"; $write_sharc_file = ">$ARGV[0]\.sharc"; # #__Checking Input #test print "INPUT: $ARGV[0] READ_FILE: $read_output_file \n"; #check Version #FIX_1996-09-04(start) if($mode eq "batch") { open( G94XOUT , $read_output_file ) || exit; } else { open( G94XOUT , $read_output_file ) || die "Usage: $0 FN [a file FN.out is assumed to exist] \n" ; } if($mode eq "batch") { open( SHARC_FILE , $write_sharc_file ) || exit; } else { open( SHARC_FILE , $write_sharc_file ) || die "No Permission to write to $write_sharc_file \n"; } #FIX_1996-09-04(end) # #-! All this should never occur if the script is used in a batch process .-) #_batch #open(G94XOUT,$read_out_file); #open( SHARC_FILE , $write_sharc_file ); #_/batch # #_recognize a pattern like this AND check termination # AtFile(1): /exe/g94/basis/IGLO_ii.gbs [optional] # VARIABLES: $G94_identifier, $G94_version, $G94termination # ************************************************** # Gaussian 94: HP-PARisc-HPUX-G94RevB.1 16-Apr-1995 # 20-Feb-1996 # ************************************************** # ************************************************** # Gaussian 94: HP-PARisc-HPUX-G94RevC.3 26-Sep-1995 # 24-May-1996 # ************************************************** # ************************************************** # Gaussian 94: HP-PARisc-HPUX-G94RevB.1 16-Apr-1995 # 20-Jan-1996 # ************************************************** # Entering Link 1 = /Programs/g94/l1.exe PID= 19958. # *************************************** # Gaussian 94: SGI-G94RevC.3 26-Sep-1995 # 30-Jun-1996 # *************************************** # $/ = $stars_bar; #not necessary but makes it faster while (<G94XOUT>){ # check the GAUSSIAN Version, Termination and gen basises if(/Gaussian/){ if (/Gaussian 94:/){ $G94_identifier = "G94"; @words = split; $G94_version = $words[3]; #test print "$words[0] $words[1] $G94_version TheE_G94VERsIOn \n"; if( ($G94_version eq "HP-PARisc-HPUX-G94RevB.1") || ($G94_version eq "HP-PARisc-HPUX-G94RevC.3") || ($G94_version eq "SGI-G94RevC.3") ){ # everything should work out nicely }else{ if($mode eq "interactive"){ print "WARNING This skript was not written for this output format \n"} } #test print "Version $words[3] \n"; } } if (/Normal termination of Gaussian 94/){ $G94termination = "normal"; } #_ Find a line like: # AtFile(1): /usr/local/g94revC3/basis/IGLO_ii.gbs #_ one blank at Start of line # some possible 'values' #631.gbs DunnCC_DZ.gbs citry.gbs mc6311.gbs vd11s7p.gbs #6311.gbs DunnCC_QZ.gbs d95.gbs mmgmbs.gbs vd13s8p.gbs #6311s.gbs DunnCC_TZ.gbs d95v.gbs plus.gbs vd8s4p.gbs #6311ss.gbs IGLO_ii.gbs he9s.gbs plusplus.gbs vd9s5p.gbs #631s.gbs IGLO_iii.gbs hfsbas.lst pol.gbs #631ss.gbs SHAsv.gbs hfsbasis.lst pol2.gbs #741.gbs SHAtz.gbs hfspol.gbs rydberg.gbs #_ Evaluate this pattern # AtFile(1): /usr/local/g94revC3/basis/SHAsv.gbs # AtFile(1): /usr/local/g94revC3/basis/pol.gbs # Entering Link 1 = /usr/local/g94revC3/l1.exe PID= 22436. # some possible 'combinations' # SHAsv.gbs + pol.gbs # INPUT included as genbas line: @g94basis:IGLO_ii.gbs or from above list if (/AtFile/){ #test print "\nFound an atFile Note \n\n"; if(/IGLO_ii.gbs/){ $genbas = "B2"; } if(/IGLO_iii.gbs/){ $genbas = "B3"; } if(/DunnCC_TZ.gbs/){ $genbas = "TZ_Dunncc"; } if(/SHAtz.gbs/){ $genbas = "SHA_tz"; #renamed_1996-08-13 $genbas = "TZ_Sha"; } #new_1996-07-28-START if(/SHAsv.gbs/){ $genbas = "SHA_sv"; #renamed_1996-08-13 $genbas = "SV_Sha"; #test print "$genbas FLAG-1" } if(/pol.gbs/){ $genbas = join("_",$genbas,"Pol1"); #test print "$genbas FLAG-2a" } if(/pol2.gbs/){ $genbas = join("_",$genbas,"Pol2"); print "$genbas FLAG-2b" } if($mode eq "interactive"){ print "GenBaSis is $genbas \n";} #new_1996-07-28-END } } #test print "VARIABLES: $G94_identifier, $G94_version, $G94termination\n"; #_recognize a pattern like below to specify the NMR method # VARIABLES: $nmr_program # Magnetic properties (CSGT method) # # Magnetic susceptibility (cgs-ppm): # Isotropic = -84.9582 Anisotropy= 62.0945 # XX= -43.5623 YX= 0.0000 ZX= 0.0000 # XY= 0.0000 YY= -43.5619 ZY= -0.0004 # XZ= 0.0000 YZ= 0.0000 ZZ= -167.7505 # Eigenvalues: -167.7505 -43.5623 -43.5619 # Magnetic shielding (ppm): # 1 Li Isotropic = 96.9340 Anisotropy = 37.2703 #----------------------------- OR ---------------------- # Calculating GIAO nuclear magnetic shielding tensors. # GIAO Magnetic shielding tensor (ppm): # 1 H Isotropic = 23.1895 Anisotropy = 5.8342 # XX= 26.1889 YX= -2.3901 ZX= 0.0000 # XY= -3.6721 YY= 16.7577 ZY= 0.0000 # XZ= 0.0000 YZ= 0.0000 ZZ= 26.6221 # Eigenvalues: 15.8675 26.6221 27.0790 # 2 B Isotropic = 29.8367 Anisotropy = 184.0868 if($mode eq "interactive"){ seek (G94XOUT,0,0) || die "Can not seek to the beginning of the file"; }else{ seek (G94XOUT,0,0) || exit; } # still valid: $/ = $stars_bar; #not necessary but makes it faster while (<G94XOUT>){ if(/Calculating GIAO nuclear magnetic shielding tensors/){ #test print "FounD Calculating GIAO nuclear magnetic shielding tensors\n"; $nmr_program = "GIAO-G94"; last; } #_style geht nicht, why? if(/Magnetic properties (CSGT method)/){ if(/Magnetic properties/){ if (/CSGT method/){ $nmr_program = "CSGT-G94"; last; } #a.d._patch_h_1997-06-05 START if (/IGAIM method/){ $nmr_program = "IGAIM-G94"; last; } #a.d._patch_h_1997-06-05 END } } #test_V print "VARIABLE_nmr_program: $nmr_program\n"; #_recognize the command line and the comment line(s) # VARIABLES: $G94_keywords , $G94_comments # Default route: MAXDISK=40000107 SCF=TIGHT # --------------------------------------------- # 1st # #RHF/6-31G* nmr test NAME=DRANSFLD SCF=DIRECT # --------------------------------------------- # 2nd # 1/11=1,38=1/1; # <cut> # 99/5=1,9=1/99; # ---------------------------------------------------------------------- # HB(PH2)2 //RMP2-FC/6-31+GD both_P_pyram to same side (s.a.JACS,1992,87 # 21) # ---------------------------------------------------------------------- # Symbolic Z-matrix: #__ split the INPUT in parts between ---- lines (only 2nd and 4th used) # if($mode eq "batch") { seek (G94XOUT,0,0) || exit; }else{ seek (G94XOUT,0,0) || die "Can not seek to the beginning of the file"; } # $/ = "never_ever"; $i = 1; # make the file one $_ while (<G94XOUT>){ # split by line_bars s/\-{10,}/sachertorte/g; # introduce temporary tags #test print "ALL $_ \n"; @part = split(/sachertorte/,$_); # use a line of ---'s a separator # commad/comment line are assumed to be at least 10 character long } # end_while split by line_bars # #test print "PART 1 $part[1] \n"; # the comands #test print "PART 3 $part[3] \n"; # the comments #_style double chop would be necessary #_style BUT deleting \n is better $G94_keywords = $part[1]; $G94_keywords =~ s/\n//g; # newline's deleted # if($verbose > 1){print "ThE keywords $G94_keywords\n";} $G94_comments = $part[3]; $G94_comments =~ s/\n//g; # newline's deleted if($verbose > 1){ print "ThE comments $G94_comments\n"; } if($verbose > 5){print "VARIABLES_G94_keywords_G94_comments: $G94_keywords $G94_comments \n";} #_/recognize the keywords line and the comments line(s) #__ Analysing the CommAND Line foreach $basis_kw (keys %g2s_basis_set){ if(index($G94_keywords,$basis_kw) >= 0 ){ # valid basis set keyword #test print "XxbB $basis_kw in $G94_keywords \n"; $nmr_basis = $g2s_basis_set{$basis_kw}; #ad_patch_1996-09-11 if($verbose > 2){ print "VARIABLE_nmr_basis: $nmr_basis <- $basis_kw \n";} if(($nmr_basis eq "MIX-unknown")&&($genbas ne "unknown")){ $nmr_basis = $genbas; } } } $_ = $G94_keywords; #a.d._patch_j_1997-05-13 (start) $tmp = 0; foreach $method_kw (keys %g2s_method){ if(/$method_kw/) { # recognized [DFT] method #test print "XxmM $method_kw in $G94_keywords \n"; $nmr_approach = $g2s_method{$method_kw}; $tmp = 1; if($verbose > 2){ print "VARIABLE_nmr_method: $nmr_approach <- $method_kw \n"; } } } if(!$tmp){ # if not 1 = a DFT etc. calc. $nmr_approach = "RHF"; # the default method if($verbose > 2){ print "VARIABLE_nmr_method: $nmr_approach <- ... by default \n"; } } #__Analysing the CommENt Line $_ = $G94_comments; #-! read standard geometry specification if (/\/\//){ # comment includes something like //RHF... $opt_method = $'; # s OK f,n,t,r BAD # $opt_method =~ s/\s?//; # this should work - but does notine breakes $opt_method =~ s/ ?//; #undo splitting due to GAUSSIAN line breakes $opt_method =~ s/\s.*//; #chop all following words $opt_method =~ s/RMP2\(FU\)/RMP2-FU/; $opt_method =~ s/RMP2\(fu\)/RMP2-FU/; $opt_method =~ s/RMP2\(FC\)/RMP2-FC/; $opt_method =~ s/RMP2\(fc\)/RMP2-FC/; $opt_method =~ s/MP2\(Full\)/RMP2-FU/; $opt_method =~ s/MP2\(fu\)/RMP2-FU/; $opt_method =~ s/MP2\(FU\)/RMP2-FU/; $opt_method =~ s/MP2\(fu\)/RMP2-FU/; #_patch 1996-10-21_start $opt_method =~ s/MP2\(Fu\)/RMP2-FU/; $opt_method =~ s/MP2\(Fc\)/RMP2-FC/; $opt_method =~ s/MP2\(fU\)/RMP2-FU/; $opt_method =~ s/MP2\(fC\)/RMP2-FC/; #_patch 1996-10-21_end $opt_method =~ s/MP2\(FC\)/RMP2-FC/; $opt_method =~ s/MP2\(fc\)/RMP2-FC/; $tmp = join("",$opt_method," "); # append a blank $opt_method = $tmp; #_ the B3LYP specifications have to be added to the above foreach $basis_kw (keys %g2s_basis_set){ #test print "XxB $basis_kw in >$opt_method\< index($opt_method,$basis_kw) \n"; if(index($opt_method,$basis_kw) >= 0 ){ # valid basis set keyword $opt_basis = $g2s_basis_set{$basis_kw}; if($verbose > 2){print "VARIABLE_opt_basis: $opt_basis <- $basis_kw \n"; } # replace nonstandard basis specification by standard one } } $opt_method = join("",("\/\/",$opt_method)); # restore the prefix "//" } if(/@/){ $character = $'; $character =~ s/\s.*//; #chop all following words } #_pro # foreach $basis_kw (keys %g2s_basis_set){ #test # print "Xb $basis_kw in $opt_method \n"; # if(index($opt_method,$basis_kw) >= 0 ){ # valid basis set keyword # if(index($opt_method,"6-31\+G\*") >= 0 ){ # valid basis set keyword # $tmp_G94 = $basis_kw; # $tmp_SHARC = $g2s_basis_set{$basis_kw}; # $opt_method =~ s/"$tmp_G94"/"$tmp_SHARC"/; # $opt_method =~ s/$basis_kw/$g2s_basis_set{$basis_kw}/; #test # print "DDDDDDDDDD $opt_method \n"; # } # } #_/pro #test_V print "VARIABLE_opt_method: $opt_method \n"; # #__ read required permissions $_ = $G94_comments; if (/shARC/i || /perMISSION/i || /perM=/i){ $_ = $G94_comments; # reset to unsplit line chop; if (/shARC/i){ $tmp = $'; # split by reg.Expr. in if } if (/perMISSION/i){ $tmp = $'; # split by reg.Expr. in if } if (/perM=/i){ $tmp = $'; # split by reg.Expr. in if } if($verbose > 6){ print "TMP_sharc_permission: $tmp \n";} $tmp =~ s/=/ /; # I SHARC=x_permission is used $tmp =~ s/^\s+//; # elimination of preceeding blanks $tmp =~ s/\W.*//; # eliminate everything besides the keyword $tmp =~ tr/[A-Z]/[a-z]/; # deCapitalize keyword if(defined $remark2sharc_perm{$tmp}){ # otherwise keep default value $sharc_permission = $remark2sharc_perm{$tmp}; if($verbose > 1){ print "NMR-SHARC permissions set to >$sharc_permission< \n";} } } # END_if /shARC/i || /perMISSION/i in $G94_comments #test_V if($verbose > 6){ print "VARIABLE_sharc_permission: $sharc_permission \n";} #__Reading the xyz Coordinates # ATTENTION: Z-Matrix orientation occurs first in output # REMARK: Atoms X are ignored in NMR calculations and do NOT # appear in the Std.Ori. # Standard orientation: # ---------------------------------------------------------- # Center Atomic Coordinates (Angstroms) # Number Number X Y Z # ---------------------------------------------------------- # 1 1 0.389664 1.878292 0.000000 # 2 5 0.076389 0.725297 0.000000 # <cut> # 8 1 -0.948546 -1.120179 -1.529568 # ---------------------------------------------------------- #_or_# Z-Matrix orientation: #_or_# ---------------------------------------------------------- #_or_# Center Atomic Coordinates (Angstroms) #_or_# Number Number X Y Z #_or_# ---------------------------------------------------------- #_or_# 1 1 -1.914880 -0.114258 0.000000 #_or_# 2 5 -0.720084 -0.115629 0.000000 #_or_# 9 -1 1.394631 0.000000 0.000000 #- --------- ignore -1 X non-Bq's -------------- #_or_# <cut> #_or_# ---------------------------------------------------------- seek (G94XOUT,0,0); $/ = "\n"; # reset to splitting in lines while(<G94XOUT>) { # reading line by line if (/Job cpu time/){ chop; $G94timing = $_ ; # register the job timing } if (/Standard orientation:/ || /Z-Matrix orientation:/ || /Input orientation:/){ #test print "X_found Coordinates \n"; if(/Z-Matrix orientation:/ || /Input orientation:/ ){ $available_coordinaes = "z-matix_orientation"; #test print "X_found Z-Matr.Ori. $_ \n";# $n_atoms should be 0; } if(/Standard orientation:/){ # overwrite the Z-Matrix ori. coordinates $coordinates_orientation = "Standard"; $n_atoms = 0; $n_x = 0; #test print "X_found Std.Ori. $_ \nX_reset VARIABLE_n_atoms to $n_atoms \n"; } $n_linebars = 0; $n_lines = 0; while(<G94XOUT>) { # reading the Std.Ori block line by line $n_lines++; chop; #test print "$n_lines X> $_ <X \n"; if (/\-{25,}/){ # a line with more than 25 "-" in one piece $n_linebars++; if ($n_linebars >= 3){ #test print "That is enough $n_linebars in the part following STANDARD ORIENT.\n"; last; } }else{ # if this is NOT a separator line if (/Center/ || /Atomic/ || /Coordinates/ || /Number/){ #test print "A title line \n"; }else{ # neither a separator nor title line $n_atoms++; @words = split; #test print "$n_atoms $n_x W> $words[1] $words[2] $words[3] <W \n"; if(($n_x + $n_atoms) != $words[1]){ #FIX_1996-09-04(start) print SHARC_FILE "WARNING: mismatch in reading the coordinates \n"; print SHARC_FILE "WARNING: May be there are two .out in the file \n"; if($verbose > 0){ print "WARNING: mismatch in reading the coordinates \n"; print "WARNING: May be there are two .out in the file \n"; } #FIX_1996-09-04(end) }else{ #FIX_1996-07-14 if($words[2] eq "-1"){ $n_x++; $n_atoms--; # no SIGMA for X dummies }else{ $value{"$n_atoms A_nuc_char"} = $words[2]; for($i=1;$i<4;$i++){ $j = $i+2; $value{"$n_atoms $coord[$i]"} = $words[$j]; } } } } } } } #__Read GIAO results # ! EXPECT lines like: # Diamagnetic GIAO Magnetic shielding tensor (ppm): # and # Paramagnetic GIAO Magnetic shielding tensor (ppm): # with the preceeding to be IGNORED. # # Calculating GIAO nuclear magnetic shielding tensors. # GIAO Magnetic shielding tensor (ppm): # 1 H Isotropic = 23.1895 Anisotropy = 5.8342 # XX= 26.1889 YX= -2.3901 ZX= 0.0000 # XY= -3.6721 YY= 16.7577 ZY= 0.0000 # XZ= 0.0000 YZ= 0.0000 ZZ= 26.6221 # Eigenvalues: 15.8675 26.6221 27.0790 # 2 B Isotropic = 29.8367 Anisotropy = 184.0868 # XX= 140.8785 YX= -50.2661 ZX= 0.0000 # XY= -49.2116 YY= -59.1999 ZY= 0.0000 # XZ= 0.0000 YZ= 0.0000 ZZ= 7.8315 # if(($nmr_program eq "GIAO-G94") && /Calculating GIAO nuclear magnetic shielding tensors/){ #test print "TEST_Ab_hier_ $nmr_program tensoren_lesen\n"; $i_atom = 0; while(<G94XOUT>) { # reading the NMR block line by line if(/GIAO Magnetic shielding tensor/){ #test print "TEST_GIAO_ignore_this_line $_"; if(/Paramagnetic/ || /Diamagnetic/){ #test print "TEST_ignore_this_and_more_line $_"; }else{ #to be finished with last #test print "TEST_Here_comes_the_good_part. \nXX$_ "; while(<G94XOUT>) { # reading the NMR block line by line # 1 F Isotropic =-27600.4571 Anisotropy = 42119.3282 # XX=-41640.2332 YX= 0.0000 ZX= 0.0000 #_old if(/Isotropic/){ #_old $i_atom++; #_old chop; #_old $_ =~ s/^ +//; # replace preceeding blanks #_old @words = split; # e.g. in __1 , _99 , not in 100 .-> #_old $value{"$i_atom nmr_isotropic"} = $words[4]; #test print "VARIABLE_VALUE_nmr_isotropic $words[4] Atom $i_atom\n"; # a.d._1997-09-10 ... a similar adjustment would be necessary for the tensor values #_less flexible ... like fixed format #test print "TEST_Reading_good_part_line_by_line. \nXX$_ "; #_match 1 H Isotropic = 23.1895 Anisotropy = 5.8342 if(/(\d+)\s+(\D+)\s+Isotropic =\s*(\-*\d+\.\d+)\s+Anisotropy/) { $i_atom++; $value{"$i_atom nmr_isotropic"} = $3; #test print "TEST_shielD $i_atom = $1 is a $2 atom with $3 shielding\n"; #test print "Read tensors for atom 1 to $n_atoms \n $i >> $_"; #test print "VARIABLE_VALUE_nmr_isotropic $3 Atom $i_atom\n"; while(<G94XOUT>) { # reading the NMR block of ONE atom line by line $_ =~ s/^\s+//g; # elimination of preceeding blanks $_ =~ s/=//g; # elimination the equation characters @words = split; #test if($mode eq "interactive"){print "W0 $words[0] # $words[1] # $words[2] # $words[3] # $words[4] # $words[5]\n";} if(($words[0] ne "XX") && ($words[0] ne "XY") && ($words[0] ne "XZ")){ last; # WHILE reading the NMR block of ONE atom }else{ %pairs = split; @tmpK = keys %pairs; @tmpV = values %pairs; #test print "W_keys $tmpK[0] # $tmpK[1] # $tmpK[2] \n"; #test print "W_vals $tmpV[0] # $tmpV[1] # $tmpV[2] \n"; for($i=0;$i<=2;$i++){ #test print "TMP_K $tmpK[$i] >"; $value{"$i_atom $tmpK[$i]"} = $tmpV[$i]; } } } } if($i_atom >= $n_atoms){ #BUG if atoms X are used only for real atoms shift is printed # and therefor $i_atom never reaches $n_atoms # Effect: reds until end -> no arc entry saved #test print "LAST GIAO atom $i_atom = $n_atoms\n"; last; } if(/Dipole moment/){ #BUGFIX #test print "Far behind the last GIAO atom \n"; last; } } #END_ while reading REAL NMR block last; #do not read behind the NMR block } #END_ if shielding but not dia- or para-Contraproduct } #END_ if shielding } } #__Read CSGT results # Magnetic susceptibility (cgs-ppm): # this is different to GIAO fmt # Isotropic = -84.9582 Anisotropy= 62.0945 # this is different to GIAO fmt # XX= -43.5623 YX= 0.0000 ZX= 0.0000 # this is different to GIAO fmt # XY= 0.0000 YY= -43.5619 ZY= -0.0004 # this is different to GIAO fmt # XZ= 0.0000 YZ= 0.0000 ZZ= -167.7505 # this is different to GIAO fmt # Eigenvalues: -167.7505 -43.5623 -43.5619 # this is different to GIAO fmt # Magnetic shielding (ppm): # 1 Li Isotropic = 96.9340 Anisotropy = 37.2703 # XX= 84.5105 YX= 0.0000 ZX= 0.0000 # XY= 0.0000 YY= 84.5107 ZY= 0.0002 # XZ= 0.0000 YZ= 0.0000 ZZ= 121.7809 # Eigenvalues: 84.5105 84.5107 121.7809 # 2 P Isotropic = -328.7714 Anisotropy = 847.8630 # XX= -663.8990 YX= 0.0000 ZX= 0.0000 # XY= 0.0000 YY= -555.4973 ZY= -33.7003 # XZ= 0.0000 YZ= 137.3062 ZZ= 233.0822 # #a.d._patch_h_1997-06-05 START if((($nmr_program eq "IGAIM-G94") || ($nmr_program eq "CSGT-G94")) && /Magnetic properties/){ #test print "Ab hiEr $nmr_program magNETic tensoren lesen\n"; if(/CSGT method/ || /IGAIM method/){ #OLD if(/CSGT method/){ #a.d._patch_h_1997-06-05 END #test print "Ab hiEr $nmr_program tenSOren lesen\n"; $i_atom = 0; while(<G94XOUT>) { # reading the NMR block line by line #_if_susz. if(/Magnetic susceptibility/){ # reading CHI, suszeptibility while(<G94XOUT>) { #_BUGgy with PERL5.x better /Isotropic lala (\-*\d+\.d+) lilaliz (\-*\d+\.d+)/ if(/Isotropic/){ @words = split; $value{"0 susz_isotropic"} = $words[3]; # CHI #new_1996-07-29_START $value{"0 susz_anisotropy"} = $words[5]; # CHI_ANISOTROPY #new_1996-07-29_END if($verbose > 1){ print "VARIABLE_VALUE_susz_isotropic $words[3] \n"; } } if(/Magnetic shielding/){ #test print "Finished reading SUSZepy \n"; last; } } } # if reading Suszeptibility #__ reading NMR shieldings ... within IGAIM part #_if_shield. if(/Isotropic/){ $i_atom++; @words = split; $value{"$i_atom nmr_isotropic"} = $words[5]; #test print "TEST Read tensors for atom 1 to $n_atoms \n $i_atom >> $_"; #test print "VARIABLE_VALUE_nmr_isotropic $words[5] Atom $i\n"; #test print "TEST VAR_n_atoms $n_atoms \n"; while(<G94XOUT>) { # reading the NMR block of ONE atom line by line $_ =~ s/^\s+//g; # elimination of preceeding blanks $_ =~ s/=//g; # elimination the equation characters @words = split; #test print "W0 $words[0] # $words[1] # $words[2] # $words[3] # $words[4] # $words[5]\n"; if(($words[0] ne "XX") && ($words[0] ne "XY") && ($words[0] ne "XZ")){ last; # WHILE reading the NMR block of ONE atom } }else{ %pairs = split; @tmpK = keys %pairs; @tmpV = values %pairs; #test print "W_keys $tmpK[0] # $tmpK[1] # $tmpK[2] \n"; #test print "W_vals $tmpV[0] # $tmpV[1] # $tmpV[2] \n"; for($i=0;$i<=2;$i++){ #test print "TMP_K $tmpK[$i] >"; $value{"$i_atom $tmpK[$i]"} = $tmpV[$i]; } } } #_if_final if($i_atom >= $n_atoms){ #test print "LAST CSGT atom $i_atom\n"; last; } } } } #-! If not Std.Ori/Z-Matr. Coordinates part if(/Stoichiometry/){ @words = split; $stoichiometry = $words[2]; $stoichiometry =~ s/\(.*//; # chop off the charge #test_V print "VARIABLE_stoichiometry $stoichiometry \n"; #_NEW_in_04 #__Read Symmetry (if available) #_ symmetry specified: _____________ # Framework group C5V[C5(Li),5SGV(P)] # Deg. of freedom 2 # Full point group C5V NOp 10 # this should be point_group # Largest Abelian subgroup CS NOp 2 # ignored # Largest concise Abelian subgroup CS NOp 2 # ignored #_ symmetry NOT specified: _____________ # Framework group # PRSFWG-- UNABLE TO FIND LEFT SQUARE BRACKET. # NUMDOF-- UNRECOGNIZED SYMMETRIC SUBSPACE, ICHAR= E " # Deg. of freedom -1 # Full point group NOp 1 # default point_group to C1 # while(<G94XOUT>) { # reading the Symmetry block line by line if(/Framework group/){ $G94_symmetry_frame = $_; # to be punched as suppl data #test print "V_X_Symm.frame $G94_symmetry_frame \n"; } if(/Full point group/){ #test print "POST_match $' "; @words = split(/NOp/, $'); #postmatch from reg.expr. /Full.../ in if( #test print "W0 $words[0] # $words[1] # $words[2] \n"; $tmp_pg = $words[0]; $tmp_pg =~ s/ +//; # replace blanks $tmp_pg =~ s/\W.*//; #replace the rest $point_group = $tmp_pg; #test print "VARIABLE_v_point_group > $point_group < \n"; #if PG does NOT start with a letter make it "U" if($point_group !~ s/[cdsi]//i){ # PG does not start with a letter $point_group = "U"; # classify as Unknown #test print "Na sowas $point_group \n"; }else{ $point_group = $tmp_pg; $point_group =~ s/0//; # eliminate the zero $point_group =~ tr/[a-z]/[A-Z]/; # capitalize everything } last; # WHILE reading the Symmetry block } } #_/NEW_in_04 } # END_IF (/Stoichiometry/){ #__Read Charge # Charge = 0 Multiplicity = 1 # Charge =-1 Multiplicity = 1 # requires split at = if(/Charge/ && /Multiplicity/){ $tmp = $_; $tmp =~ s/=/ /; # eliminate = characters #test print "X_Tmp $tmp pmt_T\n"; #_? @words = split(/\s/,$tmp); # why? not @words = split(/ +/,$tmp); #test print "X_Tmx $words[0] $words[1] $words[2] $words[3] xmt_T\n"; $charge = $words[2]; #test_V print "VARIABLE_charge $charge\n"; } #__Read Check parameter NRE # nuclear repulsion energy 321.5012206667 Hartrees. if(/nuclear repulsion energy/){ @words = split; $E_nuc_rep_energy = $words[4]; #test_V print "VARIABLE_E_nuc_rep_energy $E_nuc_rep_energy \n"; } #__Read what goes into the <!PROPERTY=POPU_NAO!> tag # SUMMARY: Total Natural Atomic and Molecular Charges and Atomic Hybridizations # Atom Natural Charge Valence Populations # ---- -------------- -------------------------------------------- # S P D F G # Unit 1: # H 1 Q = .00000 e .9994 .0006 # ratio 1.000 : .001 # Total, unit 1 .000000 # Grand Total .000000 # if(/SUMMARY: Total Natural Atomic/){ $text_prop_POPU_NAO_counter = 1; # sets the flag to print NAO if($verbose > 9){ print "Found the summary of the Natural Atomic Orbital Analysis\n";} # # 6 TMP_"property" # while <G94> solange bis /Grand Total/ # save first line # $text_prop_POPU_NAO{$text_prop_POPU_NAO_counter} = $_; # save first line # while(<G94XOUT>) { # reading line by line # $text_prop_POPU_NAO_counter++; # $_ =~ s/^\s//g; # eliminate preceeding blank # $text_prop_POPU_NAO{$text_prop_POPU_NAO_counter} = $_; } #_new_1996-09-12_start #__Read what goes into the <!PROPERTY=MO_ENE!> tag # units = # Alpha occ. eigenvalues -- -.49771 -.46213 -.44421 -.32914 # Alpha virt. eigenvalues -- # text_prop_MO_ENE_counter = 1; if(/Alpha occ. eigenvalues/){ $text_prop_MO_ENE_counter = 1; # sets the flag to print NAO if($verbose > 9){ print "Found Molecular Orbital Energies\n";} $text_prop_MO_ENE{$text_prop_MO_ENE_counter} = $_; # safe first line while(<G94XOUT>) { # reading line by line $text_prop_MO_ENE_counter++; $text_prop_MO_ENE{$text_prop_MO_ENE_counter} = $_; #test print "$text_prop_MO_ENE_counter . Line = $_\n"; if(/Alpha virt. eigenvalues/){ # 1-5 unocc orbitals are enough last; # after this no "alpha..." should come } } # #_END while(<G94XOUT>) { } # #_END if (/Alpha occ. eigenvalues/){ #_new_1996-09-12_end #__Read GAUSSIAN archive section # Test job not archived. # 1\1\FAU-CCC-HP112\SP\RHF\6-311+G(d)\Li1P5\MAERKER\18-Feb-1996\0\\#HF/6 #<cut> # HP-PARisc-HPUX-G94RevB.1\State=1-A1\HF=-1711.2274366\RMSD=7.048e-09\Di # pole=0.,0.,1.1999219\PG=C05V [C5(Li1),5SGV(P1)]\\@ # #_ grep out the GAUSSIAN archive part #test print "Foundation $_"; if(/Test job not archived/ || /FAU-IOC-INDIGO4/ || /FAU-CCC-HP/ || /FAU-RRZE-GSM/){ # DIRS&ENVIRONMENT the below list of computer names # _MUST_ be adjusted to your comput.pool # take the "|| /_computer_name/" parts from the GAUSSIAN archive part. #test print "Found a GAUSSIAN arc start marker\n"; $Garchi = 0; if(/FAU-IOC-INDIGO4/ || /FAU-CCC-HP/ || /FAU-RRZE-GSM/){ # save the first line $Garchi++ ; $_ =~ s/^\s//g; # eliminate preceeding blank $G94_arc{$Garchi} = $_; } while(<G94XOUT>) { # reading line by line $Garchi++; $_ =~ s/^\s//g; # eliminate preceeding blank $G94_arc{$Garchi} = $_; if(/\\\\@/){ #test print "G94 arc terminator \n"; last; } if($archi > 50){ # to prevent an endless loop if($mode eq "interactive"){ print "Missing G94 arc terminator ERROR \n"; last;} } } } #__Read WIBERG bond index section # Wiberg bond index matrix in the NAO basis: # # Atom 1 2 3 4 5 # ---- ------ ------ ------ ------ ------ # 1. C 0.0000 1.0173 0.9298 0.9298 0.9298 # 2. Cl 1.0173 0.0000 0.0164 0.0164 0.0164 # ... # # Wiberg bond index, Totals by atom: if(/Wiberg bond index matrix in the NAO basis/){ $Wiberi = 0; while(<G94XOUT>) { # reading line by line $Wibergi++; $G94_wbi{$Wibergi} = $_; if(/Wiberg bond index, Totals by atom/){ #terminating line #test print "Last Wiberg INdex Line \n"; last; } if($Wibergi > 100){ #test print "Too amy Wiberg INdex Lines \n"; last; } } } } #_test # $tmp = $value{"3 A_nuc_char"}; # print "Nr3 Nucl.Charge is $tmp \n"; # $tmp = $value{"4 Y"}; # print "Nr4 Y-coord is $tmp \n"; # $tmp = $value{"2 nmr_isotropic"}; # print "Nr2 isotropic NMR shielding $tmp \n"; # $tmp = $value{"6 ZZ"}; # print "Nr6 NMR shielding tensor element ZZ is $tmp \n"; #_/test # #__Writing to the SHARC file # #_new_1996-03-05 if($opt_method eq "unknown"){ $opt_method = "//unknown"; } #_/new_1996-03-05 print SHARC_FILE "SHARC $nmr_program\/$nmr_approach\/$nmr_basis $stoichiometry _$charge\. $opt_method $opt_basis \/$point_group @$character \n"; print SHARC_FILE "TEXT FIGU $G94_comments \n"; print SHARC_FILE "SHARCNR 0 \n"; #patch_a.d._1997-05-11 (start) $sharc_e_id = join(",",$sharc_contributor,$sharc_e_date); #test print "SHARCID $sharc_e_id\n"; print SHARC_FILE "SHARCID $sharc_e_id\n"; #patch_a.d._1997-05-11 (end) print SHARC_FILE "NUCS $n_atoms \n"; # #test print "TEST VAR_n_atoms $n_atoms \n"; $res_nuc = 0; for($i=1;$i<=$n_atoms;$i++){ if(defined $value{"$i nmr_isotropic"}){$res_nuc++;} } #test print "TEST VAR_res_nuc $res_nuc\n"; if($res_nuc == 0){ $punch = "inactive"; # switch off punching .sharc to arc directory if($mode eq "interactive"){ print "\nNO NMR DATA. Stopped archiving\n";} print SHARC_FILE "\n\n NO NMR DATA. \n\n"; print SHARC_FILE "Stopped archiving \n\n"; }else{ #test print "Res_uc $res_nuc N_atomS $n_atoms"; for($i=1;$i<=$n_atoms;$i++){ $i_nuc_char = $value{"$i A_nuc_char"}; $i_atom_name = $atom_name{$value{"$i A_nuc_char"}}; for($j=1;$j<=3;$j++){ $i_coord[$j] = $value{"$i $coord[$j]"}; } if(defined $value{"$i nmr_isotropic"}){ $i_nmr_isotropic = $value{"$i nmr_isotropic"}; }else{ $i_nmr_isotropic = 10000; # magic number 10ooo } for($j=1;$j<=9;$j++){ $i_tensor[$j] = $value{"$i $tensor[$j]"}; } # print SHARC_FILE "N=$i_atom_name "; if($verbose = 4){ if($i_atom_name eq "Bq"){ print "GhoSt with SiGma $i_nmr_isotropic\n"; } } printf SHARC_FILE "%3.1f",$i_nuc_char; printf SHARC_FILE "%12.8f %12.8f %12.8f",$i_coord[1],$i_coord[2],$i_coord[3]; printf SHARC_FILE " %6.2f ",$i_nmr_isotropic; # isotropic shielding (as separator) for($j=1;$j<=9;$j++){ printf SHARC_FILE "%6.4f ",$i_tensor[$j]; } print SHARC_FILE "\n"; } #END_ for($i=1;$i<=$n_atoms;$i++){ } #END_ if($res_nuc == 0){ print SHARC_FILE "CHAR $charge \n"; print SHARC_FILE "NAME $sharc_contributor \n"; print SHARC_FILE "GROUP $sharc_group \n"; print SHARC_FILE "PERM $sharc_permission \n"; # #__ Writing supplementary data #-! Until here 'vital' data specified as NMR-SHARC(c) format #-! URL: http://www.ccc.uni-erlangen.de/sharc/ # ====================================================== print SHARC_FILE "\n"; # ====================================================== #-! Everything below is "attached data" (format free/partially marked) #-! not really prepared for systematic evaluation # print SHARC_FILE "EXTRACTED_BY $version \n"; # if(defined $value{"0 susz_isotropic"}){ $tmp = $value{"0 susz_isotropic"}; print SHARC_FILE "CHI $tmp \n"; } #new_1996-07-29_START if(defined $value{"0 susz_anisotropy"}){ $tmp = $value{"0 susz_anisotropy"}; print SHARC_FILE "CHI_ANISOTROPY $tmp \n"; } #new_1996-07-29_END print SHARC_FILE "NRE $E_nuc_rep_energy \n"; # open (IN, "date |"); while (<IN>){ print SHARC_FILE "DATE $_ \n"; } close(IN); print SHARC_FILE "PROGRAM $G94_identifier \n"; print SHARC_FILE "PRG_VERSION $G94_version \n"; print SHARC_FILE "TIMING $G94timing \n"; print SHARC_FILE "TERMINATION $G94termination \n"; print SHARC_FILE "COORD ORIENTATION $coordinates_orientation \n"; if(defined $G94_symmetry_frame){ print SHARC_FILE "SYMMETRY_FRAME $G94_symmetry_frame"; } #_ print the GAUSSIAN archive data if($Garchi > 0){ # if there is a GAUSSIAN archive part print SHARC_FILE "<!MODELED=A94!>\n"; for($i=1;$i<=$Garchi;$i++){ print SHARC_FILE $G94_arc{$i}; } print SHARC_FILE "<!/MODELED=A94!>\n"; } #_END if($Garchi > 0){ #_ print the WIBERG bond index if($Wibergi > 0){ # if there is a WIBERG part print SHARC_FILE "<\!PROPERTY=WBI\!>\n"; for($i=1;$i<=$Wibergi;$i++){ print SHARC_FILE $G94_wbi{$i}; } print SHARC_FILE "<\!/PROPERTY=WBI\!>\n"; } #_new_1996-09-12_start #_ print the Molecular orbital energies in <!PROPERTY=MO_ENE!> tag if($text_prop_MO_ENE_counter > 0) { print SHARC_FILE "<\!PROPERTY=MO_ENE\!>\n"; for ($i=1;$i <= $text_prop_MO_ENE_counter;$i++) { print SHARC_FILE "$text_prop_MO_ENE{$i}"; # unchopped lines } # $text_prop_MO_ENE{$text_prop_MO_ENE_counter} print SHARC_FILE "<\!/PROPERTY=MO_ENE\!>\n"; } #_new_1996-09-12_end # # print SHARC_FILE "SHARCEND\n\n"; # the inofficial NMR-SHARC end tag # #__Finishing close(DMM93OUT); close(SHARC_FILE); close(DMM93NMR); # if($sharc_permission eq "TEST"){ $punch = "inactive"; # prevent punching of test jobs if($verbose > 1){ print "NMR-SHARC file _NOT_ punched to archive\n";} } #__Punch .SHARC to sharc_punch_dir if($punch eq "active"){ # "inactive" switches off punching to Arc dir $i = 0; @punch_sharc_file = ($sharc_punch_dir,"$ARGV[0]\.sharc","-",$i); $punch_sharc = join("",@punch_sharc_file); while (-e $punch_sharc){ $i++; @punch_sharc_file = ($sharc_punch_dir,"$ARGV[0]\.sharc","-",$i); $punch_sharc = join("",@punch_sharc_file); } system "cp","$ARGV[0]\.sharc",$punch_sharc; } #FIX_1996-09-04(start) delete .sharc file if no NMR data in .out file if( ($res_nuc == 0) && ($mode eq "batch")){ system "rm","$ARGV[0]\.sharc"; } #FIX_1996-09-04(end)