module defpi
implicit none
real(8),parameter::pi=3.14159265358979323846D0
end module defpi

program f90_calj
    use defpi
    implicit none
    integer,parameter::nn=100
    character(len=20)::dummy
    real(8)::a,b,AJ,sum
    integer::i

    ! Condition b>=a
    call getarg(1,dummy);read(dummy,*) a
    call getarg(2,dummy);read(dummy,*) b

    sum=0.0D0
    do i=1,nn
        sum=sum+tanh(0.5D0*dble(2*i-1)*pi*b/a)/(dble(2*i-1)**5)
    end do
    AJ=1.0D0/3.0D0*b*a*a*a*(1.0D0-192.0D0/pi**5*a/b*sum)
    write(6,'(3(e15.7),f10.4)') a,b,AJ,AJ/b/a/a/a

end program f90_calj
