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

SOURCE

3270 subroutine chkvars(string)
3271 
3272 !Arguments ------------------------------------
3273 !scalars
3274  character(len=*),intent(in) :: string
3275 
3276 !Local variables-------------------------------
3277 !scalars
3278  integer,parameter :: protocol1=1
3279  character(len=100) :: list_logicals,list_strings, list_vars_img
3280  character(len=20000) :: list_vars
3281 
3282 !************************************************************************
3283 
3284 
3285 !Here, list all admitted variable names (max 10 per line, to fix the ideas)
3286 !<ABINIT_VARS>
3287 !A
3288  list_vars=                 ' accuracy acell adpimd adpimd_gamma'
3289  list_vars=trim(list_vars)//' algalch amu analyze_anh_pot angdeg asr atvshift autoparal'
3290  list_vars=trim(list_vars)//' auxc_ixc auxc_scal awtr'
3291 !B
3292  list_vars=trim(list_vars)//' bandpp bdberry bdeigrf bdgw berryopt berrysav berrystep bfield bmass'
3293  list_vars=trim(list_vars)//' boxcenter boxcutmin brav brvltt builtintest'
3294  list_vars=trim(list_vars)//' bound_SPCoupling bound_anhaStrain bound_cell bound_cutoff bound_EFS bound_factors'
3295  list_vars=trim(list_vars)//' bound_maxCoeff bound_model bound_penalty bound_rangePower bound_step bound_temp'
3296  list_vars=trim(list_vars)//' bs_algorithm bs_calctype bs_coulomb_term bs_coupling'
3297  list_vars=trim(list_vars)//' bs_interp_kmult bs_interp_m3_width bs_interp_method bs_interp_mode bs_interp_prep'
3298  list_vars=trim(list_vars)//' bs_interp_rl_nb bs_eh_cutoff bs_exchange_term bs_freq_mesh'
3299  list_vars=trim(list_vars)//' bs_haydock_niter bs_haydock_tol bs_hayd_term'
3300  list_vars=trim(list_vars)//' bs_loband bs_nstates'
3301  list_vars=trim(list_vars)//' bxctmindg'
3302 !C
3303  list_vars=trim(list_vars)//' cd_customnimfrqs cd_frqim_method cd_full_grid cd_imfrqs'
3304  list_vars=trim(list_vars)//' cd_halfway_freq cd_max_freq cd_subset_freq'
3305  list_vars=trim(list_vars)//' cellcharge charge chrgat chempot chkdilatmx chkexit chkparal chkprim'
3306  list_vars=trim(list_vars)//' chksymbreak chksymtnons chneut cineb_start coefficients constraint_kind'
3307  list_vars=trim(list_vars)//' cprj_update_lvl cpus cpum cpuh'
3308 !D
3309  list_vars=trim(list_vars)//' ddamp ddb_ngqpt ddb_shiftq'
3310  list_vars=trim(list_vars)//' delayperm densfor_pred densty dfield'
3311  list_vars=trim(list_vars)//' dfpt_sciss diecut diegap dielam dielng diemac'
3312  list_vars=trim(list_vars)//' diemix diemixmag diismemory'
3313  list_vars=trim(list_vars)//' dilatmx dipdip dipquad dipdip_prt dipdip_range'
3314  list_vars=trim(list_vars)//' dmatpawu dmatpuopt dmatudiag'
3315  list_vars=trim(list_vars)//' dmftbandi dmftbandf dmftctqmc_basis'
3316  list_vars=trim(list_vars)//' dmftctqmc_check dmftctqmc_correl dmftctqmc_gmove'
3317  list_vars=trim(list_vars)//' dmftctqmc_grnns dmftctqmc_config dmftctqmc_meas dmftctqmc_mrka'
3318  list_vars=trim(list_vars)//' dmftctqmc_mov dmftctqmc_order dmftctqmc_triqs_nleg'
3319  list_vars=trim(list_vars)//' dmftcheck dmftqmc_l dmftqmc_n dmftqmc_seed dmftqmc_therm'
3320  list_vars=trim(list_vars)//' dmft_charge_prec dmft_dc dmft_entropy dmft_iter dmft_kspectralfunc'
3321  list_vars=trim(list_vars)//' dmft_mxsf dmft_nlambda dmft_nwli dmft_nwlo'
3322  list_vars=trim(list_vars)//' dmft_occnd_imag dmft_read_occnd dmft_rslf dmft_solv'
3323  list_vars=trim(list_vars)//' dmft_tolfreq dmft_tollc dmft_t2g dmft_wanorthnorm' ! dmft_wanorthnorm is not documented
3324  list_vars=trim(list_vars)//' dosdeltae dtion dtele dynamics dynimage' !FB: dynamics?
3325  list_vars=trim(list_vars)//' dvdb_add_lr dvdb_ngqpt dvdb_qcache_mb dvdb_qdamp dvdb_rspace_cell'
3326  list_vars=trim(list_vars)//' dyn_chksym dyn_tolsym'
3327  list_vars=trim(list_vars)//' d3e_pert1_atpol d3e_pert1_dir d3e_pert1_elfd d3e_pert1_phon'
3328  list_vars=trim(list_vars)//' d3e_pert2_atpol d3e_pert2_dir d3e_pert2_elfd d3e_pert2_phon'
3329  list_vars=trim(list_vars)//' d3e_pert2_strs'
3330  list_vars=trim(list_vars)//' d3e_pert3_atpol d3e_pert3_dir d3e_pert3_elfd d3e_pert3_phon'
3331 !E
3332  list_vars=trim(list_vars)//' ecut ecuteps ecutsigx ecutsm ecutwfn effmass_free efmas'
3333  list_vars=trim(list_vars)//' efmas_bands efmas_calc_dirs efmas_deg efmas_deg_tol'
3334  list_vars=trim(list_vars)//' efmas_dim efmas_dirs efmas_n_dirs efmas_ntheta'
3335  list_vars=trim(list_vars)//' efield einterp elph2_imagden energy_reference enunit'
3336  list_vars=trim(list_vars)//' eph_frohl_ntheta'
3337  list_vars=trim(list_vars)//' eph_doping eph_ecutosc eph_extrael eph_fermie eph_frohlich eph_frohlichm eph_fsewin eph_fsmear '
3338  list_vars=trim(list_vars)//' eph_intmeth eph_mustar eph_ngqpt_fine eph_ahc_type'
3339  ! XG20200321, please provide testing for eph_np_pqbks
3340  ! MG: Well, eph_np_pqbks cannot be tested with the present infrastructure because it's a MPI-related variable
3341  ! and all the tests in the paral and mpiio directory are done with a single input file
3342  ! whereas EPH requires GS + DFPT + MRGDV + MRGDDB + TESTS_MULTIPLES_PROCS
3343  list_vars=trim(list_vars)//' eph_np_pqbks'
3344  list_vars=trim(list_vars)//' eph_phrange eph_phrange_w eph_phwinfact'
3345  list_vars=trim(list_vars)//' eph_prtscratew eph_restart eph_stern eph_task eph_tols_idelta eph_transport eph_use_ftinterp'
3346  list_vars=trim(list_vars)//' eshift esmear exchmix exchn2n3d expert_user extfpmd_nbcut extfpmd_nbdbuf extrapwf'
3347 !F
3348  list_vars=trim(list_vars)//' fband fermie_nest ffnl_lw'
3349  list_vars=trim(list_vars)//' fftalg fftcache fftgw fft_count'
3350  list_vars=trim(list_vars)//' fit_anhaStrain fit_bancoeff fit_coeff fit_cutoff fit_dispterms'
3351  list_vars=trim(list_vars)//' fit_EFS fit_factors fit_fixcoeff'
3352  list_vars=trim(list_vars)//' fit_generateCoeff fit_iatom fit_imposecoeff fit_initializeData'
3353  list_vars=trim(list_vars)//' fit_nbancoeff fit_ncoeff fit_ncoeff_per_iatom'
3354  list_vars=trim(list_vars)//' fit_nfixcoeff fit_nimposecoeff fit_rangePower fit_SPCoupling fit_SPC_maxS'
3355  list_vars=trim(list_vars)//' fit_tolGF fit_tolMSDE fit_tolMSDF fit_tolMSDFS fit_tolMSDS'
3356  list_vars=trim(list_vars)//' fockoptmix focktoldfe fockdownsampling fock_icutcoul'
3357  list_vars=trim(list_vars)//' freqim_alpha freqremax freqremin freqspmax'
3358  list_vars=trim(list_vars)//' freqspmin friction frzfermi fxcartfactor'
3359  list_vars=trim(list_vars)//' f4of2_sla f6of2_sla'
3360 !G
3361  list_vars=trim(list_vars)//' ga_algor ga_fitness ga_n_rules ga_opt_percent ga_rules'
3362  list_vars=trim(list_vars)//' genafm getbscoup getbseig getbsreso getcell'
3363  list_vars=trim(list_vars)//' getddb getddb_filepath getden_filepath getddk'
3364  list_vars=trim(list_vars)//' getdelfd getdkdk getdkde getden getkden getdvdb getdvdb_filepath'
3365  list_vars=trim(list_vars)//' getefmas getkerange_filepath getgam_eig2nkq'
3366  list_vars=trim(list_vars)//' gethaydock getocc getpawden getpot_filepath getsigeph_filepath getgstore_filepath'
3367  list_vars=trim(list_vars)//' getqps getscr getscr_filepath'
3368  list_vars=trim(list_vars)//' getwfkfine getwfkfine_filepath getsuscep'
3369  list_vars=trim(list_vars)//' getvel getwfk getwfk_filepath getwfq getwfq_filepath getxcart getxred'
3370  list_vars=trim(list_vars)//' get1den get1wf goprecon goprecprm'
3371  list_vars=trim(list_vars)//' gpu_devices gpu_kokkos_nthrd gpu_linalg_limit gpu_nl_distrib'
3372  list_vars=trim(list_vars)//' gpu_nl_splitsize gpu_option'
3373  list_vars=trim(list_vars)//' gwaclowrank gwcalctyp gwcomp gwencomp gwgamma gwmem'
3374  list_vars=trim(list_vars)//' gstore_brange gstore_cplex gstore_erange gstore_kfilter'
3375  list_vars=trim(list_vars)//' gstore_kzone gstore_qzone gstore_with_vk'
3376  list_vars=trim(list_vars)//' gwpara gwrpacorr gwgmcorr gw_customnfreqsp gw1rdm'
3377  list_vars=trim(list_vars)//' gw_frqim_inzgrid gw_frqre_inzgrid gw_frqre_tangrid gw_freqsp'
3378  list_vars=trim(list_vars)//' gw_icutcoul gw_invalid_freq'
3379  list_vars=trim(list_vars)//' gw_nqlwl gw_qlwl gw_qprange gw_sigxcore'
3380  list_vars=trim(list_vars)//' gwls_stern_kmax gwls_kmax_complement gwls_kmax_poles'
3381  list_vars=trim(list_vars)//' gwls_kmax_analytic gwls_kmax_numeric'
3382  list_vars=trim(list_vars)//' gwls_list_proj_freq gwls_nseeds gwls_n_proj_freq gwls_recycle'
3383  list_vars=trim(list_vars)//' gwls_first_seed gwls_model_parameter gwls_npt_gauss_quad'
3384  list_vars=trim(list_vars)//' gwls_diel_model gwls_print_debug gwls_band_index gwls_exchange gwls_correlation'
3385  list_vars=trim(list_vars)//' gwr_boxcutmin gwr_chi_algo gwr_max_hwtene gwr_regterm gwr_np_kgts gwr_nstep gwr_ntau'
3386  list_vars=trim(list_vars)//' gwr_rpa_ncut gwr_sigma_algo gwr_task gwr_tolqpe gwr_ucsc_batch'
3387 !H
3388  list_vars=trim(list_vars)//' hmcsst hmctt hyb_mixing hyb_mixing_sr hyb_range_dft hyb_range_fock'
3389 !I
3390  list_vars=trim(list_vars)//' iatcon iatfix iatfixx iatfixy iatfixz iatsph'
3391  list_vars=trim(list_vars)//' ibte_abs_tol ibte_alpha_mix ibte_niter ibte_prep '
3392  list_vars=trim(list_vars)//' iboxcut icoulomb icutcoul ieig2rf'
3393  list_vars=trim(list_vars)//' imgmov imgwfstor inclvkb indata_prefix intxc invovl_blksliced iomode ionmov iqpt'
3394  list_vars=trim(list_vars)//' iprcel iprcfc irandom irdbscoup'
3395  list_vars=trim(list_vars)//' irdbseig irdbsreso irdchkprdm irdddb irdddk irdden irdkden irddvdb irdefmas'
3396  list_vars=trim(list_vars)//' irdhaydock irdpawden irdqps'
3397  list_vars=trim(list_vars)//' irdscr irdsuscep irdwfk irdwfq ird1den'
3398  list_vars=trim(list_vars)//' irdwfkfine'
3399  list_vars=trim(list_vars)//' ird1wf iscf isecur istatimg istatr'
3400  list_vars=trim(list_vars)//' istatshft istwfk ixc ixc_sigma ixcpositron ixcrot irdvdw ivalence'
3401 !J
3402  list_vars=trim(list_vars)//' jdtset jellslab jfielddir jpawu'
3403 !K
3404  list_vars=trim(list_vars)//' kberry kpt kptbounds kptgw'
3405  list_vars=trim(list_vars)//' kptnrm kptopt kptrlatt kptrlen kssform'
3406 !L
3407  list_vars=trim(list_vars)//' lambsig'
3408  list_vars=trim(list_vars)//' latt_anharm_pot_fname latt_ddb_fnames latt_friction latt_harm_pot_fname'
3409  list_vars=trim(list_vars)//' latt_init_hist_fname latt_friction latt_lwf_anharmonic latt_pot_fname latt_taut'
3410  list_vars=trim(list_vars)//' latt_temperature latt_temperature_end'
3411  list_vars=trim(list_vars)//' latt_temperature_nstep latt_temperature_start'
3412  list_vars=trim(list_vars)//' latt_test_set_fname'
3413  list_vars=trim(list_vars)//' latt_training_set_fname'
3414  list_vars=trim(list_vars)//' latt_var_temperature'
3415  list_vars=trim(list_vars)//' ldaminushalf lexexch localrdwf lpawu'
3416  list_vars=trim(list_vars)//' lotf_classic lotf_nitex lotf_nneigx lotf_version'
3417  list_vars=trim(list_vars)//' lw_flexo lw_natopt lw_qdrpl'
3418  list_vars=trim(list_vars)//' lwf_constraint'
3419  list_vars=trim(list_vars)//' lwf_dt lwf_dynamics lwf_init_state lwf_init_hist_fname'
3420  list_vars=trim(list_vars)//' lwf_mc_avg_amp'
3421  list_vars=trim(list_vars)//' lwf_nctime lwf_ntime'
3422  list_vars=trim(list_vars)//' lwf_pot_fname'
3423  list_vars=trim(list_vars)//' lwf_taut'
3424  list_vars=trim(list_vars)//' lwf_temperature lwf_temperature_start lwf_temperature_end'
3425  list_vars=trim(list_vars)//' lwf_temperature_nstep lwf_var_temperature'
3426 !M
3427  list_vars=trim(list_vars)//' max_ncpus macro_uj maxestep maxnsym mdf_epsinf mdtemp mdwall'
3428  list_vars=trim(list_vars)//' magconon magcon_lambda mbpt_sciss'
3429  list_vars=trim(list_vars)//' mep_mxstep mep_solver mem_test mixalch mixprec mixesimgf'
3430  list_vars=trim(list_vars)//' mqgrid mqgriddg'
3431 !N
3432  list_vars=trim(list_vars)//' natcon natfix natfixx natfixy natfixz'
3433  list_vars=trim(list_vars)//' natom natrd natsph natsph_extra natvshift nband nbandkss nbandhf'
3434  list_vars=trim(list_vars)//' ncell ncellmat ncoeff nbdblock nbdbuf nberry nconeq ncout nc_xccc_gspace'
3435  list_vars=trim(list_vars)//' nctime ndivk ndivsm ndtset neb_algo neb_spring'
3436  list_vars=trim(list_vars)//' nfreqim nfreqre nfreqsp ngfft ngfftdg'
3437  list_vars=trim(list_vars)//' ngkpt ngqpt nimage nkpath nkpt nkptgw nkpthf'
3438  list_vars=trim(list_vars)//' nline nblock_lobpcg nloc_alg nloc_mem nnos nnsclo nnsclohf'
3439  list_vars=trim(list_vars)//' nobj nomegasf nomegasi nomegasrd nonlinear_info nonlop_ylm_count noseinert npband'
3440  list_vars=trim(list_vars)//' npfft nphf nph1l npimage np_spkpt npkpt nppert npsp npspinor'
3441  list_vars=trim(list_vars)//' npulayit npvel npwkss'
3442  list_vars=trim(list_vars)//' np_slk nqpt nqptdm nqfd nscforder nshiftk nshiftq nqshft'
3443  list_vars=trim(list_vars)//' nspden nspinor nsppol nstep nsym'
3444  list_vars=trim(list_vars)//' ntime ntimimage ntypalch ntypat nucdipmom nucefg nucfc nwfshist nzchempot'
3445 !O
3446  list_vars=trim(list_vars)//' objaat objbat objaax objbax objan objbn objarf'
3447  list_vars=trim(list_vars)//' objbrf objaro objbro objatr objbtr occ'
3448  list_vars=trim(list_vars)//' occopt omegasimax omegasrdmax optcell optdcmagpawu optdriver optforces '
3449  list_vars=trim(list_vars)//' optnlxccc optstress orbmag ortalg'
3450  list_vars=trim(list_vars)//' opt_effpot opt_ncoeff opt_coeff output_file outdata_prefix'
3451 !P
3452  list_vars=trim(list_vars)//' papiopt paral_atom paral_kgb paral_rf pawcpxocc pawcross'
3453  list_vars=trim(list_vars)//' pawecutdg pawfatbnd pawlcutd pawlmix'
3454  list_vars=trim(list_vars)//' pawmixdg pawnhatxc pawnphi pawntheta pawnzlm pawoptmix pawoptosc pawovlp'
3455  list_vars=trim(list_vars)//' pawprtdos pawprtvol pawprtwf pawprt_b pawprt_k pawspnorb pawstgylm'
3456  list_vars=trim(list_vars)//' pawsushat pawujat pawujrad pawujv'
3457  list_vars=trim(list_vars)//' pawusecp pawxcdev pimass pimd_constraint'
3458  list_vars=trim(list_vars)//' ph_intmeth ph_ndivsm ph_ngqpt ph_nqpath ph_nqshift ph_qpath'
3459  list_vars=trim(list_vars)//' ph_qshift ph_smear ph_wstep pitransform'
3460  list_vars=trim(list_vars)//' plowan_bandi plowan_bandf plowan_compute plowan_iatom plowan_it plowan_lcalc'
3461  list_vars=trim(list_vars)//' plowan_natom plowan_nbl plowan_nt plowan_projcalc plowan_realspace'
3462  list_vars=trim(list_vars)//' polcen posdoppler positron posnstep posocc postoldfe postoldff'
3463  list_vars=trim(list_vars)//' ppmfrq ppmodel pp_dirpath'
3464  list_vars=trim(list_vars)//' prepalw prepanl prepgkk'
3465  list_vars=trim(list_vars)//' prtatlist prtbbb prtbltztrp prtchkprdm prtcif prtddb prtden'
3466  list_vars=trim(list_vars)//' prtdensph prtdipole prtdos prtdosm prtebands prtefmas prteig prteliash prtelf prtevk'
3467  list_vars=trim(list_vars)//' prtfull1wf prtfsurf prtgden prtgeo prtgsr prtgkk prthist prtkden prtkpt prtlden'
3468  list_vars=trim(list_vars)//' prtnabla prtnest prtocc prtphbands prtphdos prtphsurf prtposcar'
3469  list_vars=trim(list_vars)//' prtpot prtprocar prtpsps'
3470  list_vars=trim(list_vars)//' prtspcur prtstm prtsuscep prtvclmb prtvha prtvdw prtvhxc prtkbff'
3471  list_vars=trim(list_vars)//' prtvol prtvolimg prtvpsp prtvxc prtwant prtwf prtwf_full prtxml prt1dm'
3472  list_vars=trim(list_vars)//' prt_GF_csv prt_lorbmag prt_model'
3473  list_vars=trim(list_vars)//' pseudos ptcharge'
3474  list_vars=trim(list_vars)//' pvelmax pw_unbal_thresh'
3475 !Q
3476  list_vars=trim(list_vars)//' q1shft qmass qprtrb qpt qptdm qptnrm qph1l'
3477  list_vars=trim(list_vars)//' qptopt quadquad qptrlatt quadmom'
3478 !R
3479  list_vars=trim(list_vars)//' random_atpos randomseed ratsm ratsph ratsph_extra rcut'
3480  list_vars=trim(list_vars)//' recefermi recgratio recnpath recnrec recptrott recrcut rectesteg rectolden'
3481 !list_vars=trim(list_vars)//' red_dfield red_efield red_efieldbar restartxf rfasr'
3482  list_vars=trim(list_vars)//' red_dfield red_efield red_efieldbar restartxf'
3483  list_vars=trim(list_vars)//' rfatpol rfddk rfdir rfelfd rfmagn rfmeth rfphon'
3484  list_vars=trim(list_vars)//' rfstrs rfstrs_ref rfuser rf2_dkdk rf2_dkde rf2_pert1_dir rf2_pert2_dir rhoqpmix rifcsph rprim'
3485  list_vars=trim(list_vars)//' rmm_diis rmm_diis_savemem'
3486 !S
3487  list_vars=trim(list_vars)//' scalecart shiftk shiftq signperm'
3488  list_vars=trim(list_vars)//' sel_EFS'
3489  list_vars=trim(list_vars)//' sigma_bsum_range sigma_erange sigma_ngkpt sigma_nshiftk sigma_shiftk'
3490 !MS Variables for SCALE-UP
3491 !This is only for the developer version, not for the production version. So, was commented.
3492 ! @Marcus: simply uncomment these lines in v9.1 (not v9.0 !), and continue to develop without worrying.
3493 !list_vars=trim(list_vars)//' scup_elec_model scup_ksamp scup_tcharge scup_initorbocc scup_ismagnetic'
3494 !list_vars=trim(list_vars)//' scup_istddft scup_printbands scup_printgeom scup_printeigv scup_printeltic '
3495 !list_vars=trim(list_vars)//' scup_printorbocc scup_printniter scup_nspeck scup_speck scup_ndivsm'
3496 !list_vars=trim(list_vars)//' scup_scfmixing scup_scfthresh scup_startpulay scup_maxscfstep'
3497 !list_vars=trim(list_vars)//' scup_smearing scup_freezden'
3498 !End SCALE-UP variables
3499  list_vars=trim(list_vars)//' slabwsrad slabzbeg slabzend slk_rankpp smdelta so_psp'
3500  list_vars=trim(list_vars)//' slc_coupling slc_pot_fname'
3501  list_vars=trim(list_vars)//' spbroad spgaxor spgorig spgroup spgroupma'
3502  !list_vars=trim(list_vars)//' spin_calc_correlation_obs spin_calc_thermo_obs spin_calc_traj_obs'
3503  list_vars=trim(list_vars)//' spin_calc_thermo_obs'
3504  list_vars=trim(list_vars)//' spin_damping'
3505  list_vars=trim(list_vars)//' spin_dipdip spin_dt spin_dynamics '
3506  list_vars=trim(list_vars)//' spin_init_hist_fname'
3507  list_vars=trim(list_vars)//' spin_init_orientation spin_init_qpoint spin_init_rotate_axis spin_init_state'
3508  list_vars=trim(list_vars)//' spin_mag_field spin_nctime spin_ntime spin_ntime_pre'
3509  !list_vars=trim(list_vars)//' spin_n1l spin_n2l'
3510  list_vars=trim(list_vars)//' spin_pot_fname spin_projection_qpoint'
3511  list_vars=trim(list_vars)//' spin_sia_add spin_sia_k1amp spin_sia_k1dir'
3512  list_vars=trim(list_vars)//' spin_temperature spin_temperature_end'
3513  list_vars=trim(list_vars)//' spin_temperature_nstep spin_temperature_start'
3514  !list_vars=trim(list_vars)//' spin_tolavg spin_tolvar'
3515  list_vars=trim(list_vars)//' spin_var_temperature spin_write_traj'
3516  list_vars=trim(list_vars)//' spinat spinmagntarget spmeth'
3517  list_vars=trim(list_vars)//' spnorbscl stmbias strfact string_algo strprecon strtarget'
3518  list_vars=trim(list_vars)//' supercell_latt symafm symchi symdynmat symmorphi symrel symsigma symv1scf'
3519  list_vars=trim(list_vars)//' structure '
3520 !T
3521  list_vars=trim(list_vars)//' td_exp_order td_maxene td_mexcit td_scnmax td_prtstr td_restart td_propagator td_scthr'
3522  list_vars=trim(list_vars)//' tfkinfunc temperature test_effpot test_prt_ph tfw_toldfe tim1rev timopt'
3523  list_vars=trim(list_vars)//' tmesh tmpdata_prefix transport_ngkpt'
3524  list_vars=trim(list_vars)//' tl_nprccg tl_radius tnons tolcum toldfe tolmxde toldff tolimg tolmxf tolrde tolrff tolsym'
3525  list_vars=trim(list_vars)//' tolvrs tolwfr tolwfr_diago tphysel ts_option tsmear typat'
3526 !U
3527  list_vars=trim(list_vars)//' ucrpa ucrpa_bands ucrpa_window udtset upawu usepead usedmatpu '
3528  list_vars=trim(list_vars)//' usedmft useexexch usekden use_nonscf_gkk usepawu usepotzero'
3529  list_vars=trim(list_vars)//' useria userib useric userid userie'
3530  list_vars=trim(list_vars)//' userra userrb userrc userrd userre'
3531  list_vars=trim(list_vars)//' usewvl usexcnhat useylm use_gemm_nonlop'
3532  list_vars=trim(list_vars)//' use_slk useextfpmd use_yaml'
3533  list_vars=trim(list_vars)//' use_oldchi'
3534 !V
3535  list_vars=trim(list_vars)//' vaclst vacnum vacuum vacwidth vcutgeo'
3536  list_vars=trim(list_vars)//' vdw_nfrag vdw_supercell'
3537  list_vars=trim(list_vars)//' vdw_tol vdw_tol_3bt vdw_typfrag vdw_xc'
3538  list_vars=trim(list_vars)//' vdw_df_acutmin vdw_df_aratio vdw_df_damax'
3539  list_vars=trim(list_vars)//' vdw_df_damin vdw_df_dcut vdw_df_dratio'
3540  list_vars=trim(list_vars)//' vdw_df_dsoft vdw_df_gcut'
3541  list_vars=trim(list_vars)//' vdw_df_ndpts vdw_df_ngpts vdw_df_nqpts'
3542  list_vars=trim(list_vars)//' vdw_df_nrpts vdw_df_nsmooth vdw_df_phisoft vdw_df_qcut'
3543  list_vars=trim(list_vars)//' vdw_df_qratio vdw_df_rcut vdw_df_rsoft'
3544  list_vars=trim(list_vars)//' vdw_df_threshold vdw_df_tolerance'
3545  list_vars=trim(list_vars)//' vdw_df_tweaks vdw_df_zab'
3546  list_vars=trim(list_vars)//' vel vel_cell vis vloc_rcut vprtrb'
3547 !W
3548  list_vars=trim(list_vars)//' wfinit wfmix wfoptalg wtatcon wtk wtq'
3549  list_vars=trim(list_vars)//' wvl_bigdft_comp wvl_crmult wvl_frmult wvl_hgrid wvl_ngauss wvl_nprccg'
3550  list_vars=trim(list_vars)//' w90iniprj w90prtunk'
3551  list_vars=trim(list_vars)//' write_files'
3552 !X
3553  list_vars=trim(list_vars)//' xcart xc_denpos xc_taupos xc_tb09_c xred xredsph_extra xyzfile x1rdm'
3554 !Y
3555 !Z
3556  list_vars=trim(list_vars)//' zcut zeemanfield znucl'
3557 
3558 !List of input variables for which the image index can be added
3559  list_vars_img=' acell amu angdeg cellcharge dmatpawu jpawu mixalch occ rprim scalecart'
3560  list_vars_img=trim(list_vars_img)//' vel vel_cell xcart xred'
3561 
3562 !Logical input variables
3563  list_logicals=' SpinPolarized'
3564 
3565 !String input variables
3566  list_strings=' XCname wfk_task'
3567 !</ABINIT_VARS>
3568 
3569 !Extra token, also admitted:
3570 !<ABINIT_UNITS>
3571  list_vars=trim(list_vars)//' au Angstr Angstrom Angstroms Bohr Bohrs eV meV Ha'
3572  list_vars=trim(list_vars)//' Hartree Hartrees K Kelvin nm Ry Rydberg Rydbergs S Sec Second T Tesla'
3573 !</ABINIT_UNITS>
3574 
3575 !<ABINIT_OPERATORS>
3576  list_vars=trim(list_vars)//' sqrt end'
3577 !</ABINIT_OPERATORS>
3578 
3579  ! Transform to upper case
3580  call inupper(list_vars)
3581  call inupper(list_vars_img)
3582  call inupper(list_logicals)
3583  call inupper(list_strings)
3584 
3585  call chkvars_in_string(protocol1, list_vars, list_vars_img, list_logicals, list_strings, string)
3586 
3587 end subroutine chkvars

ABINIT/m_dtset [ Modules ]

[ Top ] [ Modules ]

NAME

  m_dtset

FUNCTION

COPYRIGHT

 Copyright (C) 1992-2024 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

16 #if defined HAVE_CONFIG_H
17 #include "config.h"
18 #endif
19 
20 #include "abi_common.h"
21 
22 module m_dtset
23 
24  use defs_basis
25  use m_abicore
26  use m_copy
27  use m_errors
28  use m_xmpi
29 
30  use m_fstrings,     only : inupper
31  use m_numeric_tools,only : arth
32  use m_symtk,        only : mati3inv, littlegroup_q, symatm
33  use m_symkpt,       only : symkpt
34  use m_geometry,     only : mkrdim, metric, littlegroup_pert, irreducible_set_pert
35  use m_parser,       only : intagm, chkvars_in_string
36  use m_crystal,      only : crystal_t, crystal_init
37 
38  implicit none
39 
40  private

m_dtset/dataset_type [ Types ]

[ Top ] [ m_dtset ] [ Types ]

NAME

 dataset_type

FUNCTION

 The dataset_type structured datatype gather all the input variables,
 except those that are labelled NOT INTERNAL.
 For one dataset, it is initialized in driver.F90, and will not change
 at all during the treatment of the dataset.
 The "evolving" input variables are also stored, with their
 name appended with _orig, to make clear that this is the original
 value, decided by the user, and not a possibly modified, intermediate value.
 The following input variables are NOT INTERNAL, that is, they
 are input variables used to determine other input variables,
 after suitable processing, and do not appear anymore afterwards
 (so, they do not appear as components of a dataset_type variable) :
 cpuh,cpum(but cpus is present),fband,kptbounds,ndivk,ndism,nobj,
 objaat,objbat,objaax,objbax,objan,objbn,objarf,objbrf,objaro,objbro
 objatr,objbtr,vaclst,vacuum

 WARNING: if you modify this datatype, please check whether there might be
 creation/destruction/copy routines, declared in another part of ABINIT,
 that might need to take into account your modification.

 Variables should be declared on separated lines in order to reduce the occurence of git conflicts.

 Since all these input variables are described in the abinit_help.html and
 associated html files they are not described in length here ...

