Skip to content

cam-fv model_mod.nml has r8 which causes namelist error #1055

@hkershaw-brown

Description

@hkershaw-brown

cam-fv in model_mod.nml

has an _r8 on the number

perturbation_amplitude = 0.0_r8

If you use this in an input.nml, you get an namelist error.

What is cool, is that with gfortran you get this error about the line below

ERROR FROM:
  source : utilities_mod.f90
  routine: check_namelist_read
  message:  INVALID NAMELIST ENTRY:    using_chemistry                     = .false. in namelist camfv_model_nml

If you don't use the dart namelist tools you get the message about r8,

[hkershaw:namelistbugs]() > cat input.nml 
&mylist
 i =42,
 x =  3.14000010_r8,
 NAME ="example",
 /
[hkershaw:namelistbugs]() > cat test_namelist.f90
program test_namelist
  implicit none

  integer, parameter :: r8 = SELECTED_REAL_KIND(12)
  integer :: i
  real(kind=r8) :: x
  character(len=20) :: name
  
  namelist /mylist/ i, x, name

  open(unit=10, file='input.nml', status='old')
  read(10, nml=mylist)
  close(10)

  print *, 'i = ', i
  print *, 'x = ', x
  print *, 'name = ', name

end program test_namelist

[hkershaw:namelistbugs]() > gfortran test_namelist.f90 
[hkershaw:namelistbugs]() > ./a.out 
At line 12 of file test_namelist.f90 (unit = 10, file = 'input.nml')
Fortran runtime error: Cannot match namelist object name _r8

So it looks this particular error (stuffing an _r8 on the end) is tripping up the backspace in gfortran, like #578 (intel), but does not trip up with the reproducer as in #578.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions