Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
ywkawai committed Sep 12, 2021
2 parents 6e5c764 + b94fe0d commit 8424d4d
Show file tree
Hide file tree
Showing 207 changed files with 28,910 additions and 4,640 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/FEProject_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,12 @@ jobs:
make -C mesh_rectdom2d_quadrilateral
make -C mesh_cubedsphere2d
make -C mesh_cubedom3d_hexahedral
make -C mesh_cubedsphere3d
make -C field_linedom1d
make -C field_rectdom2d_quadrilateral
make -C field_cubedspheredom2d
make -C field_cubedom3d_hexahedral
make -C field_cubedspheredom3d
- name: unit test for framework
run: |
Expand All @@ -115,8 +117,10 @@ jobs:
make -C advect2dGlobal
make -C advect2d_fvm
make -C advect3d
make -C advect3dGlobal
make -C advect3d_hevi
make -C euler3d_hevi
make -C eigen_analysis
- name: Build model
run: |
Expand All @@ -125,17 +129,15 @@ jobs:
export SCALE_FE_SYS=Linux64-gnu-ompi
export SCALE=${GITHUB_WORKSPACE}/../scale
echo "Build global shallow water model"
make -C global_shallow_water/src
echo "Build 2D nonhydrostatic atmospheric model"
make -C atm_nonhydro2d/src
echo "Build 3D nonhydrostatic atmospheric model"
make -C atm_nonhydro3d/src
echo "Build 3D nonhydrostatic atmospheric model / utils"
make -C atm_nonhydro3d/util/regrid_tool
4 changes: 2 additions & 2 deletions .github/workflows/scalelib_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ jobs:
mkdir -p ${SCALE_INST_DIR} && cd ${SCALE_INST_DIR}
echo "Download SCALE library .."
wget -q https://scale.riken.jp/archives/scale-5.4.3.tar.gz
tar xzf scale-5.4.3.tar.gz --strip-components 1
wget -q https://scale.riken.jp/archives/scale-5.4.4.tar.gz
tar xzf scale-5.4.4.tar.gz --strip-components 1
echo "Build SCALE library .."
export SCALE_SYS=Linux64-gnu-ompi
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ scale-dg
LOG.pe*
history.pe*.nc
restart_*.pe*.nc
*.dat

#
interp_LOG.pe*
Expand Down
35 changes: 24 additions & 11 deletions FElib/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ endif

OBJS_NAME_COMMON = \
scale_polynominal.o \
scale_polygon.o \
scale_sparsemat.o \
scale_linalgebra.o \
scale_time_manager.o \
Expand All @@ -52,7 +53,9 @@ OBJS_NAME_MESH = \
scale_meshutil_1d.o \
scale_meshutil_2d.o \
scale_meshutil_3d.o \
scale_meshutil_vcoord.o \
scale_meshutil_cubedsphere2d.o \
scale_meshutil_cubedsphere3d.o \
scale_mesh_bndinfo.o \
scale_localmesh_base.o \
scale_localmesh_1d.o \
Expand All @@ -65,7 +68,9 @@ OBJS_NAME_MESH = \
scale_mesh_linedom1d.o \
scale_mesh_rectdom2d.o \
scale_mesh_cubedom3d.o \
scale_mesh_cubedspheredom2d.o
scale_mesh_cubedspheredom2d.o \
scale_mesh_cubedspheredom3d.o \
scale_mesh_topography.o

OBJS_NAME_DATA = \
scale_variableinfo.o \
Expand All @@ -76,6 +81,7 @@ OBJS_NAME_DATA = \
scale_meshfieldcomm_rectdom2d.o \
scale_meshfieldcomm_cubedspheredom2d.o \
scale_meshfieldcomm_cubedom3d.o \
scale_meshfieldcomm_cubedspheredom3d.o \
scale_meshfield_statistics.o

OBJS_NAME_FILE = \
Expand All @@ -86,16 +92,23 @@ OBJS_NAME_FILE = \
scale_file_monitor_meshfield.o

OBJS_NAME_FLUID_DYN_SOLVER = \
scale_atm_dyn_dgm_modalfilter.o \
scale_atm_dyn_dgm_spongelayer.o \
scale_atm_dyn_dgm_hydrostatic.o \
scale_atm_dyn_dgm_nonhydro3d_numdiff.o \
scale_atm_dyn_dgm_nonhydro2d.o \
scale_atm_dyn_dgm_nonhydro3d_heve.o \
scale_atm_dyn_dgm_nonhydro3d_hevi.o \
scale_atm_dyn_dgm_nonhydro3d_splitform_heve.o \
scale_atm_dyn_dgm_nonhydro3d_splitform_hevi.o \
scale_atm_dyn_dgm_nonhydro3d_hevi_gmres.o
scale_atm_dyn_dgm_modalfilter.o \
scale_atm_dyn_dgm_spongelayer.o \
scale_atm_dyn_dgm_hydrostatic.o \
scale_atm_dyn_dgm_nonhydro3d_numdiff.o \
scale_atm_dyn_dgm_nonhydro2d.o \
scale_atm_dyn_dgm_nonhydro3d_common.o \
scale_atm_dyn_dgm_nonhydro3d_heve_numflux.o \
scale_atm_dyn_dgm_nonhydro3d_heve.o \
scale_atm_dyn_dgm_nonhydro3d_hevi_common.o \
scale_atm_dyn_dgm_nonhydro3d_hevi_numflux.o \
scale_atm_dyn_dgm_nonhydro3d_hevi.o \
scale_atm_dyn_dgm_nonhydro3d_splitform_heve.o \
scale_atm_dyn_dgm_nonhydro3d_splitform_hevi.o \
scale_atm_dyn_dgm_nonhydro3d_hevi_gmres.o \
scale_atm_dyn_dgm_globalnonhydro3d_heve.o \
scale_atm_dyn_dgm_globalnonhydro3d_hevi.o \
scale_atm_dyn_dgm_globalsw.o

OBJS_NAME_TURBULENCE = \
scale_atm_phy_tb_dgm_smg.o
Expand Down
2 changes: 1 addition & 1 deletion FElib/src/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.0
0.5.0
30 changes: 20 additions & 10 deletions FElib/src/common/scale_cubedsphere_cnv.F90
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
!-------------------------------------------------------------------------------
!> module common / Coordinate conversion with a cubed-sphere
!!
!! @par Description
!! Coordinate conversion with a cubed-sphere
!!
!! @author Team SCALE
!!
#include "scaleFElib.h"
module scale_cubedsphere_cnv
!-----------------------------------------------------------------------------
Expand Down Expand Up @@ -63,7 +71,7 @@ subroutine CubedSphereCnv_CS2LonLatCoord( &
!-----------------------------------------------------------------------------

select case( panelID )
case(1, 2, 3, 4)
case( 1, 2, 3, 4 )
!$omp parallel
!$omp do
do p=1, Np
Expand Down Expand Up @@ -182,10 +190,12 @@ subroutine CubedSphereCnv_LonLat2CSVec( &
end subroutine CubedSphereCnv_LonLat2CSVec

subroutine CubedSphereCnv_CS2LonLatVec( &
panelID, alpha, beta, Np, radius, & ! (in)
VecAlpha, VecBeta, & ! (in)
VecLon, VecLat ) ! (out)
panelID, alpha, beta, Np, radius, & ! (in)
VecAlpha, VecBeta, & ! (in)
VecLon, VecLat ) ! (out)

use scale_const, only: &
EPS => CONST_EPS
implicit none

integer, intent(in) :: panelID
Expand Down Expand Up @@ -233,18 +243,18 @@ subroutine CubedSphereCnv_CS2LonLatVec( &
del2 = 1.0_RP + X**2 + Y**2

VecLon(p) = (- Y * ( 1.0 + X**2 ) * VecAlpha(p) + X * ( 1.0_RP + Y**2 ) * VecBeta(p) ) &
* s / ( X**2 + Y**2 )
* s / ( X**2 + Y**2 + EPS )
VecLat(p) = (- X * ( 1.0 + X**2 ) * VecAlpha(p) - Y * ( 1.0_RP + Y**2 ) * VecBeta(p) ) &
* s / ( del2 * sqrt( X**2 + Y**2 ) )
* s / ( del2 * sqrt( X**2 + Y**2 ) + EPS )
end do
end select

return
end subroutine CubedSphereCnv_CS2LonLatVec

subroutine CubedSphereCnv_CS2CartCoord( &
panelID, alpha, beta, Np, radius, &
X, Y, Z )
panelID, alpha, beta, Np, radius, & ! (in)
X, Y, Z ) ! (out)

implicit none
integer, intent(in) :: panelID
Expand Down Expand Up @@ -356,7 +366,7 @@ subroutine CubedSphereCnv_LonLat2CSPos( &
!$omp parallel
if ( panelID == 1 ) then
!$omp workshare
where (lon(:) > 2.0_RP * PI - 0.25_RP * PI )
where (lon(:) >= 2.0_RP * PI - 0.25_RP * PI )
lon_(:) = lon(:) - 2.0_RP * PI
elsewhere
lon_(:) = lon(:)
Expand Down Expand Up @@ -405,7 +415,7 @@ end subroutine CubedSphereCnv_LonLat2CSPos

subroutine CubedSphereCnv_GetMetric( &
alpha, beta, Np, radius, & ! (in)
G_ij, GIJ, Gsqrt ) ! (out)
G_ij, GIJ, Gsqrt ) ! (out)

implicit none

Expand Down
59 changes: 59 additions & 0 deletions FElib/src/common/scale_polygon.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#include "scaleFElib.h"
module scale_polygon
!-----------------------------------------------------------------------------
!
!++ Used modules
!
use scale_precision
use scale_io

!-----------------------------------------------------------------------------
implicit none
private
!-----------------------------------------------------------------------------
!
!++ Public type & procedures
!
public :: polygon_inpoly

contains

!> Check whether the point is located inside a polyngon
!OCL SERIAL
function polygon_inpoly( pt_x, pt_y, num_node, v_x, v_y ) result(ret)
implicit none
real(RP), intent(in) :: pt_x
real(RP), intent(in) :: pt_y
integer, intent(in) :: num_node
real(RP), intent(in) :: v_x(num_node)
real(RP), intent(in) :: v_y(num_node)
logical :: ret

integer :: wn
integer :: i, ii
!------------------------------------------

wn = 0
do i=1, num_node
ii = mod(i, num_node) + 1
if ( v_y(i) <= pt_y .and. pt_y < v_y(ii)) then
if( pt_x < v_x(i) + (pt_y - v_y(i)) * (v_x(ii) - v_x(i))/(v_y(ii) - v_y(i)) ) then
wn = wn + 1
end if
else if ( v_y(i) > pt_y .and. v_y(ii) <= pt_y ) then
if( pt_x < v_x(i) + (pt_y - v_y(i)) * (v_x(ii) - v_x(i))/(v_y(ii) - v_y(i)) ) then
wn = wn - 1
end if
end if
end do

if (wn == 0) then
ret = .false.
else
ret = .true.
end if

return
end function polygon_inpoly

end module scale_polygon
30 changes: 28 additions & 2 deletions FElib/src/common/scale_polynominal.F90
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ module scale_polynominal
!

public :: Polynominal_GenLegendrePoly
public :: Polynominal_GenLegendrePoly_sub
public :: Polynominal_GenDLegendrePoly

public :: Polynominal_GenGaussLobattoPt
Expand Down Expand Up @@ -49,6 +50,7 @@ module scale_polynominal
contains
!> A function to obtain the values of Lagrange basis functions which are evaluated over aribitary points
!!
!OCL SERIAL
function Polynominal_GenLagrangePoly(Nord, x_lgl, x) result(l)
implicit none

Expand Down Expand Up @@ -85,6 +87,7 @@ end function Polynominal_GenLagrangePoly

!> A function to obtain the differential values of Lagrange basis functions which are evaluated over aribitary points
!!
!OCL SERIAL
function Polynominal_GenDLagrangePoly_lglpt(Nord, x_lgl) result(lr)
implicit none

Expand Down Expand Up @@ -118,12 +121,13 @@ end function Polynominal_GenDLagrangePoly_lglpt

!> A function to obtain the values of Legendre polynominals which are evaluated at aribitary points.
!!
function Polynominal_GenLegendrePoly(Nord, x) result(P)
!OCL SERIAL
subroutine Polynominal_GenLegendrePoly_sub(Nord, x, P)
implicit none

integer, intent(in) :: Nord
real(RP), intent(in) :: x(:)
real(RP) :: P(size(x), Nord+1)
real(RP), intent(out) :: P(size(x), Nord+1)

integer :: n

Expand All @@ -142,10 +146,27 @@ function Polynominal_GenLegendrePoly(Nord, x) result(P)
end do

return
end subroutine Polynominal_GenLegendrePoly_sub

!> A function to obtain the values of Legendre polynominals which are evaluated at aribitary points.
!!
!OCL SERIAL
function Polynominal_GenLegendrePoly(Nord, x) result(P)
implicit none

integer, intent(in) :: Nord
real(RP), intent(in) :: x(:)
real(RP) :: P(size(x), Nord+1)
!---------------------------------------------------------------------------

call Polynominal_GenLegendrePoly_sub( Nord, x(:), & ! (in)
P(:,:) ) ! (out)
return
end function Polynominal_GenLegendrePoly

!> A function to obtain differential values of Legendre polynominals which are evaluated at aribitary points.
!!
!OCL SERIAL
function Polynominal_GenDLegendrePoly(Nord, x, P) result(GradP)
implicit none

Expand Down Expand Up @@ -175,6 +196,7 @@ end function Polynominal_GenDLegendrePoly

!> A function to calcuate the Legendre-Gauss-Lobtatto (LGL) points.
!!
!OCL SERIAL
function Polynominal_GenGaussLobattoPt(Nord) result(pts)
implicit none

Expand All @@ -193,6 +215,7 @@ end function Polynominal_GenGaussLobattoPt

!> A function to calcuate the Gauss-Lobbato weights.
!!
!OCL SERIAL
function Polynominal_GenGaussLobattoPtIntWeight(Nord) result(int_weight_lgl)
implicit none

Expand All @@ -213,6 +236,7 @@ end function Polynominal_GenGaussLobattoPtIntWeight

!> A function to calcuate the Gauss-Legendre points.
!!
!OCL SERIAL
function Polynominal_GenGaussLegendrePt(Nord) result(pts)
implicit none

Expand All @@ -226,6 +250,7 @@ end function Polynominal_GenGaussLegendrePt

!> A function to calcuate the Gauss-Legendre weights.
!!
!OCL SERIAL
function Polynominal_GenGaussLegendrePtIntWeight(Nord) result(int_weight_gl)
implicit none

Expand All @@ -249,6 +274,7 @@ end function Polynominal_GenGaussLegendrePtIntWeight
!- private -------------------------------

!> Calculate the N'th-order Gauss quadrature points and weights associated the Jacobi polynomial of type (alpja,beta).
!OCL SERIAL
subroutine gen_JacobiGaussQuadraturePts( alpha, beta, N, &
x )

Expand Down
Loading

0 comments on commit 8424d4d

Please sign in to comment.