Hi Roms users!
I try to define a shape function for sources, but the simulation doesn't respect the shape... I don't know if there is something specific to do?
In my header file, I have defined:
#define UV_PSOURCE
#ifdef UV_PSOURCE
# define TS_PSOURCE
# define ANA_PSOURCE
#endif
In ANA_PSOURCE, I defined my sources, then I define their shape:
# if defined DRAVEIL
DO k=1,N(ng)-6
DO is=1,Nsrc
i=Isrc(is)
j=Jsrc(is)
Qshape(is,k)=0.0_r8
END DO
END DO
DO k=N(ng)-5,N(ng)
DO is=1,Nsrc
i=Isrc(is)
j=Jsrc(is)
Qshape(is,k)=1.0_r8/6.0_r8
END DO
END DO
Eventually, I defined Qbar and their temperature. Everytnig seems good, except the shape of sources, because the flow is over the entire water column.
Thanks in advance for your answer.
How to use Qshape in ANA_PSOURCE?
Re: How to use Qshape in ANA_PSOURCE?
I have tried with an other source but this one is not beside a wall, it is just a source of momentum. This source works well, and respect Qbar and Qshape, that is to say, when I calculate, u(source)*dy*dz, it is equal to Qbar.
The two other sources does not respect Qshape and Qbar... I don't know why?
Someone can help me?
Thanks in advance
The two other sources does not respect Qshape and Qbar... I don't know why?
Someone can help me?
Thanks in advance
Re: How to use Qshape in ANA_PSOURCE?
I try with oceanG.exe, it gives this error:
At line 632 of file analytical.f90
Fortran runtime error: Array reference out of bounds for array 'z_w', lower bound
of dimension 1 exceeded (-1 < 0)
This error corresponds on this part of the analytical.f90 file:
DO is=1,2
cff=0.0_r8
i=Isrc(is)
j=Jsrc(is)
Qshape(is,k)=cff*(z_w(i-1,j,k )-z_w(i-1,j,k-1)+ &
& z_w(i ,j,k )-z_w(i ,j,k-1))/ &
& (z_w(i-1,j,N(ng)-4)-z_w(i-1,j,0 )+ &
& z_w(i ,j,N(ng)-4)-z_w(i ,j,0 ))
My model works when I use the real value, like that:
Qshape(is,k)=cff*(z_w(37 ,j,k )-z_w(37 ,j,k-1)+ &
& z_w(i ,j,k )-z_w(i ,j,k-1))/ &
& (z_w(37 ,j,N(ng)-4)-z_w(37 ,j,0 )+ &
& z_w(i ,j,N(ng)-4)-z_w(i ,j,0 ))
Why my model does not understand Isrc(is) and Jsrc(is), wheareas it is used in examples???
I attach my analytical.f90 file if someone is interested.
Thanks in advance
Antoine
At line 632 of file analytical.f90
Fortran runtime error: Array reference out of bounds for array 'z_w', lower bound
of dimension 1 exceeded (-1 < 0)
This error corresponds on this part of the analytical.f90 file:
DO is=1,2
cff=0.0_r8
i=Isrc(is)
j=Jsrc(is)
Qshape(is,k)=cff*(z_w(i-1,j,k )-z_w(i-1,j,k-1)+ &
& z_w(i ,j,k )-z_w(i ,j,k-1))/ &
& (z_w(i-1,j,N(ng)-4)-z_w(i-1,j,0 )+ &
& z_w(i ,j,N(ng)-4)-z_w(i ,j,0 ))
My model works when I use the real value, like that:
Qshape(is,k)=cff*(z_w(37 ,j,k )-z_w(37 ,j,k-1)+ &
& z_w(i ,j,k )-z_w(i ,j,k-1))/ &
& (z_w(37 ,j,N(ng)-4)-z_w(37 ,j,0 )+ &
& z_w(i ,j,N(ng)-4)-z_w(i ,j,0 ))
Why my model does not understand Isrc(is) and Jsrc(is), wheareas it is used in examples???
I attach my analytical.f90 file if someone is interested.
Thanks in advance
Antoine
- Attachments
-
- analytical.f90
- analytical.f90 file
- (52.66 KiB) Downloaded 197 times
- arango
- Site Admin
- Posts: 1367
- Joined: Wed Feb 26, 2003 4:41 pm
- Location: DMCS, Rutgers University
- Contact:
Re: How to use Qshape in ANA_PSOURCE?
I have repeatedly mentioned in this forum to use a NetCDF file for the river forcing. It requires a lot of expertise to use ANA_PSOURCE correctly. It is even harder for me and takes a lot of debugging in TotalView to code this correctly in parallel each time. There is a lot of messages in this forum about this. This recommendation is frequently ignored.
We don't have the time to debug user's code... Your code above is incorrect, if you run in parallel. If you do not know why, it proves our point of using a river forcing NetCDF instead.
We don't have the time to debug user's code... Your code above is incorrect, if you run in parallel. If you do not know why, it proves our point of using a river forcing NetCDF instead.