SOURCE

  76 type, public :: dataset_type
  77 
  78 !A
  79  integer :: accuracy
  80  integer :: adpimd
  81  integer :: asr = 1
  82  integer :: autoparal
  83  integer :: auxc_ixc
  84  integer :: awtr = 1
  85 !B
  86  integer :: bandpp
  87  integer :: bdeigrf
  88  integer :: berryopt
  89  integer :: berrysav
  90  integer :: berrystep
  91  integer :: brav = 1
  92  integer :: brvltt
  93  integer :: bs_algorithm = 2
  94  integer :: bs_calctype = 1
  95  integer :: bs_coulomb_term = 11
  96  integer :: bs_coupling = 0
  97  integer :: bs_exchange_term = 1
  98  integer :: bs_haydock_niter = 100
  99  integer :: bs_hayd_term = 0
 100  integer :: bs_interp_method = 1 ! YG interpolation
 101  integer :: bs_interp_mode = 0 ! No interpolation
 102  integer :: bs_interp_prep = 0 ! Do not prepare interp
 103  integer :: bs_interp_rl_nb = 1
 104  integer :: bs_nstates
 105  integer :: builtintest
 106 
 107 !C
 108  integer :: cd_full_grid
 109  integer :: cd_frqim_method
 110  integer :: cd_customnimfrqs
 111  integer :: chkdilatmx
 112  integer :: chkexit
 113  integer :: chneut = 1
 114  integer :: chkparal
 115  integer :: chkprim
 116  integer :: chksymbreak
 117  integer :: chksymtnons
 118  integer :: cineb_start
 119  integer :: cprj_in_memory
 120  integer :: cprj_update_lvl
 121 
 122 !D
 123  integer :: delayperm
 124  integer :: densfor_pred
 125  integer :: diismemory
 126  integer :: dipdip = 1
 127  integer :: dipquad = 1
 128  integer :: dmatpuopt
 129  integer :: dmatudiag
 130  integer :: dmft_dc
 131  integer :: dmft_entropy
 132  integer :: dmft_iter
 133  integer :: dmft_kspectralfunc
 134  integer :: dmft_nlambda
 135  integer :: dmft_nwli
 136  integer :: dmft_nwlo
 137  integer :: dmft_occnd_imag
 138  integer :: dmft_rslf
 139  integer :: dmft_read_occnd
 140  integer :: dmft_solv
 141  integer :: dmft_t2g
 142  integer :: dmft_wanorthnorm
 143 !integer :: dmft_x2my2d
 144  integer :: dmftbandi
 145  integer :: dmftbandf
 146  integer :: dmftcheck
 147  integer :: dmftctqmc_basis
 148  integer :: dmftctqmc_check
 149  integer :: dmftctqmc_correl
 150  integer :: dmftctqmc_gmove
 151  integer :: dmftctqmc_grnns
 152  integer :: dmftctqmc_config
 153  integer :: dmftctqmc_meas
 154  integer :: dmftctqmc_mov
 155  integer :: dmftctqmc_mrka
 156  integer :: dmftctqmc_order
 157  integer :: dmftctqmc_triqs_nleg
 158  integer :: dmftqmc_l
 159  integer :: dmftqmc_seed
 160  integer :: dmftqmc_therm
 161  integer :: dvdb_add_lr = 1
 162  integer :: dvdb_rspace_cell = 0
 163  integer :: d3e_pert1_elfd
 164  integer :: d3e_pert1_phon
 165  integer :: d3e_pert2_elfd
 166  integer :: d3e_pert2_phon
 167  integer :: d3e_pert2_strs
 168  integer :: d3e_pert3_elfd
 169  integer :: d3e_pert3_phon
 170 !E
 171  integer :: efmas
 172  integer :: efmas_calc_dirs
 173  integer :: efmas_deg
 174  integer :: efmas_dim
 175  integer :: efmas_n_dirs
 176  integer :: efmas_ntheta
 177  integer :: enunit
 178  integer :: eph_ahc_type = 1
 179  integer :: eph_intmeth = 2
 180  integer :: eph_frohlichm = 0
 181  integer :: eph_frohl_ntheta = 0
 182  integer :: eph_phrange(2) = 0
 183 
 184  integer :: eph_prtscratew = 0
 185  integer :: eph_restart = 0
 186  integer :: eph_stern = 0
 187  integer :: eph_task = 1
 188  integer :: eph_transport = 0
 189  integer :: eph_use_ftinterp = 0
 190  integer :: exchn2n3d
 191  integer :: extfpmd_nbcut = 25
 192  integer :: extfpmd_nbdbuf = 0
 193  integer :: extrapwf
 194  integer :: expert_user
 195 !F
 196  integer :: ffnl_lw = 0
 197  integer :: fftgw = 21
 198  integer :: fft_count = 0
 199  integer :: fockoptmix
 200  integer :: fock_icutcoul
 201  integer :: frzfermi
 202 !G
 203  integer :: ga_algor
 204  integer :: ga_fitness
 205  integer :: ga_n_rules
 206  integer :: getcell = 0
 207  integer :: getddb = 0
 208  integer :: getdvdb = 0
 209  integer :: getddk = 0
 210  integer :: getdelfd = 0
 211  integer :: getdkdk = 0
 212  integer :: getdkde = 0
 213  integer :: getden = 0
 214  integer :: getefmas = 0
 215  integer :: getgam_eig2nkq = 0
 216  integer :: getkden = 0
 217  integer :: getocc = 0
 218  integer :: getpawden = 0
 219  integer :: getqps = 0
 220  integer :: getscr = 0
 221  integer :: getsuscep = 0
 222  integer :: getvel = 0
 223  integer :: getwfk = 0
 224  integer :: getwfkfine = 0
 225  integer :: getwfq = 0
 226  integer :: getxcart = 0
 227  integer :: getxred = 0
 228  integer :: get1den = 0
 229  integer :: get1wf = 0
 230  integer :: getbseig = 0
 231  integer :: getbsreso = 0
 232  integer :: getbscoup = 0
 233  integer :: gethaydock = 0
 234  integer :: goprecon
 235 
 236  integer :: gpu_kokkos_nthrd
 237  integer :: gpu_linalg_limit
 238  integer :: gpu_nl_distrib = 0
 239  integer :: gpu_nl_splitsize = 1
 240  integer :: gpu_option
 241 
 242  integer :: gstore_cplex = 2
 243  integer :: gstore_with_vk = 1
 244  character(len=fnlen) :: gstore_kzone = "ibz"
 245  character(len=fnlen) :: gstore_qzone = "bz"
 246  character(len=fnlen) :: gstore_kfilter = "none"
 247  integer :: gstore_brange(2, 2) = 0
 248  real(dp) :: gstore_erange(2, 2) = zero
 249 
 250  integer :: gwaclowrank = 0
 251  integer :: gwcalctyp = 0
 252  integer :: gwcomp = 0
 253  integer :: gwgamma = 0
 254  ! GWLS
 255  integer :: gwls_stern_kmax             ! number of Lanczos steps taken by the gw_sternheimer routine
 256  integer :: gwls_npt_gauss_quad         ! number of points used in Gaussian quadrature in gw_sternheimer routine
 257  integer :: gwls_diel_model             ! switch to determine which dielectic model should be used in integration
 258  integer :: gwls_print_debug            ! switch to determine what to print out for debugging
 259  integer :: gwls_nseeds                 ! number of seeds in the Lanczos description of the dielectric matrix
 260  integer :: gwls_n_proj_freq            ! Number of projection frequencies to be used for the construction of the sternheimer basis
 261  integer :: gwls_kmax_complement        ! number of Lanczos steps taken in the complement space
 262  integer :: gwls_kmax_poles             ! number of Lanczos steps taken to compute Poles contribution
 263  integer :: gwls_kmax_analytic          ! number of Lanczos steps taken to compute the analytic contribution
 264  integer :: gwls_kmax_numeric           ! number of Lanczos steps taken to compute the numeric contribution
 265  integer :: gwls_band_index             ! band index of the state to be corrected
 266  integer :: gwls_exchange               ! Flag to determine if Exchange energy will be computed
 267  integer :: gwls_correlation            ! Flag to determine if Correlation energy will be computed
 268  integer :: gwls_first_seed             ! index of the first seed used in the Lanczos algorithm;
 269                                         ! seeds will go from first_seed to first_seed+nseeds
 270  !integer :: gwls_n_ext_freq            ! The number of frequencies to be read in gwls_ext_freq
 271  integer :: gwls_recycle                ! Recycle the sternheimer solutions computed to obtain the static dielectric matrix
 272                                         ! and add them to the other solutions requested.
 273                                         ! 0 : don't recycle. 1 : store in RAM. 2 : Store on disk.
 274  integer :: gwmem = 11
 275  integer :: gwpara = 2
 276  integer :: gwrpacorr = 0
 277  integer :: gwgmcorr = 0
 278  integer :: gw1rdm = 0
 279 
 280  integer :: gw_customnfreqsp
 281  integer :: gw_frqim_inzgrid = 0
 282  integer :: gw_frqre_inzgrid = 0
 283  integer :: gw_frqre_tangrid = 0
 284  integer :: gw_icutcoul
 285  integer :: gw_invalid_freq
 286  integer :: gw_nqlwl
 287  integer :: gw_qprange
 288  integer :: gw_sigxcore = 0
 289 
 290  integer :: gwr_nstep = 50
 291  integer :: gwr_ntau = 12
 292  integer :: gwr_chi_algo = 1
 293  integer :: gwr_sigma_algo = 1
 294  integer :: gwr_rpa_ncut = 5
 295  real(dp) :: gwr_boxcutmin = one
 296  real(dp) :: gwr_max_hwtene = -one
 297  real(dp) :: gwr_regterm = -one
 298  character(len=fnlen) :: gwr_task = "None"
 299 !H
 300  integer :: hmcsst
 301  integer :: hmctt
 302 !I
 303  real(dp) :: ibte_abs_tol = -one
 304  real(dp) :: ibte_alpha_mix = 0.7_dp
 305  integer :: ibte_niter = 100
 306  integer :: ibte_prep = 0
 307 
 308  integer :: iboxcut
 309  integer :: icoulomb
 310  integer :: icutcoul
 311  integer :: ieig2rf
 312  integer :: imgmov
 313  integer :: imgwfstor
 314  integer :: inclvkb = 2
 315  integer :: intxc
 316  integer :: invovl_blksliced
 317  integer :: iomode
 318  integer :: ionmov
 319  integer :: iprcel
 320  integer :: iprcfc
 321  integer :: irandom
 322  integer :: irdchkprdm = 0
 323  integer :: irdddb = 0
 324  integer :: irddvdb = 0
 325  integer :: irdddk = 0
 326  integer :: irdden = 0
 327  integer :: irdefmas = 0
 328  integer :: irdhaydock = 0
 329  integer :: irdkden = 0
 330  integer :: irdpawden = 0
 331  integer :: irdqps = 0
 332  integer :: irdscr = 0
 333  integer :: irdsuscep = 0
 334  integer :: irdvdw = 0
 335  integer :: irdwfk = 0
 336  integer :: irdwfkfine = 0
 337  integer :: irdwfq = 0
 338  integer :: ird1den = 0
 339  integer :: ird1wf = 0
 340  integer :: irdbseig = 0
 341  integer :: irdbsreso = 0
 342  integer :: irdbscoup = 0
 343  integer :: iscf
 344  integer :: isecur
 345  integer :: istatimg
 346  integer :: istatr
 347  integer :: istatshft
 348  integer :: ivalence
 349  integer :: ixc
 350  integer :: ixc_sigma
 351  integer :: ixcpositron
 352  integer :: ixcrot
 353 !J
 354  integer :: jdtset !  jdtset contains the current dataset number
 355  integer :: jellslab
 356 !K
 357  integer :: kptopt
 358  integer :: kssform = 1
 359 !L
 360  integer :: localrdwf = 1
 361  integer :: lotf_classic
 362  integer :: lotf_nitex
 363  integer :: lotf_nneigx
 364  integer :: lotf_version
 365  integer :: lw_flexo
 366  integer :: lw_qdrpl
 367  integer :: lw_natopt
 368 !M
 369  integer :: magconon
 370  integer :: maxnsym
 371  integer :: max_ncpus = 0
 372  integer :: mband
 373  integer :: mband_mem
 374  integer :: mep_solver
 375  integer :: mem_test = 1
 376  integer :: mffmem
 377  integer :: mgfft
 378  integer :: mgfftdg
 379  integer :: mixprec = 0
 380  integer :: mkmem
 381  integer :: mkqmem
 382  integer :: mk1mem
 383  integer :: nnos
 384  integer :: mpw
 385  integer :: mqgrid
 386  integer :: mqgriddg
 387 !N
 388  integer :: natom
 389  integer :: natpawu
 390  integer :: natrd
 391  integer :: natsph
 392  integer :: natsph_extra
 393  integer :: natvshift
 394  integer :: nbandhf
 395  integer :: nbandkss = 0
 396  integer :: nbdblock
 397  integer :: nbdbuf
 398  integer :: nberry
 399  integer :: nc_xccc_gspace = 0
 400  integer :: nconeq
 401  integer :: ncout = 1
 402  integer :: nctime
 403  integer :: ndivsm = 0
 404  integer :: ndtset
 405  integer :: ndynimage
 406  integer :: neb_algo
 407  integer :: nfft
 408  integer :: nfftdg
 409  integer :: nfreqim = -1
 410  integer :: nfreqre = -1
 411  integer :: nfreqsp = 0
 412  integer :: nimage
 413  integer :: nkpath = 0
 414  integer :: nkpt
 415  integer :: nkptgw
 416  integer :: nkpthf
 417  integer :: nline
 418  integer :: nblock_lobpcg
 419  integer :: nnsclo
 420  integer :: nnsclohf
 421  integer :: nomegasf = 100
 422  integer :: nomegasi = 12
 423  integer :: nomegasrd = 9
 424  integer :: nonlinear_info
 425  integer :: nonlop_ylm_count = 0
 426  integer :: npband
 427  integer :: npfft
 428  integer :: nphf
 429  integer :: npimage
 430  integer :: np_spkpt
 431  integer :: nppert
 432  integer :: npspinor
 433  integer :: npsp
 434  integer :: npspalch
 435  integer :: npulayit
 436  integer :: npvel
 437  integer :: npweps = 0
 438  integer :: npwkss = 0
 439  integer :: npwsigx = 0
 440  integer :: npwwfn = 0
 441  integer :: np_slk
 442  integer :: nqpt
 443  integer :: nqptdm
 444  integer :: nscforder
 445  integer :: nshiftk
 446  integer :: nshiftk_orig  ! original number of shifts given in input (changed in inkpts, the actual value is nshiftk)
 447  integer :: nspden
 448  integer :: nspinor
 449  integer :: nsppol
 450  integer :: nstep
 451  integer :: nsym
 452  integer :: ntime
 453  integer :: ntimimage
 454  integer :: ntypalch
 455  integer :: ntypat
 456  integer :: ntyppure
 457  integer :: nucefg = 0
 458  integer :: nucfc = 0
 459  integer :: nwfshist
 460  integer :: nzchempot
 461 !O
 462  integer :: occopt
 463  integer :: optcell
 464  integer :: optdcmagpawu = 3
 465  integer :: optdriver
 466  integer :: optforces
 467  integer :: optnlxccc
 468  integer :: optstress
 469  integer :: orbmag
 470  integer :: ortalg
 471 !P
 472  integer :: paral_atom
 473  integer :: paral_kgb
 474  integer :: paral_rf
 475  integer :: pawcpxocc
 476  integer :: pawcross
 477  integer :: pawfatbnd
 478  integer :: pawlcutd
 479  integer :: pawlmix
 480  integer :: pawmixdg
 481  integer :: pawnhatxc
 482  integer :: pawnphi
 483  integer :: pawntheta
 484  integer :: pawnzlm
 485  integer :: pawoptmix
 486  integer :: pawoptosc
 487  integer :: pawprtdos
 488  integer :: pawprtvol
 489  integer :: pawprtwf
 490  integer :: pawprt_k
 491  integer :: pawprt_b
 492  integer :: pawspnorb
 493  integer :: pawstgylm
 494  integer :: pawsushat
 495  integer :: pawusecp
 496  integer :: macro_uj
 497  integer :: pawujat
 498  integer :: pawxcdev
 499  integer :: ph_intmeth = 2
 500  integer :: ph_ndivsm = 20
 501  integer :: ph_nqpath = 0
 502  integer :: ph_nqshift = 1
 503  integer :: pimd_constraint
 504  integer :: prt_lorbmag = 0
 505  integer :: pitransform
 506  integer :: plowan_bandi
 507  integer :: plowan_bandf
 508  integer :: plowan_compute
 509  integer :: plowan_natom
 510  integer :: plowan_nt
 511  integer :: plowan_realspace
 512  integer :: posdoppler
 513  integer :: positron
 514  integer :: posnstep
 515  integer :: ppmodel = 1
 516  integer :: prepalw
 517  integer :: prepanl
 518  integer :: prepgkk = 0
 519  integer :: prtbbb = 0
 520  integer :: prtbltztrp = 0
 521  integer :: prtchkprdm = 0
 522  integer :: prtcif = 0
 523  integer :: prtddb = 1
 524  integer :: prtden
 525  integer :: prtdensph = 1
 526  integer :: prtdipole = 0
 527  integer :: prtdos = 0
 528  integer :: prtdosm = 0
 529  integer :: prtebands
 530  integer :: prtefmas = 1
 531  integer :: prteliash = 0
 532  integer :: prteig
 533  integer :: prtelf = 0
 534  integer :: prtevk = 1
 535  integer :: prtfc = 0
 536  integer :: prtfull1wf = 0
 537  integer :: prtfsurf = 0
 538  integer :: prtgsr = 1
 539  integer :: prtgden = 0
 540  integer :: prtgeo = 0
 541  integer :: prtgkk = 0
 542  integer :: prthist = 1
 543  integer :: prtkden = 0
 544  integer :: prtkpt
 545  integer :: prtlden = 0
 546  integer :: prtnabla = 0
 547  integer :: prtnest = 0
 548  integer :: prtocc = 0
 549  integer :: prtpmp
 550  integer :: prtposcar = 0
 551  integer :: prtprocar = 0
 552  integer :: prtphdos = 1
 553  integer :: prtphbands = 1
 554  integer :: prtphsurf = 0
 555  integer :: prtpot = 0
 556  integer :: prtpsps = 0
 557  integer :: prtspcur = 0
 558  integer :: prtstm = 0
 559  integer :: prtsuscep = 0
 560  integer :: prtvclmb = 0
 561  integer :: prtvdw = 0
 562  integer :: prtvha = 0
 563  integer :: prtvhxc = 0
 564  integer :: prtkbff = 0
 565  integer :: prtvol = 0
 566  integer :: prtvolimg = 0
 567  integer :: prtvpsp = 0
 568  integer :: prtvxc = 0
 569  integer :: prtwant = 0
 570  integer :: prtwf
 571  integer :: prtwf_full = 0
 572  integer :: prtxml = 0
 573  integer :: prt1dm = 0
 574  integer :: ptgroupma
 575 !Q
 576  integer :: qptopt
 577  integer :: quadquad = 1
 578 !R
 579  integer :: random_atpos
 580  integer :: recgratio
 581  integer :: recnpath
 582  integer :: recnrec
 583  integer :: recptrott
 584  integer :: rectesteg
 585  integer :: restartxf
 586 !integer :: rfasr
 587  integer :: rfddk
 588  integer :: rfelfd
 589  integer :: rfmagn
 590  integer :: rfmeth
 591  integer :: rfphon
 592  integer :: rfstrs
 593  integer :: rfstrs_ref
 594  integer :: rfuser
 595  integer :: rf2_dkdk
 596  integer :: rf2_dkde
 597  integer :: rmm_diis = 0
 598  integer :: rmm_diis_savemem = 0
 599 !S
 600  integer :: sigma_nshiftk = 1      ! Number of shifts in k-mesh for Sigma_{nk}.
 601  integer :: signperm
 602  integer :: slk_rankpp
 603  integer :: smdelta
 604  integer :: spgaxor
 605  integer :: spgorig
 606  integer :: spgroup
 607  integer :: spmeth = 0
 608  integer :: string_algo
 609  integer :: symmorphi = 1
 610  integer :: symchi = 1
 611  integer :: symdynmat = 1
 612  integer :: symsigma = 1
 613  integer :: symv1scf = 0
 614 !T
 615  integer :: td_exp_order
 616  integer :: td_mexcit
 617  integer :: td_scnmax
 618  integer :: td_prtstr
 619  integer :: td_propagator
 620  integer :: td_restart
 621  integer :: tfkinfunc
 622  integer :: tim1rev
 623  integer :: timopt
 624  integer :: tl_nprccg
 625 !U
 626  integer :: ucrpa
 627  integer :: usedmatpu
 628  integer :: usedmft
 629  integer :: useexexch
 630  integer :: usefock
 631  integer :: usekden
 632  integer :: use_gemm_nonlop
 633  integer :: use_nonscf_gkk
 634  integer :: usepaw
 635  integer :: usepawu
 636  integer :: usepead
 637  integer :: usepotzero
 638  integer :: userec
 639  integer :: useria = 0
 640  integer :: userib = 0
 641  integer :: useric = 0
 642  integer :: userid = 0
 643  integer :: userie = 0
 644  integer :: usewvl
 645  integer :: usexcnhat_orig
 646  integer :: useylm
 647  integer :: useextfpmd = 0
 648  integer :: use_yaml = 0
 649  integer :: use_slk
 650  integer :: use_oldchi = 1
 651 !V
 652  integer :: vacnum
 653  integer :: vdw_nfrag
 654  integer :: vdw_df_ndpts
 655  integer :: vdw_df_ngpts
 656  integer :: vdw_df_nqpts
 657  integer :: vdw_df_nrpts
 658  integer :: vdw_df_nsmooth
 659  integer :: vdw_df_tweaks
 660  integer :: vdw_xc
 661 !W
 662  integer :: wfinit = 0
 663  integer :: wfoptalg
 664  integer :: wfk_task
 665  integer :: wvl_bigdft_comp
 666  integer :: wvl_nprccg
 667  integer :: w90iniprj
 668  integer :: w90prtunk
 669 !X
 670  integer :: xclevel
 671  integer :: x1rdm  = 0
 672 
 673 !Integer arrays
 674  integer :: bdberry(4)
 675  integer :: bravais(11)
 676  integer :: bs_interp_kmult(3) = 0
 677  integer :: cd_subset_freq(2)
 678  integer :: ddb_ngqpt(3) = 0
 679  integer :: d3e_pert1_atpol(2)
 680  integer :: d3e_pert1_dir(3)
 681  integer :: d3e_pert2_atpol(2)
 682  integer :: d3e_pert2_dir(3)
 683  integer :: d3e_pert3_atpol(2)
 684  integer :: d3e_pert3_dir(3)
 685  integer :: eph_ngqpt_fine(3) = 0
 686  integer :: eph_np_pqbks(5) = 0
 687  integer :: fockdownsampling(3)
 688  integer :: gwr_np_kgts(4) = 0
 689  integer :: gwr_ucsc_batch(2) = -1
 690  integer :: jfielddir(3)
 691  integer :: kptrlatt(3,3)
 692  integer :: kptrlatt_orig(3,3)=0
 693  integer :: qptrlatt(3,3)
 694  integer :: ga_rules(30)
 695  integer :: gpu_devices(12)
 696  integer :: ngfft(18)
 697  integer :: ngfftdg(18)
 698  integer :: nloalg(3)
 699  integer :: ngkpt(3)   ! Number of division for MP sampling.
 700  integer :: ph_ngqpt(3) = 20
 701  integer :: qprtrb(3)
 702  integer :: rfatpol(2)
 703  integer :: rfdir(3)
 704  integer :: rf2_pert1_dir(3)
 705  integer :: rf2_pert2_dir(3)
 706  integer :: sigma_bsum_range(2) = 0
 707  integer :: sigma_ngkpt(3) = 0         ! K-mesh for Sigma_{nk} (only IBZ points). Alternative to kptgw.
 708  integer :: supercell_latt(3)
 709  integer :: transport_ngkpt(3) = 0     ! K-mesh for Transport calculation.
 710  integer :: ucrpa_bands(2)
 711  integer :: vdw_supercell(3)
 712  integer :: vdw_typfrag(100)
 713  integer :: wvl_ngauss(2)
 714 
 715 !Integer allocatables
 716  integer, allocatable ::  algalch(:)         ! algalch(ntypalch)
 717  integer, allocatable ::  bdgw(:,:,:)        ! bdgw(2,nkptgw,nsppol)
 718  integer, allocatable ::  bs_loband(:)
 719  integer, allocatable ::  constraint_kind(:) ! constraint_kind(ntypat)
 720  integer, allocatable ::  dynimage(:)        ! dynimage(nimage or mxnimage)
 721  integer, allocatable ::  efmas_bands(:,:)   ! efmas_bands(2,nkptgw)
 722  integer, allocatable ::  iatfix(:,:)        ! iatfix(3,natom)
 723  integer, allocatable ::  iatsph(:)          ! iatsph(natsph)
 724  integer, allocatable ::  istwfk(:)          ! istwfk(nkpt)
 725  integer, allocatable ::  kberry(:,:)        ! kberry(3,nberry)
 726  integer, allocatable ::  lexexch(:)         ! lexexch(ntypat)
 727  integer, allocatable ::  ldaminushalf(:)    ! ldaminushalf(ntypat)
 728  integer, allocatable ::  lpawu(:)           ! lpawu(ntypat)
 729  integer, allocatable ::  nband(:)           ! nband(nkpt*nsppol)
 730  integer, allocatable ::  plowan_iatom(:)    ! plowan_iatom(plowan_natom)
 731  integer, allocatable ::  plowan_it(:)       ! plowan_it(plowan_nt*3)
 732  integer, allocatable ::  plowan_lcalc(:)    ! plowan_lcalc(\sum_iatom plowan_nbl)
 733  integer, allocatable ::  plowan_nbl(:)      ! plowan_nbl(plowan_natom)
 734  integer, allocatable ::  plowan_projcalc(:) ! plowan_projcalc(\sum_iatom plowan_nbl)
 735  integer, allocatable ::  prtatlist(:)       ! prtatlist(natom)
 736  integer, allocatable ::  so_psp(:)          ! so_psp(npsp)
 737  integer, allocatable ::  symafm(:)          ! symafm(nsym)
 738  integer, allocatable ::  symrel(:,:,:)      ! symrel(3,3,nsym)
 739  integer, allocatable ::  typat(:)           ! typat(natom)
 740 
 741 !Real
 742  real(dp) :: adpimd_gamma
 743  real(dp) :: auxc_scal
 744  real(dp) :: bmass
 745  real(dp) :: boxcutmin
 746  real(dp) :: bs_interp_m3_width = one
 747  real(dp) :: bxctmindg
 748  real(dp) :: cd_halfway_freq
 749  real(dp) :: cd_max_freq
 750  real(dp) :: cpus
 751  real(dp) :: ddamp
 752  real(dp) :: dfpt_sciss
 753  real(dp) :: diecut
 754  real(dp) :: diegap
 755  real(dp) :: dielam
 756  real(dp) :: dielng
 757  real(dp) :: diemac
 758  real(dp) :: diemix
 759  real(dp) :: diemixmag
 760  real(dp) :: dilatmx
 761  real(dp) :: dmft_charge_prec
 762  real(dp) :: dmft_mxsf
 763  real(dp) :: dmft_tolfreq
 764  real(dp) :: dmft_tollc
 765  real(dp) :: dmftqmc_n
 766  real(dp) :: dosdeltae
 767  real(dp) :: dtion
 768  real(dp) :: dtele
 769  !real(dp) :: dvdb_qcache_mb = 1024.0_dp
 770  real(dp) :: dvdb_qcache_mb = zero
 771  real(dp) :: dvdb_qdamp = 0.1_dp
 772  real(dp) :: ecut
 773  real(dp) :: ecuteps
 774  real(dp) :: ecutsigx
 775  real(dp) :: ecutsm
 776  real(dp) :: ecutwfn
 777  real(dp) :: effmass_free
 778  real(dp) :: efmas_deg_tol
 779  real(dp) :: elph2_imagden
 780  real(dp) :: eph_ecutosc = zero
 781  real(dp) :: eph_extrael = zero
 782  real(dp) :: eph_fermie = zero
 783  real(dp) :: eph_fsewin = 0.04_dp
 784  real(dp) :: eph_fsmear = 0.01_dp
 785  real(dp) :: eph_mustar = 0.1_dp
 786  real(dp) :: eph_phrange_w(2) = zero
 787  real(dp) :: eph_phwinfact = 1.1_dp
 788  real(dp) :: eshift
 789  real(dp) :: esmear
 790  real(dp) :: exchmix
 791  real(dp) :: fband
 792  real(dp) :: fermie_nest = zero
 793  real(dp) :: focktoldfe
 794  real(dp) :: freqim_alpha
 795  real(dp) :: freqremin = zero
 796  real(dp) :: freqremax = zero
 797  real(dp) :: freqspmin = zero
 798  real(dp) :: freqspmax = zero
 799  real(dp) :: friction
 800  real(dp) :: fxcartfactor
 801  real(dp) :: ga_opt_percent
 802  real(dp) :: gwencomp = 2.0_dp
 803  real(dp) :: gwls_model_parameter         ! Parameter used in dielectric function model
 804  real(dp) :: gwr_tolqpe = 0.01 * eV_Ha
 805  real(dp) :: hyb_mixing
 806  real(dp) :: hyb_mixing_sr
 807  real(dp) :: hyb_range_dft
 808  real(dp) :: hyb_range_fock
 809  real(dp) :: kptnrm
 810  real(dp) :: kptrlen
 811  real(dp) :: magcon_lambda
 812  real(dp) :: maxestep
 813  real(dp) :: mbpt_sciss = zero
 814  real(dp) :: mdf_epsinf = zero
 815  real(dp) :: mdwall
 816  real(dp) :: mep_mxstep
 817  real(dp) :: nelect
 818  real(dp) :: ne_qFD = zero
 819  real(dp) :: nh_qFD = zero
 820  real(dp) :: noseinert
 821  real(dp) :: nqfd = zero
 822  real(dp) :: omegasimax = 50/Ha_eV
 823  real(dp) :: omegasrdmax = 1.0_dp/Ha_eV  ! = 1eV
 824  real(dp) :: pawecutdg
 825  real(dp) :: pawovlp
 826  real(dp) :: pawujrad
 827  real(dp) :: pawujv
 828  real(dp) :: ph_smear = 0.00002_dp
 829  real(dp) :: ph_wstep = 0.1_dp / Ha_meV
 830  real(dp) :: posocc
 831  real(dp) :: postoldfe
 832  real(dp) :: postoldff
 833  real(dp) :: ppmfrq = zero
 834  real(dp) :: pw_unbal_thresh
 835  real(dp) :: ratsm
 836  real(dp) :: ratsph_extra
 837  real(dp) :: recrcut
 838  real(dp) :: recefermi
 839  real(dp) :: rectolden
 840  real(dp) :: rhoqpmix
 841  real(dp) :: rifcsph = zero
 842  real(dp) :: rcut
 843  real(dp) :: slabwsrad
 844  real(dp) :: slabzbeg
 845  real(dp) :: slabzend
 846  real(dp) :: spbroad
 847  real(dp) :: spinmagntarget
 848  real(dp) :: spnorbscl
 849  real(dp) :: stmbias
 850  real(dp) :: strfact
 851  real(dp) :: strprecon
 852  real(dp) :: td_maxene
 853  real(dp) :: td_scthr
 854  real(dp) :: tfw_toldfe
 855  real(dp) :: tl_radius
 856  real(dp) :: tolcum = zero
 857  real(dp) :: toldfe
 858  real(dp) :: tolmxde
 859  real(dp) :: toldff
 860  real(dp) :: tolimg
 861  real(dp) :: tolmxf
 862  real(dp) :: tolrde
 863  real(dp) :: tolrff
 864  real(dp) :: tolsym
 865  real(dp) :: tolvrs
 866  real(dp) :: tolwfr
 867  real(dp) :: tolwfr_diago
 868  real(dp) :: tphysel
 869  real(dp) :: tsmear
 870  real(dp) :: userra = zero
 871  real(dp) :: userrb = zero
 872  real(dp) :: userrc = zero
 873  real(dp) :: userrd = zero
 874  real(dp) :: userre = zero
 875  real(dp) :: vacwidth
 876  real(dp) :: vdw_tol
 877  real(dp) :: vdw_tol_3bt
 878  real(dp) :: vdw_df_acutmin
 879  real(dp) :: vdw_df_aratio
 880  real(dp) :: vdw_df_damax
 881  real(dp) :: vdw_df_damin
 882  real(dp) :: vdw_df_dcut
 883  real(dp) :: vdw_df_dratio
 884  real(dp) :: vdw_df_dsoft
 885  real(dp) :: vdw_df_gcut
 886  real(dp) :: vdw_df_phisoft
 887  real(dp) :: vdw_df_qcut
 888  real(dp) :: vdw_df_qratio
 889  real(dp) :: vdw_df_rcut
 890  real(dp) :: vdw_df_rsoft
 891  real(dp) :: vdw_df_threshold = zero
 892  real(dp) :: vdw_df_tolerance
 893  real(dp) :: vdw_df_zab
 894  real(dp) :: vis
 895  real(dp) :: vloc_rcut = 6.0_dp
 896  real(dp) :: wfmix
 897  real(dp) :: wtq
 898  real(dp) :: wvl_hgrid
 899  real(dp) :: wvl_crmult
 900  real(dp) :: wvl_frmult
 901  real(dp) :: xc_denpos
 902  real(dp) :: xc_taupos
 903  real(dp) :: xc_tb09_c
 904  real(dp) :: zcut
 905 
 906 !Real arrays
 907  real(dp) :: boxcenter(3)
 908  real(dp) :: bfield(3)
 909 !  Take big absolute value numbers, but not the biggest ones, otherwise overflow can happen
 910  real(dp) :: bs_eh_cutoff(2) = [smallest_real*tol6, greatest_real*tol6]
 911  real(dp) :: bs_freq_mesh(3) = [zero,zero, 0.01_dp/Ha_eV]
 912  real(dp) :: bs_haydock_tol(2) = [0.02_dp, zero]
 913  real(dp) :: ddb_shiftq(3) = zero
 914  real(dp) :: dfield(3)
 915  real(dp) :: efield(3)
 916  real(dp) :: einterp(4) = zero
 917  real(dp) :: eph_tols_idelta(2) = [tol12, tol12]
 918  real(dp) :: field_red(3)
 919  real(dp) :: genafm(3)
 920  real(dp) :: goprecprm(3)
 921  real(dp) :: neb_spring(2)
 922  real(dp) :: pol(3)
 923  real(dp) :: polcen(3)
 924  real(dp) :: pvelmax(3)
 925  real(dp) :: qptn(3)
 926  real(dp) :: red_efield(3)
 927  real(dp) :: red_dfield(3)
 928  real(dp) :: red_efieldbar(3)
 929  real(dp) :: sigma_erange(2) = zero
 930  real(dp) :: strtarget(6)
 931  real(dp) :: tmesh(3) = [5._dp, 59._dp, 6._dp]  ! [start, stop, num]
 932  real(dp) :: ucrpa_window(2)
 933  real(dp) :: vcutgeo(3) = [0.0_dp,0.0_dp,0.0_dp]
 934  real(dp) :: vprtrb(2)
 935  real(dp) :: zeemanfield(3)
 936  real(dp) :: mdtemp(2)
 937 
 938 !Real allocatables
 939  real(dp), allocatable :: acell_orig(:,:)   ! acell_orig(3,nimage)
 940  real(dp), allocatable :: amu_orig(:,:)     ! amu(ntypat,nimage)
 941  real(dp), allocatable :: atvshift(:,:,:)   ! atvshift(16,nsppol,natom)
 942  real(dp), allocatable :: cd_imfrqs(:)      ! cd_imfrqs(cd_customnimfrqs)
 943  real(dp), allocatable :: cellcharge(:)     ! cellcharge(nimage)
 944  real(dp), allocatable :: chrgat(:)         ! chrgat(natom)
 945  real(dp), allocatable :: chempot(:,:,:)    ! chempot(3,nzchempot,ntypat)
 946  real(dp), allocatable :: corecs(:)         ! corecs(ntypat)
 947  real(dp), allocatable :: densty(:,:)       ! densty(ntypat,4)
 948  real(dp), allocatable :: dmatpawu(:,:,:,:,:) ! dmatpawu(2*lpawu+1,2*lpawu+1,nsppol*nspinor,natpu,nimage)
 949                                               ! where natpu=number of atoms with lpawu/=1
 950  real(dp), allocatable :: efmas_dirs(:,:)   ! efmas_dirs(3,efmas_n_dirs)
 951  real(dp), allocatable :: f4of2_sla(:)      ! f4of2_sla(ntypat)
 952  real(dp), allocatable :: f6of2_sla(:)      ! f6of2_sla(ntypat)
 953  real(dp), allocatable :: gw_qlwl(:,:)      ! gw_qlwl(3,gw_nqlwl)
 954  real(dp), allocatable :: gw_freqsp(:)      ! gw_freqsp(gw_customnfreqsp)
 955  real(dp), allocatable :: gwls_list_proj_freq(:)      ! gwls_list_proj_freq(gwls_n_proj_freq)
 956  real(dp), allocatable :: jpawu(:,:)        ! jpawu(ntypat,nimage)
 957  real(dp), allocatable :: kpt(:,:)          ! kpt(3,nkpt)
 958  real(dp), allocatable :: kptbounds(:,:)
 959  real(dp), allocatable :: kptgw(:,:)        ! kptgw(3,nkptgw)
 960  real(dp), allocatable :: kptns(:,:)        ! kptns(3,nkpt) k-points renormalized and shifted.
 961                                             !  The ones that should be used inside the code.
 962  real(dp), allocatable :: kptns_hf(:,:)     ! kpthf(3,nkptns_hf)
 963  real(dp), allocatable :: lambsig(:)        ! lambsig(ntypat)
 964 
 965  real(dp), allocatable :: mixalch_orig(:,:,:) ! mixalch_orig(npspalch,ntypalch,nimage)
 966  real(dp), allocatable :: mixesimgf(:)        ! mixesimgf(nimage)
 967  real(dp), allocatable :: nucdipmom(:,:)      ! nucdipmom(3,natom)
 968  real(dp), allocatable :: occ_orig(:,:)       ! occ_orig(mband*nkpt*nsppol,nimage)
 969  real(dp), allocatable :: pimass(:)           ! pimass(ntypat)
 970  real(dp), allocatable :: ph_qpath(:,:)       ! ph_qpath(3, nqpath)
 971  real(dp), allocatable :: ph_qshift(:,:)      ! ph_qshift(3, ph_nqshift)
 972  real(dp), allocatable :: ptcharge(:)         ! ptcharge(ntypat)
 973  real(dp), allocatable :: qmass(:)            ! qmass(nnos)
 974  real(dp), allocatable :: qptdm(:,:)          ! qptdm(3,nqptdm)
 975  real(dp), allocatable :: quadmom(:)          ! quadmom(ntypat)
 976  real(dp), allocatable :: ratsph(:)           ! ratsph(ntypat)
 977  real(dp), allocatable :: rprim_orig(:,:,:)   ! rprim_orig(3,3,nimage)
 978  real(dp), allocatable :: rprimd_orig(:,:,:)  ! rprimd_orig(3,3,nimage)
 979  real(dp), allocatable :: sigma_shiftk(:,:)   ! sigma_shiftk(3, sigma_nshiftk)    ! shifts in k-mesh for Sigma_{nk}.
 980 
 981  real(dp), allocatable :: shiftk(:,:)         ! shiftk(3,nshiftk)
 982  real(dp) :: shiftk_orig(3,MAX_NSHIFTK)       ! original shifts given in input (changed in inkpts).
 983 
 984  real(dp), allocatable :: spinat(:,:)         ! spinat(3,natom)
 985  real(dp), allocatable :: tnons(:,:)          ! tnons(3,nsym)
 986  real(dp), allocatable :: upawu(:,:)          ! upawu(ntypat,nimage)
 987  real(dp), allocatable :: vel_cell_orig(:,:,:)! vel_cell_orig(3,3,nimage)
 988  real(dp), allocatable :: vel_orig(:,:,:)     ! vel_orig(3,natom,nimage)
 989  real(dp), allocatable :: wtatcon(:,:,:)      ! wtatcon(3,natom,nconeq)
 990  real(dp), allocatable :: wtk(:)              ! wtk(nkpt)
 991  real(dp), allocatable :: xred_orig(:,:,:)    ! xred_orig(3,natom,nimage)
 992  real(dp), allocatable :: xredsph_extra(:,:)  ! xredsph_extra(3,natsph_extra)
 993  real(dp), allocatable :: ziontypat(:)        ! ziontypat(ntypat)
 994  real(dp), allocatable :: znucl(:)            ! znucl(npsp)
 995 
 996 !Character strings
 997  character(len=fnlen) :: getddb_filepath = ABI_NOFILE
 998  character(len=fnlen) :: getden_filepath = ABI_NOFILE
 999  character(len=fnlen) :: getdvdb_filepath = ABI_NOFILE
