yambo-code / yambo

This is the official GPL repository of the yambo code
http://www.yambo-code.eu/
GNU General Public License v2.0
91 stars 35 forks source link

Variables ng_closed and wf_ng inside ndb.cutoff #75

Open sangallidavide opened 2 months ago

sangallidavide commented 2 months ago

The I/O subroutine io_COL_CUT.F contains, in section 1, wf_ng and ng_closed.

This implies that the latter are changed when yambo finds the database, causing potential issues.

io_COL_CUT should contains a different variable ng_cutoff, eventually with checks about the size w.r.t wf_ng / ng_closed

palful commented 2 months ago

Can I just change

   call io_elemental(ID,I0=wf_ng,DB_I0=wf_ng_db,&
&       VAR=' RL components                   ',CHECK=.true.,OP=(/"<="/))

Into

   call io_elemental(ID,I0=cutoff_ng,&
&       VAR=' RL components                   ',CHECK=.true.,OP=(/"<="/))

where cutoff_ng is declared in mod_wave_func.F and set by default to wf_ng during the setup (i.e. after the call to io_db1)?

sangallidavide commented 2 months ago

I think something like that would be ok. You would need to also define cutoff_ng_db

palful commented 2 months ago

Can you clarify why the argument DB_I0=wf_ng_db (or cutoff_ng_db with the new name) is needed for io_elemental in this case?

sangallidavide commented 2 months ago

In general for the cases in which cutoff_ng_db > cutoff_ng, it might happen that variables needs to be allocated with size cutoff_ng_db and later used with size cutoff_ng

See for example src/io/io_GROT.F

However here it is not used, so it is not strictly needed...