-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfiles2list.ncl
45 lines (43 loc) · 1.25 KB
/
files2list.ncl
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
file_list = NewList("lifo")
dom111file=getenv("domain_1")
if (fileexists(dom111file)) then
ListAppend(file_list, addfile(dom111file, "w"))
else
print("Error!")
print(dom111file + " is not a valid file for domain 1")
exit()
end if
dom222file = getenv("domain_2")
if (fileexists(dom222file)) then
ListAppend(file_list, addfile(dom222file, "w"))
else
ListAppend(file_list, "no_file")
end if
dom333file = getenv("domain_3")
if (fileexists(dom333file)) then
ListAppend(file_list, addfile(dom333file, "w"))
else
ListAppend(file_list, "no_file")
end if
dom444file = getenv("domain_4")
if (fileexists(dom444file)) then
ListAppend(file_list, addfile(dom444file, "w"))
else
dom444 = "no_file"
end if
dom555file = getenv("domain_5")
if (fileexists(dom555file)) then
ListAppend(file_list, addfile(dom555file, "w"))
else
ListAppend(file_list, "no_file")
end if
d1 = str_squeeze(dom111file)
d2 = str_squeeze(dom222file)
d3 = str_squeeze(dom333file)
d4 = str_squeeze(dom444file)
d5 = str_squeeze(dom555file)
if (((d1 .eq. d2) .and. (d2 .ne. "")) .or. ((d2 .eq. d3) .and. (d2 .ne. "")) .or. ((d1 .eq. d3) .and. (d3 .ne. ""))) then
print("Warning: Some domains in namelist.tailor have the same WRF file")
print("Exiting ..")
exit()
end if