Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic unit numbers #91

Merged
merged 1 commit into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading