forked from RDCEP/psims
-
Notifications
You must be signed in to change notification settings - Fork 0
/
psims.swift
29 lines (23 loc) · 959 Bytes
/
psims.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 (external e) pysims (string campaign, string param, string tlatidx, string tlonidx, int slatidx, int slonidx, int split, string rundir) {
pysims "--campaign" campaign "--param" param "--tlatidx" tlatidx "--tlonidx" tlonidx "--slatidx" slatidx "--slonidx" slonidx "--split" split "--rundir" rundir;
}
string campaign = arg("campaign");
string param = arg("param");
string rundir = arg("cwd");
int split = toInt(arg("split"));
string tileList[] = readData("tileList.txt");
external externals[string][][];
tracef("\nCreating part files . . .\n");
foreach tile in tileList {
string indices[] = strsplit(tile, "/");
string tlatidx = indices[0];
string tlonidx = indices[1];
foreach slatidx in [1:split] {
foreach slonidx in [1:split] {
external e;
e = pysims(campaign, param, tlatidx, tlonidx, slatidx, slonidx, split, rundir);
externals[tile][slatidx][slonidx] = e;
}
}
}