Skip to content

Commit a5367b4

Browse files
committed
Merge pull request #801 from CliMA/ln/moist-hs
Add moist Held-Suarez run script init clean clean params clean params
2 parents 8cd985f + b7cb707 commit a5367b4

35 files changed

+859
-129
lines changed

.buildkite/hierarchies/pipeline.yml

+10-14
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,18 @@ steps:
5050

5151
- label: "Clima: GPU ClimaCoupler dry HS"
5252
command:
53-
- "echo $$JULIA_DEPOT_PATH"
54-
55-
- echo "--- Instantiate AMIP env"
56-
- "julia --project=experiments/ClimaEarth/ -e 'using Pkg; Pkg.instantiate(;verbose=true)'"
57-
- "julia --project=experiments/ClimaEarth/ -e 'using Pkg; Pkg.precompile()'"
58-
- "julia --project=experiments/ClimaEarth/ -e 'using Pkg; Pkg.status()'"
59-
60-
- echo "--- Download artifacts"
61-
- "julia --project=artifacts -e 'using Pkg; Pkg.instantiate(;verbose=true)'"
62-
- "julia --project=artifacts -e 'using Pkg; Pkg.precompile()'"
63-
- "julia --project=artifacts -e 'using Pkg; Pkg.status()'"
64-
- "julia --project=artifacts artifacts/download_artifacts.jl"
65-
66-
- echo "--- Run simulation"
6753
- "julia --color=yes --project=experiments/ClimaEarth/ experiments/ClimaEarth/run_dry_held_suarez.jl"
6854
artifact_paths: "dry_held_suarez/dry_held_suarez/clima_atmos/*"
55+
agents:
56+
queue: clima
57+
slurm_mem: 20GB
58+
slurm_gpus: 1
59+
modules: common
60+
61+
- label: "Clima: GPU ClimaCoupler moist HS"
62+
command:
63+
- "julia --color=yes --project=experiments/ClimaEarth/ experiments/ClimaEarth/run_moist_held_suarez.jl"
64+
artifact_paths: "moist_held_suarez/moist_held_suarez/clima_atmos/*"
6965
agents:
7066
queue: clima
7167
slurm_mem: 20GB

.buildkite/pipeline.yml

+12-3
Original file line numberDiff line numberDiff line change
@@ -378,15 +378,24 @@ steps:
378378

379379
- group: "Hierarchy tests (1d)"
380380
steps:
381-
- label: "Dry Held Suarez"
381+
- label: ":construction: Dry Held Suarez"
382382
key: "dry_held_suarez"
383383
command:
384-
- sed 's/t_end = "1000days"/t_end = "1days"/' experiments/ClimaEarth/run_dry_held_suarez.jl > experiments/ClimaEarth/run_dry_held_suarez_modified.jl
385-
- "julia --color=yes --project=experiments/ClimaEarth/ experiments/ClimaEarth/run_dry_held_suarez_modified.jl"
384+
- sed 's/t_end = "1000days"/t_end = "1days"/' experiments/ClimaEarth/run_dry_held_suarez.jl > experiments/ClimaEarth/run_dry_held_suarez_short.jl
385+
- "julia --color=yes --project=experiments/ClimaEarth/ experiments/ClimaEarth/run_dry_held_suarez_short.jl"
386386
artifact_paths: "dry_held_suarez/dry_held_suarez/clima_atmos/*"
387387
agents:
388388
slurm_mem: 20GB
389389

390+
- label: ":construction: Moist Held Suarez"
391+
key: "moist_held_suarez"
392+
command:
393+
- sed 's/t_end = "1000days"/t_end = "1days"/' experiments/ClimaEarth/run_moist_held_suarez.jl > experiments/ClimaEarth/run_moist_held_suarez_short.jl
394+
- "julia --color=yes --project=experiments/ClimaEarth/ experiments/ClimaEarth/run_moist_held_suarez_short.jl"
395+
artifact_paths: "moist_held_suarez/moist_held_suarez/clima_atmos/*"
396+
agents:
397+
slurm_mem: 20GB
398+
390399
- group: "GPU integration tests"
391400
steps:
392401
# GPU RUNS: slabplanet

config/benchmark_configs/amip_diagedmf.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ monthly_checkpoint: false
1414
run_name: "amip_diagedmf"
1515
start_date: "19790301"
1616
t_end: "12hours"
17-
turb_flux_partition: "CombinedStateFluxes"
17+
turb_flux_partition: "CombinedStateFluxesMOST"
1818
use_coupler_diagnostics: false

config/benchmark_configs/gpu_amip_diagedmf.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ monthly_checkpoint: false
1414
run_name: "gpu_amip_diagedmf"
1515
start_date: "19790301"
1616
t_end: "12hours"
17-
turb_flux_partition: "CombinedStateFluxes"
17+
turb_flux_partition: "CombinedStateFluxesMOST"
1818
use_coupler_diagnostics: false

config/ci_configs/gpu_amip_target_topo_diagedmf_shortrun.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ surface_setup: "PrescribedSurface"
2222
t_end: "200secs"
2323
topo_smoothing: true
2424
topography: "Earth"
25-
turb_flux_partition: "CombinedStateFluxes"
25+
turb_flux_partition: "CombinedStateFluxesMOST"
2626
use_reference_state: false

config/ci_configs/interactive_debug.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ run_name: "interactive_debug_run"
1818
start_date: "19790301"
1919
surface_setup: "PrescribedSurface"
2020
t_end: "20days"
21-
turb_flux_partition: "CombinedStateFluxes"
21+
turb_flux_partition: "CombinedStateFluxesMOST"
2222
vert_diff: "true"

config/longrun_configs/amip_target.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ run_name: "amip_target"
1919
start_date: "19790301"
2020
surface_setup: "PrescribedSurface"
2121
t_end: "100days"
22-
turb_flux_partition: "CombinedStateFluxes"
22+
turb_flux_partition: "CombinedStateFluxesMOST"
2323
vert_diff: "true"

config/longrun_configs/amip_target_topo.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ surface_setup: "PrescribedSurface"
2323
t_end: "100days"
2424
topo_smoothing: true
2525
topography: "Earth"
26-
turb_flux_partition: "CombinedStateFluxes"
26+
turb_flux_partition: "CombinedStateFluxesMOST"
2727
vert_diff: "true"

config/longrun_configs/amip_target_topo_diagedmf.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ t_end: "30days"
2626
topo_smoothing: true
2727
topography: "Earth"
2828
coupler_toml_file: "toml/amip_target_topo_diagedmf.toml"
29-
turb_flux_partition: "CombinedStateFluxes"
29+
turb_flux_partition: "CombinedStateFluxesMOST"
3030
use_reference_state: false

config/longrun_configs/dyamond_target.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ monthly_checkpoint: false
1212
run_name: "dyamond_target"
1313
start_date: "19790301"
1414
t_end: "1days"
15-
turb_flux_partition: "CombinedStateFluxes"
15+
turb_flux_partition: "CombinedStateFluxesMOST"

config/longrun_configs/gpu_amip_target_topo.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ surface_setup: "PrescribedSurface"
2323
t_end: "100days"
2424
topo_smoothing: true
2525
topography: "Earth"
26-
turb_flux_partition: "CombinedStateFluxes"
26+
turb_flux_partition: "CombinedStateFluxesMOST"
2727
vert_diff: "true"
2828
use_reference_state: false

config/longrun_configs/gpu_amip_target_topo_diagedmf.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ t_end: "300days"
2626
topo_smoothing: true
2727
topography: "Earth"
2828
coupler_toml_file: "toml/amip_target_topo_diagedmf.toml"
29-
turb_flux_partition: "CombinedStateFluxes"
29+
turb_flux_partition: "CombinedStateFluxesMOST"
3030
use_reference_state: false

config/longrun_configs/gpu_longrun_amip_dyamond.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ monthly_checkpoint: false
1212
run_name: "gpu_longrun_amip_dyamond"
1313
start_date: "19790301"
1414
t_end: "1days"
15-
turb_flux_partition: "CombinedStateFluxes"
15+
turb_flux_partition: "CombinedStateFluxesMOST"

config/longrun_configs/slabplanet_aqua_atmos_sf_couple.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ run_name: "slabplanet_aqua_atmos_sf_couple"
1818
start_date: "19790301"
1919
surface_setup: "DefaultMoninObukhov"
2020
t_end: "20days"
21-
turb_flux_partition: "CombinedStateFluxes"
21+
turb_flux_partition: "CombinedStateFluxesMOST"
2222
vert_diff: "true"

