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

Surface fluxes of heat, moisture and momentum: Land and ocean seasonal climatology #399

Merged
merged 20 commits into from
Oct 18, 2023

Conversation

milankl
Copy link
Member

@milankl milankl commented Oct 7, 2023

This implements surface fluxes of heat, moisture and momentum following Fortran SPEEDY but with shortcuts (no skin temperature calculation for now). Land and ocean temperatures are seasonal climatologies updated every 3 days.

@milankl milankl added input data 💾 Input data used by default (Orography, land-sea mask, etc) parameterizations 🌧️ Parameterizations of unresolved physical processes labels Oct 7, 2023
@milankl milankl changed the title Ocean model: seasonally varying sst from file Surface fluxes of heat, moisture and momentum: Land and ocean seasonal climatology Oct 18, 2023
@milankl
Copy link
Member Author

milankl commented Oct 18, 2023

Surface humidity 1 day after starting from a dry atmosphere, fluxes currently not based on skin temperatures, vegetation ignored (availability = 0.2 everywhere)

image

10 days in

image

30 days in

image

still not high enough to precipitate.

@p-hss

@milankl milankl added the forcing 🏋️ Forcing of the momentum equations label Oct 18, 2023
@milankl
Copy link
Member Author

milankl commented Oct 18, 2023

Surface specific humidity increase over 4 months (time vs lat @ 180E)

image

And during the 8 months after that

image

reaching still higher humidity levels, but again not enough to precipitate by itself

@milankl
Copy link
Member Author

milankl commented Oct 18, 2023

land_surface_temperature.nc from previous land.nc created via (to include a mask and compression)

using NCDatasets, Dates, BitInformation
ds = NCDataset("land.nc")
ds2 = NCDataset("land_surface_temperature.nc","c")
nx, ny, nt = ds.dim["lon"], ds.dim["lat"], ds.dim["time"]

defDim(ds2,"lon",nx)
defDim(ds2,"lat",ny)
defDim(ds2,"time",nt)
t0 = Dates.DateTime(1981,1,1)

lon = defVar(ds2,"lon",Float32,("lon",),attrib=Dict("units"=>"degrees_east","long_name"=>"longitude"))
lat = defVar(ds2,"lat",Float32,("lat",),attrib=Dict("units"=>"degrees_north","long_name"=>"latitude"))
time = defVar(ds2,"time",Int64,("time",),attrib=Dict("units"=>"hours since 1981-1-1 00:00:00",
                                                    "standard_name"=>"time",
                                                    "calendar"=>"gregorian"))

lon[:] = ds["lon"][:]
lat[:] = ds["lat"][:]

for t in 1:nt
    time[t] = Dates.Hour.(ds["time"][t] - t0).value
end

lst = defVar(ds2,"lst",Float32,("lon","lat","time"),
attrib=Dict("long_name"=>"land surface temperature",
            "units"=>"K","_FillValue"=>ds["stl"][1,1,1]),
deflatelevel=9,shuffle=true)

keepbits = 11
lst[:] = round(ds["stl"][:],keepbits)

close(ds2)

@milankl
Copy link
Member Author

milankl commented Oct 18, 2023

Last commit brings the model initialisation time down to 0.1-0.2s (was 2-4s).

Before: (no ocean or land initialization, which is an interpolation for every month)

julia> @time simulation = initialize!(model)
  1.691842 seconds (437.42 k allocations: 108.633 MiB, 1.29% gc time)
SpeedyWeather.Simulation{PrimitiveWetModel{Float32, SpeedyWeather.CPUDevice}}
├ PrimitiveWetModel{Float32, SpeedyWeather.CPUDevice}
├ PrognosticVariables{Float32, OctahedralGaussianGrid{Float32}, PrimitiveWetModel{Float32, SpeedyWeather.CPUDevice}}
└ DiagnosticVariables{Float32, OctahedralGaussianGrid{Float32}, PrimitiveWet}

After: (with ocean, land and orography)

julia> @time simulation = initialize!(model)
  0.137597 seconds (641.46 k allocations: 61.707 MiB)
Main.SpeedyWeather.Simulation{PrimitiveWetModel{Float32, Main.SpeedyWeather.CPUDevice}}
├ PrimitiveWetModel{Float32, Main.SpeedyWeather.CPUDevice}
├ PrognosticVariables{Float32, OctahedralGaussianGrid{Float32}, PrimitiveWet}
└ DiagnosticVariables{Float32, OctahedralGaussianGrid{Float32}, PrimitiveWet}

Orography had an expensive large spectal transform (interpolation now), ocean and land read individual values from netcdf (slow, now in batch).

@milankl milankl merged commit b6d6f33 into main Oct 18, 2023
3 checks passed
@milankl milankl mentioned this pull request Oct 18, 2023
22 tasks
@milankl milankl deleted the mk/ocean branch October 20, 2023 01:30
@milankl milankl mentioned this pull request Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
forcing 🏋️ Forcing of the momentum equations input data 💾 Input data used by default (Orography, land-sea mask, etc) parameterizations 🌧️ Parameterizations of unresolved physical processes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant