Migrate execution to GNU Parallel

GNU Parallel allows us to run several simulations at the same time and
resume the simulations in case the current run stops for some reason.

Thus, the MC-2.f90 code has been adapted to support running it via GNU
Parallel (passing the namefile via stdin), and a bash script which
replaces the previous dependenciaEn*.bash scripts has been created,
named runAll.bash.

Change-Id: I5cc8bd6fb5a176c73dd7372eb61b9eabc278c12b
diff --git a/quad10/fenomens/lab/p4/MC-2.f90 b/quad10/fenomens/lab/p4/MC-2.f90
index 48c6a11..9b8e78e 100644
--- a/quad10/fenomens/lab/p4/MC-2.f90
+++ b/quad10/fenomens/lab/p4/MC-2.f90
@@ -17,15 +17,10 @@
 
   ! Inicialitzem algunes variables sobre el problema
   namelist /DADES/ L, NOM, TEMP, NSEED, SEED0, MCTOT, MCINI, MCD
-  open(10, file="mc2.dat")
-  read(10, DADES)
-  close(10)
+  read(nml = DADES, unit = 5)
 
   N = L*L
 
-  ! Obrim el fitxer on escriurem els resultats a cada iteració
-  open(unit = 12, file = "data_out/" // trim(NOM) // ".out")
-
   ! Cache dels valors de l'exponencial
   do I = 0, 8
     W(I) = (2**30 - 1 + 2**30)*exp(-float(I)/TEMP)
@@ -47,7 +42,6 @@
 
     E = energ(S, L)
     M = magne(S, L)
-    !write (12, *) "0", E, M
 
     ! Iterem amb el mètode de Montecarlo
     do IMC = 1, MCTOT
@@ -75,10 +69,9 @@
         M = M + 2*S(I, J)
       enddo
 
-      if (mod(IMC, 10000) == 0) then
-        print *, "Iter:", IMC, "Energia:", E, "Magn:", INT(M)
-      endif
-      !write (12, *) IMC, E, M
+      !if (mod(IMC, 10000) == 0) then
+      !  print *, "Iter:", IMC, "Energia:", E, "Magn:", INT(M)
+      !endif
 
       if (IMC > MCINI .and. mod(IMC, MCD) == 0) then
         SUMI = SUMI + 1
@@ -106,10 +99,9 @@
 
   ! Guardem a un fiter els promitjos
   open(unit = 13, file = "data_out/" // trim(NOM) // ".res")
-  !write(13, *) "L,     T,     <E>,     <E**2>,     Var(E),     <M>,     <M**2>,     Var(M),     C_V,     CHI"
+  !write(13, *) "L,     T,     <E>,     <E**2>,     Var(E),     <M>,     <|M|>,     <M**2>,     Var(M),     C_V,     CHI"
   write(13, *) L, TEMP, SUME, SUME2, VARE, SUMM, SUMAM, SUMM2, VARM, CV, CHI
 
   ! Tanquem els fitxers de sortida
-  close(12)
   close(13)
 endprogram main