立即注册 登录
气象家园 返回首页

packard的个人空间 http://bbs.06climate.com/?87401 [收藏] [复制] [分享] [RSS]

日志

[Fortran] file formats

已有 149 次阅读2018-4-22 09:19 |个人分类:technical

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.

评论 (0 个评论)

facelist doodle 涂鸦板

您需要登录后才可以评论 登录 | 立即注册

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

返回顶部