Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solve grid mean equations explicitly #343

Merged
merged 1 commit into from
Oct 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions integration_tests/utils/generate_namelist.jl
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ function default_namelist(case_name::String)
namelist_defaults["thermodynamics"]["quadrature_type"] = "log-normal" #"gaussian" or "log-normal"

namelist_defaults["time_stepping"] = Dict()
namelist_defaults["time_stepping"]["dt"] = 10.0
namelist_defaults["time_stepping"]["dt"] = 6.0

namelist_defaults["microphysics"] = Dict()
namelist_defaults["microphysics"]["rain_model"] = "None"
Expand Down Expand Up @@ -196,6 +196,7 @@ function Soares(namelist_defaults)
namelist["grid"]["dz"] = 50.0

namelist["time_stepping"]["t_max"] = 8 * 3600.0
namelist["time_stepping"]["dt"] = 2.0

namelist["meta"]["simname"] = "Soares"
namelist["meta"]["casename"] = "Soares"
Expand All @@ -211,6 +212,7 @@ function Nieuwstadt(namelist_defaults)
namelist["grid"]["dz"] = 50.0

namelist["time_stepping"]["t_max"] = 8 * 3600.0
namelist["time_stepping"]["dt"] = 2.0

namelist["meta"]["simname"] = "Nieuwstadt"
namelist["meta"]["casename"] = "Nieuwstadt"
Expand Down Expand Up @@ -294,6 +296,7 @@ function ARM_SGP(namelist_defaults)
namelist["grid"]["dz"] = 50.0

namelist["time_stepping"]["t_max"] = 3600.0 * 14.5
namelist["time_stepping"]["dt"] = 5.0
namelist["meta"]["simname"] = "ARM_SGP"
namelist["meta"]["casename"] = "ARM_SGP"

Expand Down Expand Up @@ -324,6 +327,7 @@ function DYCOMS_RF01(namelist_defaults)
namelist["grid"]["dz"] = 50

namelist["time_stepping"]["t_max"] = 60 * 60 * 16.0
namelist["time_stepping"]["dt"] = 6.0
namelist["meta"]["simname"] = "DYCOMS_RF01"
namelist["meta"]["casename"] = "DYCOMS_RF01"

Expand Down Expand Up @@ -351,11 +355,11 @@ function SP(namelist_defaults)
namelist["meta"]["casename"] = "SP"

# this case is resolution dependent, we should check why
namelist["grid"]["nz"] = 256
namelist["grid"]["dz"] = 8
namelist["grid"]["nz"] = 64
namelist["grid"]["dz"] = 32

namelist["time_stepping"]["t_max"] = 7200.0
namelist["time_stepping"]["dt"] = 3.0
namelist["time_stepping"]["dt"] = 1.0
namelist["meta"]["simname"] = "SP"
namelist["meta"]["casename"] = "SP"

Expand All @@ -375,6 +379,7 @@ function DryBubble(namelist_defaults)

namelist["stats_io"]["frequency"] = 10.0
namelist["time_stepping"]["t_max"] = 1000.0
namelist["time_stepping"]["dt"] = 6.0
namelist["meta"]["simname"] = "DryBubble"
namelist["meta"]["casename"] = "DryBubble"

Expand All @@ -389,7 +394,7 @@ function LES_driven_SCM(namelist_defaults)
namelist["grid"]["nz"] = 200

namelist["stats_io"]["frequency"] = 10.0
namelist["time_stepping"]["dt"] = 5.0
namelist["time_stepping"]["dt"] = 3.0
namelist["time_stepping"]["t_max"] = 3600.0 * 12

namelist["meta"]["lesfile"] =
Expand Down
236 changes: 118 additions & 118 deletions integration_tests/utils/mse_tables.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,144 +5,144 @@
all_best_mse = OrderedDict()
#
all_best_mse["ARM_SGP"] = OrderedDict()
all_best_mse["ARM_SGP"]["qt_mean"] = 0.3209542546606794
all_best_mse["ARM_SGP"]["updraft_area"] = 340.65140381176064
all_best_mse["ARM_SGP"]["updraft_w"] = 157.87446432503418
all_best_mse["ARM_SGP"]["updraft_qt"] = 29.518518489348367
all_best_mse["ARM_SGP"]["updraft_thetal"] = 170.9770207379274
all_best_mse["ARM_SGP"]["u_mean"] = 5.762470982857273e8
all_best_mse["ARM_SGP"]["tke_mean"] = 1001.0595560376108
all_best_mse["ARM_SGP"]["temperature_mean"] = 0.0001470066691944856
all_best_mse["ARM_SGP"]["ql_mean"] = 228.98620338102327
all_best_mse["ARM_SGP"]["thetal_mean"] = 0.00013834194937665118
all_best_mse["ARM_SGP"]["Hvar_mean"] = 480.8116272326762
all_best_mse["ARM_SGP"]["QTvar_mean"] = 188.88775541726022
all_best_mse["ARM_SGP"]["qt_mean"] = 0.26421363773114487
all_best_mse["ARM_SGP"]["updraft_area"] = 342.0522312617839
all_best_mse["ARM_SGP"]["updraft_w"] = 148.13571351377792
all_best_mse["ARM_SGP"]["updraft_qt"] = 28.944904740159764
all_best_mse["ARM_SGP"]["updraft_thetal"] = 170.98088348120865
all_best_mse["ARM_SGP"]["u_mean"] = 5.762470982857257e8
all_best_mse["ARM_SGP"]["tke_mean"] = 987.4335390129128
all_best_mse["ARM_SGP"]["temperature_mean"] = 0.00012055550990238811
all_best_mse["ARM_SGP"]["ql_mean"] = 205.76908838933457
all_best_mse["ARM_SGP"]["thetal_mean"] = 0.00011125982667316287
all_best_mse["ARM_SGP"]["Hvar_mean"] = 2842.0863157999497
all_best_mse["ARM_SGP"]["QTvar_mean"] = 1642.635677320087
#
all_best_mse["Bomex"] = OrderedDict()
all_best_mse["Bomex"]["qt_mean"] = 0.10207607899672161
all_best_mse["Bomex"]["updraft_area"] = 130.65437082730938
all_best_mse["Bomex"]["updraft_w"] = 18.509499509732102
all_best_mse["Bomex"]["updraft_qt"] = 6.525693304537803
all_best_mse["Bomex"]["updraft_thetal"] = 69.4615627157949
all_best_mse["Bomex"]["v_mean"] = 64.1436235173287
all_best_mse["Bomex"]["u_mean"] = 2250.073116158956
all_best_mse["Bomex"]["tke_mean"] = 55.259994933864725
all_best_mse["Bomex"]["temperature_mean"] = 4.1823946641424295e-5
all_best_mse["Bomex"]["ql_mean"] = 9.47122227590953
all_best_mse["Bomex"]["thetal_mean"] = 4.233035463783991e-5
all_best_mse["Bomex"]["Hvar_mean"] = 1282.4611055024627
all_best_mse["Bomex"]["QTvar_mean"] = 478.51986192655914
all_best_mse["Bomex"]["qt_mean"] = 0.11034670891224195
all_best_mse["Bomex"]["updraft_area"] = 132.0788865649432
all_best_mse["Bomex"]["updraft_w"] = 18.392509423445038
all_best_mse["Bomex"]["updraft_qt"] = 6.288835389580369
all_best_mse["Bomex"]["updraft_thetal"] = 69.45747637501809
all_best_mse["Bomex"]["v_mean"] = 66.15195917633564
all_best_mse["Bomex"]["u_mean"] = 2244.359495472965
all_best_mse["Bomex"]["tke_mean"] = 55.75185915047925
all_best_mse["Bomex"]["temperature_mean"] = 4.3858868869668704e-5
all_best_mse["Bomex"]["ql_mean"] = 8.228711881484596
all_best_mse["Bomex"]["thetal_mean"] = 4.448304470557014e-5
all_best_mse["Bomex"]["Hvar_mean"] = 4019.5984832795702
all_best_mse["Bomex"]["QTvar_mean"] = 1505.300250338699
#
all_best_mse["DryBubble"] = OrderedDict()
all_best_mse["DryBubble"]["updraft_area"] = 0.0
all_best_mse["DryBubble"]["updraft_w"] = 0.0
all_best_mse["DryBubble"]["updraft_thetal"] = 0.0
all_best_mse["DryBubble"]["u_mean"] = 0.0
all_best_mse["DryBubble"]["tke_mean"] = 0.0
all_best_mse["DryBubble"]["temperature_mean"] = 0.0
all_best_mse["DryBubble"]["thetal_mean"] = 0.0
all_best_mse["DryBubble"]["Hvar_mean"] = 0.0
all_best_mse["DryBubble"]["updraft_area"] = 1.4799637943136015
all_best_mse["DryBubble"]["updraft_w"] = 0.5971783111955326
all_best_mse["DryBubble"]["updraft_thetal"] = 1.3263944156646987e-7
all_best_mse["DryBubble"]["u_mean"] = 5.0284827141735486e-29
all_best_mse["DryBubble"]["tke_mean"] = 36.095720193263155
all_best_mse["DryBubble"]["temperature_mean"] = 4.4825217266510774e-7
all_best_mse["DryBubble"]["thetal_mean"] = 2.2169485793143537e-7
all_best_mse["DryBubble"]["Hvar_mean"] = 2.1469799118558727e-8
#
all_best_mse["DYCOMS_RF01"] = OrderedDict()
all_best_mse["DYCOMS_RF01"]["qt_mean"] = 0.030903964784675216
all_best_mse["DYCOMS_RF01"]["ql_mean"] = 1.5155792412982982
all_best_mse["DYCOMS_RF01"]["updraft_area"] = 31.220391677878165
all_best_mse["DYCOMS_RF01"]["updraft_w"] = 5.760527532978497
all_best_mse["DYCOMS_RF01"]["updraft_qt"] = 1.7540072931352435
all_best_mse["DYCOMS_RF01"]["updraft_thetal"] = 46.18618448372134
all_best_mse["DYCOMS_RF01"]["v_mean"] = 18996.859750270294
all_best_mse["DYCOMS_RF01"]["u_mean"] = 74749.3281320331
all_best_mse["DYCOMS_RF01"]["tke_mean"] = 18.445196342843182
all_best_mse["DYCOMS_RF01"]["temperature_mean"] = 0.00014609672928103247
all_best_mse["DYCOMS_RF01"]["thetal_mean"] = 0.00014697301399216027
all_best_mse["DYCOMS_RF01"]["Hvar_mean"] = 1241.054423331865
all_best_mse["DYCOMS_RF01"]["QTvar_mean"] = 490.2420331091086
all_best_mse["DYCOMS_RF01"]["qt_mean"] = 0.04296283701093193
all_best_mse["DYCOMS_RF01"]["ql_mean"] = 0.9002624413249023
all_best_mse["DYCOMS_RF01"]["updraft_area"] = 31.587329122184922
all_best_mse["DYCOMS_RF01"]["updraft_w"] = 5.415162673665433
all_best_mse["DYCOMS_RF01"]["updraft_qt"] = 1.7094903825460446
all_best_mse["DYCOMS_RF01"]["updraft_thetal"] = 46.18596979134379
all_best_mse["DYCOMS_RF01"]["v_mean"] = 18999.209476532847
all_best_mse["DYCOMS_RF01"]["u_mean"] = 74763.82069231402
all_best_mse["DYCOMS_RF01"]["tke_mean"] = 18.834055670931797
all_best_mse["DYCOMS_RF01"]["temperature_mean"] = 0.000162908076455199
all_best_mse["DYCOMS_RF01"]["thetal_mean"] = 0.00016385194888958462
all_best_mse["DYCOMS_RF01"]["Hvar_mean"] = 1226.9562157344662
all_best_mse["DYCOMS_RF01"]["QTvar_mean"] = 476.7889656276658
#
all_best_mse["GABLS"] = OrderedDict()
all_best_mse["GABLS"]["updraft_thetal"] = 0.0
all_best_mse["GABLS"]["v_mean"] = 0.0
all_best_mse["GABLS"]["u_mean"] = 0.0
all_best_mse["GABLS"]["tke_mean"] = 0.0
all_best_mse["GABLS"]["temperature_mean"] = 0.0
all_best_mse["GABLS"]["thetal_mean"] = 0.0
all_best_mse["GABLS"]["Hvar_mean"] = 0.0
all_best_mse["GABLS"]["QTvar_mean"] = 0.0
all_best_mse["GABLS"]["updraft_thetal"] = 1.7836091397581662e-11
all_best_mse["GABLS"]["v_mean"] = 1.1964954031328427e-5
all_best_mse["GABLS"]["u_mean"] = 8.63469510859231e-8
all_best_mse["GABLS"]["tke_mean"] = 6.417801625474837e-6
all_best_mse["GABLS"]["temperature_mean"] = 1.7538826825717998e-11
all_best_mse["GABLS"]["thetal_mean"] = 1.111385971285917e-11
all_best_mse["GABLS"]["Hvar_mean"] = 4.965501468174674e-6
all_best_mse["GABLS"]["QTvar_mean"] = 3.869182692980235e-6
#
all_best_mse["life_cycle_Tan2018"] = OrderedDict()
all_best_mse["life_cycle_Tan2018"]["qt_mean"] = 1.9318188479656425e-7
all_best_mse["life_cycle_Tan2018"]["ql_mean"] = 0.0008456911547173455
all_best_mse["life_cycle_Tan2018"]["updraft_area"] = 0.0010716616835207747
all_best_mse["life_cycle_Tan2018"]["updraft_w"] = 0.0032190599664453116
all_best_mse["life_cycle_Tan2018"]["updraft_qt"] = 0.010833328702039614
all_best_mse["life_cycle_Tan2018"]["updraft_thetal"] = 6.430085792119167e-6
all_best_mse["life_cycle_Tan2018"]["v_mean"] = 1.5207825307066974e-5
all_best_mse["life_cycle_Tan2018"]["u_mean"] = 3.7291651500287595e-8
all_best_mse["life_cycle_Tan2018"]["tke_mean"] = 4.5068923511154894e-5
all_best_mse["life_cycle_Tan2018"]["temperature_mean"] = 9.7305238461242e-11
all_best_mse["life_cycle_Tan2018"]["thetal_mean"] = 6.877977363260781e-11
all_best_mse["life_cycle_Tan2018"]["Hvar_mean"] = 0.5904994448272346
all_best_mse["life_cycle_Tan2018"]["QTvar_mean"] = 0.4433374645562033
all_best_mse["life_cycle_Tan2018"]["qt_mean"] = 0.002765847255140167
all_best_mse["life_cycle_Tan2018"]["ql_mean"] = 1.8411503562984726
all_best_mse["life_cycle_Tan2018"]["updraft_area"] = 0.8863501501906347
all_best_mse["life_cycle_Tan2018"]["updraft_w"] = 0.47403139982327686
all_best_mse["life_cycle_Tan2018"]["updraft_qt"] = 0.0013467655617395333
all_best_mse["life_cycle_Tan2018"]["updraft_thetal"] = 5.727396841450201e-7
all_best_mse["life_cycle_Tan2018"]["v_mean"] = 0.6079754009654996
all_best_mse["life_cycle_Tan2018"]["u_mean"] = 0.010279010424175316
all_best_mse["life_cycle_Tan2018"]["tke_mean"] = 0.41881798665899767
all_best_mse["life_cycle_Tan2018"]["temperature_mean"] = 1.5421325561891456e-6
all_best_mse["life_cycle_Tan2018"]["thetal_mean"] = 1.5156178965968648e-6
all_best_mse["life_cycle_Tan2018"]["Hvar_mean"] = 3070.715059898344
all_best_mse["life_cycle_Tan2018"]["QTvar_mean"] = 2542.98820651888
#
all_best_mse["Nieuwstadt"] = OrderedDict()
all_best_mse["Nieuwstadt"]["updraft_area"] = 109.37267631499536
all_best_mse["Nieuwstadt"]["updraft_w"] = 13.975905834637413
all_best_mse["Nieuwstadt"]["updraft_thetal"] = 117.36641168262074
all_best_mse["Nieuwstadt"]["u_mean"] = 56.657063854913254
all_best_mse["Nieuwstadt"]["tke_mean"] = 201.9964273125944
all_best_mse["Nieuwstadt"]["temperature_mean"] = 1.108208428357535e-5
all_best_mse["Nieuwstadt"]["thetal_mean"] = 1.1158960544908172e-5
all_best_mse["Nieuwstadt"]["Hvar_mean"] = 1138.519348358527
all_best_mse["Nieuwstadt"]["updraft_area"] = 110.28782105496978
all_best_mse["Nieuwstadt"]["updraft_w"] = 12.26317974116457
all_best_mse["Nieuwstadt"]["updraft_thetal"] = 117.36703137627268
all_best_mse["Nieuwstadt"]["u_mean"] = 57.02725806954108
all_best_mse["Nieuwstadt"]["tke_mean"] = 218.35258534485868
all_best_mse["Nieuwstadt"]["temperature_mean"] = 9.778248933574433e-6
all_best_mse["Nieuwstadt"]["thetal_mean"] = 1.0084674832432465e-5
all_best_mse["Nieuwstadt"]["Hvar_mean"] = 1249.5099954097193
#
all_best_mse["Rico"] = OrderedDict()
all_best_mse["Rico"]["qt_mean"] = 1.1387724162205806
all_best_mse["Rico"]["updraft_area"] = 480.64591910121953
all_best_mse["Rico"]["updraft_w"] = 89.31287575141504
all_best_mse["Rico"]["updraft_qt"] = 11.777122740698896
all_best_mse["Rico"]["updraft_thetal"] = 132.82542757227864
all_best_mse["Rico"]["v_mean"] = 23887.454465852534
all_best_mse["Rico"]["u_mean"] = 166.318722047005
all_best_mse["Rico"]["tke_mean"] = 87.06867707615511
all_best_mse["Rico"]["temperature_mean"] = 0.0005517106013089126
all_best_mse["Rico"]["ql_mean"] = 62.06876273234607
all_best_mse["Rico"]["qr_mean"] = 750.7966083988404
all_best_mse["Rico"]["thetal_mean"] = 0.0005449556916546474
all_best_mse["Rico"]["Hvar_mean"] = 16685.29151149484
all_best_mse["Rico"]["QTvar_mean"] = 3656.4881996738177
all_best_mse["Rico"]["qt_mean"] = 1.340071722331204
all_best_mse["Rico"]["updraft_area"] = 483.32342394154523
all_best_mse["Rico"]["updraft_w"] = 104.70774760907152
all_best_mse["Rico"]["updraft_qt"] = 11.430916122240632
all_best_mse["Rico"]["updraft_thetal"] = 132.81209450880542
all_best_mse["Rico"]["v_mean"] = 23890.095594659044
all_best_mse["Rico"]["u_mean"] = 167.07185707094393
all_best_mse["Rico"]["tke_mean"] = 82.98089042594096
all_best_mse["Rico"]["temperature_mean"] = 0.0006056771446766046
all_best_mse["Rico"]["ql_mean"] = 65.27357690604627
all_best_mse["Rico"]["qr_mean"] = 750.7117185237603
all_best_mse["Rico"]["thetal_mean"] = 0.0005972061066200803
all_best_mse["Rico"]["Hvar_mean"] = 18491.001287100313
all_best_mse["Rico"]["QTvar_mean"] = 4006.1320996668273
#
all_best_mse["Soares"] = OrderedDict()
all_best_mse["Soares"]["qt_mean"] = 0.14555076579192458
all_best_mse["Soares"]["updraft_area"] = 106.74391463306462
all_best_mse["Soares"]["updraft_w"] = 12.999263506546061
all_best_mse["Soares"]["updraft_qt"] = 23.139463339193593
all_best_mse["Soares"]["updraft_thetal"] = 65.2529013941133
all_best_mse["Soares"]["u_mean"] = 99.50300341958477
all_best_mse["Soares"]["tke_mean"] = 156.95277097402698
all_best_mse["Soares"]["temperature_mean"] = 1.2339922617988219e-5
all_best_mse["Soares"]["thetal_mean"] = 1.2048115233919212e-5
all_best_mse["Soares"]["Hvar_mean"] = 1041.52171369052
all_best_mse["Soares"]["qt_mean"] = 0.12980778490568226
all_best_mse["Soares"]["updraft_area"] = 113.58100620664288
all_best_mse["Soares"]["updraft_w"] = 11.430161439400026
all_best_mse["Soares"]["updraft_qt"] = 23.140430901708122
all_best_mse["Soares"]["updraft_thetal"] = 65.25334574114919
all_best_mse["Soares"]["u_mean"] = 99.45787251268736
all_best_mse["Soares"]["tke_mean"] = 162.15180485333332
all_best_mse["Soares"]["temperature_mean"] = 1.1195542406468912e-5
all_best_mse["Soares"]["thetal_mean"] = 1.0630961085120596e-5
all_best_mse["Soares"]["Hvar_mean"] = 1095.4453623561858
#
all_best_mse["TRMM_LBA"] = OrderedDict()
all_best_mse["TRMM_LBA"]["qt_mean"] = 3.621635669505784
all_best_mse["TRMM_LBA"]["updraft_area"] = 7518.988207928098
all_best_mse["TRMM_LBA"]["updraft_w"] = 9690.103451819095
all_best_mse["TRMM_LBA"]["updraft_qt"] = 168.9170715152414
all_best_mse["TRMM_LBA"]["updraft_thetal"] = 1971.7979690181276
all_best_mse["TRMM_LBA"]["v_mean"] = 817.6370669959285
all_best_mse["TRMM_LBA"]["u_mean"] = 996.6746499127546
all_best_mse["TRMM_LBA"]["tke_mean"] = 6042.75005358776
all_best_mse["TRMM_LBA"]["temperature_mean"] = 0.0009601310312244279
all_best_mse["TRMM_LBA"]["ql_mean"] = 2538.038406725415
all_best_mse["TRMM_LBA"]["thetal_mean"] = 0.010416829142866983
all_best_mse["TRMM_LBA"]["Hvar_mean"] = 2030.150563569102
all_best_mse["TRMM_LBA"]["QTvar_mean"] = 2521.908278918528
all_best_mse["TRMM_LBA"]["qt_mean"] = 3.696894480356394
all_best_mse["TRMM_LBA"]["updraft_area"] = 7561.609964448662
all_best_mse["TRMM_LBA"]["updraft_w"] = 11162.65860693764
all_best_mse["TRMM_LBA"]["updraft_qt"] = 178.62874777200045
all_best_mse["TRMM_LBA"]["updraft_thetal"] = 1972.5026068596098
all_best_mse["TRMM_LBA"]["v_mean"] = 816.9725417750085
all_best_mse["TRMM_LBA"]["u_mean"] = 996.5804518730336
all_best_mse["TRMM_LBA"]["tke_mean"] = 8195.78791967079
all_best_mse["TRMM_LBA"]["temperature_mean"] = 0.0011323111668659397
all_best_mse["TRMM_LBA"]["ql_mean"] = 2623.5510869685795
all_best_mse["TRMM_LBA"]["thetal_mean"] = 0.010479008728209362
all_best_mse["TRMM_LBA"]["Hvar_mean"] = 2511.796313996477
all_best_mse["TRMM_LBA"]["QTvar_mean"] = 2460.6541168787
#
all_best_mse["LES_driven_SCM"] = OrderedDict()
all_best_mse["LES_driven_SCM"]["qt_mean"] = 6.573885818637836
all_best_mse["LES_driven_SCM"]["v_mean"] = 3.6380982111672107
all_best_mse["LES_driven_SCM"]["u_mean"] = 1.2183961888336228
all_best_mse["LES_driven_SCM"]["temperature_mean"] = 0.002864201525340376
all_best_mse["LES_driven_SCM"]["ql_mean"] = 242.7752499905406
all_best_mse["LES_driven_SCM"]["thetal_mean"] = 0.003153495719194458
all_best_mse["LES_driven_SCM"]["qt_mean"] = 6.506558677298677
all_best_mse["LES_driven_SCM"]["v_mean"] = 3.759906797286593
all_best_mse["LES_driven_SCM"]["u_mean"] = 1.2539982669739185
all_best_mse["LES_driven_SCM"]["temperature_mean"] = 0.0028529431206087896
all_best_mse["LES_driven_SCM"]["ql_mean"] = 250.57102250812224
all_best_mse["LES_driven_SCM"]["thetal_mean"] = 0.0031457389348072914
#
#################################
#################################
Expand Down
8 changes: 8 additions & 0 deletions src/NetCDFIO.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ face_fields_list() = (
"nh_pressure_adv",
"nh_pressure_drag",
"nh_pressure_b",
"total_flux_h",
"total_flux_qt",
"massflux_h",
"massflux_qt",
"diffusive_flux_h",
"diffusive_flux_qt",
"diffusive_flux_u",
"diffusive_flux_v",
)

function is_face_field(var_name)
Expand Down
19 changes: 19 additions & 0 deletions src/Operators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,25 @@ end
∇f2c(f::SA.SVector, grid::Grid, ::BottomBCTag, bc::SetValue) = (f[2] - bc.value) * grid.Δzi
∇f2c(f::SA.SVector, grid::Grid, ::BottomBCTag, bc::SetGradient) = bc.value

∇c2f(f_dual::SA.SVector, grid::Grid, k; bottom = UseBoundaryValue(), top = UseBoundaryValue()) =
∇c2f(f_dual, grid, k, bottom, top)

function ∇c2f(f_dual::SA.SVector, grid::Grid, k, bottom::AbstractBC, top::AbstractBC)
if is_surface_face(grid, k)
return ∇c2f(f_dual, grid, BottomBCTag(), bottom)
elseif is_toa_face(grid, k)
return ∇c2f(f_dual, grid, TopBCTag(), top)
else
return ∇c2f(f_dual, grid, InteriorTag())
end
end
∇c2f(f::SA.SVector, grid::Grid, ::Int, ::UseBoundaryValue, top::UseBoundaryValue) = ∇c2f(f, grid, InteriorTag())
∇c2f(f::SA.SVector, grid::Grid, ::InteriorTag) = (f[2] - f[1]) * grid.Δzi
∇c2f(f::SA.SVector, grid::Grid, ::TopBCTag, bc::SetValue) = (bc.value - f[1]) * grid.Δzi * 2.0
∇c2f(f::SA.SVector, grid::Grid, ::TopBCTag, bc::SetGradient) = bc.value
∇c2f(f::SA.SVector, grid::Grid, ::BottomBCTag, bc::SetValue) = (f[1] - bc.value) * grid.Δzi * 2.0
∇c2f(f::SA.SVector, grid::Grid, ::BottomBCTag, bc::SetGradient) = bc.value

# Actually, this method is needed for rain (upwind is in reverse direction due to rain)
function c∇_downwind(f_dual::SA.SVector, grid::Grid, k; bottom = NoBCGivenError(), top = NoBCGivenError())
if is_surface_center(grid, k)
Expand Down
Loading