Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

Trying to Use RAP as IC/BC

This post was from a previous version of the WRF&MPAS-A Support Forum. New replies have been disabled and if you have follow up questions related to this post, then please start a new thread from the forum home page.

weathertom

New member
I'm running into errors when trying to use the RAP hybrid files as IC/BC for a limited area domain run. I have the required intermediate files, but am getting an error that blending of terrain along the boundaries would fail. Does anyone have any more info/details on this error and how it can be addressed?
 
Can you attach your full log.init_atmosphere.0000.out and log.init_atmosphere.0000.err files? There should be some message indicating whether the intermediate file couldn't be opened, or whether it appears to be lacking a SOILHGT field.
 
When you do have a chance to try the RAP data again, I'd be interested to see exactly what the log file looks like. Regardless, I think the process of creating ICs and LBCs from RAP data will fail because the MPAS-Atmosphere v7.0 code doesn't have support for input datasets given on a Lambert conformal map projection. I have some changes in a branch named 'init_atmosphere/lambert_conformal_support' of my fork of the MPAS-Model repository that should add support for this projection; specifically, the changes are in this commit. Depending on your level of familiarity with git, I can provide more detailed instructions on how to merge these changes into your working copy of the MPAS-Model code.
 
Indeed, the errors I saw were related to the map projection, so that makes sense. I'll retry and share the logs when I get a chance. I'm familiar with git, so I could try that as well afterward (a possible workaround without doing that might be for me to remap onto a lat/lon grid using wgrib2). Thanks.
 
It appears my git skills are not as good as I thought, since I can't quite figure out how to merge that commit with the code on my end. So, any suggestions would be appreciated. Thank you.

mgduda said:
When you do have a chance to try the RAP data again, I'd be interested to see exactly what the log file looks like. Regardless, I think the process of creating ICs and LBCs from RAP data will fail because the MPAS-Atmosphere v7.0 code doesn't have support for input datasets given on a Lambert conformal map projection. I have some changes in a branch named 'init_atmosphere/lambert_conformal_support' of my fork of the MPAS-Model repository that should add support for this projection; specifically, the changes are in this commit. Depending on your level of familiarity with git, I can provide more detailed instructions on how to merge these changes into your working copy of the MPAS-Model code.
 
Assuming you've obtained the MPAS-Model code by cloning the repository, I think the following should be sufficient:
Code:
git remote add mgduda https://github.com/mgduda/MPAS-Model.git
git fetch mgduda
git merge mgduda/init_atmosphere/lambert_conformal_support
If the merge of the Lambert conformal changes is successful, you should see something like the following:
Code:
Updating 51d5624..95e7e46
Fast-forward
 src/core_init_atmosphere/mpas_init_atm_cases.F   | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----
 src/core_init_atmosphere/mpas_init_atm_surface.F | 17 +++++++++++++++++
 2 files changed, 85 insertions(+), 4 deletions(-)
 
I did the merge and re-compiled. I no longer get the error regarding the map projection, but am still running into an issue. I had to change the config_nfglevels to 51, but after doing that I still get the following error:

CRITICAL ERROR: Error in interpolation of st_fg to MPAS grid: num_st = 24448.

Am wondering if it's an issue with the soil data.

mgduda said:
Assuming you've obtained the MPAS-Model code by cloning the repository, I think the following should be sufficient:
Code:
git remote add mgduda https://github.com/mgduda/MPAS-Model.git
git fetch mgduda
git merge mgduda/init_atmosphere/lambert_conformal_support
If the merge of the Lambert conformal changes is successful, you should see something like the following:
Code:
Updating 51d5624..95e7e46
Fast-forward
 src/core_init_atmosphere/mpas_init_atm_cases.F   | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----
 src/core_init_atmosphere/mpas_init_atm_surface.F | 17 +++++++++++++++++
 2 files changed, 85 insertions(+), 4 deletions(-)
 
The message "Error in interpolation of st_fg to MPAS grid: num_st = XXXX" is generally indicative of an issue with the soil temperature. Would it be possible to use some of the utilities that come with the WRF Pre-processing System (WPS) to check that there are valid soil temperature data in your intermediate file? Specifically, you could use the "rd_intermediate" utility to check that there are fields named, e.g., ST000010, and you could use the "int2nc" utility to convert the intermediate file to netCDF format, where it would be easier to view the soil fields with, e.g., ncview.

Alternatively, if you could attach your complete log.init_atmosphere.* files, I can take a look to see what soil data appear to have been read and interpolated.
 
