ocean-eddy-cpt / MOM6

Modular Ocean Model
Other
1 stars 1 forks source link

Option to read (spatially varying) KHTH from file #24

Closed NoraLoose closed 1 year ago

NoraLoose commented 2 years ago

This adds the option to read a spatially varying GM interface height diffusivity (KHTH) from a netcdf file.

NoraLoose commented 2 years ago

@gustavo-marques, I solved the previous problem. There was nothing wrong with the code, I just forgot to set THICKNESSDIFFUSE = True. I updated the comment above.

But I noticed another problem. Here is what I give the model versus what the diagnostic KHTH_t gives me:

KHTH_t

Is the spurious "tile structure" on the right implied by MOM_read_data?

NoraLoose commented 2 years ago

Alistair (@adcroft), maybe you have seen the problem described in the previous comment before?

adcroft commented 2 years ago

That looks like a classic missing halo-update. I don't think MOM_read_data() fills the halo. You are interpolating to the edge of the compute domain which is using a halo value of zero (if initialized) rather than the correct value from the neighbouring processor. Try adding a pass_var() after reading the data.

NoraLoose commented 2 years ago

Thanks @adcroft - this solved the problem!

codecov-commenter commented 2 years ago

Codecov Report

Merging #24 (31c35ce) into dev/cpt (d8fc2ef) will decrease coverage by 0.00%. The diff coverage is 35.00%.

@@             Coverage Diff             @@
##           dev/cpt      #24      +/-   ##
===========================================
- Coverage    29.04%   29.04%   -0.01%     
===========================================
  Files          244      244              
  Lines        71849    71856       +7     
===========================================
+ Hits         20869    20870       +1     
- Misses       50980    50986       +6     
Impacted Files Coverage Δ
...arameterizations/lateral/MOM_thickness_diffuse.F90 31.34% <35.00%> (+0.03%) :arrow_up:
src/framework/MOM_restart.F90 25.68% <0.00%> (-0.27%) :arrow_down:
config_src/drivers/solo_driver/MOM_driver.F90 67.88% <0.00%> (-0.14%) :arrow_down:
src/ocean_data_assim/MOM_oda_driver.F90 0.00% <0.00%> (ø)
src/user/baroclinic_zone_initialization.F90 0.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

NoraLoose commented 1 year ago

@gustavo-marques @adcroft is this PR of interest for the MOM6 code (upstream)?

If so, it will take some work to merge it because I started from the dev/cpt branch, which has significantly diverged from the upstream master branch.

I successfully tested the new code for the NeverWorld2 setup, but I have to admit I have never compiled or run MOM6 in a more complex configuration. Gustavo, do you have a working (and up to date) setup on Cheyenne that we could use for testing?

gustavo-marques commented 1 year ago

Hi @NoraLoose: yes, I think we should merge this PR to the main branch eventually. I can take care of that and if I get conflicts related to the changes in this PR I will reach out to you. Thanks!

NoraLoose commented 1 year ago

@gustavo-marques have you tried merging this yet? If not, I will try and reach out to you if I get stuck. Thanks!

gustavo-marques commented 1 year ago

No, I have not.

NoraLoose commented 1 year ago

Closing this PR because I have opened it at NOAA/GFDL.