Enquires whether the user would like to write a new params.txt file, or check an existing params.txt file, and follows up accordingly.
This routine has been wrapped in a function so that it can be called interactively from a jupyter notebook. It can also be invoked directly from the terminal by running: python 3 dice_inputs.py
Definition at line 24 of file dice_inputs.py.
32 print(
'Hello! I\'m here to help you with the input file for your Dice QMC simulation.')
36 print(
'Would you like me to write (w) or check (c) your input file?')
37 task = input(
'Your response ("w" or "c", without quotes): ')
40 while task!=
'w' and task!=
'c':
42 print(
'Error: Oops, your response is invalid, please enter "w" or "c", without quotes.')
43 task = input(
'Your response: ')
48 print(
'Alright! I shall write out a new input file for you.')
58 print(
'Your params.txt file is ready! You are all set to run the next step on Fortran :-) ')
62 print(
'Alright! I shall check the input file in this directory.')
66 f = open(
'params.txt')
67 except FileNotFoundError:
69 print(
'Error: Oops, there is no param.txt file in the current working directory.')
70 print(
' Please copy your params.txt file into this directory, and then run dice_inputs() again.')
71 print(
' Exiting the program.')
77 nml = f90nml.read(
'params.txt')
84 print(
'Your params.txt file is correct! You are all set to run the next step on Fortran :-) ')
def check_inputs(nml)
Major subroutine that checks the inputs of file params.txt.
def write_params(control, params)
Major subroutine that writes the input file params.txt.
def query_params()
Major function that queries the user for all the inputs required to assemble params....