#!/bin/bash
# delete first line
sed  '/setup_case()/d' setup_case.py > temp_file
# add new first line plus global declarations
cat  ~/pythons-rans-code/global-GPU temp_file modify_case.py synt_fluct.py ../pyCALC-LES-GPU.py >  temp_file1;
# find setting of 'gpu' 
'grep' gpu setup_case.py > gpu_value;
# remove leading white space
sed -i 's/^[ \t]*//' gpu_value;
# add value of 'gpu' at first line
cat  gpu_value temp_file1  > exec-pyCALC-LES-GPU.py;
/usr/bin/time -a  -o out ~/anaconda3/bin/python -u  exec-pyCALC-LES-GPU.py > out
