Hello Everybody
I want to use a 'TPAR file' to input wave parameters at one of the boundaries of my ROMS-SWAN coupled system. I tried to define the input file in a standard way (as done in SWAN Model). The ROMS model starts computation, but at the time of coupling the SWAN model doesn't seem to provide any results. I tried entering my file information in swan_**.in file in following fashions:
BOUNDPAR2 SEGMENT IJ 34 0 34 80 CONSTANT FILE '/home/kumar/ROMS/Projects/MyrtleBeach/Forcings/TPAR.txt'
BOUNDPAR2 SEGMENT IJ 34 0 34 80 CONSTANT FILE '/home/kumar/ROMS/Projects/MyrtleBeach/Forcings/TPAR.txt' 4 0 FREE
It would be kind, if someone could point out the correct way of using TPAR files in ROMS SWAN coupled system. Is the format of data entry within the TPAR file also different from the usual format?
Thanks
Nirnimesh
Creating TPAR input file for ROMS-SWAN coupled system
Re: Creating TPAR input file for ROMS-SWAN coupled system
Nirnemesh-
It is late you should be asleep. Fortunately for you, i am still in France from ROMS conference and the time change allows me to be awake now.
You are starting to ask SWAN questions on the ROMS forum, but that is fine for now. The coupling does not alter the Boundary specifications for swan in any way. So you should do as stated in the swan manual. Here are some things to consider:
1) what is actaully the problem? Does swan just stop? Is there anything in the PRINT or ERRFILES from swan?
2) try to run it first with just:
BOUND SHAPESPEC JONSWAP MEAN DSPR DEGREES
BOUNDSPEC SEGMENT IJ 34 0 34 80 CONSTANT PAR hs period dir dd
where hs period dir and dd are real values.
if that works, then try it with the TPAR file.
3) for swan with tpar you should have
BOUND SHAPESPEC JONSWAP MEAN DSPR DEGREES
BOUNDSPEC SEGMENT IJ 34 0 34 80 CONSTANT FILE 'tpar.filename'
where tpar.filename is that file name you have. SWAN has troubles with long file names, so maybe try it with just putting the tpar file at the root (where oceanM is) and just list the file without the full path. If SWAN can not find the file it may tell you that information in the PRINT or ERRFILE. Read them.
4) the TPAR file should have
TPAR
YYYYMMDD.HHMMSS 4.0 12. 0.0 22.
YYYYMMDD.HHMMSS 4.0 12. 0.0 22.
... (see the swan manual).
-j
It is late you should be asleep. Fortunately for you, i am still in France from ROMS conference and the time change allows me to be awake now.
You are starting to ask SWAN questions on the ROMS forum, but that is fine for now. The coupling does not alter the Boundary specifications for swan in any way. So you should do as stated in the swan manual. Here are some things to consider:
1) what is actaully the problem? Does swan just stop? Is there anything in the PRINT or ERRFILES from swan?
2) try to run it first with just:
BOUND SHAPESPEC JONSWAP MEAN DSPR DEGREES
BOUNDSPEC SEGMENT IJ 34 0 34 80 CONSTANT PAR hs period dir dd
where hs period dir and dd are real values.
if that works, then try it with the TPAR file.
3) for swan with tpar you should have
BOUND SHAPESPEC JONSWAP MEAN DSPR DEGREES
BOUNDSPEC SEGMENT IJ 34 0 34 80 CONSTANT FILE 'tpar.filename'
where tpar.filename is that file name you have. SWAN has troubles with long file names, so maybe try it with just putting the tpar file at the root (where oceanM is) and just list the file without the full path. If SWAN can not find the file it may tell you that information in the PRINT or ERRFILE. Read them.
4) the TPAR file should have
TPAR
YYYYMMDD.HHMMSS 4.0 12. 0.0 22.
YYYYMMDD.HHMMSS 4.0 12. 0.0 22.
... (see the swan manual).
-j
Re: Creating TPAR input file for ROMS-SWAN coupled system
Hello John
I am sorry for asking question related to SWAN on ROMS forum. But the reason for doing that was, I have already done simulations using TPAR file as input for SWAN only and it worked correctly. Problem occurred when I coupled the models. So, I thought maybe the problem occurs because of coupling.
(1) SWAN was stopping at the time of coupling with ROMS. It was not giving any information in the PRINT or ERRFILE
(2) I had already been running the coupled systems using these commands:
BOUND SHAPESPEC JONSWAP MEAN DSPR DEGREES
BOUNDSPEC SEGMENT IJ 34 0 34 80 CONSTANT PAR hs period dir dd
which was working fine. So, I wanted to go to a higher step and use a TPAR file as input.
(3) I guess, there were two problems:
(a) The input file name was too long and I shortened it as suggested by you.
(b) The input txt file I created was in a windows machine and it is possible I may have used TAB key while formatting that file.
(4) The format of input data in TPAR file I made is same as you have mentioned in the last post.
After creating a fresh TPAR input file using 'vi editor( )', the coupled system works very smoothly.
John, Thanks a lot for all the help.
Next time onwards I should try to do a bit more research before posting a doubt in the forum
Nirni
I am sorry for asking question related to SWAN on ROMS forum. But the reason for doing that was, I have already done simulations using TPAR file as input for SWAN only and it worked correctly. Problem occurred when I coupled the models. So, I thought maybe the problem occurs because of coupling.
(1) SWAN was stopping at the time of coupling with ROMS. It was not giving any information in the PRINT or ERRFILE
(2) I had already been running the coupled systems using these commands:
BOUND SHAPESPEC JONSWAP MEAN DSPR DEGREES
BOUNDSPEC SEGMENT IJ 34 0 34 80 CONSTANT PAR hs period dir dd
which was working fine. So, I wanted to go to a higher step and use a TPAR file as input.
(3) I guess, there were two problems:
(a) The input file name was too long and I shortened it as suggested by you.
(b) The input txt file I created was in a windows machine and it is possible I may have used TAB key while formatting that file.
(4) The format of input data in TPAR file I made is same as you have mentioned in the last post.
After creating a fresh TPAR input file using 'vi editor( )', the coupled system works very smoothly.
John, Thanks a lot for all the help.
Next time onwards I should try to do a bit more research before posting a doubt in the forum
Nirni
Re: Creating TPAR input file for ROMS-SWAN coupled system
Nirnemesh-
No problem. I am glad you figured it out. I know you, and you are the good type - to dig deep and find the problem.
- NEVER USE TABS, NEVER NEVER NEVER.
The text file can be made with vi, textpad, notepad, emacs, xemacs, etc etc. No word processors, just text editors.
- I will dig into the swan code, and see if we can allow longer file names. I know of others whom had similar problems.
-john
No problem. I am glad you figured it out. I know you, and you are the good type - to dig deep and find the problem.
- NEVER USE TABS, NEVER NEVER NEVER.
The text file can be made with vi, textpad, notepad, emacs, xemacs, etc etc. No word processors, just text editors.
- I will dig into the swan code, and see if we can allow longer file names. I know of others whom had similar problems.
-john
-
- Posts: 7
- Joined: Thu Sep 25, 2008 5:47 pm
- Location: FSU COAPS
Re: Creating TPAR input file for ROMS-SWAN coupled system
Hello,
I'm running coupled ROMS/SWAN, although the problem that I'm having is SWAN related only. I tried to find the answer in SWAN forrum but did not get any respond. Probably somebody who is running SWAN/ROMS can help me. I'm trying to prescribe spectra at 20 locations along West-South sides of a curvilinear domain. Since this is curvilinear grid, I'm using "segment" for BOUNDSPEC. Spectra for all 20 locations and all time steps are in one file. It is not clear from the SWAN manual, how to specify all these points in the *.in file. Following the manual (FILE <[len] 'filename' [seq]>), I do:
BOUDNSPEC SEGMENT IJ 0 180 0 0 390 0 VARIABLE FILE &
0 'swan_ob200701.dat' 1&
5560 'swan_ob200701.dat' 2&
83340 'swan_ob200701.dat' 3&
...
484056.0121 'swan_ob200701.dat' 20
When reading the second point SWAN gives an error, that the file is already open. I've unsuccesfully tried some other ways to input the data. What is the correct way of doing this?
Thanks,
Dmitry
I'm running coupled ROMS/SWAN, although the problem that I'm having is SWAN related only. I tried to find the answer in SWAN forrum but did not get any respond. Probably somebody who is running SWAN/ROMS can help me. I'm trying to prescribe spectra at 20 locations along West-South sides of a curvilinear domain. Since this is curvilinear grid, I'm using "segment" for BOUNDSPEC. Spectra for all 20 locations and all time steps are in one file. It is not clear from the SWAN manual, how to specify all these points in the *.in file. Following the manual (FILE <[len] 'filename' [seq]>), I do:
BOUDNSPEC SEGMENT IJ 0 180 0 0 390 0 VARIABLE FILE &
0 'swan_ob200701.dat' 1&
5560 'swan_ob200701.dat' 2&
83340 'swan_ob200701.dat' 3&
...
484056.0121 'swan_ob200701.dat' 20
When reading the second point SWAN gives an error, that the file is already open. I've unsuccesfully tried some other ways to input the data. What is the correct way of doing this?
Thanks,
Dmitry
Re: Creating TPAR input file for ROMS-SWAN coupled system
i do not use this method. I typically have the 2d spec in separate files. Maybe you could try 20 different boundspec lines ??
BOUDNSPEC SEGMENT IJ 0 0 10 0 VARIABLE FILE 'swan_ob200701.dat' 1
BOUDNSPEC SEGMENT IJ 10 0 20 0 VARIABLE FILE 'swan_ob200701.dat' 2
...
??
BOUDNSPEC SEGMENT IJ 0 0 10 0 VARIABLE FILE 'swan_ob200701.dat' 1
BOUDNSPEC SEGMENT IJ 10 0 20 0 VARIABLE FILE 'swan_ob200701.dat' 2
...
??
-
- Posts: 7
- Joined: Thu Sep 25, 2008 5:47 pm
- Location: FSU COAPS
Re: Creating TPAR input file for ROMS-SWAN coupled system
John,
thank you for the advise. It did not work. I finally looked into the SWAN code and figured out how to do that.
BOUNDSPEC SEGMENT IJ 0 180 0 0 390 0 VARIABLE FILE &
0.00 'negomwvswan/Data/swanOB_200701.dat' 1 &
27780.00 ' ' 2 &
55560.00 ' ' 3 &
83340.00 ' ' 4 &
111120.00 ' ' 5 &
138900.00 ' ' 6 &
...
484056.0121 ' ' 20
The text editor does not keep formating of my code. There should be at least 4 spaces between the ' '. In swanOB_2007.dat # of locations should be 20.
-Dmitry
thank you for the advise. It did not work. I finally looked into the SWAN code and figured out how to do that.
BOUNDSPEC SEGMENT IJ 0 180 0 0 390 0 VARIABLE FILE &
0.00 'negomwvswan/Data/swanOB_200701.dat' 1 &
27780.00 ' ' 2 &
55560.00 ' ' 3 &
83340.00 ' ' 4 &
111120.00 ' ' 5 &
138900.00 ' ' 6 &
...
484056.0121 ' ' 20
The text editor does not keep formating of my code. There should be at least 4 spaces between the ' '. In swanOB_2007.dat # of locations should be 20.
-Dmitry