This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Hello, It appears that however the environmental variables are set is not being identified by the shell when you invoke `gfortran`; it appears that `$(NETCDF)/include` is being expanded to `/include`, suggesting that $(NETCDF) is blank at this time. What happens if you invoke the following? $ gfortran -o nc_read simple_xy_rd.f90 -I/home/oem/BUILD_WRF/LIBRARIES/netcdfexport/include Does it produce the same error? Or do you observe different behavior? -Ward > Sir, > > I am facing a problem while opening a netcdf file using fortran. Here below > is the error: > > > > > > > > > *(base) oem@oem-Inspiron-15-5501:~/IOD/sst$ gfortran -o nc_read > simple_xy_rd.f90 -I$(NETCDF)/includeNETCDF: command not foundf951: Warning: > Nonexistent include directory ‘/include’ > [-Wmissing-include-dirs]simple_xy_rd.f90:19:6: 19 | use netcdf | > 1Fatal Error: Cannot open module file ‘netcdf.mod’ for reading at (1): > No such file or directorycompilation terminated.* > > > *My system is Ubuntu 20.01* > *'netcdf.mod' is located in my system:* > > > > > > > *(base) oem@oem-Inspiron-15-5501:~/IOD/sst$ locate > netcdf.mod/home/oem/BUILD_WRF/LIBRARIES/netcdf/include/netcdf.mod/home/oem/BUILD_WRF/LIBRARIES/netcdf-4.1.3/f90/netcdf.mod/home/oem/miniconda3/envs/ncl_stable/include/netcdf.mod/home/oem/miniconda3/pkgs/netcdf-fortran-4.5.3-nompi_hfef6a68_100/include/netcdf.mod/netcdf/include/netcdf.mod* > > *Here is the details of env variables:* > > > > > > > > > > > > > > > > *export DIR=/home/oem/BUILD_WRF/LIBRARIESexport CC=gccexport CXX=g++export > FC=gfortranexport FCFLAGS=-m64export F77=gfortranexport FFLAGS=-m64export > JASPERLIB=$DIR/grib2/libexport JASPERINC=$DIR/grib2/includeexport > LDFLAGS=-L$DIR/grib2/libexport CPPFLAGS=-I$DIR/grib2/includeexport > PATH=$DIR/netcdf/bin:$PATHexport NETCDF=$DIR/netcdfexport > PATH=$DIR/mpich/bin:$PATHexport WRF_DIR=/home/oem/WRF-4.2.1export > LD_LIBRARY_PATH=$DIR/grib2/lib:$LD_LIBRARY_PATH* > > *Kindly help me with the solution of the problem.* > > *Thanks in advance.* > > *Regards* > > *Jayanti* > > > > - > > Ticket Details =================== Ticket ID: UQM-135489 Department: Support netCDF Priority: Normal Status: Closed =================== NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.