Skip to content

Commit 110f428

Browse files
authored
split out Ekman tests into custom, ideal, input_sounding (#567)
1 parent 91de40e commit 110f428

31 files changed

+319
-43
lines changed

Exec/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ add_subdirectory(ABL)
99
add_subdirectory(ChannelFlow)
1010
add_subdirectory(CouetteFlow)
1111
add_subdirectory(PoiseuilleFlow)
12-
add_subdirectory(EkmanSpiral)
12+
add_subdirectory(EkmanSpiral_custom)
1313
add_subdirectory(DensityCurrent)
1414
add_subdirectory(DensityCurrent_Terrain)
1515
add_subdirectory(WitchOfAgnesi)

Exec/EkmanSpiral/init_ideal_terrain.cpp

-30
This file was deleted.

Exec/EkmanSpiral/CMakeLists.txt Exec/EkmanSpiral_custom/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ target_sources(${erf_exe_name}
55
PRIVATE
66
prob.H
77
prob.cpp
8-
init_ideal_terrain.cpp
98
)
109

1110
target_include_directories(${erf_exe_name} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})

Exec/EkmanSpiral/GNUmakefile Exec/EkmanSpiral_custom/GNUmakefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ BL_NO_FORT = TRUE
2929
Bpack := ./Make.package
3030
Blocs := .
3131
ERF_HOME := ../..
32-
ERF_PROBLEM_DIR = $(ERF_HOME)/Exec/EkmanSpiral
32+
ERF_PROBLEM_DIR = $(ERF_HOME)/Exec/EkmanSpiral_custom
3333
include $(ERF_HOME)/Exec/Make.ERF

Exec/EkmanSpiral_custom/Make.package

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CEXE_headers += prob.H
2+
CEXE_sources += prob.cpp
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Exec/EkmanSpiral_ideal/CMakeLists.txt

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
set(erf_exe_name ekman_spiral_ideal)
2+
3+
add_executable(${erf_exe_name} "")
4+
target_sources(${erf_exe_name}
5+
PRIVATE
6+
prob.H
7+
prob.cpp
8+
)
9+
10+
target_include_directories(${erf_exe_name} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
11+
12+
include(${CMAKE_SOURCE_DIR}/CMake/BuildERFExe.cmake)
13+
build_erf_exe(${erf_exe_name})

Exec/EkmanSpiral_ideal/GNUmakefile

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# AMReX
2+
COMP = gnu
3+
PRECISION = DOUBLE
4+
5+
TEST = TRUE
6+
USE_ASSERTION = TRUE
7+
8+
# Profiling
9+
PROFILE = FALSE
10+
TINY_PROFILE = FALSE
11+
COMM_PROFILE = FALSE
12+
TRACE_PROFILE = FALSE
13+
MEM_PROFILE = FALSE
14+
USE_GPROF = FALSE
15+
16+
# Performance
17+
USE_MPI = TRUE
18+
USE_OMP = FALSE
19+
USE_CUDA = FALSE
20+
USE_HIP = FALSE
21+
USE_DPCPP = FALSE
22+
23+
# Debugging
24+
DEBUG = FALSE
25+
26+
USE_NETCDF = TRUE
27+
USE_TERRAIN = FALSE
28+
29+
BL_NO_FORT = TRUE
30+
31+
# GNU Make
32+
Bpack := ./Make.package
33+
Blocs := .
34+
ERF_HOME := ../..
35+
ERF_PROBLEM_DIR = $(ERF_HOME)/Exec/EkmanSpiral_ideal
36+
include $(ERF_HOME)/Exec/Make.ERF

Exec/EkmanSpiral_ideal/Make.package

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CEXE_headers += prob.H
2+
CEXE_sources += prob.cpp

Exec/WPS_Test/inputs_ideal_EkmanSpiral Exec/EkmanSpiral_ideal/inputs_ideal_EkmanSpiral

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ------------------ INPUTS TO MAIN PROGRAM -------------------
2-
max_step = 0
2+
max_step = 1
33
stop_time = 1000.0
44

55
amrex.fpe_trap_invalid = 1
@@ -16,6 +16,10 @@ zlo.type = "NoSlipWall"
1616
zhi.type = "SlipWall"
1717

1818
# TIME STEP CONTROL
19+
integration.type = RungeKutta
20+
integration.rk.type = 3
21+
erf.use_native_mri = 0
22+
1923
erf.fixed_dt = 0.5 # fixed time step
2024

2125
# DIAGNOSTICS & VERBOSITY
@@ -58,6 +62,4 @@ prob.T_0 = 300.0
5862

5963
# INITIALIZATION WITH ATM DATA
6064
erf.init_type = "ideal"
61-
erf.nc_init_file_0 = "wrfinput_d01"
62-
63-
FILE = ./inputs.time_integration
65+
erf.nc_init_file_0 = "wrfinput_ekman_d01"

Exec/EkmanSpiral_ideal/prob.H

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#ifndef _PROB_H_
2+
#define _PROB_H_
3+
4+
#include <AMReX_REAL.H>
5+
6+
struct ProbParm {
7+
amrex::Real rho_0 = 1.0;
8+
amrex::Real Theta_0 = 300.0;
9+
amrex::Real V_0 = 1.0;
10+
}; // namespace ProbParm
11+
12+
extern ProbParm parms;
13+
14+
#endif

Exec/EkmanSpiral_ideal/prob.cpp

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#include "prob.H"
2+
#include "prob_common.H"
3+
4+
#include "IndexDefines.H"
5+
#include "ERF_Constants.H"
6+
#include "AMReX_ParmParse.H"
7+
#include "AMReX_MultiFab.H"
8+
9+
ProbParm parms;
10+
11+
#ifdef ERF_USE_TERRAIN
12+
void
13+
erf_init_dens_hse(amrex::MultiFab& rho_hse,
14+
const amrex::MultiFab& z_phys_nd,
15+
const amrex::MultiFab& z_phys_cc,
16+
amrex::Geometry const& geom)
17+
{
18+
amrex::Real R0 = parms.rho_0;
19+
for ( amrex::MFIter mfi(rho_hse, amrex::TilingIfNotGPU()); mfi.isValid(); ++mfi )
20+
{
21+
amrex::Array4<amrex::Real> rho_arr = rho_hse.array(mfi);
22+
const amrex::Box& gbx = mfi.growntilebox(1);
23+
amrex::ParallelFor(gbx, [=] AMREX_GPU_DEVICE (int i, int j, int k) {
24+
rho_arr(i,j,k) = R0;
25+
});
26+
}
27+
}
28+
#else
29+
void
30+
erf_init_dens_hse(amrex::Real* dens_hse_ptr,
31+
amrex::Geometry const& geom,
32+
const int ng_dens_hse)
33+
{
34+
const int khi = geom.Domain().bigEnd()[2];
35+
for (int k = -ng_dens_hse; k <= khi+ng_dens_hse; k++)
36+
{
37+
dens_hse_ptr[k] = parms.rho_0;
38+
}
39+
}
40+
#endif
41+
42+
void
43+
erf_init_rayleigh(amrex::Vector<amrex::Real>& /*tau*/,
44+
amrex::Vector<amrex::Real>& /*ubar*/,
45+
amrex::Vector<amrex::Real>& /*vbar*/,
46+
amrex::Vector<amrex::Real>& /*thetabar*/,
47+
amrex::Geometry const& /*geom*/)
48+
{
49+
amrex::Error("Should never get here for WPS tests problem");
50+
}
51+
52+
// Shouldn't we get rid of this function when initializing with real atm data?
53+
///*
54+
void
55+
init_custom_prob(
56+
const amrex::Box& bx,
57+
amrex::Array4<amrex::Real> const& state,
58+
amrex::Array4<amrex::Real> const& x_vel,
59+
amrex::Array4<amrex::Real> const& y_vel,
60+
amrex::Array4<amrex::Real> const& z_vel,
61+
#ifdef ERF_USE_TERRAIN
62+
amrex::Array4<amrex::Real> const& r_hse,
63+
amrex::Array4<amrex::Real> const& p_hse,
64+
amrex::Array4<amrex::Real const> const& z_nd,
65+
amrex::Array4<amrex::Real const> const& z_cc,
66+
#endif
67+
amrex::GeometryData const& geomdata)
68+
{
69+
amrex::Print() << "Dummy function..Needed for linking" << std::endl;
70+
}
71+
//*/
72+
73+
void
74+
amrex_probinit(
75+
const amrex_real* /*problo*/,
76+
const amrex_real* /*probhi*/)
77+
{
78+
// Parse params
79+
amrex::ParmParse pp("prob");
80+
pp.query("rho_0", parms.rho_0);
81+
pp.query("T_0", parms.Theta_0);
82+
}
1.07 MB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
set(erf_exe_name ekman_spiral_input_sounding)
2+
3+
add_executable(${erf_exe_name} "")
4+
target_sources(${erf_exe_name}
5+
PRIVATE
6+
prob.H
7+
prob.cpp
8+
)
9+
10+
target_include_directories(${erf_exe_name} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
11+
12+
include(${CMAKE_SOURCE_DIR}/CMake/BuildERFExe.cmake)
13+
build_erf_exe(${erf_exe_name})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# AMReX
2+
COMP = gnu
3+
PRECISION = DOUBLE
4+
5+
TEST = TRUE
6+
USE_ASSERTION = TRUE
7+
8+
# Profiling
9+
PROFILE = FALSE
10+
TINY_PROFILE = FALSE
11+
COMM_PROFILE = FALSE
12+
TRACE_PROFILE = FALSE
13+
MEM_PROFILE = FALSE
14+
USE_GPROF = FALSE
15+
16+
# Performance
17+
USE_MPI = TRUE
18+
USE_OMP = FALSE
19+
USE_CUDA = FALSE
20+
USE_HIP = FALSE
21+
USE_DPCPP = FALSE
22+
23+
# Debugging
24+
DEBUG = FALSE
25+
DEBUG = TRUE
26+
27+
USE_NETCDF = FALSE
28+
USE_TERRAIN = FALSE
29+
30+
BL_NO_FORT = TRUE
31+
32+
# GNU Make
33+
Bpack := ./Make.package
34+
Blocs := .
35+
ERF_HOME := ../..
36+
ERF_PROBLEM_DIR = $(ERF_HOME)/Exec/EkmanSpiral_input_sounding
37+
include $(ERF_HOME)/Exec/Make.ERF
File renamed without changes.

Exec/WPS_Test/inputs_input_sounding_EkmanSpiral Exec/EkmanSpiral_input_sounding/inputs_input_sounding_EkmanSpiral

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ------------------ INPUTS TO MAIN PROGRAM -------------------
2-
max_step = 0
2+
max_step = 1
33
stop_time = 1000.0
44

55
amrex.fpe_trap_invalid = 1
@@ -16,6 +16,10 @@ zlo.type = "NoSlipWall"
1616
zhi.type = "SlipWall"
1717

1818
# TIME STEP CONTROL
19+
erf.use_native_mri = 0
20+
integration.type = RungeKutta
21+
integration.rk.type = 3
22+
1923
erf.fixed_dt = 0.5 # fixed time step
2024

2125
# DIAGNOSTICS & VERBOSITY
@@ -59,6 +63,3 @@ prob.T_0 = 300.0
5963
# INITIALIZATION WITH ATM DATA
6064
erf.init_type = "input_sounding"
6165
erf.input_sounding_file = "input_sounding_file"
62-
#erf.input_sounding_file = "/home/pkjha/Desktop/input_sounding_file/ekman/input_sounding"
63-
64-
FILE = ./inputs.time_integration
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#ifndef _PROB_H_
2+
#define _PROB_H_
3+
4+
#include <AMReX_REAL.H>
5+
6+
struct ProbParm {
7+
amrex::Real rho_0 = 1.0;
8+
amrex::Real Theta_0 = 300.0;
9+
amrex::Real V_0 = 1.0;
10+
}; // namespace ProbParm
11+
12+
extern ProbParm parms;
13+
14+
#endif

0 commit comments

Comments
 (0)