Skip to content

Commit 550f2e2

Browse files
author
Steve Goldhaber
committed
Fix logic bug introduced by following reviewer change request
1 parent 63e0f35 commit 550f2e2

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

src/cpl/nuopc/atm_stream_co2.F90

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,16 @@ subroutine stream_co2_surface_source_readnl(nlfile)
9696
close(nu_nml)
9797

9898
! Error check
99-
if ( trim(stream_co2_surface_source_taxmode) /= 'cycle' .and. &
100-
trim(stream_co2_surface_source_taxmode) /= 'extend' .and. &
101-
trim(stream_co2_surface_source_taxmode) /= 'limit') then
102-
call endrun(subName//': ERROR stream_co2_surface_source_taxmode '&
103-
//trim(stream_co2_surface_source_taxmode)&
104-
//' must be either cycle, extend or limit')
99+
if (co2_surface_source) then
100+
if ( trim(stream_co2_surface_source_taxmode) /= 'cycle' .and. &
101+
trim(stream_co2_surface_source_taxmode) /= 'extend' .and. &
102+
trim(stream_co2_surface_source_taxmode) /= 'limit') then
103+
call endrun(subName//': ERROR stream_co2_surface_source_taxmode ' &
104+
//trim(stream_co2_surface_source_taxmode) &
105+
//' must be either cycle, extend or limit')
106+
end if
105107
end if
106-
endif
108+
end if
107109

108110
call mpi_bcast(co2_surface_source, 1, mpi_logical, masterprocid, mpicom, ierr)
109111
if (ierr /= 0) call endrun(trim(subname)//": FATAL: mpi_bcast: co2_surface_source")
@@ -153,7 +155,7 @@ subroutine stream_co2_surface_source_readnl(nlfile)
153155
else
154156
write(iulog, '(2a)') subname, 'co2 surface source will not be overwritten'
155157
end if
156-
endif
158+
end if
157159

158160
end subroutine stream_co2_surface_source_readnl
159161

0 commit comments

Comments
 (0)