Added and option to include an output folder name. The date and time of

creation is still appended to the folder name provided.
This commit is contained in:
Jorge Gonzalez 2021-01-20 16:36:01 +01:00
commit 2a6628d529
9 changed files with 33 additions and 11 deletions

Binary file not shown.

View file

@ -309,6 +309,10 @@ make
\begin{itemize}
\item \textbf{path}: Character.
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.
Determines the number of iterations between writing output files for macroscopic quantities.
\item \textbf{cpuTime}: Logical.

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -347,6 +347,7 @@ MODULE moduleInput
TYPE(json_file), INTENT(inout):: config
LOGICAL:: found
CHARACTER(:), ALLOCATABLE:: object
CHARACTER(:), ALLOCATABLE:: baseName
CHARACTER(8) :: date_now=''
CHARACTER(10) :: time_now=''
@ -359,11 +360,22 @@ MODULE moduleInput
END IF
!Creates output folder
!TODO: Add option for custon name output_folder
!Gets actual date and time
CALL DATE_AND_TIME(date_now, time_now)
folder = date_now(1:4) // '-' // date_now(5:6) // '-' // date_now(7:8) // '_' &
!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 config%get(object // '.cpuTime', timeOutput, found)