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

Fix/2.1 awiesm 2.1 async icebergs #363

Open
wants to merge 7 commits into
base: 2.1-awiesm-2.1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions config/namelist.config
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,11 @@ use_sw_pene=.true.
n_levels=2
n_part= 12, 36 ! 432 number of partitions on each hierarchy level
/

&icebergs
use_icesheet_coupling=.false.
ib_num=1
use_icebergs=.false.
steps_per_ib_step=8
ib_async_mode=0
/
4 changes: 2 additions & 2 deletions src/fvom_main.F90
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ program main

type(t_mesh), target, save :: mesh

#if defined (__async_icebergs)
!#if defined (__async_icebergs)
! kh 26.03.21 get current values for ib_async_mode and thread_support_level_required
call read_namelist_icebergs
#endif
!#endif

#ifndef __oifs
!ECHAM6-FESOM2 coupling: cpl_oasis3mct_init is called here in order to avoid circular dependencies between modules (cpl_driver and g_PARSUP)
Expand Down
2 changes: 1 addition & 1 deletion src/icb_allocate.F90
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ subroutine allocate_icb()
allocate(arr_block(15*ib_num))
allocate(elem_block(ib_num))
allocate(vl_block(4*ib_num))
allocate(buoy_props(ib_num,12))
allocate(buoy_props(ib_num,13))
buoy_props = 0.0
allocate(melted(ib_num))
melted = .false.
Expand Down
78 changes: 49 additions & 29 deletions src/icb_coupling.F90
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,29 @@ subroutine prepare_icb2fesom(mesh, ib,i_have_element,localelement,depth_ib)
integer :: iceberg_node
integer, dimension(3) :: ib_nods_in_ib_elem
integer :: num_ib_nods_in_ib_elem
integer :: i, ib
type(t_mesh), intent(in) , target :: mesh
#include "associate_mesh.h"

if(i_have_element) then
! ##############################################################
! LA: spread fluxes over all nodes of element, 25.04.2022
call get_iceberg_nodes_for_element(mesh, localelement, ib_nods_in_ib_elem, num_ib_nods_in_ib_elem)
!call get_iceberg_nodes_for_element(mesh, localelement, ib_nods_in_ib_elem, num_ib_nods_in_ib_elem)
!call get_iceberg_nodes_for_element(elem2d_nodes, localelement, ib_nods_in_ib_elem, num_ib_nods_in_ib_elem)
num_ib_nods_in_ib_elem=0

do i=1,3
iceberg_node=elem2d_nodes(i,localelement)

if (iceberg_node<=mydim_nod2d) then
ib_nods_in_ib_elem(i) = iceberg_node
num_ib_nods_in_ib_elem = num_ib_nods_in_ib_elem + 1
else
ib_nods_in_ib_elem(i) = 0
end if
end do
! ##############################################################

!write(*,*) "LA DEBUG: ib_nods_in_ib_elem=",ib_nods_in_ib_elem,", num_ib_nods_in_ib_elem=",num_ib_nods_in_ib_elem
do i=1, 3
iceberg_node=ib_nods_in_ib_elem(i)
Expand All @@ -65,34 +81,37 @@ subroutine prepare_icb2fesom(mesh, ib,i_have_element,localelement,depth_ib)
end if
end subroutine prepare_icb2fesom

subroutine get_iceberg_nodes_for_element(mesh, localelement, ib_nods_in_ib_elem, num_ib_nods_in_ib_elem)
use o_param
use o_mesh
use MOD_MESH
use g_config
use g_parsup
use i_arrays
use iceberg_params

integer, intent(in) :: localelement
integer, dimension(3), intent(inout) :: ib_nods_in_ib_elem
integer, intent(inout) :: num_ib_nods_in_ib_elem
type(t_mesh), intent(in) , target :: mesh
#include "associate_mesh.h"

num_ib_nods_in_ib_elem=0

do i=1,3
iceberg_node=elem2d_nodes(i,localelement)

if (iceberg_node<=mydim_nod2d) then
ib_nods_in_ib_elem(i) = iceberg_node
num_ib_nods_in_ib_elem = num_ib_nods_in_ib_elem + 1
else
ib_nods_in_ib_elem(i) = 0
end if
end do
end subroutine get_iceberg_nodes_for_element
!subroutine get_iceberg_nodes_for_element(elem2d_nodes, localelement, ib_nods_in_ib_elem, num_ib_nods_in_ib_elem)
! use o_param
! use o_mesh
! use MOD_MESH
! use g_config
! use g_parsup
! use i_arrays
! use iceberg_params
!
! integer, intent(in) :: localelement
! integer, dimension(3), intent(inout) :: ib_nods_in_ib_elem
! integer, intent(inout) :: num_ib_nods_in_ib_elem
! integer :: i, iceberg_node
! integer, dimension(:,:), intent(in) :: elem2d_nodes
!! integer, intent(in) :: mydim_nod2d
!!type(t_mesh), intent(in) :: mesh
!!#include "associate_mesh.h"
!
! num_ib_nods_in_ib_elem=0
!
! do i=1,3
! iceberg_node=elem2d_nodes(i,localelement)
!
! if (iceberg_node<=mydim_nod2d) then
! ib_nods_in_ib_elem(i) = iceberg_node
! num_ib_nods_in_ib_elem = num_ib_nods_in_ib_elem + 1
! else
! ib_nods_in_ib_elem(i) = 0
! end if
! end do
!end subroutine get_iceberg_nodes_for_element


subroutine icb2fesom(mesh)
Expand All @@ -110,6 +129,7 @@ subroutine icb2fesom(mesh)
use g_parsup
use i_arrays
use iceberg_params
integer :: n
type(t_mesh), intent(in) , target :: mesh
#include "associate_mesh.h"

Expand Down