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

NAMELIST HELP

kcmonaka

New member
Please assist I am trying to do some simulations over SADC region. now this is more of a benchmark case before i start the actual WRF run. so appears that my domain is focused on the Northeastern parts of Africa but this is contrary to the namelists attached. I will attach the python script I am using to extract the above.. please assist as its been 2 months now trying to sort this issue.

PYTHON SCRIPT

import xarray as xr

import matplotlib.pyplot as plt

import geopandas as gpd

# Open the NetCDF file using xarray

file_pattern = '/home/wrf/Build_WRF/WRF/run/wrfout_d01_2022-12-25_*00:00'

# Open and combine the NetCDF files using xarray

combined_data = xr.open_mfdataset(file_pattern, combine='nested', concat_dim='Time')

# Access the "RAINC" variable

rainc_var = combined_data['RAINC']

# Compute the cumulative sum along the time dimension

cumulative_rainc = rainc_var.sum(dim='Time')

# Load the administrative boundaries shapefile using geopandas

admin_boundaries = gpd.read_file('/home/wrf/Build_WRF/WRF/run/SHP/NationalBnds.shp')

# Plot the cumulative map and shapefile

fig, ax = plt.subplots(figsize=(10, 8))

cumulative_rainc.plot(ax=ax)

admin_boundaries.plot(ax=ax, facecolor='none', edgecolor='black')

# Adjust plot extent

xmin, ymin, xmax, ymax = admin_boundaries.total_bounds

ax.set_xlim(xmin, xmax)

ax.set_ylim(ymin, ymax)

# Save the plot to a file

plt.savefig('rainfall_plot_J10.png')

I have attached the ideal map projection thatI want. Please assist

 

Attachments

  • namelist.wps
    768 bytes · Views: 1
  • namelist.input
    3.7 KB · Views: 2
  • rainfall_plot_J10.png
    rainfall_plot_J10.png
    84.3 KB · Views: 3
  • projection.jpg
    projection.jpg
    101.6 KB · Views: 3
Last edited:
Hi,
I get a different domain than you are getting (I'm attaching the domain your namelist is producing) It may be more simple/accurate to use the WPS/util/plotgrids_new.ncl script to take a look at your domain, than trying to plot with a python script. You will need to modify the following namelist parameters to ensure your domain is in the right location and is the right size.

Code:
parent_id         =   1,   1,
 parent_grid_ratio =   1,   3,
 i_parent_start    =   1,  169,
 j_parent_start    =   1,  163,
 e_we              =  400, 592,
 e_sn              =  325, 355,
 dx = 10000,
 dy = 10000,
 map_proj = 'lambert',
 ref_lat   =  -18.789,
 ref_lon   =  7.537,
 truelat1  =  -18.789,
 truelat2  =  -18.789,
 stand_lon =  7.537,

Please take a look at the descriptions for these parameters in the WPS chapter of the WRF Users' Guide. You may also find some useful information in this WPS Best Practices web page, or in this presentation on WPS.
 
Top