how to compile a code with if statement in make file in fortran? -


i using fortran code write code. using subroutine inside loop. , name of subroutine different various runs (i have written subroutines). whenever want run code different case, have change name of subroutine accordingly. don't want modify code again , again. want 2 write global code. can use subroutines "if statement" in code. in case not have modify code every time. in way if statement run @ each step. possible write code in way give value of parameter , code compiles subroutine want out loop or statement. or can using if statement in make file.

you have few options.

  1. this doesn't fit question requests directly, having if statements picking right subroutine of negligible cost. using input file determines subroutine use way have 1 executable can handle multiple cases.
  2. there fortran preprocessors; using preprocessor such fpp right way have make compile code target particular subroutine.
  3. this great problem scripting language; if don't know language that's great processing strings, chance! wrote program, bake, because had problem similar you. making program manage fortran code gave me great experience writing python, use daily now. you're welcome use bake, may want make own.

Comments

Popular posts from this blog

php - Admin SDK -- get information about the group -

dns - How To Use Custom Nameserver On Free Cloudflare? -

Python Error - TypeError: input expected at most 1 arguments, got 3 -