fR = [4.7359649E+00, 4.6914534E+00, 4.7839294E+00]

LX = [3.6278590E+01, 3.3001750E+01, 3.8759082E+01]
Zcut = [1.8858519E+01, 1.8857876E+01, 1.8955685E+01]

FileName = 'Zcut.h5'

from Run_21cmFAST import *
import numpy as np
import h5py

nf = len(fR)
nx = len(LX)
nzcut = len(Zcut)
N = nf*nx*nzcut
z, T0, Tr0 = Run_21cmFAST(fR[0],LX[0],Zcut[0])
nz=len(z)

T21_array = np.zeros((N,nz))
Trad_array = np.zeros((N,nz))

idx = 0
for fR_id in np.arange(0,nf,1):
    for LX_id in np.arange(0,nx,1):
        for Zcut_id in np.arange(0,nzcut,1):
            z, T21, Trad = Run_21cmFAST(fR[fR_id],LX[LX_id],Zcut[Zcut_id])
            T21_array[idx][:]=T21[:]
            Trad_array[idx][:]=Trad[:]
            idx = idx + 1
    print('Status: ', idx/N)

f = h5py.File(FileName, "w")
f.create_dataset('z',data=z)
f.create_dataset('T21_array',data=T21_array)
f.create_dataset('Trad_array',data=Trad_array)
f.close()
