Skip to content
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

Add JRA55 in docs #319

Merged
merged 4 commits into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const EXAMPLES_DIR = joinpath(@__DIR__, "..", "examples")
const OUTPUT_DIR = joinpath(@__DIR__, "src/literated")

to_be_literated = [
"ecco_inspect_temperature_salinity.jl",
# "ecco_inspect_temperature_salinity.jl",
"generate_bathymetry.jl",
"generate_surface_fluxes.jl",
"single_column_os_papa_simulation.jl",
Expand Down Expand Up @@ -41,7 +41,7 @@ pages = [
"Home" => "index.md",

"Examples" => [
"Inspect ECCO2 data" => "literated/ecco_inspect_temperature_salinity.md",
# "Inspect ECCO2 data" => "literated/ecco_inspect_temperature_salinity.md",
"Generate bathymetry" => "literated/generate_bathymetry.md",
"Surface fluxes" => "literated/generate_surface_fluxes.md",
"Single-column simulation" => "literated/single_column_os_papa_simulation.md",
Expand Down
7 changes: 7 additions & 0 deletions docs/src/library/internals.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ Modules = [ClimaOcean.ECCO]
Public = false
```

## JRA55

```@autodocs
Modules = [ClimaOcean.JRA55]
Public = false
```

## Bathymetry

```@autodocs
Expand Down
7 changes: 7 additions & 0 deletions docs/src/library/public.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ Modules = [ClimaOcean.ECCO]
Private = false
```

## JRA55

```@autodocs
Modules = [ClimaOcean.JRA55]
Private = false
```

## Bathymetry

```@autodocs
Expand Down
79 changes: 39 additions & 40 deletions src/DataWrangling/JRA55.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ using ClimaOcean.OceanSeaIceModels:
using CUDA: @allowscalar

using NCDatasets
using JLD2
using JLD2
using Dates
using Scratch

Expand Down Expand Up @@ -286,40 +286,40 @@ new_backend(::JRA55NetCDFBackend, start, length) = JRA55NetCDFBackend(start, len
"""
JRA55_field_time_series(variable_name;
architecture = CPU(),
time_indices = nothing,
latitude = nothing,
longitude = nothing,
grid = nothing,
location = nothing,
url = nothing,
dir = download_jra55_cache,
filename = nothing,
shortname = nothing,
latitude = nothing,
longitude = nothing,
backend = InMemory(),
time_indexing = Cyclical(),
preprocess_chunk_size = 10,
preprocess_architecture = CPU())
preprocess_architecture = CPU(),
time_indices = nothing)

Return a `FieldTimeSeries` containing atmospheric reanalysis data for `variable_name`,
which describes one of the variables in the "repeat year forcing" dataset derived
from the Japanese 55-year atmospheric reanalysis for driving ocean-sea-ice models (JRA55-do).
For more information about the derivation of the repeat year forcing dataset, see

"Stewart et al., JRA55-do-based repeat year forcing datasets for driving ocean–sea-ice models",
Ocean Modelling, 2020, https://doi.org/10.1016/j.ocemod.2019.101557.

The `variable_name`s (and their `shortname`s used in NetCDF files)
available from the JRA55-do are:

- `:river_freshwater_flux` ("friver")
- `:rain_freshwater_flux` ("prra")
- `:snow_freshwater_flux` ("prsn")
- `:iceberg_freshwater_flux` ("licalvf")
- `:specific_humidity` ("huss")
- `:sea_level_pressure` ("psl")
- `:relative_humidity` ("rhuss")
- `:downwelling_longwave_radiation` ("rlds")
- `:downwelling_shortwave_radiation` ("rsds")
- `:temperature` ("ras")
- `:eastward_velocity` ("uas")
- `:northward_velocity` ("vas")
from the Japanese 55-year atmospheric reanalysis for driving ocean-sea ice models (JRA55-do).
For more information about the derivation of the repeat-year forcing dataset, see

> Stewart et al. (2020). JRA55-do-based repeat year forcing datasets for driving ocean–sea-ice models, _Ocean Modelling_, **147**, 101557, https://doi.org/10.1016/j.ocemod.2019.101557.

The `variable_name`s (and their `shortname`s used in NetCDF files) available from the JRA55-do are:
- `:river_freshwater_flux` ("friver")
- `:rain_freshwater_flux` ("prra")
- `:snow_freshwater_flux` ("prsn")
- `:iceberg_freshwater_flux` ("licalvf")
- `:specific_humidity` ("huss")
- `:sea_level_pressure` ("psl")
- `:relative_humidity` ("rhuss")
- `:downwelling_longwave_radiation` ("rlds")
- `:downwelling_shortwave_radiation` ("rsds")
- `:temperature` ("ras")
- `:eastward_velocity` ("uas")
- `:northward_velocity` ("vas")

Keyword arguments
=================
Expand Down Expand Up @@ -352,8 +352,8 @@ Keyword arguments
- `interpolated_file`: file holding an Oceananigans compatible version of the JRA55 data.
If it does not exist it will be generated.

- `time_chunks_in_memory`: number of fields held in memory. If `nothing` the whole timeseries is
loaded (not recommended).
- `time_chunks_in_memory`: number of fields held in memory. If `nothing` then the whole timeseries
is loaded (not recommended).
"""
function JRA55_field_time_series(variable_name;
architecture = CPU(),
Expand Down Expand Up @@ -639,20 +639,20 @@ JRA55PrescribedAtmosphere(arch::Distributed, time_indices=Colon(); kw...) =
# TODO: allow the user to pass dates
"""
JRA55PrescribedAtmosphere(architecture::AA, time_indices=Colon();
backend = nothing,
time_indexing = Cyclical(),
reference_height = 10, # meters
include_rivers_and_icebergs = false,
other_kw...)
backend = nothing,
time_indexing = Cyclical(),
reference_height = 10, # meters
include_rivers_and_icebergs = false,
other_kw...)

Return a `PrescribedAtmosphere` representing JRA55 reanalysis data.
"""
function JRA55PrescribedAtmosphere(architecture::AA, time_indices=Colon();
backend = nothing,
time_indexing = Cyclical(),
reference_height = 10, # meters
include_rivers_and_icebergs = false,
other_kw...)
backend = nothing,
time_indexing = Cyclical(),
reference_height = 10, # meters
include_rivers_and_icebergs = false,
other_kw...)

if isnothing(backend) # apply a default
Ni = try
Expand All @@ -667,7 +667,7 @@ function JRA55PrescribedAtmosphere(architecture::AA, time_indices=Colon();
end

kw = (; time_indices, time_indexing, backend, architecture)
kw = merge(kw, other_kw)
kw = merge(kw, other_kw)

ua = JRA55_field_time_series(:eastward_velocity; kw...)
va = JRA55_field_time_series(:northward_velocity; kw...)
Expand Down Expand Up @@ -719,4 +719,3 @@ function JRA55PrescribedAtmosphere(architecture::AA, time_indices=Colon();
end

end # module

Loading