Monday, December 12, 2016

Research Note #6 - Beberapa Script Fortran Serba Guna

Berikut ini adalah beberapa fungsi/statement Fortran yang biasa digunakan untuk berbagai keperluan (termasuk riset). Daftar script ini bisa diperbaharui kapan saja, sesuai kebutuhan. Yang perlu diperhatikan, untuk script Fortran pada tulisan ini, saya menggunakan gfortran compiler (GCC) versi 4.8.1 di Windows (MinGW).

Catatan:
(Last updated: Dec 14, 2016)
Judul tulisan ini sedikit diubah agar tidak bias. Versi GCC juga ditambahkan.

Selamat menikmati.

1. Deklarasi variabel
implicit none
character :: line,the_str,inputfile,outputfile
character(len=100) :: thn,yearstr
integer :: year,month,day,maxyear,maxmonth,maxday,obstime
integer*2 :: tmi_tot_px,tmi_rain_px,pr_tot_px,pr_rain_px
integer*4 :: comb_tot_px, comb_rain_px
real :: tmi_mean_rain,pr_mean_rain,comb_mean_rain
parameter (XDIM=1440,YDIM=720,undef=-999)

Catatan:
  • Karakter '::' d antara jenis variabel dan nama variabel bisa diabaikan.
  • 'Implicit none' diletakkan sebelum deklarasi variabel. Tanpa 'implicit none', variabel dengan nama i, j, k, l, m dan n akan dianggap integer, dan lainnya dianggap real. Statement ini harus digunakan untuk menghindari kebingungan yg akan muncul nantinya.
  • Data character tanpa opsi 'len' hanya memuat 1 karakter.
  • Integer *2 untuk integer 2 byte, integer*4 untuk integer 4 byte.
  • Parameter digunakan untuk menentukan konstanta.

2. Deklarasi array
real, dimension (1:XDIM,1:YDIM) :: grid_val 

atau

real grid_val(XDIM, YDIM)
Catatan:
  • Dimension berguna untuk menentukan awal indeks array (misalnya 0, 1 atau 2 dll). Tanpa dimension, indeks array akan dimulai dari 1.

3. Membuka file binary
open(unit_no,file=[filename],form='unformatted', access='direct',recl=[byte]*[xdim]*[ydim],status=[fstatus])
...
close(unit_no)

Catatan:
  • Unit_no adalah integer antara 1 sampai 99. Hindari 5 dan 6 karena merupakan reserved number (5=standard input, 6=standard output).
  • Filename harus berjenis karakter. 
  • Recl harus ada. Byte bisa 2 (2 byte) atau 4 (4 byte). 
  • Fstatus bisa 'old' bila hanya membuka, 'replace' bila ingin memodifikasi file.  

4. Membuka file teks/ASCII
open(unit_no,file=[filename],form='formatted',status=[status])
...
close(unit_no)

Catatan:
  • Opsi form bisa diabaikan.
  • Status sama aturannya dengan file binary.
  • Aturan lain sama dengan file binary.

5. Looping
Ada beberapa cara. Misalnya:
do n=[start],[end] 
 ...
end do 

atau,

n=[start]
do while(n<=[end])
   ...
  n=n+1
end do

Catatan:
  • Looping dengan 'while' harus menyertakan persamaan untuk counter (misal n=n+1) untuk menghindari looping tanpa akhir, kecuali pada kasus-kasus tertentu.

6. Komentar
Komentar bisa menggunakan 1 baris penuh (dengan 'c') atau pada baris yang sama di belakang script (dengan '!').

c --------------- The start of MAJOR comments #1 ----------------------------------
c This part will determine the starting and ending time of processed data files
c and observation time/type

write(*,'(a)',advance='no') ' Enter the starting year: '


day=1    ! Change this only if you want to start day other than 1. 


7. Kondisional
Ada dua jenis statement kondisional yang biasa digunakan. Yang pertama dan paling umum digunakan adalah (if .. then .. else .. end if) untuk dua atau tiga pilihan. Bila pilihannya banyak, bisa menggunakan (select .. case .. end select).

if ([cond1] [operator1] [cond2] [operator2] ... [condn]) then
 ...
else
 ...
end if

