E3SM-Project / scorpio

A high-level Parallel I/O Library for structured grid applications
19 stars 16 forks source link

SCREAM build error with updated Fortran interface of SCORPIO #526

Open dqwu opened 1 year ago

dqwu commented 1 year ago

Steps to reproduce this issue on Perlmutter

git clone https://github.com/E3SM-Project/scream.git
cd scream
git submodule update --init --recursive

cd externals/scorpio
git fetch origin
git checkout master

cd ../../cime/scripts
./create_newcase --machine pm-cpu --case F2010-SCREAMv1-DYAMOND2_ne4pg2_ne4pg2 --compset F2010-SCREAMv1-DYAMOND2 --res ne4pg2_ne4pg2

cd F2010-SCREAMv1-DYAMOND2_ne4pg2_ne4pg2

./case.setup

./case.build

Build error

scream/components/eamxx/src/share/io/scream_scorpio_interface.F90:50:7:
   50 |   use pio_nf,       only: PIO_enddef, PIO_inq_dimid, PIO_inq_dimlen, PIO_inq_varid, &
      |       1
Fatal Error: Cannot open module file 'pio_nf.mod' for reading at (1): No such file or directory
compilation terminated.

Need to decide whether this build error should be fixed on SCORPIO side or on SCREAM side.

jayeshkrishna commented 1 year ago

Does the code work if you change the module included to pio (if so, that should be the fix for this issue)?

use pio,       only: PIO_enddef, PIO_inq_dimid, PIO_inq_dimlen, PIO_inq_varid, &
dqwu commented 1 year ago

Does the code work if you change the module included to pio (if so, that should be the fix for this issue)?

use pio,       only: PIO_enddef, PIO_inq_dimid, PIO_inq_dimlen, PIO_inq_varid, &

With this fix, a new build error is

scream/components/eamxx/src/share/io/scream_scorpio_interface.F90:52:7:

   52 |   use pionfatt_mod, only: PIO_put_att   => put_att
      |       1 
Fatal Error: Cannot open module file 'pionfatt_mod.mod' for reading at (1): No such file or directory
jayeshkrishna commented 1 year ago

All of the pio functions should be available via the pio module, so all these statements should use "use pio" instead

dqwu commented 1 year ago

All of the pio functions should be available via the pio module, so all these statements should use "use pio" instead

put_att not found in the pio module.

scream/components/eamxx/src/share/io/scream_scorpio_interface.F90:52:16:

   52 |   use pio, only: PIO_put_att   => put_att
      |                1
Error: Symbol 'put_att' referenced at (1) not found in module 'pio'
dqwu commented 10 months ago

@jayeshkrishna Your scream branch jayeshkrishna/eamxx/rm_old_pio_mods can fix this issue. That branch also works with the default scorpio module (release 1.4.1).