44    integer,              
public :: nyoung
 
   45    integer                      :: nup, ndown, iyoung
 
   46    integer, 
allocatable, 
public :: young_up(:,:)
 
   47    integer, 
allocatable, 
public :: young_down(:,:)
 
   54    integer, 
intent(in) :: nup, ndown
 
   55    type(young_t), 
intent(inout) :: this
 
   62      write (
message(1),
'(a)') 
'We only make 2-row Young diagrams with nup >= ndown' 
   72      this%nyoung = this%nyoung / (ndown-ipart+1)
 
   74      this%nyoung = this%nyoung / (nup  -ipart+2)
 
   76    do ipart = ndown+1, nup
 
   78      this%nyoung = this%nyoung / (nup  -ipart+1)
 
   81    safe_allocate(this%young_up  (1:nup,  1:this%nyoung))
 
   82    safe_allocate(this%young_down(1:ndown,1:this%nyoung))
 
   84    this%young_up(:, :)   = -999
 
   85    this%young_down(:, :) = -999
 
   96    integer, 
intent(in) :: nn
 
   97    type(young_t), 
intent(inout) :: this
 
  102    if (this%iyoung > this%nyoung) 
then 
  108    do idown = this%ndown, 1, -1
 
  109      if (this%young_down(idown, this%iyoung) == -999) 
then 
  110        this%young_down(idown, this%iyoung) = nn
 
  115          this%iyoung = this%iyoung+1
 
  116          if (this%iyoung <= this%nyoung) 
then 
  117            this%young_up(:,this%iyoung)   = this%young_up(:,this%iyoung-1)
 
  118            this%young_down(:,this%iyoung) = this%young_down(:,this%iyoung-1)
 
  126    if (this%iyoung > this%nyoung) 
then 
  132    do iup = this%nup, 1, -1
 
  133      if (this%young_up(iup, this%iyoung) == -999) 
then 
  135        if (iup > this%ndown) 
then 
  136          this%young_up(iup, this%iyoung) = nn
 
  141            this%iyoung = this%iyoung+1
 
  142            if (this%iyoung <= this%nyoung) 
then 
  143              this%young_up(:,this%iyoung)   = this%young_up(:,this%iyoung-1)
 
  144              this%young_down(:,this%iyoung) = this%young_down(:,this%iyoung-1)
 
  149        else if (this%young_down(iup, this%iyoung) /= -999) 
then 
  150          this%young_up(iup, this%iyoung) = nn
 
  155            this%iyoung = this%iyoung+1
 
  156            if (this%iyoung <= this%nyoung) 
then 
  157              this%young_up(:,this%iyoung)   = this%young_up(:,this%iyoung-1)
 
  158              this%young_down(:,this%iyoung) = this%young_down(:,this%iyoung-1)
 
  167    if (this%iyoung > this%nyoung) 
then 
  186    type(
young_t), 
intent(inout) :: this
 
  187    integer, 
intent(in) :: nn
 
  189    integer :: iup, idown
 
  195      if (this%young_up(iup,this%iyoung) == nn+1) this%young_up(iup,this%iyoung) = -999
 
  197    do idown = 1, this%ndown
 
  198      if (this%young_down(idown,this%iyoung) == nn+1) this%young_down(idown,this%iyoung) = -999
 
  207    integer, 
intent(in) :: iunit
 
  208    type(
young_t), 
intent(inout) :: this
 
  214    write (iunit, 
'(a,I4,a,I4,a)') 
' Young diagrams for ', this%nup, 
' spins up, and ', this%ndown, 
' down ' 
  215    do iyoung = 1, this%nyoung
 
  225    integer, 
intent(in) :: iunit
 
  226    type(
young_t), 
intent(inout) :: this
 
  228    integer, 
intent(in) :: iyoung
 
  232    write (iunit,
'(a,I7)') 
' Young diagram ', iyoung
 
  233    write (iunit,
'(10I7)') this%young_up(:, iyoung)
 
  234    write (iunit,
'(10I7)') this%young_down(:, iyoung)
 
  243    integer, 
intent(in) :: iunit, nparticles
 
  244    integer :: nup, ndown
 
  250      nup = nparticles - ndown
 
  261    integer, 
intent(in) :: nparticles
 
  262    integer, 
intent(out) :: ndiagrams
 
  263    integer :: nup, ndown
 
  270      nup = nparticles - ndown
 
  272      ndiagrams = ndiagrams + this%nyoung
 
  283    type(
young_t), 
intent(inout) :: young_in, young_out
 
  287    young_out%nup = young_in%nup
 
  288    young_out%ndown = young_in%ndown
 
  289    young_out%nyoung = young_in%nyoung
 
  291    safe_allocate_source_a(young_out%young_up,young_in%young_up)
 
  292    safe_allocate_source_a(young_out%young_down,young_in%young_down)
 
  300    type(
young_t), 
intent(inout) :: this
 
  304    safe_deallocate_a(this%young_up)
 
  305    safe_deallocate_a(this%young_down)
 
double floor(double __x) __attribute__((__nothrow__
 
real(real64), parameter, public m_half
 
This module is intended to contain "only mathematical" functions and procedures.
 
recursive integer function, public factorial(n)
 
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
 
subroutine, public messages_fatal(no_lines, only_root_writes, namespace)
 
subroutine, public young_copy(young_in, young_out)
 
subroutine, public young_end(this)
 
subroutine, public young_init(this, nup, ndown)
 
recursive subroutine young_fill(this, nn)
 
subroutine young_reset_1val(this, nn)
 
subroutine, public young_ndiagrams(nparticles, ndiagrams)
 
subroutine, public young_write_one(iunit, this, iyoung)
 
subroutine, public young_write(iunit, this)
 
subroutine, public young_write_allspins(iunit, nparticles)
routine gets all Young diagrams for all distributions of spins