-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathRunpSIMS.swift
29 lines (22 loc) · 1.19 KB
/
RunpSIMS.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
type file;
app (file tar_out, file part_out) RunpSIMS (string latidx, string lonidx, string input_files)
{
RunpSIMS latidx lonidx @tar_out input_files;
}
string gridLists[] = readData("gridList.txt");
file scenario_input[] <filesys_mapper; location=@arg("campaign"), pattern="*">;
file common_input[] <filesys_mapper; location=@arg("refdata"), pattern="*">;
file params <single_file_mapper; file=@strcat(@arg("workdir"), "/params.psims")>;
tracef("\nCreating part files...\n");
foreach g,i in gridLists {
// Input files
file weather_input[] <filesys_mapper; location=@strcat(@arg("weather"), "/", gridLists[i]), pattern="*">;
file soils_input[] <filesys_mapper; location=@strcat(@arg("soils"), "/", gridLists[i]), pattern="*">;
// Output files
file tar_output <single_file_mapper; file=@strcat("output/", gridLists[i], "output.tar.gz")>;
file part_output <single_file_mapper; file=@strcat("parts/", gridLists[i], ".psims.nc")>;
// RunpSIMS
string gridNames[] = @strsplit(g, "/");
string files_in = @strcat(@scenario_input, " ", @weather_input, " ", @soils_input, " ", @common_input, " ", @params);
(tar_output, part_output) = RunpSIMS(gridNames[0], gridNames[1], files_in);
}