-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
All-sky example useful for timing (#220)
Revises the all-sky example to be useful for timing benchmarks. Removes use of NCHOME environment variable, removes (optional) use of GPTL timing library in RFMIP examples. Revises aerosol optics for GPUs.
- Loading branch information
1 parent
1cb0a4e
commit 36d7969
Showing
15 changed files
with
772 additions
and
536 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#! /usr/bin/env python | ||
# | ||
# This script... | ||
# | ||
import argparse | ||
import csv | ||
import os | ||
|
||
# template: exe ncol nlay nloops output_file k_dist clouds aeorsols | ||
|
||
# specify: kdist, optional clouds, aerosols. specify nloops | ||
# Toggle clouds and aerosols? | ||
# Loop over sets of ncol, nlay, | ||
# output name | ||
|
||
|
||
if __name__ == '__main__': | ||
parser = argparse.ArgumentParser( | ||
description="Description here ") | ||
# Argument parseing described at | ||
# https://stackoverflow.com/questions/15753701/how-can-i-pass-a-list-as-a-command-line-argument-with-argparse | ||
parser.add_argument("-x", "--executable", | ||
type=str, | ||
default="./rrtmgp_allsky", | ||
help="Path to exectuable") | ||
parser.add_argument("-c", "--ncol", | ||
type=lambda items: [int(i) for i in list(csv.reader([items]))[0]], | ||
default="2,4,8,16", | ||
help="Number of columns (multiple e.g. 2,4,8,16)") | ||
parser.add_argument("-l", "--nlay", | ||
type=lambda items: [int(i) for i in list(csv.reader([items]))[0]], | ||
default="32, 64, 96", | ||
help="Number of layers (multiple e.g. 32,64.96)") | ||
parser.add_argument("-i", "--nloops", | ||
type=int, default=1, | ||
help="Number of loops (same for all ncol)") | ||
parser.add_argument("-o", "--output_file", | ||
type=str, | ||
default="rrtmgp-allsky-output.nc", | ||
help="Path to output file") | ||
parser.add_argument("-k", "--k_distribution", | ||
type=str, | ||
required = True, | ||
help="Path to gas optics file [required]") | ||
parser.add_argument("-cl", "--cloud_optics", | ||
type=str, default="", | ||
help="Path to cloud optics file") | ||
parser.add_argument("-a", "--aerosol_optics", | ||
type=str, default="", | ||
help="Path to aerosol optics file") | ||
args = parser.parse_args() | ||
|
||
# Can't supply aerosols without clouds | ||
if(args.cloud_optics == "" and args.aerosol_optics != ""): | ||
raise AssertionError("Need to supply cloud optics if providing aerosol optics") | ||
|
||
# Every combo of ncol, nlay | ||
for l in args.nlay: | ||
for i in args.ncol: | ||
print(f"{args.executable} {i:6d} {l:4d} {args.nloops:3d} " + \ | ||
f"{args.output_file} {args.k_distribution}" + \ | ||
f"{args.cloud_optics} {args.aerosol_optics}") |
Oops, something went wrong.