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
Row | ID | time | lon | lat | dep | i | j | k | etaN | uVel | vVel | theta | salt | tile |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Int64 | Int64 | Float32 | Float32 | Float32 | Float32 | Float32 | Float32 | Float32 | Float32 | Float32 | Float32 | Float32 | Int64 | |
1 | 1 | 3600 | 117500.0 | 97500.4 | -2531.25 | 24.0 | 20.0001 | 5.0 | 0.000108853 | 2.28572e-5 | 0.000293337 | -0.0995471 | 35.0 | 1 |
2 | 2 | 3600 | 137500.0 | 97500.5 | -2531.25 | 28.0 | 20.0001 | 5.0 | 0.000125795 | 1.72759e-5 | 0.00031245 | -0.0995473 | 35.0 | 1 |
3 | 3 | 3600 | 167500.0 | 97500.6 | -2531.25 | 34.0 | 20.0001 | 5.0 | 0.000176366 | -6.00037e-6 | 0.000392465 | -0.099548 | 35.0 | 1 |
4 | 21 | 3600 | 117500.0 | 97500.4 | -2531.25 | 24.0 | 20.0001 | 5.0 | 0.000108853 | 2.28572e-5 | 0.000293337 | -0.0995471 | 35.0 | 1 |
5 | 22 | 3600 | 137500.0 | 97500.5 | -2531.25 | 28.0 | 20.0001 | 5.0 | 0.000125795 | 1.72759e-5 | 0.00031245 | -0.0995473 | 35.0 | 1 |
6 | 23 | 3600 | 167500.0 | 97500.6 | -2531.25 | 34.0 | 20.0001 | 5.0 | 0.000176366 | -6.00037e-6 | 0.000392465 | -0.099548 | 35.0 | 1 |
7 | 41 | 3600 | 117500.0 | 97500.0 | -2531.25 | 24.0 | 20.0 | 5.0 | -999.0 | -999.0 | -999.0 | -999.0 | -999.0 | 1 |
8 | 42 | 3600 | 137500.0 | 97500.0 | -2531.25 | 28.0 | 20.0 | 5.0 | -999.0 | -999.0 | -999.0 | -999.0 | -999.0 | 1 |
9 | 43 | 3600 | 167500.0 | 97500.0 | -2531.25 | 34.0 | 20.0 | 5.0 | -999.0 | -999.0 | -999.0 | -999.0 | -999.0 | 1 |
10 | 61 | 3600 | 117500.0 | 97500.0 | -2531.25 | 24.0 | 20.0 | 5.0 | -999.0 | -999.0 | -999.0 | -999.0 | -999.0 | 1 |
11 | 62 | 3600 | 137500.0 | 97500.0 | -2531.25 | 28.0 | 20.0 | 5.0 | -999.0 | -999.0 | -999.0 | -999.0 | -999.0 | 1 |
12 | 63 | 3600 | 167500.0 | 97500.0 | -2531.25 | 34.0 | 20.0 | 5.0 | -999.0 | -999.0 | -999.0 | -999.0 | -999.0 | 1 |
13 | 81 | 3600 | 97500.0 | 97500.0 | -1968.75 | 20.0 | 20.0 | 4.0 | 9.8633e-5 | 2.56849e-5 | 0.000284589 | 0.0995485 | 35.0 | 1 |
⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ |
409 | 102 | 10800 | 2.0e5 | 1.59998e5 | -1406.25 | 40.5001 | 32.4996 | 3.0 | -0.00228578 | 9.15741e-5 | -0.000480871 | 0.298353 | 35.0 | 4 |
410 | 124 | 10800 | 2.70001e5 | 1.25009e5 | -3093.75 | 54.5003 | 25.5017 | 6.0 | -0.00146935 | 0.000468265 | 0.00208892 | -0.298692 | 35.0 | 4 |
411 | 125 | 10800 | 270001.0 | 1.30008e5 | -3093.75 | 54.5002 | 26.5015 | 6.0 | -0.0016641 | 0.000387549 | 0.00187627 | -0.298704 | 35.0 | 4 |
412 | 126 | 10800 | 2.70001e5 | 1.35007e5 | -3093.75 | 54.5001 | 27.5013 | 6.0 | -0.0018351 | 0.00030453 | 0.00163208 | -0.298717 | 35.0 | 4 |
413 | 127 | 10800 | 2.7e5 | 1.40006e5 | -3093.75 | 54.5001 | 28.5011 | 6.0 | -0.00197978 | 0.000218532 | 0.00135935 | -0.29873 | 35.0 | 4 |
414 | 128 | 10800 | 2.7e5 | 1.45004e5 | -3093.75 | 54.5 | 29.5009 | 6.0 | -0.00209574 | 0.000128351 | 0.00106042 | -0.298743 | 35.0 | 4 |
415 | 129 | 10800 | 2.7e5 | 1.50003e5 | -3093.75 | 54.5 | 30.5006 | 6.0 | -0.00218069 | 3.25459e-5 | 0.000736987 | -0.298755 | 35.0 | 4 |
416 | 130 | 10800 | 2.7e5 | 1.55002e5 | -3093.75 | 54.4999 | 31.5003 | 6.0 | -0.00223241 | -7.02949e-5 | 0.000390125 | -0.298767 | 35.0 | 4 |
417 | 120 | 10800 | 2.70002e5 | 1.0501e5 | -3093.75 | 54.5005 | 21.5021 | 6.0 | -0.000514093 | 0.000751799 | 0.00255706 | -0.298643 | 35.0 | 4 |
418 | 121 | 10800 | 2.70002e5 | 1.1001e5 | -3093.75 | 54.5004 | 22.502 | 6.0 | -0.000772393 | 0.000690538 | 0.00250338 | -0.298655 | 35.0 | 4 |
419 | 122 | 10800 | 2.70002e5 | 1.1501e5 | -3093.75 | 54.5004 | 23.502 | 6.0 | -0.00102019 | 0.000621279 | 0.00240577 | -0.298667 | 35.0 | 4 |
420 | 123 | 10800 | 2.70002e5 | 1.20009e5 | -3093.75 | 54.5003 | 24.5018 | 6.0 | -0.00125366 | 0.000546535 | 0.00226656 | -0.298679 | 35.0 | 4 |