How to add blank lines to the output of o-gw*.qp

Various technical topics such as parallelism and efficiency, netCDF problems, the Yambo code structure itself, are posted here.

Moderators: Davide Sangalli, andrea.ferretti, myrta gruning, andrea marini, Daniele Varsano, Conor Hogan, Nicola Spallanzani

Post Reply
lyzhao
Posts: 62
Joined: Tue May 31, 2016 8:02 am

How to add blank lines to the output of o-gw*.qp

Post by lyzhao » Wed Dec 24, 2025 1:05 pm

Dear all,
Could you tell me how to modify the src file (may be QP_of.F) to add blank lines to the output of o-gw*.qp at each k point.
that is, change from

Code: Select all

#    K-point            Band               Eo [eV]              E-Eo [eV]          Sc|Eo [eV]
#
        1                  1                 -17.93766            -9.933513           1.090004
        1                  2                 -5.390117            -4.946246           1.058876
        1                  3                 -1.386996            -4.484918           0.937772
        1                  4                -1.386987            -4.485260           0.937435
        1                  5                 4.584253             1.216447          -0.998785
        2                  1                 -15.99499            -9.029319           1.115146
        2                  2                 -7.015398            -5.931352           0.997163
        2                  3                 -3.698058            -5.000331           0.962454
        2                  4                -2.683181            -4.019266           0.970213
        2                  5                 7.088098             4.239224          -0.944775
        3                  1                 -14.27528            -8.886320           1.092589
        3                  2                 -8.099078            -5.859301           1.017284
        3                  3                 -7.270516            -6.156611           1.005850
        3                  4                 0.000000            -3.507087           0.917450
        3                  5                 4.633116             4.356365          -0.910707
to

Code: Select all

#    K-point            Band               Eo [eV]              E-Eo [eV]          Sc|Eo [eV]
#
        1                  1                 -17.93766            -9.933513           1.090004
        1                  2                 -5.390117            -4.946246           1.058876
        1                  3                 -1.386996            -4.484918           0.937772
        1                  4                -1.386987            -4.485260           0.937435
        1                  5                 4.584253             1.216447          -0.998785
        add the blank line
        2                  1                 -15.99499            -9.029319           1.115146
        2                  2                 -7.015398            -5.931352           0.997163
        2                  3                 -3.698058            -5.000331           0.962454
        2                  4                -2.683181            -4.019266           0.970213
        2                  5                 7.088098             4.239224          -0.944775
        add the blank line
        3                  1                 -14.27528            -8.886320           1.092589
        3                  2                 -8.099078            -5.859301           1.017284
        3                  3                 -7.270516            -6.156611           1.005850
        3                  4                 0.000000            -3.507087           0.917450
        3                  5                 4.633116             4.356365          -0.910707
best regards.
Youzhao Lan
College of Chemistry and Materials Science,
Zhejiang Normal University,
Jinhua, Zhejiang, China.
HomePage: http://blog.sciencenet.cn/u/lyzhao

User avatar
Davide Sangalli
Posts: 659
Joined: Tue May 29, 2012 4:49 pm
Location: Via Salaria Km 29.3, CP 10, 00016, Monterotondo Stazione, Italy
Contact:

Re: How to add blank lines to the output of o-gw*.qp

Post by Davide Sangalli » Wed Dec 24, 2025 9:47 pm

Something along these lines

Code: Select all

  ik_ref=0
  !
  do i_qp=1,QP_n_states
     !
     if ( QP_table(i_qp,3)/=ik_ref) then
        ik_ref=QP_table(i_qp,3)
        call msg('o '//what,"","")
     endif
     !                                                                  
     ! Fill the COL type with values                                    
     !===============================                                   
     call OUTPUT_driver(what,TITLES=(/"K-point","Band   "/),I_VALUES=(/QP_table(i_qp,3),QP_table(i_qp,1)/))
Davide Sangalli, PhD
Piazza Leonardo Da Vinci, 32, 20133 – Milano
CNR, Istituto di Struttura della Materia (ISM)
https://sites.google.com/view/davidesangalli
http://www.max-centre.eu/

User avatar
Daniele Varsano
Posts: 4302
Joined: Tue Mar 17, 2009 2:23 pm
Contact:

Re: How to add blank lines to the output of o-gw*.qp

Post by Daniele Varsano » Fri Jan 02, 2026 10:47 am

Dear Youzhao,

the lines indicated by Davide are found in:
.src/qp/QP_of.F

alternatively, you can post-process the output with an external bash/python/your_favourite script.

Best,

Daniele
Dr. Daniele Varsano
S3-CNR Institute of Nanoscience and MaX Center, Italy
MaX - Materials design at the Exascale
http://www.nano.cnr.it
http://www.max-centre.eu/

Post Reply