Modification of land use and water temperatures

Compiling NMM/ARW code for EMS system, upgrading WRF cores on your own, changing EMS scripts to suit your particular needs, and other modifications to original EMS distribution goes in this forum. These are officially unsupported actions.
dmbrown1
Posts: 15
Joined: Tue Aug 10, 2010 9:02 pm

Modification of land use and water temperatures

Post by dmbrown1 » Tue Feb 01, 2011 7:45 pm

This is a summary of how I have gone about changing the land use and other data in WRF





A) Ways to change static variables



Variables that do not change during the model run can be modified in 2 different places






1) BEFORE you have created your domain, you can modify the variables by modifying the values in "wrfems/data/geog". In this folder lies all the surface things you may want to change, such as land use, topography, soil type, etc. I have been able to modify the 30s USGS land use files and the elevation files. I had to write a program to convert whichever binary files I needed into something which I could modify, and then back to the binary file. If anyone wants it, I wrote a short command line java program which does some of the work.


It converts the binary file into a:

Text file - you can edit the text directly
PNG file - you can colour the picture with a paint program
ASC file - for displaying maps in ArcGIS
GRD file - for displaying maps in Golden Software Surfer

Once the binary files have been replaced (BACK UP THE ORIGINALS), you must recreate the domain and the geogrid program will interpolate the new files into the proper netCDF files to run on the system. This is more handy than modifying the netCDF files (see next section) because all the calculations involving different grids and land use percentages are done for you in the geogrid program.

I have not been able to change the soil or lake temperatures here - see section C.






2) AFTER you have created your domain, the different static variables are interpolated into a netCDF file called geo_em.d01.nc, located in "wrfems/runs/YourSimulation/static". One of these is created for each domain, with domain 2 called geo_em.d02.nc, etc. You can access and modify the data within this file by using the program ncdump. Type

"ncdump geo_em.d01.nc > geo_em.d01.cdl -l 10000"

while in the same folder and it will output all data to a text file called "geo_em.d01.cdl". You can modify the data from within this file. You will have to do this for each domain.

Within this file there are different headings. You should be concerned with the following.

LANDMASK - whether it is land or water
LANDUSEF - the USGS land use fraction. There are 24 grids within this file for each land use type. You can edit the percentage of each land use type for each grid cell.
LUINDEX - the dominant USGS land use type (1 through 24)
HGT and SLP - the height and slope on different grids.
Then there are some soil types/temperatures, albedo and green vegetation sections.

I have not had success changing soil or lake temperatures here - see section C.

Once you are happy with the file, you can convert it back to netCDF format by typing the following:

"ncgen geo_em.d01.cdl -o geo_em.d01.nc"

and it will overwrite your old netCDF file.

dmbrown1
Posts: 15
Joined: Tue Aug 10, 2010 9:02 pm

Re: Modification of land use and water temperatures

Post by dmbrown1 » Tue Feb 01, 2011 7:46 pm

B) Creating a new land use type.

You need to check what land surface scheme you're using. View the following file:

"wrfems/runs/YourSimulation/conf/ems_run/run_physics.conf"

If it is set to the Noah LSM, then you need to look at the VEGPARM.TBL. If it is set to the 5 layer thermal diffusion, then you need to look at the LANDUSE.TBL. Both of these are located in:

"wrfems/data/tables/wrf"

Here you can modify things such as the albedo, the soil moisture, the roughness, etc. You will likely be using the 24 category USGS dataset. Sometimes it is listed as 27 categories or 33 categories. I haven't been able to use any categories beyond 27, or create new categories beyond 27.

To create a new land surface type, you can modify a type that you are not using. For instance, in Alberta, we do not have any use for any tropical forest landscapes, so I can change type 13 (Evergreen Broadleaf Forest) into whatever I want. I have not been able to create a new category in addition to all the ones that are there already.

For some reason, if you are using the Noah LSM, the roughness is still taken from the LANDUSE.TBL although all other data is taken from the VEGPARM.TBL. I don't know why or if this is only on my system.

dmbrown1
Posts: 15
Joined: Tue Aug 10, 2010 9:02 pm

Re: Modification of land use and water temperatures

Post by dmbrown1 » Tue Feb 01, 2011 7:47 pm

C) Ways to change lake/sea and soil temperatures

The WPS system takes the weather data it downloads and processes it into stuff for the model to use. It puts these files into the following folder:

"wrfems/runs/YourSimulation/wpsprd"

I have wanted to change lake temperatures to simulate an industrial system outputting heat into a lake, so I wanted to increase lake temperatures for this. WRF only uses the data from the FIRST file. If you want to change lake temperatures you need to edit only the FIRST file. It only uses the boundary conditions from the other files. The files are netCDF format, so you can edit them as explained above in section A) 1). To edit the lake temperatures you need to edit the surface temperature data. It should be easy to spot the lakes - they should be either really warm or really cold. If you have more than one domain, you will have to edit each one separately. I managed to turn the lake temperature up to 60 C and watch a giant vortex form.

I have not had any success editing the ground temperature using the surface temperature. In order to edit the ground temperature I needed to edit the soil temperature. This didn't work nearly as nice as the lake temperatures.

meteoadriatic
Posts: 1515
Joined: Wed Aug 19, 2009 10:05 am

Re: Modification of land use and water temperatures

Post by meteoadriatic » Tue Feb 01, 2011 8:32 pm

Wow,

this is great info! That is something I already wanted to play with! Thanks for the guide and keep great work :)

dmbrown1
Posts: 15
Joined: Tue Aug 10, 2010 9:02 pm

Re: Modification of land use and water temperatures

Post by dmbrown1 » Wed Feb 09, 2011 7:23 pm

The programs for converting binary WRF files are available here: dmbrown1

You will likely need all 4 files. There is a readme.txt file with instructions on how to use the programs.

Ivan
Posts: 1
Joined: Mon Mar 07, 2011 10:38 pm

Re: Modification of land use and water temperatures

Post by Ivan » Mon Mar 07, 2011 10:41 pm

Thanks,
it was very helpful. I try to do the same. However, one question still remains unclear: how does the lake surface temperature changes with time? Is it set to be constant in WRF or do they solve some equation for it? I think NOAH LSM don't deal with water bodies, so, most probably, lake surface temperature should be constant, I guess.

meteoadriatic
Posts: 1515
Joined: Wed Aug 19, 2009 10:05 am

Re: Modification of land use and water temperatures

Post by meteoadriatic » Thu Mar 17, 2011 9:23 pm

Hello,

until dmbrown comes back to topic.. it looks to me that lake temperatures are constant during model run. This did a problem to me because I got very high air temperatures over little lakes in very cold winter nights... up to 20 degrees C difference from reality. That wasn't good at all; so I used procedure dmbrown explained here and I changed that lake into wetland landuse category type. It can still evaporate moisture into air, but it also allows to cool a lot during cold winter nights and so, temperatures over it are now reasonably good.

colopolo
Posts: 1
Joined: Wed Jan 27, 2010 1:13 am

Re: Modification of land use and water temperatures

Post by colopolo » Wed Mar 30, 2011 2:16 am

dmbrown1 wrote:The programs for converting binary WRF files are available here: dmbrown1

You will likely need all 4 files. There is a readme.txt file with instructions on how to use the programs.
I run this java program to read one of landuse_30s files but I got some error message;

$ java Read 37201-38400.14401-15600 Output PNG
Exception in thread "main" java.lang.NoClassDefFoundError: com/trend/iwss/jscan/runtime/CallContext
at Read.main(Read.java:51)
Caused by: java.lang.ClassNotFoundException: com.trend.iwss.jscan.runtime.CallContext
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 1 more

I did set up classpath properly ( I did check it by helloworld) but I have no idea how to handle this error.
Do you have any idea about this problem?

Best Regards,
JY

dmbrown1
Posts: 15
Joined: Tue Aug 10, 2010 9:02 pm

Re: Modification of land use and water temperatures

Post by dmbrown1 » Sat Apr 09, 2011 1:50 am

I will try to answer some of these questions early next week.

dmbrown1
Posts: 15
Joined: Tue Aug 10, 2010 9:02 pm

Re: Modification of land use and water temperatures

Post by dmbrown1 » Sat Apr 09, 2011 9:27 pm

About lake temperatures (Ivan):

If you look in the run_physics.conf file, you can change a variable called SST_SKIN. Apparently this allows water temperatures to change with time in the model and you can set it on or off. Default is on.

I wouldn't think water temperatures would change much overnight anyway, but maybe in a small lake the air would mix enough to keep the air temperature cool - and maybe the model doesn't handle this. I had a problem last fall where the lakes should have been frozen, but weren't in the model and were adding way too much heat to the atmosphere. I never solved it - they just eventually froze a number of weeks later.


Regarding the Java program (colopolo):

It looks to me like Java is not finding the program. Read.class and all related files (including the ones you want to change) MUST be in the same directory, and you must be IN that directory, otherwise you may get this error. Hopefully this helps.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests