Skip to content

Conversation

@sbrus89
Copy link

@sbrus89 sbrus89 commented Dec 18, 2018

This pull request adds time varying wind and pressure forcing using Adrian Turner's framework implementation.

@xylar
Copy link
Collaborator

xylar commented Dec 18, 2018

I'm excited for this PR because I'd like to use the same infrastructure to do time-variable ice-shelf pressure soon.

Copy link
Collaborator

@xylar xylar left a comment

Choose a reason for hiding this comment

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

@sbrus89, let me know if this is a work in progress and you're not yet ready for comments. If you're ready for them, I have a few suggestions.

@xylar xylar added the Ocean label Dec 18, 2018
@xylar xylar requested a review from pwolfram December 18, 2018 19:00
@xylar
Copy link
Collaborator

xylar commented Dec 18, 2018

@sbrus89
Copy link
Author

sbrus89 commented Dec 18, 2018

@xylar Thanks for the input! I'll work on creating packages as we discussed.

@mark-petersen mark-petersen self-requested a review December 18, 2018 21:49
@mark-petersen
Copy link
Contributor

Try the delinter on .F and .xml files that you edited, here:
MPAS-Tools/source_code_processing/mpas_source_linter/mpas_source_linter.py
mpas_source_linter.py -f foo.F
and it makes a foo.e file.

@sbrus89
Copy link
Author

sbrus89 commented Dec 18, 2018

@xylar Take a look if you get a chance and let me know if you have any other suggestions.

Copy link
Collaborator

@xylar xylar left a comment

Choose a reason for hiding this comment

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

The changes look excellent to me. The package support looks exactly as we discussed.

Let me know if you find any problems with the package, though, during your testing.

@xylar
Copy link
Collaborator

xylar commented Dec 18, 2018

It looks like you'll eventually need to rebase onto ocean/develop and handle whatever conflicts in driver/mpas_ocn_core_interface.F may emerge. Shouldn't be too bad (I hope).

@mark-petersen
Copy link
Contributor

I found my notes for new code additions:
Doug wrote a nice tool to help us write uniform code. It is here:
https://github.com/MPAS-Dev/MPAS-Tools/tree/master/source_code_processing/mpas_source_linter
and can be run with:

linter -f file.F

it produces a new file that notifies you of 'delint' clean-up items, that sometimes cause a problem on odd compilers. These can also be helpful for brand new code:

sed -i 's/    /\t/g' $file    # change space to tab, for *.xml files
sed -i 's/[ \t]*$//g' $file   # remove trailing white spaces

though it is best to clean up just the new code you are submitting, and not include white space alterations to lots of other code in this PR.

@pwolfram
Copy link
Contributor

@sbrus89, thanks for getting this PR in before leaving for the break. I'm going to wait to review until you do the rebase and address edits from @xylar and @mark-petersen (thank you to you both for the speedy review!).

@mark-petersen
Copy link
Contributor

I can also take a closer look, test, and review on the next round, after the holiday. @sbrus89 thanks for pushing this through. I return to work January 7.

@sbrus89 sbrus89 force-pushed the ocean/time-varying-wind branch from 2b37800 to 1bd29a9 Compare January 4, 2019 23:22
@sbrus89
Copy link
Author

sbrus89 commented Jan 4, 2019

@xylar I just did the rebase to handle the conflicts in driver/mpas_ocn_core_interface.F.

@sbrus89
Copy link
Author

sbrus89 commented Jan 4, 2019

@mark-petersen I did my best to address the whitespace issues with the linter and sed commands in 27fea306.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@sbrus89, This will work. The alternative would be to have a function like ocn_time_varying_forcing_active(domain) for each of the forcing modules that returns a logical type and then the code here would be:

            if (ocn_shortwave_forcing_active(domain) .or. &
                ocn_ecosys_forcing_active(domain) .or. &
                ocn_salinity_restoring_forcing_active(domain) .or. &
                ocn_time_varying_forcing_active(domain)) then

I think that would be a bit cleaner and more intuitive to update because the specific logic for knowing whether a given forcing is active would be contained in that module rather than here. Your version is more consistent with what everyone has done so far so don't feel obligated to do this clean up if you don't want to.

Copy link
Author

Choose a reason for hiding this comment

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

