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

bugfix: CAMtr_volume_mixing_ratio read issue #176

Merged
Merged
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
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