Coherens Installation From Clean Ubuntu 16.04 LTS

If you are a new user, please take a look at this thread. All questions related to the download of the COHERENS code, the installation and how to run the pre-installed test cases are to be posted here. Experienced users are also encouraged to take a look at this forum to help newbies.

Moderator: Katrijn

Post Reply
ramadhan_hani
Posts: 4
Joined: Wed Jan 03, 2018 10:30 am
Full name: Hani Ramadhan

Coherens Installation From Clean Ubuntu 16.04 LTS

Post by ramadhan_hani » Wed Jan 03, 2018 10:37 am

Dear all,

I am a newbie in linux system and don't know too much about how to compile a source code. Would anyone please to make an instruction step by step to install coherens in a new clean ubuntu 16.04 LTS system including installation of libraries needed like NetCDF, etc. :)
I prefer to use gfortran as my compiler.

thank you very much... :)

Best regards,

Hani Ramadhan

Katrijn
Posts: 86
Joined: Fri Nov 29, 2013 3:04 pm
Full name: Katrijn Baetens

Re: Coherens Installation From Clean Ubuntu 16.04 LTS

Post by Katrijn » Tue Jan 09, 2018 8:45 am

Dear Hani,
Did you check out the manual for dummies? If this is not sufficient, please let me know at which step you are struggling. https://odnature.naturalsciences.be/coh ... troduction

I can already tell you that besides unzipping the file, you don't need to do anything special to install it. Make sure netcdf, gcc and g++ are installed properly and you should be good to go.

Have fun!
Katrijn

ramadhan_hani
Posts: 4
Joined: Wed Jan 03, 2018 10:30 am
Full name: Hani Ramadhan

Re: Coherens Installation From Clean Ubuntu 16.04 LTS

Post by ramadhan_hani » Sat Jan 20, 2018 5:41 am

Dear Katrijn,

Thanks a lot for your response.. This is my condition:

1. I have installed netcdf_4.4 in directory:
/home/hani/Downloads/libraries
(I have installed netcdf before, as a library for other model, and it works)

2. Then I extract coherensV2.7.tar.gz to
/home/hani/Documents

3. I make a folder and
cd /home/hani/models/work

4. ln -s /home/hani/Documents/V2.7 COHERENS

5. COHERENS/install_test

6. make linux-gfort
and it shows fatal error = Can't open module file ‘netcdf.mod’ for reading at (1): No such file or directory

7. so I change coherensflags.cmp and insert my netcdf_44 directory:

# netCDF directory path
NETCDF_PATH = /home/hani/Downloads/libraries/netcdf_4.4

# netCDF library file
NETCDF_LIB_FILE = netcdf

# netCDF include options
FCIFLAGS_NETCDF = -I$(NETCDF_PATH)/include

# netCDF library options
#FLIBS_NETCDF = -L$(NETCDF_PATH)/lib -l$(NETCDF_LIB_FILE)

8. then I tried again make linux-gfort
9. and it shows another error message like this:

collect2: error: ld returned 1 exit status
Makefile:87: recipe for target 'coherens' failed
make[1]: *** [coherens] Error 1
make[1]: Leaving directory '/home/hani/models/work'
COHERENS/code/physics/comps/compilers.cmp:44: recipe for target 'linux-gfort' failed
make: *** [linux-gfort] Error 2

That's my problem, I need some suggestions, thank you for your help..

Best regards

Katrijn
Posts: 86
Joined: Fri Nov 29, 2013 3:04 pm
Full name: Katrijn Baetens

Re: Coherens Installation From Clean Ubuntu 16.04 LTS

Post by Katrijn » Sat Jan 20, 2018 4:51 pm

Hi Hani,
I think you did not install a test case, so the program lacks some user defined input, to install the bohai test case:
COHERENS/install_test -t bohai
Make sure to double check the coherensflags files, cause after each install_test command it gets overwritten. Before running the program check what files are added, these are typically the ones you as a user need to change.
Hope it works out,
Kat

ramadhan_hani
Posts: 4
Joined: Wed Jan 03, 2018 10:30 am
Full name: Hani Ramadhan

Re: Coherens Installation From Clean Ubuntu 16.04 LTS

Post by ramadhan_hani » Thu Mar 01, 2018 2:12 am

Dear Katrijn,

Thanks a lot for your help. I have tried to install the test case
COHERENS/install_test -t bohai
but I still can't make the executable file. I use ubuntu 16.04 and want to build coherens with gfortran compiler. I also show my terminal log, my nc-config, compilers.cmp and coherensflag.cmp.
Hopefully, you can help me. Thank you very much.

Best regards.

hani@hani-K42F:~/models/work$ ln -s /home/hani/Documents/V2.7 COHERENS
hani@hani-K42F:~/models/work$ COHERENS/install_test -t bohai
hani@hani-K42F:~/models/work$ make linux-gfort

make coherens "FC=gfortran" "FCOPTS= -O3" "FCDEFS=" "FCDEBUG=" \
"CPP=" "CPPF=cpp" "CPPOPTS=-traditional-cpp" "CPPDEFS=-DALLOC -DCDF"
make[1]: Entering directory '/home/hani/models/work'
gfortran -I//include -O3 -c cf90_routines.f90 -o cf90_routines.o
cpp -traditional-cpp -DALLOC -DCDF COHERENS/code/physics/source/math_library.F90 ./math_library.f90
gfortran -I//include -O3 -c ./math_library.f90 -o math_library.o
cpp -traditional-cpp -DALLOC -DCDF COHERENS/code/physics/source/comms_MPI.F90 ./comms_MPI.f90
gfortran -I//include -O3 -c ./comms_MPI.f90 -o comms_MPI.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/paral_comms.f90 -o paral_comms.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/grid_routines.f90 -o grid_routines.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/paral_utilities.f90 -o paral_utilities.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/check_model.f90 -o check_model.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/cif_routines.f90 -o cif_routines.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/default_model.f90 -o default_model.o
cpp -traditional-cpp -DALLOC -DCDF COHERENS/code/physics/source/diagnostic_routines.F90 ./diagnostic_routines.f90
gfortran -I//include -O3 -c ./diagnostic_routines.f90 -o diagnostic_routines.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/fft_library.f90 -o fft_library.o
cpp -traditional-cpp -DALLOC -DCDF COHERENS/code/physics/source/grid_interp.F90 ./grid_interp.f90
gfortran -I//include -O3 -c ./grid_interp.f90 -o grid_interp.o
cpp -traditional-cpp -DALLOC -DCDF COHERENS/code/physics/source/reset_model.F90 ./reset_model.f90
gfortran -I//include -O3 -c ./reset_model.f90 -o reset_model.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/inout_routines.f90 -o inout_routines.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/inout_paral.f90 -o inout_paral.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/biology_output.f90 -o biology_output.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/sediment_output.f90 -o sediment_output.o
cpp -traditional-cpp -DALLOC -DCDF COHERENS/code/physics/source/turbulence_routines.F90 ./turbulence_routines.f90
gfortran -I//include -O3 -c ./turbulence_routines.f90 -o turbulence_routines.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/model_output.f90 -o model_output.o
cpp -traditional-cpp -DALLOC -DCDF COHERENS/code/physics/source/nla_library.F90 ./nla_library.f90
gfortran -I//include -O3 -c ./nla_library.f90 -o nla_library.o
cpp -traditional-cpp -DALLOC -DCDF COHERENS/code/physics/source/petsc_routines.F90 ./petsc_routines.f90
gfortran -I//include -O3 -c ./petsc_routines.f90 -o petsc_routines.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/rng_library.f90 -o rng_library.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/check_sediments.f90 -o check_sediments.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/default_sediments.f90 -o default_sediments.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/reset_sediments.f90 -o reset_sediments.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/check_biology.f90 -o check_biology.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/default_biology.f90 -o default_biology.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/reset_biology.f90 -o reset_biology.o
cpp -traditional-cpp -DALLOC -DCDF COHERENS/code/physics/source/Advection_Terms.F90 ./Advection_Terms.f90
gfortran -I//include -O3 -c ./Advection_Terms.f90 -o Advection_Terms.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/Allocate_Arrays.f90 -o Allocate_Arrays.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/Bottom_Fluxes.f90 -o Bottom_Fluxes.o
cpp -traditional-cpp -DALLOC -DCDF COHERENS/code/physics/source/Corrector_Terms.F90 ./Corrector_Terms.f90
gfortran -I//include -O3 -c ./Corrector_Terms.f90 -o Corrector_Terms.o
cpp -traditional-cpp -DALLOC -DCDF COHERENS/code/physics/source/Density_Equations.F90 ./Density_Equations.f90
gfortran -I//include -O3 -c ./Density_Equations.f90 -o Density_Equations.o
cpp -traditional-cpp -DALLOC -DCDF COHERENS/code/physics/source/Diffusion_Coefficients.F90 ./Diffusion_Coefficients.f90
gfortran -I//include -O3 -c ./Diffusion_Coefficients.f90 -o Diffusion_Coefficients.o
cpp -traditional-cpp -DALLOC -DCDF COHERENS/code/physics/source/Diffusion_Terms.F90 ./Diffusion_Terms.f90
gfortran -I//include -O3 -c ./Diffusion_Terms.f90 -o Diffusion_Terms.o
cpp -traditional-cpp -DALLOC -DCDF COHERENS/code/physics/source/Grid_Arrays.F90 ./Grid_Arrays.f90
gfortran -I//include -O3 -c ./Grid_Arrays.f90 -o Grid_Arrays.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/Harmonic_Analysis.f90 -o Harmonic_Analysis.o
cpp -traditional-cpp -DALLOC -DCDF COHERENS/code/physics/source/Hydrodynamic_Equations.F90 ./Hydrodynamic_Equations.f90
gfortran -I//include -O3 -c ./Hydrodynamic_Equations.f90 -o Hydrodynamic_Equations.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/Inundation_Schemes.f90 -o Inundation_Schemes.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/Model_Finalisation.f90 -o Model_Finalisation.o
cpp -traditional-cpp -DALLOC -DCDF COHERENS/code/physics/source/Model_Initialisation.F90 ./Model_Initialisation.f90
gfortran -I//include -O3 -c ./Model_Initialisation.f90 -o Model_Initialisation.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/Model_Parameters.f90 -o Model_Parameters.o
cpp -traditional-cpp -DALLOC -DCDF COHERENS/code/physics/source/Nested_Grids.F90 ./Nested_Grids.f90
gfortran -I//include -O3 -c ./Nested_Grids.f90 -o Nested_Grids.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/Open_Boundary_Conditions.f90 -o Open_Boundary_Conditions.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/Open_Boundary_Data_2D.f90 -o Open_Boundary_Data_2D.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/Open_Boundary_Data_Prof.f90 -o Open_Boundary_Data_Prof.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/Parallel_Initialisation.f90 -o Parallel_Initialisation.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/Relaxation_Zones.f90 -o Relaxation_Zones.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/Structures_Model.f90 -o Structures_Model.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/Surface_Boundary_Data_1D.f90 -o Surface_Boundary_Data_1D.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/Surface_Data.f90 -o Surface_Data.o
cpp -traditional-cpp -DALLOC -DCDF COHERENS/code/physics/source/Surface_Fluxes.F90 ./Surface_Fluxes.f90
gfortran -I//include -O3 -c ./Surface_Fluxes.f90 -o Surface_Fluxes.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/Surface_Grids.f90 -o Surface_Grids.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/Surface_Waves.f90 -o Surface_Waves.o
cpp -traditional-cpp -DALLOC -DCDF COHERENS/code/physics/source/Tidal_Forcing.F90 ./Tidal_Forcing.f90
gfortran -I//include -O3 -c ./Tidal_Forcing.f90 -o Tidal_Forcing.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/Time_Averages.f90 -o Time_Averages.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/Time_Series.f90 -o Time_Series.o
cpp -traditional-cpp -DALLOC -DCDF COHERENS/code/physics/source/Transport_Equations.F90 ./Transport_Equations.f90
gfortran -I//include -O3 -c ./Transport_Equations.f90 -o Transport_Equations.o
cpp -traditional-cpp -DALLOC -DCDF COHERENS/code/physics/source/Turbulence_Equations.F90 ./Turbulence_Equations.f90
gfortran -I//include -O3 -c ./Turbulence_Equations.f90 -o Turbulence_Equations.o
gfortran -I//include -O3 -c Usrdef_Harmonic_Analysis.f90 -o Usrdef_Harmonic_Analysis.o
gfortran -I//include -O3 -c Usrdef_Model.f90 -o Usrdef_Model.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/Usrdef_Nested_Grids.f90 -o Usrdef_Nested_Grids.o
gfortran -I//include -O3 -c Usrdef_Output.f90 -o Usrdef_Output.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/Usrdef_Structures.f90 -o Usrdef_Structures.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/Usrdef_Surface_Data.f90 -o Usrdef_Surface_Data.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/Usrdef_Time_Averages.f90 -o Usrdef_Time_Averages.o
gfortran -I//include -O3 -c Usrdef_Time_Series.f90 -o Usrdef_Time_Series.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/Sediment_Model.f90 -o Sediment_Model.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/Usrdef_Sediment.f90 -o Usrdef_Sediment.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/Biological_Model.f90 -o Biological_Model.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/Usrdef_Biology.f90 -o Usrdef_Biology.o
gfortran -I//include -O3 -c COHERENS/code/physics/source/Coherens_Program.f90 -o Coherens_Program.o
gfortran -I//include -O3 -o coherens currents.o datatypes.o density.o depths.o diffusion.o fluxes.o grid.o gridpars.o iopars.o meteo.o modids.o nestgrids.o obconds.o optics.o paralpars.o physpars.o relaxation.o structures.o switches.o syspars.o tide.o timepars.o turbpars.o turbulence.o waves.o array_interp.o cf90_routines.o check_model.o cif_routines.o comms_MPI.o datatypes_init.o default_model.o diagnostic_routines.o error_routines.o fft_library.o grid_interp.o grid_routines.o inout_paral.o inout_routines.o math_library.o model_output.o modvars_routines.o nla_library.o paral_comms.o paral_utilities.o petsc_routines.o reset_model.o rng_library.o time_routines.o turbulence_routines.o utility_routines.o check_sediments.o default_sediments.o reset_sediments.o sediment_output.o sedvars_routines.o biology_output.o biovars_routines.o check_biology.o default_biology.o reset_biology.o Advection_Terms.o Allocate_Arrays.o Bottom_Fluxes.o Corrector_Terms.o Density_Equations.o Diffusion_Coefficients.o Diffusion_Terms.o Grid_Arrays.o Harmonic_Analysis.o Hydrodynamic_Equations.o Inundation_Schemes.o Model_Finalisation.o Model_Initialisation.o Model_Parameters.o Nested_Grids.o Open_Boundary_Conditions.o Open_Boundary_Data_2D.o Open_Boundary_Data_Prof.o Parallel_Initialisation.o Relaxation_Zones.o Structures_Model.o Surface_Boundary_Data_1D.o Surface_Data.o Surface_Fluxes.o Surface_Grids.o Surface_Waves.o Tidal_Forcing.o Time_Averages.o Time_Series.o Transport_Equations.o Turbulence_Equations.o Usrdef_Harmonic_Analysis.o Usrdef_Model.o Usrdef_Nested_Grids.o Usrdef_Output.o Usrdef_Structures.o Usrdef_Surface_Data.o Usrdef_Time_Averages.o Usrdef_Time_Series.o Sediment_Model.o Usrdef_Sediment.o Biological_Model.o Usrdef_Biology.o \
Coherens_Program.o
cf90_routines.o: In function `__cf90_routines_MOD_cf90_inq_libvers':
cf90_routines.f90:(.text+0x11): undefined reference to `__netcdf_MOD_nf90_inq_libvers'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_error':
cf90_routines.f90:(.text+0x1f5): undefined reference to `__netcdf_MOD_nf90_strerror'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_sync':
cf90_routines.f90:(.text+0x307): undefined reference to `__netcdf_MOD_nf90_sync'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_set_fill':
cf90_routines.f90:(.text+0x3d6): undefined reference to `__netcdf_MOD_nf90_set_fill'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_rename_var':
cf90_routines.f90:(.text+0x4b2): undefined reference to `__netcdf_MOD_nf90_rename_var'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_rename_dim':
cf90_routines.f90:(.text+0x592): undefined reference to `__netcdf_MOD_nf90_rename_dim'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_rename_att':
cf90_routines.f90:(.text+0x682): undefined reference to `__netcdf_MOD_nf90_rename_att'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_redef':
cf90_routines.f90:(.text+0x757): undefined reference to `__netcdf_MOD_nf90_redef'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_put_var_real_4d':
cf90_routines.f90:(.text+0xba6): undefined reference to `__netcdf_MOD_nf90_put_var_4d_fourbytereal'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_put_var_real_3d':
cf90_routines.f90:(.text+0x126e): undefined reference to `__netcdf_MOD_nf90_put_var_3d_fourbytereal'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_put_var_real_2d':
cf90_routines.f90:(.text+0x17ea): undefined reference to `__netcdf_MOD_nf90_put_var_2d_fourbytereal'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_put_var_real_1d':
cf90_routines.f90:(.text+0x1ca0): undefined reference to `__netcdf_MOD_nf90_put_var_1d_fourbytereal'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_put_var_real_0d':
cf90_routines.f90:(.text+0x1f93): undefined reference to `__netcdf_MOD_nf90_put_var_fourbytereal'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_put_var_int_4d':
cf90_routines.f90:(.text+0x23e6): undefined reference to `__netcdf_MOD_nf90_put_var_4d_fourbyteint'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_put_var_int_3d':
cf90_routines.f90:(.text+0x2aae): undefined reference to `__netcdf_MOD_nf90_put_var_3d_fourbyteint'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_put_var_int_2d':
cf90_routines.f90:(.text+0x302a): undefined reference to `__netcdf_MOD_nf90_put_var_2d_fourbyteint'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_put_var_int_1d':
cf90_routines.f90:(.text+0x34e0): undefined reference to `__netcdf_MOD_nf90_put_var_1d_fourbyteint'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_put_var_int_0d':
cf90_routines.f90:(.text+0x37d3): undefined reference to `__netcdf_MOD_nf90_put_var_fourbyteint'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_put_var_chars':
cf90_routines.f90:(.text+0x3949): undefined reference to `__netcdf_MOD_nf90_put_var_text'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_put_att_real_1d':
cf90_routines.f90:(.text+0x3af9): undefined reference to `__netcdf_MOD_nf90_put_att_fourbytereal'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_put_att_real_0d':
cf90_routines.f90:(.text+0x3c06): undefined reference to `__netcdf_MOD_nf90_put_att_one_fourbytereal'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_put_att_int_1d':
cf90_routines.f90:(.text+0x3d39): undefined reference to `__netcdf_MOD_nf90_put_att_fourbyteint'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_put_att_int_0d':
cf90_routines.f90:(.text+0x3e46): undefined reference to `__netcdf_MOD_nf90_put_att_one_fourbyteint'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_put_att_chars_1d':
cf90_routines.f90:(.text+0x4051): undefined reference to `__netcdf_MOD_nf90_put_att_text'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_put_att_chars_0d':
cf90_routines.f90:(.text+0x415b): undefined reference to `__netcdf_MOD_nf90_put_att_text'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_open':
cf90_routines.f90:(.text+0x4268): undefined reference to `__netcdf_MOD_nf90_open'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_inquire_variable':
cf90_routines.f90:(.text+0x4433): undefined reference to `__netcdf_MOD_nf90_inquire_variable'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_inquire_dimension':
cf90_routines.f90:(.text+0x4560): undefined reference to `__netcdf_MOD_nf90_inquire_dimension'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_inquire_attribute':
cf90_routines.f90:(.text+0x465f): undefined reference to `__netcdf_MOD_nf90_inquire_attribute'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_inquire':
cf90_routines.f90:(.text+0x4759): undefined reference to `__netcdf_MOD_nf90_inquire'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_inq_varid':
cf90_routines.f90:(.text+0x4842): undefined reference to `__netcdf_MOD_nf90_inq_varid'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_inq_dimid':
cf90_routines.f90:(.text+0x4922): undefined reference to `__netcdf_MOD_nf90_inq_dimid'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_inq_attname':
cf90_routines.f90:(.text+0x4a06): undefined reference to `__netcdf_MOD_nf90_inq_attname'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_get_var_real_4d':
cf90_routines.f90:(.text+0x4e56): undefined reference to `__netcdf_MOD_nf90_get_var_4d_fourbytereal'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_get_var_real_3d':
cf90_routines.f90:(.text+0x551e): undefined reference to `__netcdf_MOD_nf90_get_var_3d_fourbytereal'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_get_var_real_2d':
cf90_routines.f90:(.text+0x5a9a): undefined reference to `__netcdf_MOD_nf90_get_var_2d_fourbytereal'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_get_var_real_1d':
cf90_routines.f90:(.text+0x5f50): undefined reference to `__netcdf_MOD_nf90_get_var_1d_fourbytereal'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_get_var_real_0d':
cf90_routines.f90:(.text+0x6243): undefined reference to `__netcdf_MOD_nf90_get_var_fourbytereal'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_get_var_int_4d':
cf90_routines.f90:(.text+0x6696): undefined reference to `__netcdf_MOD_nf90_get_var_4d_fourbyteint'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_get_var_int_3d':
cf90_routines.f90:(.text+0x6d5e): undefined reference to `__netcdf_MOD_nf90_get_var_3d_fourbyteint'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_get_var_int_2d':
cf90_routines.f90:(.text+0x72da): undefined reference to `__netcdf_MOD_nf90_get_var_2d_fourbyteint'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_get_var_int_1d':
cf90_routines.f90:(.text+0x7790): undefined reference to `__netcdf_MOD_nf90_get_var_1d_fourbyteint'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_get_var_int_0d':
cf90_routines.f90:(.text+0x7a83): undefined reference to `__netcdf_MOD_nf90_get_var_fourbyteint'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_get_var_chars':
cf90_routines.f90:(.text+0x7bf9): undefined reference to `__netcdf_MOD_nf90_get_var_text'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_get_att_real_1d':
cf90_routines.f90:(.text+0x7da9): undefined reference to `__netcdf_MOD_nf90_get_att_fourbytereal'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_get_att_real_0d':
cf90_routines.f90:(.text+0x7eb6): undefined reference to `__netcdf_MOD_nf90_get_att_one_fourbytereal'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_get_att_int_1d':
cf90_routines.f90:(.text+0x7fe9): undefined reference to `__netcdf_MOD_nf90_get_att_fourbyteint'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_get_att_int_0d':
cf90_routines.f90:(.text+0x80f6): undefined reference to `__netcdf_MOD_nf90_get_att_one_fourbyteint'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_get_att_chars_1d':
cf90_routines.f90:(.text+0x824a): undefined reference to `__netcdf_MOD_nf90_get_att_text'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_get_att_chars_0d':
cf90_routines.f90:(.text+0x83fb): undefined reference to `__netcdf_MOD_nf90_get_att_text'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_enddef':
cf90_routines.f90:(.text+0x8530): undefined reference to `__netcdf_MOD_nf90_enddef'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_del_att':
cf90_routines.f90:(.text+0x8662): undefined reference to `__netcdf_MOD_nf90_del_att'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_def_var':
cf90_routines.f90:(.text+0x87bb): undefined reference to `__netcdf_MOD_nf90_def_var_manydims'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_def_dim':
cf90_routines.f90:(.text+0x88c6): undefined reference to `__netcdf_MOD_nf90_def_dim'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_create':
cf90_routines.f90:(.text+0x89e5): undefined reference to `__netcdf_MOD_nf90_create'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_copy_att':
cf90_routines.f90:(.text+0x8b02): undefined reference to `__netcdf_MOD_nf90_copy_att'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_close':
cf90_routines.f90:(.text+0x8bd7): undefined reference to `__netcdf_MOD_nf90_close'
cf90_routines.o: In function `__cf90_routines_MOD_cf90_abort':
cf90_routines.f90:(.text+0x8c97): undefined reference to `__netcdf_MOD_nf90_abort'
collect2: error: ld returned 1 exit status
Makefile:87: recipe for target 'coherens' failed
make[1]: *** [coherens] Error 1
make[1]: Leaving directory '/home/hani/models/work'
COHERENS/code/physics/comps/compilers.cmp:44: recipe for target 'linux-gfort' failed
make: *** [linux-gfort] Error 2
hani@hani-K42F:~/models/work$


hani@hani-K42F:~/models/work$ nc-config --all

This netCDF 4.1.3 has been built with the following features:

--cc -> gcc
--cflags -> -I/include -I/include
--libs -> -L/lib -lnetcdf

--cxx -> g++
--has-c++ -> yes

--fc -> gfortran
--fflags -> -g -O2 -I/include
--flibs -> -L/lib -lnetcdff -lnetcdf
--has-f77 -> yes
--has-f90 -> yes

--has-dap -> yes
--has-nc2 -> yes
--has-nc4 -> yes
--has-hdf5 -> yes
--has-hdf4 -> no
--has-pnetcdf-> no
--has-szlib ->

--prefix ->
--includedir-> /include
--version -> netCDF 4.1.3

this is my netcdf configuration in coherensflags.cmp

# netCDF directory path
NETCDF_PATH = /

# netCDF library file
NETCDF_LIB_FILE = netcdf

# netCDF include options
FCIFLAGS_NETCDF = -I$(NETCDF_PATH)/include

# netCDF library options
#FLIBS_NETCDF = -L$(NETCDF_PATH)/lib -l$(NETCDF_LIB_FILE)

this is compilers.cmp configuration for linux-gfort

# Linux gfortran (GNU Fortran)
linux-gfort:
$(MAKE) $(EXEFILE) "FC=gfortran" "FCOPTS= -O3" "FCDEFS=" "FCDEBUG=" \
"CPP=" "CPPF=cpp" "CPPOPTS=-traditional-cpp" "CPPDEFS=$(CPPDFLAGS)"

I have searched and found that cpp preprocessing option gone in this page https://gcc.gnu.org/bugzilla/show_bug.cgi?id=18428 .

Katrijn
Posts: 86
Joined: Fri Nov 29, 2013 3:04 pm
Full name: Katrijn Baetens

Re: Coherens Installation From Clean Ubuntu 16.04 LTS

Post by Katrijn » Thu Mar 01, 2018 9:43 am

Dear Hani,
This indeed is a netcdf problem. The only thing I find peculiar is that your netcdf directory or NETCDF_PATH = /, because typically this is installed under /usr of /usr/local. So I recommend that you double check if your netcdf files are indeed installed under /lib and /include. But for the rest it seems like you did nothing wrong.

I recommend the following document I use in case of netCDF problems: https://share.naturalsciences.be/f/cdfb ... b19f/?dl=1
We use version 4.3.0 of netCDF

Hope this helps,

Katrijn

ropponen
Posts: 7
Joined: Thu Dec 04, 2014 11:45 am
Full name: Janne Ropponen

Re: Coherens Installation From Clean Ubuntu 16.04 LTS

Post by ropponen » Fri Mar 02, 2018 12:00 pm

I just installed COHERENS V2.11 on Ubuntu 16.04.3 LTS and didn't have any major problems compiling.

