-
Notifications
You must be signed in to change notification settings - Fork 21
Adding an ECCO prescribed atmosphere #505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
simone-silvestri
wants to merge
30
commits into
main
Choose a base branch
from
ss/atmosphere-ecco
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 13 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
173b2ca
done?
simone-silvestri 75f38a6
removed unused stuff
simone-silvestri 1acf4c8
small bug
simone-silvestri 8e39262
remove celsius
simone-silvestri 2acc086
enforce data conventions
simone-silvestri 2fa2379
Merge branch 'main' into ss/atmosphere-ecco
simone-silvestri 2932ee1
Merge remote-tracking branch 'origin/main' into ss/atmosphere-ecco
simone-silvestri bf3d37d
bugfix
simone-silvestri 98ea366
bugfix
simone-silvestri a9e55a9
add the reversed sign
simone-silvestri 1e1b198
remove previous type
simone-silvestri af13a54
fix
simone-silvestri cd22337
bring back ECCO2
simone-silvestri e040f42
bugfix
simone-silvestri cfb4012
Merge branch 'main' into ss/atmosphere-ecco
navidcy 004917b
Merge branch 'main' into ss/atmosphere-ecco
simone-silvestri 4043c25
add this
simone-silvestri 2dd13d6
do not reverse sign
simone-silvestri 8ea4174
remove maybe reverse sign
simone-silvestri 078694e
ok no I actually needed it
simone-silvestri 9c923ee
no need to invert signs once again
simone-silvestri 58a11bd
Merge branch 'main' into ss/atmosphere-ecco
simone-silvestri d0bdae0
Merge branch 'main' into ss/atmosphere-ecco
simone-silvestri da37b56
Merge branch 'main' into ss/atmosphere-ecco
simone-silvestri 76123d0
Merge branch 'main' into ss/atmosphere-ecco
simone-silvestri ec2c8a0
Merge branch 'main' into ss/atmosphere-ecco
simone-silvestri 3919d09
Merge branch 'main' into ss/atmosphere-ecco
simone-silvestri 5a30ad2
Merge branch 'main' into ss/atmosphere-ecco
simone-silvestri 8fa397c
Merge branch 'main' into ss/atmosphere-ecco
simone-silvestri dd3ccf8
Merge branch 'main' into ss/atmosphere-ecco
simone-silvestri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| using ClimaOcean.DataWrangling: DatasetBackend | ||
| using Oceananigans.OutputReaders | ||
| using ClimaOcean.OceanSeaIceModels: TwoBandDownwellingRadiation | ||
|
|
||
| """ | ||
| ECCOPrescribedAtmosphere([architecture = CPU(), FT = Float32]; | ||
| dataset = ECCO4Montly(), | ||
| start_date = first_date(dataset, :temperature), | ||
| end_date = last_date(dataset, :temperature), | ||
| backend = DatasetBackend(10), | ||
| time_indexing = Cyclical(), | ||
| surface_layer_height = 10, # meters | ||
| include_rivers_and_icebergs = false, | ||
| other_kw...) | ||
|
|
||
| Return a [`PrescribedAtmosphere`](@ref) representing JRA55 reanalysis data. | ||
| The atmospheric data will be held in `JRA55FieldTimeSeries` objects containing. | ||
| For a detailed description of the keyword arguments, see the [`JRA55FieldTimeSeries`](@ref) constructor. | ||
| """ | ||
| function ECCOPrescribedAtmosphere(architecture = CPU(), FT = Float32; | ||
| dataset = ECCO4Monthly(), | ||
| start_date = first_date(dataset, :air_temperature), | ||
| end_date = last_date(dataset, :air_temperature), | ||
| time_indexing = Cyclical(), | ||
| time_indices_in_memory = 10, | ||
| surface_layer_height = 2, # meters | ||
| other_kw...) | ||
|
|
||
| ua_meta = Metadata(:eastward_wind; dataset, start_date, end_date) | ||
| va_meta = Metadata(:northward_wind; dataset, start_date, end_date) | ||
| Ta_meta = Metadata(:air_temperature; dataset, start_date, end_date) | ||
| qa_meta = Metadata(:air_specific_humidity; dataset, start_date, end_date) | ||
| pa_meta = Metadata(:sea_level_pressure; dataset, start_date, end_date) | ||
| Ql_meta = Metadata(:downwelling_longwave; dataset, start_date, end_date) | ||
| Qs_meta = Metadata(:downwelling_shortwave; dataset, start_date, end_date) | ||
| Fr_meta = Metadata(:rain_freshwater_flux; dataset, start_date, end_date) | ||
|
|
||
| kw = (; time_indices_in_memory, time_indexing) | ||
| kw = merge(kw, other_kw) | ||
|
|
||
| ua = FieldTimeSeries(ua_meta, architecture; kw...) | ||
| va = FieldTimeSeries(va_meta, architecture; kw...) | ||
| Ta = FieldTimeSeries(Ta_meta, architecture; kw...) | ||
| qa = FieldTimeSeries(qa_meta, architecture; kw...) | ||
| pa = FieldTimeSeries(pa_meta, architecture; kw...) | ||
| Ql = FieldTimeSeries(Ql_meta, architecture; kw...) | ||
| Qs = FieldTimeSeries(Qs_meta, architecture; kw...) | ||
| Fr = FieldTimeSeries(Fr_meta, architecture; kw...) | ||
|
|
||
| auxiliary_freshwater_flux = nothing | ||
| freshwater_flux = (; rain = Fr) | ||
|
|
||
| times = ua.times | ||
| grid = ua.grid | ||
|
|
||
| velocities = (u = ua, v = va) | ||
| tracers = (T = Ta, q = qa) | ||
| pressure = pa | ||
|
|
||
| downwelling_radiation = TwoBandDownwellingRadiation(shortwave=Qs, longwave=Ql) | ||
|
|
||
| FT = eltype(ua) | ||
| surface_layer_height = convert(FT, surface_layer_height) | ||
|
|
||
| atmosphere = PrescribedAtmosphere(grid, times; | ||
| velocities, | ||
| freshwater_flux, | ||
| auxiliary_freshwater_flux, | ||
| tracers, | ||
| downwelling_radiation, | ||
| surface_layer_height, | ||
| pressure) | ||
|
|
||
| return atmosphere | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.