test case - bad linking netcdf
Posted: Sun Jan 11, 2015 2:58 pm
Hi.... I am new to Coherens but not Fortran, Linux and netcdf. My machine is OSX 10.10 (Yosemite) and I have a working netcdf installed by MacPorts. I use ncview for a variety of model outputs.
When I compile the test case all goes well until link time. I get:
gfortran -I/opt/local/include -O0 -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 -L/opt/local/lib -lnetcdf \
Coherens_Program.o
Undefined symbols for architecture x86_64:
"___netcdf_MOD_nf90_abort", referenced from:
___cf90_routines_MOD_cf90_abort in cf90_routines.o
"___netcdf_MOD_nf90_close", referenced from:
___cf90_routines_MOD_cf90_close in cf90_routines.o
.... etc etc
Using gfortran 4.9.2. Any thoughts?
Many thanks
Dave
When I compile the test case all goes well until link time. I get:
gfortran -I/opt/local/include -O0 -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 -L/opt/local/lib -lnetcdf \
Coherens_Program.o
Undefined symbols for architecture x86_64:
"___netcdf_MOD_nf90_abort", referenced from:
___cf90_routines_MOD_cf90_abort in cf90_routines.o
"___netcdf_MOD_nf90_close", referenced from:
___cf90_routines_MOD_cf90_close in cf90_routines.o
.... etc etc
Using gfortran 4.9.2. Any thoughts?
Many thanks
Dave