Wednesday, November 28, 2018

Research Note #17 - WRF-Chem Simulation with ECMWF ERA-Interim Data

Running WRF-Chem with ERA-Interim data is basically similar with GFS data. The main difference is the pre-processing steps. While GFS (FNL or forecast) dataset contains everything the user needs for the pre-processing, ECMWF (ERA-Interim, Era5 etc) dataset requires more efforts from user to determine parameters included in the data before downloading and processing it. It may seems bothersome and complicated, but determination of parameters is really important to understand how WRF model works.

The key point here is WRF's Vtable file, which contains all parameter needed for simulation. Once you understand the contents of the file (in accordance with the type of input data), you can basically use WRF with many kinds of input dataset.

To make long story short, here are steps for running WRF-Chem with ERA-Interim dataset:

1. Downloading Data
  • Go to ECMWF website, and log-in to it. An account is required for downloading data, thus if you don't have one, just register a new account. It's free.
  • Once you logged in, browse into Forecast > Datasets > Archived Datasets > Reanalysis Datasets, and finally, select Download on ERA-Interim section. You will be directed to ERA-Interim, Daily data page.
  • Now, the most important thing, WRF needs two kinds of level type for the data: surface and levels. Aside from surface level, there are at least two kinds of level type could be used for WRF: pressure levels and model levels. Which level type you use will depend on Vtable you use for WRF (wrf directory/ungrib/Variable_Tables). For this example, I use, which means I will use model levels type dataset. Another important thing, aside from daily data, you will need Invariant data for the data field. This data is static and not time-varied as daily data, hence you only need to download it once.
  • For the surface level data, on Type of Level section, select Surface, and put a tick on the month and year section. Regardless the data period of your interest, you have to download the data for at least one whole month. Next, select the time of the data. If you want to use 6-hourly boundary condition data, put check to all time box. For the step (model cycle), choose 0. Finally, you should choose 18 parameters of the surface level data (which are listed in WRF Vtable file): 2m temperature, 10m U wind component, 10m V wind component, mean sea level pressure, sea surface temperature, sea ice area fraction, skin temperature, snow density, snow depth, surface pressure, soil temperature levels (1,2,3 and 4) and finally, volumetric soil water layers (1,2,3 and 4). Click Retrieve GRIB. The website will summarize your request and if you think it's correct, click Retrieve now, and wait until the download link appears. Depending on the size of the data you requested, this process may take up to 1 minute to hours to complete. All those parameters will be downloaded as single file. Give it suitable name e.g. era-int-201711-sfc.grib.
  • For the model levels data, on Type of Level section, select Model levels. The steps are almost similar with surface level data download. This time you only need to select the month, year, time and 5 parameters on all levels: specific humidity, temperature, U component of wind, V component of wind and geopotential. Click Retrieve GRIB, and the rest will be same as surface level data download procedure. Anyway, since geopotential data is only available for one level, you could download it separately from the others. For example, the downloaded data will be named era-int-201711-geo.grib (for geopotential) and era-int-201711-mod.grib (for the other parameters). Therefore, there will be two model levels data files.  
  • Finally, don't forget to download the Invariant data. On ERA Interim Fields section, select Invariant, and put check on Land-Sea Mask, then click Retrieve GRIB and so on. Name it into era-int-invariant.grib.
  • In the end, based on this example, there are four files you should have from the website: era-int-201711-sfc.grib (surface levels), era-int-201711-geo.grib (model levels geopotential), era-int-201711-mod.grib (model levels other than geopotential) and era-int-invariant.grib (land-sea mask invariant).

2. WRF Pre-processing

  • Make sure you have already set the model domain (by geogrid.exe) and set the dynamic link of Vtable to file.
  • Link all ERA-Interim data downloaded by link_grib.csh script, and execute ungrib.exe. Wait until the process finished.
  • The next step after ungrib is very important. ECMWF model levels data uses sigma levels, while WRF requires pressure levels, thus you need to calculate the pressure level of the corresponding sigma level using utility calc_ecmwf_p.exe (WPS/util/calc_ecmwf_p.exe). You have to do this before executing metgrid.exe. Failing to do so may result on model crashes or unrealistic simulation results (as I previously experienced). Assuming this is the first time you use ERA-Interim data, open namelist.wps and add 'PRES' to the list of prefixes in the fg_name namelist variable.
          fg_name = 'FILE', 'PRES',
  • Make a dynamic link of the calc_ecmwf_p.exe to the current working WPS directory and make a text file with this following template, then save and name it: 'ecmwf_coeffs':

    0         0.000000    0.00000000
    1        20.000000    0.00000000
    2        38.425343    0.00000000
    3        63.647804    0.00000000
    4        95.636963    0.00000000
    5       134.483307    0.00000000
    6       180.584351    0.00000000
    7       234.779053    0.00000000
    8       298.495789    0.00000000
    9       373.971924    0.00000000
   10       464.618134    0.00000000
   11       575.651001    0.00000000
   12       713.218079    0.00000000
   13       883.660522    0.00000000
   14      1094.834717    0.00000000
   15      1356.474609    0.00000000
   16      1680.640259    0.00000000
   17      2082.273926    0.00000000
   18      2579.888672    0.00000000
   19      3196.421631    0.00000000
   20      3960.291504    0.00000000
   21      4906.708496    0.00000000
   22      6018.019531    0.00000000
   23      7306.631348    0.00000000
   24      8765.053711    0.00007582
   25     10376.126953    0.00046139
   26     12077.446289    0.00181516
   27     13775.325195    0.00508112
   28     15379.805664    0.01114291
   29     16819.474609    0.02067788
   30     18045.183594    0.03412116
   31     19027.695313    0.05169041
   32     19755.109375    0.07353383
   33     20222.205078    0.09967469
   34     20429.863281    0.13002251
   35     20384.480469    0.16438432
   36     20097.402344    0.20247594
   37     19584.330078    0.24393314
   38     18864.750000    0.28832296
   39     17961.357422    0.33515489
   40     16899.468750    0.38389215
   41     15706.447266    0.43396294
   42     14411.124023    0.48477158
   43     13043.218750    0.53570992
   44     11632.758789    0.58616841
   45     10209.500977    0.63554746
   46      8802.356445    0.68326861
   47      7438.803223    0.72878581
   48      6144.314941    0.77159661
   49      4941.778320    0.81125343
   50      3850.913330    0.84737492
   51      2887.696533    0.87965691
   52      2063.779785    0.90788388
   53      1385.912598    0.93194032
   54       855.361755    0.95182151
   55       467.333588    0.96764523
   56       210.393890    0.97966272
   57        65.889244    0.98827010
   58         7.367743    0.99401945
   59         0.000000    0.99763012
   60         0.000000    1.00000000
  • Execute the utility and wait until it completes calculating the pressure levels. This results new files with prefix 'PRES' in current directory. Once finished, you can execute metgrid.exe. This will complete the pre-processing steps.
3. Running WRF
  • Open namelist.input in WRF's run directory, and pay attention to these following variables, since they are closely related to ECMWF data, e.g. number of metgrid pressure levels. Modify the values as follows:
num_metgrid_levels = 61 [default 32]

surface_input_sources= 1 [default 3]
  • Execute real.exe and finally, wrf.exe to run the model.  
That's it. This post will be updated once something new occurred in the future.

Friday, November 16, 2018

Gunpa #39 - HGUC Sinanju Stein (Narrative Version)

I've never been a big fan of the red Sinanju from Unicorn series. While it's really cool, I still prefer the 'fat' Sazabi than Sinanju. In my humble opinion, Sinanju is an over-designed mobile suit and lacks the war robot theme which is one of the aspects I like the most about gundam and real-robot genre. And then, comes the Sinanju Stein, which is basically the Sinanju, before 'stolen' and modified by Neo Zeon for Full Frontal, the second coming of Char. In almost every aspect, Sinanju Stein is very same with Sinanju. The difference lies on the aesthetics since the mobile suit was built by Anaheim Electronics, the main MS supplier of Earth Federation. Sinanju Stein appearance is just like a mixed of Nu Gundam and Sazabi. It has gundam face and eyes, sharp-angled design as typical EFSF mobile suits, while inheriting the body shape of Sazabi and proportion as well as color scheme of Nu Gundam. Anyway, what I like the most about Sinanju Stein is it looks much more like a war robot than a super robot as red Sinanju. Therefore, when Bandai announced that they will release Sinanju Stein in HGUC line, I was so hype for it.

