diff --git a/src/downloads/cdsapi.jl b/src/downloads/cdsapi.jl index 396996b2..a94542c7 100644 --- a/src/downloads/cdsapi.jl +++ b/src/downloads/cdsapi.jl @@ -33,7 +33,7 @@ function retrieve( resp_dict = JSON.parse(String(response.body)) data = Dict("state" => "queued") - @info "$(now()) - CDSAPI - Request is queued" + @info "$(now()) - CDSAPI - Request is queued"; flush(stderr) sleep_seconds = 1. while data["state"] == "queued" data = parserequest(ckeys,resp_dict,apikey) @@ -41,7 +41,7 @@ function retrieve( sleep(sleep_seconds) end - @info "$(now()) - CDSAPI - Request is running" + @info "$(now()) - CDSAPI - Request is running"; flush(stderr) sleep_seconds = 1. while data["state"] == "running" data = parserequest(ckeys,resp_dict,apikey) @@ -51,7 +51,7 @@ function retrieve( if data["state"] == "completed" - @info "$(now()) - CDSAPI - Request is completed" + @info "$(now()) - CDSAPI - Request is completed"; flush(stderr) sleep(10) @@ -59,6 +59,7 @@ function retrieve( URL: $(data["location"]) Destination: $(fnc) """ + flush(stderr) tries = 0 while isinteger(tries) && (tries < 10) @@ -72,6 +73,7 @@ function retrieve( tries += 1 @info "$(now()) - CDSAPI - Failed to download on Attempt $(tries) of 10" end + flush(stderr) end if tries == 10 @@ -84,6 +86,8 @@ function retrieve( end + flush(stderr) + return end diff --git a/src/downloads/downloads.jl b/src/downloads/downloads.jl index 94634b4c..97cb7d3d 100644 --- a/src/downloads/downloads.jl +++ b/src/downloads/downloads.jl @@ -148,6 +148,8 @@ function downloadcheckevar( @info "$(modulelog()) - The ERA5Variable ID \"$(evar.ID)\" is a valid ERA5 Variable identifier and therefore can be used to download data from the Climate Data Store" + flush(stderr) + else error("$(modulelog()) - The ERA5Variable ID \"$(evar.ID)\" is a custom ERA5 Variable identifier and therefore cannot be used to download data from the Climate Data Store, and can only be calculated/analyzed from preexisting valid ERA5 data") @@ -187,6 +189,8 @@ function downloadcheckplvl( pvec = [] end + flush(stderr) + return pvec end \ No newline at end of file