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
SC=MITgcm.system_check()
 MITgcm_system_check 
  name = advect_xy
  download = true
  complete = true
  mpi = false
  adj = false
  folder = /tmp/ac946140-ff74-4526-8112-2aafb3de1f20
  path_MITgcm = /home/runner/.julia/scratchspaces/124859b0-ceae-595e-8997-d05f6a7a8dfe/datadeps/mitgcmsmall/MITgcm
  path_verification = /home/runner/.julia/scratchspaces/124859b0-ceae-595e-8997-d05f6a7a8dfe/datadeps/mitgcmsmallverif/MITgcm/verification
  NETCDF_ROOT = /usr
  MPI_INC_DIR = /usr/lib/x86_64-linux-gnu/openmpi/include
  genmake_log = OrderedDict with 5 keys
  genmake_state = OrderedDict with 81 keys
MC=MITgcm_config(configuration="advect_xy")
setup(MC)
build(MC)
launch(MC)
"STOP NORMAL END"
monitor(MC)
  ID            = 77d0556a-9663-4791-b438-0095724626d0
  model         = MITgcm
  configuration = advect_xy
  run folder    = /tmp/77d0556a-9663-4791-b438-0095724626d0
  log subfolder = /tmp/77d0556a-9663-4791-b438-0095724626d0/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, 20)

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   true

Functionalities

Main

Note

The following three methods implement the ClimateModels.jl's interface for MITgcm.

ClimateModels.setupFunction
setup(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)

source
ClimateModels.buildFunction
build(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.

source
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)

source
ClimateModels.launchFunction
launch(config::MITgcm_config)

Go to run/ folder and effectively call mitgcmuv > output.txt

(part of the climate model interface as specialized for MITgcm)

source

Tools

MITgcm.MITgcm_system_checkType
MITgcm_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 = false
source
MITgcm.system_checkFunction
system_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=MITgcm.system_check()
source
MITgcm.test_runFunction
test_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)
source
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")
source
MITgcm.set_environment_variables_to_defaultFunction
set_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 !!!

source
MITgcm.getdataFunction
getdata(nam::String)

Add data to the scratch space folder. Known options for nam include "mitgcmsmall", "mitgcmsmallverif", "hs94pickup", "darwin3code", "darwin3oneD"

source
MITgcm.create_scriptFunction
create_script(rundir=pwd(),filename="")

Create submission script – for NASA pleiades in this example.

submission_script=MITgcm.create_script(pwd(),"job.csh")
source