I got the kit from コジマ (Kojima), one of the retail stores which has the most gunpla collection in the city, with the price of 1980 Yen (the original price is 2600 Yen). It has 11 runners, with one comes runner from HGUC Sinanju (D runner), and one comes from HGUC Neo Zeong (F runner). One may think it's just a retooling from Sinanju, but in fact, it mostly uses new design, in particular with the body armor parts.

After completed the assembly, one could easily tell that this kit actually a miniature version of MG Sinanju Stein. Aside from inner frame and several gimmicks, it almost looks identical with the MG version, especially the panel lines. If only it comes with proper decals, this HG kit will look exactly similar with its MG counterpart. The main differences between the original Stein and Narrative version are (of course) the Neo Zeon emblems on the chest and sleeves, grayish color scheme instead of white, longer fuel tanks and slightly different beam rifle. Cool thing of this kit is, it provides option parts for making shorter fuel tanks and extra parts (with different color) for the leg thrusters, which makes me quite sure that Bandai will likely released the original Sinanju Stein, probably as P-Bandai. Also, the fact that Stein's beam rifle is slightly retooled of Sinanju's is a big plus. At least the builder has option to choose between Stein or Sinanju beam rifle for customization.

Stein and Sazabi (with action base)
Now, lets talk about articulation. Stein narrative version has quite unique articulation on the shoulder parts which enables the arms to stretch out, to the front, back or upwards. Also, the elbow connection is quite stiff, hence holding such a huge beam rifle is not a problem at all. The legs/knee could bend quite far inside, which is really good. The hands, feet and (unfortunately) waist use ball joint connection which is typical for a HG kit. The leg and backpack thursters also have articulation gimmicks. All I can say is this kit has really good articulation and it's easy to make cool poses with it (just look at the pictures).

For accessories, this kit comes with a huge beam rifle, bazooka, two beam sabers, grenade launcher and shield. The bazooka has short and long barrels, and it could be attached to the beam rifle which makes the weapon totally badass!! Grenade launcher could also be attached to the beam rifle and shield. This is not in the manual, but few modification could enable the bazooka to be attached to the shield, as the red Sinanju does in the OVA. The beam saber use yellow clear effects, and the hilts could be stored in the arm. Unfortunately, it doesn't have beam tonfa gimmick as MG, which is I don't really complain about since it's a HG. This kit has 6 sets of hands: a pair of closed hand, a pair of open hand, 1 trigger right hand and open left hand. Anyway, there are only 5 sets of hand guards which is quite weird, but I also don't mind much about it since you could only use 2 hands at a time.

Now let's talk about the bad side. As other Sleeves HG, this kit only uses stickers for the Neo Zeon emblems. Also, the beam rifle lacks parts separation. If you don't like it, you can paint it of though. Lastly, it only comes with sticker, no marking decals at all. Those are the reasons which prompted me to apply custom decal and paint on it.

I used some spare waterslide decals of RG Sinanju and 1/144 HQParts decals to add some details to the kit. For the paint, I used black, grey and red gundam marker to add color separation to the beam rifle. Finally, I applied two layers of matte top coats with Mr. Top Coat for finisher. The final result is so amazing. For posing purpose, I used action base 5 and Kotobukiya red LED sword.

Finally, the verdict. I could say this kit is so great, probably one of the best HG I've ever built. The details are overwhelming, even though there are some areas it lacks but that's still reasonable. The articulation is fantastic with tons of accessories and extra parts, hence it's really fun to play with. Finally, with price tag of 2600 Yen, this kit is well worth of your money and I really recommend it for any gundam/gunpla fans.


MSN-06S-2 Sinanju Stein (Narrative Version)

  • Beautiful aesthetics, a miniature version of MG Sinanju Stein
  • Great articulation with wide range of movements
  • Lots of accessories, with extra spare parts and options for custom
  • Solid joints, really fun to play with
  • Good price
  • No marking stickers
  • Foil stickers for Neo Zeon markings on the collar and arms