Skip to content

test_def_file

Functions

all_datatypes

all_datatypes()
Source code in tests/test_def_file.py
20
21
22
@pytest.fixture
def all_datatypes():
    return _load_file("all_datatypes.def")

all_datatypes_dump

all_datatypes_dump()
Source code in tests/test_def_file.py
25
26
27
@pytest.fixture
def all_datatypes_dump():
    return _open_file("all_datatypes.def.dump")

all_datatypes_with_positions

all_datatypes_with_positions()
Source code in tests/test_def_file.py
30
31
32
@pytest.fixture
def all_datatypes_with_positions():
    return _load_file("all_datatypes.def", include_positions=True)

config_actuel

config_actuel()
Source code in tests/test_def_file.py
35
36
37
@pytest.fixture
def config_actuel():
    return _load_file("config.def_actuel.r7417")

earth_const

earth_const()
Source code in tests/test_def_file.py
40
41
42
@pytest.fixture
def earth_const():
    return _load_file("earth_const.def.r7417")

earth_const_dump

earth_const_dump()
Source code in tests/test_def_file.py
45
46
47
@pytest.fixture
def earth_const_dump():
    return _open_file("earth_const.def.r7417.dump")

earth_const_with_positions

earth_const_with_positions()
Source code in tests/test_def_file.py
50
51
52
@pytest.fixture
def earth_const_with_positions():
    return _load_file("earth_const.def.r7417", include_positions=True)

gcm_144x142_NPv63

gcm_144x142_NPv63()
Source code in tests/test_def_file.py
55
56
57
@pytest.fixture
def gcm_144x142_NPv63():
    return _load_file("gcm.def_144x142_NPv6.3.r7417")

orchidee_v22

orchidee_v22()
Source code in tests/test_def_file.py
60
61
62
@pytest.fixture
def orchidee_v22():
    return _load_file("orchidee.def_v22.r7417")

orchidee_v4

orchidee_v4()
Source code in tests/test_def_file.py
65
66
67
@pytest.fixture
def orchidee_v4():
    return _load_file("orchidee.def_v4.r7445")

physiq_NPv650

physiq_NPv650()
Source code in tests/test_def_file.py
70
71
72
@pytest.fixture
def physiq_NPv650():
    return _load_file("physiq.def_NPv6.5.0.r7417")

run_dynamico_lam_ERA5_France

run_dynamico_lam_ERA5_France()
Source code in tests/test_def_file.py
85
86
87
@pytest.fixture
def run_dynamico_lam_ERA5_France():
    return _load_file("run_dynamico_lam_ERA5_France.def.r7417")

run_dynamico_nbp60

run_dynamico_nbp60()
Source code in tests/test_def_file.py
80
81
82
@pytest.fixture
def run_dynamico_nbp60():
    return _load_file("run_dynamico.def_nbp60.r7417")

run_lmdz

run_lmdz()
Source code in tests/test_def_file.py
75
76
77
@pytest.fixture
def run_lmdz():
    return _load_file("run.def.r7417")

test_all_datatypes_dumps

test_all_datatypes_dumps(all_datatypes, all_datatypes_dump)
Source code in tests/test_def_file.py
233
234
def test_all_datatypes_dumps(all_datatypes, all_datatypes_dump):
    assert dumps(all_datatypes) == all_datatypes_dump

test_all_datatypes_dumps_loads

test_all_datatypes_dumps_loads(all_datatypes)
Source code in tests/test_def_file.py
237
238
def test_all_datatypes_dumps_loads(all_datatypes):
    assert all_datatypes == loads(dumps(all_datatypes))

test_all_datatypes_load

test_all_datatypes_load(all_datatypes)
Source code in tests/test_def_file.py
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
def test_all_datatypes_load(all_datatypes):
    assert all_datatypes == {
        "INCLUDEDEF": ["module1", "module2.def", '"module3.def"'],
        "array_floats": [3.3, 4.4, 1.3, 3.1],
        "array_integers": [1, 2, 3, 4],
        "array_mixed": [1, 10000000000.0, 13.31, "test1", "'test2'", '"test2"'],
        "array_strings": ["test1", "test2", "test3"],
        "auto": ("_AUTO_", None),
        "auto_default_float": ("_AUTO_", 0.25),
        "auto_default_integer": ("_AUTO_", 23),
        "auto_default_quoted_string": ("_AUTO_", '"some string"'),
        "auto_default_string": ("_AUTO_", "somestring"),
        "autoblocker": ("_AUTOBLOCKER_", None),
        "autoblocker_default": ("_AUTOBLOCKER_", 3.33),
        "float": 0.25,
        "float_negative": -0.25,
        "float_positive": 0.25,
        "float_scientific": 1476.48,
        "float_scientific_negative": -1476.48,
        "float_scientific_zero": 0.0,
        "integer": 23,
        "integer_negative": -23,
        "integer_positive": 23,
        "integer_zero": 0,
        "logical_false1": False,
        "logical_false2": False,
        "logical_false3": False,
        "logical_false4": False,
        "logical_false5": False,
        "logical_true1": True,
        "logical_true2": True,
        "logical_true3": True,
        "logical_true4": True,
        "logical_true5": True,
        "string": "somestring",
        "string_double_quotes": '"some string"',
        "string_single_quotes": "'some string'",
        "string_special": "_somestring123__",
    }

test_all_datatypes_load_with_positions

