Skip to content

Commit

Permalink
Update interp_inc to allow hdf5 >=1.10.9 (NOAA-EMC#16)
Browse files Browse the repository at this point in the history
* Update interp_inc to allow hdf5 >=1.10.9

* gcc CI updates (incl. JCSDA/spack->spack/spack)

* revert spack->JCSDA

* tweak intel CI

* test fix for recentersigp for CI failure

* revert to JCSDA spack

* revert to main spack; re-add --dirty

* more intel CI debugging

* ci cache

* intel CI cache key

* Update intel.yml
  • Loading branch information
AlexanderRichert-NOAA authored Aug 9, 2023
1 parent 4bb9dee commit 4bd8521
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 23 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/gcc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ jobs:
- name: install-dependencies-with-spack
if: steps.cache-env.outputs.cache-hit != 'true'
run: |
git clone -c feature.manyFiles=true https://github.com/NOAA-EMC/spack.git
git clone -c feature.manyFiles=true https://github.com/JCSDA/spack.git
source spack/share/spack/setup-env.sh
spack env create gsiutils-env GSI-utils/ci/spack.yaml
spack env activate gsiutils-env
spack compiler find
spack external find
spack add [email protected]
spack concretize
spack install --dirty -v
spack install -v --fail-fast
build:
needs: setup
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/intel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ defaults:

# Set I_MPI_CC/F90 so Intel MPI wrapper uses icc/ifort instead of gcc/gfortran
env:
cache_key: intel4 # The number (#) following the cache_key "intel" is to flush Action cache.
cache_key: intel5 # The number (#) following the cache_key "intel" is to flush Action cache.
CC: icc
FC: ifort
CXX: icpc
Expand Down Expand Up @@ -39,7 +39,7 @@ jobs:
# Cache spack, compiler and dependencies
- name: cache-env
id: cache-env
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
spack
Expand Down Expand Up @@ -67,15 +67,16 @@ jobs:
- name: install-dependencies-with-spack
if: steps.cache-env.outputs.cache-hit != 'true'
run: |
git clone -c feature.manyFiles=true https://github.com/NOAA-EMC/spack.git
git clone -c feature.manyFiles=true https://github.com/JCSDA/spack.git
source spack/share/spack/setup-env.sh
spack env create gsiutils-env GSI-utils/ci/spack.yaml
spack env activate gsiutils-env
sudo mv /usr/local/ /usr/local_mv
spack compiler find
spack external find
spack add intel-oneapi-mpi
spack concretize
spack install --dirty -v
spack install --dirty --fail-fast -v
build:
needs: setup
Expand All @@ -93,7 +94,7 @@ jobs:
- name: cache-env
id: cache-env
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
spack
Expand Down
2 changes: 1 addition & 1 deletion src/EnKF/gfs/src/recentersigp.fd/recentersigp.f90
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ program recentersigp
type(Dataset) :: dseti,dseto,dsetmi,dsetmo,dsetmg
type(Dimension) :: londim,latdim,levdim

namelist /recenter/ incvars_to_zero
character(len=12),dimension(10) :: incvars_to_zero !just picking 10 arbitrarily
namelist /recenter/ incvars_to_zero

! Initialize mpi
call MPI_Init(ierr)
Expand Down
30 changes: 15 additions & 15 deletions src/netcdf_io/interp_inc.fd/driver.f90
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ program interp_inc
! with data below.
!-----------------------------------------------------------------

if (mype == 0) call w3tagb('INTERP_INC', 2019, 100, 0, 'EMC')
if (mype == npes-1) call w3tagb('INTERP_INC', 2019, 100, 0, 'EMC')

if (mype == 0) print*,'- READ SETUP NAMELIST'
if (mype == npes-1) print*,'- READ SETUP NAMELIST'
open (43, file="./fort.43")
read (43, nml=setup, iostat=error)
if (error /= 0) then
Expand All @@ -102,7 +102,7 @@ program interp_inc
endif
close (43)

if (mype == 0) print*,"- WILL INTERPOLATE TO GAUSSIAN GRID OF DIMENSION ",lon_out, lat_out
if (mype == npes-1) print*,"- WILL INTERPOLATE TO GAUSSIAN GRID OF DIMENSION ",lon_out, lat_out

! Set constants
rad2deg = 180.0_8 / (4.0_8 * atan(1.0_8))
Expand All @@ -111,7 +111,7 @@ program interp_inc
ilev=lev+1

call mpi_barrier(mpi_comm_world, mpierr)
if (mype == 0) then
if (mype == npes-1) then
print*,'- OPEN OUTPUT FILE: ', trim(outfile)

error = nf90_create(outfile, cmode=IOR(NF90_CLOBBER,NF90_NETCDF4), ncid=ncid_out)
Expand Down Expand Up @@ -243,7 +243,7 @@ program interp_inc
! Open and read input file
!----------------------------------------------------

if (mype == 0) print*,'- OPEN INPUT FILE: ', trim(infile)
if (mype == npes-1) print*,'- OPEN INPUT FILE: ', trim(infile)

error = nf90_open(trim(infile), ior(nf90_nowrite, nf90_mpiio), &
comm=mpi_comm_world, info = mpi_info_null, ncid=ncid_in)
Expand Down Expand Up @@ -338,7 +338,7 @@ program interp_inc
! skip v_inc (done with u_inc, which comes first)
if (trim(records(rec)) .eq. 'v_inc') cycle

if (mype == rec) then
if (mype == rec-1) then
print*,'- PROCESS RECORD: ', trim(records(rec))

error = nf90_inq_varid(ncid_in, trim(records(rec)), id_var)
Expand Down Expand Up @@ -379,9 +379,9 @@ program interp_inc
stop 77
endif
call mpi_send(go(1,1), size(go), mpi_double_precision, &
0, 1000+rec, mpi_comm_world, mpierr)
npes-1, 1000+rec, mpi_comm_world, mpierr)
call mpi_send(go3(1,1), size(go3), mpi_double_precision, &
0, 2000+rec, mpi_comm_world, mpierr)
npes-1, 2000+rec, mpi_comm_world, mpierr)
else
call ipolates(ip, ipopt, kgds_in, kgds_out, mi, mo, &
lev, ibi, li, gi, no, rlat, rlon, ibo, &
Expand All @@ -397,12 +397,12 @@ program interp_inc
!dummy_out = reshape(go, (/lon_out,lat_out,lev/))
!print *, lon_out, lat_out, lev, 'send'
call mpi_send(go(1,1), size(go), mpi_double_precision, &
0, 1000+rec, mpi_comm_world, mpierr)
npes-1, 1000+rec, mpi_comm_world, mpierr)
endif
else if (mype == 0) then
else if (mype == npes-1) then
!print *, lon_out, lat_out, lev, 'recv'
call mpi_recv(go2(1,1), size(go2), mpi_double_precision, &
rec, 1000+rec, mpi_comm_world, mpistat, mpierr)
rec-1, 1000+rec, mpi_comm_world, mpistat, mpierr)
dummy_out = reshape(go2, (/lon_out,lat_out,lev/))
error = nf90_inq_varid(ncid_out, trim(records(rec)), id_var)
call netcdf_err(error, 'inquiring ' // trim(records(rec)) // ' id for file='//trim(outfile) )
Expand All @@ -411,7 +411,7 @@ program interp_inc
if (trim(records(rec)) .eq. 'u_inc') then
! process v_inc also.
call mpi_recv(go2(1,1), size(go2), mpi_double_precision, &
rec, 2000+rec, mpi_comm_world, mpistat, mpierr)
rec-1, 2000+rec, mpi_comm_world, mpistat, mpierr)
dummy_out = reshape(go2, (/lon_out,lat_out,lev/))
error = nf90_inq_varid(ncid_out, 'v_inc', id_var)
call netcdf_err(error, 'inquiring v_inc id for file='//trim(outfile) )
Expand All @@ -435,7 +435,7 @@ program interp_inc
! Update remaining output file records according to Cory's sample.
!------------------------------------------------------------------

if (mype == 0) then
if (mype == npes-1) then
print*,"- WRITE OUTPUT FILE: ", trim(outfile)

! lev
Expand Down Expand Up @@ -490,9 +490,9 @@ program interp_inc
end if

call mpi_barrier(mpi_comm_world, mpierr)
if (mype == 0) print*,'- NORMAL TERMINATION'
if (mype == npes-1) print*,'- NORMAL TERMINATION'

if (mype == 0) call w3tage('INTERP_INC')
if (mype == npes-1) call w3tage('INTERP_INC')
call mpi_barrier(mpi_comm_world, mpierr)
call mpi_finalize(mpierr)

Expand Down

0 comments on commit 4bd8521

Please sign in to comment.