Catatan:

  • Operator bisa berupa boolean (misal: '.and.', 'or' dll) atau matematika (misal: '==', '=/', '<=' dll)

select case ([var_name])
case ([cond1,cond2:cond3])
 ...
case ([condA,condB,...,condn])
 ...
case default
 ...
end select

Catatan:

  • Koma digunakan untuk memisahkan kondisi tunggal, colon (:) digunakan untuk kondisi dengan selang tertentu.
  • 'Case default' kurang lebih sama dengan 'else'.

8. Membaca file teks/ASCII baris demi baris sampai akhir file
do while (1.eq.1)                       
read(unit_no,END=500) line 
 ... 
end do
 ...
500 [CONTINUE or some script]
end

Catatan:
  • Unit_no (unit number) harus sama dengan unit_no file yang hendak dibaca .
  • Line number tidak harus 500. 

9. Memasukkan data file binary ke dalam array
Untuk array 2 dimensi (misalnya matriks array 10x10):

implicit none
parameter (XDIM=10,YDIM=10)
 ... 
do y=1,10
 do x=1,10
  read([unit_no],rec=1) ((rain(x,y),x=1,XDIM),y=1,YDIM)
 end do
end do  

Catatan:
  • Rec=1 untuk akses direct.
  • Untuk array 3 dimensi dst, tinggal tambahkan kurung di belakang statement read. Jangan lupa deklarasikan komponen arraynya. Contoh:
  read([unit_no],rec=1) (((rain(x,y,z),x=1,XDIM),y=1,YDIM),z=1,ZDIM)
     
 (Bersambung ...)

Monday, December 5, 2016

Gunpla #27 - HGUC Delta Plus Review

It's been almost a year since I built my last kit (Jegan ECOAS), and finally today, I completed the Delta Plus. It's become my first kit I built after living in Japan (started from last April). Tell the truth, I always want to build Delta Plus from long time ago, but somehow, I've always ended up buying another kit. Seriously, I took a great risk from building the Delta Plus since I used very inappropriate tools (too much bigger nipper and cutter), at a very inappropriate place (my laboratory), during inappropriate time (daytime, on week days). Fortunately, nobody found out what I did, and the result is (almost) perfect, and now, the kit's standing on top of my desk. I hope it could help lightening up my 'boring' and 'monotonous' daily academic life.

Delta Plus, as you may already know, was developed from the-never-constructed Delta Gundam during the Zeta Project. If only Anaheim Electronics' engineers could solve the problem with its frame strength, Char Aznable probably would get a transformable mobile suit instead of Hyaku Shiki. The Delta Plus is a perfect reminiscence of both Delta Gundam and Hyaku Shiki, during the Mobile Suit Gundam Unicorn era.

Those "eyes" ... XD
This mobile suit is transformable between mobile suit mode and wave rider mode. And since it's a HG kit, we could just expect a "partsformer", instead of "transformer" mobile suit (no surprise here). Nevertheless, I love the Delta Plus design, not merely because its similarity with Hyaku Shiki, but also its color scheme (looks so militaristic) and of course, its ability to transform. The kit itself is quite solid and sturdy, no loose connections so far (for my case). The best part of this kit without a doubt are its sexy legs. The exposed "inner frame" gives a detail and complex feeling of the mobile suit. Furthermore, the design of the head is also top notch. I never get tired to see those menacing red eyes behind the transparent visor of Delta Plus.


Many reviews stated that this kit lacks articulation which I agree with. It's pretty difficult to pose the Delta Plus due the limited movement by shoulders, upper arm "skirt", waist, legs and head. I also think the beam rifle is a little bit to long, and when combined with the lack of open hands just makes shooting pose looks awkward.



Another drawback of this kit is the lack of accessories. You only get 1 beam rifle, 1 shield, 2 clear beam saber parts, 2 fix (closed) hands, 1 beam saber hand (right) and 1 beam rifle hand. That's all. I wonder why Bandai only gave us one beam saber hilt even though there are 2 beam saber parts. It's also disappointing to have only right beam saber hand since we could not handle it on the left hand (as MG Delta Plus).




Nevertheless, everybody know the main bonus offered by this kit: WAVE RIDER MODE! Just by looking at it, I'm sure nobody would deny that wave rider mode of Delta Plus is really amazing. It looks very similar with the fighters from Macross series.


