Commit 8d2cd963 authored by Martin Claus's avatar Martin Claus

Added small example for Nemo ref and cfg namelists

parent 4f085959
Pipeline #1893 passed with stage
in 42 seconds
......@@ -3,3 +3,19 @@ import json
in_file_ref = "namelist_ref"
in_file_cfg = "namelist_cfg"
with open(in_file_ref) as f:
ref_nmls = namelist.parse_namelist_file(f)
with open(in_file_cfg) as f:
cfg_nmls = namelist.parse_namelist_file(f)
nmls = ref_nmls.copy()
for k in cfg_nmls:
if k in nmls:
nmls[k].update(cfg_nmls[k])
else:
nmls[k] = cfg_nmls[k]
print(json.dumps(nmls, indent=4))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment