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

Workbench merge cavity #48

Merged
merged 45 commits into from
Jan 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
07b7a5b
add cavity to mesh partitioning routine, reads cavity depth, writes …
patrickscholz May 26, 2020
37faf29
Merge branch 'master' of https://gitlab.dkrz.de/FESOM/fesom2 into wor…
patrickscholz May 26, 2020
091ede2
do not create cavity flag file during partitioning use instead the c…
patrickscholz May 27, 2020
b696717
read and setup cavity information when model is initialised
patrickscholz May 27, 2020
c78b94a
change variable names for upper cavity index to ulevels and ulevels_…
patrickscholz Jun 20, 2020
7cab6d0
add upper cavity index to all gen_... routines
patrickscholz Jun 20, 2020
f4ef969
add upper cavity index to ice_... routines
patrickscholz Jun 20, 2020
f059eab
add cavity index to all oce_... routines
patrickscholz Jun 20, 2020
55e3d69
add cavity variables to mesh files
patrickscholz Jun 20, 2020
d354c6a
correct cavity bug in src/oce_ale_fct_3d_adv.F90 and clean up remaini…
patrickscholz Jun 25, 2020
43cf4b6
add cavity subroutines for extrapolation, momentum flux, heat and fr…
patrickscholz Jul 1, 2020
d13c44b
correct cavity creation during partitioning so that there are enoug…
patrickscholz Jul 8, 2020
95fae61
improve ice part in case of cavity
patrickscholz Jul 8, 2020
77ae15d
improve gen_... routines when using cavity
patrickscholz Jul 8, 2020
bb1df1f
add namelist flag for cavity surface partial cells
patrickscholz Jul 8, 2020
ae618ff
delete debug markings
patrickscholz Jul 8, 2020
0894692
correct monin-obukov mixing under cavity
patrickscholz Jul 8, 2020
7232d40
add varaible for vertice and element surface level depth
patrickscholz Jul 8, 2020
eacd99c
add cavity changes for surface partial cell, like computation of sur…
patrickscholz Jul 8, 2020
c072d1e
add routine to compute pressure gradient force in case cavity surfac…
patrickscholz Jul 8, 2020
cd895a4
add some more error information
patrickscholz Jul 8, 2020
081cf51
exchange some order in gen_ic3d2
patrickscholz Jul 9, 2020
e82d21d
correct bug in oce_ale_mixing_kpp regarding the proper mid depth lev…
patrickscholz Jul 9, 2020
aa3b266
correct bug in oce_ale_pressure_bv regarding the proper mid depth le…
patrickscholz Jul 9, 2020
2423e82
improve my python plotting
patrickscholz Jul 9, 2020
e553e22
add use_density_ref as namelist parameter
patrickscholz Jul 16, 2020
1337040
correct bugs in ice_... routines
patrickscholz Jul 16, 2020
6819716
correct minor cavity bugs in forcing part
patrickscholz Jul 16, 2020
ce82504
add if cavity into soutine for bulk formular
patrickscholz Jul 16, 2020
eaede25
kick out density_ref from computation of brunt väisälä frequence N^2…
patrickscholz Jul 16, 2020
cd9455d
correct small bug in oce_ale_mixing_kpp
patrickscholz Jul 16, 2020
bbff18a
coorect small bug in cavity heat flux subroutine when computing the …
patrickscholz Jul 16, 2020
872b354
add some cavity plotting option to my python subroutine
patrickscholz Jul 16, 2020
25ca1e5
correct small bug indice bug in ocean shortwave penetration
patrickscholz Jul 17, 2020
7c242fc
add all changes due to cavity implementation to latestest master vers…
patrickscholz Dec 13, 2020
36eef02
correct indice bug, and missing interface bug
patrickscholz Dec 13, 2020
c320960
correct interface bug for the second time
patrickscholz Dec 13, 2020
c50f94f
correct interface bug for the third time
patrickscholz Dec 13, 2020
02128ec
fix interface issue in oce_ale.F90
patrickscholz Dec 13, 2020
565ed18
fix interface issue in src/oce_ale_pressure_bv.F90
patrickscholz Dec 13, 2020
d58dc0e
fix interface issue in src/oce_ale_tracer.F90
patrickscholz Dec 13, 2020
c365649
globally balance also the freshwater flux that comes from the ocean-c…
patrickscholz Dec 14, 2020
8d6b4e0
delete comment
patrickscholz Dec 14, 2020
1e3c563
fix bug when using surface partial cells with zstar + add namelist f…
patrickscholz Dec 17, 2020
c7f0a51
correct bug from cavity in tracer fct
patrickscholz Dec 28, 2020
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
2 changes: 2 additions & 0 deletions config/namelist.config
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ include_fleapyear=.false.

&run_config
use_ice=.true. ! ocean+ice
use_cavity=.false. !
use_cavity_partial_cell=.false.
use_floatice = .false.
use_sw_pene=.true.
/
Expand Down
1 change: 1 addition & 0 deletions mesh_part/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ add_executable(${PROJECT_NAME} ${sources_Fortran})
# CMAKE_Fortran_COMPILER_ID will also work if a wrapper is being used (e.g. mpif90 wraps ifort -> compiler id is Intel)
if(${CMAKE_Fortran_COMPILER_ID} STREQUAL Intel )
target_compile_options(${PROJECT_NAME} PRIVATE -r8 -i4 -fp-model precise -no-prec-div -no-prec-sqrt -fast-transcendentals -xHost -ip)
# target_compile_options(${PROJECT_NAME} PRIVATE -r8 -i4 -fp-model precise -no-prec-div -no-prec-sqrt -fast-transcendentals -xHost -ip -g -traceback -check all,noarg_temp_created,bounds,uninit)
elseif(${CMAKE_Fortran_COMPILER_ID} STREQUAL GNU )
target_compile_options(${PROJECT_NAME} PRIVATE -fdefault-real-8 -ffree-line-length-none)
endif()
Expand Down
44 changes: 39 additions & 5 deletions src/MOD_MESH.F90
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ MODULE MOD_MESH
integer, allocatable, dimension(:,:) :: elem2D_nodes ! elem2D_nodes(:,n) lists; 3 nodes of element n
integer, allocatable, dimension(:,:) :: edges ! edge(:,n) lists 2 nodes; edge n
integer, allocatable, dimension(:,:) :: edge_tri ! edge_tri(:,n) lists 2
! elements containing edge n: the first one is to left
! of the line directed to the second node
! elements containing edge n: the first one is to left
! of the line directed to the second node
integer, allocatable, dimension(:,:) :: elem_edges ! elem_edges(:,n) are edges of element n.
real(kind=WP), allocatable, dimension(:) :: elem_area
real(kind=WP), allocatable, dimension(:,:) :: edge_dxdy, edge_cross_dxdy
Expand All @@ -43,13 +43,47 @@ MODULE MOD_MESH
real(kind=WP), allocatable, dimension(:,:) :: gradient_sca ! Coefficients to compute gradient of scalars
! on elements
INTEGER, ALLOCATABLE, DIMENSION(:) :: bc_index_nod2D(:)
! vertical structure
! vertical structure
!
!
!___vertical mesh info__________________________________________________________
! total number of layers
integer :: nl

! initial layer, mid-depth layer and element depth
real(kind=WP), allocatable, dimension(:) :: zbar, Z,elem_depth
integer, allocatable, dimension(:) :: nlevels, nlevels_nod2D

! upper boudnary index of all vertical vertice/element loops, default==1 but when
! cavity is used becomes index of cavity-ocean boundary at vertices and elements
integer, allocatable, dimension(:) :: ulevels, ulevels_nod2D, ulevels_nod2D_max

! number of levels at elem and vertices considering bottom topography
integer, allocatable, dimension(:) :: nlevels, nlevels_nod2D, nlevels_nod2D_min

!
!
!___horizontal mesh info________________________________________________________
real(kind=WP), allocatable, dimension(:,:) :: area, area_inv
real(kind=WP), allocatable, dimension(:) :: mesh_resolution
! Elevation stiffness matrix

!
!
!___cavity mesh info____________________________________________________________
! level index of cavity-ocean boundary at vertices and elements
! --> see: ulevels, ulevels_nod2D (fvom_main)

! vertice/element yes=1/no=0 flag if cavity exists
integer, allocatable, dimension(:) :: cavity_flag_n, cavity_flag_e

! depth of cavity-ocean interface
real(kind=WP), allocatable, dimension(:) :: cavity_depth


real(kind=WP), allocatable, dimension(:,:) :: cavity_nrst_cavlpnt_xyz

!
!
!___Elevation stiffness matrix__________________________________________________
type(sparse_matrix) :: ssh_stiff

!#if defined (__oasis)
Expand Down
34 changes: 27 additions & 7 deletions src/associate_mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,15 @@ real(kind=WP), dimension(:,:), pointer :: gradient_vec
real(kind=WP), dimension(:,:), pointer :: gradient_sca
integer, dimension(:) , pointer :: bc_index_nod2D
real(kind=WP), dimension(:) , pointer :: zbar, Z, elem_depth
integer, dimension(:) , pointer :: nlevels, nlevels_nod2D
integer, dimension(:) , pointer :: nlevels, nlevels_nod2D, nlevels_nod2D_min
real(kind=WP), dimension(:,:), pointer :: area, area_inv
real(kind=WP), dimension(:) , pointer :: mesh_resolution
real(kind=WP), dimension(:) , pointer :: lump2d_north, lump2d_south
type(sparse_matrix) , pointer :: ssh_stiff
!!$integer, dimension(:) , pointer :: cavity_lev_nod2D, cavity_lev_elem2D
integer, dimension(:) , pointer :: cavity_flag_n, cavity_flag_e
real(kind=WP), dimension(:) , pointer :: cavity_depth
integer, dimension(:) , pointer :: ulevels, ulevels_nod2D, ulevels_nod2D_max

nod2D => mesh%nod2D
elem2D => mesh%elem2D
Expand All @@ -34,9 +38,9 @@ edge2D_in => mesh%edge2D_in
ocean_area => mesh%ocean_area
nl => mesh%nl

!!$coord_nod2D => mesh%coord_nod2D
!!$geo_coord_nod2D => mesh%geo_coord_nod2D
!!$elem2D_nodes => mesh%elem2D_nodes
!!$coord_nod2D => mesh%coord_nod2D
!!$geo_coord_nod2D => mesh%geo_coord_nod2D
!!$elem2D_nodes => mesh%elem2D_nodes
!!$edges => mesh%edges
!!$edge_tri => mesh%edge_tri
!!$elem_edges => mesh%elem_edges
Expand All @@ -59,11 +63,18 @@ nl => mesh%nl
!!$elem_depth => mesh%elem_depth
!!$nlevels => mesh%nlevels
!!$nlevels_nod2D => mesh%nlevels_nod2D
!!$nlevels_nod2D_min => mesh%nlevels_nod2D_min
!!$area => mesh%area
!!$area_inv => mesh%area_inv
!!$mesh_resolution => mesh%mesh_resolution
!!$ssh_stiff => mesh%ssh_stiff

!!$cavity_flag => mesh%cavity_flag
!!$cavity_lev_nod2D => mesh%cavity_lev_nod2D
!!$cavity_lev_elem2D => mesh%cavity_lev_elem2D
!!$cavity_depth => mesh%cavity_depth
!!$ulevels => mesh%ulevels
!!$ulevels_nod2D => mesh%ulevels_nod2D
!!$ulevels_nod2D_max => mesh%ulevels_nod2D_max

coord_nod2D(1:2,1:myDim_nod2D+eDim_nod2D) => mesh%coord_nod2D
geo_coord_nod2D(1:2,1:myDim_nod2D+eDim_nod2D) => mesh%geo_coord_nod2D
Expand All @@ -90,9 +101,18 @@ Z(1:mesh%nl-1) => mesh%Z
elem_depth => mesh%elem_depth ! never used, not even allocated
nlevels(1:myDim_elem2D+eDim_elem2D+eXDim_elem2D) => mesh%nlevels
nlevels_nod2D(1:myDim_nod2D+eDim_nod2D) => mesh%nlevels_nod2D
area(1:mesh%nl,1:myDim_nod2d+eDim_nod2D) => mesh%area
area_inv(1:mesh%nl,1:myDim_nod2d+eDim_nod2D) => mesh%area_inv
nlevels_nod2D_min(1:myDim_nod2D+eDim_nod2D) => mesh%nlevels_nod2D_min
area(1:mesh%nl,1:myDim_nod2d+eDim_nod2D) => mesh%area
area_inv(1:mesh%nl,1:myDim_nod2d+eDim_nod2D) => mesh%area_inv
mesh_resolution(1:myDim_nod2d+eDim_nod2D) => mesh%mesh_resolution
ssh_stiff => mesh%ssh_stiff
lump2d_north(1:myDim_nod2d) => mesh%lump2d_north
lump2d_south(1:myDim_nod2d) => mesh%lump2d_south
cavity_flag_n(1:myDim_nod2D+eDim_nod2D) => mesh%cavity_flag_n
cavity_flag_e(1:myDim_elem2D+eDim_elem2D+eXDim_elem2D) => mesh%cavity_flag_e
!!$cavity_lev_nod2D(1:myDim_nod2D+eDim_nod2D) => mesh%cavity_lev_nod2D
!!$cavity_lev_elem2D(1:myDim_elem2D+eDim_elem2D+eXDim_elem2D) => mesh%cavity_lev_elem2D
cavity_depth(1:myDim_nod2D+eDim_nod2D) => mesh%cavity_depth
ulevels(1:myDim_elem2D+eDim_elem2D+eXDim_elem2D) => mesh%ulevels
ulevels_nod2D(1:myDim_nod2D+eDim_nod2D) => mesh%ulevels_nod2D
ulevels_nod2D_max(1:myDim_nod2D+eDim_nod2D) => mesh%ulevels_nod2D_max
7 changes: 7 additions & 0 deletions src/associate_mesh_ini.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ real(kind=WP), dimension(:) , pointer :: zbar, Z, elem_depth
integer, dimension(:) , pointer :: nlevels, nlevels_nod2D
real(kind=WP), dimension(:,:), pointer :: area, area_inv
real(kind=WP), dimension(:) , pointer :: mesh_resolution
integer, dimension(:) , pointer :: cavity_flag, ulevels_nod2D, ulevels
real(kind=WP), dimension(:) , pointer :: cavity_depth
type(sparse_matrix) , pointer :: ssh_stiff

nod2D => mesh%nod2D
Expand Down Expand Up @@ -62,3 +64,8 @@ area => mesh%area
area_inv => mesh%area_inv
mesh_resolution => mesh%mesh_resolution
ssh_stiff => mesh%ssh_stiff
!!$cavity_flag_n => mesh%cavity_flag_n
!!$cavity_flag_e => mesh%cavity_flag_e
ulevels_nod2D => mesh%ulevels_nod2D
ulevels => mesh%ulevels
cavity_depth => mesh%cavity_depth
Loading