Friday, February 7, 2020

WRF on the Mac!

WRF on the Mac, in as few steps as possible


  1. First, big props to the Catastrophe Science blog. It's a little outdated, but I can confirm that even with the newest packages, you can compile WRF itself.
    1. It's not mentioned in the blog, but you can use Homebrew. Especially if you are used to packages in Linux, it's quite handy.
    2. Specfically, I used Homebrew to use GRIB2. Most of the files are in GRIB2 anyways from the major models, so it's worth it.
  2. This will be updated, but here are the basic steps I did after the steps listed above:
    1. Get 0p25 GRIB2 from Nomads (I use GFS)
    2. Save to data folder
    3. Dynamically link the GRIBS
      1. ./link_grib.csh ~/model/Data/gfs*
    4. Adjust namelist.input to time range and domain
    5. Wipe any FILE or geo or met files
    6. Execute UNGRIB
      1. At this point you should have FILE files
    7. Execute GEOGRID
      1. At this point you should have a geo file
    8. Execute metgrid
      1. At this point you should have met files
    9. Move to run folder of WRF
    10. Make sure your namelist.input matches what you used in the WPS!
    11. Link the files done from metgrid (below is an example)
      1. ln -s ../../WPS-4.1/met_em.d01.2020-02-* .
    12. Execute real.exe in the directory
    13. Execuite wrf.exe
    14. Open in IDV

Wednesday, March 28, 2012

MLB.TV NexDef on Ubuntu/Linux 2012 (Updated!)!

Thanks to an intrepid commenter, mit55, here are the instructions for 2012! I can confirm these work, as I am currently watching Mariners/A's with NexDef.

The download link is: http://mlb.mlb.com/media/player/nexd...definstall.dmg (As of 3/28/2012)

The following commands are how I did it:

1. Navigate to your Downloads folder.
2. Do the following commands; if you don't have the programs, install them.

Code:
dmg2img mlbnexdefinstall.dmg
sudo modprobe hfsplus
sudo mount -t hfsplus -o loop mlbnexdefinstall.img /mnt
cp /mnt/NexDef\ Plug-in.pkg/Contents/Archive.pax.gz .
gzip -d Archive.pax.gz
pax -r < Archive.pax
cd Library/Application\ Support/NexDef/lib/
java -Xmx128m -jar ./nexdef.jar
It works for me, so I hope if works for you! I can try to help you if it doesn't work, but I am far from a Linux expert.

Good luck, and Go Cubs!

Teddy

Wednesday, May 4, 2011

How to Change Mailbox Order in Thunderbird

The mailbox order can easily be changed by modifying your prefs.js file. This is located in Windows Vista and 7 at "C:\Users\your_username\AppData\Roaming\Thunderbird\Profiles\mt2ews1u.default" or, in Windows XP at "C:\Documents and Settings\your_username\Application Data\Roaming\Thunderbird\Profiles\mt2ews1u.default"
Of course, it is always good practice to make a copy of your prefs.js file as prefs.bak, in case you accidentally corrupt it.

Before editing, also take note of the order of mailboxes as it stands, then close Mozilla Thunderbird. This is the nut section of the prefs.js file:

user_pref("mail.account.account1.server", "server1");
user_pref("mail.account.account2.identities", "id1");
user_pref("mail.account.account2.server", "server2");
user_pref("mail.account.account3.identities", "id2");
user_pref("mail.account.account3.server", "server3");
user_pref("mail.account.account4.identities", "id3");
user_pref("mail.account.account4.server", "server4");
user_pref("mail.account.account5.identities", "id4");
user_pref("mail.account.account5.server", "server5");
user_pref("mail.accountmanager.accounts","account1,account2,account3,account4,account5");
user_pref("mail.accountmanager.defaultaccount", "account2"); 
In my case, account2 was a school account, account 3 my old school account, account4 another school account, and account5 a Gmail account I wanted at the second position. The order is taken from the bolded line with 2 caveats: because account2 is the default account, it is on top; because account1 is the Local Folders, it is at the bottom.  With this in mind, I wanted account5 to move up to second position and  account3 last. Here is how that line changes:

user_pref("mail.accountmanager.accounts","account1,account2,account5,account4,account3");
Save prefs.js, and fire up Thunderbird. You are all set!

Note: If you are not sure which number is what account, search for "mail.server.server1.directory", replacing the number after server with what you are searching for. The directory name should be the same as the account. 

Sunday, April 17, 2011

A Compendium of WRF Errors

As an atmospheric science grad student, I often run the WRF model. The errors it throws can be somewhat inscrutable, so here is a compendium of errors that I have frequently run into:

  1. X  points exceeded cfl=2 in domain d01 at time Y
    1. Meaning: Your time step is too long for the waves that exist within the model; it cannot solve the PDE's.  The CFL condition is explained here. Some may recall it from their dynamics courses. 
    2. Effect: If the model becomes sufficiently unstable it will fail.
    3. Solution: Either lower your time step or let the model damp out the instability. It seems to happen particularly at the upper boundary of the model, which is normally in the stratosphere and thus not a huge concern.
  2. Flerchinger USEd in NEW version. Iterations= 10
    1. Meaning: This condition (technically not an error) is thrown by the NOAH Land Surface Model module. Apparently, it involves the amount of supercooled water available if the ground is frozen. Often, this is because there is very low soil temperature in your model run.
    2. Effect: Because this is an explicit method of solving for the supercooled water available, the model slows down by several orders of magnitude. 
    3. Solution: Unclear, but changing from the NOAH land surface model suppresses the error.
  3. glibc detected *** free(): invalid pointer: 0xb7f4fc90
    1. Meaning: Invalid pointer means a reference to memory returned empty. In my case, this was caused by attempting to use the Zhang-McFarlane convection scheme in WRF 3.3.
    2. Effect: Model halts, often before the first time step.
    3. Solution: None that I know of, but it appears the CAM ZM module requires very specific namelist.input choices. These include only using the MYJ or Brotherton PBL schemes and including a shallow convection parameterization. As of now, I have not been able to use the module.
  4. Avost in Vilka
    1. Meaning: Cryptically, this is Russian for 'Crash in Fork', and is related to the land surface model.
    2. Effect: Model crashes, and this seems to be related to bad soil temperature values again.
    3. Solution: Unclear, sometimes my model runs go through, others grind to a halt with no change in namelist.input.
If you have any insight into these problems, feel free to post in the comments.  The WRF model is a wonderful tool, but its errors can be confounding. Often, I have found looking directly in the code (particularly if the errant module is named) can at least give you some sense of where the problem lies.

Thursday, April 14, 2011

MLB.TV NexDef on Ubuntu/Linux 2012 (Updated!)!

Thanks to an intrepid commenter, mit55, here are the instructions for 2012! I can confirm these work, as I am currently watching Mariners/A's with NexDef.

The download link is: http://mlb.mlb.com/media/player/nexd...definstall.dmg (As of 3/28/2012)

The following commands are how I did it:

1. Navigate to your Downloads folder.
2. Do the following commands; if you don't have the programs, install them.

Code:
dmg2img mlbnexdefinstall.dmg
sudo modprobe hfsplus
sudo mount -t hfsplus -o loop mlbnexdefinstall.img /mnt
cp /mnt/NexDef\ Plug-in.pkg/Contents/Archive.pax.gz .
gzip -d Archive.pax.gz
pax -r < Archive.pax
cd Library/Application\ Support/NexDef/lib/
java -Xmx128m -jar ./nexdef.jar
It works for me, so I hope if works for you! I can try to help you if it doesn't work, but I am far from a Linux expert.

Good luck, and Go Cubs!

Teddy