Some problems about running ROMS-SWAN Coupling test case

Report or discuss software problems and other woes

Moderators: arango, robertson

Post Reply
Message
Author
s091334
Posts: 17
Joined: Mon Sep 24, 2012 4:48 pm
Location: National Kaohsiung Marine University

Some problems about running ROMS-SWAN Coupling test case

#1 Unread post by s091334 »

Dear all:
I used WindosXP, Cygwin and g95 to install MPICH2-1.2.1p1 on my personal computer (Intel Core 2 Quad Q8200).
Now, I can use oceaM run my cases(just ROMS) by one processor.

In my research, I needed coupling ROMS and SWAN.
That's why I installed mpi.
I'm presently trying to run Inlet Test Case(https://www.myroms.org/wiki/index.php/INLET_TEST_CASE).

And I used the command to install MCT.
$CC=gcc FC=mpif90 F90=g95 FFLAGS="-fno-second-underscore" F90FLAGS="-fno-second-underscore" ./configure MPIHEADER=-I/MPICH2/include MPILIBS=-L/MPICH2/lib --prefix=/MCT/ 2>&1 | tee config.txt

So, in the coupling_inlet_test.in
I set the least processor number

Nthreads(ocean) = 1
Nthreads(waves) = 1

I used the build.bash to compile Inlet Test case, and it could finish.
$./build.bash -j 2

When I used the command to run, .
$mpd &
$mpiexec -np 2 ./oceanM User/External/coupling_inlet_test.in

I got some error messages

Coupled Input File name = User/External/coupling_inlet_test.in
rank 1 in job 2 980622-05_3343 caused collective abort of all ranks
exit status of rank 1: killed by signal 9
rank 0 in job 2 980622-05_3343 caused collective abort of all ranks
exit status of rank 0: return code 0


Therefore, I tried to run just ocean model on the same case.
In inlet_test.h I set
/*
** svn $Id: inlet_test.h 170 2008-04-01 18:31:49Z arango $
*******************************************************************************
** Copyright (c) 2002-2008 The ROMS/TOMS Group **
** Licensed under a MIT/X style license **
** See License_ROMS.txt **
*******************************************************************************
**
** Options for Inlet Test Case, waves-ocean (SWAN/ROMS) two-way coupling.
**
** Application flag: INLET_TEST
** Input script: ocean_inlet_test.in
** coupling_inlet_test.in
** sediment_inlet_test.in
*/

#define UV_VIS2
#define MIX_S_UV
#undef ANA_GRID
#define MASKING
#define UV_ADV
#undef UV_COR
#define TS_MPDATA
#define DJ_GRADPS
#define SOUTHERN_WALL
#define FSOBC_REDUCED
#define NORTH_FSGRADIENT
#define NORTH_M2REDUCED
#define NORTH_M3GRADIENT
#define WEST_FSGRADIENT
#define WEST_M2GRADIENT
#define WEST_M3GRADIENT
#define EAST_FSGRADIENT
#define EAST_M2GRADIENT
#define EAST_M3GRADIENT
#define SOLVE3D
#define SPLINES
#undef SWAN_COUPLING
#undef NEARSHORE_MELLOR

#define ANA_INITIAL
#define ANA_SMFLUX
#define ANA_FSOBC
#define ANA_M2OBC

#ifdef SWAN_COUPLING
# define MCT_LIB
#endif

/* define only one of the following 5 */
#define UV_LOGDRAG
#undef UV_QDRAG
#undef MB_BBL
#undef SG_BBL
#undef SSW_BBL
#ifdef SSW_BBL
# define SSW_CALC_ZNOT
#endif

#ifdef SOLVE3D
# define GLS_MIXING
# ifdef GLS_MIXING
# define KANTHA_CLAYSON
# define N2S2_HORAVG
# endif
# undef SEDIMENT
# ifdef SEDIMENT
# define SUSPLOAD
# undef BEDLOAD_SOULSBY
# undef BEDLOAD_MPM
# define SED_MORPH
# endif
# if defined SEDIMENT || defined SG_BBL || defined MB_BBL || defined SSW_BBL
# define ANA_SEDIMENT
# endif
# define ANA_STFLUX
# define ANA_SSFLUX
# define ANA_BPFLUX
# define ANA_BTFLUX
# define ANA_BSFLUX
# define ANA_SPFLUX
# define ANA_SRFLUX
#endif

I could compile and run finishing.
$mpiexec -np 1 ./oceanM User/External/ocean_inlet_test.in > oceaM_n1_ocean_inletest_20121013.log
But, I couldn't draw it by matlab(I had set tools path)
I got warning messages

the dates in ocean_his.nc which are 19-Nov-9855 00:00:00 to
21-Nov-9855 00:00:00

So,
1) Can anyone give some advices about running coupling ROMS-SWAN test error messages?
2) When I draw the result that just running ocean model, I got warning messages about dates,
that I find the ocean_inlet_test.in set
TIME_REF = 0.0d0 ! yyyymmdd.dd
Should I modify it?

Best regards,
Chi-Che Hsieh
Attachments
oceaM_n1_ocean_inletest_20121013.log
(2.66 MiB) Downloaded 435 times

jcwarner
Posts: 1200
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: Some problems about running ROMS-SWAN Coupling test case

#2 Unread post by jcwarner »

i have not run the coupled rutgers version in quite some time. but your error message does not tell a lot.

Coupled Input File name = User/External/coupling_inlet_test.in
rank 1 in job 2 980622-05_3343 caused collective abort of all ranks
exit status of rank 1: killed by signal 9
rank 0 in job 2 980622-05_3343 caused collective abort of all ranks
exit status of rank 0: return code 0

was ther more in the output message?
can you run it in debug mode? (use_debug=on)

if you are serious about the coupled modeling, then you would most likely want to use out other code. that has vortex force method and updated swan, as well as grid refinement in both roms and swan. if you are just doing some testing then the rutgers code will be fine.

-john

s091334
Posts: 17
Joined: Mon Sep 24, 2012 4:48 pm
Location: National Kaohsiung Marine University

Re: Some problems about running ROMS-SWAN Coupling test case

#3 Unread post by s091334 »

Thanks, John.
I tried to use USE_DEBUG=on, recompiling.
And when I used command
$mpiexec -np 2 ./oceanG User/External/coupling_inlet_test.in > oceaM_n2_inletest_20121015.log

I got messages about these.
Coupled Input File name = User/External/coupling_inlet_test.in

INP_PAR - Unable to open coupling input script.
In distributed-memory applications, the input
script file is processed in parallel. The Unix
routine GETARG is used to get script file name.
For example, in MPI applications make sure that
command line is something like:

mpirun -np 4 masterM coupling.in

and not

mpirun -np 4 masterM < coupling.in

MyRank = 0 User/External/coupling_inlet_test.in
rank 0 in job 1 980622-05_1410 caused collective abort of all ranks
exit status of rank 0: killed by signal 9

Another thing, I found would get similar messages, if I used #define SWAN_COUPLING in inlet_test.h, whatever I just only used mpiexec -np 1 ./oceanM User/External/ocean_inlet.in or swan_inlet.in.

Coupled Input File name = User/External/ocean_inlet_test.in
rank 0 in job 2 980622-05_4703 caused collective abort of all ranks
exit status of rank 0: return code 0
-------------------------------------------------------------------------------
Coupled Input File name = User/External/swan_inlet_test.in
Exception: Access Violation
Traceback: not available, compile with -ftrace=frame or -ftrace=full
rank 0 in job 3 980622-05_4703 caused collective abort of all ranks
exit status of rank 0: killed by signal 9

Can anyone give me some suggests to solve this problem?


Best regards,
Chi-Che Hsieh

jcwarner
Posts: 1200
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: Some problems about running ROMS-SWAN Coupling test case

#4 Unread post by jcwarner »

1)well does this file exist:
User/External/coupling_inlet_test.in

2) mpiexec -np 1 ./oceanM User/External/ocean_inlet.in or swan_inlet.in.
should probably need np 2

jcwarner
Posts: 1200
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: Some problems about running ROMS-SWAN Coupling test case

#5 Unread post by jcwarner »

should
User/External/coupling_inlet_test.in
be
ROMS/External/coupling_inlet_test.in

s091334
Posts: 17
Joined: Mon Sep 24, 2012 4:48 pm
Location: National Kaohsiung Marine University

Re: Some problems about running ROMS-SWAN Coupling test case

#6 Unread post by s091334 »

Thanks a lot, John.

When I tried to use ROMS/External/coupling_inlet_test.in
It could work, now.

And I had another questions,
1) if I wanted to use the oceanM.exe (ROMS+SWAN), just only ran ocean model(didn't exchange SWAN data). Testing the results between oceanM.exe (ROMS+SWAN) and oceanS(ROMS) were the same or not.

2) the similar as above, if use the oceanM.exe (ROMS+SWAN), and just only ran swan model(didn't exchange ROMS data)

I want to test and verify the compiler oceanM(ROMS+SWAN), what I used was right.

How can I set?
Can anyone give me some advices?

jcwarner
Posts: 1200
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: Some problems about running ROMS-SWAN Coupling test case

#7 Unread post by jcwarner »

I am not sure exactly what you are asking. but if you run a roms+swan application, and then compare that result to a roms only or a swan only simulation, the solutions will not be exactly the same because the wave-current interactions will cause changes to the currents and to the waves. so you can run a roms only simulation, but it will not be the same as a roms+swan run. likewise, a swan only result will not be the same as a swan+roms simulation.

for the method on the rutgers site, the exchange fields are set with import/export exchange field flags that are set in the coupling.in file. We have found some issues with this approach, and have modified the formulation to be based on cpp definitions in our coawst system. we also have cpp options that prevent free surface changes to be sent to swan, no currents to swan, etc so that we can isolate specific effects.

also, in the coawst system, we can run swan alone. this is not possible in the rutgers code. so if you really want to use the coupled system, we have advanced the coupling in the coawst system.

s091334
Posts: 17
Joined: Mon Sep 24, 2012 4:48 pm
Location: National Kaohsiung Marine University

Re: Some problems about running ROMS-SWAN Coupling test case

#8 Unread post by s091334 »

Sorry, I didn't describe clearly.

I know that if I ran ROMS(only ocean model) the result would different from using ROMS+SWAN.
Therefor, I want to test and verify compiler oceanM(ROMS+SWAN), if SWAN didn't send data to ROMS,
and the simulate result, would get the same of using ROMS(only ocean model)?

Then, I try to modify coupling_inlet_test.in
NnodesWAV = 0 ! wave model
NnodesOCN = 1 ! ocean model

But it didn't work.
So, I edited SWAN file INPUT_inlet_test, let the inlet side wave height equal zero.

&& BOUNDARY FORCING &&
BOUNDPAR1 SHAPESPEC JONSWAP 3.3 PEAK DSPR DEGREES
BOUNDPAR2 SEGMENT IJ 0 71 76 71 CONSTANT PAR 0.0 10.0 0. 20.

And ran oceaM(ROMS+SWAN), the SWAN output file hsig.mat should be zero. But the waves height was about 0.024 in Hsig_20000101_000000.
The SWAN wave height data will send to ROMS. I Can't prove when coupling ROMS and SWAN, the ROMS still can simulate well, just like only using ROMS.

Can anyone give me some suggest?


Best regards,
Chi-Che Hsieh

jcwarner
Posts: 1200
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: Some problems about running ROMS-SWAN Coupling test case

#9 Unread post by jcwarner »

i am not sure if that approach will work with the Rutgers version. i was not so happy with the exchange field approach, and that is why we chose to reformulate this approach to use cppdefs. this is available in our coawst system. we have already done the tests that you are looking to do.

s091334
Posts: 17
Joined: Mon Sep 24, 2012 4:48 pm
Location: National Kaohsiung Marine University

Re: Some problems about running ROMS-SWAN Coupling test case

#10 Unread post by s091334 »

Thank you, John.

About the question of waves height was about 0.024 in Hsig_20000101_000000.
I solved it. I added INIT ZERO in SWAN file.
Then the SWAN output file hsig.mat will be zero.
In my research, I could prove when coupling ROMS and SWAN, the ROMS still can simulate well, just like only using ROMS.

I had another problems about SWAN, I feel sorry to ask in here.
My model was a square harbor, in east side was the square harbor, west side was the wave inlet side.
South and north side I didn't set anything, so they were open boundaries.
I want to produce a horizontal wave from west side to east side.

I could run the SWAN file, and didn't get errors. But when I set it 1m waves, the simulation results not I want.
I used setting
$********* CREATE AND READ COMPUTATIONAL GRID ********
CGRID CURVILINEAR 100 100 EXC 9999 CIRCLE 36 0.04 1.0 20
$********** BOUNDARY FORCING ********
BOUN SHAPESPEC JONSWAP 3.3 PEAK DSPR DEGREES
BOUN SEGMENT IJ 0 0 0 100 CONSTANT PAR 1.0 10.0 270. 30.

Should I change to use SECTOR?
In my model wave from west side to east side, so the right-hand boundary and left-hand boundary degrees how to decide?

Can anyone give me some suggestions or better methods?

Best regards,
Chi-Che Hsieh

jcwarner
Posts: 1200
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: Some problems about running ROMS-SWAN Coupling test case

#11 Unread post by jcwarner »

this is probably not the best place to ask SWAN questions, but i will give it a try.
you said "But when I set it 1m waves, the simulation results not I want"
But what did it give? what did swan show? it is hard to tknow how to help.

the CIRCLE 36 0.04 1.0 20
uses 20 directional bins, so that means each bin is 18degrees. you could use sector to make more bins and only resolve part of the full circle.

BOUN SEGMENT IJ 0 0 0 100 CONSTANT PAR 1.0 10.0 270. 30.
means that this BC is for the west side (0 0 0 100; x y x y) with a 1 m wave heigth at 10 sec period heading from 270 degrees with a 30 degree spread. if you are trying to get a uniform wave field coming in from the west, you may need to change some of these parameters, or try swan in 1D.

s091334
Posts: 17
Joined: Mon Sep 24, 2012 4:48 pm
Location: National Kaohsiung Marine University

Re: Some problems about running ROMS-SWAN Coupling test case

#12 Unread post by s091334 »

Thanks, John.
My model was 20km*20km, the most deep were 20m.
When I set 1m waves height in west side, the simulation results like the figure.
http://i.imgur.com/YJoij.jpg

But it not I want. I want to produce a uniform wave field coming in from west side to east side.
And research refraction and diffraction near the harbor.

I appended the swan files that I used, but it needed to modify the file extensions.
wave_SH.txt => wave_SH.swn

So, How can I modify the wave_SH.swn to produce a uniform wave?
Can anyone give me advices? Thanks.

Best regards,
Chi-Che Hsieh
Attachments
wave_SH.txt
(2.41 KiB) Downloaded 425 times
Last edited by s091334 on Mon Nov 05, 2012 7:08 pm, edited 1 time in total.

jcwarner
Posts: 1200
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: Some problems about running ROMS-SWAN Coupling test case

#13 Unread post by jcwarner »

what happens if you change
BOUN SEGMENT IJ 0 0 0 100 CONSTANT PAR 1.0 10.0 270. 30.
to
BOUN SEGMENT IJ 0 0 0 100 CONSTANT PAR 1.0 10.0 270. 5.

s091334
Posts: 17
Joined: Mon Sep 24, 2012 4:48 pm
Location: National Kaohsiung Marine University

Re: Some problems about running ROMS-SWAN Coupling test case

#14 Unread post by s091334 »

Thanks, John.
I try to use
BOUN SEGMENT IJ 0 0 0 100 CONSTANT PAR 1.0 10.0 270. 5.

But it still similar before I change.
http://i.imgur.com/fGCBG.jpg

jcwarner
Posts: 1200
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: Some problems about running ROMS-SWAN Coupling test case

#15 Unread post by jcwarner »

try changing from
CIRCLE 36 0.04 1.0 20
to
CIRCLE 36 0.04 1.0 60

s091334
Posts: 17
Joined: Mon Sep 24, 2012 4:48 pm
Location: National Kaohsiung Marine University

Re: Some problems about running ROMS-SWAN Coupling test case

#16 Unread post by s091334 »

I change to use
$********* CREATE AND READ COMPUTATIONAL GRID ********
CGRID CURVILINEAR 100 100 EXC 9999 CIRCLE 36 0.04 1 60
$********** BOUNDARY FORCING ********
BOUN SEGMENT IJ 0 0 0 100 CONSTANT PAR 1.0 10.0 270. 5.

Then, the result south side and north side still have problems.
http://i.imgur.com/6VrkG.jpg

jcwarner
Posts: 1200
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: Some problems about running ROMS-SWAN Coupling test case

#17 Unread post by jcwarner »

what if you try
MODE NONSTATIONARY ONEDIMENSIONAL

s091334
Posts: 17
Joined: Mon Sep 24, 2012 4:48 pm
Location: National Kaohsiung Marine University

Re: Some problems about running ROMS-SWAN Coupling test case

#18 Unread post by s091334 »

If I used
MODE NONSTATIONARY ONEDIMENSIONAL

$********** CREATE AND READ BATHYMETRY GRID ********
INPGRID BOTTOM CURVILINEAR 0 0 100 100 EXC 9999

I would get error messages about CURVILINEAR not for 1D-simulation.
The waves model I would use it coupling ROMS.
Therefor, I exported ROMS grid and bottom by matlab. And used them to be waves model grid and bottom.
If I changed to used 1-D model, the bottom grid I needed to changed using REGULAR to generate.
Another thing,if I does that, SWAN data still can sent to ROMS?

jcwarner
Posts: 1200
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: Some problems about running ROMS-SWAN Coupling test case

#19 Unread post by jcwarner »

i think you need to explore a little with swan to get it to do what you want. i remember having troubles with this, and i think what we did was make the grid wide and just look at results in the middle where swan is uniform. I am not sure if swan will couple in 1D, but it should. if swan has a limitation that it can only do rectilinear grids in 1D, then you will need to limit your test to what ever swan can do. you can also ask questoins on the swan forum to see what others have done.
-john

s091334
Posts: 17
Joined: Mon Sep 24, 2012 4:48 pm
Location: National Kaohsiung Marine University

Re: Some problems about running ROMS-SWAN Coupling test case

#20 Unread post by s091334 »

Thank you, John.
I think it can do what I want, but I don't know how to set it, or something I negligence.

And I had trying to post similar questions on some swan forums(http://sourceforge.net/mailarchive/foru ... odel-users), but I had not getting reply on these questions.
Also, I sent e-mail ("swan-info-citg@tudelft.nl",this e-mail from SWAN user manual), but I get a failing message.

Delivery to the following recipient failed permanently:
swan-info-citg@tudelft.nl

Maybe, I should try sending it again.
Do you or anyone have any other swan forums to recommend to me?

Best regards,
Chi-Che Hsieh

s091334
Posts: 17
Joined: Mon Sep 24, 2012 4:48 pm
Location: National Kaohsiung Marine University

Re: Some problems about running ROMS-SWAN Coupling test case

#21 Unread post by s091334 »

Dear all:
Before, I asked about producing a horizontal wave from west side to east side.
I got reply from e-mail, and suggested similar swan user manual describing about.

The SWAN boundaries are absorbing, meaning that they allow wave energy
to exit the domain (rather than reflect it back into the domain).
Thus, when the wave energy approaches the boundaries on the top and
bottom of your domain, the wave energy is absorbed. That is why you
are seeing a boundary layer at each of those top and bottom
boundaries. Wave energy is lost as it approaches those boundaries.

You can try to "tighten" the directional spreading by adjusting the
input parameters for your incoming wave. But that will not correct
fully for this behavior. As a work-around, most SWAN users will
lengthen the domain so that the absorbing boundaries are far from the
region of interest. For example, the wave solution is probably fine
along the centerline of your domain.

So, in my model where I interested areas were far enough away north side and south side.
I just researching the reflection and diffraction near the harbors.

And I had a questions about plotting output.
I used ROMS Matlab tools (http://romsmatlab.tiddlyspot.com/) to plot, and I could use zview to plot zeta,
but I couldn't plot Hwave, I had turn on about
Hout(idWamp) == T ! wave height
Hout(idWlen) == T ! wave length
Hout(idWdir) == T ! wave direction

I want to plot SWAN output of wave height (Hwave) and barotropic currents.
Can any one give me some help to solved?

Best regards,
Chi-Che Hsieh

Post Reply