1000  character(len=fnlen) :: getwfk_filepath = ABI_NOFILE
1001  character(len=fnlen) :: getwfkfine_filepath = ABI_NOFILE
1002  character(len=fnlen) :: getwfq_filepath = ABI_NOFILE
1003  character(len=fnlen) :: getkerange_filepath = ABI_NOFILE
1004  character(len=fnlen) :: getpot_filepath = ABI_NOFILE
1005  character(len=fnlen) :: getscr_filepath = ABI_NOFILE
1006  character(len=fnlen) :: getsigeph_filepath = ABI_NOFILE
1007  character(len=fnlen) :: getgstore_filepath = ABI_NOFILE
1008  character(len=fnlen) :: write_files = ABI_NOFILE
1009 
1010  contains
1011 
1012  procedure :: initocc_chkneu => dtset_initocc_chkneu
1013    ! Check neutrality of system based on band occupancies and valence charges of pseudo-atoms.
1014 
1015  procedure :: copy => dtset_copy
1016    ! Copy object.
1017 
1018  procedure :: free => dtset_free
1019    ! Free dynamic memory.
1020 
1021  procedure :: free_nkpt_arrays => dtset_free_nkpt_arrays
1022    ! Free arrays that depend on input nkpt (used in EPH code)
1023 
1024  procedure :: get_npert_rbz => dtset_get_npert_rbz
1025    ! Get the number of effective pertubation done in looper3, nkpt_rbz, nband_rbz
1026 
1027  procedure :: testsusmat => dtset_testsusmat
1028    ! Test wether a new susceptibility matrix and/or a new dielectric matrix must be computed
1029 
1030  procedure :: get_crystal => dtset_get_crystal
1031    ! Build crystal_t object from dtset and image index.
1032 
1033  procedure :: get_ktmesh => dtset_get_ktmesh
1034    ! Build (linear) mesh of K * temperatures. tsmesh(1:3) = [start, step, num]
1035 
1036  end type dataset_type

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)>

SOURCE

1377 type(dataset_type) function dtset_copy(dtin) result(dtout)
1378 
1379 !Arguments ------------------------------------
1380 !scalars
1381  class(dataset_type),intent(in) :: dtin
1382 
1383 ! *************************************************************************
1384 
1385  DBG_ENTER("COLL")
1386 
1387  !@dataset_type
1388 
1389 !BEGIN VARIABLES FOR @Bethe-Salpeter
1390  dtout%bs_algorithm     = dtin%bs_algorithm
1391  dtout%bs_haydock_niter = dtin%bs_haydock_niter
1392  dtout%bs_exchange_term = dtin%bs_exchange_term
1393  dtout%bs_coulomb_term  = dtin%bs_coulomb_term
1394  dtout%bs_calctype      = dtin%bs_calctype
1395  dtout%bs_coupling      = dtin%bs_coupling
1396  dtout%bs_haydock_tol   = dtin%bs_haydock_tol
1397  dtout%bs_hayd_term     = dtin%bs_hayd_term
1398  dtout%bs_interp_m3_width = dtin%bs_interp_m3_width
1399  dtout%bs_interp_method = dtin%bs_interp_method
1400  dtout%bs_interp_mode   = dtin%bs_interp_mode
1401  dtout%bs_interp_prep   = dtin%bs_interp_prep
1402  dtout%bs_interp_rl_nb  = dtin%bs_interp_rl_nb
1403  dtout%bs_interp_kmult(:) = dtin%bs_interp_kmult(:)
1404  dtout%bs_eh_cutoff(:) = dtin%bs_eh_cutoff(:)
1405  dtout%bs_freq_mesh(:) = dtin%bs_freq_mesh(:)
1406 !END VARIABLES FOR @Bethe-Salpeter.
1407 
1408 !Copy integers from dtin to dtout
1409  dtout%iomode             = dtin%iomode
1410  dtout%accuracy           = dtin%accuracy
1411  dtout%adpimd             = dtin%adpimd
1412  dtout%autoparal          = dtin%autoparal
1413  dtout%auxc_ixc           = dtin%auxc_ixc
1414  dtout%auxc_scal          = dtin%auxc_scal
1415  dtout%awtr               = dtin%awtr
1416  dtout%bandpp             = dtin%bandpp
1417  dtout%bdeigrf            = dtin%bdeigrf
1418  dtout%berryopt           = dtin%berryopt
1419  dtout%berrysav           = dtin%berrysav
1420  dtout%berrystep          = dtin%berrystep
1421  dtout%brav               = dtin%brav
1422  dtout%brvltt             = dtin%brvltt
1423  dtout%bs_nstates         = dtin%bs_nstates
1424  dtout%builtintest        = dtin%builtintest
1425  dtout%cd_customnimfrqs   = dtin%cd_customnimfrqs
1426  dtout%cd_frqim_method    = dtin%cd_frqim_method
1427  dtout%cd_full_grid       = dtin%cd_full_grid
1428  dtout%chkdilatmx         = dtin%chkdilatmx
1429  dtout%chkexit            = dtin%chkexit
1430  dtout%chkparal           = dtin%chkparal
1431  dtout%chkprim            = dtin%chkprim
1432  dtout%chksymbreak        = dtin%chksymbreak
1433  dtout%chksymtnons        = dtin%chksymtnons
1434  dtout%cineb_start        = dtin%cineb_start
1435  dtout%cprj_in_memory     = dtin%cprj_in_memory
1436  dtout%cprj_update_lvl    = dtin%cprj_update_lvl
1437  dtout%delayperm          = dtin%delayperm
1438  dtout%diismemory         = dtin%diismemory
1439  dtout%dipquad            = dtin%dipquad
1440  dtout%dmatpuopt          = dtin%dmatpuopt
1441  dtout%dmatudiag          = dtin%dmatudiag
1442  dtout%dmft_dc            = dtin%dmft_dc
1443  dtout%dmft_entropy       = dtin%dmft_entropy
1444  dtout%dmft_charge_prec   = dtin%dmft_charge_prec
1445  dtout%dmft_iter          = dtin%dmft_iter
1446  dtout%dmft_kspectralfunc = dtin%dmft_kspectralfunc
1447  dtout%dmft_nlambda       = dtin%dmft_nlambda
1448  dtout%dmft_mxsf          = dtin%dmft_mxsf
1449  dtout%dmft_nwlo          = dtin%dmft_nwlo
1450  dtout%dmft_nwli          = dtin%dmft_nwli
1451  dtout%dmft_occnd_imag    = dtin%dmft_occnd_imag
1452  dtout%dmft_read_occnd    = dtin%dmft_read_occnd
1453  dtout%dmft_rslf          = dtin%dmft_rslf
1454  dtout%dmft_solv          = dtin%dmft_solv
1455  dtout%dmft_t2g           = dtin%dmft_t2g
1456 !dtout%dmft_x2my2d        = dtin%dmft_x2my2d
1457  dtout%dmft_tolfreq       = dtin%dmft_tolfreq
1458  dtout%dmft_tollc         = dtin%dmft_tollc
1459  dtout%dmft_wanorthnorm   = dtin%dmft_wanorthnorm
1460  dtout%dmftbandi          = dtin%dmftbandi
1461  dtout%dmftbandf          = dtin%dmftbandf
1462  dtout%dmftcheck          = dtin%dmftcheck
1463  dtout%dmftctqmc_basis    = dtin%dmftctqmc_basis
1464  dtout%dmftctqmc_check    = dtin%dmftctqmc_check
1465  dtout%dmftctqmc_correl   = dtin%dmftctqmc_correl
1466  dtout%dmftctqmc_gmove    = dtin%dmftctqmc_gmove
1467  dtout%dmftctqmc_grnns    = dtin%dmftctqmc_grnns
1468  dtout%dmftctqmc_config   = dtin%dmftctqmc_config
1469  dtout%dmftctqmc_meas     = dtin%dmftctqmc_meas
1470  dtout%dmftctqmc_mrka     = dtin%dmftctqmc_mrka
1471  dtout%dmftctqmc_mov      = dtin%dmftctqmc_mov
1472  dtout%dmftctqmc_order    = dtin%dmftctqmc_order
1473  dtout%dmftctqmc_triqs_nleg = dtin%dmftctqmc_triqs_nleg
1474  dtout%dmftqmc_n          = dtin%dmftqmc_n
1475  dtout%dmftqmc_l          = dtin%dmftqmc_l
1476  dtout%dmftqmc_seed       = dtin%dmftqmc_seed
1477  dtout%dmftqmc_therm      = dtin%dmftqmc_therm
1478  dtout%d3e_pert1_elfd     = dtin%d3e_pert1_elfd
1479  dtout%d3e_pert1_phon     = dtin%d3e_pert1_phon
1480  dtout%d3e_pert2_elfd     = dtin%d3e_pert2_elfd
1481  dtout%d3e_pert2_phon     = dtin%d3e_pert2_phon
1482  dtout%d3e_pert2_strs     = dtin%d3e_pert2_strs
1483  dtout%d3e_pert3_elfd     = dtin%d3e_pert3_elfd
1484  dtout%d3e_pert3_phon     = dtin%d3e_pert3_phon
1485  dtout%efmas              = dtin%efmas
1486  dtout%efmas_calc_dirs    = dtin%efmas_calc_dirs
1487  dtout%efmas_deg          = dtin%efmas_deg
1488  dtout%efmas_dim          = dtin%efmas_dim
1489  dtout%efmas_n_dirs       = dtin%efmas_n_dirs
1490  dtout%efmas_ntheta       = dtin%efmas_ntheta
1491  dtout%enunit             = dtin%enunit
1492 
1493 ! begin eph variables
1494  dtout%asr                = dtin%asr
1495  dtout%dipdip             = dtin%dipdip
1496  dtout%chneut             = dtin%chneut
1497 
1498  dtout%eph_ahc_type       = dtin%eph_ahc_type
1499  dtout%eph_mustar         = dtin%eph_mustar
1500  dtout%eph_intmeth        = dtin%eph_intmeth
1501  dtout%eph_tols_idelta    = dtin%eph_tols_idelta
1502  dtout%eph_phrange        = dtin%eph_phrange
1503  dtout%eph_phrange_w      = dtin%eph_phrange_w
1504  dtout%eph_extrael        = dtin%eph_extrael
1505  dtout%eph_fermie         = dtin%eph_fermie
1506  dtout%eph_frohlichm      = dtin%eph_frohlichm
1507  dtout%eph_frohl_ntheta   = dtin%eph_frohl_ntheta
1508  dtout%eph_fsmear         = dtin%eph_fsmear
1509  dtout%eph_fsewin         = dtin%eph_fsewin
1510  dtout%eph_ecutosc        = dtin%eph_ecutosc
1511  dtout%eph_phwinfact      = dtin%eph_phwinfact
1512  dtout%eph_ngqpt_fine     = dtin%eph_ngqpt_fine
1513  dtout%eph_np_pqbks       = dtin%eph_np_pqbks
1514 
1515  dtout%eph_prtscratew     = dtin%eph_prtscratew
1516  dtout%eph_restart        = dtin%eph_restart
1517  dtout%eph_task           = dtin%eph_task
1518  dtout%eph_stern          = dtin%eph_stern
1519  dtout%eph_use_ftinterp   = dtin%eph_use_ftinterp
1520  dtout%eph_transport      = dtin%eph_transport
1521 
1522  dtout%ph_wstep          = dtin%ph_wstep
1523  dtout%ph_intmeth        = dtin%ph_intmeth
1524  dtout%symdynmat         = dtin%symdynmat
1525  dtout%symv1scf          = dtin%symv1scf
1526  dtout%ph_nqshift        = dtin%ph_nqshift
1527  if (allocated(dtin%ph_qshift)) call alloc_copy(dtin%ph_qshift, dtout%ph_qshift)
1528  dtout%ph_smear          = dtin%ph_smear
1529  dtout%ddb_ngqpt         = dtin%ddb_ngqpt
1530  dtout%ddb_shiftq        = dtin%ddb_shiftq
1531  dtout%dvdb_qcache_mb    = dtin%dvdb_qcache_mb
1532  dtout%dvdb_qdamp        = dtin%dvdb_qdamp
1533  dtout%dvdb_add_lr       = dtin%dvdb_add_lr
1534  dtout%dvdb_rspace_cell  = dtin%dvdb_rspace_cell
1535 
1536  dtout%sigma_bsum_range = dtin%sigma_bsum_range
1537  dtout%sigma_erange = dtin%sigma_erange
1538  dtout%sigma_ngkpt = dtin%sigma_ngkpt
1539  dtout%sigma_nshiftk = dtin%sigma_nshiftk
1540  if (allocated(dtin%sigma_shiftk)) call alloc_copy(dtin%sigma_shiftk, dtout%sigma_shiftk)
1541 
1542  dtout%transport_ngkpt = dtin%transport_ngkpt
1543 
1544  dtout%ph_ndivsm          = dtin%ph_ndivsm
1545  dtout%ph_nqpath          = dtin%ph_nqpath
1546  dtout%ph_ngqpt           = dtin%ph_ngqpt
1547  if (allocated(dtin%ph_qpath)) call alloc_copy(dtin%ph_qpath, dtout%ph_qpath)
1548 ! end eph variables
1549 
1550  dtout%exchn2n3d          = dtin%exchn2n3d
1551  dtout%expert_user        = dtin%expert_user
1552  dtout%extfpmd_nbcut      = dtin%extfpmd_nbcut
1553  dtout%extfpmd_nbdbuf     = dtin%extfpmd_nbdbuf
1554  dtout%extrapwf           = dtin%extrapwf
1555  dtout%pawfatbnd          = dtin%pawfatbnd
1556  dtout%fermie_nest        = dtin%fermie_nest
1557  dtout%ffnl_lw            = dtin%ffnl_lw
1558  dtout%fftgw              = dtin%fftgw
1559  dtout%fft_count          = dtin%fft_count
1560  dtout%fockdownsampling   = dtin%fockdownsampling
1561  dtout%gwr_np_kgts        = dtin%gwr_np_kgts
1562  dtout%gwr_ucsc_batch     = dtin%gwr_ucsc_batch
1563  dtout%fockoptmix         = dtin%fockoptmix
1564  dtout%fock_icutcoul      = dtin%fock_icutcoul
1565  dtout%freqim_alpha       = dtin%freqim_alpha
1566  dtout%freqremin          = dtin%freqremin
1567  dtout%freqremax          = dtin%freqremax
1568  dtout%freqspmin          = dtin%freqspmin
1569  dtout%freqspmax          = dtin%freqspmax
1570  dtout%frzfermi           = dtin%frzfermi
1571  dtout%ga_algor           = dtin%ga_algor
1572  dtout%ga_fitness         = dtin%ga_fitness
1573  dtout%ga_n_rules         = dtin%ga_n_rules
1574  dtout%getbseig           = dtin%getbseig
1575  dtout%getbsreso          = dtin%getbsreso
1576  dtout%getbscoup          = dtin%getbscoup
1577  dtout%getcell            = dtin%getcell
1578  dtout%getddb             = dtin%getddb
1579  dtout%getdvdb            = dtin%getdvdb
1580  dtout%getddk             = dtin%getddk
1581  dtout%getdelfd           = dtin%getdelfd
1582  dtout%getdkdk            = dtin%getdkdk
1583  dtout%getdkde            = dtin%getdkde
1584  dtout%getden             = dtin%getden
1585  dtout%getefmas           = dtin%getefmas
1586  dtout%getgam_eig2nkq     = dtin%getgam_eig2nkq
1587  dtout%gethaydock         = dtin%gethaydock
1588  dtout%getkden            = dtin%getkden
1589  dtout%getocc             = dtin%getocc
1590  dtout%getpawden          = dtin%getpawden
1591  dtout%getddb_filepath    = dtin%getddb_filepath
1592  dtout%getden_filepath    = dtin%getden_filepath
1593  dtout%getdvdb_filepath   = dtin%getdvdb_filepath
1594  dtout%getpot_filepath    = dtin%getpot_filepath
1595  dtout%getsigeph_filepath = dtin%getsigeph_filepath
1596  dtout%getgstore_filepath = dtin%getgstore_filepath
1597  dtout%getscr_filepath    = dtin%getscr_filepath
1598  dtout%getwfk_filepath    = dtin%getwfk_filepath
1599  dtout%getwfkfine_filepath= dtin%getwfkfine_filepath
1600  dtout%getwfq_filepath    = dtin%getwfq_filepath
1601  dtout%getqps             = dtin%getqps
1602  dtout%getscr             = dtin%getscr
1603  dtout%getsuscep          = dtin%getsuscep
1604  dtout%getvel             = dtin%getvel
1605  dtout%getwfk             = dtin%getwfk
1606  dtout%getwfkfine         = dtin%getwfkfine
1607  dtout%getwfq             = dtin%getwfq
1608  dtout%getxcart           = dtin%getxcart
1609  dtout%getxred            = dtin%getxred
1610  dtout%get1den            = dtin%get1den
1611  dtout%get1wf             = dtin%get1wf
1612  dtout%goprecon           = dtin%goprecon
1613 
1614  dtout%gpu_kokkos_nthrd   = dtin%gpu_kokkos_nthrd
1615  dtout%gpu_linalg_limit   = dtin%gpu_linalg_limit
1616  dtout%gpu_nl_distrib     = dtin%gpu_nl_distrib
1617  dtout%gpu_nl_splitsize   = dtin%gpu_nl_splitsize
1618  dtout%gpu_option         = dtin%gpu_option
1619 
1620  dtout%gstore_cplex       = dtin%gstore_cplex
1621  dtout%gstore_with_vk     = dtin%gstore_with_vk
1622  dtout%gstore_kzone       = dtin%gstore_kzone
1623  dtout%gstore_qzone       = dtin%gstore_qzone
1624  dtout%gstore_kfilter     = dtin%gstore_kfilter
1625  dtout%gstore_brange      = dtin%gstore_brange
1626  dtout%gstore_erange      = dtin%gstore_erange
1627 
1628  dtout%gwaclowrank        = dtin%gwaclowrank
1629  dtout%gwcalctyp          = dtin%gwcalctyp
1630  dtout%gwcomp             = dtin%gwcomp
1631  dtout%gwencomp           = dtin%gwencomp
1632  dtout%gwmem              = dtin%gwmem
1633  dtout%gwpara             = dtin%gwpara
1634  dtout%gwgamma            = dtin%gwgamma
1635  dtout%gwrpacorr          = dtin%gwrpacorr
1636  dtout%gwgmcorr           = dtin%gwgmcorr
1637  dtout%gw1rdm             = dtin%gw1rdm
1638  dtout%gw_customnfreqsp   = dtin%gw_customnfreqsp
1639  dtout%gw_icutcoul        = dtin%gw_icutcoul
1640  dtout%gw_nqlwl           = dtin%gw_nqlwl
1641  dtout%gw_frqim_inzgrid   = dtin%gw_frqim_inzgrid
1642  dtout%gw_frqre_inzgrid   = dtin%gw_frqre_inzgrid
1643  dtout%gw_frqre_tangrid   = dtin%gw_frqre_tangrid
1644  dtout%gw_invalid_freq    = dtin%gw_invalid_freq
1645  dtout%gw_qprange         = dtin%gw_qprange
1646  dtout%gw_sigxcore        = dtin%gw_sigxcore
1647 
1648  dtout%gwls_stern_kmax      = dtin%gwls_stern_kmax
1649  dtout%gwls_npt_gauss_quad  = dtin%gwls_npt_gauss_quad
1650  dtout%gwls_diel_model      = dtin%gwls_diel_model
1651  dtout%gwls_print_debug     = dtin%gwls_print_debug
1652  dtout%gwls_nseeds          = dtin%gwls_nseeds
1653  dtout%gwls_n_proj_freq     = dtin%gwls_n_proj_freq
1654  dtout%gwls_kmax_complement = dtin%gwls_kmax_complement
1655  dtout%gwls_kmax_poles      = dtin%gwls_kmax_poles
1656  dtout%gwls_kmax_analytic   = dtin%gwls_kmax_analytic
1657  dtout%gwls_kmax_numeric    = dtin%gwls_kmax_numeric
1658  dtout%gwls_band_index      = dtin%gwls_band_index
1659  dtout%gwls_exchange        = dtin%gwls_exchange
1660  dtout%gwls_correlation     = dtin%gwls_correlation
1661  dtout%gwls_first_seed      = dtin%gwls_first_seed
1662  dtout%gwls_recycle         = dtin%gwls_recycle
1663 
1664  dtout%gwr_ntau             = dtin%gwr_ntau
1665  dtout%gwr_chi_algo         = dtin%gwr_chi_algo
1666  dtout%gwr_sigma_algo       = dtin%gwr_sigma_algo
1667  dtout%gwr_rpa_ncut         = dtin%gwr_rpa_ncut
1668  dtout%gwr_boxcutmin        = dtin%gwr_boxcutmin
1669  dtout%gwr_max_hwtene       = dtin%gwr_max_hwtene
1670  dtout%gwr_regterm          = dtin%gwr_regterm
1671  dtout%gwr_task             = dtin%gwr_task
1672  dtout%gwr_tolqpe           = dtin%gwr_tolqpe
1673  dtout%gwr_nstep            = dtin%gwr_nstep
1674 
1675  dtout%hyb_mixing         = dtin%hyb_mixing
1676  dtout%hyb_mixing_sr      = dtin%hyb_mixing_sr
1677  dtout%hyb_range_dft      = dtin%hyb_range_dft
1678  dtout%hyb_range_fock     = dtin%hyb_range_fock
1679  dtout%hmcsst             = dtin%hmcsst
1680  dtout%hmctt              = dtin%hmctt
1681  dtout%ibte_abs_tol       = dtin%ibte_abs_tol
1682  dtout%ibte_alpha_mix     = dtin%ibte_alpha_mix
1683  dtout%ibte_niter         = dtin%ibte_niter
1684  dtout%ibte_prep          = dtin%ibte_prep
1685  dtout%iboxcut            = dtin%iboxcut
1686  dtout%icoulomb           = dtin%icoulomb
1687  dtout%icutcoul           = dtin%icutcoul
1688  dtout%ieig2rf            = dtin%ieig2rf
1689  dtout%imgmov             = dtin%imgmov
1690  dtout%imgwfstor          = dtin%imgwfstor
1691  dtout%inclvkb            = dtin%inclvkb
1692  dtout%intxc              = dtin%intxc
1693  dtout%invovl_blksliced  = dtin%invovl_blksliced
1694  dtout%ionmov             = dtin%ionmov
1695  dtout%densfor_pred       = dtin%densfor_pred
1696  dtout%iprcel             = dtin%iprcel
1697  dtout%iprcfc             = dtin%iprcfc
1698  dtout%irandom            = dtin%irandom
1699  dtout%irdchkprdm         = dtin%irdchkprdm
1700  dtout%irdbseig           = dtin%irdbseig
1701  dtout%irdbsreso          = dtin%irdbsreso
1702  dtout%irdbscoup          = dtin%irdbscoup
1703  dtout%irdddb             = dtin%irdddb
1704  dtout%irddvdb            = dtin%irddvdb
1705  dtout%irdddk             = dtin%irdddk
1706  dtout%irdden             = dtin%irdden
1707  dtout%irdefmas           = dtin%irdefmas
1708  dtout%irdhaydock         = dtin%irdhaydock
1709  dtout%irdkden            = dtin%irdkden
1710  dtout%irdpawden          = dtin%irdpawden
1711  dtout%irdqps             = dtin%irdqps
1712  dtout%irdscr             = dtin%irdscr
1713  dtout%irdsuscep          = dtin%irdsuscep
1714  dtout%irdvdw             = dtin%irdvdw
1715  dtout%irdwfk             = dtin%irdwfk
1716  dtout%irdwfkfine         = dtin%irdwfkfine
1717  dtout%irdwfq             = dtin%irdwfq
1718  dtout%ird1den            = dtin%ird1den
1719  dtout%ird1wf             = dtin%ird1wf
1720  dtout%iscf               = dtin%iscf
1721  dtout%isecur             = dtin%isecur
1722  dtout%istatimg           = dtin%istatimg
1723  dtout%istatr             = dtin%istatr
1724  dtout%istatshft          = dtin%istatshft
1725  dtout%ivalence           = dtin%ivalence
1726  dtout%ixc                = dtin%ixc
1727  dtout%ixc_sigma          = dtin%ixc_sigma
1728  dtout%ixcpositron        = dtin%ixcpositron
1729  dtout%ixcrot             = dtin%ixcrot
1730  dtout%jdtset             = dtin%jdtset
1731  dtout%jellslab           = dtin%jellslab
1732  dtout%kptopt             = dtin%kptopt
1733  dtout%kssform            = dtin%kssform
1734  dtout%localrdwf          = dtin%localrdwf
1735 #if defined HAVE_LOTF
1736  dtout%lotf_classic       = dtin%lotf_classic
1737  dtout%lotf_nitex         = dtin%lotf_nitex
1738  dtout%lotf_nneigx        = dtin%lotf_nneigx
1739  dtout%lotf_version       = dtin%lotf_version
1740 #endif
1741  dtout%lw_flexo           = dtin%lw_flexo
1742  dtout%lw_natopt          = dtin%lw_natopt
1743  dtout%lw_qdrpl           = dtin%lw_qdrpl
1744  dtout%magconon           = dtin%magconon
1745  dtout%maxnsym            = dtin%maxnsym
1746  dtout%max_ncpus          = dtin%max_ncpus
1747  dtout%mband              = dtin%mband
1748  dtout%mband_mem          = dtin%mband_mem
1749  dtout%mdf_epsinf         = dtin%mdf_epsinf
1750  dtout%mep_solver         = dtin%mep_solver
1751  dtout%mem_test           = dtin%mem_test
1752  dtout%mixprec            = dtin%mixprec
1753  dtout%mffmem             = dtin%mffmem
1754  dtout%mgfft              = dtin%mgfft
1755  dtout%mgfftdg            = dtin%mgfftdg
1756  dtout%mkmem              = dtin%mkmem
1757  dtout%mkqmem             = dtin%mkqmem
1758  dtout%mk1mem             = dtin%mk1mem
1759  dtout%mpw                = dtin%mpw
1760  dtout%mqgrid             = dtin%mqgrid
1761  dtout%mqgriddg           = dtin%mqgriddg
1762  dtout%natom              = dtin%natom
1763  dtout%natrd              = dtin%natrd
1764  dtout%natsph             = dtin%natsph
1765  dtout%natsph_extra       = dtin%natsph_extra
1766  dtout%natpawu            = dtin%natpawu
1767  dtout%natvshift          = dtin%natvshift
1768  dtout%nbdblock           = dtin%nbdblock
1769  dtout%nbdbuf             = dtin%nbdbuf
1770  dtout%nbandhf            = dtin%nbandhf
1771  dtout%nberry             = dtin%nberry
1772  dtout%nc_xccc_gspace     = dtin%nc_xccc_gspace
1773  dtout%nbandkss           = dtin%nbandkss
1774  dtout%nconeq             = dtin%nconeq
1775  dtout%ncout              = dtin%ncout
1776  dtout%nctime             = dtin%nctime
1777  dtout%ndtset             = dtin%ndtset
1778  dtout%ndynimage          = dtin%ndynimage
1779  dtout%neb_algo           = dtin%neb_algo
1780  dtout%nfft               = dtin%nfft
1781  dtout%nfftdg             = dtin%nfftdg
1782  dtout%nfreqim            = dtin%nfreqim
1783  dtout%nfreqre            = dtin%nfreqre
1784  dtout%nfreqsp            = dtin%nfreqsp
1785  dtout%nimage             = dtin%nimage
1786  dtout%nkpt               = dtin%nkpt
1787  dtout%nkpthf             = dtin%nkpthf
1788  dtout%nkptgw             = dtin%nkptgw
1789  dtout%nonlinear_info     = dtin%nonlinear_info
1790  dtout%nonlop_ylm_count   = dtin%nonlop_ylm_count
1791  dtout%nline              = dtin%nline
1792  dtout%nblock_lobpcg      = dtin%nblock_lobpcg
1793  dtout%nnsclo             = dtin%nnsclo
1794  dtout%nnsclohf           = dtin%nnsclohf
1795  dtout%nomegasf           = dtin%nomegasf
1796  dtout%nomegasi           = dtin%nomegasi
1797  dtout%nomegasrd          = dtin%nomegasrd
1798  dtout%npband             = dtin%npband
1799  dtout%npfft              = dtin%npfft
1800  dtout%nphf               = dtin%nphf
1801  dtout%npimage            = dtin%npimage
1802  dtout%np_spkpt           = dtin%np_spkpt
1803  dtout%nppert             = dtin%nppert
1804  dtout%npspinor           = dtin%npspinor
1805  dtout%npsp               = dtin%npsp
1806  dtout%npspalch           = dtin%npspalch
1807  dtout%npulayit           = dtin%npulayit
1808  dtout%npvel              = dtin%npvel
1809  dtout%npweps             = dtin%npweps
1810  dtout%npwkss             = dtin%npwkss
1811  dtout%npwsigx            = dtin%npwsigx
1812  dtout%npwwfn             = dtin%npwwfn
1813  dtout%np_slk             = dtin%np_slk
1814  dtout%nqpt               = dtin%nqpt
1815  dtout%nqptdm             = dtin%nqptdm
1816  dtout%nscforder          = dtin%nscforder
1817  dtout%nshiftk            = dtin%nshiftk
1818  dtout%nshiftk_orig       = dtin%nshiftk_orig
1819  dtout%nspden             = dtin%nspden
1820  dtout%nspinor            = dtin%nspinor
1821  dtout%nsppol             = dtin%nsppol
1822  dtout%nstep              = dtin%nstep
1823  dtout%nsym               = dtin%nsym
1824  dtout%ntime              = dtin%ntime
1825  dtout%ntimimage          = dtin%ntimimage
1826  dtout%ntypalch           = dtin%ntypalch
1827  dtout%ntypat             = dtin%ntypat
1828  dtout%ntyppure           = dtin%ntyppure
1829  dtout%nucefg             = dtin%nucefg
1830  dtout%nucfc              = dtin%nucfc
1831  dtout%nwfshist           = dtin%nwfshist
1832  dtout%nzchempot          = dtin%nzchempot
1833  dtout%occopt             = dtin%occopt
1834  dtout%optcell            = dtin%optcell
1835  dtout%optdcmagpawu       = dtin%optdcmagpawu
1836  dtout%optdriver          = dtin%optdriver
1837  dtout%optforces          = dtin%optforces
1838  dtout%optnlxccc          = dtin%optnlxccc
1839  dtout%optstress          = dtin%optstress
1840  dtout%orbmag             = dtin%orbmag
1841  dtout%ortalg             = dtin%ortalg
1842  dtout%paral_atom         = dtin%paral_atom
1843  dtout%paral_kgb          = dtin%paral_kgb
1844  dtout%paral_rf           = dtin%paral_rf
1845  dtout%prt_lorbmag        = dtin%prt_lorbmag
1846  dtout%pawcpxocc          = dtin%pawcpxocc
1847  dtout%pawcross           = dtin%pawcross
1848  dtout%pawlcutd           = dtin%pawlcutd
1849  dtout%pawlmix            = dtin%pawlmix
1850  dtout%pawmixdg           = dtin%pawmixdg
1851  dtout%pawnhatxc          = dtin%pawnhatxc
1852  dtout%pawnphi            = dtin%pawnphi
1853  dtout%pawntheta          = dtin%pawntheta
1854  dtout%pawnzlm            = dtin%pawnzlm
1855  dtout%pawoptmix          = dtin%pawoptmix
1856  dtout%pawoptosc          = dtin%pawoptosc
1857  dtout%pawprtdos          = dtin%pawprtdos
1858  dtout%pawprtvol          = dtin%pawprtvol
1859  dtout%pawprtwf           = dtin%pawprtwf
1860  dtout%pawprt_k           = dtin%pawprt_k
1861  dtout%pawprt_b           = dtin%pawprt_b
1862  dtout%pawspnorb          = dtin%pawspnorb
1863  dtout%pawstgylm          = dtin%pawstgylm
1864  dtout%pawsushat          = dtin%pawsushat
1865  dtout%pawusecp           = dtin%pawusecp
1866  dtout%pawujat            = dtin%pawujat
1867  dtout%macro_uj           = dtin%macro_uj
1868  dtout%pawujrad           = dtin%pawujrad
1869  dtout%pawujv             = dtin%pawujv
1870  dtout%pawxcdev           = dtin%pawxcdev
1871  dtout%pimd_constraint    = dtin%pimd_constraint
1872  dtout%pitransform        = dtin%pitransform
1873  dtout%plowan_compute     = dtin%plowan_compute
1874  dtout%plowan_bandi       = dtin%plowan_bandi
1875  dtout%plowan_bandf       = dtin%plowan_bandf
1876  dtout%plowan_natom       = dtin%plowan_natom
1877  dtout%plowan_nt          = dtin%plowan_nt
1878  dtout%plowan_realspace   = dtin%plowan_realspace
1879  dtout%posdoppler         = dtin%posdoppler
1880  dtout%positron           = dtin%positron
1881  dtout%posnstep           = dtin%posnstep
1882  dtout%ppmodel            = dtin%ppmodel
1883  dtout%prepalw            = dtin%prepalw
1884  dtout%prepanl            = dtin%prepanl
1885  dtout%prepgkk            = dtin%prepgkk
1886  dtout%prtbbb             = dtin%prtbbb
1887  dtout%prtbltztrp         = dtin%prtbltztrp
1888  dtout%prtchkprdm         = dtin%prtchkprdm
1889  dtout%prtcif             = dtin%prtcif
1890  dtout%prtddb             = dtin%prtddb
1891  dtout%prtden             = dtin%prtden
1892  dtout%prtdensph          = dtin%prtdensph
1893  dtout%prtdipole          = dtin%prtdipole
1894  dtout%prtdos             = dtin%prtdos
1895  dtout%prtdosm            = dtin%prtdosm
1896  dtout%prtebands          = dtin%prtebands    ! TODO prteig could be replaced by prtebands...
1897  dtout%prtefmas           = dtin%prtefmas
1898  dtout%prteig             = dtin%prteig
1899  dtout%prtelf             = dtin%prtelf
1900  dtout%prteliash          = dtin%prteliash
1901  dtout%prtevk             = dtin%prtevk
1902  dtout%prtfc              = dtin%prtfc
1903  dtout%prtfull1wf         = dtin%prtfull1wf
1904  dtout%prtfsurf           = dtin%prtfsurf
1905  dtout%prtgsr             = dtin%prtgsr
1906  dtout%prtgden            = dtin%prtgden
1907  dtout%prtgeo             = dtin%prtgeo
1908  dtout%prtgkk             = dtin%prtgkk
1909  dtout%prthist            = dtin%prthist
1910  dtout%prtkden            = dtin%prtkden
1911  dtout%prtkpt             = dtin%prtkpt
1912  dtout%prtlden            = dtin%prtlden
1913  dtout%prtnabla           = dtin%prtnabla
1914  dtout%prtnest            = dtin%prtnest
1915  dtout%prtphbands         = dtin%prtphbands
1916  dtout%prtocc             = dtin%prtocc
1917  dtout%prtphdos           = dtin%prtphdos
1918  dtout%prtphsurf          = dtin%prtphsurf
1919  dtout%prtposcar          = dtin%prtposcar
1920  dtout%prtprocar          = dtin%prtprocar
1921  dtout%prtpot             = dtin%prtpot
1922  dtout%prtpsps            = dtin%prtpsps
1923  dtout%prtspcur           = dtin%prtspcur
1924  dtout%prtsuscep          = dtin%prtsuscep
1925  dtout%prtstm             = dtin%prtstm
1926  dtout%prtvclmb           = dtin%prtvclmb
1927  dtout%prtvdw             = dtin%prtvdw
1928  dtout%prtvha             = dtin%prtvha
1929  dtout%prtvhxc            = dtin%prtvhxc
1930  dtout%prtkbff            = dtin%prtkbff
1931  dtout%prtvol             = dtin%prtvol
1932  dtout%prtvolimg          = dtin%prtvolimg
1933  dtout%prtvpsp            = dtin%prtvpsp
1934  dtout%prtvxc             = dtin%prtvxc
1935  dtout%prtwant            = dtin%prtwant
1936  dtout%prtwf              = dtin%prtwf
1937  dtout%prtwf_full         = dtin%prtwf_full
1938  dtout%prtxml             = dtin%prtxml
1939  dtout%prt1dm             = dtin%prt1dm
1940  dtout%ptgroupma          = dtin%ptgroupma
1941  dtout%qptopt             = dtin%qptopt
1942  dtout%quadquad           = dtin%quadquad
1943  dtout%random_atpos       = dtin%random_atpos
1944  dtout%recgratio          = dtin%recgratio
1945  dtout%recnpath           = dtin%recnpath
1946  dtout%recnrec            = dtin%recnrec
1947  dtout%recptrott          = dtin%recptrott
1948  dtout%rectesteg          = dtin%rectesteg
1949  dtout%rcut               = dtin%rcut
1950  dtout%restartxf          = dtin%restartxf
1951  dtout%rfddk              = dtin%rfddk
1952  dtout%rfelfd             = dtin%rfelfd
1953  dtout%rfmagn             = dtin%rfmagn
1954  dtout%rfmeth             = dtin%rfmeth
1955  dtout%rfphon             = dtin%rfphon
1956  dtout%rfstrs             = dtin%rfstrs
1957  dtout%rfstrs_ref         = dtin%rfstrs_ref
1958  dtout%rfuser             = dtin%rfuser
1959  dtout%rf2_dkdk           = dtin%rf2_dkdk
1960  dtout%rf2_dkde           = dtin%rf2_dkde
1961  dtout%rmm_diis           = dtin%rmm_diis
1962  dtout%rmm_diis_savemem   = dtin%rmm_diis_savemem
1963  dtout%rhoqpmix           = dtin%rhoqpmix
1964  dtout%rifcsph            = dtin%rifcsph
1965  dtout%signperm           = dtin%signperm
1966  dtout%slabwsrad          = dtin%slabwsrad
1967  dtout%slabzbeg           = dtin%slabzbeg
1968  dtout%slabzend           = dtin%slabzend
1969  dtout%slk_rankpp         = dtin%slk_rankpp
1970  dtout%smdelta            = dtin%smdelta
1971  dtout%spgaxor            = dtin%spgaxor
1972  dtout%spgorig            = dtin%spgorig
1973  dtout%spgroup            = dtin%spgroup
1974  dtout%spmeth             = dtin%spmeth
1975  dtout%string_algo        = dtin%string_algo
1976  dtout%symchi             = dtin%symchi
1977  dtout%symmorphi          = dtin%symmorphi
1978  dtout%symsigma           = dtin%symsigma
1979  dtout%td_exp_order       = dtin%td_exp_order
1980  dtout%td_mexcit          = dtin%td_mexcit
1981  dtout%td_scnmax          = dtin%td_scnmax
1982  dtout%td_prtstr          = dtin%td_prtstr
1983  dtout%td_restart         = dtin%td_restart
1984  dtout%td_propagator      = dtin%td_propagator
1985  dtout%td_scthr           = dtin%td_scthr
1986  dtout%tfkinfunc          = dtin%tfkinfunc
1987  dtout%tim1rev            = dtin%tim1rev
1988  dtout%timopt             = dtin%timopt
1989  dtout%use_gemm_nonlop    = dtin%use_gemm_nonlop
1990  dtout%useextfpmd         = dtin%useextfpmd
1991  dtout%use_yaml           = dtin%use_yaml   ! This variable activates the Yaml output for testing purposes
1992                                             ! It will be removed when Yaml output enters production.
1993  dtout%use_slk            = dtin%use_slk
1994  dtout%use_oldchi         = dtin%use_oldchi
1995  dtout%usedmatpu          = dtin%usedmatpu
1996  dtout%usedmft            = dtin%usedmft
1997  dtout%useexexch          = dtin%useexexch
1998  dtout%usefock            = dtin%usefock
1999  dtout%usekden            = dtin%usekden
2000  dtout%use_nonscf_gkk     = dtin%use_nonscf_gkk
2001  dtout%usepaw             = dtin%usepaw
2002  dtout%usepawu            = dtin%usepawu
2003  dtout%usepead            = dtin%usepead
2004  dtout%usepotzero         = dtin%usepotzero
2005  dtout%userec             = dtin%userec
2006  dtout%useria             = dtin%useria
2007  dtout%userib             = dtin%userib
2008  dtout%useric             = dtin%useric
2009  dtout%userid             = dtin%userid
2010  dtout%userie             = dtin%userie
2011  dtout%usewvl             = dtin%usewvl
2012  dtout%usexcnhat_orig     = dtin%usexcnhat_orig
2013  dtout%useylm             = dtin%useylm
2014  dtout%vacnum             = dtin%vacnum
2015  dtout%vdw_df_acutmin     = dtin%vdw_df_acutmin
2016  dtout%vdw_df_aratio      = dtin%vdw_df_aratio
2017  dtout%vdw_df_damax       = dtin%vdw_df_damax
2018  dtout%vdw_df_damin       = dtin%vdw_df_damin
2019  dtout%vdw_df_dcut        = dtin%vdw_df_dcut
2020  dtout%vdw_df_dratio      = dtin%vdw_df_dratio
2021  dtout%vdw_df_dsoft       = dtin%vdw_df_dsoft
2022  dtout%vdw_df_gcut        = dtin%vdw_df_gcut
2023  dtout%vdw_df_ndpts       = dtin%vdw_df_ndpts
2024  dtout%vdw_df_ngpts       = dtin%vdw_df_ngpts
2025  dtout%vdw_df_nqpts       = dtin%vdw_df_nqpts
2026  dtout%vdw_df_nrpts       = dtin%vdw_df_nrpts
2027  dtout%vdw_df_nsmooth     = dtin%vdw_df_nsmooth
2028  dtout%vdw_df_phisoft     = dtin%vdw_df_phisoft
2029  dtout%vdw_df_qcut        = dtin%vdw_df_qcut
2030  dtout%vdw_df_qratio      = dtin%vdw_df_qratio
2031  dtout%vdw_df_rcut        = dtin%vdw_df_rcut
2032  dtout%vdw_df_rsoft       = dtin%vdw_df_rsoft
2033  dtout%vdw_df_tolerance   = dtin%vdw_df_tolerance
2034  dtout%vdw_df_threshold   = dtin%vdw_df_threshold
2035  dtout%vdw_df_tweaks      = dtin%vdw_df_tweaks
2036  dtout%vdw_df_zab         = dtin%vdw_df_zab
2037  dtout%vdw_nfrag          = dtin%vdw_nfrag
2038  dtout%vdw_xc             = dtin%vdw_xc
2039  dtout%wfinit             = dtin%wfinit
2040  dtout%wfoptalg           = dtin%wfoptalg
2041  dtout%wfoptalg           = dtin%wfoptalg
2042  dtout%write_files        = dtin%write_files
2043  dtout%wvl_bigdft_comp    = dtin%wvl_bigdft_comp
2044  dtout%w90iniprj          = dtin%w90iniprj
2045  dtout%w90prtunk          = dtin%w90prtunk
2046  dtout%xclevel            = dtin%xclevel
2047  dtout%xc_denpos          = dtin%xc_denpos
2048  dtout%xc_taupos          = dtin%xc_taupos
2049  dtout%x1rdm              = dtin%x1rdm
2050 
2051 !Copy allocated integer arrays from dtin to dtout
2052  dtout%bdberry(:)         = dtin%bdberry(:)
2053  dtout%cd_subset_freq(:)  = dtin%cd_subset_freq(:)
2054  dtout%d3e_pert1_atpol(:) = dtin%d3e_pert1_atpol(:)
2055  dtout%d3e_pert1_dir(:)   = dtin%d3e_pert1_dir(:)
2056  dtout%d3e_pert2_atpol(:) = dtin%d3e_pert2_atpol(:)
2057  dtout%d3e_pert2_dir(:)   = dtin%d3e_pert2_dir(:)
2058  dtout%d3e_pert3_atpol(:) = dtin%d3e_pert3_atpol(:)
2059  dtout%d3e_pert3_dir(:)   = dtin%d3e_pert3_dir(:)
2060  dtout%ga_rules(:)        = dtin%ga_rules(:)
2061  dtout%gpu_devices(:)     = dtin%gpu_devices(:)
2062  dtout%jfielddir(:)       = dtin%jfielddir(:)
2063  dtout%kptrlatt(:,:)      = dtin%kptrlatt(:,:)
2064  dtout%kptrlatt_orig      = dtin%kptrlatt_orig
2065  dtout%qptrlatt(:,:)      = dtin%qptrlatt(:,:)
2066  dtout%ngfft(:)           = dtin%ngfft(:)
2067  dtout%ngfftdg(:)         = dtin%ngfftdg(:)
2068  dtout%nloalg(:)          = dtin%nloalg(:)
2069  dtout%ngkpt(:)           = dtin%ngkpt(:)
2070  dtout%qprtrb(:)          = dtin%qprtrb(:)
2071  dtout%rfatpol(:)         = dtin%rfatpol(:)
2072  dtout%rfdir(:)           = dtin%rfdir(:)
2073  dtout%rf2_pert1_dir(:)   = dtin%rf2_pert1_dir(:)
2074  dtout%rf2_pert2_dir(:)   = dtin%rf2_pert2_dir(:)
2075  dtout%supercell_latt(:)= dtin%supercell_latt(:)
2076  dtout%ucrpa_bands(:)     = dtin%ucrpa_bands(:)
2077  dtout%vdw_supercell(:)   = dtin%vdw_supercell(:)
2078  dtout%vdw_typfrag(:)     = dtin%vdw_typfrag(:)
2079  dtout%wvl_ngauss(:)      = dtin%wvl_ngauss(:)
2080 
2081 !Copy reals from dtin to dtout
2082  dtout%adpimd_gamma       = dtin%adpimd_gamma
2083  dtout%boxcutmin          = dtin%boxcutmin
2084  dtout%bxctmindg          = dtin%bxctmindg
2085  dtout%cd_halfway_freq    = dtin%cd_halfway_freq
2086  dtout%cd_max_freq        = dtin%cd_max_freq
2087  dtout%cpus               = dtin%cpus
2088  dtout%ddamp              = dtin%ddamp
2089  dtout%diecut             = dtin%diecut
2090  dtout%diegap             = dtin%diegap
2091  dtout%dielam             = dtin%dielam
2092  dtout%dielng             = dtin%dielng
2093  dtout%diemac             = dtin%diemac
2094  dtout%diemix             = dtin%diemix
2095  dtout%diemixmag          = dtin%diemixmag
2096  dtout%dilatmx            = dtin%dilatmx
2097  dtout%dosdeltae          = dtin%dosdeltae
2098  dtout%dtion              = dtin%dtion
2099  dtout%dtele              = dtin%dtele
2100  dtout%ecut               = dtin%ecut
2101  dtout%ecuteps            = dtin%ecuteps
2102  dtout%ecutsigx           = dtin%ecutsigx
2103  dtout%ecutsm             = dtin%ecutsm
2104  dtout%ecutwfn            = dtin%ecutwfn
2105  dtout%effmass_free       = dtin%effmass_free
2106  dtout%efmas_deg_tol      = dtin%efmas_deg_tol
2107  dtout%elph2_imagden      = dtin%elph2_imagden
2108  dtout%eshift             = dtin%eshift
2109  dtout%esmear             = dtin%esmear
2110  dtout%exchmix            = dtin%exchmix
2111  dtout%fband              = dtin%fband
2112  dtout%focktoldfe         = dtin%focktoldfe
2113  dtout%friction           = dtin%friction
2114  dtout%fxcartfactor       = dtin%fxcartfactor
2115  dtout%ga_opt_percent     = dtin%ga_opt_percent
2116  dtout%gwls_model_parameter = dtin%gwls_model_parameter
2117  dtout%kptnrm             = dtin%kptnrm
2118  dtout%kptrlen            = dtin%kptrlen
2119  dtout%maxestep           = dtin%maxestep
2120  dtout%bmass              = dtin%bmass
2121  dtout%magcon_lambda      = dtin%magcon_lambda
2122  dtout%mdwall             = dtin%mdwall
2123  dtout%mep_mxstep         = dtin%mep_mxstep
2124  dtout%nelect             = dtin%nelect
2125  dtout%ne_qFD             = dtin%ne_qFD
2126  dtout%nh_qFD             = dtin%nh_qFD
2127  dtout%nnos               = dtin%nnos
2128  dtout%noseinert          = dtin%noseinert
2129  dtout%nqfd               = dtin%nqfd
2130  dtout%omegasimax         = dtin%omegasimax
2131  dtout%omegasrdmax        = dtin%omegasrdmax
2132  dtout%pawecutdg          = dtin%pawecutdg
2133  dtout%pawovlp            = dtin%pawovlp
2134  dtout%posocc             = dtin%posocc
2135  dtout%postoldfe          = dtin%postoldfe
2136  dtout%postoldff          = dtin%postoldff
2137  dtout%ppmfrq             = dtin%ppmfrq
2138  dtout%pw_unbal_thresh    = dtin%pw_unbal_thresh
2139  dtout%ratsm              = dtin%ratsm
2140  dtout%ratsph_extra       = dtin%ratsph_extra
2141  dtout%recrcut            = dtin%recrcut
2142  dtout%recefermi          = dtin%recefermi
2143  dtout%rectolden          = dtin%rectolden
2144  dtout%dfpt_sciss         = dtin%dfpt_sciss
2145  dtout%mbpt_sciss         = dtin%mbpt_sciss
2146  dtout%spinmagntarget     = dtin%spinmagntarget
2147  dtout%spbroad            = dtin%spbroad
2148  dtout%spnorbscl          = dtin%spnorbscl
2149  dtout%stmbias            = dtin%stmbias
2150  dtout%strfact            = dtin%strfact
2151  dtout%strprecon          = dtin%strprecon
2152  dtout%tfw_toldfe         = dtin%tfw_toldfe
2153  dtout%tl_radius          = dtin%tl_radius
2154  dtout%tl_nprccg          = dtin%tl_nprccg
2155  dtout%td_maxene          = dtin%td_maxene
2156  dtout%tolcum             = dtin%tolcum
2157  dtout%toldfe             = dtin%toldfe
2158  dtout%tolmxde            = dtin%tolmxde
2159  dtout%toldff             = dtin%toldff
2160  dtout%tolimg             = dtin%tolimg
2161  dtout%tolmxf             = dtin%tolmxf
2162  dtout%tolrde             = dtin%tolrde
2163  dtout%tolrff             = dtin%tolrff
2164  dtout%tolsym             = dtin%tolsym
2165  dtout%tolvrs             = dtin%tolvrs
2166  dtout%tolwfr             = dtin%tolwfr
2167  dtout%tolwfr_diago       = dtin%tolwfr_diago
2168  dtout%tphysel            = dtin%tphysel
2169  dtout%tsmear             = dtin%tsmear
2170  dtout%ucrpa              = dtin%ucrpa
2171  dtout%userra             = dtin%userra
2172  dtout%userrb             = dtin%userrb
2173  dtout%userrc             = dtin%userrc
2174  dtout%userrd             = dtin%userrd
2175  dtout%userre             = dtin%userre
2176  dtout%vacwidth           = dtin%vacwidth
2177  dtout%vdw_tol            = dtin%vdw_tol
2178  dtout%vdw_tol_3bt        = dtin%vdw_tol_3bt
2179  dtout%vis                = dtin%vis
2180  dtout%vloc_rcut          = dtin%vloc_rcut
2181  dtout%wfmix              = dtin%wfmix
2182  dtout%wfk_task           = dtin%wfk_task
2183  dtout%wtq                = dtin%wtq
2184  dtout%wvl_hgrid          = dtin%wvl_hgrid
2185  dtout%wvl_crmult         = dtin%wvl_crmult
2186  dtout%wvl_frmult         = dtin%wvl_frmult
2187  dtout%wvl_nprccg         = dtin%wvl_nprccg
2188  dtout%xc_tb09_c          = dtin%xc_tb09_c
2189  dtout%zcut               = dtin%zcut
2190 
2191 !Copy allocated real arrays from dtin to dtout
2192  dtout%boxcenter(:)       = dtin%boxcenter(:)
2193  dtout%bfield(:)          = dtin%bfield(:)
2194  dtout%dfield(:)          = dtin%dfield(:)
2195  dtout%efield(:)          = dtin%efield(:)
2196  dtout%field_red(:)       = dtin%field_red(:)
2197  dtout%genafm(:)          = dtin%genafm(:)
2198  dtout%goprecprm(:)       = dtin%goprecprm(:)
2199  dtout%mdtemp(:)          = dtin%mdtemp(:)
2200  dtout%neb_spring(:)      = dtin%neb_spring(:)
2201  dtout%polcen(:)          = dtin%polcen(:)
2202  dtout%qptn(:)            = dtin%qptn(:)
2203  dtout%pvelmax(:)         = dtin%pvelmax(:)
2204  dtout%red_efield(:)      = dtin%red_efield(:)
2205  dtout%red_dfield(:)      = dtin%red_dfield(:)
2206  dtout%red_efieldbar(:)   = dtin%red_efieldbar(:)
2207  dtout%shiftk_orig        = dtin%shiftk_orig
2208  dtout%strtarget(:)       = dtin%strtarget(:)
2209  dtout%ucrpa_window(:)    = dtin%ucrpa_window(:)
2210  dtout%vcutgeo(:)         = dtin%vcutgeo(:)
2211  dtout%vprtrb(:)          = dtin%vprtrb(:)
2212  dtout%zeemanfield(:)     = dtin%zeemanfield(:)
2213 
2214 !Use alloc_copy to allocate and copy the allocatable arrays
2215 
2216 !integer allocatables
2217  call alloc_copy(dtin%algalch, dtout%algalch)
2218  call alloc_copy(dtin%bdgw, dtout%bdgw)
2219  call alloc_copy(dtin%bs_loband, dtout%bs_loband)
2220  call alloc_copy(dtin%constraint_kind, dtout%constraint_kind)
2221  call alloc_copy(dtin%dynimage, dtout%dynimage)
2222  call alloc_copy(dtin%efmas_bands, dtout%efmas_bands)
2223  call alloc_copy(dtin%iatfix, dtout%iatfix)
2224  call alloc_copy(dtin%iatsph, dtout%iatsph)
2225  call alloc_copy(dtin%istwfk, dtout%istwfk)
2226  call alloc_copy(dtin%kberry, dtout%kberry)
2227  call alloc_copy(dtin%lexexch, dtout%lexexch)
2228  call alloc_copy(dtin%ldaminushalf, dtout%ldaminushalf)
2229  call alloc_copy(dtin%lpawu, dtout%lpawu)
2230  call alloc_copy(dtin%nband, dtout%nband)
2231  call alloc_copy(dtin%plowan_iatom, dtout%plowan_iatom)
2232  call alloc_copy(dtin%plowan_it, dtout%plowan_it)
2233  call alloc_copy(dtin%plowan_nbl, dtout%plowan_nbl)
2234  call alloc_copy(dtin%plowan_lcalc, dtout%plowan_lcalc)
2235  call alloc_copy(dtin%plowan_projcalc, dtout%plowan_projcalc)
2236  call alloc_copy(dtin%prtatlist, dtout%prtatlist)
2237  call alloc_copy(dtin%so_psp, dtout%so_psp)
2238  call alloc_copy(dtin%symafm, dtout%symafm)
2239  call alloc_copy(dtin%symrel, dtout%symrel)
2240  call alloc_copy(dtin%typat, dtout%typat)
2241 
2242 !Allocate and copy real allocatable
2243  call alloc_copy(dtin%acell_orig, dtout%acell_orig)
2244  call alloc_copy(dtin%amu_orig, dtout%amu_orig)
2245  call alloc_copy(dtin%atvshift, dtout%atvshift)
2246  call alloc_copy(dtin%cd_imfrqs, dtout%cd_imfrqs)
2247  call alloc_copy(dtin%cellcharge, dtout%cellcharge)
2248  call alloc_copy(dtin%chempot, dtout%chempot)
2249  call alloc_copy(dtin%chrgat, dtout%chrgat)
2250  call alloc_copy(dtin%corecs, dtout%corecs)
2251  call alloc_copy(dtin%densty, dtout%densty)
2252  call alloc_copy(dtin%dmatpawu, dtout%dmatpawu)
2253  call alloc_copy(dtin%efmas_dirs, dtout%efmas_dirs)
2254  call alloc_copy(dtin%f4of2_sla, dtout%f4of2_sla)
2255  call alloc_copy(dtin%f6of2_sla, dtout%f6of2_sla)
2256  call alloc_copy(dtin%gw_qlwl, dtout%gw_qlwl)
2257  call alloc_copy(dtin%gw_freqsp, dtout%gw_freqsp)
2258  call alloc_copy(dtin%gwls_list_proj_freq, dtout%gwls_list_proj_freq)
2259  call alloc_copy(dtin%jpawu, dtout%jpawu)
2260  call alloc_copy(dtin%kpt, dtout%kpt)
2261  call alloc_copy(dtin%kptgw, dtout%kptgw)
2262  call alloc_copy(dtin%kptns, dtout%kptns)
2263  call alloc_copy(dtin%kptns_hf, dtout%kptns_hf)
2264  call alloc_copy(dtin%lambsig, dtout%lambsig)
2265  call alloc_copy(dtin%mixalch_orig, dtout%mixalch_orig)
2266  call alloc_copy(dtin%mixesimgf, dtout%mixesimgf)
2267  call alloc_copy(dtin%nucdipmom, dtout%nucdipmom)
2268  call alloc_copy(dtin%occ_orig, dtout%occ_orig)
2269  call alloc_copy(dtin%pimass, dtout%pimass)
2270  call alloc_copy(dtin%ptcharge, dtout%ptcharge)
2271  call alloc_copy(dtin%qmass, dtout%qmass)
2272  call alloc_copy(dtin%qptdm, dtout%qptdm)
2273  call alloc_copy(dtin%quadmom, dtout%quadmom)
2274  call alloc_copy(dtin%ratsph, dtout%ratsph)
2275  call alloc_copy(dtin%rprim_orig, dtout%rprim_orig)
2276  call alloc_copy(dtin%rprimd_orig, dtout%rprimd_orig)
2277  call alloc_copy(dtin%shiftk, dtout%shiftk)
2278  call alloc_copy(dtin%spinat, dtout%spinat)
2279  call alloc_copy(dtin%tnons, dtout%tnons)
2280  call alloc_copy(dtin%upawu, dtout%upawu)
2281  call alloc_copy(dtin%vel_orig, dtout%vel_orig)
2282  call alloc_copy(dtin%vel_cell_orig, dtout%vel_cell_orig)
2283  call alloc_copy(dtin%wtatcon, dtout%wtatcon)
2284  call alloc_copy(dtin%wtk, dtout%wtk)
2285  call alloc_copy(dtin%xred_orig, dtout%xred_orig)
2286  call alloc_copy(dtin%xredsph_extra, dtout%xredsph_extra)
2287  call alloc_copy(dtin%ziontypat, dtout%ziontypat)
2288  call alloc_copy(dtin%znucl, dtout%znucl)
2289 
2290  dtout%ndivsm = dtin%ndivsm
2291  dtout%nkpath = dtin%nkpath
2292  dtout%einterp = dtin%einterp
2293  call alloc_copy(dtin%kptbounds, dtout%kptbounds)
2294  dtout%tmesh = dtin%tmesh
2295  dtout%getkerange_filepath = dtin%getkerange_filepath
2296 
2297  DBG_EXIT("COLL")
2298 
2299 end function 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.

