NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.
To learn about what's going on, see About the Archive Site.
Hello, I have some read/write modules written in free form fortran (Fortran 90) and I have some fortran77 code that writes standard fortran binary files. However, I would prefer to have output in netcdf format. The question is if I can compile and link, fortran90 netcdf write module with the fortran 77 code. The platform that I am working on is Linux with Intel Fortran Compiler 8.1 and netcdf library version 3.6.0-p1. ifort compiles the write netcdf module (f90 code), and it compiles the main code (f77) if I comment the lines that calls netcdf write subroutines. When I am trying to compile including these lines, ifort complains that it cannot find the module for writing netcdf. (ERROR in opening the Library module file [WRITE_3D_NETCDF_FIELD]) Below are the headers of my netcdf write module and headers of main code that calls subroutine to write netcdf field, and the makefile that compiles everything. If somebody could tell me what I am doing wrong and point me to the solution, I would be the most thankful. Goran ----netcdf write module f90 code, write_netcdf_3d_field.f90---- module write_netcdf_3d_field use netcdf implicit none contains subroutine write_3d_field(nx,x_axis,ny,y_axis,nz,z_axis,field1, netcdf_outfile) ... end subroutine write_3d_field end module write_netcdf_3d_field ----main program f77 code, m_buildCLM201regionen_eval_oro.f---- PROGRAM m_buildCLM201regionen USE write_netcdf_3d_field IMPLICIT NONE .... CALL write_3d_field(nxg,x_lon,nyg,y_lat,nzg,z_lev,mask, >netcdf_file) STOP END ---- makefile ---- # DEVDIR = /home/goran/clm/regiomask REMDIR = /home/goran/clm/regiomask EXECUTABLE = buildCLM201regionen_eval_oro.exe CF = ifort FFLAGS = -O3 NETCDFLIB = -L/usr/local/lib NETCDFINC = -I/usr/local/include # #Objektdateien######################################################### # OBJFILES = m_buildCLM201regionen_eval_oro.o \ r_getcoord.o r_regiomask.o t_createmask.o w_regiomask.o \ hnioerr.o write_netcdf_3d_field.o # $(EXECUTABLE): $(OBJFILES) $(CF) -o $(EXECUTABLE) $(OBJFILES) $(NETCDFLIB) -lnetcdf ## m_buildCLM201regionen_eval_oro.o: $(REMDIR)/m_buildCLM201regionen_eval_oro.f ($(CF) $(FFLAGS) -c $(REMDIR)/m_buildCLM201regionen_eval_oro.f r_getcoord.o: $(DEVDIR)/r_getcoord.f ($(CF) $(FFLAGS) -c $(DEVDIR)/r_getcoord.f) r_regiomask.o: $(DEVDIR)/r_regiomask.f ($(CF) $(FFLAGS) -c $(DEVDIR)/r_regiomask.f) t_createmask.o: $(REMDIR)/t_createmask.f ($(CF) $(FFLAGS) -c $(REMDIR)/t_createmask.f) w_regiomask.o: $(DEVDIR)/w_regiomask.f ($(CF) $(FFLAGS) -c $(DEVDIR)/w_regiomask.f) hnioerr.o : $(DEVDIR)/hnioerr.f90 ($(CF) $(FFLAGS) -c $(DEVDIR)/hnioerr.f90 $(NETCDFINC)) write_netcdf_3d_field.o : $(DEVDIR)/write_netcdf_3d_field.f90 ($(CF) $(FFLAGS) -c $(DEVDIR)/write_netcdf_3d_field.f90 $(NETCDFINC))
netcdfgroup
archives: