Skip to content

Commit

Permalink
Merge pull request #176 from scrasmussen/bugfix/CAMtr_volume_mixing_r…
Browse files Browse the repository at this point in the history
…atio-read

bugfix: CAMtr_volume_mixing_ratio read issue
  • Loading branch information
gutmann authored Jan 23, 2024
2 parents 3a0061a + f295303 commit 2065ee6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/physics/ra_clWRF_support.f90
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
!-----------------------------------------------------------------------
MODULE module_ra_clWRF_support

use iso_fortran_env, only: iostat_end
!USE module_wrf_error

IMPLICIT NONE
Expand Down Expand Up @@ -113,6 +114,7 @@ SUBROUTINE read_CAMgases(yr, julian, model, co2vmr, n2ovmr, ch4vmr, cfc11vmr, cf
!INTEGER, EXTERNAL :: get_unused_unit

INTEGER :: istatus, iunit, idata
CHARACTER(LEN=1024) :: imessage
!ccc VARCAM_in_years is a module variable, needs something else here!
INTEGER, SAVE :: max_years
integer :: nyrm, nyrp, njulm, njulp
Expand Down Expand Up @@ -151,7 +153,7 @@ SUBROUTINE read_CAMgases(yr, julian, model, co2vmr, n2ovmr, ch4vmr, cfc11vmr, cf
istatus = 0
idata = 1
DO WHILE (istatus == 0)
READ(UNIT=iunit, FMT='(I4, 1x, F8.3,1x, 4(F10.3,1x))', IOSTAT=istatus) &
READ(UNIT=iunit, FMT='(I4, 1x, F8.3,1x, 4(F10.3,1x))', IOSTAT=istatus, IOMSG=imessage) &
yrdata(idata), co2r(idata), n2or(idata), ch4r(idata), cfc11r(idata), &
cfc12r(idata)
if (istatus==0) then
Expand All @@ -171,10 +173,10 @@ SUBROUTINE read_CAMgases(yr, julian, model, co2vmr, n2ovmr, ch4vmr, cfc11vmr, cf
END DO
if (this_image()==1) print*,"CLWRF read:",idata-1, " lines"

IF (istatus /= -1) THEN
IF (istatus /= iostat_end) THEN
PRINT *,'CLWRF -- clwrf -- CLWRF ALERT!'
PRINT *," Not normal ending of 'CAMtr_volume_mixing_ratio' file"
PRINT *," Lecture ends with 'IOSTAT'=",istatus
PRINT *," Lecture ends with 'IOSTAT'=",istatus, "and IOMSG=", trim(imessage)
END IF
max_years = idata - 1
CLOSE(iunit)
Expand Down

0 comments on commit 2065ee6

Please sign in to comment.