SOURCE

2316 subroutine dtset_free(dtset)
2317 
2318 !Arguments ------------------------------------
2319 !scalars
2320  class(dataset_type),intent(inout) :: dtset
2321 
2322 ! *************************************************************************
2323 
2324 !please, use the same order as the one used in the declaration of the type (see defs_abitypes).
2325 
2326  !@dataset_type
2327 !integer allocatable
2328  ABI_SFREE(dtset%algalch)
2329  ABI_SFREE(dtset%bdgw)
2330  ABI_SFREE(dtset%bs_loband)
2331  ABI_SFREE(dtset%constraint_kind)
2332  ABI_SFREE(dtset%dynimage)
2333  ABI_SFREE(dtset%efmas_bands)
2334  ABI_SFREE(dtset%iatfix)
2335  ABI_SFREE(dtset%iatsph)
2336  ABI_SFREE(dtset%istwfk)
2337  ABI_SFREE(dtset%kberry)
2338  ABI_SFREE(dtset%lexexch)
2339  ABI_SFREE(dtset%ldaminushalf)
2340  ABI_SFREE(dtset%lpawu)
2341  ABI_SFREE(dtset%nband)
2342  ABI_SFREE(dtset%ph_qpath)
2343  ABI_SFREE(dtset%ph_qshift)
2344  ABI_SFREE(dtset%plowan_iatom)
2345  ABI_SFREE(dtset%plowan_it)
2346  ABI_SFREE(dtset%plowan_lcalc)
2347  ABI_SFREE(dtset%plowan_nbl)
2348  ABI_SFREE(dtset%plowan_projcalc)
2349  ABI_SFREE(dtset%prtatlist)
2350  ABI_SFREE(dtset%so_psp)
2351  ABI_SFREE(dtset%symafm)
2352  ABI_SFREE(dtset%symrel)
2353  ABI_SFREE(dtset%typat)
2354 
2355 !real allocatable
2356  ABI_SFREE(dtset%acell_orig)
2357  ABI_SFREE(dtset%amu_orig)
2358  ABI_SFREE(dtset%atvshift)
2359  ABI_SFREE(dtset%cd_imfrqs)
2360  ABI_SFREE(dtset%cellcharge)
2361  ABI_SFREE(dtset%chrgat)
2362  ABI_SFREE(dtset%chempot)
2363  ABI_SFREE(dtset%corecs)
2364  ABI_SFREE(dtset%densty)
2365  ABI_SFREE(dtset%dmatpawu)
2366  ABI_SFREE(dtset%efmas_dirs)
2367  ABI_SFREE(dtset%gw_qlwl)
2368  ABI_SFREE(dtset%gw_freqsp)
2369  ABI_SFREE(dtset%gwls_list_proj_freq)
2370  ABI_SFREE(dtset%f4of2_sla)
2371  ABI_SFREE(dtset%f6of2_sla)
2372  ABI_SFREE(dtset%jpawu)
2373  ABI_SFREE(dtset%kpt)
2374  ABI_SFREE(dtset%kptbounds)
2375  ABI_SFREE(dtset%kptgw)
2376  ABI_SFREE(dtset%kptns)
2377  ABI_SFREE(dtset%kptns_hf)
2378  ABI_SFREE(dtset%lambsig)
2379  ABI_SFREE(dtset%mixalch_orig)
2380  ABI_SFREE(dtset%mixesimgf)
2381  ABI_SFREE(dtset%nucdipmom)
2382  ABI_SFREE(dtset%occ_orig)
2383  ABI_SFREE(dtset%pimass)
2384  ABI_SFREE(dtset%ptcharge)
2385  ABI_SFREE(dtset%qmass)
2386  ABI_SFREE(dtset%qptdm)
2387  ABI_SFREE(dtset%quadmom)
2388  ABI_SFREE(dtset%ratsph)
2389  ABI_SFREE(dtset%rprim_orig)
2390  ABI_SFREE(dtset%rprimd_orig)
2391  ABI_SFREE(dtset%shiftk)
2392  ABI_SFREE(dtset%spinat)
2393  ABI_SFREE(dtset%tnons)
2394  ABI_SFREE(dtset%sigma_shiftk)
2395  ABI_SFREE(dtset%upawu)
2396  ABI_SFREE(dtset%vel_orig)
2397  ABI_SFREE(dtset%vel_cell_orig)
2398  ABI_SFREE(dtset%wtatcon)
2399  ABI_SFREE(dtset%wtk)
2400  ABI_SFREE(dtset%xred_orig)
2401  ABI_SFREE(dtset%xredsph_extra)
2402  ABI_SFREE(dtset%ziontypat)
2403  ABI_SFREE(dtset%znucl)
2404 
2405 end subroutine dtset_free

m_dtset/dtset_free_nkpt_arrays [ Functions ]

[ Top ] [ m_dtset ] [ Functions ]

NAME

 dtset_free_nkpt_arrays

