-
Notifications
You must be signed in to change notification settings - Fork 108
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
Remove 'goto' statements from chgres_cube #759
Comments
I created a branch where I removed the WAM option. See 63f29d6. |
driver scripts. Fixes ufs-community#759.
@akubaryk I have looking through Henry's version of "wam_climo_data.f90". I see references to 'MSIS', defined as Mass Spectrometer and Incoherent Scatter radar. In your branch, I also see references to 'MSIS'. Did you simply replace Henry's old functions with newer versions from NRL? |
Correct, the primary change here is replacing NRLMSISE-00 with NRLMSIS 2.1, which is a welcome improvement in initializing the upper atmosphere. The NRLMSIS 2.1 source also does not contain any goto statements that I'm aware of. My branch has a major issue in that it retrieves the MSIS 2.1 source from NRL rather than including it in the branch, which would cause the build to fail on e.g. Hera. NRL's license with MSIS 2.0 was extremely restrictive, but we may be able to use the 2.1 source without issue (with some kind of included statement about the use of MSIS and its license); I haven't had a chance to read the new license closely, though. I also haven't tested it at all beyond checking that it compiles cleanly on WCOSS2. |
@akubaryk I see your branch downloads a zip file from an NRL web site. That won't work well. How many MSIS routines do you use? Can we host them as part of UFS_UTILS? Are these routines on Github somewhere so we can get them as submodule? |
NRL does not make MSIS available on GitHub. The license reads as such:
Without having read it closely, I don't know if we can host the source as a part of UFS_UTILS. Seems like 4c might allow it if we follow the instructions, but I don't know if that's compatible with the standard UFS LGPLv3.0 license |
@akubaryk I just want to verify that your group is not using the WAM function as it is currently implemented in the authoritative fork. Is that correct? If you are not using it, would you mind if I remove that functionality from the authoritative fork? You can always add it back using the desired MSIS routines in the future. If you think you can update |
@GeorgeGayno-NOAA we would like to keep the code in the repository. What needs to be resolved in my branch to accomplish this? |
Can you eliminate the download of the zip file? Can the required routines be hosted under UFS_UTILS? How many routines are there? |
Who can we talk to about the license issue? We need most of the MSIS package, and it all falls under the license I pasted above. |
It sounds like we can use the code as long as we display the license. Perhaps we can keep the MSIS code in a separate directory, compile it as a library (using the ufs_utils cmake build), then map it into chgres_cube. @edwardhartnett Does NCEPLIBS use any code with a similar worded license? |
@akubaryk and @GeorgeGayno-NOAA Let me know if you need my help on the license issue |
How about we put the license in the comments at the top of the code file and go wiht that? |
@akubaryk While we discuss the details of the license, please go ahead and come up with a way to implement these routines as part of UFS_UTILS. |
4ed6de8 contains the MSIS 2.1 source in a subdirectory of chgres_cube.fd, updates the cmake tree appropriately, and includes the license notice as required by the MSIS 2.1 license at the top of wam_climo_data.f90. |
@akubaryk are your changes ready to be merged? If so, please create a PR. |
Increase the number of characters to hold the parm file in msis_init.F90. Fixes ufs-community#759.
@akubaryk I made a copy of your branch in my fork. I fixed a problem with the read of the msis parm file. See 865bb17. But when I try to run the WAM-based regression test, I get this error:
To run the test on Hera, I used this script: |
Thanks, @GeorgeGayno-NOAA -- returning from leave today, will look at this as soon as I am able. |
Where did you run the test? I want to check the log file.
…On Wed, Mar 1, 2023 at 4:04 PM akubaryk ***@***.***> wrote:
Does this work now? I had no issues running the regression test when
copying /scratch1/NCEPDEV/da/George.Gayno/ufs_utils.git/UFS_UTILS into my
own space. If so -- thank you for your efforts bringing my branch up to
speed in my absence!
—
Reply to this email directly, view it on GitHub
<#759 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMSYBTBGDYCHUGCC4WXSBXLWZ62XDANCNFSM6AAAAAAUAR3FDI>
.
You are receiving this because you were mentioned.
|
Sorry, that was sent in error. The commit I was using was not the one referenced in the issue. |
Appear to be some type errors in wam_climo_data.F90 that I think I have resolved correctly, check the log here: Of course fails the regression test itself because MSIS 2.1 is not MSIS 1.0, but that's fine. I can have someone in my group look at the output for a science review if we think that's useful. (Is there an easy way to regrid the individual tiles to get a convenient global view? I think I remember some such software that was able to do it on the fly but cannot recall now.) I will update the PR if all looks good. |
Just checked your changes into my branch (ff87f3c). The regression test ran. You will need to check the results. Yes, a science review is a good idea. And I would run some coldstart files though the forecast model. @DusanJovic-NOAA has a tool that pieces together the six tiles for visualization. |
This is one that George will likely need to help us with, but there are some options in |
The last step compares the out.sfc.tile?.nc files from the test (see your working directory) to those from the baseline. If they were identical, you can use either set. Otherwise, use the ones from the working directory. |
We don't have @GeorgeGayno-NOAA should we also include those changes into our regression test in this PR? |
The temperature, winds, tracers from 5days FV3WAM run output with ICs created from FV3->FV3WAM chgres applications look good. One issue: the global temperature near the mesopause( top lid of FV3GFS-128L) is getting colder during the run. |
You are right. The WAM regression test only outputs the 'atm' files. Since the WAM function only concerns the atmosphere, there is no need to update the test to process the surface fields. |
Thanks, @SvetlanaKarol-NOAA! Are we good to go with the PR -- do I need to do anything else from here @GeorgeGayno-NOAA? |
I can create a PR. Just to confirm, you tested with my fork at ff87f3c. You did not have local changes, correct? |
Yes, I think we are good, we could figure out the issue with temperature later. |
Yes, the only changes I made were to the regression test scripts for various matters of convenience, no source changes to any part of chgres_cube. |
Ok. You will need to add my changes to your fork or close your PR and I can submit a PR from my fork. I would prefer the former because I am an official reviewer for the repo. |
…UTILS into feature/wam_update Fixes ufs-community#759.
to the 'test' directory. Fixes ufs-community#759.
Update unit test to read in the check values and compare them against the computed values. Fixes ufs-community#759.
Remove old input value file. Add comments to unit test. Fixes ufs-community#759.
@akubaryk I made some mostly minor updates. I see that the library came with its own test. I incorporated this test under Github actions with our other unit tests. It reads the file provided with the library, computes some fields, then compares the computed values with the 'check' values. The computed and check values will never be exact. So, I guessed at a threshold at which the test fails. Your comments are welcome. If you merge my changes to your branch, you can start a PR. |
#775 has been updated with the proposed minor changes. I wish I had more insight on the MSIS tests, but unfortunately I do not. As long as it doesn't fail right now, it's probably fine overall. |
wam_climo_data.f90 Fixes ufs-community#759.
worked on Hera, but not wcoss2. Fixes ufs-community#759.
NCO is becoming more strict with their coding standards, especially in regards to 'goto' statements. The HAFS group wants to use the v1.9.0 release in their upcoming implementation (code delivery date is March 31, 2023). But they are concerned that NCO will reject their implementation package because of the 'goto' statements in
chgres_cube
.The Whole Atmosphere Model (WAM) option of
chgres_cube
contains >99% of the 'goto' statements. Some of these WAM functions can be easily converted. However, other WAM functions use convoluted logic that won't be simple to fix. For example, here is a 'goto' from functiongts7
.The HAFS group uses
chgres_cube
to create lateral boundary conditions. They do not use the WAM option.So, what to do?
chgres_cube
.The text was updated successfully, but these errors were encountered: