Skip to content

Commit

Permalink
runs in AMIP driver
Browse files Browse the repository at this point in the history
  • Loading branch information
LenkaNovak committed Sep 1, 2023
1 parent 6b0da02 commit 32cfa17
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions experiments/AMIP/modular/coupler_driver_modular.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ if isinteractive()
parsed_args["vert_diff"] = true #hide
parsed_args["rad"] = "gray" #hide
parsed_args["energy_check"] = true #hide
parsed_args["mode_name"] = "slabplanet_semtner" #hide
parsed_args["mode_name"] = "slabplanet_zhang" #hide
parsed_args["t_end"] = "10days" #hide
parsed_args["dt_save_to_sol"] = "3600secs" #hide
parsed_args["dt_cpl"] = 200 #hide
Expand All @@ -89,14 +89,15 @@ if isinteractive()
parsed_args["precip_model"] = "0M" #hide
parsed_args["job_id"] = "interactive_debug_run"
parsed_args["monthly_checkpoint"] = true
parsed_args["FLOAT_TYPE"] = "Float64"
end

## read in some parsed command line arguments
mode_name = parsed_args["mode_name"]
run_name = parsed_args["run_name"]
energy_check = parsed_args["energy_check"]
if !(@isdefined FT)
const FT = parsed_args["FLOAT_TYPE"] == "Float64" ? Float64 : Float32
const FT = parsed_args["FLOAT_TYPE"] == "Float32" ? Float32 : Float64
end
land_sim_name = "bucket"
t_end = Int(time_to_seconds(parsed_args["t_end"]))
Expand Down Expand Up @@ -197,7 +198,7 @@ land_fraction =

## init surface (slab) model components
include("components/slab_utils.jl")
include("components/ocean/semtner_seaice.jl")
include("components/ocean/zhang_seaice.jl")
include("components/land/bucket_init.jl")
include("components/land/bucket_utils.jl")
include("components/ocean/slab_ocean_init.jl")
Expand Down Expand Up @@ -315,7 +316,7 @@ elseif mode_name == "slabplanet"

mode_specifics = (; name = mode_name, SST_info = nothing, SIC_info = nothing)

elseif mode_name == "slabplanet_semtner"
elseif mode_name == "slabplanet_zhang"
## ocean
ocean_sim = ocean_init(
FT;
Expand All @@ -327,9 +328,9 @@ elseif mode_name == "slabplanet_semtner"
thermo_params = thermo_params,
)


## sea ice (here set to zero area coverage)
ice_sim = semtner_ice_init(FT, tspan, ocean_sim.params, dt = Δt_cpl, space = boundary_space, saveat = saveat,)
ml_params = (; h_ml = ocean_sim.params.h, ρc_ml = ocean_sim.params.ρ * ocean_sim.params.c)
ice_sim = zhang_seaice_init(FT, tspan, ml_params, dt = Δt_cpl, space = boundary_space, saveat = saveat)

mode_specifics = (; name = mode_name, SST_info = nothing, SIC_info = nothing)
end
Expand Down Expand Up @@ -399,7 +400,7 @@ diagnostics = (monthly_3d_diags, monthly_2d_diags)
conservation_checks = nothing
if energy_check
@assert(
mode_name == "slabplanet" && !ClimaAtmos.is_distributed(ClimaComms.context(boundary_space)),
mode_name[1:10] == "slabplanet" && !ClimaAtmos.is_distributed(ClimaComms.context(boundary_space)),
"Only non-distributed slabplanet allowable for energy_check"
)
conservation_checks =
Expand Down

0 comments on commit 32cfa17

Please sign in to comment.