Skip to content

Command-line options for lmf / lmfa / lmchk (and friends)

Cmdline argument structure (the minimum)

The Fortran binaries accept four token forms. Anything else aborts at startup with a one-line hint. All parsing lives in SRC/subroutines/m_cmdopt_registry.f90 (option table + typo / retired-syntax check) and SRC/subroutines/m_toml_override.f90 (TOML override application).

FormMeaningWhere it goes
<sname>positional, the ctrlg file extensionm_ext::sname
ctrlg.<sname>.tomlpositional, the full TOML filename (e.g. after TAB completion)m_ext::sname
--ctrlg:<dotted.path>=<value>runtime TOML override (applied in memory; file untouched)m_toml_override
--<flag>registered cmdopt0 — presence boolc0_<flag> in m_cmdopt_registry
--<flag>=<value>registered cmdopt2 — typed valuec2_<flag> in m_cmdopt_registry

The two positional forms are equivalent: lmf nio and lmf ctrlg.nio.toml both end up with sname='nio'. m_ext_init rejects anything in between -- ctrlg.nio (no .toml suffix) and ctrl.nio (the legacy text format) abort at startup with a hint pointing at the two canonical forms (and at Legacy2toml.py for the latter).

A single argument-validation pass runs at startup (m_cmdopt_registry::validate_arglist, called from m_args::m_setargs). It aborts on:

  • any --<word> / -<word> that is not in the cmdopt0 table;
  • any --<word>=<value> whose bare prefix is not in the cmdopt2 table;
  • any of the retired forms below (with a per-form migration hint).

Adding a new option is one line each in m_cmdopt_registry.f90: declare c0_<name> (or c2_<name>) and add a matching call set0('--<name>', c0_<name>, narg, arglist) (resp. get2('--<name>', outs, narg, arglist)) in the relevant load_*_registry subroutine. The typo-detection table is built as a side effect — there is no parallel "known-flag list" to keep in sync.

This page is the catalogue of registered options. It is regenerated by searching grep -E "call set0\('--|get2\('--" SRC/subroutines/m_cmdopt_registry.f90, so any flag added/removed in the source flips here automatically.

How to read the table

  • Flags are cmdopt0 (no value): write them verbatim, e.g. --writeham.
  • Key=value are cmdopt2: always include =, e.g. --jobgw=1. Unrecognised --<word>=<value> aborts with a typo hint.
  • TOML override lives in a different namespace: --ctrlg:<dotted.path>=<value> (handled in m_toml_override.f90). It does not appear in this table.
  • Most flags work in lmf (and lmf --jobgw=… which acts as the GW driver). lmfa / lmchk honour the few that apply to the atomic-program / structure-check phases — they are explicitly marked below.

Retired (now abort with migration hint)

These used to be cmdopt0 / cmdopt2 shortcuts that overrode a TOML key directly. They are gone and any of these on the cmdline triggers an abort + one-line hint pointing at the canonical --ctrlg:<path>=<value> form.

Retired formReplacement
--pr=N / --pr N / -pr N--ctrlg:verbose=N
--time=N[,M]--ctrlg:time=[N,M]
--phispinsym (cmdline flag)--ctrlg:ham.phispinsym=true
-v<name>=<value> (legacy %const)--ctrlg:<dotted.path>=<value>
-v[<path>]=<value> (older bracketed)--ctrlg:<dotted.path>=<value>
--[<path>]=<value> (intermediate)--ctrlg:<dotted.path>=<value>
--<a.b.c>=<value> (intermediate dotted)--ctrlg:<a.b.c>=<value>
--toml.<path>=<value> (intermediate)--ctrlg:<path>=<value>
-emin= / -emax= / -ndos= (single dash, legacy)--emin= / --emax= / --ndos=
-EfermiShifteV= (single dash, legacy)--EfermiShifteV=
--terse / -terse (lmchk overlap-table)dropped — use --ctrlg:verbose=N (N≤40)
--no-iactiv (legacy lmfa flag)dropped — silently ignored before, now aborts

Common (lmf / lmfa / lmchk)

OptionTypeEffectUsed in
--helpflagPrint Usage banner + link to this page, then exitm_ext.f90
--debugflagGlobal debug printoutmany
--show_timeflagPrint hambl timinghambl.f90:41
--fullstdoflagAll ranks write to stdout (default: master only)m_MPItk.f90

SCF / electronic structure (lmf core)

