Hi everyone,
I faced the following error when executing the IOAPI2UAM Makefile during the process of building the MEGANv3.2 code:
How can I solve this issue? Thank you for any help in advance.
Reza
Hi everyone,
I faced the following error when executing the IOAPI2UAM Makefile during the process of building the MEGANv3.2 code:
How can I solve this issue? Thank you for any help in advance.
Reza
Please follow this guidance.
First:
search the forum for issues simllar to yours.
Search for MEGAN related issues.
follow the tips available from previous users, to see if it resolves your issue.
Note: MEGAN is a third party code, so please ALSO read the developer documentation and contact the developer directly.
After you have tried solving the issue on your own using tips from the community.
cd [your_local_git_repo]
git remote -v
git branch
If the code was not obtained from a git repository, please include version of the code you are using, and include a link of where the code was obtained.
module avail
module list
(if using modules, this will depend on what module you load in the above steps.)
for GNU compiler:
gcc --version
gfortran --version
For intel compiler
ifort --version
Thank you for your response and sorry for the lack of information in my post.
I searched previous posts for a report of a similar problem but couldn’t find a similar issue report.
The problem arises when executing the IOAPI2UAM makefile during the process of building the MEGANv3.2 code. I got the MEGANv3.2 codes from:
I use Ubuntu 20.04.2 LTS, and the system doesn’t use modules. Moreover, gcc version = 9.4.0 and gfortran version = 9.4.0.
This is appears to be an error with the formatting of the write statement.
My solution was to comment out line 165 and line 299, as they appear to be debugging statements.
Error message after running make using the gcc compiler and compiler options.
165 | write(*,‘(2(i,f))’) ibdate,btime,iedate,etime
| 1
Error: Nonnegative width required in format string at (1)
ioapi2uam.f:299:23:
299 | write(*,‘(a,2(i,f))’)'Writing ',ibdate,btime,iedate,etime
| 1
Error: Nonnegative width required in format string at (1)
make: *** [ioapi2uam.o] Error 1
Added a comment before line 165 and 299 as follows:
` write(*,'(/,A)')'Output period (start date/time & end date/time):'
c write(*,'(2(i,f))') ibdate,btime,iedate,etime
`
`
write(MUNIT) ibdate,btime,iedate,etime
c write(*,'(a,2(i,f))')'Writing ',ibdate,btime,iedate,etime
`
Then it compiled successfully.
Another option is to fix the format string.
Try changing the format string I
to Iw
where w
is a positive number.
https://pages.mtu.edu/~shene/COURSES/cs201/NOTES/chap05/format.html
@lizadams
Thank you for your suggestion. This solved the problem.