E3SM icon indicating copy to clipboard operation
E3SM copied to clipboard

SMS_R_Ld5.ne4_ne4.FSCM5A97.<machine>_<compiler>.eam-scm test writes unexpected area value with GNU compiler

Open dqwu opened this issue 2 years ago • 0 comments

This issue can be reproduced on chrysalis, cori-knl, and anlgce with GNU compiler. Intel compiler works as expected.

Steps to reproduce on chrysalis:

git clone https://github.com/E3SM-Project/E3SM.git
cd E3SM
git submodule update --init
cd cime/scripts
./create_test SMS_R_Ld5.ne4_ne4.FSCM5A97.chrysalis_gnu.eam-scm --walltime 00:02:00

Even though this test always passes on chrysalis, "ncdump -v area" on the output history file ****.eam.h0.1997-06-19-84585.nc shows: area = 7.58278475126327e-316 ;

For Intel compiler, the result is different on chrysalis: area = 0.00247318500831899 ;

[Variable infomation in the history file]

dimensions:
        ncol = 1 ;

variables:
        double area(ncol) ;
                area:long_name = "gll grid areas" ;

This single-value variable is set on line 676 of components/eam/src/dynamics/se/dyn_grid.F90

      area_scm(1) = 1.0_r8 / elem(1)%rspheremp(1,1)
      call cam_grid_attribute_register(trim(gridname), trim(areaname),   &
                                    'gll grid areas', trim(ncolname), area_scm)

A print of area_scm(1) shows that the assigned value is 2.473185008318995E-003 on chrysalis

The value is written to ****.eam.h0.1997-06-19-84585.nc with pio_put_var in line 2352 of components/eam/src/utils/cam_grid_support.F90 ierr = pio_put_var(File, attr%vardesc, attr%values)

For GNU compiler on chrysalis, a print of attr%values shows that the value retrieved from attr is now 7.5827847512632665E-316, instead of expected 2.473185008318995E-003

Not sure if this is an issue of GNU compiler or a possible bug of E3SM EAM model code.

dqwu avatar Apr 08 '22 19:04 dqwu