Running MITgcm from Julia#

  • In this notebook, we just show the method for running a small MITgcm verification experiment via testreport.

  • A more general method is highlighted in the MITgcm.jl docs.

#Let's start a temporary environment for this notebook, and add julia packages that we will use :
if !isdefined(Main,:MITgcm)
    using Pkg; Pkg.activate(temp=true); Pkg.add("MITgcm")
end
using MITgcm

Setting up an optfile#

In jupyter, it seems that the MITgcm build options file needs to be explicitely selected; e.g. darwin_arm64_gfortran in MacOS (M series).

path0=MITgcm.default_path()
MC=MITgcm_config(configuration="flt_example")
a=MITgcm.build_options_default[1]*" -optfile=../../../tools/build_options/darwin_arm64_gfortran"
b="-optfile=../../../"
!occursin(b,a) ? opt="" : opt="-optfile="*joinpath(path0,split(a,b)[2]);

Running a Verification Experiment#

tmp=testreport(MC,opt);
/private/var/folders/vn/3r695jqd3177cw09wdmf3z940000gn/T/jl_shUVQf2F8b

Look at Model Ouput#

In this case we the particle tracking output from MITgcm/pkg/flt. All other MITgcm output formats are supported by MITgcm.jl docs.

pth=joinpath(tmp,"MITgcm","verification","flt_example","run")
tmp=read_flt(pth,Float32)
420×14 DataFrame
395 rows omitted
RowIDtimelonlatdepijketaNuVelvVelthetasalttile
Int64Int64Float32Float32Float32Float32Float32Float32Float32Float32Float32Float32Float32Int64
113600117500.097500.4-2531.2524.020.00015.00.0001088532.28572e-50.000293337-0.099547135.01
223600137500.097500.5-2531.2528.020.00015.00.0001257951.72759e-50.00031245-0.099547335.01
333600167500.097500.6-2531.2534.020.00015.00.000176366-6.00037e-60.000392465-0.09954835.01
4213600117500.097500.4-2531.2524.020.00015.00.0001088532.28572e-50.000293337-0.099547135.01
5223600137500.097500.5-2531.2528.020.00015.00.0001257951.72759e-50.00031245-0.099547335.01
6233600167500.097500.6-2531.2534.020.00015.00.000176366-6.00037e-60.000392465-0.09954835.01
7413600117500.097500.0-2531.2524.020.05.0-999.0-999.0-999.0-999.0-999.01
8423600137500.097500.0-2531.2528.020.05.0-999.0-999.0-999.0-999.0-999.01
9433600167500.097500.0-2531.2534.020.05.0-999.0-999.0-999.0-999.0-999.01
10613600117500.097500.0-2531.2524.020.05.0-999.0-999.0-999.0-999.0-999.01
11623600137500.097500.0-2531.2528.020.05.0-999.0-999.0-999.0-999.0-999.01
12633600167500.097500.0-2531.2534.020.05.0-999.0-999.0-999.0-999.0-999.01
1381360097500.097500.0-1968.7520.020.04.09.8633e-52.56849e-50.0002845890.099548535.01
409102108002.0e51.59998e5-1406.2540.500132.49963.0-0.002285789.15741e-5-0.0004808710.29835335.04
410124108002.70001e51.25009e5-3093.7554.500325.50176.0-0.001469350.0004682650.00208892-0.29869235.04
41112510800270001.01.30008e5-3093.7554.500226.50156.0-0.00166410.0003875490.00187627-0.29870435.04
412126108002.70001e51.35007e5-3093.7554.500127.50136.0-0.00183510.000304530.00163208-0.29871735.04
413127108002.7e51.40006e5-3093.7554.500128.50116.0-0.001979780.0002185320.00135935-0.2987335.04
414128108002.7e51.45004e5-3093.7554.529.50096.0-0.002095740.0001283510.00106042-0.29874335.04
415129108002.7e51.50003e5-3093.7554.530.50066.0-0.002180693.25459e-50.000736987-0.29875535.04
416130108002.7e51.55002e5-3093.7554.499931.50036.0-0.00223241-7.02949e-50.000390125-0.29876735.04
417120108002.70002e51.0501e5-3093.7554.500521.50216.0-0.0005140930.0007517990.00255706-0.29864335.04
418121108002.70002e51.1001e5-3093.7554.500422.5026.0-0.0007723930.0006905380.00250338-0.29865535.04
419122108002.70002e51.1501e5-3093.7554.500423.5026.0-0.001020190.0006212790.00240577-0.29866735.04
420123108002.70002e51.20009e5-3093.7554.500324.50186.0-0.001253660.0005465350.00226656-0.29867935.04