ESCOMP / POP2-CESM

Parallel Ocean Program (POP2) in CESM
http://www.cesm.ucar.edu/models/cesm2/ocean/
4 stars 24 forks source link

Add -S option to some shebang lines #81

Closed mnlevy1981 closed 8 months ago

mnlevy1981 commented 8 months ago

Description of changes:

When using /usr/bin/env in the shebang line, you need a "-S" argument if the command being run by env has its own arguments... so

#!/usr/bin/env csh -f

tried to find an executable named csh -f, while

#!/usr/bin/env -S csh -f

correctly splits that into the command csh and the argument -f

Testing:

I tried to run preview_namelists in a C compset case and got the error

/usr/bin/env: ‘csh -f’: No such file or directory
/usr/bin/env: use -[v]S to pass options in shebang lines

But the command runs successfully when using this branch

klindsay28 commented 8 months ago

@mnlevy1981, I'm curious what codebase and platform leads to this problem for you. I'm running CESM 2.1.5 on derecho without problems.

mnlevy1981 commented 8 months ago

I merged #73 into master at the end of the year, which updated a bunch of files with

-#!/bin/csh -f
+#!/usr/bin/env csh -f

I didn't do any testing (shame on me), and @fischer-ncar found out that derecho complains about the #!/usr/bin/env csh -f formatting. The POP tag in CESM 2.1.5 should still be using #!/bin/csh -f, which is okay (I didn't merge the update from #73 onto any of the older release branches).

mnlevy1981 commented 8 months ago

@fischer-ncar confirmed that derecho can run POP cases again, so I'm going to merge this in