I used int2nc and there are soil temperature and moisture fields for 8 levels. Specifically, there are the following soil related fields in the intermediate file.

SOILHGT

SOILM001
SOILM004
SOILM010
SOLM030
SOILM060
SOILM100
SOILM160
SOILM600

SOILT001
SOILT004
SOILT010
SOILT030
SOILT060
SOILT100
SOILT160
SOILT600

mgduda said:
The message "Error in interpolation of st_fg to MPAS grid: num_st = XXXX" is generally indicative of an issue with the soil temperature. Would it be possible to use some of the utilities that come with the WRF Pre-processing System (WPS) to check that there are valid soil temperature data in your intermediate file? Specifically, you could use the "rd_intermediate" utility to check that there are fields named, e.g., ST000010, and you could use the "int2nc" utility to convert the intermediate file to netCDF format, where it would be easier to view the soil fields with, e.g., ncview.

Alternatively, if you could attach your complete log.init_atmosphere.* files, I can take a look to see what soil data appear to have been read and interpolated.
 
Thanks very much for checking. I think this is the problem -- that we have hard-wired logic for known soil layers to set, e.g., the soil layer bottom depth based on the name of the field (e.g., ST000010), and we don't currently have code to handle RAP soil layers.

It shouldn't be terribly difficult to add additional logic to handle RAP soil layers, though I couldn't say when I might be able to implement this myself. If you'd like to have a go at implementing support for RAP soil data yourself, I could probably provide some guidance. The best approach may be to open a separate thread in the "Code development" section of the forum.

As another option, it should in principle be possible to use land-surface fields, e.g., from the GFS model with RAP atmospheric fields. There could be issues of consistency in doing this, but it should be possible in any case.
 
Thank you for the reply. I went in and edited mpas_init_atm_cases.F to add the 8 RAP levels for soil moisture and temperature, then recompiled things. It successfully processed the RAP data after doing that (and making the appropriate namelist changes to increase the values for nfglevels and nfgsoillevels), and I was able to successfully complete a run. I do, however, need to take a look at the run results to make sure things look ok. Given that the RAP soil data are defined as levels (at least in the Vtable used by the ARW) rather than layers, I had to make some assumptions when adding them as layers in mpas_init_atm_cases.F. I assumed the following and coded things as such...

SOILM(SOILT)001 - soil moisture (temperature) at 1 cm
SOILM(SOILT)004 - soil moisture (temperature) of 1-4 cm layer
SOILM(SOILT)010 - soil moisture (temperature) at 4-10 cm layer
SOILM(SOILT)030 - soil moisture (temperature) at 10-30 cm layer
SOILM(SOILT)060 - soil moisture (temperature) at 30-60 cm layer
SOILM(SOILT)100 - soil moisture (temperature) at 60-100 cm layer
SOILM(SOILT)160 - soil moisture (temperature) at 100-160 cm layer
SOILM(SOILT)300 - soil moisture (temperature) at 160-300 cm layer

mgduda said:
Thanks very much for checking. I think this is the problem -- that we have hard-wired logic for known soil layers to set, e.g., the soil layer bottom depth based on the name of the field (e.g., ST000010), and we don't currently have code to handle RAP soil layers.

It shouldn't be terribly difficult to add additional logic to handle RAP soil layers, though I couldn't say when I might be able to implement this myself. If you'd like to have a go at implementing support for RAP soil data yourself, I could probably provide some guidance. The best approach may be to open a separate thread in the "Code development" section of the forum.

As another option, it should in principle be possible to use land-surface fields, e.g., from the GFS model with RAP atmospheric fields. There could be issues of consistency in doing this, but it should be possible in any case.
 
If the test simulation looks good, and if you'd be interested in getting your changes back into the main MPAS-Model repository, just let me know and I can help in the process of creating a new pull request from your changes.
 
Sounds good. Will let you know after I'm able to take a closer look at the results.

mgduda said:
If the test simulation looks good, and if you'd be interested in getting your changes back into the main MPAS-Model repository, just let me know and I can help in the process of creating a new pull request from your changes.
 
I've been doing 36-hour runs every 12 hours, and the output looks realistic, so I'd be happy to contribute the code modification to the repository.

I only have 32 cores to run things on, so am just doing a small domain but the fields look ok. I am now posting the realtime output online (at http://hopwrf.hopkinsschools.org/MPAS-3km/index_1.html). There is just one run there now (and the images cut off at 29 hours).

mgduda said:
If the test simulation looks good, and if you'd be interested in getting your changes back into the main MPAS-Model repository, just let me know and I can help in the process of creating a new pull request from your changes.
 
Top