#!/bin/bash
whole_ensemble_size=$1
ensemble_pool_size=$2
ensemble_pool_rank=$3
ensemble_pool_member_rank=$4

echo noise_teta=1e-8 > ensemble.def
echo seed_noise_teta=$(($ensemble_pool_size * $ensemble_pool_rank + $ensemble_pool_member_rank)) >> ensemble.def
echo whole_ensemble_size=$whole_ensemble_size >> ensemble.def
echo ensemble_pool_size=$ensemble_pool_size >> ensemble.def
echo ensemble_pool_rank=$ensemble_pool_rank >> ensemble.def
echo ensemble_pool_member_rank=$ensemble_pool_member_rank >> ensemble.def

echo "&ensemble" > namelist_ensemble
echo "whole_ensemble_size=$whole_ensemble_size,">> namelist_ensemble
echo "ensemble_pool_size=$ensemble_pool_size,">> namelist_ensemble
echo "ensemble_pool_rank=$ensemble_pool_rank,">> namelist_ensemble
echo "ensemble_pool_member_rank=$ensemble_pool_member_rank">> namelist_ensemble
echo "/" >> namelist_ensemble
