NEMS configuration generation
Project description
NEMSpy
NEMSpy generates configuration files (nems.configure
, config.rc
, model_configure
, atm_namelist.rc
)
for coupled modeling applications run with a compiled NEMS binary (not included).
NEMS implements the National Unified Operational Prediction Capability (NUOPC), and configuration files built for NEMS will also work for most NUOPC applications.
Usage:
from datetime import datetime, timedelta
from nemspy import ModelingSystem
from nemspy.model import (
ADCIRCEntry,
AtmosphericMeshEntry,
WaveMeshEntry,
)
# model run time
start_time = datetime(2020, 6, 1)
duration = timedelta(days=1)
# returning interval of main run sequence
interval = timedelta(hours=1)
# directory to which configuration files should be written
output_directory = '~/nems_configuration/'
# model entries
ocean_model = ADCIRCEntry(processors=11, verbose=True, DumpFields=False)
atmospheric_mesh = AtmosphericMeshEntry('~/wind_atm_fin_ch_time_vec.nc')
wave_mesh = WaveMeshEntry('~/ww3.Constant.20151214_sxy_ike_date.nc')
# instantiate model system with model entries
nems = ModelingSystem(
start_time, duration, interval, ocn=ocean_model, atm=atmospheric_mesh, wav=wave_mesh,
)
# form connections between models
nems.connect('ATM', 'OCN')
nems.connect('WAV', 'OCN')
# define execution order
nems.sequence = [
'ATM -> OCN',
'WAV -> OCN',
'ATM',
'WAV',
'OCN',
]
# write configuration files to the given directory
nems.write(output_directory, overwrite=True)
Output:
nems.configure
#############################################
#### NEMS Run-Time Configuration File #####
#############################################
# EARTH #
EARTH_component_list: ATM WAV OCN
EARTH_attributes::
Verbosity = min
::
# ATM #
ATM_model: atmesh
ATM_petlist_bounds: 0 0
ATM_attributes::
Verbosity = min
::
# WAV #
WAV_model: ww3data
WAV_petlist_bounds: 1 1
WAV_attributes::
Verbosity = min
::
# OCN #
OCN_model: adcirc
OCN_petlist_bounds: 2 12
OCN_attributes::
Verbosity = max
DumpFields = false
::
# Run Sequence #
runSeq::
@3600
ATM -> OCN :remapMethod=redist
WAV -> OCN :remapMethod=redist
ATM
WAV
OCN
@
::
config.rc
atm_dir: ~
atm_nam: wind_atm_fin_ch_time_vec.nc
wav_dir: ~
wav_nam: ww3.Constant.20151214_sxy_ike_date.nc
model_configure
total_member: 1
print_esmf: .true.
namelist: atm_namelist
PE_MEMBER01: 13
start_year: 2020
start_month: 6
start_day: 1
start_hour: 0
start_minute: 0
start_second: 0
nhours_fcst: 24
RUN_CONTINUE: .false.
ENS_SPS: .false.
Related:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nemspy-0.4.4.tar.gz
(13.1 kB
view details)
Built Distribution
nemspy-0.4.4-py3-none-any.whl
(15.7 kB
view details)
File details
Details for the file nemspy-0.4.4.tar.gz
.
File metadata
- Download URL: nemspy-0.4.4.tar.gz
- Upload date:
- Size: 13.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb8b5a9a2ec47296f99bf2c669bbcd2a215db873901186ec8f3d2679c143d915 |
|
MD5 | 74ed5d126ff9fa2437162b1d89b66265 |
|
BLAKE2b-256 | a78a22706013a91b15f9a6a19b22b35248e5e547cbe6cfbad82c6340a6cb01b3 |
Provenance
File details
Details for the file nemspy-0.4.4-py3-none-any.whl
.
File metadata
- Download URL: nemspy-0.4.4-py3-none-any.whl
- Upload date:
- Size: 15.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5e2997f459290c90d5e6838520f79f4bc5c795d5379cb16207eb89a5ce7a6c3 |
|
MD5 | 3fbd5a288a58bc85bf4b26033f0184f8 |
|
BLAKE2b-256 | 29831efb15d4bb8176b7e37c09d6add4550823821749f04dce8a27eda9b03181 |