The transformation was done by replacing some body parts with special transformation parts. Despite straightforward, the transformation is quite complicated, especially with the legs. Since there's a peg on the shield part, you'll have another option to put the beam rifle under the main body instead of under the wings as I shown here. Once it's finished and put on an action base, you could expect one of the best display on your desk. It's really beautiful to watch it again and again, thus I guess I'll leave it on this mode for awhile. 


  


My conclusion of this kit? Well, despite the lacks of articulation and accessories, HGUC Delta Plus is a solid kit with cool design, details and color scheme. The wave rider mode is the best part of this kit, and I suggest any UC fans should have it. 

----------------------

MSN-001A1 Delta Plus

Pros:
  • Cool design and badass color scheme
  • Sturdy parts and nice details
  • WAVE RIDER MODE!!
 Cons:
  • Lack articulations
  • Lack of accessories
  • Foil sticker only, no marking


Friday, September 30, 2016

Sky Force Reloaded - Prestige Points, Technicians and Mini-Boss for Stage 12

For complete planes list from previous update : Complete Planes of Sky Force Reloaded

After a couple of weeks, Sky Force Reloaded finally got new update ... and it's huge! 
I'm saluting the developers who brought a lot of new stuffs added to the game which surely enhance the game experience in many aspects. These are several changes I noticed after the latest update:

Game App Icon
It's not so important, but firstly, say goodbye to the 'retro' Sky Force Icon. I've seen it coming since the previous update. The new app icon looks fresh and modern. I personally like this new icon more than the old one.

The new app icon looks much more modern than ever.

Prestige Points
New addition to the game.  It's a kind of achievement points. You could get points (in diamonds) after you achieved certain objectives, e.g. rescuing certain number of survivors, destroying boxes, upgrading weapons etc. The main purpose of prestige points is to enable players for unlocking the technicians, which will be explained below.

Prestige points in diamonds. Collect them to unlock the technicians.
Technicians
This is probably the most exciting stuffs of the latest update. Technicians have special abilities which will provide the player (or I could say, pilot) with certain bonus during the level, e.g. additional stars, power-ups, fortune (?) etc. The more prestige points you have, the more technicians you can unlock. Similar with planes, you could choose the technicians before the level starts. So far, there are eight technicians with different abilities (I have unlocked only six of them).
  • Gringo Star (The Beatles?) : fills a random crate with a bunch of extra stars. Use him if you wants more points from stars.
  • Kate Brush: paints your first scratch, that's one more chance to stay untouched. Good for achieving "Stay Untouched" medal.
  • Burton Panic: has a few power-ups of his own. The life-saver in emergency situations, he will unleash random extra power-ups (laser, shield or mega bombs) automatically, especially when you get cornered by enemies.
  • Lucy Clover: brings good fortune (in all aspects). So far, I've noticed that she will greatly increase chance to get card, especially when Ace of Spade plane is used. Furthermore, the auto-shield activation (during critical time) will almost be guaranteed if you use her. 
  • Slo Mo Chan: slows down hostile bullets. Slo Mo Chan will creates some kind of  "Aura" in the beginning of a level. The slow down also affects EMP, make him the best technician for the stage 5.
  • Tase Mebro: strikes nearby enemies with a lightning bolt. Self explanatory. The lightning strikes however, have a quite short range. 
  • Holo Granny: deploys decoys on the field. Despite haven't unlocked her by myself yet, this one is pretty interesting. She will apply a kind of "kage-bunshin" on your plane.

The technicians (upper) and Slo Mo Chan's aura (lower).
Mini-Boss for Stage 12
The missing part of level 12 of previous update. I said mini-boss because it's basically not as strong as or as large as the "real" bosses in the game. Furthermore, no trophy provided after you defeat it. Nevertheless, it's quite annoying and hard to defeat, especially during insane level of stage 12.

Mini-boss of Level 12. Annoying.
Additional info on cards
It basically provides more detail information for cards you've collected.

Information for card #24 (Golden Last Card)
New tournament level
I haven't seen it since the tournament starts each weekends.

Minor changes on previous stages
I noticed there are more enemy planes in the beginning of stage 7 and 12, hence it becomes more difficult to have a perfect finish (destroy all enemies) on those stages.
 
