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

Add variable dimensions to available_diags file #864

Open
wants to merge 1 commit into
base: dev/gfdl
Choose a base branch
from

Conversation

jkrasting
Copy link

The output of the current available_diags file lacks the dimensions of each diagnostic.

This PR includes a commit that adds the appropriate horizontal and vertical dimension names to the entries listed in the available_diags file. Scalar diagnostics are denoted with a "scalar" string.

Example of an entry generated with the new code:

"temp"  [Used] (CMOR equivalent is "thetao")
    ! modules: {ocean_model,ocean_model_z,ocean_model_rho2,ocean_model_rho0,ocean_model_d2,ocean_model_z_d2,ocean_model_rho2_d2,ocean_model_rho0_d2}
    ! dimensions: yh, xh, zl
    ! long_name: Potential Temperature
    ! units: degC
    ! cell_methods: xh:mean yh:mean zl:mean area:mean
    ! variants: {temp,temp_xyave,thetao,thetao_xyave}

Adds appropriate horizontal and vertical dimension names to the
entries listed in the available_diags file. Scalar diagnostics
are denoted with a "scalar" string.
@@ -2384,6 +2385,21 @@ integer function register_diag_field(module_name, field_name, axes_in, init_time
enddo ! i
enddo

dimensions = ""
if (axes_in%is_h_point) dimensions = trim(dimensions)//" ,yh, xh"
Copy link
Member

Choose a reason for hiding this comment

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

Overall I like what is done here. I have two questions, though, to consider in perhaps minorly revising this code:

  1. Why is there a space before the comma on lines 2389-2392 and similarly on lines 3133-3136 and not after? (I.e., why is the end of this lines " ,yh, xh" instead of ", yh, xh"?
  2. Why is the order of dimensions here given as (for example) "yh, xh, zl" instead of the "xh, yh, zl" that might seem more natural?

@marshallward
Copy link
Member

Apologies for moving the goalposts, but if we're considering revisions to available_diags, then we could also convert it to YAML:

temp:
    used: True
    cmor_equivalent: thetao
    modules: [ocean_model, ocean_model_z, ocean_model_rho2, ocean_model_rho0, ocean_model_d2, ocean_model_z_d2, ocean_model_rho2_d2, ocean_model_rho0_d2]
    dimensions: [yh, xh, zl]
    long_name: Potential Temperature
    units: degC
    cell_methods: [xh:mean, yh:mean, zl:mean, area:mean]
    variants: [temp, temp_xyave, thetao, thetao_xyave]

This would make postprocessing easier for many people.

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.

None yet

3 participants