Skip to content

Commit

Permalink
Merge pull request #18 from gaelforget/Climatology_plus_cmake_bis
Browse files Browse the repository at this point in the history
Climatology plus cmake bis
  • Loading branch information
gaelforget authored Jun 21, 2024
2 parents 906e7de + d39ee03 commit 09d4f28
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/binder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
push:
branches:
- main
- v0p2p2c
- Climatology_plus_cmake_bis
jobs:
binder:
runs-on: ubuntu-latest
Expand Down
7 changes: 2 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM jupyter/base-notebook:latest

USER root

ENV mainpath ./
ENV mainpath /home/jovyan/
RUN mkdir -p ${mainpath}

RUN apt-get update
Expand Down Expand Up @@ -44,17 +44,14 @@ RUN echo 'alias julia="${mainpath}/.juliaup/bin/julia --project=${mainpath}"' >>

RUN conda config --env --add channels conda-forge
RUN conda config --env --add channels r
RUN conda install numpy xarray
RUN conda install dask pandas
RUN conda install numpy xarray pandas
RUN conda install octave_kernel texinfo r-irkernel

RUN curl -fsSL https://install.julialang.org | sh -s -- --yes

RUN ${mainpath}/.juliaup/bin/julia --project=${mainpath} -e "import Pkg; Pkg.instantiate();"
RUN ${mainpath}/.juliaup/bin/julia --project=${mainpath} ${mainpath}/src/warmup.jl

ENV MPI_INC_DIR /usr/lib/x86_64-linux-gnu/openmpi/include

RUN jupyter lab build && \
jupyter lab clean && \
pip install ${mainpath} --no-cache-dir && \
Expand Down
2 changes: 1 addition & 1 deletion binder/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
### DO NOT EDIT THIS FILE! This Is Automatically Generated And Will Be Overwritten ###
FROM gaelforget/ecco-docker:a2bcb0725279
FROM gaelforget/ecco-docker:f8dc82b8e5d3
25 changes: 15 additions & 10 deletions src/warmup.jl
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
using Pluto, CairoMakie, Downloads, IJulia, Pkg

import MITgcm, OceanStateEstimation
import MITgcm.ClimateModels
import MITgcm.MeshArrays
using MITgcm.ClimateModels.Git
import MITgcm, Climatology
import MITgcm.ClimateModels, MITgcm.MeshArrays
import MITgcm.ClimateModels.git

ENV["DATADEPS_ALWAYS_ACCEPT"]=true
MITgcm.set_environment_variables_to_default()

##

p0=pathof(MITgcm)
fil=joinpath(dirname(p0),"..","examples","configurations","OCCA2.toml")
MC=MITgcm.MITgcm_config(inputs=MITgcm.read_toml(fil))
push!(MC.inputs[:setup][:main],(:input_folder => tempname()))
ClimateModels.setup(MC)
ClimateModels.build(MC)

cp(joinpath(dirname(p0),"..","examples","configurations","ECCO4.toml"),"src/ECCO4.toml")
cp(joinpath(dirname(p0),"..","examples","configurations","OCCA2.toml"),"src/OCCA2.toml")
cp(joinpath(MC,"MITgcm/mysetups/ECCOv4/input/download_files.jl"),"src/download_files.jl")

mv(joinpath(MC,"MITgcm/mysetups/ECCOv4/build/mitgcmuv"),"src/mitgcmuv")
f=joinpath(MC,"MITgcm/mysetups/ECCOv4/build/mitgcmuv")
isfile(f) ? mv(f,"src/mitgcmuv") : println("mitgcmuv not found")
rm(pathof(MC),recursive=true)

##
Expand All @@ -29,18 +33,19 @@ ClimateModels.launch(tmp)
##

MeshArrays.GRID_LLC90_download()
OceanStateEstimation.ECCOdiags_add("release2")
OceanStateEstimation.ECCOdiags_add("release4")

Climatology.ECCOdiags_add("release2")
#Climatology.ECCOdiags_add("release4")

Downloads.download(
"https://zenodo.org/record/5784905/files/interp_coeffs_halfdeg.jld2",
joinpath(OceanStateEstimation.ScratchSpaces.ECCO,"interp_coeffs_halfdeg.jld2");
joinpath(Climatology.ScratchSpaces.ECCO,"interp_coeffs_halfdeg.jld2");
timeout=60000.0)

##

pth=joinpath(ENV["HOME"],"src","OceanStateEstimation.jl")
run(`$(git()) clone https://github.com/gaelforget/OceanStateEstimation.jl $pth`)
pth=joinpath(ENV["HOME"],"src","Climatology.jl")
run(`$(git()) clone https://github.com/JuliaOcean/Climatology.jl $pth`)
nb=joinpath(pth,"examples/ECCO/ECCO_standard_plots.jl")
Pluto.activate_notebook_environment(nb)
Pkg.instantiate()
Expand Down

0 comments on commit 09d4f28

Please sign in to comment.