Codes:
Fixed form (Fortran 77) codes:
- commonly named as *.f
- compile with -fixed
- only 72(default)/80/132 columns are scanned, change default by "-extend-source 132"
- column 1: comment indicators (C, c, !, *)
- column 1-5: blank or contain numeric label
- column 6: nonblank, nonzero to indicate continuation lines
- reference: http://www.meteor.iastate.edu/classes/mt227/lectures/Fortran77_2009.pdf
Free form (Fortran 90) codes:
- commonly named as *.f90
- compile with -free
- no limit for text width
- column 1-6 is not special.
$ ls -X $NETCDF_HOME/include # ver 4.1.3
ncvalues.h netcdfcpp.h netcdf.h
netcdf_par.h netcdf.hh netcdf.inc
netcdf.mod typesizes.mod
*.h are C/C++ header files (ASCII).
*.mod are Fortran module files (binary).
- created when a code having "module" is compiled.
- named after the module (not the filename of the code)
- used when a code contains "use netcdf", -I/path/to/modfile
- see more in:
http://parallel.ksu.ru/docs/Intel/f_ug/fced_mod.htm*.inc are Fortran include files (ASCII).
- used when a code contains " include 'netcdf.inc' "
- see more in:
https://en.wikipedia.org/wiki/Include_directive#Fortran$ ls -X $NETCDF_HOME/lib # ver 4.1.3
pkgconfig libnetcdf_c++.so.4.1.0 libnetcdff.so.5.1.0 libnetcdf.so.7.1.1 libnetcdf_c++.so.4 libnetcdff.so.5 libnetcdf.so.7 libnetcdf.a
libnetcdf_c++.a libnetcdff.a libnetcdf_c++.la libnetcdff.la libnetcdf.la libnetcdf_c++.so libnetcdff.so libnetcdf.so
*.a are archive / static library (binary).
- created by command "ar" on multiple *.o object files.
- contains implementation of routines / functions
- used when linking. -L/path/to/lib -lnetcdff -static
*.so* are shared object / library (binary).
- contains implementation of routines / functions
- used when linking and executing. -L/path/to/lib -lnetcdff
Static vs. shared library:
- "A static library is like a bookstore, and a shared library is like... a library."
- see more in:
https://stackoverflow.com/questions/2649334/difference-between-static-and-shared-libraries*.la are libtool library file (ASCII).
*.o are object files (binary).
- created when compiling without linking
- contains implementation of routines / functions
- named after the filename of the code
- used when linking or archiving.