Merge branch 'feature/output' into 'development'

Folder name

See merge request JorgeGonz/fpakc!4
This commit is contained in:
Jorge Gonzalez 2021-01-20 15:38:10 +00:00
commit c378f8c3a2
9 changed files with 33 additions and 11 deletions

Binary file not shown.

View file

@ -284,7 +284,7 @@ make
in a command line from the root \acrshort{fpakc} folder. in a command line from the root \acrshort{fpakc} folder.
Substitute \lstinline|path/to/input-file.json| with the path to the input file of the case you want to run. Substitute \lstinline|path/to/input-file.json| with the path to the input file of the case you want to run.
The examples in the run directory are presented in Chapter \ref{ch:exampleRuns}. The examples in the run directory are presented in Chapter \ref{ch:exampleRuns}.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Input File}\label{ch:input_file} \chapter{Input File}\label{ch:input_file}
The input files for \Gls{fpakc} is divided between to files: a mesh file and a case file. The input files for \Gls{fpakc} is divided between to files: a mesh file and a case file.
@ -309,6 +309,10 @@ make
\begin{itemize} \begin{itemize}
\item \textbf{path}: Character. \item \textbf{path}: Character.
Path for the output files. This path is also used to locate the mesh input file. Path for the output files. This path is also used to locate the mesh input file.
\item \textbf{folder}: Character.
Base name of the folder in wich output files are placed.
The date and time is appended to this name.
If none is provided, only the date and time is writted as the folder name.
\item \textbf{triggerOutput}: Integer. \item \textbf{triggerOutput}: Integer.
Determines the number of iterations between writing output files for macroscopic quantities. Determines the number of iterations between writing output files for macroscopic quantities.
\item \textbf{cpuTime}: Logical. \item \textbf{cpuTime}: Logical.

View file

@ -5,7 +5,8 @@
"triggerOutput": 100, "triggerOutput": 100,
"cpuTime": false, "cpuTime": false,
"numColl": false, "numColl": false,
"EMField": true "EMField": true,
"folder": "Cartesian"
}, },
"reference": { "reference": {
"density": 1.0e16, "density": 1.0e16,

View file

@ -5,7 +5,8 @@
"triggerOutput": 100, "triggerOutput": 100,
"cpuTime": false, "cpuTime": false,
"numColl": false, "numColl": false,
"EMField": true "EMField": true,
"folder": "Radial"
}, },
"reference": { "reference": {
"density": 1.0e16, "density": 1.0e16,

View file

@ -5,7 +5,8 @@
"triggerCPUTime": 1, "triggerCPUTime": 1,
"cpuTime": true, "cpuTime": true,
"numColl": false, "numColl": false,
"EMField": true "EMField": true,
"folder": "Diff_tau"
}, },
"geometry": { "geometry": {
"type": "2DCyl", "type": "2DCyl",

View file

@ -5,7 +5,8 @@
"triggerCPUTime": 1, "triggerCPUTime": 1,
"cpuTime": true, "cpuTime": true,
"numColl": false, "numColl": false,
"EMField": true "EMField": true,
"folder": "Same_tau"
}, },
"geometry": { "geometry": {
"type": "2DCyl", "type": "2DCyl",

View file

@ -3,7 +3,8 @@
"path": "./runs/Argon_Expansion/", "path": "./runs/Argon_Expansion/",
"triggerOutput": 10, "triggerOutput": 10,
"cpuTime": false, "cpuTime": false,
"numColl": true "numColl": true,
"folder": "CX_case"
}, },
"geometry": { "geometry": {
"type": "2DCyl", "type": "2DCyl",

View file

@ -3,7 +3,8 @@
"path": "./runs/Argon_Expansion/", "path": "./runs/Argon_Expansion/",
"triggerOutput": 10, "triggerOutput": 10,
"cpuTime": false, "cpuTime": false,
"numColl": false "numColl": false,
"folder": "base_case"
}, },
"geometry": { "geometry": {
"type": "2DCyl", "type": "2DCyl",

View file

@ -347,6 +347,7 @@ MODULE moduleInput
TYPE(json_file), INTENT(inout):: config TYPE(json_file), INTENT(inout):: config
LOGICAL:: found LOGICAL:: found
CHARACTER(:), ALLOCATABLE:: object CHARACTER(:), ALLOCATABLE:: object
CHARACTER(:), ALLOCATABLE:: baseName
CHARACTER(8) :: date_now='' CHARACTER(8) :: date_now=''
CHARACTER(10) :: time_now='' CHARACTER(10) :: time_now=''
@ -359,11 +360,22 @@ MODULE moduleInput
END IF END IF
!Creates output folder !Gets actual date and time
!TODO: Add option for custon name output_folder
CALL DATE_AND_TIME(date_now, time_now) CALL DATE_AND_TIME(date_now, time_now)
folder = date_now(1:4) // '-' // date_now(5:6) // '-' // date_now(7:8) // '_' &
// time_now(1:2) // '.' // time_now(3:4) // '.' // time_now(5:6) !Gets the basename of the folder
CALL config%get(object // '.folder', baseName, found)
PRINT *, baseName
IF (found) THEN
folder = baseName
END IF
!Compose the folder name
folder = folder // '_' // date_now(1:4) // '-' // date_now(5:6) // '-' // date_now(7:8) // '_' &
// time_now(1:2) // '.' // time_now(3:4) // '.' // time_now(5:6)
!Creates the folder
CALL EXECUTE_COMMAND_LINE('mkdir ' // path // folder ) CALL EXECUTE_COMMAND_LINE('mkdir ' // path // folder )
CALL config%get(object // '.cpuTime', timeOutput, found) CALL config%get(object // '.cpuTime', timeOutput, found)