From f295303f7eb19f6971714e4c3ff8e103c9026ef1 Mon Sep 17 00:00:00 2001 From: Soren Rasmussen Date: Tue, 9 Jan 2024 10:58:38 -0700 Subject: [PATCH 1/3] The iso_fortran_env constant 'iostat_end' has replaced the traditional, but not defined by the standard, -1 to mean the end of a file has been reached. This fix reflects that change that is starting to appear in some compilers. --- src/physics/ra_clWRF_support.f90 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/physics/ra_clWRF_support.f90 b/src/physics/ra_clWRF_support.f90 index 5804abd8..3804e479 100755 --- a/src/physics/ra_clWRF_support.f90 +++ b/src/physics/ra_clWRF_support.f90 @@ -11,6 +11,7 @@ !----------------------------------------------------------------------- MODULE module_ra_clWRF_support + use iso_fortran_env, only: iostat_end !USE module_wrf_error IMPLICIT NONE @@ -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 @@ -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 @@ -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) From e0cf472e452bc545168130629e2ea5b5e75e4343 Mon Sep 17 00:00:00 2001 From: Soren Rasmussen Date: Tue, 23 Jan 2024 10:48:36 -0700 Subject: [PATCH 2/3] Small refactor into a single line array assignment --- src/physics/linear_winds.f90 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/physics/linear_winds.f90 b/src/physics/linear_winds.f90 index 478caa8d..a991404e 100644 --- a/src/physics/linear_winds.f90 +++ b/src/physics/linear_winds.f90 @@ -597,10 +597,7 @@ subroutine copy_data_to_remote(wind, grids, LUT, LUT_co, LUT_index_co, i, j, k, ) LUT_co(1:ime-ims+1, 1:jme-jms+1, this_image())[img] = wind(ims:ime,jms:jme) - LUT_index_co(this_image(), 1)[img] = i - LUT_index_co(this_image(), 2)[img] = j - LUT_index_co(this_image(), 3)[img] = k - LUT_index_co(this_image(), 4)[img] = z + LUT_index_co(this_image(), :)[img] = [i, j, k, z] end associate enddo From b46ba422e91a83b5520f2b22cd3af77ae81b7072 Mon Sep 17 00:00:00 2001 From: Soren Rasmussen Date: Mon, 18 Mar 2024 22:26:49 -0600 Subject: [PATCH 3/3] issue 182: fix for future warning about switch from Dataset.dims to Dataset.sizes in aggregate_parallel_files.py script --- helpers/aggregate_parallel_files.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/helpers/aggregate_parallel_files.py b/helpers/aggregate_parallel_files.py index 9a40bfd5..0f2a437d 100755 --- a/helpers/aggregate_parallel_files.py +++ b/helpers/aggregate_parallel_files.py @@ -64,15 +64,15 @@ def set_up_dataset(d): x_off, y_off = get_dim_offset(dims) if len(dims) == 1: - nt = d.dims[dims[0]] + nt = d.sizes[dims[0]] data = np.zeros((nt)) if len(dims) == 2: data = np.zeros((ny + y_off, nx + x_off)) if len(dims) == 3: - data = np.zeros((d.dims[dims[0]], ny + y_off, nx + x_off)) + data = np.zeros((d.sizes[dims[0]], ny + y_off, nx + x_off)) if len(dims) == 4: - nt = d.dims[dims[0]] - nz = d.dims[dims[1]] + nt = d.sizes[dims[0]] + nz = d.sizes[dims[1]] data = np.zeros((nt, nz, ny + y_off, nx + x_off)) # print(name, data.shape, dims, attrs)