Skip to content

Commit

Permalink
Switch to automatically chosen unit numbers (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
vanderhe authored Jul 10, 2024
1 parent 65d5f44 commit d8e7a2b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
6 changes: 2 additions & 4 deletions sktwocnt/prog/input.f90
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ subroutine readInput(inp, fname)
inp%tCam = .false.
inp%tGlobalHybrid = .false.

fp = 14
open(fp, file=fname, form="formatted", action="read")
open(newunit=fp, file=fname, form="formatted", action="read")
! general part
iLine = 0

Expand Down Expand Up @@ -348,12 +347,11 @@ subroutine readdata_(fname, cols, data)
!! auxiliary variable
integer :: ii

fp = 12
iLine = 1

allocate(tmp(maxval(cols)))

open(fp, file=fname, action="read", form="formatted")
open(newunit=fp, file=fname, action="read", form="formatted")

call nextline_(fp, iLine, line)
read(line, *, iostat=iErr) nGrid
Expand Down
8 changes: 4 additions & 4 deletions slateratom/lib/output.f90
Original file line number Diff line number Diff line change
Expand Up @@ -486,8 +486,8 @@ subroutine write_energies_tagged(ekin, enuc, ecoul, exc, econf, etot, zora, eigv
type(TTaggedwriter) :: twriter

call TTaggedwriter_init(twriter)
fp = 95
open(fp, file="energies.tag", status="replace", action="write")

open(newunit=fp, file="energies.tag", status="replace", action="write")
call writetag(twriter, fp, "zora", zora)
call writetag(twriter, fp, "kinetic_energy", ekin)
call writetag(twriter, fp, "nuclear_energy", enuc)
Expand Down Expand Up @@ -518,15 +518,15 @@ subroutine write_wave_coeffs_file(max_l, num_alpha, poly_order, cof, alpha, occ,
real(dp), allocatable :: coeffs(:,:)

call TTaggedwriter_init(twriter)
fp = 95

do ll = 0, max_l
allocate(coeffs(poly_order(ll), num_alpha(ll)))
do ii = 1, num_alpha(ll) * poly_order(ll)
if (ii < qnvalorbs(1, ll) .or. ii > qnvalorbs(2, ll)) then
cycle
end if
write(fname, "(A,I2.2,A,A)") "coeffs_", ii + ll, orbnames(ll), ".tag"
open(fp, file=fname, status="replace", action="write")
open(newunit=fp, file=fname, status="replace", action="write")
call writetag(twriter, fp, "exponents", alpha(ll, :num_alpha(ll)))
call convcoeffs(cof(1, ll, :, ii), alpha(ll, :num_alpha(ll)), ll, coeffs)
call writetag(twriter, fp, "coefficients", coeffs)
Expand Down

0 comments on commit d8e7a2b

Please sign in to comment.