Climatemachine.jl: Using simulation time as intervals for diagnositics

Created on 27 Apr 2020  ·  5Comments  ·  Source: CliMA/ClimateMachine.jl

Description

The simulation failed when using simulation time (e.g., 1shours) as intervals for diagnostics.

Steps to reproduce

mpirun julia --project=$CLIMA_HOME $EXP_FILE --diagnostics 1shours --vtk 1shours --output-dir=$OUTPUT_DIR

The simulation failed during initialization.

Expected behavior

The command should produce diagnostics every hour. It seems that here endswith(interval, "hours") = True when using 1shours, which results in an invalid "1s".

Environment and error messages

ERROR: LoadError: ArgumentError: invalid base 10 digit 's' in "1s"
Stacktrace:
 [1] tryparse_internal(::Type{Int64}, ::String, ::Int64, ::Int64, ::Int64, ::Bool) at ./parse.jl:132
 [2] #parse#347(::Nothing, ::typeof(parse), ::Type{Int64}, ::String) at ./parse.jl:238
 [3] parse at ./parse.jl:238 [inlined]
 [4] CB_constructor(::String, ::CLIMA.SolverConfiguration{Float32}, ::String) at /gcp/share1/home/zhaoyi/CLIMA/src/Utilities/Callbacks/Callbacks.jl:359
 [5] diagnostics(::String, ::CLIMA.SolverConfiguration{Float32}, ::String, ::CLIMA.DiagnosticsConfiguration) at /gcp/share1/home/zhaoyi/CLIMA/src/Utilities/Callbacks/Callbacks.jl:91
 [6] #invoke!#26(::CLIMA.DiagnosticsConfiguration, ::Tuple{CLIMA.GenericCallbacks.EveryXSimulationSteps}, ::Bool, ::Bool, ::Function, ::typeof(CLIMA.invoke!), ::CLIMA.SolverConfiguration{Float32}) at /gcp/share1/home/zhaoyi/CLIMA/src/Driver/Driver.jl:325
 [7] #invoke! at ./none:0 [inlined]
 [8] main() at /gcp/share1/home/zhaoyi/CLIMA/experiments/AtmosLES/bomex.jl:514
 [9] top-level scope at /gcp/share1/home/zhaoyi/CLIMA/experiments/AtmosLES/bomex.jl:524
 [10] include at ./boot.jl:328 [inlined]
 [11] include_relative(::Module, ::String) at ./loading.jl:1105
 [12] include(::Module, ::String) at ./Base.jl:31
 [13] exec_options(::Base.JLOptions) at ./client.jl:287
 [14] _start() at ./client.jl:460
in expression starting at /gcp/share1/home/zhaoyi/CLIMA/experiments/AtmosLES/bomex.jl:524

For CLIMA developers

  • [x] The bug can be reproduced
  • [x] Labels have been added and developers assigned
  • [x] The bug can be fixed (if not, please explain why not in a comment below)
  • [ ] There is a timeline to fix the bug
  • [ ] The bug has been fixed (Please link the PR)
bug

All 5 comments

🤦‍♂️

Actually, @kpamnany when you fix it, could you add ssecs for simulated seconds or smins for simulated minutes as well (either will work)? It would be helpful to be able to set 60ssecs or 1smins instead of 0.0166667shours :)

hi @kpamnany when we set the interval in terms of simulated time as @szy21 mentioned above, are data being interpolated in time to the requested value or are they written at the closest time level to the requested one?

The closest time level Simone. The mechanism simply checks the current simulation time and if it has passed the last diagnostics snapshot time + the interval specified, it runs on the current state.

The closest time level Simone. The mechanism simply checks the current simulation time and if it has passed the last diagnostics snapshot time + the interval specified, it runs on the current state.

Great, thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

charleskawczynski picture charleskawczynski  ·  5Comments

mwarusz picture mwarusz  ·  6Comments

kmdeck picture kmdeck  ·  8Comments

kpamnany picture kpamnany  ·  7Comments

bischtob picture bischtob  ·  4Comments