Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parser: Add ability to read in generic blocks #1519

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

uramirez8707
Copy link
Contributor

@uramirez8707 uramirez8707 commented May 14, 2024

Description
Include a summary of the change and which issue is fixed. Please also include
relevant motivation and context. List any dependencies that are required for
this change.

Fixes #1520

How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Please also note
any relevant details for your test configuration (e.g. compiler, OS). Include
enough information so someone can reproduce your tests.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • New check tests, if applicable, are included
  • make distcheck passes

Comment on lines +68 to +71
allocate(block_ids(get_num_unique_blocks(yaml_id, parent_block_id=varlist_ids(k))))
call get_unique_block_ids(yaml_id, block_ids, parent_block_id=varlist_ids(k))
do l = 1, size(block_ids)
call get_block_name(yaml_id, block_ids(l), block_name)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@J-Lentz @GFDL-Eric
This is relevant code that will be used to read the new field_table yaml format.
get_num_unique_blocks is going to be used to get the number of unique blocks for each variable. For the example below, it will get 1 for sphum and 2 for soa. get_unique_block_ids will be used to get an id for each of the blocks and that can be used to get the block name (i.e profile_type for sphum, and chem_param and profile_type for soa) and from there, it can be read as normal ...

field_table:
- field_type: tracer
  modlist:
  - model_type: atmos_mod
    varlist:
    - variable: sphum
      longname: specific humidity
      units: kg/kg
      profile_type:
      - value: fixed
        surface_value: 3.0e-06
    - variable: soa
      longname: SOA tracer
      units: mmr
      convection: all
      chem_param:
      - value: aerosol
      profile_type:
      - value: fixed
        surface_value: 1.0e-32

@uramirez8707 uramirez8707 marked this pull request as ready for review June 20, 2024 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update the field_table yaml format
1 participant