TABLE OF CONTENTS


ABINIT/chkvars [ Functions ]

[ Top ] [ Functions ]

NAME

 chkvars

FUNCTION

  Examines the input string, to check whether all names are allowed.

INPUTS

  string*(*)=string of character
   the string (with upper case) from the input file, to which the XYZ data is (possibly) appended

OUTPUT

PARENTS

      abinit

CHILDREN

SOURCE

2349 subroutine chkvars (string)
2350 
2351 
2352 !This section has been created automatically by the script Abilint (TD).
2353 !Do not modify the following lines by hand.
2354 #undef ABI_FUNC
2355 #define ABI_FUNC 'chkvars'
2356 !End of the abilint section
2357 
2358  implicit none
2359 
2360 !Arguments ------------------------------------
2361 !scalars
2362  character(len=*),intent(in) :: string
2363 
2364 !Local variables-------------------------------
2365 !scalars
2366  integer,parameter :: protocol1=1
2367  character(len=100) :: list_logicals,list_strings
2368  character(len=10000) :: list_vars
2369 
2370 !************************************************************************
2371 
2372 
2373 !Here, list all admitted variable names (max 10 per line, to fix the ideas)
2374 !Note: Do not use "double quotation mark" for the string since it triggers a bug in docchk.py (abirules script)
2375 !<ABINIT_VARS>
2376 !A
2377  list_vars=                 ' accuracy acell adpimd adpimd_gamma'
2378  list_vars=trim(list_vars)//' algalch amu angdeg asr atvshift autoparal'
2379  list_vars=trim(list_vars)//' auxc_ixc auxc_scal awtr'
2380 !B
2381  list_vars=trim(list_vars)//' bandpp bdberry bdeigrf bdgw berryopt berrysav berrystep bfield bmass'
2382  list_vars=trim(list_vars)//' boxcenter boxcutmin brvltt builtintest'
2383  list_vars=trim(list_vars)//' bound_SPCoupling bound_anhaStrain bound_cell bound_cutoff'
2384  list_vars=trim(list_vars)//' bound_maxCoeff bound_model bound_rangePower bound_step bound_temp'
2385  list_vars=trim(list_vars)//' bs_algorithm bs_calctype bs_coulomb_term bs_coupling'
2386  list_vars=trim(list_vars)//' bs_interp_kmult bs_interp_m3_width bs_interp_method bs_interp_mode bs_interp_prep'
2387  list_vars=trim(list_vars)//' bs_interp_rl_nb bs_eh_cutoff bs_exchange_term bs_freq_mesh'
2388  list_vars=trim(list_vars)//' bs_haydock_niter bs_haydock_tol bs_hayd_term'
2389  list_vars=trim(list_vars)//' bs_loband bs_nstates'
2390  list_vars=trim(list_vars)//' bxctmindg'
2391 !C
2392  list_vars=trim(list_vars)//' cd_customnimfrqs cd_frqim_method cd_full_grid cd_imfrqs'
2393  list_vars=trim(list_vars)//' cd_halfway_freq cd_max_freq cd_subset_freq'
2394  list_vars=trim(list_vars)//' charge chempot chkdilatmx chkexit chkprim'
2395  list_vars=trim(list_vars)//' chksymbreak chneut cineb_start coefficients cpus cpum cpuh'
2396 !D
2397  list_vars=trim(list_vars)//' ddamp ddb_ngqpt ddb_shiftq delayperm densfor_pred densty dfield'
2398  list_vars=trim(list_vars)//' dfpt_sciss diecut diegap dielam dielng diemac'
2399  list_vars=trim(list_vars)//' diemix diemixmag diismemory dilatmx dipdip  dipdip_prt dipdip_range'
2400  list_vars=trim(list_vars)//' dmatpawu dmatpuopt dmatudiag'
2401  list_vars=trim(list_vars)//' dmft_entropy dmft_nlambda'
2402  list_vars=trim(list_vars)//' dmft_dc dmft_iter dmft_mxsf dmft_nwli dmft_nwlo'
2403  list_vars=trim(list_vars)//' dmft_read_occnd dmft_rslf dmft_solv dmft_t2g'
2404  list_vars=trim(list_vars)//' dmft_tolfreq dmft_tollc dmftbandi dmftbandf dmftctqmc_basis'
2405  list_vars=trim(list_vars)//' dmftctqmc_check dmftctqmc_correl dmftctqmc_gmove'
2406  list_vars=trim(list_vars)//' dmftctqmc_grnns dmftctqmc_meas dmftctqmc_mrka'
2407  list_vars=trim(list_vars)//' dmftctqmc_mov dmftctqmc_order dmftctqmc_triqs_nleg'
2408  list_vars=trim(list_vars)//' dmftcheck dmftqmc_l dmftqmc_n dmftqmc_seed dmftqmc_therm'
2409  list_vars=trim(list_vars)//' dosdeltae dtion dynamics dynimage'
2410  list_vars=trim(list_vars)//' d3e_pert1_atpol d3e_pert1_dir d3e_pert1_elfd d3e_pert1_phon'
2411  list_vars=trim(list_vars)//' d3e_pert2_atpol d3e_pert2_dir d3e_pert2_elfd d3e_pert2_phon'
2412  list_vars=trim(list_vars)//' d3e_pert3_atpol d3e_pert3_dir d3e_pert3_elfd d3e_pert3_phon'
2413 !E
2414  list_vars=trim(list_vars)//' ecut ecuteps ecutsigx ecutsm ecutwfn effmass_free efmas'
2415  list_vars=trim(list_vars)//' efmas_bands efmas_calc_dirs efmas_deg efmas_deg_tol'
2416  list_vars=trim(list_vars)//' efmas_dim efmas_dirs efmas_n_dirs efmas_ntheta'
2417  list_vars=trim(list_vars)//' efield einterp elph2_imagden energy_reference enunit eshift'
2418  list_vars=trim(list_vars)//' esmear exchmix exchn2n3d extrapwf eph_frohlichm'
2419  list_vars=trim(list_vars)//' eph_intmeth eph_extrael eph_fermie eph_frohlich eph_fsmear'
2420  list_vars=trim(list_vars)//' eph_fsewin eph_mustar eph_ngqpt_fine eph_task eph_transport'
2421 !F
2422  list_vars=trim(list_vars)//' fband fermie_nest'
2423  list_vars=trim(list_vars)//' fftalg fftcache fftgw'
2424  list_vars=trim(list_vars)//' fit_SPCoupling fit_anhaStrain fit_bancoeff fit_coeff fit_cutoff fit_fixcoeff'
2425  list_vars=trim(list_vars)//' fit_generateCoeff fit_initializeData fit_nbancoeff fit_ncoeff fit_nfixcoeff'
2426  list_vars=trim(list_vars)//' fit_rangePower fit_tolMSDE fit_tolMSDF fit_tolMSDFS fit_tolMSDS'
2427  list_vars=trim(list_vars)//' fockoptmix focktoldfe fockdownsampling'
2428  list_vars=trim(list_vars)//' freqim_alpha freqremax freqremin freqspmax'
2429  list_vars=trim(list_vars)//' freqspmin'
2430  list_vars=trim(list_vars)//' friction frzfermi fxcartfactor '
2431  list_vars=trim(list_vars)//' f4of2_sla f6of2_sla'
2432 !G
2433  list_vars=trim(list_vars)//' ga_algor ga_fitness ga_n_rules ga_opt_percent ga_rules'
2434  list_vars=trim(list_vars)//' genafm getbscoup getbseig getbsreso getcell'
2435  list_vars=trim(list_vars)//' getddb getddk getdelfd getdkdk getdkde getden getefmas getgam_eig2nkq'
2436  list_vars=trim(list_vars)//' gethaydock getocc getpawden getqps getscr'
2437  list_vars=trim(list_vars)//' getwfkfine'
2438  list_vars=trim(list_vars)//' getsuscep '
2439  list_vars=trim(list_vars)//' getvel getwfk getwfq getxcart getxred'
2440  list_vars=trim(list_vars)//' get1den get1wf goprecon goprecprm'
2441  list_vars=trim(list_vars)//' gpu_devices gpu_linalg_limit gwcalctyp gwcomp gwencomp gwgamma gwmem'
2442  list_vars=trim(list_vars)//' gwpara gwrpacorr gw_customnfreqsp'
2443  list_vars=trim(list_vars)//' gw_frqim_inzgrid gw_frqre_inzgrid gw_frqre_tangrid gw_freqsp'
2444  list_vars=trim(list_vars)//' gw_invalid_freq '
2445  list_vars=trim(list_vars)//' gw_qprange gw_nqlwl gw_nstep gw_qlwl'
2446  list_vars=trim(list_vars)//' gw_sctype gw_sigxcore gw_toldfeig'
2447  list_vars=trim(list_vars)//' gwls_stern_kmax gwls_kmax_complement gwls_kmax_poles'
2448  list_vars=trim(list_vars)//' gwls_kmax_analytic gwls_kmax_numeric'
2449  list_vars=trim(list_vars)//' gwls_list_proj_freq gwls_nseeds gwls_n_proj_freq gwls_recycle'
2450  list_vars=trim(list_vars)//' gwls_first_seed gwls_model_parameter gwls_npt_gauss_quad'
2451  list_vars=trim(list_vars)//' gwls_diel_model gwls_print_debug gwls_band_index gwls_exchange gwls_correlation'
2452 !H
2453  list_vars=trim(list_vars)//' hmcsst hmctt hyb_mixing hyb_mixing_sr hyb_range_dft hyb_range_fock'
2454 !I
2455  list_vars=trim(list_vars)//' iatcon iatfix iatfixx iatfixy iatfixz iatsph'
2456  list_vars=trim(list_vars)//' iboxcut icoulomb icutcoul ieig2rf'
2457  list_vars=trim(list_vars)//' imgmov imgwfstor inclvkb intxc iomode ionmov iqpt'
2458  list_vars=trim(list_vars)//' iprcel iprcfc irandom irdbscoup'
2459  list_vars=trim(list_vars)//' irdbseig irdbsreso irdddb irdddk irdden irdefmas'
2460  list_vars=trim(list_vars)//' irdhaydock irdpawden irdqps'
2461  list_vars=trim(list_vars)//' irdscr irdsuscep irdwfk irdwfq ird1den'
2462  list_vars=trim(list_vars)//' irdwfkfine'
2463  list_vars=trim(list_vars)//' ird1wf iscf isecur istatimg istatr'
2464  list_vars=trim(list_vars)//' istatshft istwfk ixc ixc_sigma ixcpositron ixcrot'
2465  list_vars=trim(list_vars)//' irdvdw'
2466 !J
2467  list_vars=trim(list_vars)//' jdtset jellslab jfielddir jpawu'
2468 !K
2469  list_vars=trim(list_vars)//' kberry kpt kptbounds kptgw'
2470  list_vars=trim(list_vars)//' kptnrm kptopt kptrlatt kptrlen kssform'
2471 !L
2472  list_vars=trim(list_vars)//' ldaminushalf lexexch localrdwf lpawu'
2473  list_vars=trim(list_vars)//' lotf_classic lotf_nitex lotf_nneigx lotf_version'
2474 !M
2475  list_vars=trim(list_vars)//' max_ncpus macro_uj maxestep maxnsym mdf_epsinf mdtemp mdwall'
2476  list_vars=trim(list_vars)//' magconon magcon_lambda mbpt_sciss'
2477  list_vars=trim(list_vars)//' mep_mxstep mep_solver mem_test mixalch mixesimgf'
2478  list_vars=trim(list_vars)//' mqgrid mqgriddg'
2479 !N
2480  list_vars=trim(list_vars)//' natcon natfix natfixx natfixy natfixz'
2481  list_vars=trim(list_vars)//' natom natrd natsph natsph_extra natvshift nband nbandkss nbandhf'
2482  list_vars=trim(list_vars)//' ncell ncoeff nbdblock nbdbuf nberry nconeq nc_xccc_gspace'
2483  list_vars=trim(list_vars)//' nctime ndivk ndivsm ndtset neb_algo neb_spring'
2484  list_vars=trim(list_vars)//' nfreqim nfreqre nfreqsp ngfft ngfftdg'
2485  list_vars=trim(list_vars)//' ngkpt ngqpt nimage nkpath nkpt nkptgw nkpthf'
2486  list_vars=trim(list_vars)//' nline nloc_alg nloc_mem nnos nnsclo nnsclohf'
2487  list_vars=trim(list_vars)//' nobj nomegasf nomegasi nomegasrd nonlinear_info noseinert npband'
2488  list_vars=trim(list_vars)//' npfft nphf nph1l npimage npkpt nppert npsp npspinor'
2489  list_vars=trim(list_vars)//' npulayit npvel npwkss'
2490  list_vars=trim(list_vars)//' np_slk nqpt nqptdm nscforder nshiftk nshiftq nqshft'
2491  list_vars=trim(list_vars)//' nspden nspinor nsppol nstep nsym'
2492  list_vars=trim(list_vars)//' ntime ntimimage ntypalch ntypat nucdipmom nwfshist nzchempot'
2493 !O
2494  list_vars=trim(list_vars)//' objaat objbat objaax objbax objan objbn objarf'
2495  list_vars=trim(list_vars)//' objbrf objaro objbro objatr objbtr occ'
2496  list_vars=trim(list_vars)//' occopt omegasimax omegasrdmax optcell optdriver optforces'
2497  list_vars=trim(list_vars)//' optnlxccc optstress orbmag ortalg'
2498 !P
2499  list_vars=trim(list_vars)//' paral_atom paral_kgb paral_rf pawcpxocc pawcross'
2500  list_vars=trim(list_vars)//' pawecutdg pawfatbnd pawlcutd pawlmix'
2501  list_vars=trim(list_vars)//' pawmixdg pawnhatxc pawnphi pawntheta pawnzlm pawoptmix pawoptosc pawovlp'
2502  list_vars=trim(list_vars)//' pawprtdos pawprtvol pawprtwf pawprt_b pawprt_k pawspnorb pawstgylm'
2503  list_vars=trim(list_vars)//' pawsushat pawujat pawujrad pawujv'
2504  list_vars=trim(list_vars)//' pawusecp pawxcdev pimass pimd_constraint'
2505 !XG 20180927 : The developments for which these input variables have been introduced have barely started. They are
2506 !temporarily disabled, as being not documented and not tested for the v8.10 release.
2507 !list_vars=trim(list_vars)//' ph_freez_disp_addStrain'
2508 !list_vars=trim(list_vars)//' ph_freez_disp_option ph_freez_disp_nampl ph_freez_disp_ampl'
2509  list_vars=trim(list_vars)//' pitransform ph_ndivsm ph_nqpath ph_qpath ph_ngqpt'
2510  list_vars=trim(list_vars)//' ph_wstep ph_intmeth ph_smear ph_nqshift ph_qshift'
2511  list_vars=trim(list_vars)//' plowan_bandi plowan_bandf plowan_compute plowan_iatom plowan_it plowan_lcalc'
2512  list_vars=trim(list_vars)//' plowan_natom plowan_nbl plowan_nt plowan_projcalc plowan_realspace'
2513  list_vars=trim(list_vars)//' polcen posdoppler positron posnstep posocc postoldfe postoldff ppmfrq ppmodel'
2514  list_vars=trim(list_vars)//' prepanl prepgkk papiopt'
2515  list_vars=trim(list_vars)//' prtatlist prtbbb prtbltztrp prtcif prtden'
2516  list_vars=trim(list_vars)//' prtdensph prtdipole prtdos prtdosm prtebands prtefg prtefmas prteig prtelf'
2517  list_vars=trim(list_vars)//' prtfc prtfull1wf prtfsurf prtgden prtgeo prtgsr prtgkk prtkden prtkpt prtlden'
2518  list_vars=trim(list_vars)//' prt_model prtnabla prtnest prtphbands prtphdos prtphsurf prtposcar prtpot prtpsps'
2519  list_vars=trim(list_vars)//' prtspcur prtstm prtsuscep prtvclmb prtvha prtvdw prtvhxc prtkbff'
2520  list_vars=trim(list_vars)//' prtvol prtvpsp prtvxc prtwant prtwf prtwf_full prtxml prt1dm ptcharge'
2521  list_vars=trim(list_vars)//' pvelmax pw_unbal_thresh'
2522 !Q
2523  list_vars=trim(list_vars)//' q1shft qmass qprtrb qpt qptdm qptnrm qph1l'
2524  list_vars=trim(list_vars)//' qptopt qptrlatt quadmom'
2525 !R
2526  list_vars=trim(list_vars)//' random_atpos ratsph ratsph_extra rcut'
2527  list_vars=trim(list_vars)//' recefermi recgratio recnpath recnrec recptrott recrcut rectesteg rectolden'
2528  list_vars=trim(list_vars)//' red_dfield red_efield red_efieldbar restartxf rfasr'
2529  list_vars=trim(list_vars)//' rfatpol rfddk rfdir rfelfd rfmagn rfmeth rfphon'
2530  list_vars=trim(list_vars)//' rfstrs rfuser rf2_dkdk rf2_dkde rf2_pert1_dir rf2_pert2_dir rhoqpmix rprim'
2531  !These input parameters are obsolete (keep them for compatibility)
2532  list_vars=trim(list_vars)//' rf1atpol rf1dir rf1elfd rf1phon'
2533  list_vars=trim(list_vars)//' rf2atpol rf2dir rf2elfd rf2phon'
2534  list_vars=trim(list_vars)//' rf3atpol rf3dir rf3elfd rf3phon'
2535 !S
2536  list_vars=trim(list_vars)//' scalecart shiftk shiftq signperm'
2537  list_vars=trim(list_vars)//' slabwsrad slabzbeg slabzend slk_rankpp smdelta so_psp'
2538  list_vars=trim(list_vars)//' spbroad spgaxor spgorig spgroup spgroupma'
2539  list_vars=trim(list_vars)//' spin_dipdip spin_dt spin_dynamics spin_mag_field spin_nctime spin_ntime'
2540  list_vars=trim(list_vars)//' spin_n1l spin_n2l spin_qpoint spin_temperature spin_tolavg spin_tolvar'
2541  list_vars=trim(list_vars)//' spinat spinmagntarget spmeth'
2542  list_vars=trim(list_vars)//' spnorbscl stmbias strfact string_algo strprecon strtarget'
2543  list_vars=trim(list_vars)//' supercell_latt symafm symchi symdynmat symmorphi symrel symsigma'
2544 !T
2545  list_vars=trim(list_vars)//' td_maxene td_mexcit tfkinfunc temperature tfw_toldfe tim1rev timopt tl_nprccg tl_radius'
2546  list_vars=trim(list_vars)//' tmesh tnons toldfe tolmxde toldff tolimg tolmxf tolrde tolrff tolsym'
2547  list_vars=trim(list_vars)//' tolvrs tolwfr tphysel ts_option tsmear typat'
2548 !U
2549  list_vars=trim(list_vars)//' ucrpa ucrpa_bands ucrpa_window udtset upawu usepead usedmatpu '
2550  list_vars=trim(list_vars)//' usedmft useexexch usekden use_nonscf_gkk usepawu usepotzero'
2551  list_vars=trim(list_vars)//' useria userib useric userid userie'
2552  list_vars=trim(list_vars)//' userra userrb userrc userrd userre'
2553  list_vars=trim(list_vars)//' usewvl usexcnhat useylm use_gemm_nonlop use_gpu_cuda use_slk'
2554 !V
2555  list_vars=trim(list_vars)//' vaclst vacnum vacuum vacwidth vcutgeo'
2556  list_vars=trim(list_vars)//' vdw_nfrag vdw_supercell'
2557  list_vars=trim(list_vars)//' vdw_tol vdw_tol_3bt vdw_typfrag vdw_xc'
2558  list_vars=trim(list_vars)//' vdw_df_acutmin vdw_df_aratio vdw_df_damax'
2559  list_vars=trim(list_vars)//' vdw_df_damin vdw_df_dcut vdw_df_dratio'
2560  list_vars=trim(list_vars)//' vdw_df_dsoft vdw_df_gcut'
2561  list_vars=trim(list_vars)//' vdw_df_ndpts vdw_df_ngpts vdw_df_nqpts'
2562  list_vars=trim(list_vars)//' vdw_df_nrpts vdw_df_nsmooth vdw_df_phisoft vdw_df_qcut'
2563  list_vars=trim(list_vars)//' vdw_df_qratio vdw_df_rcut vdw_df_rsoft'
2564  list_vars=trim(list_vars)//' vdw_df_threshold vdw_df_tolerance'
2565  list_vars=trim(list_vars)//' vdw_df_tweaks vdw_df_zab'
2566  list_vars=trim(list_vars)//' vel vel_cell vis vprtrb'
2567 !W
2568  list_vars=trim(list_vars)//' wfmix wfoptalg wtatcon wtk wtq'
2569  list_vars=trim(list_vars)//' wvl_bigdft_comp wvl_crmult wvl_frmult wvl_hgrid wvl_ngauss wvl_nprccg'
2570  list_vars=trim(list_vars)//' w90iniprj w90prtunk'
2571 !X
2572  list_vars=trim(list_vars)//' xangst xcart xc_denpos xc_tb09_c xred xredsph_extra xyzfile'
2573 !Y
2574 !Z
2575  list_vars=trim(list_vars)//' zcut zeemanfield znucl'
2576 
2577 !Logical input variables
2578  list_logicals=' SpinPolarized'
2579 
2580 !String input variables
2581  list_strings=' XCname wfk_task'
2582 !</ABINIT_VARS>
2583 
2584 !Extra token, also admitted :
2585 !<ABINIT_UNITS>
2586  list_vars=trim(list_vars)//' au Angstr Angstrom Angstroms Bohr Bohrs eV Ha'
2587  list_vars=trim(list_vars)//' Hartree Hartrees K Ry Rydberg Rydbergs T Tesla'
2588 !</ABINIT_UNITS>
2589 
2590 !<ABINIT_OPERATORS>
2591  list_vars=trim(list_vars)//' sqrt end'
2592 !</ABINIT_OPERATORS>
2593 
2594 !Transform to upper case
2595  call inupper(list_vars)
2596  call inupper(list_logicals)
2597  call inupper(list_strings)
2598 
2599  call chkvars_in_string(protocol1, list_vars, list_logicals, list_strings, string)
2600 
2601 end subroutine chkvars

ABINIT/m_dtset [ Modules ]

[ Top ] [ Modules ]

NAME

  m_dtset

FUNCTION

COPYRIGHT

 Copyright (C) 1992-2018 ABINIT group (XG, MG, FJ, DCA, MT)
 This file is distributed under the terms of the
 GNU General Public License, see ~abinit/COPYING
 or http://www.gnu.org/copyleft/gpl.txt .
 For the initials of contributors, see ~abinit/doc/developers/contributors.txt .

SOURCE

17 #if defined HAVE_CONFIG_H
18 #include "config.h"
19 #endif
20 
21 #include "abi_common.h"
22 
23 MODULE m_dtset
24 
25  use defs_basis
26  use m_abicore
27  use m_copy
28  use m_errors
29  use m_xmpi
30 
31  use m_fstrings,     only : inupper
32  use m_symtk,        only : mati3inv, littlegroup_q, symatm
33  use m_geometry,     only : mkrdim, metric, littlegroup_pert, irreducible_set_pert
34  use m_parser,       only : intagm, chkvars_in_string
35  use defs_abitypes,  only : dataset_type
36 
37  implicit none
38 
39  private
40 
41  public :: dtset_chkneu
42  public :: dtset_copy
43  public :: dtset_free
44  public :: find_getdtset     ! Find the number of the dataset (iget) for a given value of a "get" variable (getvalue)
45  public :: get_npert_rbz     ! Get the number of effective pertubation done in looper3, nkpt_rbz, nband_rbz
46  public :: testsusmat        ! Test wether a new susceptibility matrix and/or a new dielectric matrix must be computed
47  public :: macroin           ! Treat "macro" input variables
48  public :: macroin2
49  public :: chkvars           !  Examines the input string, to check whether all names are allowed.
50 
51 CONTAINS  !==============================================================================

m_dtset/dtset_chkneu [ Functions ]

[ Top ] [ m_dtset ] [ Functions ]

NAME

 dtset_chkneu

FUNCTION

 Check neutrality of system based on band occupancies and
 valence charges of pseudo-atoms.
 Eventually initialize occ if occopt==1 or 3...8
 Also return nelect, the number of valence electron per unit cell

INPUTS

  charge=number of electrons missing (+) or added (-) to system (usually 0)
  dtset <type(dataset_type)>=all input variables in this dataset
   | iscf= if>0, SCF calculation ; if<=0, non SCF calculation (wtk might
   |  not be defined)
   | natom=number of atoms in unit cell
   | nband(nkpt*nsppol)=number of bands at each k point
   | nkpt=number of k points
   | nspinor=number of spinorial components of the wavefunctions
   | nsppol=1 for unpolarized, 2 for spin-polarized
   | ntypat=number of pseudopotentials
   | positron=0 if electron GS calculation
   |          1 if positron GS calculation
   |          2 if electron GS calcultaion in presence of the positron
   | typat(natom)=atom type (integer) for each atom
   | wtk(nkpt)=k point weights (defined if iscf>0 or iscf==-3)
   | ziontypat(ntypat)=ionic charge of each pseudoatom
  occopt=option for occupancies

OUTPUT

  Writes warning and/or aborts if error condition exists
  dtset <type(dataset_type)>=all input variables in this dataset
   | nelect=number of valence electrons per unit cell
   |  (from counting valence electrons in psps, and taking into
   |   account the input variable "charge")

SIDE EFFECTS

 Input/Output :
  dtset <type(dataset_type)>=all input variables in this dataset
   | occ_orig(dtset%nband(1)*nkpt*nsppol,nimage)=occupation numbers for each band and k point
   |   must be input for occopt==0 or 2,
   |   will be an output for occopt==1 or 3 ... 8

PARENTS

      invars2

CHILDREN

SOURCE

104 subroutine dtset_chkneu(charge,dtset,occopt)
105 
106 
107 !This section has been created automatically by the script Abilint (TD).
108 !Do not modify the following lines by hand.
109 #undef ABI_FUNC
110 #define ABI_FUNC 'dtset_chkneu'
111 !End of the abilint section
112 
113  implicit none
114 
115 !Arguments ------------------------------------
116 !scalars
117  integer,intent(in) :: occopt
118  real(dp),intent(in) :: charge
119  type(dataset_type),intent(inout) :: dtset
120 
121 !Local variables-------------------------------
122 !scalars
123  integer :: bantot,iatom,iband,ii,iimage,ikpt,isppol,nocc
124  real(dp) :: maxocc,nelect_occ,nelect_spin,occlast,sign_spin,zval
125  character(len=500) :: message
126 !arrays
127  real(dp),allocatable :: tmpocc(:)
128 
129 ! *************************************************************************
130 
131 !(1) count nominal valence electrons according to ziontypat
132  zval=zero
133  do iatom=1,dtset%natom
134    zval=zval+dtset%ziontypat(dtset%typat(iatom))
135  end do
136  if (dtset%positron/=1) then
137    dtset%nelect=zval-charge
138  else
139    dtset%nelect=one
140  end if
141 
142 ! write(std_out,*)ch10
143 ! write(std_out,*)' chkneu : enter, dtset%nelect=',dtset%nelect
144 ! write(std_out,*)' occopt,dtset%nsppol,dtset%nspden=',occopt,dtset%nsppol,dtset%nspden
145 
146 !(2) Optionally initialize occ with semiconductor occupancies
147 !(even for a metal : at this stage, the eigenenergies are unknown)
148 !Note that nband(1)=nband(2) in this section, as occopt=2 is avoided.
149  if(occopt==1 .or. (occopt>=3 .and. occopt<=8) )then
150 !  Here, initialize a real(dp) variable giving the
151 !  maximum occupation number per band
152    maxocc=2.0_dp/real(dtset%nsppol*dtset%nspinor,dp)
153 
154 !  Determine the number of bands fully or partially occupied
155    nocc=(dtset%nelect-1.0d-8)/maxocc + 1
156 !  Occupation number of the highest level
157    occlast=dtset%nelect-maxocc*(nocc-1)
158 
159    !write(std_out,*)' maxocc,nocc,occlast=',maxocc,nocc,occlast
160 
161 
162 !  The number of allowed bands must be sufficiently large
163    if( nocc<=dtset%nband(1)*dtset%nsppol .or. dtset%iscf==-2) then
164 
165      if(dtset%iscf==-2 .and. nocc>dtset%nband(1)*dtset%nsppol)nocc=dtset%nband(1)*dtset%nsppol
166 
167 !    First treat the case where the spin magnetization is not imposed, is zero with nspden==1, or has sufficient flexibility
168 !    for a target not to be matched at the initialisation, but later
169      if(abs(dtset%spinmagntarget+99.99_dp)<tol8 .or. (dtset%nspden==4) .or. &
170 &     (abs(dtset%spinmagntarget)<tol8.and.dtset%nspden==1))then
171 
172 !      Use a temporary array for defining occupation numbers
173        ABI_ALLOCATE(tmpocc,(dtset%nband(1)*dtset%nsppol))
174 !      First do it for fully occupied bands
175        if (1<nocc) tmpocc(1:nocc-1)=maxocc
176 !      Then, do it for highest occupied band
177        if (1<=nocc) tmpocc(nocc)=occlast
178 !      Finally do it for eventual unoccupied bands
179        if ( nocc<dtset%nband(1)*dtset%nsppol ) tmpocc(nocc+1:dtset%nband(1)*dtset%nsppol)=0.0_dp
180 
181 !      Now copy the tmpocc array in the occ array, taking into account the spin
182        if(dtset%nsppol==1)then
183          do ikpt=1,dtset%nkpt
184            do iband=1,dtset%nband(1)
185              dtset%occ_orig(iband+(ikpt-1)*dtset%nband(1),:)=tmpocc(iband)
186            enddo
187          end do
188        else
189          do ikpt=1,dtset%nkpt
190            do iband=1,dtset%nband(1)
191              do isppol=1,dtset%nsppol
192                dtset%occ_orig(iband+dtset%nband(1)*(ikpt-1+dtset%nkpt*(isppol-1)),:) =  &
193 &               tmpocc(isppol+dtset%nsppol*(iband-1))
194              end do
195            end do
196          end do
197        end if
198        ABI_DEALLOCATE(tmpocc)
199 
200 !      Second, treat the case in which one imposes the spin magnetization (only possible for nspden==2)
201 !      Also treat antiferromagnetic case (nsppol==1, nspden==2), although spinmagntarget must be zero
202      else if(abs(dtset%spinmagntarget+99.99_dp)>1.0d-10)then
203        do isppol=1,dtset%nsppol
204          sign_spin=real(3-2*isppol,dp)
205          nelect_spin=half*(dtset%nelect*maxocc+sign_spin*dtset%spinmagntarget)
206 
207          !write(std_out,*)' isppol,sign_spin,nelect_spin=',isppol,sign_spin,nelect_spin
208 !        Determines the last state, and its occupation
209          if(abs(nint(nelect_spin)-nelect_spin)<tol10)then
210            nocc=nint(nelect_spin/maxocc)
211            occlast=maxocc
212          else
213            nocc=ceiling(nelect_spin/maxocc)
214            occlast=nelect_spin-(real(nocc,dp)-one)*maxocc
215          end if
216          !write(std_out,*)' dtset%nband(1),maxocc,occlast=',dtset%nband(1),maxocc,occlast
217          if(dtset%nband(1)*nint(maxocc)<nocc)then
218            write(message, '(a,i4,a, a,2i6,a, a,es16.6,a, a,es16.6,6a)' )&
219 &           'Initialization of occ, with nspden=',dtset%nspden,ch10,&
220 &           'number of bands=',dtset%nband(1:2),ch10,&
221 &           'number of electrons=',dtset%nelect,ch10,&
222 &           'and spinmagntarget=',dtset%spinmagntarget,ch10,&
223 &           'This combination is not possible, because of a lack of bands.',ch10,&
224 &           'Action: modify input file ... ',ch10,&
225 &           '(you should likely increase nband, but also check nspden, nspinor, nsppol, and spinmagntarget)'
226            MSG_ERROR(message)
227          end if
228          do ikpt=1,dtset%nkpt
229 !          Fill all bands, except the upper one
230            if(dtset%nband(1)>1)then
231              do iband=1,nocc-1
232                dtset%occ_orig(iband+dtset%nband(1)*(ikpt-1+dtset%nkpt*(isppol-1)),:)=maxocc
233              end do
234            end if
235 !          Fill the upper occupied band
236            dtset%occ_orig(nocc+dtset%nband(1)*(ikpt-1+dtset%nkpt*(isppol-1)),:)=occlast
237          end do
238        end do
239 
240      else
241        write(message, '(a,i4,a,a,es16.6,6a)' )&
242 &       'Initialization of occ, with nspden=',dtset%nspden,ch10,&
243 &       'and spinmagntarget=',dtset%spinmagntarget,ch10,&
244 &       'This combination is not possible.',ch10,&
245 &       'Action: modify input file ... ',ch10,&
246 &       '(check nspden, nspinor, nsppol and spinmagntarget)'
247        MSG_ERROR(message)
248      end if
249 
250 !    Now print the values (only the first image, since they are all the same)
251      if(dtset%nsppol==1)then
252 
253        write(message, '(a,i4,a,a)' ) &
254 &       ' chkneu : initialized the occupation numbers for occopt= ',occopt,', spin-unpolarized or antiferromagnetic case : '
255        call wrtout(std_out,message,'COLL')
256        do ii=0,(dtset%nband(1)-1)/12
257          write(message,'(12f6.2)') dtset%occ_orig( 1+ii*12 : min(12+ii*12,dtset%nband(1)),1 )
258          call wrtout(std_out,message,'COLL')
259        end do
260 
261      else
262 
263        write(message, '(a,i4,a,a)' ) &
264 &       ' chkneu : initialized the occupation numbers for occopt= ',occopt,&
265 &       ch10,'    spin up   values : '
266        call wrtout(std_out,message,'COLL')
267        do ii=0,(dtset%nband(1)-1)/12
268          write(message,'(12f6.2)') dtset%occ_orig( 1+ii*12 : min(12+ii*12,dtset%nband(1)),1 )
269          call wrtout(std_out,message,'COLL')
270        end do
271        write(message, '(a)' ) '    spin down values : '
272        call wrtout(std_out,message,'COLL')
273        do ii=0,(dtset%nband(1)-1)/12
274          write(message,'(12f6.2)') &
275 &         dtset%occ_orig( 1+ii*12+dtset%nkpt*dtset%nband(1) : min(12+ii*12,dtset%nband(1))+dtset%nkpt*dtset%nband(1) ,1)
276          call wrtout(std_out,message,'COLL')
277        end do
278 
279      end if
280 
281 !    Here, treat the case when the number of allowed bands is not large enough
282    else
283      write(message, '(a,i4,a,a,a,a,a,a,a,a)' )&
284 &     'Initialization of occ, with occopt=',occopt,ch10,&
285 &     'There are not enough bands to get charge balance right',ch10,&
286 &     'Action: modify input file ... ',ch10,&
287 &     '(check the pseudopotential charges, the variable charge,',ch10,&
288 &     'and the declared number of bands, nband)'
289      MSG_ERROR(message)
290    end if
291  end if
292 
293 !The remaining of the routine is for SCF runs and special options
294  if(dtset%iscf>0 .or. dtset%iscf==-1 .or. dtset%iscf==-3)then
295 
296    do iimage=1,dtset%nimage
297 
298 !    (3) count electrons in bands (note : in case occ has just been
299 !    initialized, point (3) and (4) is a trivial test
300      nelect_occ=0.0_dp
301      bantot=0
302      do isppol=1,dtset%nsppol
303        do ikpt=1,dtset%nkpt
304          do iband=1,dtset%nband(ikpt+(isppol-1)*dtset%nkpt)
305            bantot=bantot+1
306            nelect_occ=nelect_occ+dtset%wtk(ikpt)*dtset%occ_orig(bantot,iimage)
307          end do
308        end do
309      end do
310 
311 !    (4) if dtset%iscf/=-3, dtset%nelect must equal nelect_occ
312 !    if discrepancy exceeds tol11, give warning;  tol8, stop with error
313 
314      if (abs(nelect_occ-dtset%nelect)>tol11 .and. dtset%iscf/=-3) then
315 
316 !      There is a discrepancy
317        write(message, &
318 &       '(a,a,e16.8,a,e16.8,a,a,a,e22.14,a,a,a,i5,a,a,a,a)' ) ch10,&
319 &       ' chkneu: nelect_occ=',nelect_occ,', zval=',zval,',',ch10,&
320 &       '         and input value of charge=',charge,',',ch10,&
321 &       '   nelec_occ is computed from occ and wtk, iimage=',iimage,ch10,&
322 &       '   zval is nominal charge of all nuclei, computed from zion (read in psp),',ch10,&
323 &       '   charge is an input variable (usually 0).'
324        call wrtout(std_out,message,'COLL')
325 
326        if (abs(nelect_occ-dtset%nelect)>tol8) then
327 !        The discrepancy is severe
328          write(message,'(a,a,e9.2,a,a)')ch10,&
329 &         'These must obey zval-nelect_occ=charge to better than ',tol8,ch10,&
330 &         ' This is not the case. '
331        else
332 !        The discrepancy is not so severe
333          write(message, '(a,a,e9.2)' )ch10,'These should obey zval-nelect_occ=charge to better than ',tol11
334        end if
335        MSG_WARNING(message)
336 
337        write(message, '(a,a,a,a,a,a)' ) &
338 &       'Action: check input file for occ,wtk, and charge.',ch10,&
339 &       'Note that wtk is NOT automatically normalized when occopt=2,',ch10,&
340 &       'but IS automatically normalized otherwise.',ch10
341        call wrtout(std_out,message,'COLL')
342 
343 !      If the discrepancy is severe, stop
344        if (abs(nelect_occ-dtset%nelect)>tol8)then
345          MSG_ERROR(message)
346        end if
347 
348      end if
349 
350    end do
351 
352  end if !  End the condition dtset%iscf>0 or -1 or -3 .
353 
354 end subroutine dtset_chkneu

m_dtset/dtset_copy [ Functions ]

[ Top ] [ m_dtset ] [ Functions ]

NAME

 dtset_copy

FUNCTION

 Copy all values of dataset dtin to dataset dtout. allocatables of dtout are
 allocated if required. Use dtset_free() to free a dataset after use.

INPUTS

  dtin <type(dataset_type)>=all input variables in this dataset

OUTPUT

  dtout <type(dataset_type)>

PARENTS

      chkinp,dfpt_looppert,driver,gwls_hamiltonian,m_io_kss

CHILDREN

SOURCE

 380 subroutine dtset_copy(dtout, dtin)
 381 
 382 
 383 !This section has been created automatically by the script Abilint (TD).
 384 !Do not modify the following lines by hand.
 385 #undef ABI_FUNC
 386 #define ABI_FUNC 'dtset_copy'
 387 !End of the abilint section
 388 
 389  implicit none
 390 
 391 !Arguments ------------------------------------
 392 !scalars
 393  type(dataset_type),intent(in) :: dtin
 394  type(dataset_type),intent(out) :: dtout
 395 
 396 ! *************************************************************************
 397 
 398  DBG_ENTER("COLL")
 399 
 400  !@dataset_type
 401 
 402 !BEGIN VARIABLES FOR @Bethe-Salpeter
 403  dtout%bs_algorithm     = dtin%bs_algorithm
 404  dtout%bs_haydock_niter = dtin%bs_haydock_niter
 405  dtout%bs_exchange_term = dtin%bs_exchange_term
 406  dtout%bs_coulomb_term  = dtin%bs_coulomb_term
 407  dtout%bs_calctype      = dtin%bs_calctype
 408  dtout%bs_coupling      = dtin%bs_coupling
 409 
 410  dtout%bs_haydock_tol   = dtin%bs_haydock_tol
 411  dtout%bs_hayd_term     = dtin%bs_hayd_term
 412 
 413  dtout%bs_interp_m3_width = dtin%bs_interp_m3_width
 414  dtout%bs_interp_method = dtin%bs_interp_method
 415  dtout%bs_interp_mode   = dtin%bs_interp_mode
 416  dtout%bs_interp_prep   = dtin%bs_interp_prep
 417  dtout%bs_interp_rl_nb  = dtin%bs_interp_rl_nb
 418 
 419  dtout%bs_interp_kmult(:) = dtin%bs_interp_kmult(:)
 420  dtout%bs_eh_cutoff(:) = dtin%bs_eh_cutoff(:)
 421  dtout%bs_freq_mesh(:) = dtin%bs_freq_mesh(:)
 422 !END VARIABLES FOR @Bethe-Salpeter.
 423 
 424 !Copy integers from dtin to dtout
 425  dtout%iomode          = dtin%iomode
 426  dtout%accuracy           = dtin%accuracy
 427  dtout%adpimd             = dtin%adpimd
 428  dtout%autoparal          = dtin%autoparal
 429  dtout%auxc_ixc           = dtin%auxc_ixc
 430  dtout%auxc_scal          = dtin%auxc_scal
 431  dtout%awtr               = dtin%awtr
 432  dtout%bandpp             = dtin%bandpp
 433  dtout%bdeigrf            = dtin%bdeigrf
 434  dtout%berryopt           = dtin%berryopt
 435  dtout%berrysav           = dtin%berrysav
 436  dtout%berrystep          = dtin%berrystep
 437  dtout%brvltt             = dtin%brvltt
 438  dtout%bs_nstates         = dtin%bs_nstates
 439  dtout%builtintest        = dtin%builtintest
 440  dtout%cd_customnimfrqs   = dtin%cd_customnimfrqs
 441  dtout%cd_frqim_method    = dtin%cd_frqim_method
 442  dtout%cd_full_grid       = dtin%cd_full_grid
 443  dtout%chkdilatmx         = dtin%chkdilatmx
 444  dtout%chkexit            = dtin%chkexit
 445  dtout%chkprim            = dtin%chkprim
 446  dtout%chksymbreak        = dtin%chksymbreak
 447  dtout%cineb_start        = dtin%cineb_start
 448  dtout%delayperm          = dtin%delayperm
 449  dtout%diismemory         = dtin%diismemory
 450  dtout%dmatpuopt          = dtin%dmatpuopt
 451  dtout%dmatudiag          = dtin%dmatudiag
 452  dtout%dmft_dc            = dtin%dmft_dc
 453  dtout%dmft_entropy       = dtin%dmft_entropy
 454  dtout%dmft_iter          = dtin%dmft_iter
 455  dtout%dmft_nlambda       = dtin%dmft_nlambda
 456  dtout%dmft_mxsf          = dtin%dmft_mxsf
 457  dtout%dmft_nwlo          = dtin%dmft_nwlo
 458  dtout%dmft_nwli          = dtin%dmft_nwli
 459  dtout%dmft_read_occnd    = dtin%dmft_read_occnd
 460  dtout%dmft_rslf          = dtin%dmft_rslf
 461  dtout%dmft_solv          = dtin%dmft_solv
 462  dtout%dmft_t2g           = dtin%dmft_t2g
 463  dtout%dmft_tolfreq       = dtin%dmft_tolfreq
 464  dtout%dmft_tollc         = dtin%dmft_tollc
 465  dtout%dmftbandi          = dtin%dmftbandi
 466  dtout%dmftbandf          = dtin%dmftbandf
 467  dtout%dmftcheck          = dtin%dmftcheck
 468  dtout%dmftctqmc_basis    = dtin%dmftctqmc_basis
 469  dtout%dmftctqmc_check    = dtin%dmftctqmc_check
 470  dtout%dmftctqmc_correl   = dtin%dmftctqmc_correl
 471  dtout%dmftctqmc_gmove    = dtin%dmftctqmc_gmove
 472  dtout%dmftctqmc_grnns    = dtin%dmftctqmc_grnns
 473  dtout%dmftctqmc_meas     = dtin%dmftctqmc_meas
 474  dtout%dmftctqmc_mrka     = dtin%dmftctqmc_mrka
 475  dtout%dmftctqmc_mov      = dtin%dmftctqmc_mov
 476  dtout%dmftctqmc_order    = dtin%dmftctqmc_order
 477  dtout%dmftctqmc_triqs_nleg = dtin%dmftctqmc_triqs_nleg
 478  dtout%dmftqmc_n          = dtin%dmftqmc_n
 479  dtout%dmftqmc_l          = dtin%dmftqmc_l
 480  dtout%dmftqmc_seed       = dtin%dmftqmc_seed
 481  dtout%dmftqmc_therm      = dtin%dmftqmc_therm
 482  dtout%d3e_pert1_elfd     = dtin%d3e_pert1_elfd
 483  dtout%d3e_pert1_phon     = dtin%d3e_pert1_phon
 484  dtout%d3e_pert2_elfd     = dtin%d3e_pert2_elfd
 485  dtout%d3e_pert2_phon     = dtin%d3e_pert2_phon
 486  dtout%d3e_pert3_elfd     = dtin%d3e_pert3_elfd
 487  dtout%d3e_pert3_phon     = dtin%d3e_pert3_phon
 488  dtout%efmas              = dtin%efmas
 489  dtout%efmas_calc_dirs    = dtin%efmas_calc_dirs
 490  dtout%efmas_deg          = dtin%efmas_deg
 491  dtout%efmas_dim          = dtin%efmas_dim
 492  dtout%efmas_n_dirs       = dtin%efmas_n_dirs
 493  dtout%efmas_ntheta       = dtin%efmas_ntheta
 494  dtout%enunit             = dtin%enunit
 495 
 496 ! begin eph variables
 497  dtout%asr                = dtin%asr
 498  dtout%dipdip             = dtin%dipdip
 499  dtout%chneut             = dtin%chneut
 500 
 501  dtout%eph_mustar         = dtin%eph_mustar
 502  dtout%eph_intmeth        = dtin%eph_intmeth
 503  dtout%eph_extrael        = dtin%eph_extrael
 504  dtout%eph_fermie         = dtin%eph_fermie
 505  dtout%eph_frohlichm      = dtin%eph_frohlichm
 506  dtout%eph_fsmear         = dtin%eph_fsmear
 507  dtout%eph_fsewin         = dtin%eph_fsewin
 508  dtout%eph_ngqpt_fine     = dtin%eph_ngqpt_fine
 509  dtout%eph_task           = dtin%eph_task
 510  dtout%eph_transport      = dtin%eph_transport
 511 
 512  dtout%ph_wstep          = dtin%ph_wstep
 513  dtout%ph_intmeth        = dtin%ph_intmeth
 514  dtout%symdynmat         = dtin%symdynmat
 515  dtout%ph_nqshift        = dtin%ph_nqshift
 516  if (allocated(dtin%ph_qshift)) call alloc_copy(dtin%ph_qshift, dtout%ph_qshift)
 517  dtout%ph_smear          = dtin%ph_smear
 518  dtout%ddb_ngqpt         = dtin%ddb_ngqpt
 519  dtout%ddb_shiftq        = dtin%ddb_shiftq
 520 
 521  dtout%ph_freez_disp_addStrain = dtin%ph_freez_disp_addStrain
 522  dtout%ph_freez_disp_option = dtin%ph_freez_disp_option
 523  dtout%ph_freez_disp_nampl  = dtin%ph_freez_disp_nampl
 524  dtout%ph_ndivsm          = dtin%ph_ndivsm
 525  dtout%ph_nqpath          = dtin%ph_nqpath
 526  dtout%ph_ngqpt           = dtin%ph_ngqpt
 527  if (allocated(dtin%ph_qpath)) call alloc_copy(dtin%ph_qpath, dtout%ph_qpath)
 528  if(allocated(dtin%ph_freez_disp_ampl))call alloc_copy(dtin%ph_freez_disp_ampl,dtout%ph_freez_disp_ampl)
 529 ! end eph variables
 530 
 531  dtout%exchn2n3d          = dtin%exchn2n3d
 532  dtout%extrapwf           = dtin%extrapwf
 533  dtout%pawfatbnd          = dtin%pawfatbnd
 534  dtout%fermie_nest        = dtin%fermie_nest
 535  dtout%fftgw              = dtin%fftgw
 536  dtout%fockdownsampling  = dtin%fockdownsampling
 537  dtout%fockoptmix         = dtin%fockoptmix
 538  dtout%freqim_alpha       = dtin%freqim_alpha
 539  dtout%freqremin          = dtin%freqremin
 540  dtout%freqremax          = dtin%freqremax
 541  dtout%freqspmin          = dtin%freqspmin
 542  dtout%freqspmax          = dtin%freqspmax
 543  dtout%frzfermi           = dtin%frzfermi
 544  dtout%ga_algor           = dtin%ga_algor
 545  dtout%ga_fitness         = dtin%ga_fitness
 546  dtout%ga_n_rules         = dtin%ga_n_rules
 547  dtout%getbseig           = dtin%getbseig
 548  dtout%getbsreso          = dtin%getbsreso
 549  dtout%getbscoup          = dtin%getbscoup
 550  dtout%getcell            = dtin%getcell
 551  dtout%getddb             = dtin%getddb
 552  dtout%getddk             = dtin%getddk
 553  dtout%getdelfd           = dtin%getdelfd
 554  dtout%getdkdk            = dtin%getdkdk
 555  dtout%getdkde            = dtin%getdkde
 556  dtout%getden             = dtin%getden
 557  dtout%getefmas           = dtin%getefmas
 558  dtout%getgam_eig2nkq     = dtin%getgam_eig2nkq
 559  dtout%gethaydock         = dtin%gethaydock
 560  dtout%getocc             = dtin%getocc
 561  dtout%getpawden          = dtin%getpawden
 562  dtout%getqps             = dtin%getqps
 563  dtout%getscr             = dtin%getscr
 564  dtout%getsuscep          = dtin%getsuscep
 565  dtout%getvel             = dtin%getvel
 566  dtout%getwfk             = dtin%getwfk
 567  dtout%getwfkfine         = dtin%getwfkfine
 568  dtout%getwfq             = dtin%getwfq
 569  dtout%getxcart           = dtin%getxcart
 570  dtout%getxred            = dtin%getxred
 571  dtout%get1den            = dtin%get1den
 572  dtout%get1wf             = dtin%get1wf
 573  dtout%goprecon           = dtin%goprecon
 574  dtout%gpu_linalg_limit   = dtin%gpu_linalg_limit
 575  dtout%gwcalctyp          = dtin%gwcalctyp
 576  dtout%gwcomp             = dtin%gwcomp
 577  dtout%gwencomp           = dtin%gwencomp
 578  dtout%gwmem              = dtin%gwmem
 579  dtout%gwpara             = dtin%gwpara
 580  dtout%gwgamma            = dtin%gwgamma
 581  dtout%gwrpacorr          = dtin%gwrpacorr
 582  dtout%gw_customnfreqsp   = dtin%gw_customnfreqsp
 583  dtout%gw_nqlwl           = dtin%gw_nqlwl
 584  dtout%gw_nstep           = dtin%gw_nstep
 585  dtout%gw_frqim_inzgrid   = dtin%gw_frqim_inzgrid
 586  dtout%gw_frqre_inzgrid   = dtin%gw_frqre_inzgrid
 587  dtout%gw_frqre_tangrid   = dtin%gw_frqre_tangrid
 588  dtout%gw_invalid_freq    = dtin%gw_invalid_freq
 589  dtout%gw_qprange         = dtin%gw_qprange
 590  dtout%gw_sctype          = dtin%gw_sctype
 591  dtout%gw_sigxcore        = dtin%gw_sigxcore
 592  dtout%gw_toldfeig        = dtin%gw_toldfeig
 593  dtout%gwls_stern_kmax= dtin%gwls_stern_kmax
 594  dtout%gwls_npt_gauss_quad  = dtin%gwls_npt_gauss_quad
 595  dtout%gwls_diel_model= dtin%gwls_diel_model
 596  dtout%gwls_print_debug     = dtin%gwls_print_debug
 597  dtout%gwls_nseeds          = dtin%gwls_nseeds
 598  dtout%gwls_n_proj_freq     = dtin%gwls_n_proj_freq
 599  dtout%gwls_kmax_complement = dtin%gwls_kmax_complement
 600  dtout%gwls_kmax_poles      = dtin%gwls_kmax_poles
 601  dtout%gwls_kmax_analytic   = dtin%gwls_kmax_analytic
 602  dtout%gwls_kmax_numeric    = dtin%gwls_kmax_numeric
 603  dtout%gwls_band_index      = dtin%gwls_band_index
 604  dtout%gwls_exchange        = dtin%gwls_exchange
 605  dtout%gwls_correlation     = dtin%gwls_correlation
 606  dtout%gwls_first_seed      = dtin%gwls_first_seed
 607  dtout%gwls_recycle         = dtin%gwls_recycle
 608  dtout%hyb_mixing      = dtin%hyb_mixing
 609  dtout%hyb_mixing_sr   = dtin%hyb_mixing_sr
 610  dtout%hyb_range_dft   = dtin%hyb_range_dft
 611  dtout%hyb_range_fock  = dtin%hyb_range_fock
 612  dtout%hmcsst             = dtin%hmcsst
 613  dtout%hmctt              = dtin%hmctt
 614  dtout%iboxcut            = dtin%iboxcut
 615  dtout%icoulomb           = dtin%icoulomb
 616  dtout%icutcoul           = dtin%icutcoul
 617  dtout%ieig2rf            = dtin%ieig2rf
 618  dtout%imgmov             = dtin%imgmov
 619  dtout%imgwfstor          = dtin%imgwfstor
 620  dtout%inclvkb            = dtin%inclvkb
 621  dtout%intxc              = dtin%intxc
 622  dtout%ionmov             = dtin%ionmov
 623  dtout%densfor_pred       = dtin%densfor_pred
 624  dtout%iprcel             = dtin%iprcel
 625  dtout%iprcfc             = dtin%iprcfc
 626  dtout%irandom            = dtin%irandom
 627  dtout%irdbseig           = dtin%irdbseig
 628  dtout%irdbsreso          = dtin%irdbsreso
 629  dtout%irdbscoup          = dtin%irdbscoup
 630  dtout%irdddb             = dtin%irdddb
 631  dtout%irdddk             = dtin%irdddk
 632  dtout%irdden             = dtin%irdden
 633  dtout%irdefmas           = dtin%irdefmas
 634  dtout%irdhaydock         = dtin%irdhaydock
 635  dtout%irdpawden          = dtin%irdpawden
 636  dtout%irdqps             = dtin%irdqps
 637  dtout%irdscr             = dtin%irdscr
 638  dtout%irdsuscep          = dtin%irdsuscep
 639  dtout%irdvdw             = dtin%irdvdw
 640  dtout%irdwfk             = dtin%irdwfk
 641  dtout%irdwfkfine         = dtin%irdwfkfine
 642  dtout%irdwfq             = dtin%irdwfq
 643  dtout%ird1den            = dtin%ird1den
 644  dtout%ird1wf             = dtin%ird1wf
 645  dtout%iscf               = dtin%iscf
 646  dtout%isecur             = dtin%isecur
 647  dtout%istatimg           = dtin%istatimg
 648  dtout%istatr             = dtin%istatr
 649  dtout%istatshft          = dtin%istatshft
 650  dtout%ixc                = dtin%ixc
 651  dtout%ixc_sigma          = dtin%ixc_sigma
 652  dtout%ixcpositron        = dtin%ixcpositron
 653  dtout%ixcrot             = dtin%ixcrot
 654  dtout%jdtset             = dtin%jdtset
 655  dtout%jellslab           = dtin%jellslab
 656  dtout%kptopt             = dtin%kptopt
 657  dtout%kssform            = dtin%kssform
 658  dtout%localrdwf          = dtin%localrdwf
 659 #if defined HAVE_LOTF
 660  dtout%lotf_classic       = dtin%lotf_classic
 661  dtout%lotf_nitex         = dtin%lotf_nitex
 662  dtout%lotf_nneigx        = dtin%lotf_nneigx
 663  dtout%lotf_version       = dtin%lotf_version
 664 #endif
 665  dtout%magconon           = dtin%magconon
 666  dtout%maxnsym            = dtin%maxnsym
 667  dtout%max_ncpus          = dtin%max_ncpus
 668  dtout%mband              = dtin%mband
 669  dtout%mdf_epsinf         = dtin%mdf_epsinf
 670  dtout%mep_solver         = dtin%mep_solver
 671  dtout%mem_test           = dtin%mem_test
 672  dtout%mffmem             = dtin%mffmem
 673  dtout%mgfft              = dtin%mgfft
 674  dtout%mgfftdg            = dtin%mgfftdg
 675  dtout%mkmem              = dtin%mkmem
 676  dtout%mkqmem             = dtin%mkqmem
 677  dtout%mk1mem             = dtin%mk1mem
 678  dtout%mpw                = dtin%mpw
 679  dtout%mqgrid             = dtin%mqgrid
 680  dtout%mqgriddg           = dtin%mqgriddg
 681  dtout%natom              = dtin%natom
 682  dtout%natrd              = dtin%natrd
 683  dtout%natsph             = dtin%natsph
 684  dtout%natsph_extra       = dtin%natsph_extra
 685  dtout%natpawu            = dtin%natpawu
 686  dtout%natvshift          = dtin%natvshift
 687  dtout%nbdblock           = dtin%nbdblock
 688  dtout%nbdbuf             = dtin%nbdbuf
 689  dtout%nbandhf            = dtin%nbandhf
 690  dtout%nberry             = dtin%nberry
 691  dtout%nc_xccc_gspace     = dtin%nc_xccc_gspace
 692  dtout%nbandkss           = dtin%nbandkss
 693  dtout%nconeq             = dtin%nconeq
 694  dtout%nctime             = dtin%nctime
 695  dtout%ndtset             = dtin%ndtset
 696  dtout%ndynimage          = dtin%ndynimage
 697  dtout%neb_algo           = dtin%neb_algo
 698  dtout%nfft               = dtin%nfft
 699  dtout%nfftdg             = dtin%nfftdg
 700  dtout%nfreqim            = dtin%nfreqim
 701  dtout%nfreqre            = dtin%nfreqre
 702  dtout%nfreqsp            = dtin%nfreqsp
 703  dtout%nimage             = dtin%nimage
 704  dtout%nkpt               = dtin%nkpt
 705  dtout%nkpthf             = dtin%nkpthf
 706  dtout%nkptgw             = dtin%nkptgw
 707  dtout%nonlinear_info     = dtin%nonlinear_info
 708  dtout%nline              = dtin%nline
 709  dtout%nnsclo             = dtin%nnsclo
 710  dtout%nnsclohf           = dtin%nnsclohf
 711  dtout%nomegasf           = dtin%nomegasf
 712  dtout%nomegasi           = dtin%nomegasi
 713  dtout%nomegasrd          = dtin%nomegasrd
 714  dtout%npband             = dtin%npband
 715  dtout%npfft              = dtin%npfft
 716  dtout%nphf               = dtin%nphf
 717  dtout%npimage            = dtin%npimage
 718  dtout%npkpt              = dtin%npkpt
 719  dtout%nppert             = dtin%nppert
 720  dtout%npspinor           = dtin%npspinor
 721  dtout%npsp               = dtin%npsp
 722  dtout%npspalch           = dtin%npspalch
 723  dtout%npulayit           = dtin%npulayit
 724  dtout%npvel              = dtin%npvel
 725  dtout%npweps             = dtin%npweps
 726  dtout%npwkss             = dtin%npwkss
 727  dtout%npwsigx            = dtin%npwsigx
 728  dtout%npwwfn             = dtin%npwwfn
 729  dtout%np_slk             = dtin%np_slk
 730  dtout%nqpt               = dtin%nqpt
 731  dtout%nqptdm             = dtin%nqptdm
 732  dtout%nscforder          = dtin%nscforder
 733  dtout%nshiftk            = dtin%nshiftk
 734  dtout%nshiftk_orig       = dtin%nshiftk_orig
 735  dtout%nspden             = dtin%nspden
 736  dtout%nspinor            = dtin%nspinor
 737  dtout%nsppol             = dtin%nsppol
 738  dtout%nstep              = dtin%nstep
 739  dtout%nsym               = dtin%nsym
 740  dtout%ntime              = dtin%ntime
 741  dtout%ntimimage          = dtin%ntimimage
 742  dtout%ntypalch           = dtin%ntypalch
 743  dtout%ntypat             = dtin%ntypat
 744  dtout%ntyppure           = dtin%ntyppure
 745  dtout%nwfshist           = dtin%nwfshist
 746  dtout%nzchempot          = dtin%nzchempot
 747  dtout%occopt             = dtin%occopt
 748  dtout%optcell            = dtin%optcell
 749  dtout%optdriver          = dtin%optdriver
 750  dtout%optforces          = dtin%optforces
 751  dtout%optnlxccc          = dtin%optnlxccc
 752  dtout%optstress          = dtin%optstress
 753  dtout%orbmag             = dtin%orbmag
 754  dtout%ortalg             = dtin%ortalg
 755  dtout%paral_atom         = dtin%paral_atom
 756  dtout%paral_kgb          = dtin%paral_kgb
 757  dtout%paral_rf           = dtin%paral_rf
 758  dtout%pawcpxocc          = dtin%pawcpxocc
 759  dtout%pawcross           = dtin%pawcross
 760  dtout%pawlcutd           = dtin%pawlcutd
 761  dtout%pawlmix            = dtin%pawlmix
 762  dtout%pawmixdg           = dtin%pawmixdg
 763  dtout%pawnhatxc          = dtin%pawnhatxc
 764  dtout%pawnphi            = dtin%pawnphi
 765  dtout%pawntheta          = dtin%pawntheta
 766  dtout%pawnzlm            = dtin%pawnzlm
 767  dtout%pawoptmix          = dtin%pawoptmix
 768  dtout%pawoptosc          = dtin%pawoptosc
 769  dtout%pawprtdos          = dtin%pawprtdos
 770  dtout%pawprtvol          = dtin%pawprtvol
 771  dtout%pawprtwf           = dtin%pawprtwf
 772  dtout%pawprt_k           = dtin%pawprt_k
 773  dtout%pawprt_b           = dtin%pawprt_b
 774  dtout%pawspnorb          = dtin%pawspnorb
 775  dtout%pawstgylm          = dtin%pawstgylm
 776  dtout%pawsushat          = dtin%pawsushat
 777  dtout%pawusecp           = dtin%pawusecp
 778  dtout%pawujat            = dtin%pawujat
 779  dtout%macro_uj           = dtin%macro_uj
 780  dtout%pawujrad           = dtin%pawujrad
 781  dtout%pawujv             = dtin%pawujv
 782  dtout%pawxcdev           = dtin%pawxcdev
 783  dtout%pimd_constraint    = dtin%pimd_constraint
 784  dtout%pitransform        = dtin%pitransform
 785  dtout%plowan_compute     = dtin%plowan_compute
 786  dtout%plowan_bandi       = dtin%plowan_bandi
 787  dtout%plowan_bandf       = dtin%plowan_bandf
 788  dtout%plowan_natom       = dtin%plowan_natom
 789  dtout%plowan_nt          = dtin%plowan_nt
 790  dtout%plowan_realspace   = dtin%plowan_realspace
 791  dtout%posdoppler         = dtin%posdoppler
 792  dtout%positron           = dtin%positron
 793  dtout%posnstep           = dtin%posnstep
 794  dtout%ppmodel            = dtin%ppmodel
 795  dtout%prepanl            = dtin%prepanl
 796  dtout%prepgkk            = dtin%prepgkk
 797  dtout%prtbbb             = dtin%prtbbb
 798  dtout%prtbltztrp         = dtin%prtbltztrp
 799  dtout%prtcif             = dtin%prtcif
 800  dtout%prtden             = dtin%prtden
 801  dtout%prtdensph          = dtin%prtdensph
 802  dtout%prtdipole          = dtin%prtdipole
 803  dtout%prtdos             = dtin%prtdos
 804  dtout%prtdosm            = dtin%prtdosm
 805  dtout%prtebands          = dtin%prtebands    ! TODO prteig could be replaced by prtebands...
 806  dtout%prtefg             = dtin%prtefg
 807  dtout%prtefmas           = dtin%prtefmas
 808  dtout%prteig             = dtin%prteig
 809  dtout%prtelf             = dtin%prtelf
 810  dtout%prtfc              = dtin%prtfc
 811  dtout%prtfull1wf         = dtin%prtfull1wf
 812  dtout%prtfsurf           = dtin%prtfsurf
 813  dtout%prtgsr             = dtin%prtgsr
 814  dtout%prtgden            = dtin%prtgden
 815  dtout%prtgeo             = dtin%prtgeo
 816  dtout%prtgkk             = dtin%prtgkk
 817  dtout%prtkden            = dtin%prtkden
 818  dtout%prtkpt             = dtin%prtkpt
 819  dtout%prtlden            = dtin%prtlden
 820  dtout%prtnabla           = dtin%prtnabla
 821  dtout%prtnest            = dtin%prtnest
 822  dtout%prtphbands         = dtin%prtphbands
 823  dtout%prtphdos           = dtin%prtphdos
 824  dtout%prtphsurf          = dtin%prtphsurf
 825  dtout%prtposcar          = dtin%prtposcar
 826  dtout%prtpot             = dtin%prtpot
 827  dtout%prtpsps            = dtin%prtpsps
 828  dtout%prtspcur           = dtin%prtspcur
 829  dtout%prtsuscep          = dtin%prtsuscep
 830  dtout%prtstm             = dtin%prtstm
 831  dtout%prtvclmb           = dtin%prtvclmb
 832  dtout%prtvdw             = dtin%prtvdw
 833  dtout%prtvha             = dtin%prtvha
 834  dtout%prtvhxc            = dtin%prtvhxc
 835  dtout%prtkbff            = dtin%prtkbff
 836  dtout%prtvol             = dtin%prtvol
 837  dtout%prtvolimg          = dtin%prtvolimg
 838  dtout%prtvpsp            = dtin%prtvpsp
 839  dtout%prtvxc             = dtin%prtvxc
 840  dtout%prtwant            = dtin%prtwant
 841  dtout%prtwf              = dtin%prtwf
 842  dtout%prtwf_full         = dtin%prtwf_full
 843  dtout%prtxml             = dtin%prtxml
 844  dtout%prt1dm             = dtin%prt1dm
 845  dtout%ptgroupma          = dtin%ptgroupma
 846  dtout%qptopt             = dtin%qptopt
 847  dtout%random_atpos       = dtin%random_atpos
 848  dtout%recgratio          = dtin%recgratio
 849  dtout%recnpath           = dtin%recnpath
 850  dtout%recnrec            = dtin%recnrec
 851  dtout%recptrott          = dtin%recptrott
 852  dtout%rectesteg          = dtin%rectesteg
 853  dtout%rcut               = dtin%rcut
 854  dtout%restartxf          = dtin%restartxf
 855  dtout%rfasr              = dtin%rfasr
 856  dtout%rfddk              = dtin%rfddk
 857  dtout%rfelfd             = dtin%rfelfd
 858  dtout%rfmagn             = dtin%rfmagn
 859  dtout%rfmeth             = dtin%rfmeth
 860  dtout%rfphon             = dtin%rfphon
 861  dtout%rfstrs             = dtin%rfstrs
 862  dtout%rfuser             = dtin%rfuser
 863  dtout%rf2_dkdk           = dtin%rf2_dkdk
 864  dtout%rf2_dkde           = dtin%rf2_dkde
 865  dtout%rhoqpmix           = dtin%rhoqpmix
 866  dtout%signperm           = dtin%signperm
 867  dtout%slabwsrad          = dtin%slabwsrad
 868  dtout%slabzbeg           = dtin%slabzbeg
 869  dtout%slabzend           = dtin%slabzend
 870  dtout%slk_rankpp         = dtin%slk_rankpp
 871  dtout%smdelta            = dtin%smdelta
 872  dtout%spgaxor            = dtin%spgaxor
 873  dtout%spgorig            = dtin%spgorig
 874  dtout%spgroup            = dtin%spgroup
 875  dtout%spmeth             = dtin%spmeth
 876  dtout%string_algo        = dtin%string_algo
 877  dtout%symchi             = dtin%symchi
 878  dtout%symmorphi          = dtin%symmorphi
 879  dtout%symsigma           = dtin%symsigma
 880  dtout%td_mexcit          = dtin%td_mexcit
 881  dtout%tfkinfunc          = dtin%tfkinfunc
 882  dtout%tim1rev            = dtin%tim1rev
 883  dtout%timopt             = dtin%timopt
 884  dtout%use_gemm_nonlop    = dtin%use_gemm_nonlop
 885  dtout%use_gpu_cuda       = dtin%use_gpu_cuda
 886  dtout%use_slk            = dtin%use_slk
 887  dtout%usedmatpu          = dtin%usedmatpu
 888  dtout%usedmft            = dtin%usedmft
 889  dtout%useexexch          = dtin%useexexch
 890  dtout%usefock            = dtin%usefock
 891  dtout%usekden            = dtin%usekden
 892  dtout%use_nonscf_gkk     = dtin%use_nonscf_gkk
 893  dtout%usepaw             = dtin%usepaw
 894  dtout%usepawu            = dtin%usepawu
 895  dtout%usepead            = dtin%usepead
 896  dtout%usepotzero         = dtin%usepotzero
 897  dtout%userec             = dtin%userec
 898  dtout%useria             = dtin%useria
 899  dtout%userib             = dtin%userib
 900  dtout%useric             = dtin%useric
 901  dtout%userid             = dtin%userid
 902  dtout%userie             = dtin%userie
 903  dtout%usewvl             = dtin%usewvl
 904  dtout%usexcnhat_orig     = dtin%usexcnhat_orig
 905  dtout%useylm             = dtin%useylm
 906  dtout%vacnum             = dtin%vacnum
 907  dtout%vdw_df_acutmin     = dtin%vdw_df_acutmin
 908  dtout%vdw_df_aratio      = dtin%vdw_df_aratio
 909  dtout%vdw_df_damax       = dtin%vdw_df_damax
 910  dtout%vdw_df_damin       = dtin%vdw_df_damin
 911  dtout%vdw_df_dcut        = dtin%vdw_df_dcut
 912  dtout%vdw_df_dratio      = dtin%vdw_df_dratio
 913  dtout%vdw_df_dsoft       = dtin%vdw_df_dsoft
 914  dtout%vdw_df_gcut        = dtin%vdw_df_gcut
 915  dtout%vdw_df_ndpts       = dtin%vdw_df_ndpts
 916  dtout%vdw_df_ngpts       = dtin%vdw_df_ngpts
 917  dtout%vdw_df_nqpts       = dtin%vdw_df_nqpts
 918  dtout%vdw_df_nrpts       = dtin%vdw_df_nrpts
 919  dtout%vdw_df_nsmooth     = dtin%vdw_df_nsmooth
 920  dtout%vdw_df_phisoft     = dtin%vdw_df_phisoft
 921  dtout%vdw_df_qcut        = dtin%vdw_df_qcut
 922  dtout%vdw_df_qratio      = dtin%vdw_df_qratio
 923  dtout%vdw_df_rcut        = dtin%vdw_df_rcut
 924  dtout%vdw_df_rsoft       = dtin%vdw_df_rsoft
 925  dtout%vdw_df_tolerance   = dtin%vdw_df_tolerance
 926  dtout%vdw_df_threshold   = dtin%vdw_df_threshold
 927  dtout%vdw_df_tweaks      = dtin%vdw_df_tweaks
 928  dtout%vdw_df_zab         = dtin%vdw_df_zab
 929  dtout%vdw_nfrag          = dtin%vdw_nfrag
 930  dtout%vdw_xc             = dtin%vdw_xc
 931  dtout%wfoptalg           = dtin%wfoptalg
 932  dtout%wvl_bigdft_comp    = dtin%wvl_bigdft_comp
 933  dtout%w90iniprj          = dtin%w90iniprj
 934  dtout%w90prtunk          = dtin%w90prtunk
 935  dtout%xclevel            = dtin%xclevel
 936  dtout%xc_denpos          = dtin%xc_denpos
 937 
 938 !Copy allocated integer arrays from dtin to dtout
 939  dtout%bdberry(:)         = dtin%bdberry(:)
 940  dtout%cd_subset_freq(:)  = dtin%cd_subset_freq(:)
 941  dtout%d3e_pert1_atpol(:) = dtin%d3e_pert1_atpol(:)
 942  dtout%d3e_pert1_dir(:)   = dtin%d3e_pert1_dir(:)
 943  dtout%d3e_pert2_atpol(:) = dtin%d3e_pert2_atpol(:)
 944  dtout%d3e_pert2_dir(:)   = dtin%d3e_pert2_dir(:)
 945  dtout%d3e_pert3_atpol(:) = dtin%d3e_pert3_atpol(:)
 946  dtout%d3e_pert3_dir(:)   = dtin%d3e_pert3_dir(:)
 947  dtout%ga_rules(:)        = dtin%ga_rules(:)
 948  dtout%gpu_devices(:)     = dtin%gpu_devices(:)
 949  dtout%jfielddir(:)       = dtin%jfielddir(:)
 950  dtout%kptrlatt(:,:)      = dtin%kptrlatt(:,:)
 951  dtout%kptrlatt_orig      = dtin%kptrlatt_orig
 952  dtout%qptrlatt(:,:)      = dtin%qptrlatt(:,:)
 953  dtout%ngfft(:)           = dtin%ngfft(:)
 954  dtout%ngfftdg(:)         = dtin%ngfftdg(:)
 955  dtout%nloalg(:)          = dtin%nloalg(:)
 956  dtout%ngkpt(:)           = dtin%ngkpt(:)
 957  dtout%qprtrb(:)          = dtin%qprtrb(:)
 958  dtout%rfatpol(:)         = dtin%rfatpol(:)
 959  dtout%rfdir(:)           = dtin%rfdir(:)
 960  dtout%rf2_pert1_dir(:)   = dtin%rf2_pert1_dir(:)
 961  dtout%rf2_pert2_dir(:)   = dtin%rf2_pert2_dir(:)
 962  dtout%supercell_latt(:,:)= dtin%supercell_latt(:,:)
 963  dtout%ucrpa_bands(:)     = dtin%ucrpa_bands(:)
 964  dtout%vdw_supercell(:)   = dtin%vdw_supercell(:)
 965  dtout%vdw_typfrag(:)     = dtin%vdw_typfrag(:)
 966  dtout%wvl_ngauss(:)      = dtin%wvl_ngauss(:)
 967 
 968 !Copy reals from dtin to dtout
 969  dtout%adpimd_gamma       = dtin%adpimd_gamma
 970  dtout%boxcutmin          = dtin%boxcutmin
 971  dtout%bxctmindg          = dtin%bxctmindg
 972  dtout%cd_halfway_freq    = dtin%cd_halfway_freq
 973  dtout%cd_max_freq        = dtin%cd_max_freq
 974  dtout%charge             = dtin%charge
 975  dtout%cpus               = dtin%cpus
 976  dtout%ddamp              = dtin%ddamp
 977  dtout%diecut             = dtin%diecut
 978  dtout%diegap             = dtin%diegap
 979  dtout%dielam             = dtin%dielam
 980  dtout%dielng             = dtin%dielng
 981  dtout%diemac             = dtin%diemac
 982  dtout%diemix             = dtin%diemix
 983  dtout%diemixmag          = dtin%diemixmag
 984  dtout%dilatmx            = dtin%dilatmx
 985  dtout%dosdeltae          = dtin%dosdeltae
 986  dtout%dtion              = dtin%dtion
 987  dtout%ecut               = dtin%ecut
 988  dtout%ecuteps            = dtin%ecuteps
 989  dtout%ecutsigx           = dtin%ecutsigx
 990  dtout%ecutsm             = dtin%ecutsm
 991  dtout%ecutwfn            = dtin%ecutwfn
 992  dtout%effmass_free       = dtin%effmass_free
 993  dtout%efmas_deg_tol      = dtin%efmas_deg_tol
 994  dtout%elph2_imagden      = dtin%elph2_imagden
 995  dtout%eshift             = dtin%eshift
 996  dtout%esmear             = dtin%esmear
 997  dtout%exchmix            = dtin%exchmix
 998  dtout%fband              = dtin%fband
 999  dtout%focktoldfe         = dtin%focktoldfe
1000  dtout%friction           = dtin%friction
1001  dtout%fxcartfactor       = dtin%fxcartfactor
1002  dtout%ga_opt_percent     = dtin%ga_opt_percent
1003  dtout%gwls_model_parameter = dtin%gwls_model_parameter
1004  dtout%kptnrm             = dtin%kptnrm
1005  dtout%kptrlen            = dtin%kptrlen
1006  dtout%maxestep           = dtin%maxestep
1007  dtout%bmass              = dtin%bmass
1008  dtout%magcon_lambda      = dtin%magcon_lambda
1009  dtout%mdwall             = dtin%mdwall
1010  dtout%mep_mxstep         = dtin%mep_mxstep
1011  dtout%nelect             = dtin%nelect
1012  dtout%nnos               = dtin%nnos
1013  dtout%noseinert          = dtin%noseinert
1014  dtout%omegasimax         = dtin%omegasimax
1015  dtout%omegasrdmax        = dtin%omegasrdmax
1016  dtout%pawecutdg          = dtin%pawecutdg
1017  dtout%pawovlp            = dtin%pawovlp
1018  dtout%posocc             = dtin%posocc
1019  dtout%postoldfe          = dtin%postoldfe
1020  dtout%postoldff          = dtin%postoldff
1021  dtout%ppmfrq             = dtin%ppmfrq
1022  dtout%pw_unbal_thresh    = dtin%pw_unbal_thresh
1023  dtout%ratsph_extra       = dtin%ratsph_extra
1024  dtout%recrcut            = dtin%recrcut
1025  dtout%recefermi          = dtin%recefermi
1026  dtout%rectolden          = dtin%rectolden
1027  dtout%dfpt_sciss         = dtin%dfpt_sciss
1028  dtout%mbpt_sciss         = dtin%mbpt_sciss
1029  dtout%spinmagntarget     = dtin%spinmagntarget
1030  dtout%spbroad            = dtin%spbroad
1031  dtout%spnorbscl          = dtin%spnorbscl
1032  dtout%stmbias            = dtin%stmbias
1033  dtout%strfact            = dtin%strfact
1034  dtout%strprecon          = dtin%strprecon
1035  dtout%tfw_toldfe         = dtin%tfw_toldfe
1036  dtout%tl_radius          = dtin%tl_radius
1037  dtout%tl_nprccg          = dtin%tl_nprccg
1038  dtout%td_maxene          = dtin%td_maxene
1039  dtout%toldfe             = dtin%toldfe
1040  dtout%tolmxde            = dtin%tolmxde
1041  dtout%toldff             = dtin%toldff
1042  dtout%tolimg             = dtin%tolimg
1043  dtout%tolmxf             = dtin%tolmxf
1044  dtout%tolrde             = dtin%tolrde
1045  dtout%tolrff             = dtin%tolrff
1046  dtout%tolsym             = dtin%tolsym
1047  dtout%tolvrs             = dtin%tolvrs
1048  dtout%tolwfr             = dtin%tolwfr
1049  dtout%tphysel            = dtin%tphysel
1050  dtout%tsmear             = dtin%tsmear
1051  dtout%ucrpa              = dtin%ucrpa
1052  dtout%userra             = dtin%userra
1053  dtout%userrb             = dtin%userrb
1054  dtout%userrc             = dtin%userrc
1055  dtout%userrd             = dtin%userrd
1056  dtout%userre             = dtin%userre
1057  dtout%vacwidth           = dtin%vacwidth
1058  dtout%vdw_tol            = dtin%vdw_tol
1059  dtout%vdw_tol_3bt        = dtin%vdw_tol_3bt
1060  dtout%vis                = dtin%vis
1061  dtout%wfmix              = dtin%wfmix
1062  dtout%wfk_task           = dtin%wfk_task
1063  dtout%wtq                = dtin%wtq
1064  dtout%wvl_hgrid          = dtin%wvl_hgrid
1065  dtout%wvl_crmult         = dtin%wvl_crmult
1066  dtout%wvl_frmult         = dtin%wvl_frmult
1067  dtout%wvl_nprccg         = dtin%wvl_nprccg
1068  dtout%xc_tb09_c          = dtin%xc_tb09_c
1069  dtout%zcut               = dtin%zcut
1070 
1071 !Copy allocated real arrays from dtin to dtout
1072  dtout%boxcenter(:)       = dtin%boxcenter(:)
1073  dtout%bfield(:)          = dtin%bfield(:)
1074  dtout%dfield(:)          = dtin%dfield(:)
1075  dtout%efield(:)          = dtin%efield(:)
1076  dtout%genafm(:)          = dtin%genafm(:)
1077  dtout%goprecprm(:)       = dtin%goprecprm(:)
1078  dtout%mdtemp(:)          = dtin%mdtemp(:)
1079  dtout%neb_spring(:)      = dtin%neb_spring(:)
1080  dtout%polcen(:)          = dtin%polcen(:)
1081  dtout%qptn(:)            = dtin%qptn(:)
1082  dtout%pvelmax(:)         = dtin%pvelmax(:)
1083  dtout%red_efield(:)      = dtin%red_efield(:)
1084  dtout%red_dfield(:)      = dtin%red_dfield(:)
1085  dtout%red_efieldbar(:)   = dtin%red_efieldbar(:)
1086  dtout%shiftk_orig        = dtin%shiftk_orig
1087  dtout%strtarget(:)       = dtin%strtarget(:)
1088  dtout%ucrpa_window(:)    = dtin%ucrpa_window(:)
1089  dtout%vcutgeo(:)         = dtin%vcutgeo(:)
1090  dtout%vprtrb(:)          = dtin%vprtrb(:)
1091  dtout%zeemanfield(:)     = dtin%zeemanfield(:)
1092 
1093 !Use alloc_copy to allocate and copy the allocatable arrays
1094 
1095 !integer allocatables
1096  call alloc_copy( dtin%algalch, dtout%algalch)
1097 
1098  call alloc_copy( dtin%bdgw, dtout%bdgw)
1099 
1100  call alloc_copy( dtin%bs_loband, dtout%bs_loband)
1101 
1102  call alloc_copy( dtin%dynimage, dtout%dynimage)
1103 
1104  call alloc_copy( dtin%efmas_bands, dtout%efmas_bands)
1105 
1106  call alloc_copy( dtin%iatfix, dtout%iatfix)
1107 
1108  call alloc_copy( dtin%iatsph, dtout%iatsph)
1109 
1110  call alloc_copy( dtin%istwfk, dtout%istwfk)
1111 
1112  call alloc_copy( dtin%kberry, dtout%kberry)
1113 
1114  call alloc_copy( dtin%lexexch, dtout%lexexch)
1115 
1116  call alloc_copy( dtin%ldaminushalf, dtout%ldaminushalf)
1117 
1118  call alloc_copy( dtin%lpawu, dtout%lpawu)
1119 
1120  call alloc_copy( dtin%nband, dtout%nband)
1121 
1122  call alloc_copy( dtin%plowan_iatom, dtout%plowan_iatom)
1123 
1124  call alloc_copy( dtin%plowan_it, dtout%plowan_it)
1125 
1126  call alloc_copy( dtin%plowan_nbl, dtout%plowan_nbl)
1127 
1128  call alloc_copy( dtin%plowan_lcalc, dtout%plowan_lcalc)
1129 
1130  call alloc_copy( dtin%plowan_projcalc, dtout%plowan_projcalc)
1131 
1132  call alloc_copy( dtin%prtatlist, dtout%prtatlist)
1133 
1134  call alloc_copy( dtin%so_psp, dtout%so_psp)
1135 
1136  call alloc_copy( dtin%symafm, dtout%symafm)
1137 
1138  call alloc_copy( dtin%symrel, dtout%symrel)
1139 
1140  call alloc_copy( dtin%typat, dtout%typat)
1141 
1142 !Allocate and copy real allocatable
1143  call alloc_copy( dtin%acell_orig, dtout%acell_orig)
1144 
1145  call alloc_copy( dtin%amu_orig, dtout%amu_orig)
1146 
1147  call alloc_copy( dtin%atvshift, dtout%atvshift)
1148 
1149  call alloc_copy( dtin%cd_imfrqs, dtout%cd_imfrqs)
1150 
1151  call alloc_copy( dtin%chempot, dtout%chempot)
1152 
1153  call alloc_copy( dtin%corecs, dtout%corecs)
1154 
1155  call alloc_copy( dtin%densty, dtout%densty)
1156 
1157  call alloc_copy( dtin%dmatpawu, dtout%dmatpawu)
1158 
1159  call alloc_copy( dtin%efmas_dirs, dtout%efmas_dirs)
1160 
1161  call alloc_copy( dtin%f4of2_sla, dtout%f4of2_sla)
1162 
1163  call alloc_copy( dtin%f6of2_sla, dtout%f6of2_sla)
1164 
1165  call alloc_copy( dtin%gw_qlwl, dtout%gw_qlwl)
1166 
1167  call alloc_copy( dtin%gw_freqsp, dtout%gw_freqsp)
1168 
1169  call alloc_copy( dtin%gwls_list_proj_freq, dtout%gwls_list_proj_freq)
1170 
1171  call alloc_copy( dtin%jpawu, dtout%jpawu)
1172 
1173  call alloc_copy( dtin%kpt, dtout%kpt)
1174 
1175  call alloc_copy( dtin%kptgw, dtout%kptgw)
1176 
1177  call alloc_copy( dtin%kptns, dtout%kptns)
1178 
1179  call alloc_copy( dtin%kptns_hf, dtout%kptns_hf)
1180 
1181  call alloc_copy( dtin%mixalch_orig, dtout%mixalch_orig)
1182 
1183  call alloc_copy( dtin%mixesimgf, dtout%mixesimgf)
1184 
1185  call alloc_copy( dtin%nucdipmom, dtout%nucdipmom)
1186 
1187  call alloc_copy( dtin%occ_orig, dtout%occ_orig)
1188 
1189  call alloc_copy( dtin%pimass, dtout%pimass)
1190 
1191  call alloc_copy( dtin%ptcharge, dtout%ptcharge)
1192 
1193  call alloc_copy( dtin%qmass, dtout%qmass)
1194 
1195  call alloc_copy( dtin%qptdm, dtout%qptdm)
1196 
1197  call alloc_copy( dtin%quadmom, dtout%quadmom)
1198 
1199  call alloc_copy( dtin%ratsph, dtout%ratsph)
1200 
1201  call alloc_copy( dtin%rprim_orig, dtout%rprim_orig)
1202 
1203  call alloc_copy( dtin%rprimd_orig, dtout%rprimd_orig)
1204 
1205  call alloc_copy( dtin%shiftk, dtout%shiftk)
1206 
1207  call alloc_copy( dtin%spinat, dtout%spinat)
1208 
1209  call alloc_copy( dtin%tnons, dtout%tnons)
1210 
1211  call alloc_copy( dtin%upawu, dtout%upawu)
1212 
1213  call alloc_copy( dtin%vel_orig, dtout%vel_orig)
1214 
1215  call alloc_copy( dtin%vel_cell_orig, dtout%vel_cell_orig)
1216 
1217  call alloc_copy( dtin%wtatcon, dtout%wtatcon)
1218 
1219  call alloc_copy( dtin%wtk, dtout%wtk)
1220 
1221  call alloc_copy( dtin%xred_orig, dtout%xred_orig)
1222 
1223  call alloc_copy( dtin%xredsph_extra, dtout%xredsph_extra)
1224 
1225  call alloc_copy( dtin%ziontypat, dtout%ziontypat)
1226 
1227  call alloc_copy( dtin%znucl, dtout%znucl)
1228 
1229  DBG_EXIT("COLL")
1230 
1231  dtout%ndivsm = dtin%ndivsm
1232  dtout%nkpath = dtin%nkpath
1233  dtout%einterp = dtin%einterp
1234  call alloc_copy(dtin%kptbounds, dtout%kptbounds)
1235  dtout%tmesh = dtin%tmesh
1236 
1237 end subroutine dtset_copy

m_dtset/dtset_free [ Functions ]

[ Top ] [ m_dtset ] [ Functions ]

NAME

 dtset_free

FUNCTION

 Free a dataset after use.

SIDE EFFECTS

  dtset <type(dataset_type)>=free all allocated allocatable.

PARENTS

      chkinp,dfpt_looppert,driver,gwls_hamiltonian,m_ab7_invars_f90,m_io_kss
      mover_effpot

CHILDREN

SOURCE

1260 subroutine dtset_free(dtset)
1261 
1262 
1263 !This section has been created automatically by the script Abilint (TD).
1264 !Do not modify the following lines by hand.
1265 #undef ABI_FUNC
1266 #define ABI_FUNC 'dtset_free'
1267 !End of the abilint section
1268 
1269  implicit none
1270 
1271 !Arguments ------------------------------------
1272 !scalars
1273  type(dataset_type),intent(inout) :: dtset
1274 
1275 ! *************************************************************************
1276 
1277 !please, use the same order as the one used in the declaration of the type (see defs_abitypes).
1278 
1279  !@dataset_type
1280 !integer allocatable
1281  if (allocated(dtset%algalch))     then
1282    ABI_DEALLOCATE(dtset%algalch)
1283  end if
1284  if (allocated(dtset%bdgw))        then
1285    ABI_DEALLOCATE(dtset%bdgw)
1286  end if
1287   if (allocated(dtset%bs_loband))  then
1288     ABI_DEALLOCATE(dtset%bs_loband)
1289   end if
1290 
1291  if (allocated(dtset%dynimage))    then
1292    ABI_DEALLOCATE(dtset%dynimage)
1293  end if
1294  if (allocated(dtset%efmas_bands))        then
1295    ABI_DEALLOCATE(dtset%efmas_bands)
1296  end if
1297  if (allocated(dtset%iatfix))      then
1298    ABI_DEALLOCATE(dtset%iatfix)
1299  end if
1300  if (allocated(dtset%iatsph))      then
1301    ABI_DEALLOCATE(dtset%iatsph)
1302  end if
1303  if (allocated(dtset%istwfk))      then
1304    ABI_DEALLOCATE(dtset%istwfk)
1305  end if
1306  if (allocated(dtset%kberry))      then
1307    ABI_DEALLOCATE(dtset%kberry)
1308  end if
1309  if (allocated(dtset%lexexch))     then
1310    ABI_DEALLOCATE(dtset%lexexch)
1311  end if
1312  if (allocated(dtset%ldaminushalf))     then
1313    ABI_DEALLOCATE(dtset%ldaminushalf)
1314  end if
1315  if (allocated(dtset%lpawu))       then
1316    ABI_DEALLOCATE(dtset%lpawu)
1317  end if
1318  if (allocated(dtset%nband))       then
1319    ABI_DEALLOCATE(dtset%nband)
1320  end if
1321  if (allocated(dtset%ph_freez_disp_ampl)) then
1322    ABI_DEALLOCATE(dtset%ph_freez_disp_ampl)
1323  end if
1324  if (allocated(dtset%ph_qpath)) then
1325    ABI_DEALLOCATE(dtset%ph_qpath)
1326  end if
1327  if (allocated(dtset%ph_qshift)) then
1328    ABI_DEALLOCATE(dtset%ph_qshift)
1329  end if
1330  if (allocated(dtset%plowan_iatom))       then
1331    ABI_DEALLOCATE(dtset%plowan_iatom)
1332  end if
1333  if (allocated(dtset%plowan_it))       then
1334    ABI_DEALLOCATE(dtset%plowan_it)
1335  end if
1336  if (allocated(dtset%plowan_lcalc))       then
1337    ABI_DEALLOCATE(dtset%plowan_lcalc)
1338  end if
1339  if (allocated(dtset%plowan_nbl))       then
1340    ABI_DEALLOCATE(dtset%plowan_nbl)
1341  end if
1342  if (allocated(dtset%plowan_projcalc))       then
1343    ABI_DEALLOCATE(dtset%plowan_projcalc)
1344  end if
1345  if (allocated(dtset%prtatlist))   then
1346    ABI_DEALLOCATE(dtset%prtatlist)
1347  end if
1348  if (allocated(dtset%so_psp))      then
1349    ABI_DEALLOCATE(dtset%so_psp)
1350  end if
1351  if (allocated(dtset%symafm))      then
1352    ABI_DEALLOCATE(dtset%symafm)
1353  end if
1354  if (allocated(dtset%symrel))      then
1355    ABI_DEALLOCATE(dtset%symrel)
1356  end if
1357  if (allocated(dtset%typat))       then
1358    ABI_DEALLOCATE(dtset%typat)
1359  end if
1360 
1361 !real allocatable
1362  if (allocated(dtset%acell_orig))  then
1363    ABI_DEALLOCATE(dtset%acell_orig)
1364  end if
1365  if (allocated(dtset%amu_orig))    then
1366    ABI_DEALLOCATE(dtset%amu_orig)
1367  end if
1368  if (allocated(dtset%atvshift))    then
1369    ABI_DEALLOCATE(dtset%atvshift)
1370  end if
1371  if (allocated(dtset%cd_imfrqs))   then
1372    ABI_DEALLOCATE(dtset%cd_imfrqs)
1373  end if
1374  if (allocated(dtset%chempot))    then
1375    ABI_DEALLOCATE(dtset%chempot)
1376  end if
1377  if (allocated(dtset%corecs))      then
1378    ABI_DEALLOCATE(dtset%corecs)
1379  end if
1380  if (allocated(dtset%densty))      then
1381    ABI_DEALLOCATE(dtset%densty)
1382  end if
1383  if (allocated(dtset%dmatpawu))    then
1384    ABI_DEALLOCATE(dtset%dmatpawu)
1385  end if
1386  if (allocated(dtset%efmas_dirs))        then
1387    ABI_DEALLOCATE(dtset%efmas_dirs)
1388  end if
1389  if (allocated(dtset%gw_qlwl))     then
1390    ABI_DEALLOCATE(dtset%gw_qlwl)
1391  end if
1392  if (allocated(dtset%gw_freqsp))   then
1393    ABI_DEALLOCATE(dtset%gw_freqsp)
1394  end if
1395  if (allocated(dtset%gwls_list_proj_freq))   then
1396    ABI_DEALLOCATE(dtset%gwls_list_proj_freq)
1397  end if
1398  if (allocated(dtset%f4of2_sla))   then
1399    ABI_DEALLOCATE(dtset%f4of2_sla)
1400  end if
1401  if (allocated(dtset%f6of2_sla))   then
1402    ABI_DEALLOCATE(dtset%f6of2_sla)
1403  end if
1404  if (allocated(dtset%jpawu))       then
1405    ABI_DEALLOCATE(dtset%jpawu)
1406  end if
1407  if (allocated(dtset%kpt))         then
1408    ABI_DEALLOCATE(dtset%kpt)
1409  end if
1410  if (allocated(dtset%kptbounds)) then
1411    ABI_DEALLOCATE(dtset%kptbounds)
1412  end if
1413  if (allocated(dtset%kptgw))       then
1414    ABI_DEALLOCATE(dtset%kptgw)
1415  end if
1416  if (allocated(dtset%kptns))       then
1417    ABI_DEALLOCATE(dtset%kptns)
1418  end if
1419  if (allocated(dtset%kptns_hf))       then
1420    ABI_DEALLOCATE(dtset%kptns_hf)
1421  end if
1422  if (allocated(dtset%mixalch_orig))     then
1423    ABI_DEALLOCATE(dtset%mixalch_orig)
1424  end if
1425  if (allocated(dtset%mixesimgf))     then
1426    ABI_DEALLOCATE(dtset%mixesimgf)
1427  end if
1428  if (allocated(dtset%nucdipmom))      then
1429    ABI_DEALLOCATE(dtset%nucdipmom)
1430  end if
1431  if (allocated(dtset%occ_orig))    then
1432    ABI_DEALLOCATE(dtset%occ_orig)
1433  end if
1434  if (allocated(dtset%pimass))      then
1435    ABI_DEALLOCATE(dtset%pimass)
1436  end if
1437  if (allocated(dtset%ptcharge))    then
1438    ABI_DEALLOCATE(dtset%ptcharge)
1439  end if
1440  if (allocated(dtset%qmass))       then
1441    ABI_DEALLOCATE(dtset%qmass)
1442  end if
1443  if (allocated(dtset%qptdm))       then
1444    ABI_DEALLOCATE(dtset%qptdm)
1445  end if
1446  if (allocated(dtset%quadmom))     then
1447    ABI_DEALLOCATE(dtset%quadmom)
1448  end if
1449  if (allocated(dtset%ratsph))      then
1450    ABI_DEALLOCATE(dtset%ratsph)
1451  end if
1452  if (allocated(dtset%rprim_orig))  then
1453    ABI_DEALLOCATE(dtset%rprim_orig)
1454  end if
1455  if (allocated(dtset%rprimd_orig)) then
1456    ABI_DEALLOCATE(dtset%rprimd_orig)
1457  end if
1458  if (allocated(dtset%shiftk))      then
1459    ABI_DEALLOCATE(dtset%shiftk)
1460  end if
1461  if (allocated(dtset%spinat))      then
1462    ABI_DEALLOCATE(dtset%spinat)
1463  end if
1464  if (allocated(dtset%tnons))       then
1465    ABI_DEALLOCATE(dtset%tnons)
1466  end if
1467  if (allocated(dtset%upawu))       then
1468    ABI_DEALLOCATE(dtset%upawu)
1469  end if
1470  if (allocated(dtset%vel_orig))    then
1471    ABI_DEALLOCATE(dtset%vel_orig)
1472  end if
1473  if (allocated(dtset%vel_cell_orig))    then
1474    ABI_DEALLOCATE(dtset%vel_cell_orig)
1475  end if
1476  if (allocated(dtset%wtatcon))     then
1477    ABI_DEALLOCATE(dtset%wtatcon)
1478  end if
1479  if (allocated(dtset%wtk))         then
1480    ABI_DEALLOCATE(dtset%wtk)
1481  end if
1482  if (allocated(dtset%xred_orig))   then
1483    ABI_DEALLOCATE(dtset%xred_orig)
1484  end if
1485  if (allocated(dtset%xredsph_extra))   then
1486    ABI_DEALLOCATE(dtset%xredsph_extra)
1487  end if
1488  if (allocated(dtset%ziontypat))   then
1489    ABI_DEALLOCATE(dtset%ziontypat)
1490  end if
1491  if (allocated(dtset%znucl)) then
1492    ABI_DEALLOCATE(dtset%znucl)
1493  end if
1494 
1495 end subroutine dtset_free

m_dtset/find_getdtset [ Functions ]

[ Top ] [ m_dtset ] [ Functions ]

NAME

 find_getdtset

FUNCTION

 Find the number of the dataset (iget) for a given value of a "get" variable (getvalue)
 of name getname, given the number of the current dataset (idtset).
 Also find the coefficients of mixing of the images of the old dataset, to initialize the new dataset images
 (use a linear interpolation)

INPUTS

 dtsets(0:ndtset_alloc)=<type datasets_type>contains all input variables
 getvalue=value of the get variable
 getname=name of the get variable
 idtset=number of the current dataset
 mxnimage=dimension of miximage
 ndtset_alloc=dimension of dtsets

OUTPUT

 iget=number of the dataset from which the value must be get, 0 if the data should not be got from another dataset
 miximage(mxnimage,mxnimage)=coefficients of mixing of the images of the old dataset, to initialize the new dataset images

PARENTS

      driver

CHILDREN

      wrtout

SOURCE

1528 subroutine find_getdtset(dtsets,getvalue,getname,idtset,iget,miximage,mxnimage,ndtset_alloc)
1529 
1530 
1531 !This section has been created automatically by the script Abilint (TD).
1532 !Do not modify the following lines by hand.
1533 #undef ABI_FUNC
1534 #define ABI_FUNC 'find_getdtset'
1535 !End of the abilint section
1536 
1537  implicit none
1538 
1539 !Arguments ------------------------------------
1540 !scalars
1541  integer, intent(in) :: getvalue,idtset,mxnimage,ndtset_alloc
1542  integer, intent(out) :: iget
1543  real(dp), intent(out) :: miximage(mxnimage,mxnimage)
1544  character(len=*),intent(in) :: getname
1545  type(dataset_type),intent(in) :: dtsets(0:ndtset_alloc)
1546 
1547 !Local variables-------------------------------
1548  integer :: iimage
1549  real(dp) :: newimage_get,ratio
1550  character(len=500) :: message
1551 
1552 ! *************************************************************************
1553 
1554  iget=0
1555  if(getvalue>0 .or. (getvalue<0 .and. idtset+getvalue>0) )then
1556 !  In case getvalue is a negative number (so must add to idtset)
1557    if(getvalue<0 .and. idtset+getvalue>0) iget=idtset+getvalue
1558    if(getvalue>0)then
1559      do iget=1,idtset
1560        if( dtsets(iget)%jdtset==getvalue )exit
1561      end do
1562      if(iget==idtset)then
1563 !      The index of the dataset, from which the data ought to be taken,
1564 !      does not correspond to a previous dataset.
1565        write(message, '(a,i3,4a,i3,7a)' )&
1566 &       'The component number',idtset,' of the input variable ',trim(getname),',',&
1567 &       ' equal to',getvalue,',',ch10,&
1568 &       'does not correspond to an existing index.',ch10,&
1569 &       'Action: correct ',trim(getname),' or jdtset in your input file.'
1570        MSG_ERROR(message)
1571      end if
1572    end if
1573    write(message, '(3a,i3,2a)' )&
1574 &   ' find_getdtset : ',trim(getname),'/=0, take data from output of dataset with index',dtsets(iget)%jdtset,'.',ch10
1575    call wrtout(ab_out,message,'COLL')
1576    call wrtout(std_out,message,'COLL')
1577  end if
1578 
1579 !For the time being, uses a simple interpolation when the images do not match. If only one image, take the first get image.
1580  miximage(:,:)=zero
1581  if(dtsets(idtset)%nimage==1)then
1582    miximage(1,1)=one
1583  else
1584    do iimage=1,dtsets(idtset)%nimage
1585      ratio=(iimage-one)/real(dtsets(idtset)%nimage-one)
1586      newimage_get=one+ratio*(dtsets(iget)%nimage-one)
1587      if(abs(newimage_get-nint(newimage_get))<tol8)then
1588        miximage(iimage,nint(newimage_get))=one
1589      else
1590        miximage(iimage,floor(newimage_get))=one-(newimage_get-floor(newimage_get))
1591        miximage(iimage,ceiling(newimage_get))=one-miximage(iimage,floor(newimage_get))
1592      end if
1593    end do
1594  end if
1595 
1596 end subroutine find_getdtset

m_dtset/get_npert_rbz [ Functions ]

[ Top ] [ m_dtset ] [ Functions ]

NAME

 get_npert_rbz

FUNCTION

 Get the number of effective pertubation done in looper3, nkpt_rbz, nband_rbz

INPUTS

  dtset <type(dataset_type)>=all input variables for this dataset

OUTPUT

  npert=number of effective pertubation done in looper3
  nkpt_rbz= nkpt in the reduced brillouin zone
  nband_rbz= nband in the reduced brillouin zone

PARENTS

      finddistrproc,initmpi_pert,mpi_setup

CHILDREN

      irreducible_set_pert,littlegroup_pert,littlegroup_q,mati3inv,metric
      mkrdim,symatm,symkpt,wrtout

SOURCE

1623 subroutine get_npert_rbz(dtset,nband_rbz,nkpt_rbz,npert)
1624 
1625  use m_symkpt,     only : symkpt
1626 
1627 !This section has been created automatically by the script Abilint (TD).
1628 !Do not modify the following lines by hand.
1629 #undef ABI_FUNC
1630 #define ABI_FUNC 'get_npert_rbz'
1631 !End of the abilint section
1632 
1633  implicit none
1634 
1635 !Arguments ------------------------------------
1636 !scalars
1637  integer,intent(out) :: npert
1638 !arrays
1639  integer,pointer :: nkpt_rbz(:)
1640  real(dp),pointer :: nband_rbz(:,:)
1641  type(dataset_type),intent(in) :: dtset
1642 
1643 !Local variables-------------------------------
1644 !scalars
1645  integer :: icase,idir,ikpt,ikpt1,ipert,isppol,isym,maxidir,mpert,nband_k,nsym1,timrev,timrev_pert
1646  integer :: to_compute_this_pert
1647  real(dp) :: tolsym8,ucvol
1648  character(len=500) :: message
1649 !arrays
1650  integer :: rfdir(9),rf2dir(9),rf2_dir1(3),rf2_dir2(3)
1651  integer,allocatable :: indkpt1(:,:),indsym(:,:,:),pertsy(:,:),rfpert(:),symq(:,:,:),symrec(:,:,:)
1652  integer, allocatable :: pert_tmp(:,:), pert_calc(:,:)
1653  integer,allocatable :: symaf1(:),symrc1(:,:,:),symrl1(:,:,:),symrl1_tmp(:,:,:)
1654  real(dp) :: gmet(3,3),gprimd(3,3),rmet(3,3),rprimd(3,3)
1655  real(dp),allocatable :: tnons1_tmp(:,:),wtk_folded(:)
1656 
1657 ! *************************************************************************
1658 
1659 !Define the set of admitted perturbations
1660  mpert=dtset%natom+6
1661  if(dtset%natom+10/=0.or.dtset%natom+11/=0) mpert=dtset%natom+11
1662 
1663  ABI_ALLOCATE(symrec,(3,3,dtset%nsym))
1664 !Get the symmetry matrices in terms of reciprocal basis
1665  do isym=1,dtset%nsym
1666    call mati3inv(dtset%symrel(:,:,isym),symrec(:,:,isym))
1667  end do
1668 
1669  ABI_ALLOCATE(indsym,(4,dtset%nsym,dtset%natom))
1670 !Obtain a list of rotated atom labels:
1671  tolsym8=tol8
1672  call symatm(indsym,dtset%natom,dtset%nsym,symrec,dtset%tnons,tolsym8,dtset%typat,dtset%xred_orig)
1673 
1674  ABI_ALLOCATE(symq,(4,2,dtset%nsym))
1675  timrev=1
1676  call littlegroup_q(dtset%nsym,dtset%qptn,symq,symrec,dtset%symafm,timrev)
1677 
1678 !Initialize the list of perturbations rfpert
1679  ABI_ALLOCATE(rfpert,(mpert))
1680  rfpert(:)=0
1681  if(dtset%rfphon==1)rfpert(dtset%rfatpol(1):dtset%rfatpol(2))=1
1682 
1683  if(dtset%rfddk==1)rfpert(dtset%natom+1)=1
1684  if(dtset%rfddk==2)rfpert(dtset%natom+6)=1
1685 
1686  if(dtset%rf2_dkdk/=0) rfpert(dtset%natom+10)=1
1687  if(dtset%rf2_dkde/=0) rfpert(dtset%natom+11)=1
1688 
1689  if(dtset%rfelfd==1.or.dtset%rfelfd==2)rfpert(dtset%natom+1)=1
1690  if(dtset%rfelfd==1.or.dtset%rfelfd==3)rfpert(dtset%natom+2)=1
1691 
1692  if(dtset%rfstrs==1.or.dtset%rfstrs==3)rfpert(dtset%natom+3)=1
1693  if(dtset%rfstrs==2.or.dtset%rfstrs==3)rfpert(dtset%natom+4)=1
1694 
1695  if(dtset%rfuser==1.or.dtset%rfuser==3)rfpert(dtset%natom+6)=1
1696  if(dtset%rfuser==2.or.dtset%rfuser==3)rfpert(dtset%natom+7)=1
1697 
1698  if(dtset%rfmagn==1) rfpert(dtset%natom+5)=1
1699 
1700  ABI_ALLOCATE(pertsy,(3,mpert))
1701  call irreducible_set_pert(indsym,mpert,dtset%natom,dtset%nsym,pertsy,dtset%rfdir,rfpert,symq,symrec,dtset%symrel)
1702  npert=0
1703 ! ABI_ALLOCATE(pert_tmp,(3*mpert))
1704 
1705 ! do ipert=1,mpert
1706 !   do idir=1,3
1707 !     if( rfpert(ipert)==1 .and. dtset%rfdir(idir) == 1 )then
1708 !       if (pertsy(idir,ipert)==1.or.&
1709 !&       (dtset%prepanl == 1.and.ipert == dtset%natom+2).or.&
1710 !&       (dtset%prepgkk == 1.and.ipert <= dtset%natom)  ) then
1711 !         npert = npert+1;
1712 !         pert_tmp(npert) = idir+(ipert-1)*3;
1713 !       else
1714 !         write(message, '(a,a,i0,a,i0,a,a,a,a,a,a)' )ch10,&
1715 !&         'The perturbation idir=',idir,'  ipert=',ipert,' is',ch10,&
1716 !&         'symmetric of a previously calculated perturbation.',ch10,&
1717 !&         'So, its SCF calculation is not needed.',ch10
1718 !         call wrtout(std_out,message,'COLL')
1719 !       end if ! Test of existence of symmetry of perturbation
1720 !     end if ! Test of existence of perturbation
1721 !   end do
1722 ! end do
1723 
1724 !Initialize rf2dir :
1725  rf2_dir1(1:3)=dtset%rf2_pert1_dir(1:3)
1726  rf2_dir2(1:3)=dtset%rf2_pert2_dir(1:3)
1727 !Diagonal terms :
1728  rf2dir(1) = rf2_dir1(1)*rf2_dir2(1)
1729  rf2dir(2) = rf2_dir1(2)*rf2_dir2(2)
1730  rf2dir(3) = rf2_dir1(3)*rf2_dir2(3)
1731 !Upper triangular terms :
1732  rf2dir(4) = rf2_dir1(2)*rf2_dir2(3)
1733  rf2dir(5) = rf2_dir1(1)*rf2_dir2(3)
1734  rf2dir(6) = rf2_dir1(1)*rf2_dir2(2)
1735 !Lower triangular terms :
1736  rf2dir(7) = rf2_dir1(3)*rf2_dir2(2)
1737  rf2dir(8) = rf2_dir1(3)*rf2_dir2(1)
1738  rf2dir(9) = rf2_dir1(2)*rf2_dir2(1)
1739 
1740 !Determine existence of pertubations and of pertubation symmetries
1741 !Create array with pertubations which have to be calculated
1742  ABI_ALLOCATE(pert_tmp,(2,3*(dtset%natom+6)+18))
1743 
1744  do ipert=1,mpert
1745    if (ipert<dtset%natom+10) then
1746      maxidir = 3
1747      rfdir(1:3) = dtset%rfdir(:)
1748      rfdir(4:9) = 0
1749    else
1750      maxidir = 9
1751      rfdir(1:9) = rf2dir(:)
1752    end if
1753    do idir=1,maxidir
1754      if( rfpert(ipert)==1 .and. rfdir(idir) == 1 )then
1755        to_compute_this_pert = 0
1756        if (ipert>=dtset%natom+10) then
1757          to_compute_this_pert = 1
1758        else if ((pertsy(idir,ipert)==1).or.&
1759 &         ((dtset%prepanl == 1).and.(ipert == dtset%natom+2)).or.&
1760 &         ((dtset%prepgkk == 1).and.(ipert <= dtset%natom))  ) then
1761          to_compute_this_pert = 1
1762        end if
1763        if (to_compute_this_pert /= 0) then
1764          npert = npert+1;
1765          pert_tmp(1,npert) = ipert
1766          pert_tmp(2,npert) = idir
1767        else
1768          write(message, '(a,a,i4,a,i4,a,a,a,a,a,a)' )ch10,&
1769 &         ' The perturbation idir=',idir,'  ipert=',ipert,' is',ch10,&
1770 &         ' symmetric of a previously calculated perturbation.',ch10,&
1771 &         ' So, its SCF calculation is not needed.',ch10
1772          call wrtout(std_out,message,'COLL')
1773        end if ! Test of existence of symmetry of perturbation
1774      end if ! Test of existence of perturbation
1775    end do
1776  end do
1777  ABI_ALLOCATE(pert_calc,(2,npert))
1778  do icase=1,npert
1779    pert_calc(:,icase)=pert_tmp(:,icase)
1780  end do
1781  ABI_DEALLOCATE(pert_tmp)
1782  ABI_DEALLOCATE(pertsy)
1783  ABI_DEALLOCATE(rfpert)
1784 
1785 ! Write YAML doc with the list of irreducible perturbations. Example.
1786 !
1787 !--- !IrredPerts
1788 !# List of irreducible perturbations
1789 !irred_perts:
1790 !  - qpt: [ 0.0000000000000000,  0.0000000000000000,  0.0000000000000000]
1791 !    ipert : 1
1792 !    idir  : 1
1793 !  - qpt: [ 0.0000000000000000,  0.0000000000000000,  0.0000000000000000]
1794 !    ipert : 2
1795 !    idir  : 1
1796 !..
1797  write(std_out,'(a)')"--- !IrredPerts"
1798  write(std_out,'(a)')'# List of irreducible perturbations'
1799  write(std_out,'(a)')'irred_perts:'
1800 
1801  do icase=1,npert
1802 !   pert = pert_tmp(icase)
1803 
1804 !   if (pert <= dtset%natom*3) then
1805 !     idir = mod(pert, 3)
1806 !     if (idir==0) idir=3
1807 !     ipert=((pert-idir) / 3 + 1)
1808 !   else
1809 !     idir = mod(pert, 3)
1810 !     if (idir==0) idir=3
1811 !     ipert = dtset%natom + ((pert - 3*dtset%natom - 1) / 3) + 1
1812 !   end if
1813    ipert = pert_calc(1,icase)
1814    idir = pert_calc(2,icase)
1815 
1816    write(std_out,'(a,3(f20.16,a))')"   - qpt: [ ",dtset%qptn(1),", ", dtset%qptn(2),", ", dtset%qptn(3),"]"
1817    write(std_out,'(a,i0)')"     ipert: ",ipert
1818    write(std_out,'(a,i0)')"     idir: ",idir
1819  end do
1820 
1821  write(std_out,'(a)')"..."
1822 
1823 ! ABI_ALLOCATE(pert_calc,(npert))
1824 ! do icase=1,npert
1825 !   pert_calc(icase) = pert_tmp(icase)
1826 ! end do
1827 
1828  call mkrdim(dtset%acell_orig(1:3,1),dtset%rprim_orig(1:3,1:3,1),rprimd)
1829  call metric(gmet,gprimd,std_out,rmet,rprimd,ucvol)
1830 
1831  ABI_ALLOCATE(nkpt_rbz,(npert))
1832  ABI_ALLOCATE(indkpt1,(dtset%nkpt,npert))
1833  indkpt1=0
1834 
1835  do icase=1,npert
1836 !   if (pert_calc(icase) <= dtset%natom*3) then
1837 !     idir = mod(pert_calc(icase),3)
1838 !     if (idir==0) idir=3
1839 !     ipert=( (pert_calc(icase)-idir) / 3 + 1)
1840 !   else
1841 !     ipert = dtset%natom + ((pert_calc(icase) - 3*dtset%natom - 1) / 3) + 1
1842 !     idir = mod(pert_calc(icase),3)
1843 !     if (idir==0) idir=3
1844 !   end if
1845    ipert = pert_calc(1,icase)
1846    idir = pert_calc(2,icase)
1847 
1848    ABI_ALLOCATE(symrl1_tmp,(3,3,dtset%nsym))
1849    ABI_ALLOCATE(symaf1,(dtset%nsym))
1850    ABI_ALLOCATE(tnons1_tmp,(3,dtset%nsym))
1851 !  MJV TODO: check whether prepgkk should be used here
1852    if (dtset%prepanl /= 1 .and. dtset%berryopt /=4 .and. dtset%berryopt /=6 .and. dtset%berryopt /=7 .and. &
1853 &   dtset%berryopt /=14 .and. dtset%berryopt /=16 .and. dtset%berryopt /=17) then   !!HONG
1854      call littlegroup_pert(gprimd,idir,indsym,std_out,ipert,dtset%natom,dtset%nsym,nsym1,2,&
1855 &     dtset%symafm,symaf1,symq,symrec,&
1856 &     dtset%symrel,symrl1_tmp,0,dtset%tnons,tnons1_tmp)
1857    else
1858      nsym1 = 1
1859    end if
1860    ABI_DEALLOCATE(tnons1_tmp)
1861    ABI_DEALLOCATE(symaf1)
1862 
1863    ABI_ALLOCATE(symrc1,(3,3,nsym1))
1864    ABI_ALLOCATE(symrl1,(3,3,nsym1))
1865    symrl1(:,:,1:nsym1)=symrl1_tmp(:,:,1:nsym1)
1866    ABI_DEALLOCATE(symrl1_tmp)
1867    do isym=1,nsym1
1868      call mati3inv(symrl1(:,:,isym),symrc1(:,:,isym))
1869    end do
1870    ABI_DEALLOCATE(symrl1)
1871 
1872    ABI_ALLOCATE(wtk_folded,(dtset%nkpt))
1873    timrev_pert=timrev
1874    if(dtset%ieig2rf>0) then
1875      call symkpt(0,gmet,indkpt1(:,icase),std_out,dtset%kptns,dtset%nkpt,nkpt_rbz(icase),&
1876 &     1,symrc1,0,dtset%wtk,wtk_folded)
1877    else
1878 !    For the time being, the time reversal symmetry is not used
1879 !    for ddk, elfd, mgfd perturbations.
1880      if(ipert==dtset%natom+1 .or. ipert==dtset%natom+10 .or. ipert==dtset%natom+11 .or. &
1881 &     ipert==dtset%natom+2 .or. dtset%berryopt==4 .or. dtset%berryopt==6 .or. dtset%berryopt==7  &
1882 &     .or. dtset%berryopt==14 .or. dtset%berryopt==16 .or. dtset%berryopt==17 )timrev_pert=0  !!HONG
1883      call symkpt(0,gmet,indkpt1(:,icase),std_out,dtset%kptns,dtset%nkpt,nkpt_rbz(icase),&
1884      nsym1,symrc1,timrev_pert,dtset%wtk,wtk_folded)
1885    end if
1886    ABI_DEALLOCATE(wtk_folded)
1887    ABI_DEALLOCATE(symrc1)
1888  end do
1889 
1890  ABI_ALLOCATE(nband_rbz,(maxval(nkpt_rbz)*dtset%nsppol,npert))
1891  nband_rbz=zero
1892  do icase=1,npert
1893    do isppol=1,dtset%nsppol
1894      ikpt1=1
1895      do ikpt=1,dtset%nkpt
1896        nband_k=dtset%nband(ikpt+(isppol-1)*dtset%nkpt)
1897 !      Must test against ikpt1/=nkpt_rbz+1, before evaluate indkpt1(ikpt1)
1898        if(ikpt1/=nkpt_rbz(icase)+1)then
1899          if(ikpt==indkpt1(ikpt1,icase))then
1900            nband_rbz(ikpt1+(isppol-1)*nkpt_rbz(icase),icase)=nband_k
1901          end if
1902        end if
1903      end do
1904    end do
1905 
1906  end do
1907 
1908  ABI_DEALLOCATE(indkpt1)
1909  ABI_DEALLOCATE(symq)
1910  ABI_DEALLOCATE(symrec)
1911  ABI_DEALLOCATE(indsym)
1912  ABI_DEALLOCATE(pert_calc)
1913 
1914 end subroutine get_npert_rbz

m_dtset/macroin [ Functions ]

[ Top ] [ m_dtset ] [ Functions ]

NAME

 macroin

FUNCTION

 Treat "macro" input variables, that can:

      - initialize several other input variables for one given dataset
      - initialize several other input variables for a set of datasets.
 Note that the treatment of these different types of macro input variables is different.
 Documentation of such input variables is very important, including the
 proper echo, in the output file, of what such input variables have done.

 Important information : all the "macro" input variables should be properly
 identifiable to be so, and it is proposed to make them start with the string "macro".

INPUTS

  ndtset_alloc=number of datasets, corrected for allocation of at
               least one data set.
  ecut_tmp(3,2,10)= possible ecut values as read in psp files

OUTPUT

  dtsets(0:ndtset_alloc)=<type datafiles_type>contains all input variables,
   some of which are given a value here.
   The dataset with number 0 should NOT be modified in the present routine.

PARENTS

      m_ab7_invars_f90

CHILDREN

      intagm

SOURCE

2036 subroutine macroin(dtsets,ecut_tmp,lenstr,ndtset_alloc,string)
2037 
2038 
2039 !This section has been created automatically by the script Abilint (TD).
2040 !Do not modify the following lines by hand.
2041 #undef ABI_FUNC
2042 #define ABI_FUNC 'macroin'
2043 !End of the abilint section
2044 
2045  implicit none
2046 
2047 !Arguments ------------------------------------
2048 !scalars
2049  integer,intent(in) :: ndtset_alloc,lenstr
2050  character(len=*),intent(inout) :: string
2051 !arrays
2052  real(dp),intent(in) :: ecut_tmp(3,2,10)
2053  type(dataset_type),intent(inout) :: dtsets(0:ndtset_alloc) !vz_i ziontypat
2054 
2055 !Local variables -------------------------------
2056 !scalars
2057  integer :: idtset,iatom,jdtset,marr,tread
2058 !!arrays
2059  integer,allocatable :: intarr(:)
2060  real(dp) :: ecutmax(3),ecutdgmax(3)
2061  real(dp),allocatable :: dprarr(:)
2062  character(len=500) :: message
2063 !******************************************************************
2064 
2065  do idtset=1,ndtset_alloc
2066    jdtset=dtsets(idtset)%jdtset
2067    if (dtsets(idtset)%macro_uj>0) then
2068      dtsets(idtset)%irdwfk   = 1        ! preconverged wave function compulsory
2069 !    dtsets(idtset)%nline    = maxval((/ int(dtsets(idtset)%natom/2) , 6 /))   ! using default value: \DeltaU< 1%
2070 !    dtsets(idtset)%nnsclo   = 4        ! using default value: \DeltaU< 1%
2071      dtsets(idtset)%tolvrs   = 10d-8    ! convergence on the potential; 10d-8^= 10d-5 on occupation
2072      dtsets(idtset)%diemix   = 0.45_dp  ! fastest convergence: dn= E^(-istep * 0.229 )
2073      dtsets(idtset)%dmatpuopt= 3        ! normalization of the occupation operator
2074 !    dtsets(idtset)%nstep    = 255      ! expected convergence after 10 \pm 3, 30 as in default normally suficient
2075 !    dtsets(idtset)%iscf     = 17       ! mixing on potential, 17: default for PAW
2076    end if ! macro_uj
2077 
2078   !Read parameters
2079    marr=dtsets(idtset)%npsp;if (dtsets(idtset)%npsp<3) marr=3
2080    marr=max(marr,dtsets(idtset)%nimage)
2081    ABI_ALLOCATE(intarr,(marr))
2082    ABI_ALLOCATE(dprarr,(marr))
2083 
2084    call intagm(dprarr,intarr,jdtset,marr,1,string(1:lenstr),"accuracy",tread,'INT')
2085 
2086    ecutmax=-one
2087    ecutdgmax=-one
2088    do iatom=1,dtsets(idtset)%natom
2089      ecutmax(:)=max(ecutmax(:),ecut_tmp(:,1,dtsets(idtset)%typat(iatom)))
2090      ecutdgmax(:)=max(ecutdgmax(:),ecut_tmp(:,2,dtsets(idtset)%typat(iatom)))
2091    end do
2092 
2093    if(tread==1) then
2094      dtsets(idtset)%accuracy=intarr(1)
2095      if (dtsets(idtset)%accuracy==1) then
2096        if (ecutmax(1)>zero) dtsets(idtset)%ecut=ecutmax(1)
2097        if (ecutdgmax(1)>zero.and.dtsets(idtset)%usepaw==1) dtsets(idtset)%pawecutdg=ecutdgmax(1)
2098        dtsets(idtset)%boxcutmin=1.5_dp
2099        if (dtsets(idtset)%usepaw==1) then
2100          dtsets(idtset)%bxctmindg=1.5_dp
2101          dtsets(idtset)%pawxcdev=1
2102          dtsets(idtset)%pawmixdg=0
2103          dtsets(idtset)%pawovlp=10
2104          dtsets(idtset)%pawnhatxc=0
2105          dtsets(idtset)%mqgriddg=0
2106        end if
2107        dtsets(idtset)%mqgrid=0
2108        dtsets(idtset)%tolimg=5.0d-5
2109        dtsets(idtset)%tolvrs=tol3
2110        dtsets(idtset)%tolmxf=1.0d-3
2111        dtsets(idtset)%toldff=zero
2112        dtsets(idtset)%optforces=1
2113        dtsets(idtset)%timopt=0
2114        dtsets(idtset)%npulayit=4
2115        dtsets(idtset)%nstep=30
2116        dtsets(idtset)%prteig=0
2117        dtsets(idtset)%prtden=0
2118      else if (dtsets(idtset)%accuracy==2) then
2119        if (ecutmax(2)>zero) dtsets(idtset)%ecut=ecutmax(2)
2120        if (ecutdgmax(2)>zero.and.dtsets(idtset)%usepaw==1) dtsets(idtset)%pawecutdg=ecutdgmax(2)
2121        dtsets(idtset)%boxcutmin=1.8_dp
2122        if (dtsets(idtset)%usepaw==1) then
2123          dtsets(idtset)%bxctmindg=1.8_dp
2124          dtsets(idtset)%pawxcdev=1
2125          dtsets(idtset)%pawmixdg=0
2126          dtsets(idtset)%pawovlp=7
2127          dtsets(idtset)%pawnhatxc=1
2128          dtsets(idtset)%mqgriddg=0
2129        end if
2130        dtsets(idtset)%mqgrid=0
2131        dtsets(idtset)%tolimg=5.0d-5
2132        dtsets(idtset)%tolvrs=tol5
2133        dtsets(idtset)%tolmxf=5.0d-4
2134        dtsets(idtset)%toldff=zero
2135        dtsets(idtset)%optforces=1
2136        dtsets(idtset)%timopt=0
2137        dtsets(idtset)%npulayit=7
2138        dtsets(idtset)%nstep=30
2139        dtsets(idtset)%prteig=0
2140        dtsets(idtset)%prtden=0
2141      else if (dtsets(idtset)%accuracy==3) then
2142        if (ecutmax(2)>zero) dtsets(idtset)%ecut=ecutmax(2)
2143        if (ecutdgmax(2)>zero.and.dtsets(idtset)%usepaw==1) dtsets(idtset)%pawecutdg=ecutdgmax(2)
2144        dtsets(idtset)%boxcutmin=1.8_dp
2145        if (dtsets(idtset)%usepaw==1) then
2146          dtsets(idtset)%bxctmindg=1.8_dp
2147          dtsets(idtset)%pawxcdev=1
2148          dtsets(idtset)%pawmixdg=0
2149          dtsets(idtset)%pawovlp=7
2150          dtsets(idtset)%pawnhatxc=1
2151          dtsets(idtset)%mqgriddg=0
2152        end if
2153        dtsets(idtset)%mqgrid=0
2154        dtsets(idtset)%tolimg=5.0d-5
2155        dtsets(idtset)%tolvrs=tol7
2156        dtsets(idtset)%tolmxf=1.0d-4
2157        dtsets(idtset)%toldff=zero
2158        dtsets(idtset)%optforces=2
2159        dtsets(idtset)%timopt=1
2160        if(xmpi_paral==1) dtsets(idtset)%timopt = 0
2161        dtsets(idtset)%npulayit=7
2162        dtsets(idtset)%nstep=30
2163        dtsets(idtset)%prteig=1
2164        dtsets(idtset)%prtden=1
2165      else if (dtsets(idtset)%accuracy==4) then
2166        if (ecutmax(3)>zero) dtsets(idtset)%ecut=ecutmax(3)
2167        if (ecutdgmax(3)>zero.and.dtsets(idtset)%usepaw==1) dtsets(idtset)%pawecutdg=ecutdgmax(3)
2168        dtsets(idtset)%boxcutmin=two
2169        if (dtsets(idtset)%usepaw==1) then
2170          dtsets(idtset)%bxctmindg=two
2171          dtsets(idtset)%pawxcdev=1
2172          dtsets(idtset)%pawmixdg=0
2173          dtsets(idtset)%pawovlp=5
2174          dtsets(idtset)%pawnhatxc=1
2175          dtsets(idtset)%mqgriddg=0
2176        end if
2177        dtsets(idtset)%mqgrid=0
2178        dtsets(idtset)%tolimg=5.0d-5
2179        dtsets(idtset)%tolvrs=tol9
2180        dtsets(idtset)%tolmxf=5.0d-5
2181        dtsets(idtset)%toldff=zero
2182        dtsets(idtset)%optforces=2
2183        dtsets(idtset)%timopt=1
2184        if(xmpi_paral==1) dtsets(idtset)%timopt = 0
2185        dtsets(idtset)%npulayit=7
2186        dtsets(idtset)%nstep=30
2187        dtsets(idtset)%prteig=1
2188        dtsets(idtset)%prtden=1
2189      else if (dtsets(idtset)%accuracy==5) then
2190        if (ecutmax(2)>zero) dtsets(idtset)%ecut=ecutmax(2)
2191        if (ecutdgmax(2)>zero.and.dtsets(idtset)%usepaw==1) dtsets(idtset)%pawecutdg=ecutdgmax(2)
2192        dtsets(idtset)%boxcutmin=two
2193        if (dtsets(idtset)%usepaw==1) then
2194          dtsets(idtset)%bxctmindg=two
2195          dtsets(idtset)%pawxcdev=2
2196          dtsets(idtset)%pawmixdg=1
2197          dtsets(idtset)%pawovlp=5
2198          dtsets(idtset)%pawnhatxc=1
2199          dtsets(idtset)%mqgriddg=0
2200        end if
2201        dtsets(idtset)%mqgrid=0
2202        dtsets(idtset)%tolimg=5.0d-5
2203        dtsets(idtset)%tolvrs=tol10
2204        dtsets(idtset)%tolmxf=1.0d-6
2205        dtsets(idtset)%toldff=zero
2206        dtsets(idtset)%optforces=2
2207        dtsets(idtset)%timopt=1
2208        if(xmpi_paral==1) dtsets(idtset)%timopt = 0
2209        dtsets(idtset)%npulayit=15
2210        dtsets(idtset)%nstep=50
2211        dtsets(idtset)%prteig=1
2212        dtsets(idtset)%prtden=1
2213      else if (dtsets(idtset)%accuracy==6) then
2214        if (ecutmax(3)>zero) dtsets(idtset)%ecut=ecutmax(3)
2215        if (ecutdgmax(3)>zero.and.dtsets(idtset)%usepaw==1) dtsets(idtset)%pawecutdg=ecutdgmax(3)
2216        dtsets(idtset)%boxcutmin=two
2217        if (dtsets(idtset)%usepaw==1) then
2218          dtsets(idtset)%bxctmindg=two
2219          dtsets(idtset)%pawxcdev=2
2220          dtsets(idtset)%pawmixdg=1
2221          dtsets(idtset)%pawovlp=5
2222          dtsets(idtset)%pawnhatxc=1
2223          dtsets(idtset)%mqgriddg=0
2224        end if
2225        dtsets(idtset)%mqgrid=0
2226        dtsets(idtset)%tolimg=5.0d-5
2227        dtsets(idtset)%tolvrs=tol12
2228        dtsets(idtset)%tolmxf=1.0d-6
2229        dtsets(idtset)%toldff=zero
2230        dtsets(idtset)%optforces=2
2231        dtsets(idtset)%timopt=1
2232        if(xmpi_paral==1) dtsets(idtset)%timopt = 0
2233        dtsets(idtset)%npulayit=15
2234        dtsets(idtset)%nstep=50
2235        dtsets(idtset)%prteig=1
2236        dtsets(idtset)%prtden=1
2237      elseif(dtsets(idtset)%accuracy>6)then
2238        write(message, '(a,a,a)' )&
2239 &       'accuracy >6 is forbiden !',ch10,&
2240 &       'Action: check your input data file.'
2241        MSG_ERROR(message)
2242      end if
2243    else
2244      if (ecutmax(3)>zero) dtsets(idtset)%ecut=ecutmax(3)
2245    end if
2246    ABI_DEALLOCATE(intarr)
2247    ABI_DEALLOCATE(dprarr)
2248  end do
2249 
2250 end subroutine macroin

m_dtset/macroin2 [ Functions ]

[ Top ] [ m_dtset ] [ Functions ]

NAME

 macroin2

FUNCTION

 Treat "macro" input variables, that can :
 - initialize several other input variables for one given dataset
 - initialize several other input variables for a set of datasets.
 Note that the treatment of these different types of macro input variables is different.
 Documentation of such input variables is very important, including the
 proper echo, in the output file, of what such input variables have done.

 Important information : all the "macro" input variables should be properly
 identifiable to be so, and it is proposed to make them start with the string "macro".

INPUTS

  ndtset_alloc=number of datasets, corrected for allocation of at
               least one data set.

OUTPUT

  dtsets(0:ndtset_alloc)=<type datafiles_type>contains all input variables,
   some of which are given a value here.
   The dataset with number 0 should NOT be modified in the present routine.

PARENTS

      m_ab7_invars_f90

CHILDREN

SOURCE

2284 subroutine macroin2(dtsets,ndtset_alloc)
2285 
2286 
2287 !This section has been created automatically by the script Abilint (TD).
2288 !Do not modify the following lines by hand.
2289 #undef ABI_FUNC
2290 #define ABI_FUNC 'macroin2'
2291 !End of the abilint section
2292 
2293  implicit none
2294 
2295 !Arguments ------------------------------------
2296 !scalars
2297  integer,intent(in) :: ndtset_alloc
2298 !arrays
2299  type(dataset_type),intent(inout) :: dtsets(0:ndtset_alloc) !vz_i
2300 
2301 !Local variables -------------------------------
2302 !scalars
2303  integer :: idtset,pawujat              !,jdtset
2304 
2305 !******************************************************************
2306 
2307  do idtset=1,ndtset_alloc
2308 !  Set first PAW+U atom to perform atomic level shift
2309    if (dtsets(idtset)%typat(1)==0) cycle
2310    pawujat=dtsets(idtset)%pawujat
2311    pawujat=pawujat-count(dtsets(idtset)%lpawu( dtsets(idtset)%typat( 1:pawujat ))<0)
2312 
2313    if (dtsets(idtset)%macro_uj>0) then
2314 !    Level shift atom with amplitude pawujv
2315      dtsets(idtset)%atvshift(:,:,pawujat)=dtsets(idtset)%pawujv
2316 
2317 !    Case level shift only on one spin channel
2318      if ((dtsets(idtset)%macro_uj==2.or.dtsets(idtset)%macro_uj==3).and.dtsets(idtset)%nsppol==2) then
2319        dtsets(idtset)%atvshift(:,2,pawujat)=0_dp
2320      end if
2321 
2322    end if ! macro_uj
2323 
2324  end do
2325 
2326 end subroutine macroin2

m_dtset/testsusmat [ Functions ]

[ Top ] [ m_dtset ] [ Functions ]

NAME

 testsusmat

FUNCTION

 Test wether a new susceptibility matrix and/or a new dielectric matrix must be computed
 and return the logical result

INPUTS

 dielop: option for the computation of the dielectric matrix
 dtset:
 istep: number of the current SCF cycle

OUTPUT

 compute:
  * if dielop >= 1 and istep == 1 => TRUE
  * if dielop >= 2 and istep == dtset%dielstrt => TRUE
  * if (dtset%iprcel >= 140 and <=170) depends on the periodicity modulo 10 of istep and iprcel
  * otherwise FALSE

PARENTS

      prcref,prcref_PMA,vtorho

CHILDREN

SOURCE

1944 subroutine testsusmat(compute,dielop,dielstrt,dtset,istep)
1945 
1946 
1947 !This section has been created automatically by the script Abilint (TD).
1948 !Do not modify the following lines by hand.
1949 #undef ABI_FUNC
1950 #define ABI_FUNC 'testsusmat'
1951 !End of the abilint section
1952 
1953  implicit none
1954 
1955 !Arguments-------------------------------
1956 !scalars
1957  integer,intent(in) :: dielop,dielstrt,istep
1958  logical,intent(out) :: compute
1959  type(dataset_type),intent(in) :: dtset
1960 
1961 ! *********************************************************************
1962 
1963  compute=.FALSE.
1964  if((dtset%iprcel >= 140).and.(dtset%iprcel<=170)) then
1965    if(modulo(dtset%iprcel,10).ne.0) then
1966      compute=(modulo(istep,modulo(dtset%iprcel,10))==0)
1967    else
1968      compute=(modulo(istep,10)==0)
1969    end if
1970  end if
1971  if (istep==1 .and. dielop>=2) compute=.TRUE.
1972  if (istep==dielstrt .and. dielop>=1) compute=.TRUE.
1973 !DEBUG
1974 !if (compute) then
1975 !write(std_err,*) 'testsusmat : TRUE'
1976 !else
1977 !write(std_err,*) 'testsusmat : FALSE',dielop,dielstrt,istep,dtset%iprcel,modulo(istep,10),&
1978 !&modulo(dtset%iprcel,10),modulo(dtset%iprcel,modulo(dtset%iprcel,10))
1979 !end if
1980 !ENDDEBUG
1981 
1982 !if( (istep==1        .and. dielop>=2) .or. &
1983 !&     (istep==dielstrt .and. dielop>=1) .or. &
1984 !&       computesusmat       )then
1985 
1986 !if((iprcel >= 140) .and. (iprcel <= 170)) then
1987 !if(modulo(iprcel,10).ne.0) then
1988 !computediel=(modulo(istep,10)==modulo(iprcel,modulo(iprcel,10)))
1989 !else
1990 !computediel=(modulo(istep,10)==0)
1991 !end if
1992 !end if
1993 !
1994 !if( (istep==1        .and. dielop>=2) &
1995 !&     .or. (istep==dielstrt .and. dielop>=1) &
1996 !&     .or. computediel          )then
1997 
1998 end subroutine testsusmat