Subject: Re: CCL:basis set optimiser in solid

From: Samantha Jenkins <[email-masked]>
Date: Mon, 15 Jan 2001 13:32:13 -0500

Dear Yoshiyuki,

Thankyou for your attachments, however, I have now got a patch for
LOPTCG maybe this is of interest to you. Please see message below too:

************************************************************************************

Concerning your problem with the optimizer: attached I send you a patch
that will correct
(I hope!) this bug. In principle it is enough to include the whole file
within the
optimizer input deck.  Alternatively you can place the file containing
the new function in
the appropriate directory,  for instance:  ~/LoptFnc, and then source it
into the
procedure by adding in any part of your input file a line like this:

. ~/LoptFnc/UpdateProfile.fnc

Any of these two posibilities would redefine the function UpdateProfile
that likely causes
the error you found. This function is active when the FIXINDEX keyword
is used in the
profile, and it doesn't work in the case of basis set optimization.

  function UpdateProfile {

        /bin/ksh -p $inp $* | awk '

        BEGIN { str["GEOM"]="ENDG" ; str["BASE"]="ENDBS"
                str["GEBA"]="ENDBS" }

        /GEOM/ || /BASE/ || /GEBA/ \
                        {
                          end=str[$1]
                          getline y
                          x = y
                          while ( getline == 1 )
                            if ( $1 != "STOP" ) x=x"\n"$0
                          }
        END             { 
                          z = ""
                          w = ""
                          getline < fn
                          while ( $0 !~ y )
                                { z = z""w""$0
                                  getline < fn
                                  w = "\n"
                                  }
                          while ( $0 !~ end ) getline < fn
                          getline w < fn
                          while ( getline < fn == 1 ) w = w"\n"$0
                          print z"\n"x"\n"w > fn
                           }
                                      ' fn=$inp

        istart=""

        return $?
  }