From 1009eb2350854e1c24209438e56482893f11dcd5 Mon Sep 17 00:00:00 2001 From: lkugler <lukas.kugler@gmail.com> Date: Mon, 13 Mar 2023 13:43:23 +0100 Subject: [PATCH] docs+typo --- dartwrf/create_obsseq.py | 22 +++++++++++----------- dartwrf/prepare_namelist.py | 22 +++++++++++++--------- dartwrf/prepare_wrfrundir.py | 10 +++++++++- 3 files changed, 33 insertions(+), 21 deletions(-) diff --git a/dartwrf/create_obsseq.py b/dartwrf/create_obsseq.py index df2a847..d014f05 100755 --- a/dartwrf/create_obsseq.py +++ b/dartwrf/create_obsseq.py @@ -174,21 +174,21 @@ kind def create_obs_seq_in(time_dt, list_obscfg, - output_path=cluster.dartrundir+'/obs_seq.in'): + output_path=cluster.dartrundir+'/obs_seq.in'): """Create obs_seq.in with multiple obs types in one file Args: time_dt (dt.datetime): time of observation - list_obscfg (list of dict) : configuration for observation types - must have keys: - - n_obs (int) : number of observations (must be a square of an integer: 4, 9, 1000, ...) - - obs_locations (str or tuple) in ['square_array_from_domaincenter', 'square_array_evenly_on_grid', ] - or list of (lat, lon) coordinate tuples, in degrees north/east - - error_generate (float) - - error_assimilate (float or False) : False -> parameterized - - cov_loc_radius_km (float) - - obs_errors (np.array): contains observation errors, one for each observation + list_obscfg (list of dict): configuration for observation types + + Note: + `list_obscfg` must have these keys: + - n_obs (int) : number of observations (must be a square of an integer: 4, 9, 1000, ...) + - obs_locations (str or tuple) in ['square_array_from_domaincenter', 'square_array_evenly_on_grid', ] + or list of (lat, lon) coordinate tuples, in degrees north/east + - error_generate (np.array) + - error_assimilate (np.array or False) : False -> parameterized + - cov_loc_radius_km (float) """ print('creating obs_seq.in:') time_dt = add_timezone_UTC(time_dt) diff --git a/dartwrf/prepare_namelist.py b/dartwrf/prepare_namelist.py index 85bf245..d223aa3 100755 --- a/dartwrf/prepare_namelist.py +++ b/dartwrf/prepare_namelist.py @@ -1,12 +1,12 @@ """Create namelist.input files Usage: - prepare_namelist.py <begin> <end> <intv> [--radt=<minutes>] [--restart=<flag>] [--restart_interval=<minutes>] +prepare_namelist.py <begin> <end> <intv> [--radt=<minutes>] [--restart=<flag>] [--restart_interval=<minutes>] Options: - --radt=<minutes> Radiation interval [default: 5] - --restart=<flag> Restart flag (.true., .false.) [default: .false.] - --restart_interval=<minutes> Restart frequency [default: 720] +--radt=<minutes> Radiation interval [default: 5] +--restart=<flag> Restart flag (.true., .false.) [default: .false.] +--restart_interval=<minutes> Restart frequency [default: 720] """ import os, sys, shutil, warnings import datetime as dt @@ -18,13 +18,16 @@ from dartwrf.utils import sed_inplace, copy, symlink, mkdir def run(iens, begin, end, hist_interval=5, radt=5, archive=True, restart=False, restart_interval=720): - """Create namelist.input files + """Create a namelist.input file for each ensemble member Args: - archive (bool): if True, write to archivedir of experiment - if False, write to WRF run directory - restart (str): fortran bool whether to use wrfinput or wrfrst - restart_interval (int): output frequency of wrfrst (minutes) + archive (bool): if True, write to archivedir of experiment + if False, write to WRF run directory + restart (str): fortran bool whether to use wrfinput or wrfrst + restart_interval (int): output frequency of wrfrst (minutes) + + Returns + None """ rundir = cluster.wrf_rundir(iens) copy(cluster.namelist, rundir+'/namelist.input') @@ -73,6 +76,7 @@ def run(iens, begin, end, hist_interval=5, radt=5, archive=True, if __name__ == '__main__': + args = docopt(__doc__) begin = dt.datetime.strptime(args['<begin>'], '%Y-%m-%d_%H:%M') end = dt.datetime.strptime(args['<end>'], '%Y-%m-%d_%H:%M') diff --git a/dartwrf/prepare_wrfrundir.py b/dartwrf/prepare_wrfrundir.py index 82d6acc..b1199cc 100755 --- a/dartwrf/prepare_wrfrundir.py +++ b/dartwrf/prepare_wrfrundir.py @@ -1,10 +1,18 @@ +"""Prepare WRF run directories, to use wrf.exe then + +Args: + init_time (str): YYYY-MM-DD_HH:MM + +Returns: + None +""" import os, sys, shutil import datetime as dt from config.cfg import exp from config.cluster import cluster from dartwrf.utils import symlink, copy, link_contents -from dartrwrf import prepare_namelist +from dartwrf import prepare_namelist if __name__ == '__main__': -- GitLab