Interface to MITgcm
The ClimateModels.jl's interface is implemented in MITgcm.jl.
This allows you to easily create model simulations using MITgcm conveniently from Julia.
using MITgcm
MC=MITgcm_config(configuration="advect_xy")
setup(MC)
build(MC)
launch(MC)"STOP NORMAL END"Or in abbreviated form, equivalently :
using MITgcm
MC=run( MITgcm_config(configuration="advect_xy") )To get information about how the model simulation is going (or has gone) :
monitor(MC) ID = 0babc316-f9fd-4fd2-b529-ca943c47c61a
model = MITgcm
configuration = advect_xy
run folder = /tmp/0babc316-f9fd-4fd2-b529-ca943c47c61a
log subfolder = /tmp/0babc316-f9fd-4fd2-b529-ca943c47c61a/log
task(s) = MITgcm_launch
packages
8×2 DataFrame
Row │ name value
│ Symbol Bool
─────┼────────────────────────
1 │ generic_advdiff true
2 │ mom_common false
3 │ mom_vecinv false
4 │ mom_fluxform false
5 │ monitor true
6 │ debug false
7 │ rw true
8 │ mdsio true
params_grid
13×2 DataFrame
Row │ name value
│ Symbol Int64
─────┼────────────────────────────────
1 │ usingCurvilinearGrid 0
2 │ nSy 2
3 │ usingCartesianGrid 1
4 │ nPx 1
5 │ sNy 10
6 │ usingCylindricalGrid 0
7 │ Nx 20
8 │ sNx 20
9 │ nSx 1
10 │ Nr 1
11 │ Ny 10
12 │ usingSphericalPolarGrid 0
13 │ nPy 1
params_files
3×2 DataFrame
Row │ name value
│ Symbol Any
─────┼─────────────────────────
1 │ use_mdsio true
2 │ use_mnc false
3 │ ioSize (20.0, 20.0)
params_time
7×2 DataFrame
Row │ name value
│ Symbol Float64
─────┼──────────────────────
1 │ nEndIter 80.0
2 │ deltaTClock 2500.0
3 │ nIter0 0.0
4 │ monitorFreq 40000.0
5 │ pChkPtFreq 0.0
6 │ nTimeSteps 80.0
7 │ dumpFreq 40000.0
completed
1×2 DataFrame
Row │ name value
│ Int64 Bool
─────┼──────────────
1 │ 1 trueFunctionalities
Main
The following three methods implement the ClimateModels.jl's interface for MITgcm.
ClimateModels.setup — Functionsetup(config::MITgcm_config)Create a run/ folder and link everything there as needed to be ready to run model as normally done for most-standard MITgcm configurations (incl. prepare_run and mitgcmuv). Call ClimateModels.git_log_init(config) to setup git tracker and put!(config.channel,MITgcm_launch) to be executed via launch(config) later.
(part of the climate model interface as specialized for MITgcm)
ClimateModels.build — Functionbuild(config::MITgcm_config)Build the model using genmake2, make depend, and make. The first two link all code files, headers, etc in the build/ folder before compiling the model.
Note : this is skipped if config.inputs[:setup][:main][:exe] is specified.
build(config::MITgcm_config,options::String)Build the model using genmake2, make depend, and make unless otherwise specified via options. The genmake2 and make depend commands link all code files, headers, etc in the build/ folder before make compiles the model.
(part of the climate model interface as specialized for MITgcm)
ClimateModels.launch — Functionlaunch(config::MITgcm_config)Go to run/ folder and effectively call mitgcmuv > output.txt
(part of the climate model interface as specialized for MITgcm)
Tools
MITgcm.MITgcm_system_check — TypeMITgcm_system_check()Output of MITgcm.system_check.
download :: Bool = false
complete :: Bool = false
genmake_log :: OrderedDict{Any,Any} = OrderedDict{Any,Any}()
genmake_state :: OrderedDict{Any,Any} = OrderedDict{Any,Any}()
name :: String = "advect_xy"
folder :: String = ""
path_MITgcm :: String = ""
path_verification :: String = ""
NETCDF_ROOT :: String = ""
MPI_INC_DIR :: String = ""
mpi :: Bool = falseMITgcm.system_check — Functionsystem_check(;setenv=false,exe="",mpi=false,adj=false,opt=" -devel -ds -ieee")Run a suite of diagnostics, including a test run of MITgcm.
Notes :
- adj=true requires a properly set up TAF license
- fix needed : tutorialglobalocebiogeo/inputad/data.gmredi and data.grdchk
using MITgcm
SC=system_check()MITgcm.test_run — Functiontest_run(MC::MITgcm_config; exe="", opt=" -devel -ds -ieee")Build (exe="") and run a small MITgcm simulation. Ifexe` is specified then reuse precompiled executable.
using MITgcm
MC=MITgcm_config(configuration="advect_xy")
test_run(MC)test_run(MC::MITgcm_config; exe="", mpi=false, adj=false, opt=" -devel -ds -ieee")using MITgcm
MITgcm_path[1]=joinpath(MITgcm.getdata("mitgcmsmall"),"MITgcm")
MITgcm_path[2]=joinpath(MITgcm.getdata("mitgcmsmallverif"),"MITgcm","verification")
test_run("advect_xy")MITgcm.setenv — Functionsetenv(a,b)Set environment variable a to value b. Issue warning.
MITgcm.setenv("DATADEPS_ALWAYS_ACCEPT",true)
env=MITgcm.default_environment_variables()
MITgcm.setenv("NETCDF_ROOT",env.NETCDF_ROOT)
MITgcm.setenv("MPI_INC_DIR",env.MPI_INC_DIR)
system_check()MITgcm.set_environment_variables_to_default — Functionset_environment_variables_to_default()Defines environment variables to default values.
!!! Warning : it is generally much better to adjust them to your own system !!!
!!! Warning : the defaults will likely NOT work on most systems !!!
MITgcm.default_path — FunctionMITgcm.default_path()Return default path, and download via MITgcm_download if needed.
MITgcm.getdata — Functiongetdata(nam::String)Add data to the scratch space folder. Known options for nam include "mitgcmsmall", "mitgcmsmallverif", "hs94pickup", "darwin3code", "darwin3oneD"
MITgcm.create_script — Functioncreate_script(rundir=pwd(),filename="")Create submission script – for NASA pleiades in this example.
submission_script=MITgcm.create_script(pwd(),"job.csh")