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

ROMS+SWAN no difference in result with ROMS only #273

Open
remit1 opened this issue Jun 30, 2024 · 4 comments
Open

ROMS+SWAN no difference in result with ROMS only #273

remit1 opened this issue Jun 30, 2024 · 4 comments

Comments

@remit1
Copy link

remit1 commented Jun 30, 2024

Dear jcwarner,

Currently, I am working on coupling ROMS and SWAN. I have successfully run each model individually, and I have also successfully coupled ROMS and SWAN. My question is, when I compare the results, say for the variable temp (T) or u (u_eastward), and look at the differences, such as:
temp (from coupled ROMS+SWAN) - temp (ROMS only)
or
u (from coupled ROMS+SWAN) - u (ROMS only),

I find that there is no difference in the results. I have enabled the following:

#define ROMS_MODEL
#define SWAN_MODEL
#define MCT_LIB

However, the results are the same as when I only define
#define ROMS_MODEL

Could you please help me with this issue?
2way_RS.txt

@jcwarner-usgs
Copy link
Collaborator

looks like you are using some older cpp options.
Are u using a new version of code?

you dont set the boundaries in the cpp anymore,

define EAST_FSCHAPMAN

define WEST_FSCHAPMAN

define NORTH_FSCHAPMAN

define SOUTH_FSCHAPMAN

those do nothing. all that is set in the ocean.in.

you are missing some wave cpps. Can you look at Projects/Inlet_test/Coupled/inlet_test.h

@remit1
Copy link
Author

remit1 commented Jul 10, 2024

Thank you, John, for your response.

Yes, I am using a version prior to 3.8 (maybe 3.7). Here, I have an issue where the results of coupled and non-coupled runs have the same values. Please give me some guidance on this. As far as I understand, when I define ROMS alone, what we use is:

#define ROMS_MODEL
#undef SWAN_MODEL
#undef WRF_MODEL
#undef WW3_MODEL
#undef MCT_LIB
#undef MCT_INTERP_OC2AT
#undef MCT_INTERP_WV2AT
#undef MCT_INTERP_OC2WV
...

However, when we want to do coupling, we do it like this:

#define ROMS_MODEL
#define SWAN_MODEL
#undef WRF_MODEL
#undef WW3_MODEL
#define MCT_LIB
#undef MCT_INTERP_OC2AT
#undef MCT_INTERP_WV2AT
#undef MCT_INTERP_OC2WV
...

The version before 3.8 should be capable of this. If you mentioned that there is a CPP wave that is not included, could you help identify what is missing? Is it WAVE_PARTITION?

Then, my second question is, why when I define MCT_INTERP_OC2WV, neither ROMS nor SWAN exchange data, all the results are 0 (zero), like this:

...
 ** ROMS grid  1 recv data from SWAN grid  1
SWANtoROMS Min/Max DISBOT  (Wm-2):     0.000000E+00  0.000000E+00
SWANtoROMS Min/Max DISSURF (Wm-2):     0.000000E+00  0.000000E+00
SWANtoROMS Min/Max DISWCAP (Wm-2):     0.000000E+00  0.000000E+00
SWANtoROMS Min/Max HSIGN   (m):        0.000000E+00  0.000000E+00
SWANtoROMS Min/Max RTP     (s):        0.000000E+00  0.000000E+00
SWANtoROMS Min/Max TMBOT   (s):        0.000000E+00  0.000000E+00
SWANtoROMS Min/Max DIR     (rad):      0.000000E+00  0.000000E+00
SWANtoROMS Min/Max DIRP    (rad):      0.000000E+00  0.000000E+00
SWANtoROMS Min/Max WLEN    (m):        1.000000E+00  1.000000E+00
 ** ROMS grid  1 sent data to SWAN grid  1
 == SWAN grid  1 recv data from ROMS grid  1
ROMStoSWAN Min/Max DEPTH   (m):        0.000000E+00  0.000000E+00
ROMStoSWAN Min/Max WLEV    (m):        0.000000E+00  0.000000E+00
ROMStoSWAN Min/Max VELX    (ms-1):     0.000000E+00  0.000000E+00
ROMStoSWAN Min/Max VELY    (ms-1):     0.000000E+00  0.000000E+00
ROMStoSWAN Min/Max ZO      (m):        0.000000E+00  0.000000E+00
      WRT_HIS     - wrote history     fields (Index=1,1) in record = 33
      WRT_QUICK   - wrote quicksave   fields (Index=1,1) in record = 33
      WRT_AVG     - wrote averaged    fields             in record = 32
...

However, when only defining MCT_LIB, there is an exchange? Is there something wrong with my settings?

eko

@jcwarner-usgs
Copy link
Collaborator

how about you try and run inlet_test/coupled.
the relevant cpp options there are:

%if roms and swan on same grid, then you just need these 3:
#define ROMS_MODEL
#define SWAN_MODEL
#define MCT_LIB
% if roms and swan nested and/or on different grids, then you also need to use define MCT_INTERP_OC2WV.

% for roms + swan, you should activate these next 4:
%wec vf activates roms to compute wave driven flows.
#define WEC_VF
%wdiss wavemod means we are getting wave informaiton from a wave model.
#define WDISS_WAVEMOD
%uvkirby defines how to compute the currents to swan
#define UV_KIRBY
%this is a roller model, that allows the non breaking wave energy to be advected landward.
#define ROLLER_RENIERS

there are other options for bottom physics, but try those 4 first.

@remit1
Copy link
Author

remit1 commented Jul 10, 2024

Awesome explanation, John.
I'll try the suggestion you gave and will report back here as soon as possible.
Thank you for your help.

eko

EDIT

After I made the changes based on the above suggestions and made changes input file:

...
! Wec boundary conditions (wave current interaction)

   LBC(isU2Sd) ==   Gra     Gra     Gra     Gra         ! 2D U-stokes
   LBC(isV2Sd) ==   Gra     Gra     Gra     Gra         ! 2D V-stokes
   LBC(isU3Sd) ==   Gra     Gra     Gra     Gra         ! 3D U-stokes
   LBC(isV3Sd) ==   Gra     Gra     Gra     Gra         ! 3D V-stokes

...

  CHARNOK_ALPHA == 1400.0d0                     ! Charnok surface roughness
 ZOS_HSIG_ALPHA == 0.5d0                        ! roughness from wave amplitude
       SZ_ALPHA == 0.25d0                       ! roughness from wave dissipation
      CRGBAN_CW == 100.0d0                      ! Craig and Banner wave breaking
      WEC_ALPHA == 0.0d0                        ! 0: all wave dissip goes to break and none to roller.
                                                ! 1: all wave dissip goes to roller and none to breaking.

...

I encountered the following error

...
        59 2024-01-01 00:59:00.00  4.419585E-03  1.115973E+04  1.115974E+04  6.567433E+13
                     (206,064,50)  9.602300E-03  1.483858E-02  6.464710E-01  1.033333E+00
        60 2024-01-01 01:00:00.00  4.420215E-03  1.115975E+04  1.115976E+04  6.567435E+13
                     (207,064,50)  8.057617E-03  1.605433E-02  6.978283E-01  1.026012E+00
 ** ROMS grid  1 recv data from SWAN grid  1
SWANtoROMS Min/Max DISBOT  (Wm-2):              NaN           NaN
SWANtoROMS Min/Max DISSURF (Wm-2):              NaN           NaN
SWANtoROMS Min/Max DISWCAP (Wm-2):              NaN           NaN
SWANtoROMS Min/Max HSIGN   (m):        0.000000E+00  1.904785E+00
SWANtoROMS Min/Max RTP     (s):        0.000000E+00  1.118034E+01
SWANtoROMS Min/Max TMBOT   (s):        0.000000E+00  1.793501E+01
SWANtoROMS Min/Max DIR     (rad):      1.413716E+00  5.899213E+00
SWANtoROMS Min/Max DIRP    (rad):      1.134464E+00  6.021386E+00
SWANtoROMS Min/Max WLEN    (m):        1.000000E+00  1.257551E+02
 ** ROMS grid  1 sent data to SWAN grid  1
 == SWAN grid  1 recv data from ROMS grid  1
ROMStoSWAN Min/Max DEPTH   (m):        5.000000E-03  4.527281E+03
ROMStoSWAN Min/Max WLEV    (m):       -5.394259E-01  9.868454E-01
ROMStoSWAN Min/Max VELX    (ms-1):    -1.686727E-02  1.425233E-01
ROMStoSWAN Min/Max VELY    (ms-1):    -3.571428E-01  1.518221E-02
ROMStoSWAN Min/Max ZO      (m):        5.000000E-02  5.000000E-02
      WRT_HIS     - wrote history     fields (Index=1,1) in record = 2
+time 20240101.020000   , step      2; iteration    1; sweep 1 grid   1
+time 20240101.020000   , step      2; iteration    1; sweep 2 grid   1
      WRT_QUICK   - wrote quicksave   fields (Index=1,1) in record = 2
      WRT_AVG     - wrote averaged    fields             in record = 1
        61 2024-01-01 01:01:00.00           NaN           NaN           NaN           NaN
                     (022,146,31)  1.602147E-02  2.644389E-02  1.137825E-02           NaN
 Found Error: 01   Line: 345      Source: ROMS/Nonlinear/main3d.F
 Found Error: 01   Line: 331      Source: ROMS/Drivers/nl_ocean.h, ROMS_run

 Blowing-up: Saving latest model state into  RESTART file
     REASON: KEchar =      NaN, PEchar =      NaN

+time 20240101.020000   , step      2; iteration    1; sweep 3 grid   1
+time 20240101.020000   , step      2; iteration    1; sweep 4 grid   1
 == SWAN grid  1 sent wave data to ROMS grid  1
      WRT_RST     - wrote re-start    fields (Index=1,2) in record = 1
...

What does this mean?
Is there something I missed doing that resulted in DISBOT, DISSURF, and DISWCP being NaN?

Based on the instructions from Swanuse, I read that these three things are related to SET. I have this form in my Swan input:

SET   LEVEL =   0.00  NOR =  90.00    DEPMIN =   0 _              
      MAXMES = 1000   MAXERR = 2 _                                  
      GRAV =    9.81  RHO =  1025.00  INRHOG =      1 _              
      NAUT 

But I'm not sure. Can you help me?

EDIT2
After several trials and research literature, I found a combination like this that fits:

#define ROMS_MODEL
#define SWAN_MODEL
#define MCT_LIB

/* needed for coupling with swan-roms*/
#define WEC_VF
#define WDISS_WAVEMOD
#define ROLLER_RENIERS
...

plus additional change in:
remove INITIAL ZERO in swan input
change OBCFAC to 5 in roms input (before -1)
and the last #define_MY25_MIXING (before #define_GLS_MIXING)

Is it problematic if i don't include UV_KIRBY? If it must be included, what function would be appropriate to replace UV_KIRBY in COAWST? and is it problem when i define MY25_MIXING rather than GLS_MIXING?
Fyi, from these results, a difference between ROMS and its coupling was successfully found.

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