Hi all,
I don't know if my problem is faced by the others.
I already used roms during this 6months and get the .nc file as a result.
Until 2 days ago, I updated Ubuntu to 20.04. and when I try to run
./build_roms.sh, I get a notification:
"mod_netcdf.f90:19:10:
19 | USE netcdf
1
Fatal error: Cannot read module file 'netcdf.mod' opened at (1), because it
was created by a different version of GNU fortran.
Compilation terminated."
and this problem, I never experienced before updating ubuntu.
here is the version of my netcdf and gfortran.
nc-config --version : netCDF 4.7.4
gfortran --version: GNU Fortran (Ubuntu 9.3.0-17ubuntu~20.04) 9.3.0
does anyone have a solution to my problem? or do I have to downgrade the
version of gfortran?
Thanks before.
Luh
Fatal erorr after update to ubuntu 20.04
Re: Fatal erorr after update to ubuntu 20.04
What I would do is recompile netcdf-fortran. Did you compile it yourself before or use the one from "apt install"?
Re: Fatal erorr after update to ubuntu 20.04
During the upgrade to ubuntu 20.04 the GNU Compilier Suite was likely upgraded to version 9.3. Assuming you built NetCDF 4.7.4 yourself, your options are: build NetCDF again with the new compiler, downgrade the compiler, or install the libnetcdff-dev and netcdf-bin packages (this will also install a host of other required software and will also recommend some other packages you might want to install) available from Ubuntu. The last option would technically be a downgrade of NetCDF (4.7.4 -> 4.7.3).
For the downgrading option, since it's UBUNTU, it's likely that your previous version of the compiler is still installed. Try running and see if your previous version of gfortran is listed. If it is you can update your /usr/bin/gfortran link to the gfortran version you need. First see what "alternatives" are setup with "update-alternatives --query gfortran". You should see some output like this:
You will then want to issue the following command using a number higher than the "Priority" listed for gfortran-9 (replacing gfortran-8 with your previous version):
Even if your previous version is not listed as an "Alternative", as long as it was listed with that ls command, the above command should work.
For the downgrading option, since it's UBUNTU, it's likely that your previous version of the compiler is still installed. Try running
Code: Select all
ls -l /usr/bin/gfortran*
Code: Select all
$ update-alternatives --query gfortran
Name: gfortran
Link: /usr/bin/gfortran
Status: auto
Best: /usr/bin/gfortran-9
Value: /usr/bin/gfortran-9
Alternative: /usr/bin/gfortran-8
Priority: 50
Alternative: /usr/bin/gfortran-9
Priority: 60
Code: Select all
sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-8 70