Hi,
My issue might happen only with my compiler but I thought it was still worth reporting.
My model was randomly blowing up while writing the bedload average output (surprisingly it had no issue with the history output). It seems to me that the output bedload fluxes are not given (nor initialized) along the boundaries (the bedload itself is, but not the output variables bedldu and bedldv).
I just wrote a quick workaround in sed_bedload.F (see below). I know it is a bit sloppy, and there is probably a better way to do it using the right set of indices, and setting it to the right values rather than 0, but I'm relatively new to ROMS and it works for me in the meantime.
Cheers,
Francois
!-----------------------------------------------------------------------
! Output bedload fluxes.
!-----------------------------------------------------------------------
!
cff=0.5_r8/dt(ng)
DO j=JstrR,JendR
DO i=Istr,IendR
bedldu(i,j,ised)=FX(i,j)*(pn(i-1,j)+pn(i,j))*cff
END DO
END DO
DO j=Jstr,JendR
DO i=IstrR,IendR
bedldv(i,j,ised)=FE(i,j)*(pm(i,j-1)+pm(i,j))*cff
END DO
END DO
!EVERYTHING 0 at boundaries
IF (DOMAIN(ng)%Western_Edge(tile)) THEN
DO j=Jstrm1,Jendp1
bedldu(Istr-1,j,ised)=0.
bedldv(Istr-1,j,ised)=0.
END DO
END IF
IF (DOMAIN(ng)%Eastern_Edge(tile)) THEN
DO j=Jstrm1,Jendp1
bedldu(Iend+1,j,ised)=0.
bedldv(Iend+1,j,ised)=0.
END DO
END IF
IF (DOMAIN(ng)%Southern_Edge(tile)) THEN
DO i=Istrm1,Iendp1
bedldu(i,Jstr-1,ised)=0.
bedldv(i,Jstr-1,ised)=0.
END DO
END IF
IF (DOMAIN(ng)%Northern_Edge(tile)) THEN
DO i=Istrm1,Iendp1
bedldu(i,Jend+1,ised)=0.
bedldv(i,Jend+1,ised)=0.
END DO
END IF
END DO
Sediment bedload output issue
Re: Sediment bedload output issue
it is good to see that you can figure out the code, but i really dont see why those BC's would be needed. The bedldu is at u points, and the bedldv is at v points. So the call
DO j=JstrR,JendR
DO i=Istr,IendR
bedldu(i,j,ised)=FX(i,j)*(pn(i-1,j)+pn(i,j))*cff
would do all the u points. there is no need to add
bedldu(Istr-1,j,ised)=0.
because that point is never written out. that would be at a u=0 point, and that is a ghost point.
so if this fixed something, then something else was not correct and this helped to remove a nan or something.
-j
DO j=JstrR,JendR
DO i=Istr,IendR
bedldu(i,j,ised)=FX(i,j)*(pn(i-1,j)+pn(i,j))*cff
would do all the u points. there is no need to add
bedldu(Istr-1,j,ised)=0.
because that point is never written out. that would be at a u=0 point, and that is a ghost point.
so if this fixed something, then something else was not correct and this helped to remove a nan or something.
-j
Re: Sediment bedload output issue
Not sure what's going on then...
I actually don't have any issue with bedldu along western and eastern boundaries or with bedldv along northern and southern boundaries.
Only bedldu along N and S and bedldv along E and W boundaries have issues (I showed bedldu along the northern boundary and bedldv along the western boundary after and before my fix in attached figures).
I'm getting a bit confused but after a few tests ((i)putting all bedldu and bedldv to 1. within the loop that you mentioned, or (ii)trying to force the bedload to be 0 everywhere upfront (bedld_x and bedld_y=0 , or tau_wav=tau_mean=0 at the beginning)) I feel that it is actually FX and FE that are not defined everywhere.
(i) with this test, my outputs are as expected, i.e 1 everywhere in the netcdf file.
(ii) with this test, in the netcdf file bedldu and bedldv are 0 everywhere except along the boundaries.
I'm struggling to navigate through the code and the indices but I feel that FX(i,JstrR), FX(i,JendR),FE(IstrR,j) and FE(IendR,j) should be defined and doesn't seem to be. I'm using the Soulsby formulation, and my boundaries are closed. Any comments?
Cheers,
Francois
I actually don't have any issue with bedldu along western and eastern boundaries or with bedldv along northern and southern boundaries.
Only bedldu along N and S and bedldv along E and W boundaries have issues (I showed bedldu along the northern boundary and bedldv along the western boundary after and before my fix in attached figures).
I'm getting a bit confused but after a few tests ((i)putting all bedldu and bedldv to 1. within the loop that you mentioned, or (ii)trying to force the bedload to be 0 everywhere upfront (bedld_x and bedld_y=0 , or tau_wav=tau_mean=0 at the beginning)) I feel that it is actually FX and FE that are not defined everywhere.
(i) with this test, my outputs are as expected, i.e 1 everywhere in the netcdf file.
(ii) with this test, in the netcdf file bedldu and bedldv are 0 everywhere except along the boundaries.
I'm struggling to navigate through the code and the indices but I feel that FX(i,JstrR), FX(i,JendR),FE(IstrR,j) and FE(IendR,j) should be defined and doesn't seem to be. I'm using the Soulsby formulation, and my boundaries are closed. Any comments?
Cheers,
Francois
- Attachments
-
- bedldv along western boundary after modif
- bdc_w_bedldv_after.gif (7.13 KiB) Viewed 2840 times
-
- bedldu along northern boundary after modif
- bdc_n_bedldu_after.gif (7.2 KiB) Viewed 2840 times
-
- bedldv along western boundary before modif
- bdc_w_bedldv.gif (11.59 KiB) Viewed 2840 times