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

Creating Intermediate Files using pywinter w/NOAA/CIRES/DOE 20th Century Reanalysis (V3) Data

msw9090

New member
Hello everyone,

I'm trying to run WRFv4.2.2 by utilizing a netCDF4 dataset (20CR mentioned above - I've tried doing this before, but couldn't get it to work w/v2).

My process so far:

1) Download the following files from NCAR RDA Dataset ds131.3:
---Surface Fields---
anl_mean_1938_RH_2m.nc
anl_mean_1938_TMP_sfc.nc
anl_mean_1938_TMP_2m.nc
anl_mean_1938_UGRD_10m.nc
anl_mean_1938_VGRD_10m.nc
anl_mean_1938_PRMSL_MSL.nc
anl_mean_1938_PRES_sfc.nc
anl_mean_1938_WEASD_sfc.nc
---3D Fields---
anl_mean_1938_TMP_pres.nc
anl_mean_1938_SPFH_pres.nc
anl_mean_1938_UGRD_pres.nc
anl_mean_1938_VGRD_pres.nc
anl_mean_1938_HGT_pres.nc
---Soil Fields (only 2 layers)---
anl_mean_1938_TSOIL_depth.nc
anl_mean_1938_SOILW_depth.nc
2) Use pywinter to read the above files, then write intermediate files for the surface (SFC:YYYY-mm-dd_HH), pressure layers (PL:YYYY-mm-dd_HH), and soil fields (SOIL:YYYY-mm-dd_HH).
3) Run metgrid.exe... *met_em* files are generated from the intermediate files, however, real.exe fails with the given text (rsl.error):
Using sfcprs to compute psfc
*** -> Check your wrfinput_d01 file, you might have input pressure levels too close together (********* Pa and ********* Pa) at ( 220, 172) for variable type Z
-------------- FATAL CALLED ---------------
FATAL CALLED FROM FILE: <stdin> LINE: 6241
troubles, could not find trapping x locations

Additionally, if you look at rsl.out, I discovered 'NaN' values:
*** -> Check your wrfinput_d01 file, you might have input pressure levels too close together (********* Pa and ********* Pa) at ( 220, 172) for variable type Z
i,j = 220 172
target pressure and value = 50.9812622 48.1957359
column of pressure and value = 50.9879074 120.062683
column of pressure and value = 50.9879074 320.804474
column of pressure and value = 50.9879074 526.152588
column of pressure and value = 50.9879074 736.712769
column of pressure and value = 50.9879074 952.789612
column of pressure and value = 50.9879074 1401.78870
column of pressure and value = 50.9879074 1874.82471
column of pressure and value = 50.9879074 2374.35742
column of pressure and value = 50.9879074 2903.48901
column of pressure and value = 50.9879074 3466.16675
column of pressure and value = 50.9879074 4066.88965
column of pressure and value = 50.9879074 4710.96191
column of pressure and value = 50.9879074 5404.98096
column of pressure and value = 50.9879074 6157.53125
column of pressure and value = 50.9879074 6980.08154
column of pressure and value = 50.9879074 7888.57812
column of pressure and value = 50.9879074 0.00000000
column of pressure and value = NaN -1.30954285E+26
column of pressure and value = 9.90348339 11440.0723
column of pressure and value = 9.61580372 13170.4902
column of pressure and value = 9.21034050 15604.1035

In my opinion, I think I did not define the grid properly. If you look at the raw file and compare it to my *met_em* files, there's a huge difference.
Raw File (PRES):
1694722647244.png
met_em File (PRES):
1694722740444.png

For pywinter (pywinter — pywinter 2.0.6 documentation), I defined the grid as follows: pyw.Geo0(S,W,dlat,dlon)
In which;

S = -89.463
W = 359.297
dlat = 0.702
dlon = 0.703

I'm pretty sure the issue is related to how I'm creating the grid that generates the intermediate output files. Does anyone have feedback on this?

I attached an intermediate file that I've been working with.

Thanks!
 

Attachments

  • SFC_1938-09-09_18.zip
    1.2 MB · Views: 2
I noticed the grid is inverted in the y direction (South America is North and North America is South).

The blue shades appear to belong to the mountains of Chile and the area, as a whole, is South America.

This definitely looks like a projection issue.

I'll post updates when I can.
 
I was able to run WRF by inverting the 'y' axis... I'll post the script here once I figure out the next issue.

Correct me if I'm wrong, but the *met_em*.nc files should resemble *wrfout* files(?). I'm running a hurricane event, and the mslp, at multiple time steps b/n *met_em* and *wrfout* files, don't align with one another. They're actually quite different.
WRF output (mslp):
1695596120375.png
MET_EM output for the same time (mslp):
1695596231250.png

How could the two be so different?
 
Last edited:
Ming Chen replied to my question from above in a different thread < WRF Output and *met_em*.nc Files are Vastly Different >:

"met_em data are derived from the 20th Century Reanalysis data, while wrfout files represent simulations of WRF. Note that the physics and dynamics as well as model resolutions etc. can be quite different between WRF and the model used to generate the reanalysis. It is not unexpected that wrfout and reanalysis show different results."
 
Since the problem mentioned above is related to my domain/model configuration, here's the script I used to generate intermediate files with the 20th Century Reanalysis (v3) product.

It's python script. Just set qdto and qdte to your simulation start and end days.

The script will create three directories:
~ is the directory where you run 'gen-wps.py' (keep in mind, even though the extension is .txt, it's python script).
1) ~/qdto-qdte/ #main directory
2) ~/qdto-qdte/Data/ #raw data will be downloaded to this directory
3) ~/qdto-qdte/WPS/ #intermediate files will be generated here

One last thing, it's not necessary to generate intermediate files, every hour, for the land mask (land_mask.nc). That can just be done once. As is, the script works well though with limited testing.

I hope this helps someone in the future!
 

Attachments

  • gen-wps.txt
    11.2 KB · Views: 37
Top