Skip to main content

Python utilities for the GFDL's numerical model MOM

Project description

mom-utils

This is a collection of Python utilities for the MOM, a numerical model developed by GFDL/NOAA

Support and Documentation

Quick howto use

To install:

pip install mom-utils

Some uses:

  • The input.nml do not require any order, so it is usually not fun to compare two different input.nml. This command is different then a regular diff, since it doesn’t care about the order of the variables. The output show what is different, or what is defined in only one of the files.

    mom_namelist compare input.nml input2.nml

  • Inside python, one can read an input.nml setup, change one parameter, and write into another input2.nml like this:

    nml_text = open(‘input.nml’, ‘r’).read()

    cfg = mom_utils.nml_decode(nml_text)

    cfg[‘ocean_model_nml’][‘dt_ocean’] = 7200

    output = open(‘input2.nml’, ‘w’)

    output.write(mom_utils.yaml2nml(cfg))

  • Some namelists/parameters changed or disapear between MOM4 and MOM5. The task “check” evaluates if all namelists/parameters in the input.nml are declared in the code.

    mom_namelist check –momsrc=mom/src myexperiments/exp1/input.nml

  • Task 4to5 converts a namelist for MOM4 to a namelist for MOM5

    mom_namelist 4to5 input.nml > ./input.nml.new

License

mom-utils is offered under the PSFL.

Authors

Guilherme Castelão <guilherme@castelao.net> Luiz Irber <luiz.irber@gmail.com>

News

1.2

  • mom4_namelist renamed to mom_namelist.

  • New task “check” for mom_namelist.

before 1.1.4

  • mom4_namelist: An application to parse and manipulate the input.nml

  • Including some documentation

  • First release was some point at 2011, I’m not sure when.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mom-utils-1.2.1.tar.gz (14.0 kB view details)

Uploaded Source

File details

Details for the file mom-utils-1.2.1.tar.gz.

File metadata

  • Download URL: mom-utils-1.2.1.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mom-utils-1.2.1.tar.gz
Algorithm Hash digest
SHA256 5b1b23c0d90d6f215195b91d459a34f3ef996cc69f2c5b7107ce33747f330f69
MD5 74a72d4a91ffe59d590509762e204576
BLAKE2b-256 a74e63ebfa679603bb3bbec5b881d9fe286076b4e495ca218a57dae2d83f37f8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page