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

Fixed input and output of constant photolysis rates #467

Merged
merged 1 commit into from
Feb 12, 2022
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
7 changes: 3 additions & 4 deletions src/inputFunctions.f90
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,6 @@ subroutine readPhotolysisConstants()
end if

open (10, file=filename, status='old', iostat=ierr)
read (10,*) ! Ignore first line
do i = 1, numConstantPhotoRates
read (10,*, iostat=ierr) constantPhotoNumbers(i), constantPhotoValues(i), constantPhotoNames(i)
if ( ierr /= 0 ) then
Expand All @@ -348,13 +347,13 @@ subroutine readPhotolysisConstants()
close (10, status='keep')

if ( numConstantPhotoRates > 3 ) then
write (*, '(I7, 1P e15.3, 1P e15.3)') constantPhotoNumbers(1), constantPhotoValues(1), constantPhotoNames(1)
write (*, '(I7, 1P e15.3, A)') constantPhotoNumbers(1), constantPhotoValues(1), constantPhotoNames(1)
write (*, '(A)') ' ...'
write (*, '(I7, 1P e15.3, 1P e15.3)') constantPhotoNumbers(numConstantPhotoRates), &
write (*, '(I7, 1P e15.3, A)') constantPhotoNumbers(numConstantPhotoRates), &
constantPhotoValues(numConstantPhotoRates), constantPhotoNames(numConstantPhotoRates)
else
do i = 1, numConstantPhotoRates
write (*, '(I7, 1P e15.3, 1P e15.3)') constantPhotoNumbers(i), constantPhotoValues(i), constantPhotoNames(i)
write (*, '(I7, 1P e15.3, A)') constantPhotoNumbers(i), constantPhotoValues(i), constantPhotoNames(i)
end do
end if
write (*, '(A)') ' Finished reading photolysis constants.'
Expand Down
6 changes: 3 additions & 3 deletions src/outputFunctions.f90
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ end subroutine outputPhotoRateCalcParameters
! Write photolysis rates to file.
subroutine outputPhotolysisRates( t )
use types_mod
use photolysis_rates_mod, only : ck, constrainedPhotoNumbers, j, PR_type, &
constantPhotoNames, numConstantPhotoRates, &
use photolysis_rates_mod, only : ck, constrainedPhotoNumbers, constantPhotoNumbers, &
j, PR_type, constantPhotoNames, numConstantPhotoRates, &
constrainedPhotoNames, numConstrainedPhotoRates, &
unconstrainedPhotoNames, numUnconstrainedPhotoRates

Expand All @@ -145,7 +145,7 @@ subroutine outputPhotolysisRates( t )
write (58, '(100A15) ') 't', (trim( constantPhotoNames(i) ), i = 1_NPI, numConstantPhotoRates)
firstTime = .false.
end if
write (58, '(100 (ES15.6E3)) ') t, (j(ck(i)), i = 1_NPI, numConstantPhotoRates)
write (58, '(100 (ES15.6E3)) ') t, (j(constantPhotoNumbers(i)), i = 1_NPI, numConstantPhotoRates)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good bug catch, thanks!


case ( 2_SI )
if ( firstTime .eqv. .true. ) then
Expand Down