@xylar, I like that idea a lot. I'll probably leave it the way it is for now and clean it up in a separate PR. That way this one is focused just on the atmospheric forcing and doesn't touch the other forcings (since I'll have to add that function to each of them). Do you think that makes sense?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, I think that would be a nice approach.

Copy link
Contributor

Choose a reason for hiding this comment

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

@sbrus89, can you please make an issue so that we can keep track of this and tag it here before we resolve this issue?

Copy link
Contributor

@pwolfram pwolfram left a comment

Choose a reason for hiding this comment

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

@sbrus89, here are some preliminary comments to be updated as we work toward testing this with real forcing data.

Copy link
Contributor

Choose a reason for hiding this comment

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

Are we sure we really want to hard-code these? I would recommend making them namelist options with these defaults.

Copy link
Author

Choose a reason for hiding this comment

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

@pwolfram, I totally agree. Thanks for reminding me.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This struck me as odd as well. @akturner did this in MPAS-Seaice as well. Are these just the default values before they get replaced somewhere else?

Copy link
Contributor

Choose a reason for hiding this comment

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

We need to verify that the simulation / forcing are BFB under restarts.

@sbrus89
Copy link
Author

sbrus89 commented Jan 8, 2019

I think I addressed all of @pwolfram 's suggestions in these last few commits. Let me know if there's any other issues that need to be taken care of. I appreciate all the feedback!

@xylar
Copy link
Collaborator

xylar commented Feb 1, 2019

@sbrus89, at this point, I think this branch has become a mix of at least 2 projects. I've been there and I know how that happens. Maybe it would be worthwhile at some point to break out commits related to specific test cases from those related to the time-varying atmospheric forcing itself. It would, further, be useful to separate SOMA commits from your new hurricane test case to the degree feasible. Perhaps I can work with you on this when I'm there in just over a week?

@pwolfram
Copy link
Contributor

pwolfram commented Feb 1, 2019

@xylar, thanks for all the help and engaging here!

I have a question / comment that has me a bit confused. I'm thinking it is more worthwhile to have this committed sooner than later since this is holding up a variety of other work (e.g., your ocean/ice shelf coupling, wetting-drying development [general ALE, split explicit], the start of some hurricane simulations). I agree we probably don't need SOMA and a hurricane to show viability of time varying forcing. But, I do think the test case with SOMA should be enough and self contained to verify this is working at least reasonably. We don't, very intentionally, need to consider the processor decomposition bug here.

My primary concern is that this has dragged on for a while, for a variety of viable reasons, but it seems like we may be putting on the breaks and slowing down the process for an artificial reason at this point that may impede progress in other areas, e.g., just for "cleaner" PRs. I'm all for that (perhaps to a fault as we have worked through in the past) but am wondering in this context if the other competing goals of this being a key input to our other work supersedes the "cleanness". In this context, I would argue we can merge even if there has been some scope creep here (but potentially the hurricane simulation should be removed from this specific PR). Steven and I would like to complete this and move on to complete other goals. My original plan was to help out a bit early next week on this to get this merged so we can use this in all our other work. Please let me know what you think and what else I'm missing that informs this discussion-- we really appreciate your engagement here and support of this work.

@xylar
Copy link
Collaborator

xylar commented Feb 1, 2019

@pwolfram, I really do think it's important to clean this up. 58 commits is too many to feasibly go back and debug if issues come up and a lot of them should be squashed.

I also feel pretty strongly that test cases and code changes should be kept in separate pull requests. This is not just for cleanliness but also to avoid confusion -- neither the SOMA test case nor the hurricane test case are directly related to the time-varying forcing, they're just used to test it.

My suggestion to you and @sbrus89 would be to create another branch for each test case you've created or updated here. Then, you should rebase this branch onto ocean/develop, keeping only commits related to time-varying forcing (squashing where you can). Then, you should rebase each of your other branches onto this branch, removing commits already in this branch (and again squashing where appropriate). It's a tedious process but there should be a minimum of conflicts unless commits have somehow involved both code changes and test case changes (which is exactly what I'm hoping to carefully avoid by keeping branches and PRs separate) and I think the whole thing should only take an hour or 2.

Again, I'm happy to help sit down with @sbrus89 when I'm there next week. If you get to this before then, great! But I'm not really okay with just merging a branch with this many seemingly unrelated commits, even in the interest of efficiency.

@pwolfram
Copy link
Contributor

pwolfram commented Feb 1, 2019

Thanks @xylar. Will you be in on Monday? If so, we can certainly wait.

My biggest concern above is that I think we do want test cases to accompany commits (probably not quite the case here, so your argument holds minimally for the hurricane case). Otherwise, we can't be sure new code is working correctly. Ideally, we have a unit test that verifies correctness of the new code that is added.

This being said, if we want separate PRs for code / test cases, I would argue they need to be sequential and immediately merged next to each other on the same day so there isn't a merge in between them that could modify behavior of the testing case of the new code, but perhaps this isn't as hard a line as I would think.

We definitely want to get @mark-petersen's perspective on this repo management strategy we are discussing here.

@xylar
Copy link
Collaborator

xylar commented Feb 1, 2019

@pwolfram, if a version of a test case is specifically being designed to test the functionality being added, or if a test case is being modified specifically to make use of the new functionality, I can see why both should be part of the same PR. To the extent possible, I would still suggest rebasing before the PR gets merged to try to have a set of commits related to code changes followed by a set of commits to add the test case (or visa versa).

If a new test case is being added that will have a life beyond this functionality, as is my sense with the hurricane test case, I think it would be more appropriate to keep that project separate. It should be possible to have a branch base off of this branch where that new test case is being updated as this branch changes. If it's appropriate to merge that other branch right after this one, that's great! But I don't quite see why it's critical to have both merged together unless there's a regression test or unit test as part of that work that tests this PR's functionality.

Anyway, I know we have pretty different styles of development and I wanted to put in a strong pitch for the Jacobsen/@xylar style of having PRs with fewer commits and smaller scope where possible.

@sbrus89 sbrus89 force-pushed the ocean/time-varying-wind branch from dd3a10c to a5dfa40 Compare February 25, 2019 19:16
@sbrus89
Copy link
Author

sbrus89 commented Feb 25, 2019

@mark-petersen, I complied with intel debugging flags and ran the SOMA time varying forcing case. It ran without any errors. I also squashed in a very minor change to the python script that cases the forcing file for the SOMA case (the pressure needed to be made absolute instead of gage). That's why there's an extra force push.

@mark-petersen
Copy link
Contributor

Thanks @sbrus89. There is a problem with my last E3SM/MPAS PR. I need to look at that before I merge this one.

@sbrus89
Copy link
Author

sbrus89 commented Feb 25, 2019

No problem @mark-petersen, I appreciate all your help with this!

Steven Brus and others added 3 commits February 25, 2019 17:12
 - Forcing includes u,v wind velocities, and atmospheric pressure

 - A tanh ramp has been applied to these variables for spin-up purposes

 - Wind stress computed with drag law from: J.R. Garratt MWR 1977

 - Design document included in docs/ocean/design_docs

 - The logic used to decide when to write restart information for
   all other previously added time varying forcing inputs
   (i.e. salinity restoring, shortwave, and ecosys) has been unified
   since the MPAS_forcing_write_restart_times should only be called once.
@sbrus89 sbrus89 force-pushed the ocean/time-varying-wind branch from a5dfa40 to e0b2624 Compare February 26, 2019 00:14
@sbrus89
Copy link
Author

sbrus89 commented Feb 26, 2019

@mark-petersen, I just did a rebase onto ocean/develop.

@mark-petersen
Copy link
Contributor

Merged this version locally, tested in E3SM with a variety of tests. Passes:

PASS ERS_Ld3.T62_oQU240.GMPAS-IAF.cori-knl_intel RUN time=228
PASS PEM_Ln9.T62_oQU240.GMPAS-IAF.cori-knl_intel RUN time=202
PASS PEM_Ln9.ne30_oECv3wLI.A_WCYCL1850-DIB-ISMF_CMIP6.cori-knl_gnu RUN time=621
PASS SMS_D.T62_oQU120_ais20.MPAS_LISIO_TEST.cori-knl_gnu RUN time=715
PASS SMS_D.T62_oQU120_ais20.MPAS_LISIO_TEST.cori-knl_intel RUN time=3080

@mark-petersen mark-petersen merged commit e0b2624 into MPAS-Dev:ocean/develop Mar 6, 2019
mark-petersen added a commit that referenced this pull request Mar 6, 2019
This pull request adds time varying wind and pressure forcing using
Adrian Turner's framework implementation.
@xylar
Copy link
Collaborator

xylar commented Mar 6, 2019

Congratulations, @sbrus89. This was a long process!

@pwolfram
Copy link
Contributor

pwolfram commented Mar 6, 2019

Agreed, excellent work @sbrus89 and thanks for the help and coordination @mark-petersen and @xylar!

@sbrus89 sbrus89 deleted the ocean/time-varying-wind branch March 6, 2019 18:08
ashwathsv pushed a commit to ashwathsv/MPAS-Model that referenced this pull request Jul 21, 2020
This pull request adds time varying wind and pressure forcing using
Adrian Turner's framework implementation.
mark-petersen added a commit to mark-petersen/MPAS-Model that referenced this pull request Jan 11, 2021
This pull request adds time varying wind and pressure forcing using
Adrian Turner's framework implementation.
caozd999 pushed a commit to caozd999/MPAS-Model that referenced this pull request Jan 14, 2021
This pull request adds time varying wind and pressure forcing using
Adrian Turner's framework implementation.
@xylar xylar removed the Don't merge label Nov 14, 2021
dustinswales pushed a commit to dustinswales/MPAS-Model that referenced this pull request Jul 31, 2025
… and fixed issues detected with the GNU compiler (MPAS-Dev#123)

* Fixed NSSL 2-moment MP interface, added horizontal eddy diffusion and fixed issues detected with GNU compiler

* Updated .gitmodules for NSSL_GNU_2.9

* Reduced uh_smooth parameter to 0.1

* Added back removed spaces and ignored changes with submodules TEMPO & MYNN-EDMF temporarily

* Added runtime parameters mono_filter4 & vert_adv_5th for using monotonic fluxes for 4th filter (true) and using 5th order scheme for vertical transport of scalars (false)

* Fixed for backward compatibility

* Made sure the default settings for 2d eddy mixxing run identically as before

* Removed not used namelist variables

* Removed extra file src/core_atmosphere/physics/physics_wrf/module_cu_gf_mpas.F

* Updated version number to 8.3.0-1.9

* Removed extra spaces and empty lines

* One more change to keep format consistent with the original NCAR version

* Merge missing files from MPAS-Dev#147 in last merge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants