Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to execute the swanrun.bat file in WSL and ubuntu? #1

Open
linmeihong opened this issue Apr 27, 2022 · 2 comments
Open

How to execute the swanrun.bat file in WSL and ubuntu? #1

linmeihong opened this issue Apr 27, 2022 · 2 comments

Comments

@linmeihong
Copy link

Dear team coders,
Thanks for your opensource code AutoSWAN.
I got these problems, I donot know how to solve it. can anyone help me? Thank you very much!

./swanrun.bat: line 1: @echo: command not found
./swanrun.bat: line 2: rem: command not found
./swanrun.bat: line 3: rem: command not found
./swanrun.bat: line 4: rem: command not found
./swanrun.bat: line 5: rem: command not found
./swanrun.bat: line 6: rem: command not found
./swanrun.bat: line 7: rem: command not found
./swanrun.bat: line 8: rem: command not found
./swanrun.bat: line 9: rem: command not found
./swanrun.bat: line 51: syntax error near unexpected token %%i' ./swanrun.bat: line 51: for /L %%i in (1,1,%nprocs%) do copy PRINT-00%%i %inputfile%.prt-00%%i >> nul'

@nicl-nno
Copy link
Contributor

Dear linmeihong,

The provided version of SWAN model is compatible with Windows only. The linux-compatible version of the SWAN is available in https://swanmodel.sourceforge.io/

If you will solve this problem and include the linux-compatible version to AutoSWAN, it can be quite valuable contribution.

@linmeihong
Copy link
Author

Dear nicl-nno,
Thank you, I add the cmd.exe to code, and run it manually now. I will try your suggest at a later time.

    print('################################################swan run###############################')
    print('fileName:'+self._config_name)
    if is_parallel:
        subprocess.run(fr'cmd.exe ./swanrun.bat {self._config_name} -n {num_cores}', **params)
    else:
        subprocess.run(fr'cmd.exe ./swanrun.bat {self._config_name}', **params)

    if verbose:
        self._print_errors()

    os.chdir(current_folder)
    
    print('################################################swan run###############################')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants