@SET PS   IMPLICIT
@SET BC   PERIODIC
@SET Diag 0
@SET OT   1
@SET LS   off
@SET RST  off
&GLOBAL
  PRINT_LEVEL MEDIUM
  PROJECT Ar_periodic
  RUN_TYPE ENERGY
&END GLOBAL

&FORCE_EVAL
  METHOD Quickstep
  &DFT
    BASIS_SET_FILE_NAME BASIS_MOLOPT
    POTENTIAL_FILE_NAME GTH_POTENTIALS
    &LS_SCF
      EPS_FILTER 1.0E-7
      EPS_SCF 1.0E-7
      MAX_SCF 30
      MIXING_FRACTION 0.45
      MU -0.20
      PERFORM_MU_SCAN off
      PURIFICATION_METHOD TRS4
      REPORT_ALL_SPARSITIES off
      S_PRECONDITIONER NONE
    &END LS_SCF
    &MGRID
      CUTOFF 200
      NGRIDS 4
      &RS_GRID
        DISTRIBUTION_TYPE DISTRIBUTED
      &END RS_GRID
    &END MGRID
    &POISSON
      POISSON_SOLVER ${PS}
      &IMPLICIT
        BOUNDARY_CONDITIONS ${BC}
        MAX_ITER 300
        OR_PARAMETER 1.0
        TOL 1.0E-8
        &DIELECTRIC
          DERIVATIVE_METHOD fft_use_deps
          DIELECTRIC_CONSTANT 1.50
          RHO_MAX 1.0E-3
          RHO_MIN 1.0E-4
        &END DIELECTRIC
      &END IMPLICIT
    &END POISSON
    &PRINT
      &IMPLICIT_PSOLVER
        &DIELECTRIC_CUBE off
          STRIDE 1 1 1
        &END DIELECTRIC_CUBE
      &END IMPLICIT_PSOLVER
      &V_HARTREE_CUBE off
        STRIDE 1 1 1
      &END V_HARTREE_CUBE
    &END PRINT
    &QS
      EPS_DEFAULT 1.0E-10
      LS_SCF ${LS}
      &DISTRIBUTION
        BASIC_OPTIMIZATION .FALSE.
        BASIC_SPATIAL_OPTIMIZATION .TRUE.
      &END DISTRIBUTION
    &END QS
    &SCF
      @IF ${Diag}
      SCF_GUESS ATOMIC
      MAX_SCF 300
      EPS_SCF 1.0E-5
      &MIXING
        ALPHA 0.2
      &END MIXING
      @ENDIF
      @IF ${OT}
      SCF_GUESS ATOMIC
      MAX_SCF 31
      EPS_SCF 1.0E-6
      &OT
        MINIMIZER DIIS
        PRECONDITIONER FULL_SINGLE_INVERSE
      &END OT
      &OUTER_SCF
        EPS_SCF 1.0E-6
        MAX_SCF 50
      &END OUTER_SCF
      @ENDIF
      &PRINT
        &RESTART ${RST}
          BACKUP_COPIES 0
          &EACH
            QS_SCF 10
          &END EACH
        &END RESTART
      &END PRINT
    &END SCF
    &XC
      &XC_FUNCTIONAL PBE
      &END XC_FUNCTIONAL
    &END XC
  &END DFT
  &SUBSYS
    &CELL
      ABC 8.0 8.0 8.0
    &END CELL
    &COORD
      Ar        4.0000000000        4.0000000000        4.0000000000
    &END COORD
    &KIND Ar
      BASIS_SET DZVP-MOLOPT-SR-GTH
      POTENTIAL GTH-PBE-q8
    &END KIND
  &END SUBSYS
&END FORCE_EVAL
