typos in radiation_stress.F

Bug reports, work arounds and fixes

Moderators: arango, robertson

Post Reply
Message
Author
ljzhong
Posts: 15
Joined: Tue Nov 25, 2003 3:36 pm
Location: CSIRO

typos in radiation_stress.F

#1 Unread post by ljzhong »

I think Sxy_psi in radiation_stress.F should be replaced by Sxyl_psi. There is no definition of Sxy_psi in radiation_stress.F. It appears 5 times in the code.

It only affects 2D applications.

Liejun

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

Re: typos in radiation_stress.F

#2 Unread post by jcwarner »

do not modify that code. It is correct. There are temporary arrays that get used due to the averaging from rho points to psi points.

ljzhong
Posts: 15
Joined: Tue Nov 25, 2003 3:36 pm
Location: CSIRO

Re: typos in radiation_stress.F

#3 Unread post by ljzhong »

But then I could not pass the compilation. It complained that Sxy_psi is not defined. Actually I searched all files in ROMS subfolders and could not find its definition.

Is Sxyl_psi the temporary array you mentioned?

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

Re: typos in radiation_stress.F

#4 Unread post by jcwarner »

well, ok. You will need to provide more information. I have run many applications with that option activated, and have not encountered the problems that you appear to be facing. Can you please be more specific as the the compilation problem?

ljzhong
Posts: 15
Joined: Tue Nov 25, 2003 3:36 pm
Location: CSIRO

Re: typos in radiation_stress.F

#5 Unread post by ljzhong »

I am using ifort ver10 to compile ROMS 258M. It stopped at
/usr/bin/cpp -P -traditional -DMPI -DLINUX -DIA64 -DIFORT -D'ROOT_DIR="xxx/romscode"' -DWAVEBREAK -D'HEADER="wavebreak.h"' -D'ROMS_HEADER="xxx/swan/2drun//wavebreak.h"' -DNestedGrids=1 -D'ANALYTICAL_DIR="xxx/romscode/ROMS/Functionals"' -D'SVN_REV="258M"' -IROMS/Include -IROMS/Nonlinear -IROMS/Utility -IROMS/Drivers -IROMS/Functionals -Ixxx/swan/2drun/ -IWaves/SWAN/Src -IMaster -ICompilers -D'HEADER_DIR="xxx/swan/2drun/"' ROMS/Nonlinear/radiation_stress.F > Build/radiation_stress.f90
ROMS/Bin/cpp_clean Build/radiation_stress.f90
cd Build;
ifort -c -ip -O2 -fpe0 -Ixxx/MCT/include radiation_stress.f90
fortcom: Error: radiation_stress.f90, line 233: This name has not been declared as an array or a function. [SXY_PSI]
Sxy_psi(i,j)=0.25_r8*(Sxyl(i-1,j-1)+Sxyl(i,j-1)+ &
----------^
compilation aborted for radiation_stress.f90 (code 1)
make: *** [Build/radiation_stress.o] Error 1
It is a 2D simulation of wave breaking to generate longshore current on an idealized geometry. After I made the modification mentioned in my first post, I did get the results we expected.

stef
Posts: 175
Joined: Tue Mar 13, 2007 6:38 pm
Location: Independent researcher
Contact:

Re: typos in radiation_stress.F

#6 Unread post by stef »

I'm trying to set up a minimal storm surge model and hit the same bug. It seems to affect any 2d application using both NEARSHORE_MELLOR0*. I don't know much about wind waves yet, still reading literature. But this is still a bug, isn't it?

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

Re: typos in radiation_stress.F

#7 Unread post by jcwarner »

we dont really use the Mellor approach any more. suggest that you use the vortex force method (based on wave energy dissipation instead of wave energy gradients). if you want to use the WEC method, we have that in our coawst system. send me an email and i can add you to the distribution.
jcwarner@usgs.gov

-j

stef
Posts: 175
Joined: Tue Mar 13, 2007 6:38 pm
Location: Independent researcher
Contact:

Re: typos in radiation_stress.F

#8 Unread post by stef »

Thanks John, I sent the email!

Sooner or later I wanted to learn about COAWST anyways, so that's great.

For the near future, I have to keep it simple as I'm still learning nearshore processes, wind waves and small scales in general.

I looked for the most simple method to compute wave setup. SWAN has a built-in method, but it's not parallel and takes quite long. Maybe it's because of the Poisson equation they use?Also,they say in the documentation it's restricted to non-spherical grids. ANyways, I can make a series of stationary computations with SWAN, although I'm not sure yet if this makes sense physically, especially for a quickly approaching storm.

I browsed through the Kumar (2012) paper explaining the method, and they do talk about wave setup a couple of times, so I'll read it more thoroughly and start playing with COAWST.

Regards, S.

stef
Posts: 175
Joined: Tue Mar 13, 2007 6:38 pm
Location: Independent researcher
Contact:

Re: typos in radiation_stress.F

#9 Unread post by stef »

Also, there is a typo in the computation of the radiation stress component derivative for the vbar forcing:

Code: Select all

>> git diff master mybranch ROMS/Nonlinear/nearshore_mellor08.h 

...

@@ -1116,9 +1116,9 @@
       DO j=JstrV,Jend
         DO i=Istr,Iend
           cff=(Syyl(i,j  )-                                             &
-     &         Syyl(i,j-1))*on_v(i,j)+                                  &
-     &        (Sxy_psi(i+1,j)-                                          &
-     &         Sxy_psi(i  ,j))*on_u(i,j)
+     &         Syyl(i,j-1))*om_v(i,j)+                                  &
+     &        (Sxyl_psi(i+1,j)-                                          &
+     &         Sxyl_psi(i  ,j))*on_v(i,j)
           rvstr2d(i,j)=cff
 !
 !  Convert units to m2/s2 for output purposes.
Only affects 2d setups with non-equidistant grids. I noticed it while configuring a 2d version of the 3d "Plane beach—spectral waves oblique incident" test case of Haas & Warner (2009) (also used in Uchiyama et al. (2010)). I'll compare it to the the vortex force method later. Uchiyama et al. (2010) do use a 2d vortex-force version of that experiment in addition to the 3-d cases.

Post Reply