test_all_datatypes_load_with_positions(
    all_datatypes_with_positions,
)
Source code in tests/test_def_file.py
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
def test_all_datatypes_load_with_positions(all_datatypes_with_positions):
    assert all_datatypes_with_positions == {
        "logical_true1": {"value": True, "start_pos": 152, "end_pos": 153},
        "logical_true2": {"value": True, "start_pos": 168, "end_pos": 169},
        "logical_true3": {"value": True, "start_pos": 184, "end_pos": 188},
        "logical_true4": {"value": True, "start_pos": 203, "end_pos": 207},
        "logical_true5": {"value": True, "start_pos": 222, "end_pos": 226},
        "logical_false1": {"value": False, "start_pos": 243, "end_pos": 244},
        "logical_false2": {"value": False, "start_pos": 260, "end_pos": 261},
        "logical_false3": {"value": False, "start_pos": 277, "end_pos": 282},
        "logical_false4": {"value": False, "start_pos": 298, "end_pos": 303},
        "logical_false5": {"value": False, "start_pos": 319, "end_pos": 324},
        "integer": {"value": 23, "start_pos": 334, "end_pos": 336},
        "integer_negative": {"value": -23, "start_pos": 354, "end_pos": 357},
        "integer_positive": {"value": 23, "start_pos": 375, "end_pos": 378},
        "integer_zero": {"value": 0, "start_pos": 392, "end_pos": 393},
        "float": {"value": 0.25, "start_pos": 401, "end_pos": 405},
        "float_negative": {"value": -0.25, "start_pos": 421, "end_pos": 426},
        "float_positive": {"value": 0.25, "start_pos": 442, "end_pos": 447},
        "float_scientific": {"value": 1476.48, "start_pos": 466, "end_pos": 477},
        "float_scientific_negative": {
            "value": -1476.48,
            "start_pos": 504,
            "end_pos": 516,
        },
        "float_scientific_zero": {"value": 0.0, "start_pos": 539, "end_pos": 546},
        "string": {"value": "somestring", "start_pos": 555, "end_pos": 565},
        "string_special": {
            "value": "_somestring123__",
            "start_pos": 581,
            "end_pos": 597,
        },
        "string_single_quotes": {
            "value": "'some string'",
            "start_pos": 661,
            "end_pos": 674,
        },
        "string_double_quotes": {
            "value": '"some string"',
            "start_pos": 696,
            "end_pos": 709,
        },
        "array_integers": {"value": [1, 2, 3, 4], "start_pos": 728, "end_pos": 738},
        "array_floats": {
            "value": [3.3, 4.4, 1.3, 3.1],
            "start_pos": 754,
            "end_pos": 772,
        },
        "array_strings": {
            "value": ["test1", "test2", "test3"],
            "start_pos": 789,
            "end_pos": 808,
        },
        "array_mixed": {
            "value": [1, 10000000000.0, 13.31, "test1", "'test2'", '"test2"'],
            "start_pos": 823,
            "end_pos": 862,
        },
        "auto": {"value": ("_AUTO_", None), "start_pos": 869, "end_pos": 875},
        "auto_default_integer": {
            "value": ("_AUTO_", 23),
            "start_pos": 897,
            "end_pos": 916,
        },
        "auto_default_float": {
            "value": ("_AUTO_", 0.25),
            "start_pos": 936,
            "end_pos": 957,
        },
        "auto_default_string": {
            "value": ("_AUTO_", "somestring"),
            "start_pos": 978,
            "end_pos": 1005,
        },
        "auto_default_quoted_string": {
            "value": ("_AUTO_", '"some string"'),
            "start_pos": 1033,
            "end_pos": 1063,
        },
        "autoblocker": {
            "value": ("_AUTOBLOCKER_", None),
            "start_pos": 1077,
            "end_pos": 1090,
        },
        "autoblocker_default": {
            "value": ("_AUTOBLOCKER_", 3.33),
            "start_pos": 1111,
            "end_pos": 1137,
        },
        "INCLUDEDEF": [
            {"value": "module1", "start_pos": 11, "end_pos": 18},
            {"value": "module2.def", "start_pos": 30, "end_pos": 41},
            {"value": '"module3.def"', "start_pos": 53, "end_pos": 66},
        ],
    }

test_dynamico_earth_const_dumps

test_dynamico_earth_const_dumps(
    earth_const, earth_const_dump
)
Source code in tests/test_def_file.py
267
268
def test_dynamico_earth_const_dumps(earth_const, earth_const_dump):
    assert dumps(earth_const) == earth_const_dump

test_dynamico_earth_const_dumps_loads

test_dynamico_earth_const_dumps_loads(earth_const)
Source code in tests/test_def_file.py
271
272
def test_dynamico_earth_const_dumps_loads(earth_const):
    assert earth_const == loads(dumps(earth_const))

test_dynamico_earth_const_load

test_dynamico_earth_const_load(earth_const)
Source code in tests/test_def_file.py
241
242
243
244
245
246
247
248
249
250
251
def test_dynamico_earth_const_load(earth_const):
    assert earth_const == {
        "radius": 6.371229e6,
        "g": 9.80665,
        "omega": 7.292e-05,
        "kappa": 0.2857143,
        "cpp": 1004.70885783307,
        "preff": 101325.0,
        "scale_factor": 1.0,
        "netcdf_prec": "double",
    }

test_dynamico_earth_const_load_with_positions

test_dynamico_earth_const_load_with_positions(
    earth_const_with_positions,
)
Source code in tests/test_def_file.py
254
255
256
257
258
259
260
261
262
263
264
def test_dynamico_earth_const_load_with_positions(earth_const_with_positions):
    assert earth_const_with_positions == {
        "radius": {"value": 6371229.0, "start_pos": 50, "end_pos": 60},
        "g": {"value": 9.80665, "start_pos": 99, "end_pos": 106},
        "omega": {"value": 7.292e-05, "start_pos": 158, "end_pos": 166},
        "kappa": {"value": 0.2857143, "start_pos": 209, "end_pos": 218},
        "cpp": {"value": 1004.70885783307, "start_pos": 324, "end_pos": 340},
        "preff": {"value": 101325.0, "start_pos": 394, "end_pos": 401},
        "scale_factor": {"value": 1.0, "start_pos": 479, "end_pos": 481},
        "netcdf_prec": {"value": "double", "start_pos": 526, "end_pos": 532},
    }

test_lmdz_config_actuel_dumps_loads

test_lmdz_config_actuel_dumps_loads(config_actuel)
Source code in tests/test_def_file.py
463
464
def test_lmdz_config_actuel_dumps_loads(config_actuel):
    assert config_actuel == loads(dumps(config_actuel))

test_lmdz_config_actuel_load

test_lmdz_config_actuel_load(config_actuel)
Source code in tests/test_def_file.py
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
def test_lmdz_config_actuel_load(config_actuel):
    assert config_actuel == {
        "level_coupling_esm": ("_AUTO_", 0),
        "carbon_cycle_cpl": ("_AUTO_", False),
        "carbon_cycle_tr": ("_AUTO_", False),
        "carbon_cycle_rad": ("_AUTO_", False),
        "read_fco2_ocean_cor": ("_AUTO_", False),
        "var_fco2_ocean_cor": ("_AUTO_", 0.2576),
        "read_fco2_land_cor": ("_AUTO_", False),
        "var_fco2_land_cor": ("_AUTO_", -0.2036),
        "iflag_cycle_diurne": 1,
        "soil_model": True,
        "t_coupl": ("_AUTO_", None),
        "nbapp_rad": 16,
        "pmagic": ("_AUTO_", 0.0),
        "R_ecc": ("_AUTO_", 0.016715),
        "R_peri": ("_AUTO_", 102.7),
        "R_incl": ("_AUTO_", 23.441),
        "solaire": ("_AUTO_", 1361.20),
        "ok_suntime_rrtm": True,
        "co2_ppm": ("_AUTO_", 3.6912e02),
        "co2_ppm0": ("_AUTO_", 2.8432e02),
        "co2_ppm_per": ("_AUTO_", 14.7648e02),
        "CH4_ppb": ("_AUTO_", 1.7780e03),
        "N2O_ppb": ("_AUTO_", 3.1576e02),
        "CFC11_ppt": ("_AUTO_", 6.3990e01),
        "CFC12_ppt": ("_AUTO_", 1.0511e03),
        "ok_ade": ("_AUTO_", None),
        "ok_aie": ("_AUTO_", None),
        "aer_type": "actuel",
        "aerosol_couple": ("_AUTO_", None),
        "chemistry_couple": ("_AUTO_", None),
        "flag_aerosol": ("_AUTO_", None),
        "ok_cdnc": ("_AUTO_", None),
        "ok_alw": True,
        "read_climoz": ("_AUTO_", None),
        "flag_aerosol_strat": ("_AUTO_", 2),
        "ok_volcan": False,
        "ok_cosp": ("_AUTO_", None),
    }

test_lmdz_gcm_144x142_NPv63_dumps_loads

test_lmdz_gcm_144x142_NPv63_dumps_loads(gcm_144x142_NPv63)
Source code in tests/test_def_file.py
497
498
def test_lmdz_gcm_144x142_NPv63_dumps_loads(gcm_144x142_NPv63):
    assert gcm_144x142_NPv63 == loads(dumps(gcm_144x142_NPv63))

test_lmdz_gcm_144x142_NPv63_load

test_lmdz_gcm_144x142_NPv63_load(gcm_144x142_NPv63)
Source code in tests/test_def_file.py
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
def test_lmdz_gcm_144x142_NPv63_load(gcm_144x142_NPv63):
    assert gcm_144x142_NPv63 == {
        "day_step": 672,
        "iperiod": 7,
        "lstardis": True,
        "nitergdiv": 1,
        "nitergrot": 2,
        "niterh": 2,
        "tetagdiv": 3600.0,
        "tetagrot": 21600.0,
        "tetatemp": 10800.0,
        "coefdis": 0.0,
        "purmats": False,
        "iflag_phys": 1,
        "read_start": True,
        "iphysiq": 7,
        "clon": 0.0,
        "clat": 0.0,
        "grossismx": 1.0,
        "grossismy": 1.0,
        "fxyhypb": True,
        "dzoomx": 0.0,
        "dzoomy": 0.0,
        "taux": 3.0,
        "tauy": 3.0,
        "ysinus": True,
        "ngroup": 4,
    }

test_lmdz_physiq_NPv650_dumps_loads

test_lmdz_physiq_NPv650_dumps_loads(physiq_NPv650)
Source code in tests/test_def_file.py
684
685
def test_lmdz_physiq_NPv650_dumps_loads(physiq_NPv650):
    assert physiq_NPv650 == loads(dumps(physiq_NPv650))

test_lmdz_physiq_NPv650_load

test_lmdz_physiq_NPv650_load(physiq_NPv650)
Source code in tests/test_def_file.py
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
def test_lmdz_physiq_NPv650_load(physiq_NPv650):
    assert physiq_NPv650 == {
        "ok_limitvrai": False,
        "f_cdrag_stable": 1,
        "f_cdrag_ter": 1,
        "min_wind_speed": 0.1,
        "ifl_pbltree": 1,
        "Cd_frein": 0.016,
        "f_cdrag_oce": 1,
        "iflag_z0_oce": 1,
        "f_z0qh_oce": 1.55,
        "iflag_gusts": 2,
        "f_gust_bl": 0.845,
        "f_gust_wk": 0.2,
        "f_qsat_oce": 0.98,
        "cdmmax": 0.2,
        "cdhmax": 0.2,
        "new_yamada4": True,
        "yamada4_num": 5,
        "iflag_corr_sta": 4,
        "f_ri_cd_min": 0.01,
        "yamada4_ric": 0.18,
        "lmixmin": 0,
        "iflag_pbl": 12,
        "ksta_ter": 1e-07,
        "ksta": 1e-10,
        "ok_kzmin": False,
        "addtkeoro": 2,
        "alphatkeoro": 1,
        "smallscales_tkeoro": True,
        "nm_oro_t": 0,
        "zstd_orodr_t": 0,
        "zpmm_orodr_t": 0,
        "zpmm_orolf_t": 0,
        "ok_orodr": True,
        "ok_orolf": True,
        "f_rugoro": 0,
        "sso_gfrcri": 0.7,
        "sso_gkdrag": 0.6,
        "sso_gkwake": 0.4,
        "sso_gklift": 0.1,
        "ok_gwd_rando": True,
        "gwd_rando_ruwmax": 0.5,
        "gwd_rando_sat": 0.6,
        "gwd_front_ruwmax": 3,
        "iflag_rrtm": 1,
        "NSW": 6,
        "alb_vis_sno_lic": 0.96,
        "alb_nir_sno_lic": 0.68,
        "inertie_sno": 350,
        "iflag_sic": 1,
        "inertie_lic": 2000,
        "inertie_sic": 2000,
        "tau_gl": ("_AUTO_", 5.0),
        "iflag_albedo": 1,
        "nbapp_cv": 48,
        "ok_bad_ecmwf_thermo": False,
        "cld_lc_lsc": 0.001,
        "cld_lc_con": 0.001,
        "cld_tau_lsc": 900,
        "cld_tau_con": 900,
        "ffallv_lsc": 0.8,
        "ffallv_con": 0.8,
        "coef_eva": 0.0001,
        "iflag_evap_prec": 2,
        "t_glace_min": 243.15,
        "t_glace_max": 273.15,
        "exposant_glace": 0.5,
        "iflag_t_glace": 3,
        "iflag_ice_thermo": 1,
        "reevap_ice": False,
        "iflag_bergeron": 2,
        "iflag_fisrtilp_qsat": 4,
        "iflag_cld_th": 6,
        "fact_cldcon": 1,
        "facttemps": 0,
        "iflag_pdf": 1,
        "ok_newmicro": True,
        "iflag_ratqs": 4,
        "ratqsp0": 45000,
        "ratqsdp": 10000,
        "ratqsbas": 0.002,
        "ratqshaut": 0.4,
        "rad_froid": 35,
        "rad_chau1": 12,
        "rad_chau2": 11,
        "bl95_b0": 1.3,
        "bl95_b1": 0.2,
        "new_oliq": True,
        "oliqmax": 0.0015,
        "oicemax": 0.0015,
        "rei_min": 16,
        "rei_max": 61.29,
        "iflag_cloudth_vert": 3,
        "cloudth_vert_alpha": 0.5,
        "cloudth_vert_alpha_th": 0.5,
        "cdnc_min": 10,
        "iflag_con": 3,
        "if_ebil": 0,
        "epmax": 0.999,
        "ok_adj_ema": False,
        "iflag_clw": 0,
        "iflag_clos": 2,
        "iflag_mix": 1,
        "qqa1": 1,
        "qqa2": 0,
        "cvl_corr": 1,
        "Fmax": 0.65,
        "dpbase": -40,
        "sigdz": 0.003,
        "spfac": 0.15,
        "tau": 8000,
        "tau": 8000,
        "flag_wb": 50,
        "wbmax": 2.8,
        "ok_convstop": False,
        "tau_stop": 15000,
        "ok_intermittent": False,
        "iflag_mix_adiab": 0,
        "coef_peel": 0.25,
        "flag_epKEorig": 1,
        "elcrit": 0.0003,
        "tlcrit": -55,
        "pbcrit": 150,
        "ptcrit": 500,
        "flag_wk_check_trgl": False,
        "iflag_wk_check_trgl": 2,
        "iflag_alp_wk_cond": 1,
        "cv_flag_feed": 2,
        "ok_optim_yield": True,
        "iflag_cld_cv": 0,
        "ok_bug_cv_trac": ("_AUTO_", False),
        "ok_bug_ajs_cv": False,
        "keepbug_ice_frac": False,
        "iflag_pbl_split": 10,
        "alp_bl_k": 0.5,
        "alp_offset": 0,
        "t_top_max": 1000,
        "iflag_trig_bl": 1,
        "s_trig": 12000000,
        "tau_trig_shallow": 1200,
        "tau_trig_deep": 1200,
        "random_notrig_max": 0.99,
        "tmax_fonte_cv": 278.15,
        "iflag_clos_bl": 1,
        "stark": 0.33,
        "alpk": 0.25,
        "iflag_thermals": 18,
        "nsplit_thermals": 1,
        "tau_thermals": 0,
        "iflag_thermals_ed": 8,
        "thermals_afact": 0.666667,
        "thermals_fact_epsilon": 0.002,
        "thermals_betalpha": 0.9,
        "thermals_detr_q_coef": 0.012,
        "cloudth_sigma1s_factor": 1.1,
        "cloudth_sigma2s_factor": 0.09,
        "fact_thermals_ed_dz": 0.07,
        "iflag_thermals_optflux": 0,
        "iflag_coupl": 5,
        "seuil_inversion": -0.08,
        "iflag_thermals_closure": 2,
        "iflag_wake": 1,
        "coefgw": 4,
        "wdens_ref_o": 1e-09,
        "wdens_ref_l": 8e-12,
        "ok_adjwk": True,
        "ok_bug_gfl": False,
        "iflag_wk_profile": 1,
        "wk_pupper": 3.5,
        "wk_frac_int_delta_t": 0.75,
        "wk_delta_t_min": 0,
        "iflag_wk_new_ptop": 2,
        "ok_bug_zg_wk_pbl": False,
        "ok_bug_split_th": False,
        "iflag_ener_conserv": 10,
        "ok_conserv_q": True,
        "fl_cor_ebil": 1,
        "ok_lic_cond": True,
        "adjust_tropopause": True,
    }

test_lmdz_vert_L95_dumps_loads

test_lmdz_vert_L95_dumps_loads(vert_L95)
Source code in tests/test_def_file.py
716
717
def test_lmdz_vert_L95_dumps_loads(vert_L95):
    assert vert_L95 == loads(dumps(vert_L95))

test_lmdz_vert_L95_load

test_lmdz_vert_L95_load(vert_L95)
Source code in tests/test_def_file.py
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
def test_lmdz_vert_L95_load(vert_L95):
    assert vert_L95 == {
        "vert_sampling": "strato_custom",
        "iflag_top_bound": 2,
        "tau_top_bound": 0.0005,
        "mode_top_bound": 3,
        "llm": 95,
        "disvert": "strato_custom",
        "iflag_sponge": 2,
        "tau_sponge": 5e-4,
        "mode_sponge": 1,
        "vert_scale": 7.0,
        "vert_dzmin": 0.017,
        "vert_dzlow": 0.009,
        "vert_z0low": 2.0,
        "vert_dzmid": 1.1,
        "vert_z0mid": 6,
        "vert_h_mid": 17,
        "vert_dzhig": 10,
        "vert_z0hig": 75.0,
        "vert_h_hig": 20.0,
        "vert_prof_dissip": 1,
        "dissip_zref": 50,
        "ok_strato": True,
        "ok_hines": False,
    }

test_orchidee_v22_dumps_loads

test_orchidee_v22_dumps_loads(orchidee_v22)
Source code in tests/test_def_file.py
1014
1015
def test_orchidee_v22_dumps_loads(orchidee_v22):
    assert orchidee_v22 == loads(dumps(orchidee_v22))

test_orchidee_v22_load

test_orchidee_v22_load(orchidee_v22)
Source code in tests/test_def_file.py
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
def test_orchidee_v22_load(orchidee_v22):
    assert orchidee_v22 == {
        "ALB_BG_FILE": "alb_bg.nc",
        "ALB_BG_MODIS": True,
        "ALB_LEAF_NIR": [
            0.0,
            0.23,
            0.18,
            0.18,
            0.2,
            0.24,
            0.15,
            0.26,
            0.2,
            0.24,
            0.27,
            0.28,
            0.26,
            0.24,
            0.24,
        ],
        "ALB_LEAF_VIS": [
            0.0,
            0.04,
            0.04,
            0.04,
            0.04,
            0.03,
            0.03,
            0.03,
            0.03,
            0.06,
            0.06,
            0.06,
            0.06,
            0.06,
            0.06,
        ],
        "ALWAYS_INIT": [
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            True,
            False,
            True,
            True,
            False,
            True,
        ],
        "ATM_CO2": ("_AUTO_", 284.32),
        "CARBON_TAU_IPASSIVE": 300,
        "CARBON_TAU_ISLOW": 7,
        "CDRAG_from_GCM": True,
        "CHEMISTRY_BVOC": ("_AUTO_", False),
        "CO2_FOR_BVOC_POSSELL": False,
        "CO2_FOR_BVOC_WILKINSON": False,
        "CWRR_AKS_A0": 0.0,
        "CWRR_AKS_POWER": 0.0,
        "CWRR_NKS_A0": 0.0,
        "CWRR_NKS_POWER": 0.0,
        "DEPTH_MAX_T": 90,
        "DOWNREGULATION_CO2_BASELEVEL": 380.0,
        "DOWNREGULATION_CO2_NEW": True,
        "DO_RSOIL": False,
        "DO_WOOD_HARVEST": ("_AUTO_", True),
        "FIRE_DISABLE": True,
        "FORCE_CO2_VEG": ("_AUTO_", False),
        "FRAC_GROWTHRESP__02": 0.35,
        "FRAC_GROWTHRESP__03": 0.35,
        "FRAC_GROWTHRESP__04": 0.28,
        "FRAC_GROWTHRESP__05": 0.28,
        "FRAC_GROWTHRESP__06": 0.28,
        "FRAC_GROWTHRESP__07": 0.35,
        "FRAC_GROWTHRESP__08": 0.35,
        "FRAC_GROWTHRESP__09": 0.35,
        "FRAC_GROWTHRESP__10": 0.28,
        "FRAC_GROWTHRESP__11": 0.28,
        "FRAC_GROWTHRESP__12": 0.28,
        "FRAC_GROWTHRESP__13": 0.28,
        "FRAC_GROWTHRESP__14": 0.35,
        "FRAC_GROWTHRESP__15": 0.35,
        "HYDROL_CWRR": True,
        "LAI_MAP": ("_AUTO_", False),
        "LAI_MAX__02": 7.0,
        "LAI_MAX__03": 5.0,
        "LAI_MAX__04": 5.0,
        "LAI_MAX__05": 4.0,
        "LAI_MAX__06": 5.0,
        "LAI_MAX__07": 3.5,
        "LAI_MAX__08": 4.0,
        "LAI_MAX__09": 3.0,
        "LAI_MAX__10": 2.5,
        "LAI_MAX__11": 2.0,
        "LAI_MAX__12": 5.0,
        "LAI_MAX__13": 5.0,
        "LAI_MAX__14": 2.5,
        "LAI_MAX__15": 2.0,
        "MAINT_RESP_SLOPE_C__02": 0.12,
        "MAINT_RESP_SLOPE_C__03": 0.12,
        "MAINT_RESP_SLOPE_C__04": 0.16,
        "MAINT_RESP_SLOPE_C__05": 0.16,
        "MAINT_RESP_SLOPE_C__06": 0.16,
        "MAINT_RESP_SLOPE_C__07": 0.25,
        "MAINT_RESP_SLOPE_C__08": 0.25,
        "MAINT_RESP_SLOPE_C__09": 0.25,
        "MAINT_RESP_SLOPE_C__10": 0.16,
        "MAINT_RESP_SLOPE_C__11": 0.12,
        "MAINT_RESP_SLOPE_C__12": 0.16,
        "MAINT_RESP_SLOPE_C__13": 0.12,
        "MAINT_RESP_SLOPE_C__14": 0.12,
        "MAINT_RESP_SLOPE_C__15": 0.25,
        "NVM": 15,
        "OK_EXPLICITSNOW": True,
        "OK_FREEZE": True,
        "PFT_NAME__10": "'temperate C3           grass      '",
        "PFT_NAME__14": "'tropical  C3           grass      '",
        "PFT_NAME__15": "'boreal    C3           grass      '",
        "PFT_TO_MTC": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 10, 10],
        "PRINTLEV": 1,
        "READ_REFTEMP": True,
        "RIVER_DESC": ("_AUTO_", None),
        "RIVER_ROUTING": ("_AUTO_", None),
        "ROUGH_DYN": True,
        "ROUTING_METHOD": ("_AUTO_", None),
        "SECHIBA_QSINT": 0.02,
        "SECHIBA_reset_time": True,
        "SECHIBA_restart_in": ("_AUTOBLOCKER_", None),
        "SNOWA_AGED_NIR": [
            0.5,
            0,
            0,
            0.1,
            0.37,
            0.08,
            0.16,
            0.17,
            0.27,
            0.44,
            0.44,
            0.44,
            0.44,
            0.44,
            0.44,
        ],
        "SNOWA_AGED_VIS": [
            0.74,
            0,
            0,
            0.08,
            0.24,
            0.07,
            0.18,
            0.18,
            0.33,
            0.57,
            0.57,
            0.57,
            0.57,
            0.57,
            0.57,
        ],
        "SNOWA_DEC_NIR": [
            0.13,
            0,
            0,
            0.1,
            0.1,
            0.16,
            0.04,
            0.07,
            0.08,
            0.12,
            0.12,
            0.12,
            0.12,
            0.12,
            0.12,
        ],
        "SNOWA_DEC_VIS": [
            0.21,
            0,
            0,
            0.14,
            0.08,
            0.17,
            0.05,
            0.06,
            0.09,
            0.15,
            0.15,
            0.15,
            0.15,
            0.15,
            0.15,
        ],
        "SOILALB_FILE": "soilcolor.nc",
        "SOILCLASS_FILE": "soils_param.nc",
        "SOILTYPE_CLASSIF": "zobler",
        "STOMATE_OK_CO2": True,
        "STOMATE_OK_STOMATE": ("_AUTOBLOCKER_", None),
        "STOMATE_RESTART_FILEIN": ("_AUTOBLOCKER_", None),
        "STRESS_GM": [
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
        ],
        "STRESS_GS": [
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
        ],
        "STRESS_VCMAX": [
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
            1.0,
        ],
        "TCST_SNOWA": 10.0,
        "VCMAX25__02": 45.0,
        "VCMAX25__03": 45.0,
        "VCMAX25__04": 35.0,
        "VCMAX25__05": 40.0,
        "VCMAX25__06": 50.0,
        "VCMAX25__07": 45.0,
        "VCMAX25__08": 35.0,
        "VCMAX25__09": 35.0,
        "VCMAX25__10": 50.0,
        "VCMAX25__11": 50.0,
        "VCMAX25__12": 60.0,
        "VCMAX25__13": 60.0,
        "VCMAX25__14": 50.0,
        "VCMAX25__15": 40.0,
        "VEGET_UPDATE": ("_AUTO_", None),
        "WETNESS_TRANSPIR_MAX": [
            0.8,
            0.8,
            0.8,
            0.8,
            0.8,
            0.8,
            0.8,
            0.8,
            0.8,
            0.8,
            0.8,
            0.8,
            0.8,
        ],
        "WRITE_STEP": 0,
        "XIOS_ORCHIDEE_OK": True,
    }

test_orchidee_v4_dumps_loads

test_orchidee_v4_dumps_loads(orchidee_v4)
Source code in tests/test_def_file.py
1082
1083
def test_orchidee_v4_dumps_loads(orchidee_v4):
    assert orchidee_v4 == loads(dumps(orchidee_v4))

test_orchidee_v4_load

test_orchidee_v4_load(orchidee_v4)
Source code in tests/test_def_file.py
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
def test_orchidee_v4_load(orchidee_v4):
    assert orchidee_v4 == {
        "ALB_BG_FILE": "alb_bg.nc",
        "ALB_BG_MODIS": True,
        "ATM_CO2": ("_AUTO_", 284.32),
        "CHEMISTRY_BVOC": ("_AUTO_", False),
        "CNLEAF_VAR": "CN_LEAF",
        "CO2_FOR_BVOC_POSSELL": False,
        "CO2_FOR_BVOC_WILKINSON": False,
        "ENERGY_CONTROL": 2,
        "ERR_ACT": 1,
        "FORCE_CO2_VEG": ("_AUTO_", False),
        "FR_CENTER_C": -1.0,
        "HACK_KB_M1": True,
        "HACK_PWC_H": True,
        "IMPOSE_VEG": False,
        "NCIRC": 3,
        "NINPUT_UPDATE": ("_AUTO_", None),
        "NSNOW": 12,
        "Nammonium_FILE": "Nammonium.nc",
        "Nammonium_VAR": "nhx",
        "Nbnf_FILE": "bnf.nc",
        "Nbnf_VAR": "BNF_MGN_PERM2_PERYR",
        "Nfert_ammo_cropland_FILE": "Nfert_ammo_cropland.nc",
        "Nfert_ammo_cropland_VAR": "nfer_crop_nh4",
        "Nfert_ammo_pasture_FILE": "Nfert_ammo_pasture.nc",
        "Nfert_ammo_pasture_VAR": "nfer_pas_nh4",
        "Nfert_nitr_cropland_FILE": "Nfert_nitr_cropland.nc",
        "Nfert_nitr_cropland_VAR": "nfer_crop_no3",
        "Nfert_nitr_pasture_FILE": "Nfert_nitr_pasture.nc",
        "Nfert_nitr_pasture_VAR": "nfer_pas_no3",
        "Nnitrate_FILE": "Nnitrate.nc",
        "Nnitrate_VAR": "noy",
        "OK_EXPLICITSNOW": True,
        "OK_FREEZE": True,
        "OK_READ_FM_MAP": True,
        "PRINTLEV": 1,
        "RATIO_Z0M_Z0H": 10.0,
        "RIVER_DESC": ("_AUTO_", None),
        "RIVER_ROUTING": ("_AUTO_", None),
        "ROUGH_DYN": True,
        "ROUTING_METHOD": ("_AUTO_", None),
        "RSOIL_SCALE": 1.0,
        "SECHIBA_restart_in": ("_AUTOBLOCKER_", None),
        "SOILALB_FILE": "soilcolor.nc",
        "SOILTYPE_CLASSIF": "usda",
        "SPINUP_ANALYTIC": False,
        "SPINUP_PERIOD": 10,
        "STOMATE_IMPOSE_CN": ("_AUTO_", None),
        "STOMATE_OK_STOMATE": ("_AUTOBLOCKER_", None),
        "STOMATE_READ_CN": False,
        "STOMATE_RESTART_FILEIN": ("_AUTOBLOCKER_", None),
        "TCST_SNOWA": 15.0,
        "TEST_ALB_RT_BGSNOWBARE": True,
        "TEST_GRID": 1,
        "TEST_PFT": 2,
        "USE_RATIO_Z0M_Z0H": True,
        "USE_SOILC_INSULATION": True,
        "VEGETMAP_RESET": ("_AUTO_", None),
        "VEGET_UPDATE": ("_AUTO_", None),
        "XIOS_ORCHIDEE_OK": True,
    }

test_run_dynamico_lam_ERA5_France_dumps_loads

test_run_dynamico_lam_ERA5_France_dumps_loads(
    run_dynamico_lam_ERA5_France,
)
Source code in tests/test_def_file.py
417
418
def test_run_dynamico_lam_ERA5_France_dumps_loads(run_dynamico_lam_ERA5_France):
    assert run_dynamico_lam_ERA5_France == loads(dumps(run_dynamico_lam_ERA5_France))

test_run_dynamico_lam_ERA5_France_load

test_run_dynamico_lam_ERA5_France_load(
    run_dynamico_lam_ERA5_France,
)
Source code in tests/test_def_file.py
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
def test_run_dynamico_lam_ERA5_France_load(run_dynamico_lam_ERA5_France):
    assert run_dynamico_lam_ERA5_France == {
        "mpi_threading_mode": "funneled",
        "metric_type": "icosa_area",
        "area_center_lon": 3,
        "area_center_lat": 47,
        "area_radius": 800,
        "PS_relax_out": 3600,
        "T_relax_out": 3600,
        "U_relax_out": 3600,
        "Q_relax_out": 3600,
        "nudging_vertical_levels": "pressure",
        "guided_type": ("_AUTO_", None),
        "itau_nudging": 120,
        "nudging_zone": "area",
        "nudging_stiffness": 8,
        "nbp": 40,
        "nsplit_i": 4,
        "nsplit_j": 4,
        "omp_level_size": ("_AUTOBLOCKER_", None),
        "read_metric": False,
        "optim_it": 0,
        "dt": 30.0,
        "itau_adv": 1,
        "run_length": ("_AUTOBLOCKER_", None),
        "etat0_start_iteration_reset": ("_AUTOBLOCKER_", None),
        "write_period": 10800,
        "itau_check_conserv": 100,
        "nqtot": ("_AUTO_", 4),
        "out_pression_level": 85000,
        "start_file_name": "start",
        "restart_file_name": "restart",
        "using_oasis": ("_AUTOBLOCKER_", None),
        "tau_graddiv": 3600,
        "nitergdiv": 1,
        "tau_gradrot": 21600,
        "nitergrot": 2,
        "tau_divgrad": 10800,
        "niterdivgrad": 2,
        "physics": "phys_external",
        "itau_physics": 30,
        "create_etat0_limit": ("_AUTO_", None),
        "etat0": ("_AUTO_", None),
        "etat0_database_type": "ERA5_forcing",
        "iflag_phys": ("_AUTO_", None),
        "param_gw_method": "legacy",
        "heldsz_p0": 101080,
    }

test_run_dynamico_nbp60_dumps_loads

test_run_dynamico_nbp60_dumps_loads(run_dynamico_nbp60)
Source code in tests/test_def_file.py
363
364
def test_run_dynamico_nbp60_dumps_loads(run_dynamico_nbp60):
    assert run_dynamico_nbp60 == loads(dumps(run_dynamico_nbp60))

test_run_dynamico_nbp60_load

test_run_dynamico_nbp60_load(run_dynamico_nbp60)
Source code in tests/test_def_file.py
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
def test_run_dynamico_nbp60_load(run_dynamico_nbp60):
    assert run_dynamico_nbp60 == {
        "metric_type": "icosa_global",
        "guided_type": ("_AUTO_", None),
        "itau_nudging": 48,
        "nudging_zone": "global",
        "U_relax_in": 21600,
        "PS_relax_in": 1e30,
        "T_relax_in": 1e30,
        "Q_relax_in": 1e30,
        "guide_U": True,
        "mpi_threading_mode": "funneled",
        "nbp": 60,
        "nsplit_i": 6,
        "nsplit_j": 6,
        "omp_level_size": ("_AUTOBLOCKER_", None),
        "read_metric": ("_AUTO_", None),
        "optim_it": ("_AUTO_", None),
        "dt": 150.0,
        "itau_adv": 1,
        "run_length": ("_AUTOBLOCKER_", None),
        "etat0_start_iteration_reset": ("_AUTOBLOCKER_", None),
        "write_period": 86400,
        "itau_check_conserv": 100,
        "nqtot": ("_AUTO_", 4),
        "out_pression_level": 85000,
        "start_file_name": "start",
        "restart_file_name": "restart",
        "using_oasis": ("_AUTOBLOCKER_", None),
        "tau_graddiv": 2400,
        "nitergdiv": 1,
        "tau_gradrot": 14400,
        "nitergrot": 2,
        "tau_divgrad": 7200,
        "niterdivgrad": 2,
        "physics": "phys_external",
        "itau_physics": 6,
        "create_etat0_limit": ("_AUTO_", None),
        "etat0": ("_AUTO_", None),
        "iflag_phys": ("_AUTO_", None),
        "param_gw_method": "legacy",
        "heldsz_p0": 101080,
    }

test_run_lmdz_dumps_loads

test_run_lmdz_dumps_loads(run_lmdz)
Source code in tests/test_def_file.py
314
315
def test_run_lmdz_dumps_loads(run_lmdz):
    assert run_lmdz == loads(dumps(run_lmdz))

test_run_lmdz_load

test_run_lmdz_load(run_lmdz)
Source code in tests/test_def_file.py
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
def test_run_lmdz_load(run_lmdz):
    assert run_lmdz == {
        "INCLUDEDEF": [
            "run_dynamico.def",
            "earth_const.def",
            "physiq.def",
            "gcm.def",
            "vert.def",
            "orchidee.def",
            "orchidee_pft.def",
            "config.def",
            "reprobus.def",
            "guide.def",
            "inca.def",
        ],
        "VEGET": ("_AUTOBLOCKER_", None),
        "adjust": False,
        "anneeref": ("_AUTOBLOCKER_", None),
        "calend": ("_AUTOBLOCKER_", None),
        "config_inca": ("_AUTOBLOCKER_", None),
        "cpl_current": True,
        "cpl_old_calving": ("_AUTO_", None),
        "dayref": ("_AUTOBLOCKER_", None),
        "iconser": 240,
        "iecri": 1,
        "iflag_phytrac": ("_AUTOBLOCKER_", 0),
        "nday": ("_AUTOBLOCKER_", None),
        "no_ter_antartique": True,
        "ok_all_xml": True,
        "ok_dynzon": False,
        "prt_level": 0,
        "raz_date": ("_AUTOBLOCKER_", None),
        "type_ocean": ("_AUTOBLOCKER_", None),
        "type_trac": ("_AUTOBLOCKER_", None),
        "use_filtre_fft": True,
        "version_ocean": "nemo",
    }

vert_L95

vert_L95()
Source code in tests/test_def_file.py
90
91
92
@pytest.fixture
def vert_L95():
    return _load_file("vert.def_L95.r7417")