OptionTypeEffectUsed in
--etotflagTotal-energy diagnostics onm_lmfinit.f90:652
--vbmonlyflagPrint approximate VBM/CBM relative to vacuum and exitmain_lmf.f90:115
--getqflagOutput channel-resolved occupation Qmain_lmf.f90:119
--v0fixflagFreeze the spherical potential V₀ during SCFm_lmfinit.f90:186
--noinvflagDisable inversion symmetry in BZ samplingm_lmfinit.f90:541
--nosymflagDisable spatial symmetry (forces no-symmetry SCF)m_lmfinit.f90:537
--nosymdmflagNo symmetry on the LDA+U density matrixvarious
--shortenflagShorten lattice vectors (lmchk action)lmaux.f90:75
--slatflagPrint Ewald shorted lattice (lmchk)lmaux.f90:96
--afsymflagUse AF (Shubnikov) symmetry; halves the BZ samplingm_qplist.f90
--onespflagForce nspxx=1 even when nsp=2m_qplist.f90:94
--avoidgammaflagSkip Γ-point in q samplingvarious

Quit-points (debugging / staged runs)

OptionEffect
--quit=showStop after --show echo
--quit=hamStop after m_hamindex_init
--quit=mkpotStop after m_mkpot (potential build)
--quit=dmatStop after first density-matrix construction
--quit=bandStop after the band loop (no density update)
--quitecoreStop after core treatment

Bands / DOS / Fermi surface

OptionTypeEffectUsed in
--bandflagCompute eigenvalues along syml.<sname> (band plot)m_lmfinit.f90:661
--fullmeshflagFull BZ mesh; used by Fermi surface / PROCAR / boltztrapm_qplist.f90:54
--fermisurfaceflagFermi surface mode (Xcrysden .xsf)m_bndfp.f90:128
--mkprocarflagEmit PROCAR (atomic/orbital projected weights)m_bndfp.f90:185
--writepdosflagWrite pdos.* filesmain_lmf.f90:64
--dos / --pdos / --tdosflagDOS / partial DOS / total DOSm_lmfinit.f90:264
--tdostetfflagDisable tetrahedron for --tdos (use Methfessel–Paxton instead)m_bndfp.f90:283
--wdsawadaflagSawada-style simple DOS output, then exitmain_lmf.f90:71
--eigen-at-kflagWrite eigenvalues at user-supplied km_qplist.f90:125
--writeeigenflagSame as --eigen-at-k (alias)m_bndfp.f90:129
--allbandflagOutput all bands at every km_bandcal.f90
--boltztrapflagWrite BoltzTraP input on a full meshm_bndfp.f90:224
--clsflagCore-level spectroscopy weights (see m_clsmode.f90)m_bndfp.f90:157
--coreholeflagCore-hole calculationvarious
--gsflagUse plain Gram–Schmidt (not the modified variant)various

GW driver and friends (lmf --jobgw=…, gwsc internals)

OptionTypeEffectUsed in
--jobgw=0kvlmf writes __jobgw0 data for qg4gwmain_lmf.f90:47
--jobgw=1kvlmf produces the GW input (replaces legacy lmfgw-MPIK)main_lmf.f90:47
--writehamflagWrite HamiltonianPMT.* for downstream tools (mlo / writeham)main_lmf.f90:110
--writev0flagWrite V₀ (spherical part) on the radial meshlocpot.f90:354
--writeseneflagWrite self-energy file __sene.* (debug)m_bndfp.f90
--wsig_fbzflagWrite sigm reshaped to the full BZm_bndfp.f90:175
--use_sigm_fbzflagRead sigm_fbz instead of the regular sigm.*m_bndfp.f90
--readQforGWflagRead user-supplied q-vectors for hsfp0_sc / GWm_q0p.f90:168
--n1n2n3epsflagHonour n1n2n3eps mesh in qg4gw/mkqg for ε/χ⁺⁻mkqg.f90
--job=NkvStage selector in hbasfp0, hvccfp0, hsfp0_sc, qg4gw, heftet. Range is per-binary; see lmf-gw-driver-stages in gwsc.md.many
--ntqxxflagLimit number of QP states (debug)various
--cutuu=kvCut-off on vc matrix elementsm_hsfp0_sc.f90
--Wtype=kvSelect W type (RPA, eps0, …) in hsfp0_scm_hsfp0_sc.f90
--nww=kvNumber of frequency points in hrcxq / hsfp0_scm_hsfp0_sc.f90
--nk=kvk-parallel group size (overrides default of mpi_size)m_mpi.f90
--nb=kv(Deprecated; b-parallel was removed.) Tolerated and ignored.main_hrcxq.f90
--keepwvflagKeep W in memory for screening (auto-on with --gpu)hgw_combined
--qibzonlyflagCompute only IBZ q-points (skip auxiliary q₀)various
--getetaflagGet η damping diagnostics for ε(q,ω)various
--interbandonly / --intrabandonlyflagLimit interband / intraband transitions in εvarious
--testsoflagSO sanity test pathvarious
--tetraw / --tetwtkflagTetrahedron-weight diagnosticsvarious

MLO / Wannier-replacement (job_mlo, job_mloW, job_mlo_soc)

OptionTypeEffectUsed in
--mloflagMLO mode: emit __cmlo.data / __cmlo.info from the GW inputm_HamPMT.f90:188
--cmloflagUse the MLO Hamiltonian path (main_lmfham2)main_lmfham2.f90:582
--mlogflagMLO + GW combined outputvarious
--mlo_orthoflagOrthogonalize MLOs (no normalization)m_mlo_ham.f90
--mlo_orthonormflagOrthonormalize MLOsm_mlo_ham.f90
--mlo_diagnormflagDiagonal renormalization onlym_mlo_ham.f90
--mlo_feb4flagbcc Fe Fe-3d on-site W reference recipe (see MLOsamples/README.md)m_mlo_ham.f90
--mloahcflagMLO + AHC (Anomalous Hall Conductivity)various
--AHCMATflagWrite AHC matrix elementsvarious
--UUMATflagWrite `<uu>` overlap matrix (debug)
--dwnb=mlo / --dwnb=wankvChoose downfolding basis (MLO vs Wannier)m_procar.f90
--writedwflagDefault-on: write dw weights in m_procarm_procar.f90
--nowritedwflagSuppress dw writingm_procar.f90
--socmatrixflagWrite SOC matrix (__HamiltonianPMTsoc)m_HamPMT.f90:109
--ahcflagAHC variantvarious

Density / potential I/O

OptionTypeEffectUsed in
--densityflagWrite smoothed density to xsf / file (see m_bndfp.f90:340)m_bndfp.f90:340
--wrhomtflagWrite true MT density rhoMT.<ib> (debug)locpot.f90:189
--wpotmtflagWrite true MT potential vtrue.<ib>locpot.f90:335
--vesatomflagOutput lmfa electrostatic potentialfreeat.f90:31
--vesdatflagWrite the per-rank electrostatic datalocpot.f90:263
--espotflagElectrostatic-potential calculationm_bndfp.f90
--estaticallflagOutput full electrostatic potentialm_bndfp.f90
--eszeroflagSet Madelung correction to zero (diagnostic)various
--novxcflagSkip XC contribution (debug)locpot.f90:391

Structure / symmetry (lmchk actions)

OptionTypeEffectUsed in
--getwsrflagCompute touching-MT radii; used by ctrlgenToml.pylmaux.f90:120
--kchkflagCheck whether the k-mesh is compatible with the space groupbzmesh.f90:120
--ylmcflagPrint Ylm analysisvarious

SOC

OptionTypeEffectUsed in
--socmatrixflag(see MLO section)m_HamPMT.f90:109
--skiphammsocflagDon't add the SOC term to hamm (perturbation path)m_bandcal.f90
--ctrlg:ham.phispinsym=trueTOMLSpin-averaged radial wfns (formerly --phispinsym); set via TOML override or in [ham] of ctrlg.<sname>.toml.m_toml_override.f90

GPU / linear-algebra knobs

OptionTypeEffectUsed in
--gpuflagTake the GPU code path (auto-grabs /tmp/gpu.lock)InstallAll.py, m_*.f90
--use_gemmul8flagUse the GEMMul8 Ozaki-scheme matmul kernelvarious
--modifiedGSflagModified Gram–Schmidt orthogonalisationvarious
--diag=default / --diag=tridiag / --diag=chefsikvDiagonaliser selector (LAPACK default, tridiag, ChebFSI)various

Post-processing helpers (hmlo_ovlppair, eps tools)

OptionTypeEffectUsed in
--sp1= / --sp2=kvspin selectors in hmlo_ovlppairhmlo_ovlppair.f90:20
--emin= / --emax= / --ndos=kvDOS energy window / resolutionvarious
--EfermiShifteV=kvShift EF (eV) before DOS / spectrumvarious

Diagnostic / debug-only flags

These exist for development and are unlikely to be useful in production runs. Behaviour is not guaranteed to be stable.

--debugbndfp, --debugpwmat, --debugsugw, --debugzmel, --zmel0, --normcheck, --showdmat, --x0test, --q2q1test, --cvK:, --skip_qvalcheck, --skipbstruxinit, --skipCPHI, --skipGS, --skiphammsoc, --skip1d / --skip2nd / --skip2ndd / --skip2ndp / --skip2nds, --skipd / --skipf / --skiplo (all currently dead code in m_HamPMT.f90), --wanatom.

Run-time TOML overrides (--ctrlg:<path>=<value>)

The only accepted override syntax is --ctrlg:<dotted.path>=<value>. Values are TOML-typed (bool lowercase true/false, strings quoted, arrays in [...]); bare identifiers are auto-quoted so shell quote-stripping is forgiving.

bash
lmf si --ctrlg:bz.nkabc=[8,8,8] --ctrlg:ham.scaledsigma=0.8
lmf si --ctrlg:ham.so=1 --ctrlg:ham.nspin=2          # SOC as perturbation
lmf si --ctrlg:ham.phispinsym=true                   # bool lowercase
lmf si --ctrlg:verbose=50 --ctrlg:time=[5,5]         # top-level keys
lmf si --ctrlg:spec.1.r=2.5                          # override SPEC[1].r
lmf si --ctrlg:symgrp=find                           # bare identifier auto-quoted

The path mirrors the TOML structure (section.key / section.<idx>.key for arrays-of-tables, 1-indexed). Applied overrides are logged on rank 0. See toml_migration for the full spec.

When this page goes stale

If the source has a flag this page doesn't list (or vice versa), trust the source. Refresh with:

bash
grep -rEoh "cmdopt[02]\('[-][^']+'" \
     SRC/subroutines/ SRC/main/ | sort -u

and reconcile by hand. We deliberately do not auto-generate this page because the categorical grouping and the prose notes are the value; a flat alphabetical dump is what grep already gives you.

Tab completion (bash)

InstallAll.py ships a bash-completion script that knows about both the cmdopt registry and the TOML override syntax. After installation:

  • lmf <TAB> (or lmfa, lmchk) -> offers every ctrlg.<sname>.toml in the current directory as the positional <sname>.
  • lmf nio --w<TAB> -> the cmdopt0/cmdopt2 names that start with --w (--writedw, --writeham, --writepdos, ...).
  • lmf nio --ctrlg:<TAB> (or any prefix like --ctrlg:bz.) -> the dotted-path keys that actually exist in the cwd's ctrlg.<sname>.toml. [[spec]] / [[site]] arrays expand into spec.1.r, spec.2.r, ... automatically.
  • Trailing space is suppressed for --ctrlg: and any cmdopt2 (so --ct<TAB> becomes --ctrlg: with the cursor still on the colon, ready for bz.nkabc=...).

The completion has two data sources, each with a different freshness:

Completion targetSourceWhen it updates
--ctrlg:<dotted.path>the cwd's ctrlg.<sname>.toml parsed live by python3 (tomllib) at every TABalways reflects the on-disk TOML
--<flag> / --<flag>=BINDIR/ecalj_cmdopts.list (dumped by lmf --listcmdopt during InstallAll.py)refreshed on every ./InstallAll.py run

The mapping mirrors the parser:

  • A ctrlg.*.toml key only appears as a completion if it really exists in that file — so a TAB-completed --ctrlg: path never triggers the "key not found in target section" abort from m_toml_override.
  • A --<flag> only appears if it is registered in m_cmdopt_registry::load_cmdopt0_registry / load_cmdopt2_registry — so a TAB-completed flag never triggers the "unknown option" abort from validate_arglist.

Both ~/bin/ecalj_complete.bash and ~/bin/ecalj_cmdopts.list are written by InstallAll.py; a guarded [ -f .../ecalj_complete.bash ] && source ... line is appended once to ~/.bashrc. To opt out, run InstallAll.py --no-bashrc; to disable later, delete the # >>> ecalj bash completion ... <<< block from ~/.bashrc.

The lmf --listcmdopt entry point (added together with the completion plumbing) dumps every registered cmdopt0 / cmdopt2 name on stdout, one per line, with a trailing = on cmdopt2 entries so the completion script can distinguish them from bare flags:

text
$ lmf --listcmdopt | head -5
--AHCMAT
--UUMAT
--afsym
--ahc
--allband
$ lmf --listcmdopt | grep '=$' | head -3
--jobgw=
--job=
--nb=

Use the same --listcmdopt to generate completion data for any external scripting that needs to know the registry contents at install time.