|
| 1 | +.. _quickstart: |
| 2 | + |
| 3 | +======================== |
| 4 | +CMOR Quickstart (``fremor``) |
| 5 | +======================== |
| 6 | + |
| 7 | +This guide adapts the upstream ``fre-cli`` ``fre cmor`` README for the standalone |
| 8 | +``fremorizer`` package. The ``fremor`` CLI rewrites climate model output with |
| 9 | +CMIP-compliant metadata (\"CMORization\") and supports both CMIP6 and CMIP7 |
| 10 | +workflows. |
| 11 | + |
| 12 | +Comprehensive API and CLI reference material lives in :ref:`usage` and |
| 13 | +:ref:`commands`. Use this page when you want a concise, end-to-end reminder of |
| 14 | +what configuration is required and how to invoke each subcommand. |
| 15 | + |
| 16 | +Documentation and References |
| 17 | +---------------------------- |
| 18 | + |
| 19 | +* `fremorizer docs (latest) <https://fremorizer.readthedocs.io/en/latest/>`_ |
| 20 | +* `fre-cli CMOR docs <https://noaa-gfdl.readthedocs.io/projects/fre-cli/en/latest/usage.html#cmorize-postprocessed-output>`_ |
| 21 | +* `PCMDI cmor documentation <http://cmor.llnl.gov/>`_ |
| 22 | + |
| 23 | +Getting Started |
| 24 | +--------------- |
| 25 | + |
| 26 | +External configuration |
| 27 | +~~~~~~~~~~~~~~~~~~~~~~ |
| 28 | + |
| 29 | +``fremor`` relies on external CMIP metadata: |
| 30 | + |
| 31 | +* MIP tables (for example the `cmip6-cmor-tables <https://github.com/pcmdi/cmip6-cmor-tables>`_) |
| 32 | +* Controlled vocabularies (for example `CMIP6_CVs <https://github.com/WCRP-CMIP/CMIP6_CVs>`_) |
| 33 | + |
| 34 | +Required user inputs |
| 35 | +~~~~~~~~~~~~~~~~~~~~ |
| 36 | + |
| 37 | +* **Variable list** (JSON) that maps local variable names to MIP names. A small |
| 38 | + example lives in the repository at |
| 39 | + ``fremorizer/tests/test_files/CMORbite_var_list.json``. |
| 40 | +* **Experiment configuration** (JSON) supplying metadata such as ``calendar``, |
| 41 | + ``grid``, and the desired output directory structure. See |
| 42 | + ``fremorizer/tests/test_files/CMOR_input_example.json`` for CMIP6 or |
| 43 | + ``fremorizer/tests/test_files/CMOR_CMIP7_input_example.json`` for CMIP7. |
| 44 | +* **Optional CMOR YAML** if you want to batch multiple ``run`` calls via |
| 45 | + ``fremor yaml``. These YAML files are part of the larger FRE workflow and are |
| 46 | + not shipped here; point ``-y/--yamlfile`` at your project-specific YAMLs. |
| 47 | + |
| 48 | +Subcommands and Examples |
| 49 | +------------------------ |
| 50 | + |
| 51 | +The entry point to all subcommands is ``fremor``: |
| 52 | + |
| 53 | +.. code-block:: bash |
| 54 | +
|
| 55 | + fremor --help |
| 56 | +
|
| 57 | +``run`` |
| 58 | +~~~~~~~ |
| 59 | + |
| 60 | +Rewrite NetCDF files in a directory using a specific MIP table and experiment |
| 61 | +configuration. |
| 62 | + |
| 63 | +.. code-block:: bash |
| 64 | +
|
| 65 | + fremor run --run_one --grid_label gr --grid_desc FOO_BAR_PLACEHOLD --nom_res "10000 km" \ |
| 66 | + -d /path/to/input/netcdf/dir \ |
| 67 | + -l fremorizer/tests/test_files/CMORbite_var_list.json \ |
| 68 | + -r fremorizer/tests/test_files/cmip6-cmor-tables/Tables/CMIP6_Omon.json \ |
| 69 | + -p fremorizer/tests/test_files/CMOR_input_example.json \ |
| 70 | + -o /tmp/cmorized_output |
| 71 | +
|
| 72 | +``yaml`` |
| 73 | +~~~~~~~~ |
| 74 | + |
| 75 | +Process multiple directories/tables using FRE-flavored YAML configuration. |
| 76 | +This is most useful inside a full FRE workflow. |
| 77 | + |
| 78 | +.. code-block:: bash |
| 79 | +
|
| 80 | + fremor -v yaml --run_one --dry_run --output combined.yaml \ |
| 81 | + --yamlfile /path/to/cmor.yaml \ |
| 82 | + --experiment c96L65_am5f7b12r1_amip \ |
| 83 | + --platform ncrc5.intel \ |
| 84 | + --target prod-openmp |
| 85 | +
|
| 86 | +``find`` |
| 87 | +~~~~~~~~ |
| 88 | + |
| 89 | +Search MIP tables for variable definitions. |
| 90 | + |
| 91 | +.. code-block:: bash |
| 92 | +
|
| 93 | + fremor -v find --table_config_dir fremorizer/tests/test_files/cmip6-cmor-tables/Tables/ \ |
| 94 | + --opt_var_name sos |
| 95 | +
|
| 96 | +``varlist`` |
| 97 | +~~~~~~~~~~~ |
| 98 | + |
| 99 | +Generate a variable list from a directory of NetCDF files. Optionally filter |
| 100 | +against a MIP table. |
| 101 | + |
| 102 | +.. code-block:: bash |
| 103 | +
|
| 104 | + fremor varlist --dir_targ /path/to/data_dir \ |
| 105 | + --output_variable_list simple_varlist.json \ |
| 106 | + --mip_table fremorizer/tests/test_files/cmip6-cmor-tables/Tables/CMIP6_Omon.json |
| 107 | +
|
| 108 | +``config`` |
| 109 | +~~~~~~~~~~ |
| 110 | + |
| 111 | +Scan a post-processing directory tree and emit the CMOR YAML plus per-component |
| 112 | +variable lists that ``fremor yaml`` consumes. |
| 113 | + |
| 114 | +.. code-block:: bash |
| 115 | +
|
| 116 | + fremor config --pp_dir /path/to/pp \ |
| 117 | + --mip_tables_dir /path/to/cmip7-cmor-tables/tables \ |
| 118 | + --mip_era cmip7 \ |
| 119 | + --exp_config /path/to/CMOR_CMIP7_input_example.json \ |
| 120 | + --output_yaml cmor_config.yaml \ |
| 121 | + --output_dir /path/to/cmor_output \ |
| 122 | + --varlist_dir /path/to/varlists \ |
| 123 | + --freq monthly --chunk 5yr --grid gn \ |
| 124 | + --calendar noleap |
| 125 | +
|
| 126 | +In ``--dry_run`` mode, ``fremor yaml`` prints the generated ``fremor run`` calls |
| 127 | +without executing them. Pass ``--no-print_cli_call`` to print the equivalent |
| 128 | +Python ``cmor_run_subtool(...)`` invocation instead of the CLI command. |
0 commit comments