config/longrun_configs/slabplanet_aqua_atmos_sf_nocouple.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ run_name: "slabplanet_aqua_atmos_sf_nocouple"
1818
start_date: "19790301"
1919
surface_setup: "DefaultMoninObukhov"
2020
t_end: "20days"
21-
turb_flux_partition: "CombinedStateFluxes"
21+
turb_flux_partition: "CombinedStateFluxesMOST"
2222
vert_diff: "true"

config/longrun_configs/slabplanet_aqua_coupler_sf.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ run_name: "slabplanet_aqua_coupler_sf"
1818
start_date: "19790301"
1919
surface_setup: "PrescribedSurface"
2020
t_end: "20days"
21-
turb_flux_partition: "CombinedStateFluxes"
21+
turb_flux_partition: "CombinedStateFluxesMOST"
2222
vert_diff: "true"

config/longrun_configs/slabplanet_aqua_coupler_sf_evolve_ocn.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ run_name: "slabplanet_aqua_coupler_sf_evolve_ocn"
1717
start_date: "19790301"
1818
surface_setup: "PrescribedSurface"
1919
t_end: "20days"
20-
turb_flux_partition: "CombinedStateFluxes"
20+
turb_flux_partition: "CombinedStateFluxesMOST"
2121
vert_diff: "true"

config/longrun_configs/slabplanet_aqua_target.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ run_name: "slabplanet_aqua_target"
1818
start_date: "19790301"
1919
surface_setup: "PrescribedSurface"
2020
t_end: "100days"
21-
turb_flux_partition: "CombinedStateFluxes"
21+
turb_flux_partition: "CombinedStateFluxesMOST"
2222
vert_diff: "true"

config/longrun_configs/slabplanet_aqua_target_evolve_ocn.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ run_name: "slabplanet_aqua_target_evolve_ocn"
1818
start_date: "19790301"
1919
surface_setup: "PrescribedSurface"
2020
t_end: "100days"
21-
turb_flux_partition: "CombinedStateFluxes"
21+
turb_flux_partition: "CombinedStateFluxesMOST"
2222
vert_diff: "true"

config/longrun_configs/slabplanet_aqua_target_nocouple.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ run_name: "slabplanet_aqua_target_nocouple"
1818
start_date: "19790301"
1919
surface_setup: "DefaultMoninObukhov"
2020
t_end: "100days"
21-
turb_flux_partition: "CombinedStateFluxes"
21+
turb_flux_partition: "CombinedStateFluxesMOST"
2222
vert_diff: "true"

config/longrun_configs/slabplanet_coupler_sf_evolve_ocn.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ run_name: "slabplanet_coupler_sf_evolve_ocn"
1717
start_date: "19790301"
1818
surface_setup: "PrescribedSurface"
1919
t_end: "20days"
20-
turb_flux_partition: "CombinedStateFluxes"
20+
turb_flux_partition: "CombinedStateFluxesMOST"
2121
vert_diff: "true"

config/longrun_configs/slabplanet_target.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ run_name: "slabplanet_target"
1818
start_date: "19790301"
1919
surface_setup: "PrescribedSurface"
2020
t_end: "100days"
21-
turb_flux_partition: "CombinedStateFluxes"
21+
turb_flux_partition: "CombinedStateFluxesMOST"
2222
vert_diff: "true"

config/longrun_configs/slabplanet_target_evolve_ocn.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ run_name: "slabplanet_target_evolve_ocn"
1818
start_date: "19790301"
1919
surface_setup: "PrescribedSurface"
2020
t_end: "100days"
21-
turb_flux_partition: "CombinedStateFluxes"
21+
turb_flux_partition: "CombinedStateFluxesMOST"
2222
vert_diff: "true"

config/longrun_configs/slabplanet_terra.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ run_name: "slabplanet_terra"
1717
start_date: "19790301"
1818
surface_setup: "PrescribedSurface"
1919
t_end: "20days"
20-
turb_flux_partition: "CombinedStateFluxes"
20+
turb_flux_partition: "CombinedStateFluxesMOST"
2121
vert_diff: "true"

docs/src/fluxcalculator.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This modules contains abstract types and functions to calculate surface fluxes in the coupler, or to call flux calculating functions from the component models.
44

55
Fluxes over a heterogeneous surface (e.g., from a gridpoint where atmospheric cell is overlying both land and ocean) can be handled in two different ways:
6-
1. **Combined fluxes** (called with `CombinedStateFluxes()`)
6+
1. **Combined fluxes** (called with `CombinedStateFluxesMOST()`)
77
- these are calculated by averaging the surface properties for each gridpoint (e.g., land and ocean temperatures, albedos and roughness lengths are averaged, based on their respective area fractions), so the flux is calculated only once per gridpoint of the grid where we calculate fluxes. This is computationally faster, but it makes the fluxes on surface boundaries more diffuse. Currently, we use this method for calculating radiative fluxes in the atmosphere, and turbulent fluxes in the coupler (on the atmospheric grid). The fluxes are calculated in the atmospheric (host) model's cache, which can be setup to avoid allocating coupler fields.
88
2. **Partitioned fluxes** (called with `PartitionedStateFluxes()`)
99
- these are calculated separately for each surface type. It is then the fluxes (rather than the surface states) that are combined and passed to the atmospheric model as a boundary condition. This method ensures that each surface model receives fluxes that correspond to its state properties, resulting in a more accurate model evolution. However, it is more computationally expensive, and requires more communication between the component models.
@@ -13,9 +13,10 @@ Fluxes over a heterogeneous surface (e.g., from a gridpoint where atmospheric ce
1313
```@docs
1414
ClimaCoupler.FluxCalculator.TurbulentFluxPartition
1515
ClimaCoupler.FluxCalculator.PartitionedStateFluxes
16-
ClimaCoupler.FluxCalculator.CombinedStateFluxes
16+
ClimaCoupler.FluxCalculator.CombinedStateFluxesMOST
1717
ClimaCoupler.FluxCalculator.combined_turbulent_fluxes!
18-
ClimaCoupler.FluxCalculator.atmos_turbulent_fluxes!
18+
ClimaCoupler.FluxCalculator.atmos_turbulent_fluxes_bulk!
19+
ClimaCoupler.FluxCalculator.atmos_turbulent_fluxes_most!
1920
ClimaCoupler.FluxCalculator.surface_inputs
2021
ClimaCoupler.FluxCalculator.calculate_surface_air_density
2122
ClimaCoupler.FluxCalculator.get_surface_params

experiments/ClimaEarth/cli_options.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ function argparse_settings()
3535
arg_type = Bool
3636
default = false
3737
"--turb_flux_partition"
38-
help = "Method to partition turbulent fluxes. [`PartitionedStateFluxes`, `CombinedStateFluxes`]"
38+
help = "Method to partition turbulent fluxes. [`PartitionedStateFluxes`, `CombinedStateFluxesMOST`]"
3939
arg_type = String
40-
default = "CombinedStateFluxes"
40+
default = "CombinedStateFluxesMOST"
4141
"--hourly_checkpoint"
4242
help = "Boolean flag indicating whether to checkpoint at intervals of 1 hour or multiple hours"
4343
arg_type = Bool

experiments/ClimaEarth/components/atmosphere/climaatmos.jl

+12-6
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ function hasmoisture(integrator)
2929
return !(integrator.p.atmos.moisture_model isa CA.DryModel)
3030
end
3131

32-
function atmos_init(::Type{FT}, atmos_config) where {FT}
32+
function atmos_init(atmos_config)
3333
# By passing `parsed_args` to `AtmosConfig`, `parsed_args` overwrites the default atmos config
34+
FT = atmos_config.parsed_args["FLOAT_TYPE"] == "Float64" ? Float64 : Float32
3435
simulation = CA.get_simulation(atmos_config)
3536
(; integrator) = simulation
3637
Y = integrator.u
@@ -297,7 +298,7 @@ FluxCalculator.get_surface_params(sim::ClimaAtmosSimulation) = CAP.surface_fluxe
297298
get_atmos_config_dict(coupler_dict::Dict)
298299
299300
Returns the specified atmospheric configuration (`atmos_config`) overwitten by arguments
300-
in the coupler dictionary (`config_dict`). The returned dictionary will then be passed to CA.AtmosConfig().
301+
in the coupler dictionary (`config_dict`). The returned `atmos_config` dictionary will then be passed to CA.AtmosConfig().
301302
The `atmos_config_repo` flag allows us to
302303
use a configuration specified within the ClimaCoupler repo, which is useful for direct
303304
coupled/atmos-only comparisons.
@@ -350,14 +351,18 @@ function get_atmos_config_dict(coupler_dict)
350351
joinpath(coupler_dict["mode_name"], coupler_dict["run_name"]),
351352
"clima_atmos",
352353
)
354+
355+
# merge configs
356+
# (if there are common keys, the last dictionary in the `merge` arguments takes precedence)
353357
atmos_config = merge(atmos_config, Dict("output_dir" => atmos_output_dir))
358+
coupler_config = merge(atmos_config, config_dict)
354359

355360
# set restart file to the initial file saved in this location if it is not nothing
356361
# TODO this is hardcoded and should be fixed once we have a better restart system
357362
if !isnothing(atmos_config["restart_file"])
358363
atmos_config["restart_file"] = replace(atmos_config["restart_file"], "active" => "0000")
359364
end
360-
return atmos_config
365+
return atmos_config, coupler_config
361366
end
362367

363368

@@ -416,9 +421,10 @@ function get_new_cache(atmos_sim::ClimaAtmosSimulation, csf)
416421
end
417422

418423
"""
419-
FluxCalculator.atmos_turbulent_fluxes!(atmos_sim::ClimaAtmosSimulation, csf)
424+
FluxCalculator.atmos_turbulent_fluxes_most!(atmos_sim::ClimaAtmosSimulation, csf)
420425
421-
Computes turbulent surface fluxes using ClimaAtmos's `update_surface_conditions!`. This
426+
Computes turbulent surface fluxes using ClimaAtmos's `update_surface_conditions!` and
427+
and the Monin Obukhov Similarity Theory. This
422428
requires that we define a new temporary parameter Tuple, `new_p`, and save the new surface state
423429
in it. We do not want `new_p` to live in the atmospheric model permanently, because that would also
424430
trigger flux calculation during Atmos `Interfacer.step!`. We only want to trigger this once per coupling
@@ -430,7 +436,7 @@ For debigging atmos, we can set the following atmos defaults:
430436
csf.beta .= 1
431437
csf = merge(csf, (;q_sfc = nothing))
432438
"""
433-
function FluxCalculator.atmos_turbulent_fluxes!(atmos_sim::ClimaAtmosSimulation, csf)
439+
function FluxCalculator.atmos_turbulent_fluxes_most!(atmos_sim::ClimaAtmosSimulation, csf)
434440

435441
if isnothing(atmos_sim.integrator.p.sfc_setup) # trigger flux calculation if not done in Atmos internally
436442
new_p = get_new_cache(atmos_sim, csf)

experiments/ClimaEarth/run_amip.jl

+11-15
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,13 @@ if isinteractive()
9999
parsed_args["config_file"]
100100
end
101101

102-
## read in config dictionary from file, overriding the coupler defaults
102+
## read in config dictionary from file, overriding the coupler defaults in `parsed_args`
103103
config_dict = YAML.load_file(parsed_args["config_file"])
104104
config_dict = merge(parsed_args, config_dict)
105105

106106
## get component model dictionaries (if applicable)
107-
config_dict_atmos = get_atmos_config_dict(config_dict)
108-
atmos_config_object = CA.AtmosConfig(config_dict_atmos)
109-
110-
## merge dictionaries of command line arguments, coupler dictionary and component model dictionaries
111-
## (if there are common keys, the last dictionary in the `merge` arguments takes precedence)
112-
config_dict = merge(config_dict_atmos, config_dict)
107+
atmos_config_dict, config_dict = get_atmos_config_dict(config_dict)
108+
atmos_config_object = CA.AtmosConfig(atmos_config_dict)
113109

114110
## read in some parsed command line arguments, required by this script
115111
mode_name = config_dict["mode_name"]
@@ -177,13 +173,13 @@ returns a `ComponentModelSimulation` object (see `Interfacer` docs for more deta
177173

178174
#=
179175
### Atmosphere
180-
This uses the `ClimaAtmos.jl` model, with parameterization options specified in the `config_dict_atmos` dictionary.
176+
This uses the `ClimaAtmos.jl` model, with parameterization options specified in the `atmos_config_object` dictionary.
181177
=#
182178

183179
Utilities.show_memory_usage(comms_ctx)
184180

185181
## init atmos model component
186-
atmos_sim = atmos_init(FT, atmos_config_object);
182+
atmos_sim = atmos_init(atmos_config_object);
187183
Utilities.show_memory_usage(comms_ctx)
188184

189185
thermo_params = get_thermo_params(atmos_sim) # TODO: this should be shared by all models #610
@@ -573,10 +569,10 @@ Decide on the type of turbulent flux partition (see `FluxCalculator` documentati
573569
turbulent_fluxes = nothing
574570
if config_dict["turb_flux_partition"] == "PartitionedStateFluxes"
575571
turbulent_fluxes = FluxCalculator.PartitionedStateFluxes()
576-
elseif config_dict["turb_flux_partition"] == "CombinedStateFluxes"
577-
turbulent_fluxes = FluxCalculator.CombinedStateFluxes()
572+
elseif config_dict["turb_flux_partition"] == "CombinedStateFluxesMOST"
573+
turbulent_fluxes = FluxCalculator.CombinedStateFluxesMOST()
578574
else
579-
error("turb_flux_partition must be either PartitionedStateFluxes or CombinedStateFluxes")
575+
error("turb_flux_partition must be either PartitionedStateFluxes or CombinedStateFluxesMOST")
580576
end
581577

582578
#=
@@ -648,7 +644,7 @@ Interfacer.step!(ice_sim, Δt_cpl)
648644

649645
# 4.turbulent fluxes: now we have all information needed for calculating the initial turbulent surface fluxes using the combined state
650646
# or the partitioned state method
651-
if cs.turbulent_fluxes isa FluxCalculator.CombinedStateFluxes
647+
if cs.turbulent_fluxes isa FluxCalculator.CombinedStateFluxesMOST
652648
## import the new surface properties into the coupler (note the atmos state was also imported in step 3.)
653649
FieldExchanger.import_combined_surface_fields!(cs.fields, cs.model_sims, cs.turbulent_fluxes) # i.e. T_sfc, albedo, z0, beta, q_sfc
654650
## calculate turbulent fluxes inside the atmos cache based on the combined surface state in each grid box
@@ -674,7 +670,7 @@ end
674670
FieldExchanger.reinit_model_sims!(cs.model_sims)
675671

676672
# 6.update all fluxes: coupler re-imports updated atmos fluxes (radiative fluxes for both `turbulent_fluxes` types
677-
# and also turbulent fluxes if `turbulent_fluxes isa CombinedStateFluxes`,
673+
# and also turbulent fluxes if `turbulent_fluxes isa CombinedStateFluxesMOST`,
678674
# and sends them to the surface component models. If `turbulent_fluxes isa PartitionedStateFluxes`
679675
# atmos receives the turbulent fluxes from the coupler.
680676
FieldExchanger.import_atmos_fields!(cs.fields, cs.model_sims, cs.boundary_space, cs.turbulent_fluxes)
@@ -753,7 +749,7 @@ function solve_coupler!(cs)
753749

754750
## exchange combined fields and (if specified) calculate fluxes using combined states
755751
FieldExchanger.import_combined_surface_fields!(cs.fields, cs.model_sims, cs.turbulent_fluxes) # i.e. T_sfc, surface_albedo, z0, beta
756-
if cs.turbulent_fluxes isa FluxCalculator.CombinedStateFluxes
752+
if cs.turbulent_fluxes isa FluxCalculator.CombinedStateFluxesMOST
757753
FluxCalculator.combined_turbulent_fluxes!(cs.model_sims, cs.fields, cs.turbulent_fluxes) # this updates the surface thermo state, sfc_ts, in ClimaAtmos (but also unnecessarily calculates fluxes)
758754
elseif cs.turbulent_fluxes isa FluxCalculator.PartitionedStateFluxes
759755
## calculate turbulent fluxes in surfaces and save the weighted average in coupler fields

0 commit comments

Comments
 (0)