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

Moved themodynamic data #70

Merged
merged 4 commits into from
Oct 30, 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ res/spectral_files/*
res/stellar_spectra/*
res/surface_albedos/*
res/realgas/*
res/thermodynamics/*.nc
!res/*/_readme.txt

# Output files
Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors:
given-names: "Harrison"
orcid: "https://orcid.org/0000-0002-8368-4641"
title: "AGNI"
version: 0.9.0
version: 0.10.0
doi: 10.xx/xx.xx
date-released: 2024-09-20
url: "https://github.com/nichollsh/AGNI"
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "AGNI"
uuid = "ede838c1-9ec3-4ebe-8ae8-da4091b3f21c"
authors = ["Harrison Nicholls <[email protected]>"]
version = "0.9.0"
version = "0.10.0"

[deps]
ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63"
Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ See the [Getting Started](https://nichollsh.github.io/AGNI/dev/setup/) page in t
## Repository structure
* `agni.jl` - The main AGNI executable
* `LICENSE.txt` - License for use and re-use
* `get_fastchem.sh` - Download and setup FastChem
* `get_socrates.sh` - Download and setup SOCRATES
* `get_data.sh` - Download input data files
* `deps/` - Package build scripts
* `docs/` - Documentation source files
* `misc/` - Miscellaneous files
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
"keywords": "physics, radiative transfer, exoplanets, astronomy, convection, radiation, planets, atmospheres",
"license": "GPL v3.0",
"title": "AGNI",
"version": "0.9.0"
"version": "0.10.0"
}
2 changes: 1 addition & 1 deletion deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ end

# Download basic data
println("Get data")
get_data = joinpath(ROOT_DIR,"get_data.sh")
get_data = joinpath(ROOT_DIR,"src/get_data.sh")
run(`bash $get_data basic`)

println("Build completed")
2 changes: 1 addition & 1 deletion docs/src/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ directory. This will also have downloaded some basic input data.
You should run the tests next.

!!! tip
The `get_socrates.sh` script automatically adds the radiation code to your
The `src/get_socrates.sh` script automatically adds the radiation code to your
environment with the variable `RAD_DIR`, which points to the SOCRATES installation.
This variable must be set whenever AGNI is being used.

Expand Down
18 changes: 9 additions & 9 deletions docs/src/troubleshooting.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Troubleshooting
This page may be useful if you are having problems. However, I would suggest that
This page may be useful if you are having problems. However, I would suggest that
you also double check the [Getting started](@ref) instructions.

## Julia errors on start, potentially referencing the CURL library
It is important that the shell environment variable `LD_LIBRARY_PATH` is
not set when running AGNI. This will cause Julia to use the wrong libraries,
It is important that the shell environment variable `LD_LIBRARY_PATH` is
not set when running AGNI. This will cause Julia to use the wrong libraries,
which will causes problems. You can unset this variable or reset using either of the
following commands
following commands
```bash
unset LD_LIBRARY_PATH
export LD_LIBRARY_PATH=""
```
If this does not help, it's possible that you are using a Julia distribution provided by
your system package manager. It's important that you only use Julia distributed from the
your system package manager. It's important that you only use Julia distributed from the
official website.


Expand All @@ -24,15 +24,15 @@ or you haven't added it to your `PATH`.

## Spectral file does not exist
Check the path in the configuration file. Download additional spectral files using the
`get_data` script in the AGNI root directory. For example, for additional pure-steam
`get_data` script in the AGNI root directory. For example, for additional pure-steam
spectral files you would run
```bash
./get_data.sh steam
```bash
./src/get_data.sh steam
```


## Finally...
If you are still stuck, or feel that there is a problem with the code, then
If you are still stuck, or feel that there is a problem with the code, then
you can contact the authors using the information on the main page.


4,845 changes: 4,845 additions & 0 deletions misc/aqua.ipynb

Large diffs are not rendered by default.

Binary file removed res/thermodynamics/C.nc
Binary file not shown.
Binary file removed res/thermodynamics/C2H4.nc
Binary file not shown.
Binary file removed res/thermodynamics/CH3.nc
Binary file not shown.
Binary file removed res/thermodynamics/CH4.nc
Binary file not shown.
Binary file removed res/thermodynamics/CO.nc
Binary file not shown.
Binary file removed res/thermodynamics/CO2.nc
Binary file not shown.
Binary file removed res/thermodynamics/Fe.nc
Binary file not shown.
Binary file removed res/thermodynamics/FeO.nc
Binary file not shown.
Binary file removed res/thermodynamics/H.nc
Binary file not shown.
Binary file removed res/thermodynamics/H2.nc
Binary file not shown.
Binary file removed res/thermodynamics/H2O.nc
Binary file not shown.
Binary file removed res/thermodynamics/H2O2.nc
Binary file not shown.
Binary file removed res/thermodynamics/H2S.nc
Binary file not shown.
Binary file removed res/thermodynamics/H2SO4.nc
Binary file not shown.
Binary file removed res/thermodynamics/HCN.nc
Binary file not shown.
Binary file removed res/thermodynamics/HNO3.nc
Binary file not shown.
Binary file removed res/thermodynamics/Mg.nc
Binary file not shown.
Binary file removed res/thermodynamics/Mg2.nc
Binary file not shown.
Binary file removed res/thermodynamics/MgO.nc
Binary file not shown.
Binary file removed res/thermodynamics/N.nc
Binary file not shown.
Binary file removed res/thermodynamics/N2.nc
Binary file not shown.
Binary file removed res/thermodynamics/N2O.nc
Binary file not shown.
Binary file removed res/thermodynamics/NH3.nc
Binary file not shown.
Binary file removed res/thermodynamics/NO.nc
Binary file not shown.
Binary file removed res/thermodynamics/O.nc
Binary file not shown.
Binary file removed res/thermodynamics/O2.nc
Binary file not shown.
Binary file removed res/thermodynamics/O3.nc
Binary file not shown.
Binary file removed res/thermodynamics/OCS.nc
Binary file not shown.
Binary file removed res/thermodynamics/OH.nc
Binary file not shown.
Binary file removed res/thermodynamics/PH3.nc
Binary file not shown.
Binary file removed res/thermodynamics/S.nc
Binary file not shown.
Binary file removed res/thermodynamics/S2.nc
Binary file not shown.
Binary file removed res/thermodynamics/S8.nc
Binary file not shown.
Binary file removed res/thermodynamics/SO.nc
Binary file not shown.
Binary file removed res/thermodynamics/SO2.nc
Binary file not shown.
Binary file removed res/thermodynamics/Si.nc
Binary file not shown.
Binary file removed res/thermodynamics/SiO.nc
Binary file not shown.
Binary file removed res/thermodynamics/SiO2.nc
Binary file not shown.
2 changes: 1 addition & 1 deletion src/atmosphere.jl
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ module atmosphere
end

# Code versions
atmos.AGNI_VERSION = "0.9.0"
atmos.AGNI_VERSION = "0.10.0"
atmos.SOCRATES_VERSION = readchomp(joinpath(ENV["RAD_DIR"],"version"))
@debug "AGNI VERSION = $(atmos.AGNI_VERSION)"
@debug "Using SOCRATES at $(ENV["RAD_DIR"])"
Expand Down
36 changes: 30 additions & 6 deletions get_data.sh → src/get_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,21 @@ fi

# Root and resources folders
root=$(dirname $(realpath $0))
res="$root/res/"
root=$(realpath "$root/..")
res="$root/res"
spfiles=$res/spectral_files
stellar=$res/stellar_spectra
surface=$res/surface_albedos
realgas=$res/realgas
thermo=$res/thermodynamics

# Make basic data folders
mkdir -p $res
mkdir -p $spfiles
mkdir -p $stellar
mkdir -p $surface
mkdir -p $realgas
mkdir -p $thermo

# Help strings
help_basic="Get the basic data required to run the model"
Expand All @@ -33,6 +36,7 @@ help_steam="Get pure-steam spectral files"
help_stellar="Get a collection of stellar spectra"
help_surfaces="Get a collection of surface single-scattering albedos"
help_realgas="Get a real-gas EOS coefficients and lookup tables"
help_thermo="Get lookup data for thermodynamics (heat capacities, etc.)"
help="\
Helper script used to download and unpack data used to run the model.

Expand All @@ -52,6 +56,8 @@ Where [TARGET] can be any of the following:
$help_surfaces
realgas
$help_realgas
thermodynamics
$help_thermo
"

# Generic OSF downloader function
Expand All @@ -77,6 +83,17 @@ function osf {
return 0
}

# Get zip file
function get_zip {
# $1 = OSF identifier
# $2 = target folder

zipfile=".temp.zip"
osf $1 $2 $zipfile
unzip -oq $2/$zipfile -d $2
rm $2/$zipfile
}

# Handle request for downloading a group of data
function handle_request {
case $1 in
Expand All @@ -92,7 +109,9 @@ function handle_request {
osf b5gsh $spfiles/Dayspring/256/ Dayspring.sf
osf dn6wh $spfiles/Dayspring/256/ Dayspring.sf_k

osf 2qdu8 $res/stellar_spectra sun.txt
osf 2qdu8 $stellar sun.txt

get_zip 4m5x8 $thermo
;;

"highres")
Expand Down Expand Up @@ -153,10 +172,15 @@ function handle_request {
echo $help_realgas

# AQUA PT lookup
zipfile=".aqua_temp.zip"
osf uqrdx $realgas $zipfile
unzip -oq $realgas/$zipfile -d $realgas
rm $realgas/$zipfile
get_zip uqrdx $realgas

;;

"thermodynamics")
echo $help_thermo

# NetCDF files from OSF
get_zip 4m5x8 $thermo

;;

Expand Down
5 changes: 4 additions & 1 deletion get_fastchem.sh → src/get_fastchem.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/bin/bash
# Download and compile fastchem

root=$(dirname $(realpath $0))
root=$(realpath "$root/..")

# Download via HTTPS only
fcpath="fastchem"
fcpath=$(realpath "$root/fastchem")
rm -rf "$fcpath"

git clone https://github.com/NewStrangeWorlds/FastChem.git "$fcpath"
Expand Down
8 changes: 6 additions & 2 deletions get_socrates.sh → src/get_socrates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
if [ -n "$RAD_DIR" ]; then
echo "WARNING: You already have SOCRATES installed"
echo " RAD_DIR=$RAD_DIR"
exit 1
echo "Continuing..."
echo ""
sleep 5
fi

# Check SSH access to GitHub
Expand All @@ -17,7 +19,9 @@ else
fi

# Download (using SSH if possible)
socpath="$(realpath .)/socrates"
root=$(dirname $(realpath $0))
root=$(realpath "$root/..")
socpath=$(realpath "$root/socrates")
rm -rf "$socpath"
if [ "$use_ssh" = true ]; then
git clone [email protected]:nichollsh/SOCRATES.git "$socpath"
Expand Down