FUNCTION

  Free arrays that depend on input nkpt (used in EPH code, because EPH has its own
  treatment of BZ sampling and we don't want to waste memory with large and useless arrays
  especially if very dense k-meshes are used.

SOURCE

2421 subroutine dtset_free_nkpt_arrays(dtset)
2422 
2423 !Arguments ------------------------------------
2424 !scalars
2425  class(dataset_type),intent(inout) :: dtset
2426 
2427 ! *************************************************************************
2428 
2429  ABI_SFREE(dtset%istwfk)
2430  !ABI_SFREE(dtset%nband)
2431  ABI_SFREE(dtset%kpt)
2432  ABI_SFREE(dtset%kptns)
2433  ABI_SFREE(dtset%occ_orig)
2434  ABI_SFREE(dtset%wtk)
2435  ! Free HF k-points as well.
2436  ABI_SFREE(dtset%kptns_hf)
2437 
2438 end subroutine dtset_free_nkpt_arrays

m_dtset/dtset_get_crystal [ Functions ]

[ Top ] [ m_dtset ] [ Functions ]

NAME

 dtset_get_crystal

FUNCTION

  Build crystal_t object from dtset and image index.
  Note that acell_orig, rprim_orig and xred_orig are used by default

INPUTS

OUTPUT

SOURCE

2880 type(crystal_t) function dtset_get_crystal(dtset, img) result(cryst)
2881 
2882 !Arguments-------------------------------
2883 !scalars
2884  class(dataset_type),target,intent(in) :: dtset
2885  integer,intent(in) :: img
2886 
2887 !Local variables-------------------------------
2888 !scalars
2889  integer :: ii, gw_timrev
2890  logical,parameter :: remove_inv = .False.
2891 !arrays
2892  real(dp) :: my_rprimd(3,3)
2893  real(dp),pointer :: my_xred(:,:)
2894  character(len=500) :: my_title(dtset%ntypat)
2895 
2896 ! *********************************************************************
2897 
2898  call mkrdim(dtset%acell_orig(:, img), dtset%rprim_orig(:, :, img), my_rprimd)
2899  my_xred => dtset%xred_orig(:, :, img)
2900 
2901  do ii=1,dtset%ntypat
2902     my_title(ii) = "No info on pseudo available"
2903  end do
2904 
2905  gw_timrev = 1; if (any(dtset%kptopt == [3, 4])) gw_timrev = 0
2906  gw_timrev = gw_timrev + 1
2907 
2908  call crystal_init(dtset%amu_orig(:, img), cryst, dtset%spgroup, dtset%natom, dtset%npsp, &
2909    dtset%ntypat, dtset%nsym, my_rprimd, dtset%typat, my_xred, dtset%ziontypat, dtset%znucl, gw_timrev, &
2910    dtset%nspden==2 .and. dtset%nsppol==1, remove_inv, my_title,&
2911    symrel=dtset%symrel, tnons=dtset%tnons, symafm=dtset%symafm)
2912 
2913 end function dtset_get_crystal

m_dtset/dtset_get_ktmesh [ Functions ]

[ Top ] [ m_dtset ] [ Functions ]

NAME

 dtset_get_ktmesh

FUNCTION

  Build (linear) mesh of K * temperatures from tsmesh(1:3) = [start, step, num]
  Return number of temperatures (ntemp) and ktmesh array.

SOURCE

2926 subroutine dtset_get_ktmesh(dtset, ntemp, ktmesh)
2927 
2928 !Arguments-------------------------------
2929 !scalars
2930  class(dataset_type),intent(in) :: dtset
2931  integer,intent(out) :: ntemp
2932  real(dp),allocatable,intent(out) :: ktmesh(:)
2933 
2934 ! *********************************************************************
2935 
2936  ntemp = nint(dtset%tmesh(3))
2937  ABI_CHECK(ntemp > 0, "ntemp <= 0")
2938  ABI_MALLOC(kTmesh, (ntemp))
2939  kTmesh = arth(dtset%tmesh(1), dtset%tmesh(2), ntemp) * kb_HaK
2940 
2941 end subroutine dtset_get_ktmesh

m_dtset/dtset_get_npert_rbz [ Functions ]

[ Top ] [ m_dtset ] [ Functions ]

NAME

 dtset_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

SOURCE

2542 subroutine dtset_get_npert_rbz(dtset, nband_rbz, nkpt_rbz, npert)
2543 
2544 !Arguments ------------------------------------
2545 !scalars
2546  integer,intent(out) :: npert
2547 !arrays
2548  integer,pointer :: nkpt_rbz(:)
2549  real(dp),pointer :: nband_rbz(:,:)
2550  class(dataset_type),intent(in) :: dtset
2551 
2552 !Local variables-------------------------------
2553 !scalars
2554  integer :: icase,idir,ikpt,ikpt1,ipert,isppol,isym,maxidir,mpert,nband_k,nsym1,timrev,timrev_pert
2555  integer :: to_compute_this_pert
2556  real(dp) :: tolsym8,ucvol
2557  character(len=500) :: msg
2558 !arrays
2559  integer :: rfdir(9),rf2dir(9),rf2_dir1(3),rf2_dir2(3)
2560  integer,allocatable :: indkpt1(:,:),indsym(:,:,:),pertsy(:,:),rfpert(:),symq(:,:,:),symrec(:,:,:)
2561  integer, allocatable :: pert_tmp(:,:), pert_calc(:,:)
2562  integer,allocatable :: symaf1(:),symrc1(:,:,:),symrl1(:,:,:),symrl1_tmp(:,:,:), bz2ibz_smap(:,:)
2563  real(dp) :: gmet(3,3),gprimd(3,3),rmet(3,3),rprimd(3,3)
2564  real(dp),allocatable :: tnons1_tmp(:,:),wtk_folded(:)
2565 
2566 ! *************************************************************************
2567 
2568 !Define the set of admitted perturbations
2569  mpert=dtset%natom+6
2570  if(dtset%natom+10/=0.or.dtset%natom+11/=0) mpert=dtset%natom+11
2571 
2572  ABI_MALLOC(symrec,(3,3,dtset%nsym))
2573 !Get the symmetry matrices in terms of reciprocal basis
2574  do isym=1,dtset%nsym
2575    call mati3inv(dtset%symrel(:,:,isym),symrec(:,:,isym))
2576  end do
2577 
2578  ABI_MALLOC(indsym,(4,dtset%nsym,dtset%natom))
2579 !Obtain a list of rotated atom labels:
2580  tolsym8=tol8
2581  call symatm(indsym,dtset%natom,dtset%nsym,symrec,dtset%tnons,tolsym8,dtset%typat,dtset%xred_orig, print_indsym=50)
2582 
2583  ABI_MALLOC(symq,(4,2,dtset%nsym))
2584  timrev=1
2585  call littlegroup_q(dtset%nsym,dtset%qptn,symq,symrec,dtset%symafm,timrev)
2586 
2587 !Initialize the list of perturbations rfpert
2588  ABI_MALLOC(rfpert,(mpert))
2589  rfpert(:)=0
2590  if(dtset%rfphon==1)rfpert(dtset%rfatpol(1):dtset%rfatpol(2))=1
2591 
2592  if(dtset%rfddk==1)rfpert(dtset%natom+1)=1
2593  if(dtset%rfddk==2)rfpert(dtset%natom+6)=1
2594 
2595  if(dtset%rf2_dkdk/=0) rfpert(dtset%natom+10)=1
2596  if(dtset%rf2_dkde/=0) rfpert(dtset%natom+11)=1
2597 
2598  if(dtset%rfelfd==1.or.dtset%rfelfd==2)rfpert(dtset%natom+1)=1
2599  if(dtset%rfelfd==1.or.dtset%rfelfd==3)rfpert(dtset%natom+2)=1
2600 
2601  if(dtset%rfstrs==1.or.dtset%rfstrs==3)rfpert(dtset%natom+3)=1
2602  if(dtset%rfstrs==2.or.dtset%rfstrs==3)rfpert(dtset%natom+4)=1
2603 
2604  if(dtset%rfuser==1.or.dtset%rfuser==3)rfpert(dtset%natom+6)=1
2605  if(dtset%rfuser==2.or.dtset%rfuser==3)rfpert(dtset%natom+7)=1
2606 
2607  if(dtset%rfmagn==1) rfpert(dtset%natom+5)=1
2608 
2609  ABI_MALLOC(pertsy,(3,mpert))
2610  call irreducible_set_pert(indsym,mpert,dtset%natom,dtset%nsym,pertsy,dtset%rfdir,rfpert,symq,symrec,dtset%symrel)
2611 
2612  npert=0
2613 ! ABI_MALLOC(pert_tmp,(3*mpert))
2614 
2615 ! do ipert=1,mpert
2616 !   do idir=1,3
2617 !     if( rfpert(ipert)==1 .and. dtset%rfdir(idir) == 1 )then
2618 !       if (pertsy(idir,ipert)==1.or.&
2619 !&       (dtset%prepanl == 1.and.ipert == dtset%natom+2).or.&
2620 !&       (dtset%prepgkk == 1.and.ipert <= dtset%natom)  ) then
2621 !         npert = npert+1;
2622 !         pert_tmp(npert) = idir+(ipert-1)*3;
2623 !       else
2624 !         write(msg, '(a,a,i0,a,i0,a,a,a,a,a,a)' )ch10,&
2625 !&         'The perturbation idir=',idir,'  ipert=',ipert,' is',ch10,&
2626 !&         'symmetric of a previously calculated perturbation.',ch10,&
2627 !&         'So, its SCF calculation is not needed.',ch10
2628 !         call wrtout(std_out,msg,'COLL')
2629 !       end if ! Test of existence of symmetry of perturbation
2630 !     end if ! Test of existence of perturbation
2631 !   end do
2632 ! end do
2633 
2634 !Initialize rf2dir :
2635  rf2_dir1(1:3)=dtset%rf2_pert1_dir(1:3)
2636  rf2_dir2(1:3)=dtset%rf2_pert2_dir(1:3)
2637 !Diagonal terms :
2638  rf2dir(1) = rf2_dir1(1)*rf2_dir2(1)
2639  rf2dir(2) = rf2_dir1(2)*rf2_dir2(2)
2640  rf2dir(3) = rf2_dir1(3)*rf2_dir2(3)
2641 !Upper triangular terms :
2642  rf2dir(4) = rf2_dir1(2)*rf2_dir2(3)
2643  rf2dir(5) = rf2_dir1(1)*rf2_dir2(3)
2644  rf2dir(6) = rf2_dir1(1)*rf2_dir2(2)
2645 !Lower triangular terms :
2646  rf2dir(7) = rf2_dir1(3)*rf2_dir2(2)
2647  rf2dir(8) = rf2_dir1(3)*rf2_dir2(1)
2648  rf2dir(9) = rf2_dir1(2)*rf2_dir2(1)
2649 
2650 !Determine existence of perturbations and of perturbation symmetries
2651 !Create array with perturbations which have to be calculated
2652  ABI_MALLOC(pert_tmp,(2,3*(dtset%natom+6)+18))
2653 
2654  do ipert=1,mpert
2655    if (ipert<dtset%natom+10) then
2656      maxidir = 3
2657      rfdir(1:3) = dtset%rfdir(:)
2658      rfdir(4:9) = 0
2659    else
2660      maxidir = 9
2661      rfdir(1:9) = rf2dir(:)
2662    end if
2663    do idir=1,maxidir
2664      if( rfpert(ipert)==1 .and. rfdir(idir) == 1 )then
2665        to_compute_this_pert = 0
2666        if (ipert>=dtset%natom+10) then
2667          to_compute_this_pert = 1
2668        else if ((pertsy(idir,ipert)==1).or.&
2669           ((dtset%prepanl == 1).and.(ipert == dtset%natom+2)).or.&
2670           ((dtset%prepgkk == 1).and.(ipert <= dtset%natom))  ) then
2671          to_compute_this_pert = 1
2672        end if
2673        if (to_compute_this_pert /= 0) then
2674          npert = npert+1;
2675          pert_tmp(1,npert) = ipert
2676          pert_tmp(2,npert) = idir
2677        else
2678          write(msg, '(a,a,i4,a,i4,a,a,a,a,a,a)' )ch10,&
2679            ' The perturbation idir=',idir,'  ipert=',ipert,' is',ch10,&
2680            ' symmetric of a previously calculated perturbation.',ch10,&
2681            ' So, its SCF calculation is not needed.',ch10
2682          call wrtout(std_out,msg)
2683        end if ! Test of existence of symmetry of perturbation
2684      end if ! Test of existence of perturbation
2685    end do
2686  end do
2687  ABI_MALLOC(pert_calc,(2,npert))
2688  do icase=1,npert
2689    pert_calc(:,icase)=pert_tmp(:,icase)
2690  end do
2691  ABI_FREE(pert_tmp)
2692  ABI_FREE(pertsy)
2693  ABI_FREE(rfpert)
2694 
2695 ! ABI_MALLOC(pert_calc,(npert))
2696 ! do icase=1,npert
2697 !   pert_calc(icase) = pert_tmp(icase)
2698 ! end do
2699 
2700  call mkrdim(dtset%acell_orig(1:3,1),dtset%rprim_orig(1:3,1:3,1),rprimd)
2701  call metric(gmet,gprimd,std_out,rmet,rprimd,ucvol)
2702 
2703  ABI_MALLOC(nkpt_rbz,(npert))
2704  ABI_MALLOC(indkpt1,(dtset%nkpt,npert))
2705  indkpt1=0
2706 
2707  do icase=1,npert
2708 !   if (pert_calc(icase) <= dtset%natom*3) then
2709 !     idir = mod(pert_calc(icase),3)
2710 !     if (idir==0) idir=3
2711 !     ipert=( (pert_calc(icase)-idir) / 3 + 1)
2712 !   else
2713 !     ipert = dtset%natom + ((pert_calc(icase) - 3*dtset%natom - 1) / 3) + 1
2714 !     idir = mod(pert_calc(icase),3)
2715 !     if (idir==0) idir=3
2716 !   end if
2717    ipert = pert_calc(1,icase)
2718    idir = pert_calc(2,icase)
2719 
2720    ABI_MALLOC(symrl1_tmp,(3,3,dtset%nsym))
2721    ABI_MALLOC(symaf1,(dtset%nsym))
2722    ABI_MALLOC(tnons1_tmp,(3,dtset%nsym))
2723 !  MJV TODO: check whether prepgkk should be used here
2724    if (dtset%prepanl /= 1 .and. dtset%berryopt /=4 .and. dtset%berryopt /=6 .and. dtset%berryopt /=7 .and. &
2725 &   dtset%berryopt /=14 .and. dtset%berryopt /=16 .and. dtset%berryopt /=17) then   !!HONG
2726      call littlegroup_pert(gprimd,idir,indsym,std_out,ipert,dtset%natom,dtset%nsym,nsym1,2,&
2727 &     dtset%symafm,symaf1,symq,symrec,&
2728 &     dtset%symrel,symrl1_tmp,0,dtset%tnons,tnons1_tmp)
2729    else
2730      nsym1 = 1
2731    end if
2732    ABI_FREE(tnons1_tmp)
2733    ABI_FREE(symaf1)
2734 
2735    ABI_MALLOC(symrc1,(3,3,nsym1))
2736    ABI_MALLOC(symrl1,(3,3,nsym1))
2737    symrl1(:,:,1:nsym1)=symrl1_tmp(:,:,1:nsym1)
2738    ABI_FREE(symrl1_tmp)
2739    do isym=1,nsym1
2740      call mati3inv(symrl1(:,:,isym),symrc1(:,:,isym))
2741    end do
2742    ABI_FREE(symrl1)
2743 
2744    ABI_MALLOC(wtk_folded,(dtset%nkpt))
2745    ABI_MALLOC(bz2ibz_smap, (6, dtset%nkpt))
2746    timrev_pert=timrev
2747    if(dtset%ieig2rf>0) then
2748      call symkpt(0,gmet,indkpt1(:,icase),std_out,dtset%kptns,dtset%nkpt,nkpt_rbz(icase),&
2749 &     1,symrc1,0,dtset%wtk,wtk_folded, bz2ibz_smap, xmpi_comm_self)
2750    else
2751 !    For the time being, the time reversal symmetry is not used
2752 !    for ddk, elfd, mgfd perturbations.
2753      if(ipert==dtset%natom+1 .or. ipert==dtset%natom+10 .or. ipert==dtset%natom+11 .or. &
2754         ipert==dtset%natom+2 .or. dtset%berryopt==4 .or. dtset%berryopt==6 .or. dtset%berryopt==7  &
2755         .or. dtset%berryopt==14 .or. dtset%berryopt==16 .or. dtset%berryopt==17 )timrev_pert=0  !!HONG
2756      call symkpt(0,gmet,indkpt1(:,icase),std_out,dtset%kptns,dtset%nkpt,nkpt_rbz(icase),&
2757      nsym1,symrc1,timrev_pert,dtset%wtk,wtk_folded, bz2ibz_smap, xmpi_comm_self)
2758    end if
2759    ABI_FREE(bz2ibz_smap)
2760    ABI_FREE(wtk_folded)
2761    ABI_FREE(symrc1)
2762  end do
2763 
2764  ABI_MALLOC(nband_rbz,(maxval(nkpt_rbz)*dtset%nsppol,npert))
2765  nband_rbz=zero
2766  do icase=1,npert
2767    do isppol=1,dtset%nsppol
2768      ikpt1=1
2769      do ikpt=1,dtset%nkpt
2770        nband_k=dtset%nband(ikpt+(isppol-1)*dtset%nkpt)
2771 !      Must test against ikpt1/=nkpt_rbz+1, before evaluate indkpt1(ikpt1)
2772        if(ikpt1/=nkpt_rbz(icase)+1)then
2773          if(ikpt==indkpt1(ikpt1,icase))then
2774            nband_rbz(ikpt1+(isppol-1)*nkpt_rbz(icase),icase)=nband_k
2775          end if
2776        end if
2777      end do
2778    end do
2779 
2780  end do
2781 
2782 
2783 ! Write YAML doc with the list of irreducible perturbations. Example.
2784 !
2785 !--- !IrredPerts
2786 !# List of irreducible perturbations
2787 !irred_perts:
2788 !  - qpt: [ 0.0000000000000000,  0.0000000000000000,  0.0000000000000000]
2789 !    ipert: 1
2790 !    idir: 1
2791 !  - qpt: [ 0.0000000000000000,  0.0000000000000000,  0.0000000000000000]
2792 !    ipert: 2
2793 !    idir: 1
2794 !..
2795  write(std_out,'(a)')"--- !IrredPerts"
2796  write(std_out,'(a)')'# List of irreducible perturbations'
2797  write(std_out,'(a)')'irred_perts:'
2798 
2799  do icase=1,npert
2800    ipert = pert_calc(1,icase)
2801    idir = pert_calc(2,icase)
2802 
2803    write(std_out,'(a,3(f20.16,a))')"   - qpt: [ ",dtset%qptn(1),", ", dtset%qptn(2),", ", dtset%qptn(3),"]"
2804    write(std_out,'(a,i0)')"     ipert: ",ipert
2805    write(std_out,'(a,i0)')"     idir: ",idir
2806    write(std_out,'(a,i0)')"     nkpt_rbz: ",nkpt_rbz(icase)
2807  end do
2808 
2809  write(std_out,'(a)')"..."
2810 
2811  ABI_FREE(indkpt1)
2812  ABI_FREE(symq)
2813  ABI_FREE(symrec)
2814  ABI_FREE(indsym)
2815  ABI_FREE(pert_calc)
2816 
2817 end subroutine dtset_get_npert_rbz

m_dtset/dtset_initocc_chkneu [ Functions ]

[ Top ] [ m_dtset ] [ Functions ]

NAME

 dtset_initocc_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

  dtset <type(dataset_type)>=all input variables in this dataset
   | cellcharge(nimage)=number of electrons missing (+) or added (-) to system (usually 0)
   |  might depend on the image, but only with occopt=2
   | 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
  nelectjell=number of electrons brought by the jellium
  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 "cellcharge" for the first image)

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

SOURCE

1093 subroutine dtset_initocc_chkneu(dtset, nelectjell, occopt)
1094 
1095 !Arguments ------------------------------------
1096 !scalars
1097  class(dataset_type),intent(inout) :: dtset
1098  integer,intent(in) :: occopt
1099  real(dp),intent(in) :: nelectjell
1100 
1101 !Local variables-------------------------------
1102 !scalars
1103  integer :: bantot,iatom,iband,ii,iimage,ikpt,isppol,nocc
1104  real(dp) :: maxocc,nelect_img,nelect_occ,nelect_spin,occlast,sign_spin,zval
1105  character(len=500) :: msg
1106 !arrays
1107  real(dp),allocatable :: tmpocc(:)
1108 
1109 ! *************************************************************************
1110 
1111 !(1) count nominal valence electrons according to ziontypat
1112  zval=zero
1113  do iatom=1,dtset%natom
1114    zval=zval+dtset%ziontypat(dtset%typat(iatom))
1115  end do
1116  if (dtset%positron/=1) then
1117    dtset%nelect=zval-(dtset%cellcharge(1)-nelectjell)
1118  else
1119    dtset%nelect=one
1120  end if
1121 
1122 ! write(std_out,*)ch10,' initocc_chkneu : enter, dtset%nelect=',dtset%nelect
1123 ! write(std_out,*)' occopt,dtset%nsppol,dtset%nspden=',occopt,dtset%nsppol,dtset%nspden
1124 
1125 !(2) Optionally initialize occ with semiconductor occupancies
1126 !(even for a metal : at this stage, the eigenenergies are unknown)
1127 !Note that nband(1)=nband(2) in this section, as occopt=2 is avoided.
1128  if(occopt==1 .or. (occopt>=3 .and. occopt<=9) )then
1129 
1130 !  Here, initialize a real(dp) variable giving the
1131 !  maximum occupation number per band
1132    maxocc=2.0_dp/real(dtset%nsppol*dtset%nspinor,dp)
1133 
1134 !  Determine the number of bands fully or partially occupied
1135    nocc=int((dtset%nelect-dtset%nh_qFD-1.0d-8)/maxocc) + 1
1136 
1137 !  Occupation number of the highest level
1138    occlast=dtset%nelect-dtset%nh_qFD-maxocc*(nocc-1)
1139 
1140 !  The number of allowed bands must be sufficiently large
1141    if( nocc<=dtset%nband(1)*dtset%nsppol .or. dtset%iscf==-2) then
1142 
1143      if(dtset%iscf==-2 .and. nocc>dtset%nband(1)*dtset%nsppol)nocc=dtset%nband(1)*dtset%nsppol
1144 
1145 !    First treat the case where the spin magnetization is not imposed, is zero with nspden==1, or has sufficient flexibility
1146 !    for a target not to be matched at the initialisation, but later
1147      if(abs(dtset%spinmagntarget+99.99_dp)<tol8 .or. (dtset%nspden==4) .or. &
1148        (abs(dtset%spinmagntarget)<tol8.and.dtset%nspden==1))then
1149 
1150 !      Use a temporary array for defining occupation numbers
1151        ABI_MALLOC(tmpocc,(dtset%nband(1)*dtset%nsppol))
1152 !      First do it for fully occupied bands
1153        if (1<nocc) tmpocc(1:nocc-1)=maxocc
1154 !      Then, do it for highest occupied band
1155        if (1<=nocc) tmpocc(nocc)=occlast
1156 
1157        if (occopt==9) then
1158          if (nocc > dtset%ivalence*dtset%nsppol) then
1159            write(msg,'(a,i5,a,f17.8,a)') 'In occopt = 9 case, ivalence = ', dtset%ivalence, &
1160 &           ' is too small compared to the number of electrons in the valence bands, nelect-nh_qFD = ', &
1161 &          dtset%nelect-dtset%nh_qFD, '. Increase ivalence. '
1162            ABI_ERROR(msg)
1163          end if
1164 
1165          if (dtset%ivalence*dtset%nsppol > nocc) tmpocc(nocc+1:dtset%ivalence*dtset%nsppol)=zero
1166          nocc   = (dtset%ne_qFD-1.0d-8)/maxocc + 1
1167          occlast= dtset%ne_qFD-maxocc*(nocc-1)
1168          if ( (nocc+dtset%ivalence*dtset%nsppol) > dtset%nband(1)*dtset%nsppol) then
1169            write(msg,'(a)') 'Occopt = 9: Not enough band above ivalence. Increase nband or reduce ivalence'
1170            ABI_ERROR(msg)
1171          end if
1172 
1173          if(nocc > 1)  tmpocc(dtset%ivalence*dtset%nsppol+1:dtset%ivalence*dtset%nsppol+nocc-1)=maxocc
1174          if(nocc >= 1) tmpocc(dtset%ivalence*dtset%nsppol+nocc)=occlast
1175          if ((dtset%ivalence*dtset%nsppol + nocc) < dtset%nband(1)*dtset%nsppol) &
1176 &          tmpocc(dtset%ivalence*dtset%nsppol+nocc+1:dtset%nband(1)*dtset%nsppol)=zero
1177        else
1178 !        Finally do it for eventual unoccupied bands
1179          if (nocc<dtset%nband(1)*dtset%nsppol ) tmpocc(nocc+1:dtset%nband(1)*dtset%nsppol)=zero
1180        end if
1181 
1182 !      Now copy the tmpocc array in the occ array, taking into account the spin
1183        if(dtset%nsppol==1)then
1184          do ikpt=1,dtset%nkpt
1185            do iband=1,dtset%nband(1)
1186              dtset%occ_orig(iband+(ikpt-1)*dtset%nband(1),:)=tmpocc(iband)
1187            enddo
1188          end do
1189        else
1190          do ikpt=1,dtset%nkpt
1191            do iband=1,dtset%nband(1)
1192              do isppol=1,dtset%nsppol
1193                dtset%occ_orig(iband+dtset%nband(1)*(ikpt-1+dtset%nkpt*(isppol-1)),:) =  &
1194 &                tmpocc(isppol+dtset%nsppol*(iband-1))
1195              end do
1196            end do
1197          end do
1198        end if
1199        ABI_FREE(tmpocc)
1200 
1201    ! Second, treat the case in which one imposes the spin magnetization (only possible for nspden==2)
1202    ! Also treat antiferromagnetic case (nsppol==1, nspden==2), although spinmagntarget must be zero
1203      else if(abs(dtset%spinmagntarget+99.99_dp)>1.0d-10)then
1204        do isppol=1,dtset%nsppol
1205          sign_spin=real(3-2*isppol,dp)
1206          nelect_spin=half*(dtset%nelect*maxocc+sign_spin*dtset%spinmagntarget)
1207 
1208          !Determines the last state, and its occupation
1209          if(abs(nint(nelect_spin)-nelect_spin)<tol10)then
1210            nocc=nint(nelect_spin/maxocc)
1211            occlast=maxocc
1212          else
1213            nocc=ceiling(nelect_spin/maxocc)
1214            occlast=nelect_spin-(real(nocc,dp)-one)*maxocc
1215          end if
1216          if(dtset%nband(1)*nint(maxocc)<nocc)then
1217            write(msg, '(a,i0,a, a,2i0,a, a,es16.6,a, a,es16.6,6a)' )&
1218            'Initialization of occ, with nspden = ',dtset%nspden,ch10,&
1219            'number of bands = ',dtset%nband(1:2),ch10,&
1220            'number of electrons = ',dtset%nelect,ch10,&
1221            'and spinmagntarget = ',dtset%spinmagntarget,ch10,&
1222            'This combination is not possible, because of a lack of bands.',ch10,&
1223            'Action: modify input file',ch10,&
1224            '(you should likely increase nband, but also check nspden, nspinor, nsppol, and spinmagntarget)'
1225            ABI_ERROR(msg)
1226          end if
1227          do ikpt=1,dtset%nkpt
1228            ! Fill all bands, except the upper one
1229            if(dtset%nband(1)>1)then
1230              do iband=1,nocc-1
1231                dtset%occ_orig(iband+dtset%nband(1)*(ikpt-1+dtset%nkpt*(isppol-1)),:)=maxocc
1232              end do
1233            end if
1234            ! Fill the upper occupied band
1235            dtset%occ_orig(nocc+dtset%nband(1)*(ikpt-1+dtset%nkpt*(isppol-1)),:)=occlast
1236          end do
1237        end do
1238 
1239      else
1240        write(msg, '(a,i0,a,a,es16.6,6a)' )&
1241        'Initialization of occ, with nspden = ',dtset%nspden,ch10,&
1242        'and spinmagntarget = ',dtset%spinmagntarget,ch10,&
1243        'This combination is not possible.',ch10,&
1244        'Action: modify input file ... ',ch10,&
1245        '(check nspden, nspinor, nsppol and spinmagntarget)'
1246        ABI_ERROR(msg)
1247      end if
1248 
1249    ! Now print the values (only the first image, since they are all the same)
1250      if(dtset%nsppol==1)then
1251        if (dtset%prtvol > 0) then
1252          write(msg, '(a,i0,a,a)' ) &
1253           ' initocc_chkneu: initialized the occupation numbers for occopt= ',occopt,', spin-unpolarized or antiferromagnetic case:'
1254          call wrtout(std_out,msg)
1255          do ii=0,(dtset%nband(1)-1)/12
1256            write(msg,'(12f6.2)') dtset%occ_orig( 1+ii*12 : min(12+ii*12,dtset%nband(1)),1 )
1257            call wrtout(std_out,msg)
1258          end do
1259        end if
1260      else
1261        write(msg, '(a,i0,2a)' ) &
1262        ' initocc_chkneu: initialized the occupation numbers for occopt= ',occopt,ch10,'    spin up   values:'
1263        call wrtout(std_out,msg)
1264        if (dtset%prtvol > 0) then
1265          do ii=0,(dtset%nband(1)-1)/12
1266            write(msg,'(12f6.2)') dtset%occ_orig( 1+ii*12 : min(12+ii*12,dtset%nband(1)),1 )
1267            call wrtout(std_out,msg)
1268          end do
1269          call wrtout(std_out,'    spin down values:')
1270          do ii=0,(dtset%nband(1)-1)/12
1271            write(msg,'(12f6.2)') &
1272             dtset%occ_orig( 1+ii*12+dtset%nkpt*dtset%nband(1) : min(12+ii*12,dtset%nband(1))+dtset%nkpt*dtset%nband(1) ,1)
1273            call wrtout(std_out,msg)
1274          end do
1275        end if
1276 
1277      end if
1278 
1279    else
1280    ! Here, treat the case when the number of allowed bands is not large enough
1281      write(msg, '(a,i0,2a, es12.4, 6a)' )&
1282      'Initialization of occ variables with occopt: ',occopt,ch10,&
1283      'There are not enough bands to get charge balance right with nelect:', dtset%nelect, ch10, &
1284      'Action: modify input file ',ch10,&
1285      '(check the pseudopotential charges, the variable cellcharge, the variable jellslab,',ch10,&
1286      'and the declared number of bands, nband)'
1287      ABI_ERROR(msg)
1288    end if
1289  end if
1290 
1291 !The remaining of the routine is for SCF runs and special options
1292  if(dtset%iscf>0 .or. dtset%iscf==-1 .or. dtset%iscf==-3)then
1293 
1294    do iimage=1,dtset%nimage
1295 
1296 !    (3) count electrons in bands (note : in case occ has just been
1297 !    initialized, point (3) and (4) is a trivial test
1298      nelect_occ=0.0_dp
1299      bantot=0
1300      do isppol=1,dtset%nsppol
1301        do ikpt=1,dtset%nkpt
1302          do iband=1,dtset%nband(ikpt+(isppol-1)*dtset%nkpt)
1303            bantot=bantot+1
1304            nelect_occ=nelect_occ+dtset%wtk(ikpt)*dtset%occ_orig(bantot,iimage)
1305          end do
1306        end do
1307      end do
1308 
1309 !    (4) if dtset%iscf/=-3, dtset%nelect must equal nelect_occ
1310 !    if discrepancy exceeds tol11, give warning;  tol8, stop with error
1311      if (dtset%positron/=1) then
1312        nelect_img=zval-(dtset%cellcharge(iimage)-nelectjell)
1313      else
1314        nelect_img=one
1315      end if
1316      if (abs(nelect_occ-nelect_img)>tol11 .and. dtset%iscf/=-3) then
1317 
1318 !      There is a discrepancy
1319        write(msg, &
1320        '(a,a,i4,a,e22.14,a,e16.8,a,a,a,e22.14,a,a,a,i5,a,a,a,a)' ) ch10,&
1321        ' initocc_chkneu: image=',iimage,', nelect_occ=',nelect_occ,', zval=',zval,',',ch10,&
1322        '         and input value of cellcharge=',dtset%cellcharge(iimage),',',ch10,&
1323        '   nelec_occ is computed from occ and wtk, iimage=',iimage,ch10,&
1324        '   zval is nominal charge of all nuclei, computed from zion (read in psp),',ch10,&
1325        '   cellcharge is an input variable (usually 0).'
1326        call wrtout(std_out,msg)
1327 
1328        if (abs(nelect_occ-dtset%nelect)>tol8) then
1329 !        The discrepancy is severe
1330          write(msg,'(a,a,e9.2,a,a)')ch10,&
1331          'These must obey zval-nelect_occ=cellcharge-nelectjell to better than ',tol8,ch10,&
1332          ' This is not the case. '
1333        else
1334 !        The discrepancy is not so severe
1335          write(msg, '(2a,e9.2)' )ch10,&
1336 &         'These should obey zval-nelect_occ=cellcharge-nelectjell to better than: ',tol11
1337        end if
1338        ABI_WARNING(msg)
1339 
1340        write(msg, '(6a)' ) &
1341        'Action: check input file for occ,wtk, and cellcharge.',ch10,&
1342        'Note that wtk is NOT automatically normalized when occopt=2,',ch10,&
1343        'but IS automatically normalized otherwise.',ch10
1344        call wrtout(std_out,msg)
1345 
1346        ! If the discrepancy is severe, stop
1347        if (abs(nelect_occ-nelect_img)>tol8)then
1348          ABI_ERROR(msg)
1349        end if
1350 
1351      end if
1352    end do
1353 
1354  end if ! condition dtset%iscf>0 or -1 or -3 .
1355 
1356 end subroutine dtset_initocc_chkneu

m_dtset/dtset_testsusmat [ Functions ]

[ Top ] [ m_dtset ] [ Functions ]

NAME

 dtset_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

SOURCE

2842 logical function dtset_testsusmat(dtset, dielop, dielstrt, istep) result(compute)
2843 
2844 !Arguments-------------------------------
2845 !scalars
2846  integer,intent(in) :: dielop,dielstrt,istep
2847  !logical,intent(out) :: compute
2848  class(dataset_type),intent(in) :: dtset
2849 
2850 ! *********************************************************************
2851 
2852  compute=.FALSE.
2853  if((dtset%iprcel >= 140).and.(dtset%iprcel<=170)) then
2854    if(modulo(dtset%iprcel,10).ne.0) then
2855      compute=(modulo(istep,modulo(dtset%iprcel,10))==0)
2856    else
2857      compute=(modulo(istep,10)==0)
2858    end if
2859  end if
2860  if (istep==1 .and. dielop>=2) compute=.TRUE.
2861  if (istep==dielstrt .and. dielop>=1) compute=.TRUE.
2862 
2863 end function dtset_testsusmat

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

SOURCE

2465 subroutine find_getdtset(dtsets,getvalue,getname,idtset,iget,miximage,mxnimage,ndtset_alloc)
2466 
2467 !Arguments ------------------------------------
2468 !scalars
2469  integer, intent(in) :: getvalue,idtset,mxnimage,ndtset_alloc
2470  integer, intent(out) :: iget
2471  real(dp), intent(out) :: miximage(mxnimage,mxnimage)
2472  character(len=*),intent(in) :: getname
2473  type(dataset_type),intent(in) :: dtsets(0:ndtset_alloc)
2474 
2475 !Local variables-------------------------------
2476  integer :: iimage
2477  real(dp) :: newimage_get,ratio
2478  character(len=500) :: msg
2479 
2480 ! *************************************************************************
2481 
2482  iget=0
2483  if(getvalue>0 .or. (getvalue<0 .and. idtset+getvalue>0) )then
2484 !  In case getvalue is a negative number (so must add to idtset)
2485    if(getvalue<0 .and. idtset+getvalue>0) iget=idtset+getvalue
2486    if(getvalue>0)then
2487      do iget=1,idtset
2488        if( dtsets(iget)%jdtset==getvalue )exit
2489      end do
2490      if(iget==idtset)then
2491 !      The index of the dataset, from which the data ought to be taken,
2492 !      does not correspond to a previous dataset.
2493        write(msg, '(a,i0,4a,i3,7a)' )&
2494         'The component number ',idtset,' of the input variable ',trim(getname),',',' equal to ',getvalue,',',ch10,&
2495         'does not correspond to an existing index.',ch10,&
2496         'Action: correct ',trim(getname),' or jdtset in your input file.'
2497        ABI_ERROR(msg)
2498      end if
2499    end if
2500    write(msg, '(3a,i3,2a)' )&
2501 &   ' find_getdtset : ',trim(getname),'/=0, take data from output of dataset with index',dtsets(iget)%jdtset,'.',ch10
2502    call wrtout([std_out, ab_out], msg)
2503  end if
2504 
2505 !For the time being, uses a simple interpolation when the images do not match. If only one image, take the first get image.
2506  miximage(:,:)=zero
2507  if(dtsets(idtset)%nimage==1)then
2508    miximage(1,1)=one
2509  else
2510    do iimage=1,dtsets(idtset)%nimage
2511      ratio=(iimage-one)/real(dtsets(idtset)%nimage-one)
2512      newimage_get=one+ratio*(dtsets(iget)%nimage-one)
2513      if(abs(newimage_get-nint(newimage_get))<tol8)then
2514        miximage(iimage,nint(newimage_get))=one
2515      else
2516        miximage(iimage,floor(newimage_get))=one-(newimage_get-floor(newimage_get))
2517        miximage(iimage,ceiling(newimage_get))=one-miximage(iimage,floor(newimage_get))
2518      end if
2519    end do
2520  end if
2521 
2522 end subroutine find_getdtset

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)=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.

SOURCE

2972 subroutine macroin(dtsets,ecut_tmp,lenstr,ndtset_alloc,string)
2973 
2974 !Arguments ------------------------------------
2975 !scalars
2976  integer,intent(in) :: ndtset_alloc,lenstr
2977  character(len=*),intent(inout) :: string
2978 !arrays
2979  real(dp),intent(in) :: ecut_tmp(3,2,10)
2980  type(dataset_type),intent(inout) :: dtsets(0:ndtset_alloc) !vz_i ziontypat
2981 
2982 !Local variables -------------------------------
2983 !scalars
2984  integer :: idtset,iatom,jdtset,marr,tread
2985 !!arrays
2986  integer,allocatable :: intarr(:)
2987  real(dp) :: ecutmax(3),ecutdgmax(3)
2988  real(dp),allocatable :: dprarr(:)
2989  character(len=500) :: msg
2990 !******************************************************************
2991 
2992  do idtset=1,ndtset_alloc
2993    jdtset=dtsets(idtset)%jdtset
2994    if (dtsets(idtset)%macro_uj>0) then
2995      dtsets(idtset)%irdwfk   = 1        ! preconverged wave function compulsory
2996 !    dtsets(idtset)%nline    = maxval((/ int(dtsets(idtset)%natom/2) , 6 /))   ! using default value: \DeltaU< 1%
2997 !    dtsets(idtset)%nnsclo   = 4        ! using default value: \DeltaU< 1%
2998      dtsets(idtset)%tolvrs   = 10d-8    ! convergence on the potential; 10d-8^= 10d-5 on occupation
2999      dtsets(idtset)%diemix   = 0.45_dp  ! fastest convergence: dn= E^(-istep * 0.229 )
3000      dtsets(idtset)%dmatpuopt= 3        ! normalization of the occupation operator
3001 !    dtsets(idtset)%nstep    = 255      ! expected convergence after 10 \pm 3, 30 as in default normally suficient
3002 !    dtsets(idtset)%iscf     = 17       ! mixing on potential, 17: default for PAW
3003    end if ! macro_uj
3004 
3005   !Read parameters
3006    marr=dtsets(idtset)%npsp;if (dtsets(idtset)%npsp<3) marr=3
3007    marr=max(marr,dtsets(idtset)%nimage)
3008    ABI_MALLOC(intarr,(marr))
3009    ABI_MALLOC(dprarr,(marr))
3010 
3011    call intagm(dprarr,intarr,jdtset,marr,1,string(1:lenstr),"accuracy",tread,'INT')
3012 
3013    ecutmax=-one
3014    ecutdgmax=-one
3015    do iatom=1,dtsets(idtset)%natom
3016      ecutmax(:)=max(ecutmax(:),ecut_tmp(:,1,dtsets(idtset)%typat(iatom)))
3017      ecutdgmax(:)=max(ecutdgmax(:),ecut_tmp(:,2,dtsets(idtset)%typat(iatom)))
3018    end do
3019 
3020    if(tread==1) then
3021      dtsets(idtset)%accuracy=intarr(1)
3022      if (dtsets(idtset)%accuracy==1) then
3023        if (ecutmax(1)>zero) dtsets(idtset)%ecut=ecutmax(1)
3024        if (ecutdgmax(1)>zero.and.dtsets(idtset)%usepaw==1) dtsets(idtset)%pawecutdg=ecutdgmax(1)
3025        dtsets(idtset)%boxcutmin=1.5_dp
3026        if (dtsets(idtset)%usepaw==1) then
3027          dtsets(idtset)%bxctmindg=1.5_dp
3028          dtsets(idtset)%pawxcdev=1
3029          dtsets(idtset)%pawmixdg=0
3030          dtsets(idtset)%pawovlp=10
3031          dtsets(idtset)%pawnhatxc=0
3032          dtsets(idtset)%mqgriddg=0
3033        end if
3034        dtsets(idtset)%mqgrid=0
3035        dtsets(idtset)%tolimg=5.0d-5
3036        dtsets(idtset)%tolvrs=tol3
3037        dtsets(idtset)%tolmxf=1.0d-3
3038        dtsets(idtset)%toldff=zero
3039        dtsets(idtset)%optforces=1
3040        dtsets(idtset)%timopt=0
3041        dtsets(idtset)%npulayit=4
3042        dtsets(idtset)%nstep=30
3043        dtsets(idtset)%prteig=0
3044        dtsets(idtset)%prtden=0
3045      else if (dtsets(idtset)%accuracy==2) then
3046        if (ecutmax(2)>zero) dtsets(idtset)%ecut=ecutmax(2)
3047        if (ecutdgmax(2)>zero.and.dtsets(idtset)%usepaw==1) dtsets(idtset)%pawecutdg=ecutdgmax(2)
3048        dtsets(idtset)%boxcutmin=1.8_dp
3049        if (dtsets(idtset)%usepaw==1) then
3050          dtsets(idtset)%bxctmindg=1.8_dp
3051          dtsets(idtset)%pawxcdev=1
3052          dtsets(idtset)%pawmixdg=0
3053          dtsets(idtset)%pawovlp=7
3054          dtsets(idtset)%pawnhatxc=1
3055          dtsets(idtset)%mqgriddg=0
3056        end if
3057        dtsets(idtset)%mqgrid=0
3058        dtsets(idtset)%tolimg=5.0d-5
3059        dtsets(idtset)%tolvrs=tol5
3060        dtsets(idtset)%tolmxf=5.0d-4
3061        dtsets(idtset)%toldff=zero
3062        dtsets(idtset)%optforces=1
3063        dtsets(idtset)%timopt=0
3064        dtsets(idtset)%npulayit=7
3065        dtsets(idtset)%nstep=30
3066        dtsets(idtset)%prteig=0
3067        dtsets(idtset)%prtden=0
3068      else if (dtsets(idtset)%accuracy==3) then
3069        if (ecutmax(2)>zero) dtsets(idtset)%ecut=ecutmax(2)
3070        if (ecutdgmax(2)>zero.and.dtsets(idtset)%usepaw==1) dtsets(idtset)%pawecutdg=ecutdgmax(2)
3071        dtsets(idtset)%boxcutmin=1.8_dp
3072        if (dtsets(idtset)%usepaw==1) then
3073          dtsets(idtset)%bxctmindg=1.8_dp
3074          dtsets(idtset)%pawxcdev=1
3075          dtsets(idtset)%pawmixdg=0
3076          dtsets(idtset)%pawovlp=7
3077          dtsets(idtset)%pawnhatxc=1
3078          dtsets(idtset)%mqgriddg=0
3079        end if
3080        dtsets(idtset)%mqgrid=0
3081        dtsets(idtset)%tolimg=5.0d-5
3082        dtsets(idtset)%tolvrs=tol7
3083        dtsets(idtset)%tolmxf=1.0d-4
3084        dtsets(idtset)%toldff=zero
3085        dtsets(idtset)%optforces=2
3086        dtsets(idtset)%timopt=1
3087        if(xmpi_paral==1) dtsets(idtset)%timopt = 0
3088        dtsets(idtset)%npulayit=7
3089        dtsets(idtset)%nstep=30
3090        dtsets(idtset)%prteig=1
3091        dtsets(idtset)%prtden=1
3092      else if (dtsets(idtset)%accuracy==4) then
3093        if (ecutmax(3)>zero) dtsets(idtset)%ecut=ecutmax(3)
3094        if (ecutdgmax(3)>zero.and.dtsets(idtset)%usepaw==1) dtsets(idtset)%pawecutdg=ecutdgmax(3)
3095        dtsets(idtset)%boxcutmin=two
3096        if (dtsets(idtset)%usepaw==1) then
3097          dtsets(idtset)%bxctmindg=two
3098          dtsets(idtset)%pawxcdev=1
3099          dtsets(idtset)%pawmixdg=0
3100          dtsets(idtset)%pawovlp=5
3101          dtsets(idtset)%pawnhatxc=1
3102          dtsets(idtset)%mqgriddg=0
3103        end if
3104        dtsets(idtset)%mqgrid=0
3105        dtsets(idtset)%tolimg=5.0d-5
3106        dtsets(idtset)%tolvrs=tol9
3107        dtsets(idtset)%tolmxf=5.0d-5
3108        dtsets(idtset)%toldff=zero
3109        dtsets(idtset)%optforces=2
3110        dtsets(idtset)%timopt=1
3111        if(xmpi_paral==1) dtsets(idtset)%timopt = 0
3112        dtsets(idtset)%npulayit=7
3113        dtsets(idtset)%nstep=30
3114        dtsets(idtset)%prteig=1
3115        dtsets(idtset)%prtden=1
3116      else if (dtsets(idtset)%accuracy==5) then
3117        if (ecutmax(2)>zero) dtsets(idtset)%ecut=ecutmax(2)
3118        if (ecutdgmax(2)>zero.and.dtsets(idtset)%usepaw==1) dtsets(idtset)%pawecutdg=ecutdgmax(2)
3119        dtsets(idtset)%boxcutmin=two
3120        if (dtsets(idtset)%usepaw==1) then
3121          dtsets(idtset)%bxctmindg=two
3122          dtsets(idtset)%pawxcdev=2
3123          dtsets(idtset)%pawmixdg=1
3124          dtsets(idtset)%pawovlp=5
3125          dtsets(idtset)%pawnhatxc=1
3126          dtsets(idtset)%mqgriddg=0
3127        end if
3128        dtsets(idtset)%mqgrid=0
3129        dtsets(idtset)%tolimg=5.0d-5
3130        dtsets(idtset)%tolvrs=tol10
3131        dtsets(idtset)%tolmxf=1.0d-6
3132        dtsets(idtset)%toldff=zero
3133        dtsets(idtset)%optforces=2
3134        dtsets(idtset)%timopt=1
3135        if(xmpi_paral==1) dtsets(idtset)%timopt = 0
3136        dtsets(idtset)%npulayit=15
3137        dtsets(idtset)%nstep=50
3138        dtsets(idtset)%prteig=1
3139        dtsets(idtset)%prtden=1
3140      else if (dtsets(idtset)%accuracy==6) then
3141        if (ecutmax(3)>zero) dtsets(idtset)%ecut=ecutmax(3)
3142        if (ecutdgmax(3)>zero.and.dtsets(idtset)%usepaw==1) dtsets(idtset)%pawecutdg=ecutdgmax(3)
3143        dtsets(idtset)%boxcutmin=two
3144        if (dtsets(idtset)%usepaw==1) then
3145          dtsets(idtset)%bxctmindg=two
3146          dtsets(idtset)%pawxcdev=2
3147          dtsets(idtset)%pawmixdg=1
3148          dtsets(idtset)%pawovlp=5
3149          dtsets(idtset)%pawnhatxc=1
3150          dtsets(idtset)%mqgriddg=0
3151        end if
3152        dtsets(idtset)%mqgrid=0
3153        dtsets(idtset)%tolimg=5.0d-5
3154        dtsets(idtset)%tolvrs=tol12
3155        dtsets(idtset)%tolmxf=1.0d-6
3156        dtsets(idtset)%toldff=zero
3157        dtsets(idtset)%optforces=2
3158        dtsets(idtset)%timopt=1
3159        if(xmpi_paral==1) dtsets(idtset)%timopt = 0
3160        dtsets(idtset)%npulayit=15
3161        dtsets(idtset)%nstep=50
3162        dtsets(idtset)%prteig=1
3163        dtsets(idtset)%prtden=1
3164      elseif(dtsets(idtset)%accuracy>6)then
3165        write(msg, '(a,a,a)' )&
3166          'accuracy >6 is forbidden !',ch10,&
3167          'Action: check your input data file.'
3168        ABI_ERROR(msg)
3169      end if
3170    else
3171      if (ecutmax(3)>zero) dtsets(idtset)%ecut=ecutmax(3)
3172    end if
3173 
3174    ABI_FREE(intarr)
3175    ABI_FREE(dprarr)
3176  end do
3177 
3178 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)=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.

SOURCE

3206 subroutine macroin2(dtsets, ndtset_alloc)
3207 
3208 !Arguments ------------------------------------
3209 !scalars
3210  integer,intent(in) :: ndtset_alloc
3211 !arrays
3212  type(dataset_type),intent(inout) :: dtsets(0:ndtset_alloc)
3213  character(len=500) :: msg
3214 !Local variables -------------------------------
3215 !scalars
3216  integer :: idtset,pawujat
3217 
3218 !******************************************************************
3219 
3220  do idtset=1,ndtset_alloc
3221    ! Set first PAW+U atom to perform atomic level shift
3222    if (dtsets(idtset)%typat(1)==0) cycle
3223 !LMac Here is where the pawujat is perturbed.
3224    pawujat=dtsets(idtset)%pawujat
3225    pawujat=pawujat-count(dtsets(idtset)%lpawu( dtsets(idtset)%typat( 1:pawujat ))<0)
3226 
3227    write(msg,*)"LMac pawujat is: ",pawujat
3228    call wrtout(std_out,msg)
3229 
3230    if (dtsets(idtset)%macro_uj>0) then
3231      ! Level shift atom with amplitude pawujv
3232      dtsets(idtset)%atvshift(:,:,pawujat)=dtsets(idtset)%pawujv
3233      ! Case level shift only on one spin channel
3234      if ((dtsets(idtset)%macro_uj==2.or.dtsets(idtset)%macro_uj==3).and.dtsets(idtset)%nsppol==2) then
3235        dtsets(idtset)%atvshift(:,2,pawujat)=0_dp
3236      end if
3237      if (dtsets(idtset)%macro_uj==4.and.dtsets(idtset)%nsppol==2) then
3238        dtsets(idtset)%atvshift(:,2,pawujat)= -dtsets(idtset)%pawujv
3239      end if
3240    end if ! macro_uj
3241 
3242    if (dtsets(idtset)%optdriver == RUNL_EPH) then
3243      if (abs(dtsets(idtset)%eph_stern) == 1) then
3244        ! Default values for the Sternheimer method in the EPH code if not provided.
3245        if (dtsets(idtset)%tolwfr == zero) dtsets(idtset)%tolwfr = tol16
3246        if (dtsets(idtset)%nline <= 4) dtsets(idtset)%nline = 100
3247      end if
3248    end if
3249 
3250  end do
3251 
3252 end subroutine macroin2