Skip to content

Commit

Permalink
Add grads ctl file to output, append a ctl file in script folder, cha…
Browse files Browse the repository at this point in the history
…nge initial case to uniform case
  • Loading branch information
Aaron-Hsieh-0129 committed Dec 16, 2024
1 parent c57cdd0 commit d2d88a4
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
17 changes: 17 additions & 0 deletions scripts/csswm.ctl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
DSET ^%tm1.nc
DTYPE netcdf
OPTIONS template
TITLE NetCDF Data for GrADS
UNDEF 99999.
XDEF 94 LINEAR 0 1
YDEF 94 LINEAR 0 1
ZDEF 6 levels 1 2 3 4 5 6
TDEF 400 LINEAR 00:00Z01JAN2000 3mn
VARS 5
h=>h 6 z,x,y h
u=>u 6 z,x,y u
v=>v 6 z,x,y v
u_lonlat=>ulonlat 6 z,x,y usphere
v_lonlat=>vlonlat 6 z,x,y vsphere
ENDVARS

4 changes: 2 additions & 2 deletions src/define.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
// #define SteadyGeostrophy
// #define Barotropic
// #define Mountain
#define RossbyHaurwitz
// #define RossbyHaurwitz
// #define EquatorialWave
// #define Uniform
#define Uniform

// #define TrueSol
#define DIFFUSION
Expand Down
11 changes: 11 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@ int main(void) {
model.diffusion_ts = csswm_diffusion_ts;

CSSWM::Init::Init2d(model);

// Copy grads ctl file to the output directory
std::string source = "../scripts/csswm.ctl";
std::string destination = model.output_path + "nc/csswm.ctl";

// Construct the command
std::string command = "cp " + source + " " + destination;

// Execute the command
system(command.c_str());

CSSWM::Iteration::TimeMarching(model);

stop = clock();
Expand Down

0 comments on commit d2d88a4

Please sign in to comment.