Changeset 6351

Show
Ignore:
Timestamp:
03/11/10 20:01:22 (6 months ago)
Author:
dstrubbe
Message:

*) Added option for verbose SCF output from finite-difference calculation.
*) Corrected condition for redoing all dipoles given requested output.
*) Added missing deallocation.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/main/static_pol.F90

    r6349 r6351  
    6868    type(states_t), pointer :: st 
    6969 
    70     integer :: iunit, ios, i_start, ii, jj, is, isign, ierr, read_count 
     70    integer :: iunit, ios, i_start, ii, jj, is, isign, ierr, read_count, verbosity 
    7171    FLOAT :: e_field 
    7272    FLOAT, allocatable :: Vpsl_save(:), trrho(:), dipole(:, :, :) 
     
    7575    FLOAT :: center_dipole(1:MAX_DIM), diag_dipole(1:MAX_DIM), ionic_dipole(1:MAX_DIM), print_dipole(1:MAX_DIM) 
    7676    type(born_charges_t) :: born_charges 
    77     logical :: calc_Born, start_density_is_zero_field, write_restart_densities, calc_diagonal 
     77    logical :: calc_Born, start_density_is_zero_field, write_restart_densities, calc_diagonal, verbose 
    7878    logical :: diagonal_done, center_written, fromScratch_local 
    7979    character(len=80) :: fname, dir_name 
     
    144144 
    145145    if(iand(sys%outp%what, output_density) .ne. 0 .or. & 
    146        iand(sys%outp%what, output_pol_density) .ne. 0 .or. calc_Born) then 
    147        i_start = 1 
    148        diagonal_done = .false. 
     146       iand(sys%outp%what, output_pol_density) .ne. 0) then 
     147       if(i_start .gt. 2 .and. calc_diagonal) then 
     148          i_start = 2 
     149          diagonal_done = .false. 
     150          !FIXME: take derivatives between yz and z (not y) so can restart from only last (z) calc 
     151       endif 
    149152    endif 
    150153 
     
    187190    write(message(2), '(a)') 'Info: Calculating dipole moment for zero field.' 
    188191    call write_info(2) 
    189     call scf_run(scfv, sys%gr, sys%geo, st, sys%ks, hm, sys%outp, gs_run=.false., verbosity = VERB_COMPACT) 
     192    call scf_run(scfv, sys%gr, sys%geo, st, sys%ks, hm, sys%outp, gs_run=.false., verbosity = verbosity) 
    190193 
    191194    gs_rho(1:gr%mesh%np, 1:st%d%nspin) = st%rho(1:gr%mesh%np, 1:st%d%nspin) 
     
    252255 
    253256        call scf_mix_clear(scfv) 
    254         call scf_run(scfv, sys%gr, sys%geo, st, sys%ks, hm, sys%outp, gs_run=.false., verbosity = VERB_COMPACT) 
     257        call scf_run(scfv, sys%gr, sys%geo, st, sys%ks, hm, sys%outp, gs_run=.false., verbosity = verbosity) 
    255258 
    256259        trrho = M_ZERO 
     
    329332 
    330333      call scf_mix_clear(scfv) 
    331       call scf_run(scfv, sys%gr, sys%geo, st, sys%ks, hm, sys%outp, gs_run=.false., verbosity = VERB_COMPACT) 
     334      call scf_run(scfv, sys%gr, sys%geo, st, sys%ks, hm, sys%outp, gs_run=.false., verbosity = verbosity) 
    332335   
    333336      trrho = M_ZERO 
     
    441444      !%End 
    442445      call parse_logical(datasets_check('EMWriteRestartDensities'), .true., write_restart_densities) 
     446 
     447      !%Variable EMVerbose 
     448      !%Type logical 
     449      !%Default false 
     450      !%Section Linear Response::Static Polarization 
     451      !%Description 
     452      !% Write full SCF output. 
     453      !% Only applies if <tt>ResponseMethod = finite_differences</tt>. 
     454      !%End 
     455      call parse_logical(datasets_check('EMVerbose'), .false., verbose) 
     456 
     457      if(verbose) then 
     458        verbosity = VERB_FULL 
     459      else 
     460        verbosity = VERB_COMPACT 
     461      endif 
    443462 
    444463      call pop_sub() 
     
    662681         iand(sys%outp%what, output_pol_density) .ne. 0) then  
    663682        SAFE_DEALLOCATE_A(lr_rho) 
     683        SAFE_DEALLOCATE_A(lr_rho2) 
    664684      end if 
    665685