SPECIAL option : -EditData VAR
This option allows a user to read a WRF netCDF file, change a specific field, and write it BACK into the WRF netCDF file.
This option will CHANGE your CURRENT WRF netCDF file, so TAKE CARE when using this option.
ONLY one field at a time can be changed. So if you need 3 fields changed, you will need to run this program 3 times, each with a different "VAR"
IF you have multiple times in your WRF netCDF file – by default ALL times for variable "VAR" WILL be changed. If you only want to change one time period, also use the “-t” option.
HOW TO USE THIS OPTION:
**Make a COPY of your WRF netCDF file before using this option**
EDIT the subroutine USER_CODE
ADD an IF-statement block for the variable you want to change. This is to prevent a variable getting overwritten by mistake.
For REAL data arrays, work with array "data_real" and for INTEGER data arrays, work with the array "data_int".
Example 1:
If you want to change all values of U (for all time periods) to a constant 10.0 m/s, you would add the following IF-statement:
elseif ( var == 'U') then
data_real = 10.0
Example 2:
If you want to change a section of the LANDMASK data to SEA points:
elseif ( var == 'LANDMASK') then
data_real(10:15,20:25,1) = 0
Example 3:
Change all ISLTYP category 3 values into category 7 values (NOTE this is an INTEGER field):
elseif ( var == 'ISLTYP') then
where (data_int == 3 )
data_int = 7
endwhere
Compile and run the program
You will be asked if this is really what you want to do.
ONLY the answer "yes" will allow the change to take effect
|