Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

Commit

Permalink
Merge #536 #1079
Browse files Browse the repository at this point in the history
536: apply JuliaFormatter.jl r=simonbyrne a=simonbyrne

This applies [JuliaFormatter.jl](https://github.com/domluna/JuliaFormatter.jl) to the whole repository.

Any thoughts/comments?

- [x] Testing?

1079: Fix some broken docs r=charleskawczynski a=charleskawczynski

# Description

Fixes several broken docs:

 - Microphysics: had missing variables / function arguments
 - RTB/Turbulence/Tracers: switched `@example` to `julia` blocks, since they are split across scope blocks (which breaks), or does not include sufficient code for an example.

 - Fixes the
```
connect: Connection refused
GKS: can't connect to GKS socket application

GKS: Open failed in routine OPEN_WS
GKS: GKS not in proper state. GKS must be either in the state WSOP or WSAC in routine ACTIVATE_WS
```
error by [installing](https://gr-framework.org/julia.html#installation) required libraries as suggested [here](jheinen/GR.jl#278 (comment)) and [here](jheinen/GR.jl#278 (comment))



Co-authored-by: Simon Byrne <simonbyrne@gmail.com>
Co-authored-by: Charles Kawczynski <kawczynski.charles@gmail.com>
  • Loading branch information
3 people authored May 11, 2020
3 parents 47a0a67 + c7e60a9 + 5b67d61 commit 3e9471a
Show file tree
Hide file tree
Showing 28 changed files with 1,694 additions and 1,483 deletions.
18 changes: 0 additions & 18 deletions .dev/format.jl

This file was deleted.

2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ A clear and concise description of the code with usage.
I have

- [ ] Written and run all necessary tests with CLIMA by including `tests/runtests.jl`
- [ ] Followed all necessary [style guidelines](https://CliMA.github.io/CLIMA/latest/CodingConventions.html) and run `julia .dev/format.jl`
- [ ] Followed all necessary [style guidelines](https://CliMA.github.io/CLIMA/latest/CodingConventions.html) and run `julia .dev/climaformat.jl .`
- [ ] Updated the documentation to reflect changes from this PR.

<!--- Please leave the following section --->
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/Documenter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ jobs:
sudo apt-get update
sudo apt-get install mpich libmpich-dev
- name: Install dependencies
run: julia --project=docs/ -e 'using Pkg; Pkg.instantiate()'
run: |
sudo apt install libxt6 libxrender1 libxext6 libgl1-mesa-glx libqt5widgets5
julia --project=docs/ -e 'using Pkg; Pkg.instantiate()'
- name: Build and deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/JuliaFormatter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
version: 1.3
- name: Apply JuliaFormatter
run: |
julia --project=.dev .dev/format.jl origin/master
julia --project=.dev .dev/climaformat.jl .
- name: Check formatting diff
run: |
git diff --color=always --exit-code
1 change: 1 addition & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Base.HOME_PROJECT[] = abspath(Base.HOME_PROJECT[]) # JuliaLang/julia/pull/28625

using ClimateMachine, Documenter, Literate
ENV["GKSwstype"] = "100" # https://github.com/jheinen/GR.jl/issues/278#issuecomment-587090846

generated_dir = joinpath(@__DIR__, "src", "generated") # generated files directory
mkpath(generated_dir)
Expand Down
11 changes: 6 additions & 5 deletions docs/src/HowToGuides/Atmos/Microphysics.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,9 @@ The default value of ``C_{drag}`` is chosen such that the ``v_t`` is close to th
using ClimateMachine.Microphysics
using Plots
using CLIMAParameters
abstract type EarthParameterSet <: AbstractParameterSet end
param_set = EarthParameterSet()
using CLIMAParameters.Atmos.Microphysics
struct EarthParameterSet <: AbstractEarthParameterSet end
const param_set = EarthParameterSet()
# eq. 5d in Smolarkiewicz and Grabowski 1996
# https://doi.org/10.1175/1520-0493(1996)124<0487:TTLSLM>2.0.CO;2
Expand Down Expand Up @@ -172,7 +173,7 @@ using ClimateMachine.Microphysics
using Plots
using CLIMAParameters
struct EarthParameterSet <: AbstractEarthParameterSet end
param_set = EarthParameterSet()
const param_set = EarthParameterSet()
# eq. 5b in Smolarkiewicz and Grabowski 1996
# https://doi.org/10.1175/1520-0493(1996)124<0487:TTLSLM>2.0.CO;2
Expand Down Expand Up @@ -271,7 +272,7 @@ using ClimateMachine.Microphysics
using ClimateMachine.MoistThermodynamics
using CLIMAParameters
using CLIMAParameters.Planet: R_d, planet_radius, grav, MSLP
using CLIMAParameters.Planet: R_d, planet_radius, grav, MSLP, molmass_ratio
struct EarthParameterSet <: AbstractEarthParameterSet end
const param_set = EarthParameterSet()
Expand Down Expand Up @@ -310,7 +311,7 @@ q = PhasePartition(q_tot, q_liq, q_ice)
R = gas_constant_air(param_set, q)
ρ = p / R / T
plot(q_rain_range * 1e3, [conv_q_rai_to_q_vap(q_rai, q, T, p, ρ) for q_rai in q_rain_range], xlabel="q_rain [g/kg]", ylabel="rain evaporation rate [1/s]", title="Rain evaporation", label="ClimateMachine")
plot(q_rain_range * 1e3, [conv_q_rai_to_q_vap(param_set, q_rai, q, T, p, ρ) for q_rai in q_rain_range], xlabel="q_rain [g/kg]", ylabel="rain evaporation rate [1/s]", title="Rain evaporation", label="ClimateMachine")
plot!(q_rain_range * 1e3, [rain_evap_empirical(q_rai, q, T, p, ρ) for q_rai in q_rain_range], label="empirical")
savefig("rain_evaporation_rate.svg") # hide
nothing # hide
Expand Down
Loading

0 comments on commit 3e9471a

Please sign in to comment.