I used the netCDF version available from the Ubuntu repository: sudo apt install netcdf-bin libnetcdf-dev libnetcdff-dev

And in my coherensflags.cmp I have:
FCIFLAGS_NETCDF = -I/usr/include
FLIBS_NETCDF = -L/usr/lib -lnetcdf -lnetcdff

Hope this helps.

ramadhan_hani
Posts: 4
Joined: Wed Jan 03, 2018 10:30 am
Full name: Hani Ramadhan

Re: Coherens Installation From Clean Ubuntu 16.04 LTS

Post by ramadhan_hani » Wed Mar 07, 2018 12:15 am

Dear Katrijn and Ropponen,

I’m so grateful for your help. It was a challenging time but you made it easier. Thank you.

Finally, I have managed to compile and produce the coherens 2.7 executable file. I fixed net-cdf installation by running

sudo apt install netcdf-bin libnetcdf-dev libnetcdff-dev

Then, I try to run test case river by following instructions from the User Guide. I have editted the defruns as below:

river0A,W,
river1A,W,
!river0B,,
!river1B,,
!river0C,,
!river1C,,
!river0D,,
!river1D,,

When I try to execute Run file by typing ./Run &, I got this message:

hani@hani-K42F:~/Documents/Kuliah_S2/River2.7$ ./Run &
[1] 3563
hani@hani-K42F:~/Documents/Kuliah_S2/River2.7$ Note: The following floating-point exceptions are signalling: IEEE_DENORMAL
0.01user 0.01system 0:00.03elapsed 96%CPU (0avgtext+0avgdata 16028maxresident)k
0inputs+320outputs (0major+1583minor)pagefaults 0swaps

There is no message, Main Program Terminated and it didn't produce output file tsout...

I wonder if you could help me with this?

Best Regards.

Katrijn
Posts: 86
Joined: Fri Nov 29, 2013 3:04 pm
Full name: Katrijn Baetens

Re: Coherens Installation From Clean Ubuntu 16.04 LTS

Post by Katrijn » Mon Mar 19, 2018 10:23 am

Hi,

Sorry for late reply, did you have a look at *.errlog files? Are they empty?

Post Reply