Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
58c9e34
Configure glm_aed_flare_rs for FaaSr: +use_faasr, +vera4cast_* anonym…
Ashish-Ramrakhiani Apr 29, 2026
47ec529
Refactor FCRE helpers: backward-compatible config arg, dispatch via f…
Ashish-Ramrakhiani Apr 29, 2026
4840980
Add run_fcre_aed_forecast: FaaSr-action entry point (preserves combin…
Ashish-Ramrakhiani Apr 29, 2026
198e77f
Fix FCRE callers: pass full path under bare bucket as faasr_prefix/re…
Ashish-Ramrakhiani Apr 29, 2026
1d433bb
Resolve lake_directory via cloned-repo glob; chdir for relative path …
Ashish-Ramrakhiani Apr 30, 2026
962df4b
Match tarball-extracted FCRE path (Owner-Repo-{sha}) for lake_directory
Ashish-Ramrakhiani Apr 30, 2026
c948739
Use marker-based lake_directory discovery; pin test forecast date and…
Ashish-Ramrakhiani May 2, 2026
541cb57
Guard top-level vars in generate_inflow_forecast.R against parent-env…
Ashish-Ramrakhiani May 2, 2026
c55d8a6
source() with local=TRUE to use entry function's env, not stale globa…
Ashish-Ramrakhiani May 2, 2026
ee050b6
RFC 3339 dates for rstac and defensive tryCatch around get_lst/get_vals
Ashish-Ramrakhiani May 2, 2026
22a4921
Revert forecast_start_datetime to operational value (2024-12-20)
Ashish-Ramrakhiani May 2, 2026
5880e14
Shorten forecast_horizon to 1 day for FaaSr deployment testing
Ashish-Ramrakhiani May 2, 2026
dd096af
Add inflation_factor: 1.0 under da_setup for v3.1-dev FLAREr compatib…
Ashish-Ramrakhiani May 2, 2026
3a408d5
Add add_random_noise: 2 under da_setup for v3.1-dev FLAREr compatibility
Ashish-Ramrakhiani May 2, 2026
2f5e9dd
Add depth_sd: 0.0 under model_settings for v3.1-dev FLAREr compatibility
Ashish-Ramrakhiani May 2, 2026
88b67c5
Reduce spinup to 3 days and ensemble to 31 for fast deployment testing
Ashish-Ramrakhiani May 2, 2026
1514ec6
Drive forecast model_id filter from sim_name instead of hardcoded glm…
Ashish-Ramrakhiani May 3, 2026
9d9b575
tryCatch around vera4castHelpers::submit so submit errors don't kill …
Ashish-Ramrakhiani May 3, 2026
f0aa23d
Narrow arrow prefix to specific partition; pass config to update_run_…
Ashish-Ramrakhiani May 3, 2026
59c962c
Synthesize partition columns after collect() so downstream dplyr keys…
Ashish-Ramrakhiani May 3, 2026
ef79553
Deployment-only: clean_start=TRUE in set_up_simulation for repeatable…
Ashish-Ramrakhiani May 3, 2026
d55e77a
Revert clean_start=TRUE override
Ashish-Ramrakhiani May 3, 2026
4d1873f
Pin forecast date to data edge so loop exits cleanly after iter 1
Ashish-Ramrakhiani May 6, 2026
864b1d2
Drop dead duplicate arrow::open_dataset block after tryCatch
Ashish-Ramrakhiani May 7, 2026
fce5f9e
Refresh in-memory config after update_run_config inside loop
Ashish-Ramrakhiani May 7, 2026
78277d6
Extend test spinup to 4 days so chained iterations resolve restart_index
Ashish-Ramrakhiani May 7, 2026
e3dd5b8
Wrap check_noaa_present calls so missing-partition error exits loop c…
Ashish-Ramrakhiani May 7, 2026
1b136f0
Demo: glm_aed_flare_rs_demo_faasr sandbox config for FaaSr-mode run
Ashish-Ramrakhiani May 8, 2026
9f16341
Defensive GLM_PATH default; pass local_path for mode=local reads
Ashish-Ramrakhiani May 15, 2026
0d6f314
Set base_AED_phyto_pars_nml_file for v3.1-dev-netcdf-v2
Ashish-Ramrakhiani May 15, 2026
0647ab1
Add init_restart_from_file/fname placeholders to glm3.nml
Ashish-Ramrakhiani May 15, 2026
cea5946
Add restart_fname placeholder under &output
Ashish-Ramrakhiani May 15, 2026
3e8985c
Resolve GLM_PATH to embedded container binary when available
Ashish-Ramrakhiani May 15, 2026
6f556ca
Point obs_filename at insitu file instead of remote-sensing
Ashish-Ramrakhiani May 15, 2026
01e7ede
Drop secchi row from observations_config_aed.csv
Ashish-Ramrakhiani May 15, 2026
f71af21
Adopt non-vertical config bundle from FLAREr v3.1-dev-netcdf-v2
Ashish-Ramrakhiani May 15, 2026
5df395b
Use run_flare's actual restart filename instead of reconstructing it
Ashish-Ramrakhiani May 15, 2026
b736dea
Save restart at every timestep so subsequent iters can resume
Ashish-Ramrakhiani May 15, 2026
25a9fa4
Carry-forward start_datetime = old_fsd - 3 days for restart compatibi…
Ashish-Ramrakhiani May 15, 2026
de978c1
Tighten inline comments in run_fcre_aed_forecast
Ashish-Ramrakhiani May 21, 2026
04a629a
Bump sim_name for fresh demo run
Ashish-Ramrakhiani May 21, 2026
de9747b
Bump sim_name to v3 for fresh demo iteration
Ashish-Ramrakhiani May 21, 2026
21fa9a5
Bump sim_name to v4 for fresh demo run
Ashish-Ramrakhiani May 22, 2026
da4f0dd
Restore keep_automation.txt to preserve upstream automation-keepalive…
Ashish-Ramrakhiani May 22, 2026
c30b12b
Merge branch 'FLARE-forecast:main' into flare_faasr_int
Ashish-Ramrakhiani May 22, 2026
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
18 changes: 9 additions & 9 deletions R/convert_vera4cast_inflow.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
convert_vera4cast_inflow <- function(reference_date, model_id, save_path){
convert_vera4cast_inflow <- function(reference_date, model_id, save_path, config = NULL){

variables <- c("TP_ugL_sample", "NH4_ugL_sample","NO3NO2_ugL_sample",
"SRP_ugL_sample","DOC_mgL_sample","DRSI_mgL_sample",
Expand All @@ -9,9 +9,14 @@ forecast_df <- NULL

for(i in 1:length(variables)){

s3 <- arrow::s3_bucket(bucket = glue::glue("bio230121-bucket01/vera4cast/forecasts/archive-parquet/project_id=vera4cast/duration=P1D/variable={variables[i]}/model_id={model_id}/reference_date={reference_date}"),
endpoint_override = "https://amnh1.osn.mghpcc.org",
anonymous = TRUE)
if(!is.null(config)){
faasr_prefix <- glue::glue("vera4cast/forecasts/archive-parquet/project_id=vera4cast/duration=P1D/variable={variables[i]}/model_id={model_id}/reference_date={reference_date}")
s3 <- FLAREr::flare_arrow_s3_bucket(server_name = "vera4cast_forecasts", faasr_prefix = faasr_prefix, config = config)
} else {
s3 <- arrow::s3_bucket(bucket = glue::glue("bio230121-bucket01/vera4cast/forecasts/archive-parquet/project_id=vera4cast/duration=P1D/variable={variables[i]}/model_id={model_id}/reference_date={reference_date}"),
endpoint_override = "https://amnh1.osn.mghpcc.org",
anonymous = TRUE)
}

## test to see if inflow forecast exists ##
tryCatch({
Expand All @@ -28,11 +33,6 @@ for(i in 1:length(variables)){

})

# df <- arrow::open_dataset(s3) |>
# dplyr::filter(site_id == "tubr") |>
# dplyr::collect() |>
# dplyr::mutate(variable = variables[i])

forecast_df <- dplyr::bind_rows(forecast_df, df)

}
Expand Down
11 changes: 9 additions & 2 deletions R/generate_forecast_score_arrow.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,17 @@ generate_forecast_score_arrow <- function(targets_df,
bucket = NULL,
endpoint = NULL,
local_directory = NULL,
variable_types = "state"){
variable_types = "state",
config = NULL){


if(use_s3){
if(!is.null(config)){
vars <- arrow_env_vars()
output_directory <- FLAREr::flare_arrow_s3_bucket(server_name = "scores",
faasr_prefix = "flare/scores/parquet",
config = config)
on.exit(unset_arrow_vars(vars))
}else if(use_s3){
if(is.null(bucket) | is.null(endpoint)){
stop("scoring function needs bucket and endpoint if use_s3=TRUE")
}
Expand Down
18 changes: 16 additions & 2 deletions configuration/glm_aed_flare_rs/configure_flare_glm_aed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ s3:
scores:
endpoint: amnh1.osn.mghpcc.org
bucket: bio230121-bucket01/flare/scores/parquet
vera4cast_targets:
endpoint: amnh1.osn.mghpcc.org
bucket: bio230121-bucket01/vera4cast/targets
anonymous: true
vera4cast_forecasts:
endpoint: amnh1.osn.mghpcc.org
bucket: bio230121-bucket01/vera4cast/forecasts/archive-parquet
anonymous: true
location:
site_id: fcre
name: Falling Creek Reservoir
Expand All @@ -28,25 +36,30 @@ location:
da_setup:
da_method: enkf
par_fit_method: perturb
ensemble_size: 221
ensemble_size: 31
localization_distance: .na #distance in meters were covariances in the model error are used
no_negative_states: TRUE
assimilate_first_step: FALSE
use_obs_constraint: TRUE
obs_filename: fcre-targets-rs.csv
inflation_factor: 1.0
add_random_noise: 2
obs_filename: fcre-targets-insitu.csv
model_settings:
ncore: 4
model_name: glm_aed
base_GLM_nml: glm3.nml
base_AED_nml: aed2.nml
base_AED_phyto_pars_nml: aed_phyto_pars.csv
base_AED_phyto_pars_nml_file: aed2.nml
base_AED_zoop_pars_nml: aed2_zoop_pars.nml
max_model_layers: 100
modeled_depths: [0.00,1.00,1.60,2.00,3.00,4.00,5.00,6.00,7.00,8.00,9.00]
par_config_file: parameter_calibration_config_aed.csv
obs_config_file: observations_config_aed.csv
states_config_file: states_config_aed.csv
depth_model_sd_config_file: depth_model_sd_aed.csv
non_vertical_noise_config_file: non_vertical_noise_config.csv
depth_sd: 0.0
default_init:
lake_depth: 9.4 #not a modeled state
temp: [25.667, 24.9101, 23.067, 21.8815, 19.6658, 16.5739, 12.9292, 12.8456, 12.8127, 12.8079, 12.778]
Expand Down Expand Up @@ -87,6 +100,7 @@ output_settings:
diagnostics_names: [extc]
generate_plots: FALSE
evaluate_past: FALSE
restart_save_timesteps: "all"
diagnostics_daily:
names: ['CAR_ch4_atm','CAR_atm_co2_flux', 'temp', 'OXY_oxy', 'temp', 'temp']
save_names: ['ch4_flux_mean', 'co2_flux_mean', 'temp_1.6m_mean', 'oxy_mean', 'temp_1.0m_mean', 'temp_8.0m_mean']
Expand Down
9 changes: 5 additions & 4 deletions configuration/glm_aed_flare_rs/configure_run.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
restart_file: .na
start_datetime: 2024-10-01 00:00:00
start_datetime: 2026-04-30 00:00:00
end_datetime: .na
forecast_start_datetime: 2024-12-20 00:00:00
forecast_horizon: 34
sim_name: glm_aed_flare_rs
forecast_start_datetime: 2026-05-04 00:00:00
forecast_horizon: 1
sim_name: glm_aed_flare_rs_demo_v4
configure_flare: configure_flare_glm_aed.yml
configure_obs: observation_processing.yml
use_s3: TRUE
use_faasr: TRUE
4 changes: 4 additions & 0 deletions configuration/glm_aed_flare_rs/glm3.nml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
out_fn = "output"
nsave = 1
csv_lake_fname = 'lake'
restart_fname = 'glm_restart.nc'
restart_nsave = 1
/
&init_profiles
num_heights = 28
Expand All @@ -73,6 +75,8 @@
avg_surf_temp = 6
restart_variables = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
restart_mixer_count = 0
init_restart_fname = 'glm_restart.nc'
init_restart_from_file = 0
/
&meteorology
met_sw = .true.
Expand Down
4 changes: 4 additions & 0 deletions configuration/glm_aed_flare_rs/non_vertical_noise_config.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
model_variable,model_source,model_depth_m,process_noise_sd
lake_depth,state,NA,0.01
extc,diagnostic,1.0,NA
CAR_ch4_atm,diagnostic_daily,NA,0.0
13 changes: 6 additions & 7 deletions configuration/glm_aed_flare_rs/observations_config_aed.csv
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
state_names_obs,obs_units,obs_sd,target_variable, multi_depth
temp,degC,1,Temp_C_mean,1
OXY_oxy,mmol m-3,15,DO_mgL_mean,1
OGM_doc_total,mmol m-3,18.7,fDOM_QSU_mean,1
PHY_TCHLA,ugL,2,Chla_ugL_mean,1
secchi, unitless,0.25, Secchi_m_sample,0

state_names_obs,obs_units,obs_sd,target_variable,multi_depth,model_source,model_variable,model_depth_m
temp,degC,1,Temp_C_mean,1,NA,NA,NA
OXY_oxy,mmol m-3,15,DO_mgL_mean,1,NA,NA,NA
OGM_doc_total,mmol m-3,18.7,fDOM_QSU_mean,1,NA,NA,NA
PHY_TCHLA,ugL,2,Chla_ugL_mean,1,NA,NA,NA
secchi,unitless,0.25,Secchi_m_sample,0,diagnostic,extc_coeff,1.0
25 changes: 19 additions & 6 deletions workflows/glm_aed_flare_rs/generate_inflow_forecast.R
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
library(tidyverse)

lake_directory <- here::here()
config_set_name <- "glm_aed_flare_v3"
configure_run_file <- "configure_run.yml"
config <- FLAREr::set_up_simulation(configure_run_file,lake_directory, config_set_name = config_set_name)
if (!exists("lake_directory", inherits = FALSE)) lake_directory <- here::here()
if (!exists("config_set_name", inherits = FALSE)) config_set_name <- "glm_aed_flare_v3"
if (!exists("configure_run_file", inherits = FALSE)) configure_run_file <- "configure_run.yml"
if (!exists("config", inherits = FALSE)) {
config <- FLAREr::set_up_simulation(configure_run_file, lake_directory, config_set_name = config_set_name)
}

print('read VERA targets...')

targets_vera <- readr::read_csv("https://amnh1.osn.mghpcc.org/bio230121-bucket01/vera4cast/targets/project_id=vera4cast/duration=P1D/daily-inflow-targets.csv.gz",
show_col_types = FALSE)
if(!is.null(config$s3$vera4cast_targets)){
targets_local <- file.path(tempdir(), "daily-inflow-targets.csv.gz")
FLAREr::flare_get_file(local_file = "daily-inflow-targets.csv.gz",
remote_file = "daily-inflow-targets.csv.gz",
server_name = "vera4cast_targets",
local_folder = tempdir(),
remote_folder = "vera4cast/targets/project_id=vera4cast/duration=P1D",
config = config)
targets_vera <- readr::read_csv(targets_local, show_col_types = FALSE)
} else {
targets_vera <- readr::read_csv("https://amnh1.osn.mghpcc.org/bio230121-bucket01/vera4cast/targets/project_id=vera4cast/duration=P1D/daily-inflow-targets.csv.gz",
show_col_types = FALSE)
}

inflow_hist_dates <- tibble(datetime = seq(min(targets_vera$datetime), max(targets_vera$datetime), by = "1 day"))

Expand Down
Loading