-
Notifications
You must be signed in to change notification settings - Fork 177
/
Copy pathconfig.ufs
676 lines (648 loc) · 21 KB
/
config.ufs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
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
134
135
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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
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
312
313
314
315
316
317
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
361
362
363
364
365
366
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
415
416
417
418
419
420
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
461
462
463
464
465
466
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
495
496
497
498
499
500
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
#! /usr/bin/env bash
########## config.ufs ##########
# UFS model resolution specific parameters
# e.g. time-step, processor layout, physics and dynamics parameters
# This config sets default variables for FV3, MOM6, CICE6 for their resolutions
# User can over-ride after sourcing this config file
echo "BEGIN: config.ufs"
if (( $# <= 1 )); then
echo "Must specify an input resolution argument to set variables!"
echo "argument can be any one of the following:"
echo "--fv3 C48|C96|C192|C384|C768|C1152|C3072"
echo "--mom6 500|100|025"
echo "--cice6 500|100|025"
echo "--ww3 gnh_10m;aoc_9km;gsh_15m|gwes_30m|glo_025|glo_100|glo_200|glo_500|mx025|uglo_100km"
echo "--gocart"
exit 1
fi
# Initialize
skip_mom6=true
skip_cice6=true
skip_ww3=true
skip_gocart=true
skip_mediator=true
# Loop through named arguments
while (( $# > 0 )); do
key="$1"
case "${key}" in
"--fv3")
fv3_res="$2"
shift
;;
"--mom6")
mom6_res="$2"
skip_mom6=false
shift
;;
"--cice6")
cice6_res="$2"
skip_cice6=false
shift
;;
"--ww3")
ww3_res="$2"
skip_ww3=false
shift
;;
"--gocart")
skip_gocart=false
;;
*) # unknown option
echo "FATAL ERROR: Unknown option: ${key}, ABORT!"
exit 1
;;
esac
shift
done
# Mediator is required if any of the non-ATM components are used
if [[ "${skip_mom6}" == "false" ]] || [[ "${skip_cice6}" == "false" ]] || [[ "${skip_ww3}" == "false" ]]; then
skip_mediator=false
fi
if [[ "${DO_NEST:-NO}" == "YES" ]] ; then
# Describe nest location, interaction with parent, etc.
export grid_type=0
export stretch_fac=1.0001
export TARGET_LAT=32.5
export TARGET_LON=-135.0
export NEST_LON1=-195.000000
export NEST_LAT1=-7.500000
export NEST_LON2=-75.000000
export NEST_LAT2=72.500000
export twowaynest=${twowaynest:-.true.}
else
# No nest.
export grid_type=-1
fi
# (Standard) Model resolution dependent variables
case "${fv3_res}" in
"C48")
export DELTIM=1200
export layout_x_gdas=1
export layout_y_gdas=1
export layout_x_gfs=1
export layout_y_gfs=1
export nthreads_fv3_gdas=1
export nthreads_fv3_gfs=1
export nthreads_ufs_gdas=1
export nthreads_ufs_gfs=1
export xr_cnvcld=".false." # Do not pass conv. clouds to Xu-Randall cloud fraction
export cdmbgwd="0.071,2.1,1.0,1.0" # mountain blocking, ogwd, cgwd, cgwd src scaling
export cdmbgwd_gsl="40.0,1.77,1.0,1.0" # settings for GSL drag suite
export psl_gwd_dx_factor=6.0
export knob_ugwp_tauamp=6.0e-3 # setting for UGWPv1 non-stationary GWD
export k_split=1
export n_split=4
export tau=8.0
export rf_cutoff=100.0
export fv_sg_adj=3600
export WRITE_GROUP_GDAS=1
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GDAS=1
export WRITE_GROUP_GFS=1
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GFS=1
;;
"C96")
if [[ "${DO_NEST:-NO}" == "YES" ]] ; then
export DELTIM=450
export layout_x_gfs=4
export layout_y_gfs=4
export layout_x_nest=12
export layout_y_nest=10
export nest_refine=4
export nest_ioffset=4
export nest_joffset=9
export npx_nest=361
export npy_nest=241
export NEST_DLON=0.25
export NEST_DLAT=0.25
export psl_gwd_dx_factor=6.0
export WRITE_GROUP_GDAS=2
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GDAS=2
export WRITE_GROUP_GFS=2
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GFS=2
else
export DELTIM=600
export layout_x_gdas=2
export layout_y_gdas=2
export layout_x_gfs=2
export layout_y_gfs=2
export nthreads_fv3_gdas=1
export nthreads_fv3_gfs=1
export nthreads_ufs_gdas=1
export nthreads_ufs_gfs=1
export xr_cnvcld=.false. # Do not pass conv. clouds to Xu-Randall cloud fraction
export cdmbgwd="0.14,1.8,1.0,1.0" # mountain blocking, ogwd, cgwd, cgwd src scaling
export cdmbgwd_gsl="20.0,2.5,1.0,1.0" # settings for GSL drag suite
export psl_gwd_dx_factor=6.0
export knob_ugwp_tauamp=3.0e-3 # setting for UGWPv1 non-stationary GWD
export k_split=1
export n_split=4
export tau=8.0
export rf_cutoff=100.0
export fv_sg_adj=1800
export WRITE_GROUP_GDAS=1
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GDAS=1
export WRITE_GROUP_GFS=1
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GFS=1
fi
;;
"C192")
if [[ "${DO_NEST:-NO}" == "YES" ]] ; then
export DELTIM=225
export layout_x_gfs=5
export layout_y_gfs=6
export layout_x_nest=15
export layout_y_nest=25
export nest_refine=4
export nest_ioffset=7
export nest_joffset=19
export npx_nest=721
export npy_nest=481
export NEST_DLON=0.125
export NEST_DLAT=0.125
export psl_gwd_dx_factor=6.0
export WRITE_GROUP_GDAS=2
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GDAS=15
export WRITE_GROUP_GFS=2
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GFS=15
else
export DELTIM=600
export layout_x_gdas=4
export layout_y_gdas=6
export layout_x_gfs=4
export layout_y_gfs=6
export nthreads_fv3_gdas=1
export nthreads_fv3_gfs=2
export nthreads_ufs_gdas=1
export nthreads_ufs_gfs=2
export cdmbgwd="0.23,1.5,1.0,1.0" # mountain blocking, ogwd, cgwd, cgwd src scaling
export cdmbgwd_gsl="10.0,3.5,1.0,1.0" # settings for GSL drag suite
export psl_gwd_dx_factor=6.0
export knob_ugwp_tauamp=1.5e-3 # setting for UGWPv1 non-stationary GWD
export k_split=2
export n_split=4
export tau=6.0
export rf_cutoff=100.0
export fv_sg_adj=1800
export WRITE_GROUP_GDAS=1
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GDAS=10
export WRITE_GROUP_GFS=2
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GFS=5
fi
;;
"C384")
if [[ "${DO_NEST:-NO}" == "YES" ]] ; then
export DELTIM=150
export layout_x_gdas=8
export layout_y_gdas=8
export layout_x_gfs=8
export layout_y_gfs=8
export layout_x_nest=34
export layout_y_nest=24
export nest_refine=4
export nest_ioffset=13
export nest_joffset=37
export npx_nest=1441
export npy_nest=961
export NEST_DLON=0.0625
export NEST_DLAT=0.0625
export psl_gwd_dx_factor=2.0
export WRITE_GROUP_GDAS=2
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GDAS=20
export WRITE_GROUP_GFS=2
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GFS=20
else
export DELTIM=300
export layout_x_gdas=8
export layout_y_gdas=8
export layout_x_gfs=8
export layout_y_gfs=8
export nthreads_fv3_gdas=2
export nthreads_fv3_gfs=2
export nthreads_ufs_gdas=2
export nthreads_ufs_gfs=2
export cdmbgwd="1.1,0.72,1.0,1.0" # mountain blocking, ogwd, cgwd, cgwd src scaling
export cdmbgwd_gsl="5.0,5.0,1.0,1.0" # settings for GSL drag suite
export psl_gwd_dx_factor=6.0
export knob_ugwp_tauamp=0.8e-3 # setting for UGWPv1 non-stationary GWD
export k_split=2
export n_split=4
export tau=4.0
export rf_cutoff=100.0
export fv_sg_adj=900
export WRITE_GROUP_GDAS=4
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GDAS=10
export WRITE_GROUP_GFS=4
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GFS=10
fi
;;
"C768")
if [[ "${DO_NEST:-NO}" == "YES" ]] ; then
export DELTIM=75
export layout_x_gdas=16
export layout_y_gdas=10
export layout_x_gfs=16
export layout_y_gfs=10
export layout_x_nest=48
export layout_y_nest=45
export nthreads_fv3_nest=2
export nthreads_fv3_gdas=2
export nthreads_fv3_gfs=2
export nest_refine=4
export nest_ioffset=24
export nest_joffset=72
export npx_nest=2881
export npy_nest=1921
export NEST_DLON=0.0325
export NEST_DLAT=0.0325
export psl_gwd_dx_factor=2.0
export WRITE_GROUP_GDAS=2
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GDAS=90
export WRITE_GROUP_GFS=2
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GFS=90
else
export DELTIM=150
export layout_x_gdas=8
export layout_y_gdas=12
export layout_x_gfs=12
export layout_y_gfs=16
export nthreads_fv3_gdas=4
export nthreads_fv3_gfs=4
export nthreads_ufs_gdas=4
export nthreads_ufs_gfs=4
export cdmbgwd="4.0,0.15,1.0,1.0" # mountain blocking, ogwd, cgwd, cgwd src scaling
export cdmbgwd_gsl="2.5,7.5,1.0,1.0" # settings for GSL drag suite
export psl_gwd_dx_factor=6.0
export knob_ugwp_tauamp=0.5e-3 # setting for UGWPv1 non-stationary GWD
export k_split=2
export n_split=4
export tau=3.0
export rf_cutoff=100.0
export fv_sg_adj=450
export WRITE_GROUP_GDAS=2
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GDAS=15
export WRITE_GROUP_GFS=4
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GFS=20 #Note this should be 10 for WCOSS2
fi
;;
"C1152")
export DELTIM=150
export layout_x_gdas=8
export layout_y_gdas=16
export layout_x_gfs=8
export layout_y_gfs=16
export nthreads_fv3_gdas=4
export nthreads_fv3_gfs=4
export nthreads_ufs_gdas=4
export nthreads_ufs_gfs=4
export cdmbgwd="4.0,0.10,1.0,1.0" # mountain blocking, ogwd, cgwd, cgwd src scaling
export cdmbgwd_gsl="1.67,8.8,1.0,1.0" # settings for GSL drag suite
export psl_gwd_dx_factor=2.0
export knob_ugwp_tauamp=0.35e-3 # setting for UGWPv1 non-stationary GWD
export k_split=2
export n_split=6
export tau=2.5
export rf_cutoff=100.0
export fv_sg_adj=450
export WRITE_GROUP_GDAS=4
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GDAS=20 # TODO: refine these numbers when a case is available
export WRITE_GROUP_GFS=4
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GFS=20 # TODO: refine these numbers when a case is available
;;
"C3072")
export DELTIM=90
export layout_x=16
export layout_y_gdas=32
export layout_x_gfs_gdas=16
export layout_y_gfs=32
export nthreads_fv3_gdas=4
export nthreads_fv3_gfs=4
export nthreads_ufs_gdas=4
export nthreads_ufs_gfs=4
export cdmbgwd="4.0,0.05,1.0,1.0" # mountain blocking, ogwd, cgwd, cgwd src scaling
export cdmbgwd_gsl="0.625,14.1,1.0,1.0" # settings for GSL drag suite
export psl_gwd_dx_factor=2.0
export knob_ugwp_tauamp=0.13e-3 # setting for UGWPv1 non-stationary GWD
export k_split=4
export n_split=5
export tau=0.5
export rf_cutoff=100.0
export fv_sg_adj=300
export WRITE_GROUP_GDAS=4
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GDAS=10 # TODO: refine these numbers when a case is available
export WRITE_GROUP_GFS=4
export WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GFS=10 # TODO: refine these numbers when a case is available
;;
*)
echo "FATAL ERROR: Unsupported FV3 resolution = ${fv3_res}, ABORT!"
exit 1
;;
esac
(( WRTTASK_PER_GROUP_PER_THREAD_GDAS = WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GDAS * 6 ))
(( WRTTASK_PER_GROUP_PER_THREAD_GFS = WRTTASK_PER_GROUP_PER_THREAD_PER_TILE_GFS * 6 ))
export WRTTASK_PER_GROUP_PER_THREAD_GDAS
export WRTTASK_PER_GROUP_PER_THREAD_GFS
(( ntasks_fv3_gdas = layout_x_gdas * layout_y_gdas * 6 ))
(( ntasks_fv3_gfs = layout_x_gfs * layout_y_gfs * 6 ))
if [[ "${DO_NEST:-NO}" == "YES" ]] ; then
(( ntasks_fv3_gfs += layout_x_nest * layout_y_nest ))
fi
export ntasks_fv3_gdas
export ntasks_fv3_gfs
(( ntasks_quilt_gdas = WRITE_GROUP_GDAS * WRTTASK_PER_GROUP_PER_THREAD_GDAS ))
(( ntasks_quilt_gfs = WRITE_GROUP_GFS * WRTTASK_PER_GROUP_PER_THREAD_GFS ))
export ntasks_quilt_gdas
export ntasks_quilt_gfs
# Determine whether to use compression in the write grid component
# and whether to use parallel NetCDF based on resolution
case ${fv3_res} in
"C48" | "C96" | "C192")
zstandard_level=0
ideflate=0
quantize_nsd=0
OUTPUT_FILETYPE_ATM="netcdf"
OUTPUT_FILETYPE_SFC="netcdf"
;;
"C384" | "C768" | "C1152" | "C3072")
zstandard_level=0
ideflate=1
quantize_nsd=14
OUTPUT_FILETYPE_ATM="netcdf_parallel"
if [[ "${fv3_res}" == "C384" ]]; then
OUTPUT_FILETYPE_SFC="netcdf" # For C384, the write grid component is better off with serial netcdf
else
OUTPUT_FILETYPE_SFC="netcdf_parallel"
fi
;;
*)
echo "FATAL ERROR: Unrecognized FV3 resolution ${fv3_res}"
exit 15
;;
esac
export zstandard_level ideflate quantize_nsd
export OUTPUT_FILETYPE_ATM OUTPUT_FILETYPE_SFC
# cpl defaults
export cpl=".false."
export cplflx=".false."
export cplice=".false."
export cplchm=".false."
export cplwav=".false."
export cplwav2atm=".false."
if [[ "${DO_NEST:-NO}" == "YES" ]] ; then
export CCPP_SUITE="${CCPP_SUITE:-FV3_global_nest_v1}"
else
export CCPP_SUITE="${CCPP_SUITE:-FV3_GFS_v17_p8_ugwpv1}"
fi
model_list="atm"
# Mediator specific settings
if [[ "${skip_mediator}" == "false" ]]; then
export cpl=".true."
export nthreads_mediator_gfs=${nthreads_fv3_gfs} # Use same threads as FV3
export nthreads_mediator_gdas=${nthreads_fv3_gdas}
export CCPP_SUITE="FV3_GFS_v17_coupled_p8_ugwpv1" # TODO: Does this include FV3_GFS_v17_p8? Can this be used instead of FV3_GFS_v17_p8?
fi
# MOM6 specific settings
if [[ "${skip_mom6}" == "false" ]]; then
source "${EXPDIR}/config.ocn"
export cplflx=".true."
model_list="${model_list}.ocean"
nthreads_mom6=1
case "${mom6_res}" in
"500")
ntasks_mom6=8
OCNTIM=3600
NX_GLB=72
NY_GLB=35
DT_DYNAM_MOM6='3600'
DT_THERM_MOM6='3600'
FRUNOFF=""
CHLCLIM="seawifs_1998-2006_smoothed_2X.nc"
MOM6_RESTART_SETTING='r'
MOM6_RIVER_RUNOFF='False'
if [[ ${RUN} == "gfs" || "${RUN}" == "gefs" ]]; then
MOM6_DIAG_MISVAL="-1e34"
else
MOM6_DIAG_MISVAL="0.0"
fi
eps_imesh="4.0e-1"
MOM6_DIAG_COORD_DEF_Z_FILE="oceanda_zgrid_25L.nc"
MOM6_ALLOW_LANDMASK_CHANGES='False'
TOPOEDITS=""
;;
"100")
ntasks_mom6=20
OCNTIM=3600
NX_GLB=360
NY_GLB=320
DT_DYNAM_MOM6='1800'
DT_THERM_MOM6='3600'
FRUNOFF="runoff.daitren.clim.1deg.nc"
CHLCLIM="seawifs_1998-2006_smoothed_2X.nc"
MOM6_RESTART_SETTING='r'
MOM6_RIVER_RUNOFF='False'
eps_imesh="2.5e-1"
TOPOEDITS="ufs.topo_edits_011818.nc"
if [[ ${RUN} == "gfs" || "${RUN}" == "gefs" ]]; then
MOM6_DIAG_COORD_DEF_Z_FILE="interpolate_zgrid_40L.nc"
MOM6_DIAG_MISVAL="-1e34"
else
MOM6_DIAG_COORD_DEF_Z_FILE="oceanda_zgrid_75L.nc"
MOM6_DIAG_MISVAL="0.0"
fi
MOM6_ALLOW_LANDMASK_CHANGES='True'
;;
"050")
ntasks_mom6=60
OCNTIM=3600
NX_GLB=720
NY_GLB=576
DT_DYNAM_MOM6='1800'
DT_THERM_MOM6='3600'
FRUNOFF="runoff.daitren.clim.${NX_GLB}x${NY_GLB}.v20180328.nc"
CHLCLIM="seawifs-clim-1997-2010.${NX_GLB}x${NY_GLB}.v20180328.nc"
MOM6_RESTART_SETTING='n'
MOM6_RIVER_RUNOFF='True'
eps_imesh="1.0e-1"
if [[ ${RUN} == "gfs" || "${RUN}" == "gefs" ]]; then
MOM6_DIAG_COORD_DEF_Z_FILE="interpolate_zgrid_40L.nc"
MOM6_DIAG_MISVAL="-1e34"
else
MOM6_DIAG_COORD_DEF_Z_FILE="oceanda_zgrid_75L.nc"
MOM6_DIAG_MISVAL="0.0"
fi
MOM6_ALLOW_LANDMASK_CHANGES='False'
TOPOEDITS=""
;;
"025")
ntasks_mom6=220
OCNTIM=1800
NX_GLB=1440
NY_GLB=1080
DT_DYNAM_MOM6='900'
DT_THERM_MOM6='1800'
FRUNOFF="runoff.daitren.clim.${NX_GLB}x${NY_GLB}.v20180328.nc"
CHLCLIM="seawifs-clim-1997-2010.${NX_GLB}x${NY_GLB}.v20180328.nc"
MOM6_RIVER_RUNOFF='True'
MOM6_RESTART_SETTING="r"
eps_imesh="1.0e-1"
if [[ ${RUN} == "gfs" || "${RUN}" == "gefs" ]]; then
MOM6_DIAG_COORD_DEF_Z_FILE="interpolate_zgrid_40L.nc"
MOM6_DIAG_MISVAL="-1e34"
else
MOM6_DIAG_COORD_DEF_Z_FILE="oceanda_zgrid_75L.nc"
MOM6_DIAG_MISVAL="0.0"
fi
MOM6_ALLOW_LANDMASK_CHANGES='False'
TOPOEDITS=""
;;
*)
echo "FATAL ERROR: Unsupported MOM6 resolution = ${mom6_res}, ABORT!"
exit 1
;;
esac
export nthreads_mom6 ntasks_mom6
export OCNTIM
export NX_GLB NY_GLB
export DT_DYNAM_MOM6 DT_THERM_MOM6
export FRUNOFF
export CHLCLIM
export TOPOEDITS
export MOM6_RIVER_RUNOFF
export MOM6_RESTART_SETTING
export eps_imesh
export MOM6_DIAG_COORD_DEF_Z_FILE
export MOM6_DIAG_MISVAL
export MOM6_ALLOW_LANDMASK_CHANGES
fi
# CICE6 specific settings
if [[ "${skip_cice6}" == "false" ]]; then
source "${EXPDIR}/config.ice"
export cplice=".true."
model_list="${model_list}.ice"
# Ensure we sourced the MOM6 section
if [[ "${skip_mom6}" == "true" ]]; then
echo "FATAL ERROR: CICE6 cannot be configured without MOM6, ABORT!"
exit 1
fi
nthreads_cice6=${nthreads_mom6} # CICE6 needs to run on same threads as MOM6
case "${cice6_res}" in
"500")
ntasks_cice6=4
cice6_processor_shape="slenderX1"
;;
"100")
ntasks_cice6=10
cice6_processor_shape="slenderX2"
;;
"050")
ntasks_cice6=30
cice6_processor_shape="slenderX2"
;;
"025")
ntasks_cice6=120
cice6_processor_shape="slenderX2"
;;
*)
echo "FATAL ERROR: Unsupported CICE6 resolution = ${cice6_res}, ABORT!"
exit 1
;;
esac
# NX_GLB and NY_GLB are set in the MOM6 section above
# CICE6 runs on the same domain decomposition as MOM6
export nthreads_cice6 ntasks_cice6
export cice6_processor_shape
fi
# WW3 specific settings
if [[ "${skip_ww3}" == "false" ]]; then
source "${EXPDIR}/config.wave"
export cplwav=".true."
export cplwav2atm=".true."
model_list="${model_list}.wave"
nthreads_ww3=2
case "${ww3_res}" in
"gnh_10m;aoc_9km;gsh_15m")
ntasks_ww3=140
;;
"gwes_30m")
ntasks_ww3=100
;;
"glo_025")
ntasks_ww3=262
;;
"glo_100")
ntasks_ww3=20
nthreads_ww3=1
;;
"glo_200")
ntasks_ww3=30
nthreads_ww3=1
;;
"glo_500")
ntasks_ww3=12
nthreads_ww3=1
;;
"mx025")
ntasks_ww3=80
;;
"uglo_15km")
ntasks_ww3=1000
nthreads_ww3=1
;;
"uglo_100km")
ntasks_ww3=40
nthreads_ww3=1
;;
*)
echo "FATAL ERROR: Unsupported WW3 resolution = ${ww3_res}, ABORT!"
exit 1
;;
esac
export ntasks_ww3 nthreads_ww3
fi
# GOCART specific settings
if [[ "${skip_gocart}" == "false" ]]; then
source "${EXPDIR}/config.aero"
export cplchm=".true."
model_list="${model_list}.aero"
fi
# Set the name of the UFS (previously nems) configure template to use
# Default ufs.configure templates for supported model configurations
# WW3 restart field variable is different for slow vs fast loop. Add WW3_RSTFLDS="ice" for slow loop variables based on coupling scheme.
case "${model_list}" in
atm)
default_template="${PARMgfs}/ufs/ufs.configure.atm${tmpl_suffix:-}.IN"
;;
atm.aero)
default_template="${PARMgfs}/ufs/ufs.configure.atmaero${tmpl_suffix:-}.IN"
;;
atm.wave)
default_template="${PARMgfs}/ufs/ufs.configure.leapfrog_atm_wav${tmpl_suffix:-}.IN"
;;
atm.ocean.ice)
default_template="${PARMgfs}/ufs/ufs.configure.s2s${tmpl_suffix:-}.IN"
;;
atm.ocean.ice.aero)
default_template="${PARMgfs}/ufs/ufs.configure.s2sa${tmpl_suffix:-}.IN"
;;
atm.ocean.ice.wave)
default_template="${PARMgfs}/ufs/ufs.configure.s2sw${tmpl_suffix:-}.IN"
WW3_RSTFLDS="ice"
;;
atm.ocean.ice.wave.aero)
default_template="${PARMgfs}/ufs/ufs.configure.s2swa${tmpl_suffix:-}.IN"
WW3_RSTFLDS="ice"
;;
*)
echo "FATAL ERROR: Unsupported UFSWM configuration for ${model_list}"
exit 16
;;
esac
# Allow user to override the default template
export ufs_configure_template=${ufs_configure_template:-${default_template:-"/dev/null"}}
unset model_list default_template
# export wave restart variable:
export WW3_RSTFLDS=${WW3_RSTFLDS:-" "}
if [[ ! -r "${ufs_configure_template}" ]]; then
echo "FATAL ERROR: ${ufs_configure_template} either doesn't exist or is not readable."
exit 17
fi
echo "END: config.ufs"