Can CPP preprocessing statement in Fortran be indented?

后端 未结 2 380
梦如初夏
梦如初夏 2020-12-11 21:58

I am fairly new to use Fortran preprocessing statement and have a question which is probably pretty native. Can Fortran preprocessing statement be indented? I tested using G

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-11 22:23

    you could use the C preprocessor to do the processing and then compile the processed file, i.e., assuming that your program is in main.f90, then something like:

    cpp -nostdinc -C -P -w main.f90 > _main.f90
    gfortran -o main _main.f90
    

    In this connection, this question is quite useful: Indenting #defines

提交回复
热议问题