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

Added diagnostics for partial derivatives of density #1142

Merged
merged 6 commits into from
Jul 3, 2020

Conversation

gmacgilchrist
Copy link

In diagnostics/MOM_diagnostics.F90 I added diagnostics for partial derivative of density wrt temperature and salinity. I followed the convention of the density diagnostics. The new diagnostics ar drho_dT and drho_dS.

do k=1,nz
pressure_1d(:) = pressure_1d(:) + 0.5 * h(:,j,k) * GV%H_to_Pa ! Pressure in middle of layer k
! To avoid storing more arrays, put drho_dT into Rcv, and drho_dS into work3d
call calculate_density_derivs(tv%T(:,j,k),tv%S(:,j,k),pressure_1d, &
Copy link
Collaborator

Choose a reason for hiding this comment

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

You need to import this function in module specification (L18-19).

(Was this able to build for you?)

Copy link
Author

Choose a reason for hiding this comment

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

Aha, this was my error. I forgot to push my latest commit after making that change 🤦

Copy link
Collaborator

Choose a reason for hiding this comment

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

All good 🎉
BTW do you think you are able to sort out the OpenMP error as well? If not, then I can look into it.

Copy link
Author

Choose a reason for hiding this comment

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

I don't think I have the knowledge to sort that. I'd be happy if you would talk me through it though.

Is it failing because of something in the changes that I've made? Or have I done something wrong in not merging my branch with dev/gfdl correctly in the first place?

Copy link
Collaborator

Choose a reason for hiding this comment

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

The OpenMP directive preceding the block (line starting with !$OMP) has an error because you have default(none) and haven't specified if work_3d is shared across threads or not.

The directive could be fixed by adding work_3d to the OpenMP directive. But if you did not mean to add it, then it might be simpler to just remove it.

Copy link
Author

Choose a reason for hiding this comment

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

Not knowing how OpenMP functions, I don't have a sense for whether it is necessary to have work_3d shared across threads. I was just copying the convention of the other density calculations in including this line.

I think, in fact, that the line as present in my PR was copied from a previous version of MOM_diagnostic.F90, as I see that the OpenMP directives for the other density variables (e.g. rhoinsitu) have changed. I wonder if this line should instead just be consistent with that for rhoinsitu? i.e. !$OMP parallel do default(shared) private(pressure_1d)

I will implement that just now and you can tell me if I'm missing something.

Copy link
Collaborator

Choose a reason for hiding this comment

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

That looks good, and also looks like it passed. (Just waiting on the ARM tests...)
The regression fail is expected since this is a new diagnostic. I'll push this to Gaea and if it passes then I will merge it.

Thanks for fixing that up!

@codecov-commenter
Copy link

codecov-commenter commented Jun 25, 2020

Codecov Report

Merging #1142 into dev/gfdl will decrease coverage by 0.29%.
The diff coverage is 34.25%.

Impacted file tree graph

@@             Coverage Diff              @@
##           dev/gfdl    #1142      +/-   ##
============================================
- Coverage     46.08%   45.79%   -0.30%     
============================================
  Files           214      223       +9     
  Lines         69399    69847     +448     
============================================
  Hits          31984    31984              
- Misses        37415    37863     +448     
Impacted Files Coverage Δ
...g_src/external/GFDL_ocean_BGC/FMS_coupler_util.F90 0.00% <0.00%> (ø)
...fig_src/external/GFDL_ocean_BGC/generic_tracer.F90 0.00% <0.00%> (ø)
...c/external/GFDL_ocean_BGC/generic_tracer_utils.F90 0.00% <0.00%> (ø)
config_src/external/ODA_hooks/kdtree.f90 0.00% <0.00%> (ø)
config_src/external/ODA_hooks/ocean_da_core.F90 0.00% <0.00%> (ø)
config_src/external/ODA_hooks/ocean_da_types.F90 0.00% <0.00%> (ø)
config_src/external/ODA_hooks/write_ocean_obs.F90 0.00% <0.00%> (ø)
config_src/solo_driver/MESO_surface_forcing.F90 0.00% <0.00%> (ø)
config_src/solo_driver/user_surface_forcing.F90 0.00% <0.00%> (ø)
src/ALE/MOM_regridding.F90 31.63% <0.00%> (ø)
... and 114 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d44e79b...dd8d3ab. Read the comment docs.

@marshallward
Copy link
Collaborator

Gaea regression tests: https://gitlab.gfdl.noaa.gov/ogrp/MOM6/pipelines/10739

@marshallward
Copy link
Collaborator

Gaea regression has passed. Parameters will need to be updated.

Travis CI testing has also passed, but it's failing to update to GitHub. I've triggered another run but we may need to override this.

@marshallward marshallward merged commit 33792c6 into mom-ocean:dev/gfdl Jul 3, 2020
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.

4 participants