Compilation issue: yaml_parser.f90

Discussion on computers, ROMS installation and compiling

Moderators: arango, robertson

Post Reply
Message
Author
yanjie
Posts: 1
Joined: Wed Feb 22, 2023 6:59 pm
Location: Institute of Oceanology, Chinese Academy of Scienc

Compilation issue: yaml_parser.f90

#1 Unread post by yanjie »

Hi I am new to ROMS. when I tried to compile the upwelling case, I encountered the following problems:

yaml_parser.f90(1595): error #6582: A dummy argument which has the OPTIONAL or the INTENT(OUT) attribute is not allowed in this specification expression. [LSTR]
allocate ( character(LEN=Lstr) :: OutString, STAT=ErrFlag)
---------------------------------^
yaml_parser.f90(1598): error #6582: A dummy argument which has the OPTIONAL or the INTENT(OUT) attribute is not allowed in this specification expression. [LSTR]
allocate ( character(LEN=Lstr) :: OutString, STAT=ErrFlag)
---------------------------------^
compilation aborted for yaml_parser.f90 (code 1)
make: *** [/data/yanjie/ROMS_Projects/upwelling/Build_roms/yaml_parser.o] Error 1

My compiler version is Intel-fortran2013,openmpi version is openmpi1.8.I'm not sure exactly where the problem is. I hope you can help me,Thanks
I

User avatar
arango
Site Admin
Posts: 1368
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

Re: Compilation issue: yaml_parser.f90

#2 Unread post by arango »

Your compiler is too old and does not support 2003 and 2008 updates to the Fortran standard. Need to use a newer version of the ifort compiler or a recent version of gfortran.

andersonsoares
Posts: 4
Joined: Wed Oct 18, 2017 5:53 pm
Location: Federal University of Rio de Janeiro, LAMCE- COPPE

Re: Compilation issue: yaml_parser.f90

#3 Unread post by andersonsoares »

I faced the same problem while trying to install the latest version of ROMS. As suggested by Arango, the best solution would be to have the latest version of gfortran or ifort. However, I made a small change in the code and it appeared to work ( :!: I ran only a test case by that time). Instead of 'character(LEN=Lstr)', use 'character(LEN_TRIM(InpString))' ......make this change in both lines of yaml_parser.f90

User avatar
arango
Site Admin
Posts: 1368
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

Re: Compilation issue: yaml_parser.f90

#4 Unread post by arango »

Yes, that's a possibility. But it is a bug in the gfortan compiler! It works for me. I'm using gfortran versions Red Hat 11.3.1-2 and MacPorts gcc11 11.3.0_5. It is telling us how crappy is the gfortran compiler, and the folks at GNU have not read or misinterpreted correctly Fortran 2003 standard and probably later additions to it (2008, 2015). I rechecked the standard, and the syntax in yaml_parser.F is correct. The issue is that the developer team at GNU picks and chooses parts of the standard and makes lazy shortcuts sometimes.

Post Reply