Can't wait to see further updates of the game, especially for the anticipated stage 13 XD

Monday, September 12, 2016

Sky Force Reloaded : The Complete Plane List

Sky Force Reloaded is one of the best (or maybe the best) vertical shooting games in 2016. While still retaining the classic arcade style for most of its game play, SFR moves one step further by providing some extras to enhance game experience of the players. One of the biggest departures from the previous games is the extra planes addition which could be obtained by collecting certain plane’s part on random occasions during a stage. These planes have their own characteristics and may provide various advantages (or even disadvantages) for certain game levels.

Here are the complete list of 9 planes provided in the game, based on the latest update (ver.1.45-Sep 9, 2016):    

-----
The Classic
“A Little Rusty but Gets the Job Done”
 

Also known as Model 2004. As starter plane of the game, The “Red” Classic is exactly what you can expect from a typical-standard-war-plane. Basically the same plane from previous Sky Force game, it provides standard armament to deal with the enemies, thus it might be overshadowed with other more powerful and special planes which appear later in the game.

The Classic's laser whip vs Twisted Vengeance (before the latest update)
Nevertheless, The Classic receives a special treatment once you obtain the last golden card (permanent card no. 24), it will replace the ship’s main canon with a laser whip. Compared to the spreading shots of a typical main canon, the laser lacks shooting coverage, but much more powerful. Tell the truth, the "supercharged" laser whip is arguably the most powerful weapon in the game, especially for the Nightmare levels and Bonus stages (B1/B2).

The Classic's sweeping rapid drones shots (after the latest update)
The latest update even modified the drones with more rapid and sweeping shots that cover greater area thus making the Classic much more versatile than ever. 

Pros: Versatile, laser whip (after you obtain the 24th permanent card) which is really powerful after being charged, sweeping rapid drones shots 

Cons: Very standard armaments, the laser whip lacks coverage.


Enforcer
“Main Cannon Damage +10%”
With 10% more damage, this plane is basically a slightly upgraded version of the Classic. Other than that, nothing’s so special with it. Nevertheless, it provides more fire power and ideal for early levels grinding than the Classic. The good news is: If you played Sky Force 2014 before, you will automatically get this plane.

Enforcer probably, is the best plane in the game if you use it after receiving temporary Maximum Firerate card.  

Enforcer vs Spinning Retaliation (Boss of Stage 2)

Pros: Versatile, 10% more damage with main cannon.

Cons: Very standard armaments, no specialty.

Ambulance
“Increased Rescue Speed”
The ship’s name and color tell you everything. This white ship is special made for rescue mission. It greatly increases the survivor rescue speed up to 50% (even more with no.8 card), thus perfect for collecting “Rescue All People” medal. The ambulance is truly a great help for rescue purpose, especially for early levels of everyone’s favorite Stage 5. 

Ambulance vs Canned Dread (before recent updates)
Ambulance starts to differentiate from other planes after recent updates by having three-way main cannon shots and increased defense. While some may argue that its fire power decreased, the Ambulance has become more and more versatile to use.

The latest update even brought another addition to the plane's arsenal: supercharge shockwave, which is released after using main weapon supercharge (permanent card #9 needed). The effect is similar with mega bomb, but much more smaller.    

Ambulance's new 3-way shots and supercharge shockwave (after the latest update)
Pros: Rescue speed increased much, special for rescue medal missions, “Stay Untouched” medal guaranteed after surviving the stage (if you haven’t had the medal yet), larger shots coverage, supercharge shockwave. Probably one of the best plane for tournament and the best wingman in the game.  

Cons: Low health, decreased fire power.


 Iron Clad
“Health +50%, Speed -10%”
The Hulk in the game, Iron Clad provides 50% more defense to your ship, while sacrificing 10% of the speed. That means, even though it’s less maneuverable, the plane could withstand more pounding from enemies. Iron Clad + “Health Regeneration” card will be perfect for conquering insane and bullet hell levels, especially for Stage 5 and after.

Iron Clad vs Canon Spider of Stage 4 (before recent updates)
Similar with Ambulance, the Iron Clad also could access supercharge shockwave after the latest update.

Iron Clad releases supercharge shockwave (after the latest update)
 Pros: More health, suitable for difficult stages especially when combined with “Health Regeneration” card, supercharge shockwave.

