refactoring ERA5 data mode#396
Conversation
|
@billsacks I am still working on it. Once tests are passed I'll let you know. |
|
Hi @uturuncoglu @billsacks . May I ask if this is still planned? I'm interested so I ran some tests in UFS. There is also interest in using ERA5 for datm-ocn-ice work, like for RTOFS development. fyi, AI came back with some review notes (NickSzapiro-NOAA#11 (review)). |
|
@uturuncoglu I got a link to this (draft) PR from @NickSzapiro-NOAA in the context of UFS DATM with the "data" atmosphere coming from ERA-5. 2 questions for either/both of you:
|
|
@sanAkel @NickSzapiro-NOAA The only thing that I need to do is to add new formulas to valuate saturation mixing ratio. I am plaining to add new option for it. We could also introduce namelist option to get those fractions from datm_in. I am also taking off starting from next week and back to US end of the month. So, I am not sure if I could do everything before love since I am also trying to finalize things for other projects but if I could do, I'll update you through the PR and and mark tis as ready to review. |
Thanks @uturuncoglu for ⬆️ update. If you have it ready before your leave, great! If not, we will wait or make do whatever we got! |
@uturuncoglu are you back? Hope you had a nice break! Checking if you have time to finish this work? 🙏 |
|
@sanAkel Yes, I am back. I am trying to catch other things but I could work on this next week and we could finalize it. |
|
@sanAkel BTW, i am assuming this is tested without any issue in your end without the remaining additional things. |
@uturuncoglu @raphaeldussin is going to set up a DATM run with the ERA5 forcing. If you happen to have a set of sample forcing files (from the ERA5 reanalysis), that you can point us to, we can test it at our end. Thanks again! |
|
@sanAkel i am trying the finalize the implementation but I think new algorithm to calculate qsat is wrong and give negative and very large values. I tested following code under Python like following, and it is giving |
|
AI suggests it is a units issue ... ie |
|
I used the Bolton approximation (which is fairly accurate at the observed range of temperatures), you can compare with my code here https://github.com/raphaeldussin/newERAtools/blob/e29d89707058cca52abb5d8015a85894756f9c37/compute_q2_ERA5.f90#L154 |
@uturuncoglu Please see ⬆️ response from @raphaeldussin. If your error persists, please check with @raphaeldussin. |
|
@sanAkel @raphaeldussin @NickSzapiro-NOAA I fixed the unit issue and pushed it to the fork. Now you could select type of algorithm in
Anyway, I tested this with UFS WM |
|
I also sync the branch with main. |
|
That's awesome @uturuncoglu 👏 ! @NickSzapiro-NOAA Can we run the same RT test @uturuncoglu ran on wcoss-2? To rephrase my question, do we have the same datasets for that test available? |
|
Thanks @uturuncoglu . I will start some tests tonight The same RT input data should be available on all platforms @sanAkel |
Thanks @NickSzapiro-NOAA
What do we need to do make into an "ocean" RT? Please list steps.. 🙏 |
Model configuration and input data with forcing, ICs, and fix files. I think there is quite some overlap with @uturuncoglu in datm-ocean-ice efforts, but I'm not sure this ESCOMP/CDEPS thread is right place to continue this topic. Happy to continue in ufs-community/ufs-weather-model#3294 , NOAA-EMC/RTOFS_GLO#147 , or wherever else as well |
|
To re-reiterate the ERA5 precipitation issue I mentioned at the UFS-coastal technical tag up today: This may be rather particular to our current DATA-CICE and CICE-SCHISM setups but, If ERA5 provides precipitation in units of meters (cumulative meters of rain per hour), rather than kg/m^2/s, it may be misinterpreted as a rate leading to 3.6X more precip than is actually occurring. (Code/line numbers are from datm/datm_datamode_era5_mod.F90 as of head e301493) But magnitude alone can't separate the two conventions the L682 test is choosing between. For true precip R mm/hr the file value is R/1000 as metres-of-1-hour-accumulation vs R/3600 as kg/m²/s — they differ by only 3.6×, and both sit in the same 0…~10⁻² range for ordinary precip. So the 0.01 cutoff effectively asks only "is there a ≥10 mm/hr cell somewhere in the domain at the first timestep?" Model reports ""already in kg/m^2/s unit!" to output log on L683, even though CDEPS doesn't actually check the units in the ERA5 input file. In our SCHISM CICE test case (prior to the implementation of Faxa_snow) this led to far too much snow falling on the sea ice, resulting in too thick ice that persisted too long into the spring. NOTE ALSO currently Faxa_snow is left out of the above conversion (L685-689) I think ideally CDEPS should read in units from the ERA5 file explicitly and only if units are not found should it make a guess. Barring that the guess should be reported in the log as an assumption that has some ambiguity associated with it. |
| ! Initialize value of export state | ||
| if (associated(Faxa_rain)) Faxa_rain(:) = 0.0_r8 | ||
| if (associated(Faxa_rainc)) Faxa_rainc(:) = 0.0_r8 | ||
| if (associated(Faxa_rainl)) Faxa_rainl(:) = 0.0_r8 | ||
| if (associated(Faxa_snow)) Faxa_snow(:) = 0.0_r8 | ||
| if (associated(Faxa_snowc)) Faxa_snowc(:) = 0.0_r8 | ||
| if (associated(Faxa_snowl)) Faxa_snowl(:) = 0.0_r8 |
There was a problem hiding this comment.
How do you decide which export state variables are initialized (to zero)?
Say, what about taux, tauy?
There was a problem hiding this comment.
@NickSzapiro-NOAA As i see the fields are created in dshr_fldlist_realize() call in dshr/dshr_fldlist_mod.F90 and it seems that there is no any initial value assigned to them. Maybe ESMF is initializing them internally but I am not %100 sure about it. We could use ESMF_FieldFill to set zero initially in that level to be in the safe side. @billsacks let me know what do you think?
There was a problem hiding this comment.
I did a very quick look through other CDEPS components and it looks like this kind of zeroing generally isn't done. I haven't looked at this ERA5 datamode enough to know if it might be needed for this one specially. My initial thought is that these variables should be set in the call to datm_datamode_era5_advance, so there's probably no need to initially zero them, but you shouldn't take my word for it because I'm not very familiar with this.
|
Quick note that tests pass on ursa and gaea.c6 . But will need some response to #421 before this could be merged to EMC/CDEPS. |
|
@NickSzapiro-NOAA It is good to know that tests are passing. Thanks for confirmation. |
|
@sdurski regarding to the issue related with the unit conversion. I am not sure what needs to be done. I think the best approach is to assume that the stream will be on ERA5 original units. The we could remove the range check from all the fields and just apply unit conversion in all the cases. So, it would be the user responsibility to provide information in expected unit. This is same for all the data modes. |
|
@sdurski The units for variable from ERA5 side are:
So, we need to confirm those and I could remove the check for ranges from all the variables. |
|
@uturuncoglu The era5 file that I have been using for SCHISM-CICE runs and which was used for Joey's data-atm/data-ocn/CICE runs has the following units for variables Variable Units I recently changed the variable ttlpcp in the input file to be a rate in kg m⁻² s⁻¹ to prevent the mis-identification in CDEPS. But both the precipitation rate (mtpr) and the total precipitation (tp) are available from Copernicus when extracting era5 forcing data. So original units can be ambiguous. If we're hardwiring an assumption in ttlpcp, meters matches the variable name better. For the short wave and longwave there's a similar ambiguity. You can grab or Is CDEPS currently assuming J/m^2 and always converting? It seems like my W/m^2 values are getting through ok. I think the answer is different if we're trying to set something up for any anonymous user who grabs their own ERA5 forcing, or if we are just trying to make sure CDEPS works for the current tests that involve ERA5. If the latter, just let me know what units you settle on and I can adjust my forcing file accordingly. |
|
@sdurski I think best approach is to fix the units in CDEPS side and force the user to use that convention. If they want to bring another variable with another units, they need to do it in the CDEPS side with some customization (maybe they could create their own ERA5 mode). Current, design does not allow to be generic enough and cover all the cases. @sanAkel Let me your unit preference too. We need to find a common ground between UFS, UFS Coastal and CESM and fix the units to move on in this PR. |
@uturuncoglu I will let @raphaeldussin respond to this question. 🙏 |

Description of changes
This PR aims to restructure ERA5 data mode to support:
(1) Using ERA5 as a replacement of JRA55 under CESM framework. This work does not include any necessary change needs to be done in CIME interface.
(2) Adding new data component configuration option for data atmosphere (DATM) as
skip_field_check. The default value is.false.and does not change the exiting behavior. By setting it.true.the field check part is skipped and user is able to provide just set of fields supported by the data mode.(3) The changes related to support UFS WM RTs with help of (2) and also some other changes.
Specific notes
Contributors other than yourself, if any:
CDEPS Issues Fixed (include github issue #):
Are there dependencies on other component PRs (if so list):
No
Are changes expected to change answers (bfb, different to roundoff, more substantial):
No
Any User Interface Changes (namelist or namelist defaults changes):
New optional
skip_field_checkoption for datmTesting performed (e.g. aux_cdeps, CESM prealpha, etc):
UFS WM RTs:
UFS Coastal:
Hashes used for testing: