BoldingBruggeman / getm-rewrite

Rewrite of the General Estuarine Transport Model (GETM) in Python (mostly) and Fortran (performance-critical sections)
https://pygetm.readthedocs.io/
Other
7 stars 3 forks source link

2D momentum advection gives segmentation fault #1

Closed bolding closed 3 years ago

bolding commented 3 years ago

Running the box_cartesian case in 2D the model gives segmentation fault when enabling 2D momentum advection

Maybe related to X-grid not being properly defined

knutaros commented 3 years ago

what says the traceback?

On 10/28/20 8:34 AM, Karsten Bolding wrote:

Running the box_cartesian case in 2D the model gives segmentation fault when enabling 2D momentum advection

Maybe related to X-grid not being properly defined

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/BoldingBruggeman/getm-rewrite/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC2RV6U4OJCFDYNROI6X6ATSM7CRRANCNFSM4TB56NCQ.

bolding commented 3 years ago

the issue is not investigated yet - I just comment out the call when I run with test_cartesian

knutaros commented 3 years ago

where can I find test_cartesian?

On 10/28/20 9:00 AM, Karsten Bolding wrote:

the issue is not investigated yet - I just comment out the call when I run with test_cartesian

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/BoldingBruggeman/getm-rewrite/issues/1#issuecomment-717765608, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC2RV6Q6D23PWSTQQ7C2N6LSM7FQ7ANCNFSM4TB56NCQ.

bolding commented 3 years ago

it is just: ./getm_exe /data/kb/getm-setups/box_cartesian/topo.nc adjust the path to topo.nc many things hard coded in the exe file

knutaros commented 3 years ago

can't compile. seems that the repo is not updated with your last changes(?)

[ 94%] Building Fortran object CMakeFiles/getm_exe.dir/src/getm.F90.o /media/work/kklingbe/tools/bb-getm/code/src/getm.F90:187:38:

    length = size(self%bathymetry%pgrid%c1)                                       1 Error: ‘pgrid’ at (1) is not a member of the ‘type_bathymetry’ structure /media/work/kklingbe/tools/bb-getm/code/src/getm.F90:192:38:

    length = size(self%bathymetry%pgrid%c2)                                       1 Error: ‘pgrid’ at (1) is not a member of the ‘type_bathymetry’ structure /media/work/kklingbe/tools/bb-getm/code/src/getm.F90:347:59:

          call self%dynamics%momentum%do_3d(self%mode_split)                                                            1 Error: Missing actual argument for argument ‘dt’ at (1) /media/work/kklingbe/tools/bb-getm/code/src/getm.F90:360:81:

             call temperature%calculate(self%timestep,momentum%pk,momentum%qk,nuh) 1 Error: Missing actual argument for argument ‘rad’ at (1) /media/work/kklingbe/tools/bb-getm/code/src/getm.F90:241:39:

    call self%output%initialize(self%fm)                                        1 Error: More actual than formal arguments in procedure call at (1) /media/work/kklingbe/tools/bb-getm/code/src/getm.F90:181:48:

    call self%domain%configure(self%logs,self%fm)                                                 1 Error: Type mismatch in argument ‘imin’ at (1); passed TYPE(type_logging) to INTEGER(4)

On 10/28/20 11:52 AM, Karsten Bolding wrote:

it is just: ./getm_exe /data/kb/getm-setups/box_cartesian/topo.nc adjust the path to topo.nc many things hard coded in the exe file

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/BoldingBruggeman/getm-rewrite/issues/1#issuecomment-717853047, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC2RV6RDJOG3MKO4CXLSSPTSM7ZVTANCNFSM4TB56NCQ.

bolding commented 3 years ago

forgot to push - sorry

bolding commented 3 years ago

The X-grid is not properly configured - I'll fix that

bolding commented 3 years ago

after properly configuration of X-grid the advection does not give errors and results are different with and without advection - further tests are required

the X-grid calculations must be checked - in uvx_depths() and depth_update()

knutaros commented 3 years ago

shouldn't it read:

diff --git a/src/domain/depth_update.F90 b/src/domain/depth_update.F90 index 20105db..636de61 100644 --- a/src/domain/depth_update.F90 +++ b/src/domain/depth_update.F90 @@ -90,7 +90,7 @@ module SUBROUTINE depth_update(self)  #ifdef USE_MASK        if (XG%mask(i,j) > 0) then  #endif

XG%D(i,j)=max(0.25_real64(UG%D(i,j)+UG%D(i+1,j)+VG%D(i,j)+VG%D(i,j+1)),-XG%H(i,j)+self%Dmin) + XG%D(i,j)=max(0.25_real64(TG%D(i,j)+TG%D(i+1,j)+TG%D(i,j+1)+TG%D(i+1,j+1)),-XG%H(i,j)+self%Dmin)  !KB           XG%alpha(i,j)=1._real64  #ifdef USE_MASK diff --git a/src/domain/uvx_depths.F90 b/src/domain/uvx_depths.F90 index da90e11..6af6100 100644 --- a/src/domain/uvx_depths.F90 +++ b/src/domain/uvx_depths.F90 @@ -137,8 +137,8 @@ module SUBROUTINE uvx_depths(self)     ! X-mask     do j=XG%jmin+1,XG%jmax        do i=XG%imin+1,XG%imax -         if (TG%mask(i,j) > 0 .and. TG%mask(i+1,j) > 0 .and. & -             TG%mask(i,j) > 0 .and. TG%mask(i,j+1) > 0) then +         if (TG%mask(i,j  ) > 0 .and. TG%mask(i+1,j  ) > 0 .and. & +             TG%mask(i,j+1) > 0 .and. TG%mask(i+1,j+1) > 0) then              XG%mask(i,j)=1           end if        end do @@ -147,7 +147,7 @@ module SUBROUTINE uvx_depths(self)     do j=XG%jmin,XG%jmax        do i=XG%imin,XG%imax           if (XG%mask(i,j) > 0) then -            XG%H(i,j) = 0.25_real64(UG%H(i,j)+UG%H(i+1,j)+VG%H(i,j)+VG%H(i,j+1)) +            XG%H(i,j) = 0.25_real64(TG%H(i,j)+TG%H(i+1,j)+TG%H(i,j+1)+VG%H(i+1,j+1))           end if        end do     end do

?

On 10/29/20 10:50 AM, Karsten Bolding wrote:

after properly configuration of X-grid the advection does not give errors and results are different with and without advection - further tests are required

the X-grid calculations must be checked - in uvx_depths() and depth_update()

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/BoldingBruggeman/getm-rewrite/issues/1#issuecomment-718561982, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC2RV6Q2H3W7I7SENXVXYTDSNE3HBANCNFSM4TB56NCQ.

bolding commented 3 years ago
  1. and 3. change as the X-grid is used for advection of U and V I thought it was better the depth is consistent with the depths at the U and V points is it no the same if DU and DV are not modified by drying=

  2. change you are right

knutaros commented 3 years ago

On 10/29/20 2:37 PM, Karsten Bolding wrote:

1.

and 3. change
as the X-grid is used for advection of U and V I thought it was
better the depth is consistent with the depths at the U and V points
is it no the same if DU and DV are not modified by drying=

but then it should be DU(i,j)+DU(i,j+1) and/or DV(i,j)+DV(i+1,j)

bolding commented 3 years ago

that is for sure correct - and I even had the figure in front of me :-)