-
Notifications
You must be signed in to change notification settings - Fork 555
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
Fb coupling fields #285
Fb coupling fields #285
Conversation
In the original code a coupling lag had to be used, coupling took place at the last time step but not at the first, and the coupling fields had to be written in an oasis restart file. With this ticket, the program can run in a different way by not using a coupling lag, coupling taking place at the first time step but not the last, and the coupling fields are written in the wave restart file - no extra oasis restart file needed.
Enhancement to improve the way in which input data is read in and logged by the ww3_uprstr program: * read in variables specific to the update process selected * output the values provided in the ww3_uprstr.out log file * update the .inp template file and regtests to improve clarity and work with the changes * add capability to read inputs from a namelist (ww3_uprstr.nml) file
This branch add new send and receive coupling fields to WW3. In the case of receive fields (atmospheric momentum and air density), this has been done in the same way as the already existing received fields (e.g. 10m winds), so there is also the possibility to read these new fields from a file. This implies that the fixed format ww3_sheld.inp and ww3_multi.inp files needs to change to accommodate such changes. ww3_outf.inp files also need to change due to the new diagnostics. Scientific modifications for air density are already taken into account, so that when no air density is received the current, constant air density value is used in calculations. On the other hand, scientific changes to drive the model with atmospheric momentum are currently under research, so these changes will be added in a later branch once they are sufficiently mature. What is implemented here for atmospheric momentum is only the basic infrastructure to ingest this information in the model. |
The way the ww3_shel file was read was inconsistent if the file was fixed-format or namelist based - one allowed coupling ice concentrations and the other did not. Now it is possible to couple ice concentrations in all cases, and the way how the flags for received fields is processed has been slightly simplified. Furthermore, the piece of code that called the routine to generate an homogeneous ice concentration field was wrong and it has been fixed. |
New mandatory switches (ATTN and ATXN) where added mirroring the behaviour of WNTN and WNXN for the new atmospheric momentum input field. It has been later considered that, to reduce the number of changes required for a run after this branch is merged into the trunk, the wind switches will be reused for momentum. If necessary, this can be changed in the future branch that will add the scientific changes required for driving the model with atmospheric momentum instead of winds. Possibly, checks to ensure than only one of momentum or wind is used to drive the model should also be added. |
Further changes: . In the subroutine w3mpio, the variable NRQMAX has been modified to properly account for all output fields, and written as an easier to understand sum of terms. . Small fix to the reading of currents and ice fraction in the restart file in routine w3iors, as these fields have dimension 1:NSEA in each processor. . The air density is time interpolated when read from file, while other scalar fields (such as ice fraction of water levels) are not. It was implicitly assumed in the code that interpolating fields had to be vector fields, but this has been changed so that the second vector component is only processed if needed. |
regarding last modification date
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, Juan.
Just a few comments and changes.
I've not checked all the changes to the input files in the regtests, just the first few; I assume they are all similar.
model/ftn/w3ounfmetamd.ftn
Outdated
META(1)%ENAME = '.taua' | ||
META(1)%VARNM='utaua' | ||
META(1)%VARNL='eastward_atm_momentum' | ||
META(1)%VARNS='eastward_atm_momentum' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the "standard_names" you have added for your new fields actual CF standard names? If not, then the policy we are adopting at the moment is to leave the standard name blank until one has been added to the CF convention. @ukmo-ansaulter is liaising with CF group to achieve this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will check if there is a CF standard name and update accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The relevant standard names will be, I think:
surface_downward_eastward_stress, surface_downward_northward_stress
These have been submitted by another group, are currently under review in the CF discussion forum and haven't been published yet. So I'd suggest leaving blank for the time being and we can apply once the names are confirmed and the CF tables are updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me, thanks. There is indeed an air_density field, but not a 'mean wave number'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ukmo-juan-castillo - I see you have removed the standard_name for "mean_wave_number" as per my comment. However, I think you can leave in the "long_name" value though as that does not require a CF compliant value and will provide a useful description of the field. @ukmo-ansaulter - do you agree?
The same applies to your new TOC field (IFI=6, IFJ=13), lines 2623 and 2631.
I've added specific review comments to the lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's correct @ukmo-ccbunney . In CF the long_name is "free form" so we should always include something. The standard_name has the strict criteria and we should not have one unless there is a match in the latest CF standard name table.
This should avoid a fail when working with any CF compliance checkers...
model/ftn/w3ounfmetamd.ftn
Outdated
META(1)%VARNS='eastward_atm_momentum' | ||
META(1)%VARNG='eastward_atm_momentum' | ||
META(2)%VARNC='taua=sqrt(utaua**2+vtaua**2)' | ||
META(1)%VMIN = -32000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Valid min/max in this module should not be scaled by the scale_factor, but specified in the actual units of the field. I.E. for this field, vmin=-320, not -32000
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will update all these VMIN and VMAX lines.
model/ftn/w3ounfmetamd.ftn
Outdated
META(1)%VARNS='mean wave number' | ||
META(1)%VARNG='mean wave number' | ||
META(1)%VMIN = 0 | ||
META(1)%VMAX = 32000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same issue here with vmax, should be 32.0, not 32000
@@ -2206,7 +2226,7 @@ | |||
IF ( FLH(J) ) THEN | |||
CALL W3FLDH (J, NDST, NDSEN, NX, NY, NX, NY, & | |||
TIME0, TIMEN, NH(J), NHMAX, THO, HA, HD, HS,& | |||
TW0, WX0, WY0, DT0, TWN, WXN, WYN, DTN, IERR) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this a bug? It looks like the winds were being read rather than ice concentration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually - I see you mentioned a bug in the homogenous ice generation in your currents, I assume it is that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that is the bug I mentioned.
Running tests from this PR + PR#373 all completed without errors!!!! The comparison script is still running. @aliabdolali they will be in /scratch2/NCEPDEV/climate/Jessica.Meixner/PR_WW3/PR285/WW303/regtests I compared with the develop branch (one commit ago) not the results from #373. Results still need to be checked, but at least all the tests are succeeding now! |
@JessicaMeixner-NOAA Thanks for digging into the problem and provide the fix. |
Top job @JessicaMeixner-NOAA! 🥇 |
@aliabdolali, @JessicaMeixner-NOAA , @ukmo-juan-castillo - I am going to merge in develop to pull in fix #373 and then re-run the regtests for this PR. |
I have done the tests successfully, after merging develop to this PR. Thanks to Jessica's bug fix. For all the cases, the
For the following, I need your inputs @ukmo-ccbunney @ukmo-juan-castillo
|
@@ -0,0 +1,48 @@ | |||
$ -------------------------------------------------------------------- $ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ukmo-juan-castillo Could you add in the ww3_tp2.15/info about the added tests imput_rho, so later we can use it to check this feature.
A related question, does this new regtest check the interpolation of the new fields?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some information about the new test, which checks the interpolation of the new fields. Please let me know if it is clear.
@aliabdolali was there any explanation about the differences in out_grd in the tests you mention? It looks like all of the information computed from the out_grd files are the same, but still seems odd that these tests have diffs in the out_grd. |
While I am waiting for @ukmo-juan-castillo's feedback on this, I'll rerun these tests again. |
@aliabdolali thanks for the update. I'll wait on the new results and/or reply from @ukmo-juan-castillo to complete my code review. |
An update from my side:
|
Sorry for the delay, I have been quite busy this days. I believe the explanation for the differences in out_grd.ww3 comes from the lines: This means the the flags FLOGRD are written to the file. The branch adds new output fields, and changes the flag number in FLOGRD for the fields D50, IC1, and IC5. Therefore, any time we write these fields to the output the FLOGRD flags will be different, although the behaviour of the program will be the same. If you use the command cmp in linux you should be able to see that the differences are just the order of some bits, corresponding to the logical variable FLOGRD. |
Thanks for the explanation. My only concern is that it limits our matrix.comp functionality and reports these tests different. |
@aliabdolali @JessicaMeixner-NOAA
However, I also got lots of differences in the |
@ukmo-ccbunney I thought the ww3_ts3 diffs were because of some bug fix? |
@aliabdolali @JessicaMeixner-NOAA I'm happy with the matrix differences in that case. |
That fix is already in develop and this branch so should not show as a difference. This was an existing problem with the shel input file. It got fixed when Ali, Jaun and I were trying to track down the bug that you eventually fixed. |
As requested, a comment can be added to the merge, such as: This branch adds new fields that can be sent (mean wave number, mean wave period, total ocean wind stress) and received (air density, wind stress) to/from other models via OASIS coupling, which will also be available in the model output. The fields that can be received via coupling can also be read from an external file, and using an homogeneous ice fraction is now activated when using '.inp' input files, as it was already possible to do it using '.nml' input files. In order to add this functionality it was necessary to modify the format of the ww3_shel.inp and ww3_multi.inp files, so that new flags controlling if these fields are used can be read. Furthermore, the format of the ww3_outf.inp file must be modified to accommodate the new output fields available. If no air density is read from file or via coupling, the default constant value is used. The infrastructure to read and use the wind stress is already in place, but the actual use of wind stress to drive the model is not implemented yet and it will be the aim of issue #337 |
Hi,
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ukmo-juan-castillo thanks for helping us work through all the issues. The new features look good
Changes to tackle issue #206 - addition of new coupling fields