Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 21 additions & 27 deletions scripts/time_dependent_d3d/run_time_dependent_d3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,71 +10,59 @@ using ArgParse
function main()
s = ArgParseSettings()
@add_arg_table! s begin
"""
shot
"""
"shot"
help = "Shot number"
arg_type = Int
required = true
"""
--EFIT_TREE
"""
"--EFIT_TREE"
help = "Source of LCFS shape"
arg_type = String
default = "EFIT02"
default = "EFIT01"
"""
--PROFILES_TREE
"""
help = "Source of profile data"
arg_type = String
default = "ZIPFIT01"
"""
--CER_ANALYSIS_TYPE
"""
"--CER_ANALYSIS_TYPE"
help = "CER analysis type, either CERQUICK, CERAUTO, CERFAST"
arg_type = String
default = "CERQUICK"
default = "CERAUTO"
"""
--EFIT_RUN_ID
"""
help = "Run ID for EFIT Tree, only last two digits"
arg_type = String
default = ""
"""
--PROFILES_RUN_ID
"""
"--PROFILES_RUN_ID"
help = "Run ID for OMFIT_PROFS Tree, only last three digits"
arg_type = String
default = ""
"""
--RECONSTRUCTION
"""
"--RECONSTRUCTION"
help = "Run time dependent simulation in reconstruction mode"
arg_type = Bool
default = true
"""
--FIT_PROFILES
"""
"--FIT_PROFILES"
help = "Let FUSE fit the raw data into profiles"
arg_type = Bool
default = true
"""
--USE_LOCAL_CACHE
"""
"--USE_LOCAL_CACHE"
help = "Use local data cache"
arg_type = Bool
default = true
end
args = parse_args(s)

sty = FUSE.study_parameters(:Postdictive)
sty = FUSE.study_parameters(:PredictiveRT)
sty.server = get(ENV, "FUSE_SERVER", "localhost")
sty.n_workers = 0
sty.release_workers_after_run = true
sty.save_folder = get(ENV, "FUSE_RESULT_ARCHIVE", "")
sty.device = :D3D
sty.shots = [args["shot"]]
sty.reconstruction = args["RECONSTRUCTION"]
sty.redirect_output = false
sty.verbose = false

sty.kw_case_parameters=Dict{Symbol,Any}(
:use_local_cache=>args["USE_LOCAL_CACHE"],
Expand All @@ -85,9 +73,15 @@ function main()
:EFIT_run_id=>args["EFIT_RUN_ID"],
:PROFILES_run_id=>args["PROFILES_RUN_ID"])

study = FUSE.StudyPredictiveRT(sty)
FUSE.run(study)
end

try
@everywhere import FUSE
@everywhere ProgressMeter = FUSE.ProgressMeter

study = FUSE.StudyPostdictive(sty)
FUSE.run(study)
main()
finally
# Remove PIDs
Distributed.rmprocs(Distributed.workers())
end