Cons: Slow, less maneuverable

  
Swift Justice
“Health -50%, Speed +10%”
This plane is a complete opposite of Iron Clad. It provides more maneuverability while having half of normal defense. If you prefer speed more than health, then Swift Justice is for you.

Swift Justice on Stage 5 (before recent updates)
Similar with Ambulance, the main cannon of Swift Justice also differentiate from others after the latest update. The main cannon now has very focused shots which provides more damage to a single target, hence increasing its fire power than before.

The changes of Swift Justice's main weapon after Oct 16 update (left) and Nov 16 update (right)

Pros: Highly agile, especially when combined with “Increased Plane Speed” card. Fire power increased after the latest update due to its focused shot main cannon.

Cons: Low health


Limp Berserker
“Max Fire Rate, Ridiculously Low Health”
My personal favorite. Limp Berserker, as the name implies, provides you with maximum fire rate, while having almost zero defense. For the people with “attack is the best defense” attitude, having this plane is a must. You’ll get maximum fire rate right from the start, which means, no need to collect power ups from glowing enemy ships, hence makes your job much easier. This plane however, shares the same weakness with other special ships: ridiculously low health.

Limp Berserker unleashed super charged canon on Murky Huntress (Boss of Stage 6)
Limp Berserker is one of the most versatile planes in the game, as it could adept perfectly with any difficulty levels, from the easiest to the hardest stages. If you concentrate on maximizing main cannon power, Berserker could help you to level up and gathering stars much more quickly than any other ships.

Pros: Maximum fire rate, highly versatile, “Stay Untouched” medal guaranteed after surviving the stage (if you haven’t had the medal yet).

Cons: Ridiculously low health, useless if you have max fire rate temporary card.


Ace of Spades
“Increased Luck at Card Hunting, Ridiculously Low Health”
This black plane is one of a kind, as its main purpose is obvious: card hunting specialist. While not having any bonuses in terms of armaments, Ace of Spade will boost the chance for getting cards in the game, especially with the help from certain cards in the game. Other than that, this plane is merely a ship with ridiculously low health. And unfortunately, due to the latest update, the card drop rate is also affected by game levels, thus making this plane only makes big effect during the early stages of the game. That doesn’t mean you can’t obtain cards with this plane on later stages. It just gets more and more difficult to use this plane due to its very low health and lacks of bonuses.

Ace of Spades vs Laser Whip Spider of Stage 7
Pros: The best plane for card hunting, especially on later stages and when it combined with cards which increasing the card drop rate and Lucy Clover (technician).

Cons: Ridiculously low health, lacks of armaments bonuses.



 Octopus
“Fire Mini-Rockets”
Alongside Limp Berserker, this is probably the most versatile plane in the game. Octopus is basically The Classic with modified missile system. Instead of firing a single guided missile, it unleashes multiple mini guided rockets to the enemies. While not powerful enough to destroy stronger opponents, the rockets are capable to disable enemy weapons from any blank points. These rockets are also very helpful to deal with canon fodders (formation of smaller planes crossing the screen), hence increasing the chance to get medal for destroying 100% enemy forces. Ideal for completing stage 5 and advanced stages.

Octopus vs Frying Falcon (Boss of Stage 8)
Pros: The most versatile plane in the game, capable for destroying multiple enemy planes and weapons from any blank points.

Cons: The individual rockets are typically weak against strong enemies


Gladius
“Increased Fire Power, Shorter Weapon Range”
Gladius is quite bizarre. It has the most powerful main canon among other planes in the game, with a price of ... (very) short shooting range. While highly capable for destroying enemies or even their bosses much faster, you need tremendous amount of skill to get this plane close enough to shot the enemy because the canon could only reach one-third of the screen. Hence, it’s quite safe to say that this plane is more difficult to use and not suitable for beginners. Anyway, if you love challenges and brave enough to deal face to face with the enemies, Gladius is for you.

Gladius vs Super Deflection Canon (Boss of Stage 9)
The latest update enables Gladius to have slightly longer range for a moment after the supercharge. 

Gladius' longer range after a supercharge (after the latest update)
Pros: The most powerful main cannon among other planes.

Cons: Very short weapon range, very difficult to deal with long range enemy weapons.