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

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

ABINIT/m_dtset [ Modules ]

[ Top ] [ Modules ]

NAME

  m_dtset

FUNCTION

COPYRIGHT

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

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

2287 subroutine dtset_free(dtset)
2288 
2289 !Arguments ------------------------------------
2290 !scalars
2291  class(dataset_type),intent(inout) :: dtset
2292 
2293 ! *************************************************************************
2294 
2295 !please, use the same order as the one used in the declaration of the type (see defs_abitypes).
2296 
2297  !@dataset_type
2298 !integer allocatable
2299  ABI_SFREE(dtset%algalch)
2300  ABI_SFREE(dtset%bdgw)
2301  ABI_SFREE(dtset%bs_loband)
2302  ABI_SFREE(dtset%constraint_kind)
2303  ABI_SFREE(dtset%dynimage)
2304  ABI_SFREE(dtset%efmas_bands)
2305  ABI_SFREE(dtset%iatfix)
2306  ABI_SFREE(dtset%iatsph)
2307  ABI_SFREE(dtset%istwfk)
2308  ABI_SFREE(dtset%kberry)
2309  ABI_SFREE(dtset%lexexch)
2310  ABI_SFREE(dtset%ldaminushalf)
2311  ABI_SFREE(dtset%lpawu)
2312  ABI_SFREE(dtset%nband)
2313  ABI_SFREE(dtset%ph_qpath)
2314  ABI_SFREE(dtset%ph_qshift)
2315  ABI_SFREE(dtset%plowan_iatom)
2316  ABI_SFREE(dtset%plowan_it)
2317  ABI_SFREE(dtset%plowan_lcalc)
2318  ABI_SFREE(dtset%plowan_nbl)
2319  ABI_SFREE(dtset%plowan_projcalc)
2320  ABI_SFREE(dtset%prtatlist)
2321  ABI_SFREE(dtset%so_psp)
2322  ABI_SFREE(dtset%symafm)
2323  ABI_SFREE(dtset%symrel)
2324  ABI_SFREE(dtset%typat)
2325 
2326 !real allocatable
2327  ABI_SFREE(dtset%acell_orig)
2328  ABI_SFREE(dtset%amu_orig)
2329  ABI_SFREE(dtset%atvshift)
2330  ABI_SFREE(dtset%cd_imfrqs)
2331  ABI_SFREE(dtset%cellcharge)
2332  ABI_SFREE(dtset%chrgat)
2333  ABI_SFREE(dtset%chempot)
2334  ABI_SFREE(dtset%corecs)
2335  ABI_SFREE(dtset%densty)
2336  ABI_SFREE(dtset%dmatpawu)
2337  ABI_SFREE(dtset%efmas_dirs)
2338  ABI_SFREE(dtset%gw_qlwl)
2339  ABI_SFREE(dtset%gw_freqsp)
2340  ABI_SFREE(dtset%gwls_list_proj_freq)
2341  ABI_SFREE(dtset%f4of2_sla)
2342  ABI_SFREE(dtset%f6of2_sla)
2343  ABI_SFREE(dtset%jpawu)
2344  ABI_SFREE(dtset%kpt)
2345  ABI_SFREE(dtset%kptbounds)
2346  ABI_SFREE(dtset%kptgw)
2347  ABI_SFREE(dtset%kptns)
2348  ABI_SFREE(dtset%kptns_hf)
2349  ABI_SFREE(dtset%lambsig)
2350  ABI_SFREE(dtset%mixalch_orig)
2351  ABI_SFREE(dtset%mixesimgf)
2352  ABI_SFREE(dtset%nucdipmom)
2353  ABI_SFREE(dtset%occ_orig)
2354  ABI_SFREE(dtset%pimass)
2355  ABI_SFREE(dtset%ptcharge)
2356  ABI_SFREE(dtset%qmass)
2357  ABI_SFREE(dtset%qptdm)
2358  ABI_SFREE(dtset%quadmom)
2359  ABI_SFREE(dtset%ratsph)
2360  ABI_SFREE(dtset%rprim_orig)
2361  ABI_SFREE(dtset%rprimd_orig)
2362  ABI_SFREE(dtset%shiftk)
2363  ABI_SFREE(dtset%spinat)
2364  ABI_SFREE(dtset%tnons)
2365  ABI_SFREE(dtset%sigma_shiftk)
2366  ABI_SFREE(dtset%upawu)
2367  ABI_SFREE(dtset%vel_orig)
2368  ABI_SFREE(dtset%vel_cell_orig)
2369  ABI_SFREE(dtset%wtatcon)
2370  ABI_SFREE(dtset%wtk)
2371  ABI_SFREE(dtset%xred_orig)
2372  ABI_SFREE(dtset%xredsph_extra)
2373  ABI_SFREE(dtset%ziontypat)
2374  ABI_SFREE(dtset%znucl)
2375 
2376 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

2392 subroutine dtset_free_nkpt_arrays(dtset)
2393 
2394 !Arguments ------------------------------------
2395 !scalars
2396  class(dataset_type),intent(inout) :: dtset
2397 
2398 ! *************************************************************************
2399 
2400  ABI_SFREE(dtset%istwfk)
2401  !ABI_SFREE(dtset%nband)
2402  ABI_SFREE(dtset%kpt)
2403  ABI_SFREE(dtset%kptns)
2404  ABI_SFREE(dtset%occ_orig)
2405  ABI_SFREE(dtset%wtk)
2406  ! Free HF k-points as well.
2407  ABI_SFREE(dtset%kptns_hf)
2408 
2409 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

2851 type(crystal_t) function dtset_get_crystal(dtset, img) result(cryst)
2852 
2853 !Arguments-------------------------------
2854 !scalars
2855  class(dataset_type),target,intent(in) :: dtset
2856  integer,intent(in) :: img
2857 
2858 !Local variables-------------------------------
2859 !scalars
2860  integer :: ii, gw_timrev
2861  logical,parameter :: remove_inv = .False.
2862 !arrays
2863  real(dp) :: my_rprimd(3,3)
2864  real(dp),pointer :: my_xred(:,:)
2865  character(len=500) :: my_title(dtset%ntypat)
2866 
2867 ! *********************************************************************
2868 
2869  call mkrdim(dtset%acell_orig(:, img), dtset%rprim_orig(:, :, img), my_rprimd)
2870  my_xred => dtset%xred_orig(:, :, img)
2871 
2872  do ii=1,dtset%ntypat
2873     my_title(ii) = "No info on pseudo available"
2874  end do
2875 
2876  gw_timrev = 1; if (any(dtset%kptopt == [3, 4])) gw_timrev = 0
2877  gw_timrev = gw_timrev + 1
2878 
2879  call crystal_init(dtset%amu_orig(:, img), cryst, dtset%spgroup, dtset%natom, dtset%npsp, &
2880    dtset%ntypat, dtset%nsym, my_rprimd, dtset%typat, my_xred, dtset%ziontypat, dtset%znucl, gw_timrev, &
2881    dtset%nspden==2 .and. dtset%nsppol==1, remove_inv, my_title,&
2882    symrel=dtset%symrel, tnons=dtset%tnons, symafm=dtset%symafm)
2883 
2884 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

2897 subroutine dtset_get_ktmesh(dtset, ntemp, ktmesh)
2898 
2899 !Arguments-------------------------------
2900 !scalars
2901  class(dataset_type),intent(in) :: dtset
2902  integer,intent(out) :: ntemp
2903  real(dp),allocatable,intent(out) :: ktmesh(:)
2904 
2905 ! *********************************************************************
2906 
2907  ntemp = nint(dtset%tmesh(3))
2908  ABI_CHECK(ntemp > 0, "ntemp <= 0")
2909  ABI_MALLOC(kTmesh, (ntemp))
2910  kTmesh = arth(dtset%tmesh(1), dtset%tmesh(2), ntemp) * kb_HaK
2911 
2912 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

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

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

2813 logical function dtset_testsusmat(dtset, dielop, dielstrt, istep) result(compute)
2814 
2815 !Arguments-------------------------------
2816 !scalars
2817  integer,intent(in) :: dielop,dielstrt,istep
2818  !logical,intent(out) :: compute
2819  class(dataset_type),intent(in) :: dtset
2820 
2821 ! *********************************************************************
2822 
2823  compute=.FALSE.
2824  if((dtset%iprcel >= 140).and.(dtset%iprcel<=170)) then
2825    if(modulo(dtset%iprcel,10).ne.0) then
2826      compute=(modulo(istep,modulo(dtset%iprcel,10))==0)
2827    else
2828      compute=(modulo(istep,10)==0)
2829    end if
2830  end if
2831  if (istep==1 .and. dielop>=2) compute=.TRUE.
2832  if (istep==dielstrt .and. dielop>=1) compute=.TRUE.
2833 
2834 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

2436 subroutine find_getdtset(dtsets,getvalue,getname,idtset,iget,miximage,mxnimage,ndtset_alloc)
2437 
2438 !Arguments ------------------------------------
2439 !scalars
2440  integer, intent(in) :: getvalue,idtset,mxnimage,ndtset_alloc
2441  integer, intent(out) :: iget
2442  real(dp), intent(out) :: miximage(mxnimage,mxnimage)
2443  character(len=*),intent(in) :: getname
2444  type(dataset_type),intent(in) :: dtsets(0:ndtset_alloc)
2445 
2446 !Local variables-------------------------------
2447  integer :: iimage
2448  real(dp) :: newimage_get,ratio
2449  character(len=500) :: msg
2450 
2451 ! *************************************************************************
2452 
2453  iget=0
2454  if(getvalue>0 .or. (getvalue<0 .and. idtset+getvalue>0) )then
2455 !  In case getvalue is a negative number (so must add to idtset)
2456    if(getvalue<0 .and. idtset+getvalue>0) iget=idtset+getvalue
2457    if(getvalue>0)then
2458      do iget=1,idtset
2459        if( dtsets(iget)%jdtset==getvalue )exit
2460      end do
2461      if(iget==idtset)then
2462 !      The index of the dataset, from which the data ought to be taken,
2463 !      does not correspond to a previous dataset.
2464        write(msg, '(a,i0,4a,i3,7a)' )&
2465         'The component number ',idtset,' of the input variable ',trim(getname),',',' equal to ',getvalue,',',ch10,&
2466         'does not correspond to an existing index.',ch10,&
2467         'Action: correct ',trim(getname),' or jdtset in your input file.'
2468        ABI_ERROR(msg)
2469      end if
2470    end if
2471    write(msg, '(3a,i3,2a)' )&
2472 &   ' find_getdtset : ',trim(getname),'/=0, take data from output of dataset with index',dtsets(iget)%jdtset,'.',ch10
2473    call wrtout([std_out, ab_out], msg)
2474  end if
2475 
2476 !For the time being, uses a simple interpolation when the images do not match. If only one image, take the first get image.
2477  miximage(:,:)=zero
2478  if(dtsets(idtset)%nimage==1)then
2479    miximage(1,1)=one
2480  else
2481    do iimage=1,dtsets(idtset)%nimage
2482      ratio=(iimage-one)/real(dtsets(idtset)%nimage-one)
2483      newimage_get=one+ratio*(dtsets(iget)%nimage-one)
2484      if(abs(newimage_get-nint(newimage_get))<tol8)then
2485        miximage(iimage,nint(newimage_get))=one
2486      else
2487        miximage(iimage,floor(newimage_get))=one-(newimage_get-floor(newimage_get))
2488        miximage(iimage,ceiling(newimage_get))=one-miximage(iimage,floor(newimage_get))
2489      end if
2490    end do
2491  end if
2492 
2493 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

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

3177 subroutine macroin2(dtsets, ndtset_alloc)
3178 
3179 !Arguments ------------------------------------
3180 !scalars
3181  integer,intent(in) :: ndtset_alloc
3182 !arrays
3183  type(dataset_type),intent(inout) :: dtsets(0:ndtset_alloc)
3184  character(len=500) :: msg
3185 !Local variables -------------------------------
3186 !scalars
3187  integer :: idtset,pawujat
3188 
3189 !******************************************************************
3190 
3191  do idtset=1,ndtset_alloc
3192    ! Set first PAW+U atom to perform atomic level shift
3193    if (dtsets(idtset)%typat(1)==0) cycle
3194 !LMac Here is where the pawujat is perturbed.
3195    pawujat=dtsets(idtset)%pawujat
3196    pawujat=pawujat-count(dtsets(idtset)%lpawu( dtsets(idtset)%typat( 1:pawujat ))<0)
3197 
3198    write(msg,*)"LMac pawujat is: ",pawujat
3199    call wrtout(std_out,msg)
3200 
3201    if (dtsets(idtset)%macro_uj>0) then
3202      ! Level shift atom with amplitude pawujv
3203      dtsets(idtset)%atvshift(:,:,pawujat)=dtsets(idtset)%pawujv
3204      ! Case level shift only on one spin channel
3205      if ((dtsets(idtset)%macro_uj==2.or.dtsets(idtset)%macro_uj==3).and.dtsets(idtset)%nsppol==2) then
3206        dtsets(idtset)%atvshift(:,2,pawujat)=0_dp
3207      end if
3208      if (dtsets(idtset)%macro_uj==4.and.dtsets(idtset)%nsppol==2) then
3209        dtsets(idtset)%atvshift(:,2,pawujat)= -dtsets(idtset)%pawujv
3210      end if
3211    end if ! macro_uj
3212 
3213    if (dtsets(idtset)%optdriver == RUNL_EPH) then
3214      if (abs(dtsets(idtset)%eph_stern) == 1) then
3215        ! Default values for the Sternheimer method in the EPH code if not provided.
3216        if (dtsets(idtset)%tolwfr == zero) dtsets(idtset)%tolwfr = tol16
3217        if (dtsets(idtset)%nline <= 4) dtsets(idtset)%nline = 100
3218      end if
3219    end if
3220 
3221  end do
3222 
3223 end subroutine macroin2