-
Notifications
You must be signed in to change notification settings - Fork 687
/
module_check_a_mundo.F
3606 lines (3199 loc) · 174 KB
/
module_check_a_mundo.F
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
677
678
679
680
681
682
683
684
685
686
687
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
714
715
716
717
718
719
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
!=======================================================================
!
MODULE module_check_a_mundo
!<DESCRIPTION>
!
! Contains subroutines that check the consistency of some namelist
! settings. Some namelist settings depend on other values in the
! namelist. The routine check_nml_consistency can detect quite a
! few fatal inconsistencies. These are all bundled up as a convenience.
! The fatal errors are reported, and after the routine completes, then
! a single call to wrf_error_fatal is issued. The setup_physics_suite routine
! has only one fatal call, so that routine does not need this user-
! friendly concept of bundling errors. The set_physics_rconfigs
! routine does not detect any problems that would result in a fatal
! error, so the bundling of errors is also not required there.
!
! SUBROUTINE check_nml_consistency :
! Check namelist settings for consistency
!
! SUBROUTINE setup_physics_suite :
! Interpret user setting as referring to which supported schemes
! Currently: conus and tropical
!
! SUBROUTINE set_physics_rconfigs :
! Check namelist settings that determine memory allocations.
!
!</DESCRIPTION>
USE module_state_description
USE module_model_constants
USE module_wrf_error
USE module_configure
IMPLICIT NONE
!=======================================================================
CONTAINS
!=======================================================================
SUBROUTINE check_nml_consistency
!<DESCRIPTION>
!
! Check consistency of namelist settings
!
!</DESCRIPTION>
USE module_bep_bem_helper, ONLY: nurbm
IMPLICIT NONE
LOGICAL :: exists, vnest
LOGICAL , EXTERNAL :: wrf_dm_on_monitor
INTEGER :: i, j, oops, d1_value, EDMFMAX, SCHUMAX
INTEGER :: id, factor
LOGICAL :: km_opt_already_done , diff_opt_already_done
INTEGER :: count_opt
LOGICAL :: lon_extent_is_global , lat_extent_is_global
LOGICAL :: rinblw_already_done
LOGICAL :: fsbm_table1_exists, fsbm_table2_exists
INTEGER :: count_fatal_error
INTEGER :: len1, len2, len_loop
! These functions are located with in the Urban Physics files, but
! not within the confines of the modules. Since we are in the share
! directory, we need to break possible circular build dependencies.
INTERFACE
INTEGER FUNCTION bep_nurbm()
END FUNCTION bep_nurbm
INTEGER FUNCTION bep_ndm()
END FUNCTION bep_ndm
INTEGER FUNCTION bep_nz_um()
END FUNCTION bep_nz_um
INTEGER FUNCTION bep_ng_u()
END FUNCTION bep_ng_u
INTEGER FUNCTION bep_nwr_u()
END FUNCTION bep_nwr_u
INTEGER FUNCTION bep_bem_nurbm()
END FUNCTION bep_bem_nurbm
INTEGER FUNCTION bep_bem_ndm()
END FUNCTION bep_bem_ndm
INTEGER FUNCTION bep_bem_nz_um()
END FUNCTION bep_bem_nz_um
INTEGER FUNCTION bep_bem_ng_u()
END FUNCTION bep_bem_ng_u
INTEGER FUNCTION bep_bem_nwr_u()
END FUNCTION bep_bem_nwr_u
INTEGER FUNCTION bep_bem_nf_u()
END FUNCTION bep_bem_nf_u
INTEGER FUNCTION bep_bem_ngb_u()
END FUNCTION bep_bem_ngb_u
INTEGER FUNCTION bep_bem_nbui_max()
END FUNCTION bep_bem_nbui_max
INTEGER FUNCTION bep_bem_ngr_u()
END FUNCTION bep_bem_ngr_u
END INTERFACE
!-----------------------------------------------------------------------
! Set up the WRF Hydro namelist option to allow dynamic allocation of
! variables.
!-----------------------------------------------------------------------
count_fatal_error = 0
#ifdef WRF_HYDRO
model_config_rec % wrf_hydro = 1
#else
model_config_rec % wrf_hydro = 0
#endif
#if (EM_CORE == 1)
!-----------------------------------------------------------------------
! AFWA diagnostics require each domain is treated the same. If
! any domain has an option activated, all domains must have that
! option activated.
!-----------------------------------------------------------------------
do i=1,model_config_rec%max_dom
if ( model_config_rec%afwa_diag_opt(i) .EQ. 1 ) then
model_config_rec%afwa_diag_opt(:) = 1
exit
endif
enddo
do i=1,model_config_rec%max_dom
if ( model_config_rec%afwa_ptype_opt(i) .EQ. 1 ) then
model_config_rec%afwa_ptype_opt(:) = 1
exit
endif
enddo
do i=1,model_config_rec%max_dom
if ( model_config_rec%afwa_vil_opt(i) .EQ. 1 ) then
model_config_rec%afwa_vil_opt(:) = 1
exit
endif
enddo
do i=1,model_config_rec%max_dom
if ( model_config_rec%afwa_radar_opt(i) .EQ. 1 ) then
model_config_rec%afwa_radar_opt(:) = 1
exit
endif
enddo
do i=1,model_config_rec%max_dom
if ( model_config_rec%afwa_severe_opt(i) .EQ. 1 ) then
model_config_rec%afwa_severe_opt(:) = 1
exit
endif
enddo
do i=1,model_config_rec%max_dom
if ( model_config_rec%afwa_icing_opt(i) .EQ. 1 ) then
model_config_rec%afwa_icing_opt(:) = 1
exit
endif
enddo
do i=1,model_config_rec%max_dom
if ( model_config_rec%afwa_cloud_opt(i) .EQ. 1 ) then
model_config_rec%afwa_cloud_opt(:) = 1
exit
endif
enddo
do i=1,model_config_rec%max_dom
if ( model_config_rec%afwa_vis_opt(i) .EQ. 1 ) then
model_config_rec%afwa_vis_opt(:) = 1
exit
endif
enddo
do i=1,model_config_rec%max_dom
if ( model_config_rec%afwa_therm_opt(i) .EQ. 1 ) then
model_config_rec%afwa_therm_opt(:) = 1
exit
endif
enddo
do i=1,model_config_rec%max_dom
if ( model_config_rec%afwa_turb_opt(i) .EQ. 1 ) then
model_config_rec%afwa_turb_opt(:) = 1
exit
endif
enddo
do i=1,model_config_rec%max_dom
if ( model_config_rec%afwa_buoy_opt(i) .EQ. 1 ) then
model_config_rec%afwa_buoy_opt(:) = 1
exit
endif
enddo
!-----------------------------------------------------------------------
! If any AFWA diagnostics are activated, there is a minimum that
! must always be activated.
!-----------------------------------------------------------------------
do i=1,model_config_rec%max_dom
if ( ( model_config_rec%afwa_ptype_opt(i) .EQ. 1 ) .OR. &
( model_config_rec%afwa_vil_opt(i) .EQ. 1 ) .OR. &
( model_config_rec%afwa_radar_opt(i) .EQ. 1 ) .OR. &
( model_config_rec%afwa_severe_opt(i) .EQ. 1 ) .OR. &
( model_config_rec%afwa_icing_opt(i) .EQ. 1 ) .OR. &
( model_config_rec%afwa_cloud_opt(i) .EQ. 1 ) .OR. &
( model_config_rec%afwa_vis_opt(i) .EQ. 1 ) .OR. &
( model_config_rec%afwa_therm_opt(i) .EQ. 1 ) .OR. &
( model_config_rec%afwa_turb_opt(i) .EQ. 1 ) .OR. &
( model_config_rec%afwa_buoy_opt(i) .EQ. 1 ) ) then
model_config_rec%afwa_diag_opt(i)=1
endif
enddo
!-----------------------------------------------------------------------
! LBC: Always the case, nested setup up: F, T, T, T
!-----------------------------------------------------------------------
model_config_rec%nested(1) = .FALSE.
DO i=2,model_config_rec%max_dom
model_config_rec%nested(i) = .TRUE.
END DO
!-----------------------------------------------------------------------
! LBC: Always the case, nested domain BCs are always false.
!-----------------------------------------------------------------------
DO i=2,model_config_rec%max_dom
model_config_rec%periodic_x(i) = .FALSE.
model_config_rec%symmetric_xs(i) = .FALSE.
model_config_rec%symmetric_xe(i) = .FALSE.
model_config_rec%open_xs(i) = .FALSE.
model_config_rec%open_xe(i) = .FALSE.
model_config_rec%periodic_y(i) = .FALSE.
model_config_rec%symmetric_ys(i) = .FALSE.
model_config_rec%symmetric_ye(i) = .FALSE.
model_config_rec%open_ys(i) = .FALSE.
model_config_rec%open_ye(i) = .FALSE.
model_config_rec%polar(i) = .FALSE.
model_config_rec%specified(i) = .FALSE.
END DO
!-----------------------------------------------------------------------
! LBC: spec_bdy_width = spec_zone + relax_zone
!-----------------------------------------------------------------------
IF ( model_config_rec%specified(1) ) THEN
model_config_rec%spec_zone = 1
model_config_rec%relax_zone = model_config_rec%spec_bdy_width - model_config_rec%spec_zone
END IF
#endif
#if (EM_CORE == 1)
!-----------------------------------------------------------------------
! The nominal grid distance on each child domain is ENTIRELY a function
! of the MOAD grid distance and the accumulated recursive parent grid ratios
! of each child domain. Even if the child grid distance values are specified
! in the namelist file, overwrite the dx and dy namelist input with the
! computed grid distance values.
!-----------------------------------------------------------------------
DO i = 1, model_config_rec % max_dom
IF ( .NOT. model_config_rec % grid_allowed(i) ) THEN
WRITE(wrf_err_message,FMT='(A,I2,A)') 'Domain #',i,': grid turned OFF'
CALL wrf_debug ( 0, wrf_err_message )
CYCLE
END IF
id = i
factor = 1
call get_moad_factor ( id, model_config_rec % parent_id, &
model_config_rec % parent_grid_ratio, &
model_config_rec % max_dom, factor )
model_config_rec % dx(i) = model_config_rec % dx(1) / REAL(factor)
model_config_rec % dy(i) = model_config_rec % dy(1) / REAL(factor)
WRITE(wrf_err_message,FMT='(A,I2,A,F9.3,A)') 'Domain #',i,': dx = ',model_config_rec % dx(i),' m'
CALL wrf_debug ( 0, wrf_err_message )
END DO
!-----------------------------------------------------------------------
! Check that all values of diff_opt and km_opt are filled in. A flag
! value of "-1" from the nml file means that this column (domain) is not
! filled as a max_doamins variable. Since we changed these two variables
! from being single entries to max_domain entries, we need to do special
! checking. If there are missing values (if we find any -1 entries), we
! fill those columns with the value from the entry from column (domain) #1.
!-----------------------------------------------------------------------
km_opt_already_done = .FALSE.
diff_opt_already_done = .FALSE.
DO i = 2, model_config_rec % max_dom
IF ( model_config_rec % km_opt(i) .EQ. -1 ) THEN
model_config_rec % km_opt(i) = model_config_rec % km_opt(1)
IF ( .NOT. km_opt_already_done ) THEN
wrf_err_message = 'Setting blank km_opt entries to domain #1 values.'
CALL wrf_debug ( 1, wrf_err_message )
wrf_err_message = ' --> The km_opt entry in the namelist.input is now max_domains.'
CALL wrf_debug ( 1, wrf_err_message )
END IF
km_opt_already_done = .TRUE.
END IF
IF ( model_config_rec % diff_opt(i) .EQ. -1 ) THEN
model_config_rec % diff_opt(i) = model_config_rec % diff_opt(1)
IF ( .NOT. diff_opt_already_done ) THEN
wrf_err_message = 'Setting blank diff_opt entries to domain #1 values.'
CALL wrf_debug ( 1, wrf_err_message )
wrf_err_message = ' --> The diff_opt entry in the namelist.input is now max_domains.'
CALL wrf_debug ( 1, wrf_err_message )
END IF
diff_opt_already_done = .TRUE.
END IF
ENDDO
!-----------------------------------------------------------------------
! Check that km_opt and diff_opt are not -1. If the first column is set
! to -1, that means this entry is NOT in the namelist file at all.
!-----------------------------------------------------------------------
IF ( ( model_config_rec % km_opt(1) .EQ. -1 ) .OR. &
( model_config_rec % diff_opt(1) .EQ. -1 ) ) THEN
wrf_err_message = '--- ERROR: Both km_opt and diff_opt need to be set in the namelist.input file.'
CALL wrf_debug ( 0, TRIM( wrf_err_message ) )
count_fatal_error = count_fatal_error + 1
END IF
!-----------------------------------------------------------------------
! Check that multi_perturb and adptive time setp are not both activated
!-----------------------------------------------------------------------
DO i = 1, model_config_rec % max_dom
IF ( .NOT. model_config_rec % grid_allowed(i) ) CYCLE
IF ((model_config_rec%multi_perturb(i) == 1) .and. model_config_rec%use_adaptive_time_step) then
wrf_err_message = '--- ERROR: multi_perturb and adpative time step are not compatible.'
CALL wrf_debug ( 0, TRIM( wrf_err_message ) )
count_fatal_error = count_fatal_error + 1
END IF
ENDDO
!-----------------------------------------------------------------------
! Check that SMS-3DTKE scheme (km_opt=5) Must work with diff_opt=2
!-----------------------------------------------------------------------
DO i = 1, model_config_rec % max_dom
IF ( .NOT. model_config_rec % grid_allowed(i) ) CYCLE
IF ( model_config_rec % km_opt(i) .EQ. 5 .AND. &
model_config_rec % diff_opt(i) .NE. 2 ) THEN
wrf_err_message = '--- ERROR: SMS-3DTKE scheme can only work with diff_opt=2 '
CALL wrf_message ( wrf_err_message )
wrf_err_message = '--- ERROR: Fix km_opt or diff_opt in namelist.input.'
CALL wrf_debug ( 0, TRIM( wrf_err_message ) )
count_fatal_error = count_fatal_error + 1
END IF
ENDDO
!-----------------------------------------------------------------------
! Check that SMS-3DTKE scheme (km_opt=5) Must work with bl_pbl_physics=0
!-----------------------------------------------------------------------
DO i = 1, model_config_rec % max_dom
IF ( .NOT. model_config_rec % grid_allowed(i) ) CYCLE
IF ( model_config_rec % km_opt(i) .EQ. 5 .AND. &
model_config_rec % bl_pbl_physics(i) .NE. 0 ) THEN
wrf_err_message = '--- ERROR: SMS-3DTKE scheme can only work with bl_pbl_physics=0 '
CALL wrf_message ( wrf_err_message )
wrf_err_message = '--- ERROR: Fix km_opt or bl_pbl_physics in namelist.input.'
CALL wrf_debug ( 0, TRIM( wrf_err_message ) )
count_fatal_error = count_fatal_error + 1
END IF
ENDDO
!-----------------------------------------------------------------------
! Check MAD-WRF configuration
!-----------------------------------------------------------------------
DO i = 1, model_config_rec % max_dom
IF ( .NOT. model_config_rec % grid_allowed(i) ) CYCLE
IF ( model_config_rec % madwrf_opt .EQ. 1 .AND. &
(model_config_rec % mp_physics(i) .NE. 96 .or. &
model_config_rec % use_mp_re /= 0)) THEN
wrf_err_message = '--- ERROR: madwrf_opt = 1 requires mp_physics=96 and use_mp_re=0'
CALL wrf_message ( wrf_err_message )
count_fatal_error = count_fatal_error + 1
END IF
ENDDO
!-----------------------------------------------------------------------
! Check that SMS-3DTKE scheme Must work with Revised MM5 surface layer
! scheme (sf_sfclay_physics = 1), MYNN surface (sf_sfclay_physics = 5)
! and old MM5 surface scheme (sf_sfclay_physics = 91). Also, SMS-3DTKE
! Must work with no surface layer scheme.
!-----------------------------------------------------------------------
DO i = 1, model_config_rec % max_dom
IF ( .NOT. model_config_rec % grid_allowed(i) ) CYCLE
IF ( model_config_rec % km_opt(i) .EQ. 5 .AND. &
(model_config_rec % sf_sfclay_physics(i) .NE. nosfcscheme .AND. &
model_config_rec % sf_sfclay_physics(i) .NE. sfclayscheme .AND. &
model_config_rec % sf_sfclay_physics(i) .NE. sfclayrevscheme .AND. &
model_config_rec % sf_sfclay_physics(i) .NE. mynnsfcscheme ) ) THEN
wrf_err_message = '--- ERROR: SMS-3DTKE scheme works with sf_sfclay_physics = 0,1,5,91 '
CALL wrf_message ( wrf_err_message )
wrf_err_message = '--- ERROR: Fix km_opt or sf_sfclay_physics in namelist.input.'
CALL wrf_debug ( 0, TRIM( wrf_err_message ) )
count_fatal_error = count_fatal_error + 1
END IF
ENDDO
!-----------------------------------------------------------------------
! Check that LES PBL is only paired with acceptable other PBL options.
! Currently, problems occur with any CG PBL option that has a packaged
! scalar component: MYNN2, MYNN3, EEPS. This test is also if a user
! chooses to not run a PBL scheme on a finer domain, but use a PBL
! parameterized scheme on a coarser domain (obviously, just for testing
! purposes).
!-----------------------------------------------------------------------
exists = .FALSE.
DO i = 1, model_config_rec % max_dom
IF ( .NOT. model_config_rec % grid_allowed(i) ) CYCLE
IF ( model_config_rec % bl_pbl_physics(i) .EQ. LESscheme ) THEN
exists = .TRUE.
END IF
END DO
IF ( ( exists ) .AND. &
( ( model_config_rec % bl_pbl_physics(1) .EQ. MYNNPBLSCHEME ) .OR. &
( model_config_rec % bl_pbl_physics(1) .EQ. EEPSSCHEME ) ) ) THEN
WRITE(wrf_err_message,fmt='(a,i2)') '--- ERROR: LES PBL on fine grid does not work with CG PBL option ',model_config_rec % bl_pbl_physics(1)
CALL wrf_message ( TRIM( wrf_err_message ) )
wrf_err_message = ' Fix bl_pbl_physics in namelist.input: choose a CG PBL option without any scalar components'
CALL wrf_message ( TRIM( wrf_err_message ) )
wrf_err_message = ' Alternatively, remove all of the packaged variables from the CG PBL selection'
CALL wrf_message ( TRIM( wrf_err_message ) )
count_fatal_error = count_fatal_error + 1
END IF
!-----------------------------------------------------------------------
! Check that if the user has requested to use the shallow water surface
! roughness drag option, then the only surface layer scheme permitted
! to be used is the revised MM5 MO option.
!-----------------------------------------------------------------------
DO i = 1, model_config_rec % max_dom
IF ( .NOT. model_config_rec % grid_allowed(i) ) CYCLE
IF ( ( model_config_rec % shalwater_z0(i) .NE. 0 ) .AND. &
( model_config_rec % sf_sfclay_physics(i) .NE. sfclayrevscheme ) ) THEN
wrf_err_message = '--- ERROR: Shallow water surface roughness only works with sfclay_physics = 1'
CALL wrf_message ( TRIM( wrf_err_message ) )
wrf_err_message = ' Fix shalwater_z0 or sf_sfclay_physics in namelist.input.'
CALL wrf_message ( TRIM( wrf_err_message ) )
count_fatal_error = count_fatal_error + 1
END IF
ENDDO
!-----------------------------------------------------------------------
! Urban physics set up. If the run-time option for use_wudapt_lcz = 0,
! then the number of urban classes is 3. Else, if the use_wudapt_lcz = 1,
! then the number increases to 11. The seemingly local variable
! assignment, "nurbm", is actually USE associated from the BEP BEM
! helper module.
!-----------------------------------------------------------------------
IF ( model_config_rec%use_wudapt_lcz .EQ. 0 ) THEN
nurbm = 3
ELSE IF ( model_config_rec%use_wudapt_lcz .EQ. 1 ) THEN
nurbm = 11
END IF
!-----------------------------------------------------------------------
! Assign the dimensions for the urban options to the values defined in
! each of those respective modules.
!-----------------------------------------------------------------------
DO i = 1, model_config_rec % max_dom
IF ( .NOT. model_config_rec % grid_allowed(i) ) CYCLE
IF ( model_config_rec % sf_urban_physics(i) == bepscheme ) THEN
model_config_rec % num_urban_ndm = bep_ndm()
model_config_rec % num_urban_nz = bep_nz_um()
model_config_rec % num_urban_ng = bep_ng_u()
model_config_rec % num_urban_nwr = bep_nwr_u()
END IF
IF ( model_config_rec % sf_urban_physics(i) == bep_bemscheme ) THEN
model_config_rec % num_urban_ndm = bep_bem_ndm()
model_config_rec % num_urban_nz = bep_bem_nz_um()
model_config_rec % num_urban_ng = bep_bem_ng_u()
model_config_rec % num_urban_nwr = bep_bem_nwr_u()
model_config_rec % num_urban_nf = bep_bem_nf_u()
model_config_rec % num_urban_ngb = bep_bem_ngb_u()
model_config_rec % num_urban_nbui = bep_bem_nbui_max()
model_config_rec % num_urban_ngr = bep_bem_ngr_u()
END IF
ENDDO
!-----------------------------------------------------------------------
! Check that mosiac option cannot turn on when sf_urban_physics = 2 and 3
!-----------------------------------------------------------------------
DO i = 1, model_config_rec % max_dom
IF ( .NOT. model_config_rec % grid_allowed(i) ) CYCLE
IF ( model_config_rec % sf_surface_mosaic .EQ. 1 .AND. &
(model_config_rec % sf_urban_physics(i) .EQ. 2 .OR. &
model_config_rec % sf_urban_physics(i) .EQ. 3 ) ) THEN
wrf_err_message = '--- ERROR: mosaic option cannot work with urban options 2 and 3 '
CALL wrf_message ( wrf_err_message )
wrf_err_message = '--- ERROR: Fix sf_surface_mosaic and sf_urban_physics in namelist.input.'
CALL wrf_message ( wrf_err_message )
wrf_err_message = '--- ERROR: Either: use Noah LSM without the mosaic option, OR change the urban option to 1 '
CALL wrf_debug ( 0, TRIM( wrf_err_message ) )
count_fatal_error = count_fatal_error + 1
END IF
ENDDO
!-----------------------------------------------------------------------
! Check that only compatible options are set when slucm_distributed_drag is set
!-----------------------------------------------------------------------
IF (model_config_rec % slucm_distributed_drag) THEN
IF (model_config_rec % use_wudapt_lcz .EQ. 1) THEN
wrf_err_message = '--- ERROR: slucm_distributed_drag cannot work with use_wudapt_lcz'
CALL wrf_message ( wrf_err_message )
count_fatal_error = count_fatal_error + 1
END IF
DO i = 1, model_config_rec % max_dom
IF ( .NOT. model_config_rec % grid_allowed(i) ) CYCLE
IF ( model_config_rec % sf_urban_physics(i) > 1 ) THEN
wrf_err_message = '--- ERROR: slucm_distributed_drag only works with urban options 1'
CALL wrf_message ( wrf_err_message )
count_fatal_error = count_fatal_error + 1
END IF
END DO
END IF
!-----------------------------------------------------------------------
! Check that channel irrigation is run with Noah
!-----------------------------------------------------------------------
DO i = 1, model_config_rec % max_dom
IF ( .NOT. model_config_rec % grid_allowed(i) ) CYCLE
IF ( model_config_rec % sf_surface_physics(i) .NE. LSMSCHEME .AND. &
model_config_rec % sf_surf_irr_scheme(i) .EQ. CHANNEL ) THEN
wrf_err_message = '--- ERROR: irrigation Opt 1 works only with Noah-LSM'
CALL wrf_message ( wrf_err_message )
count_fatal_error = count_fatal_error + 1
END IF
ENDDO
!-----------------------------------------------------------------------
! Check that number of hours of daily irrigation is greater than zero.
! This value is used in the denominator to compute the amount of
! irrigated water per timestep, and the default value from the Registry
! is zero. This is a reminder to the user that this value needs to be
! manually set.
!-----------------------------------------------------------------------
oops = 0
DO i = 1, model_config_rec % max_dom
IF ( .NOT. model_config_rec % grid_allowed(i) ) CYCLE
IF ( ( ( model_config_rec % sf_surf_irr_scheme(i) .EQ. CHANNEL ) .OR. &
( model_config_rec % sf_surf_irr_scheme(i) .EQ. SPRINKLER ) .OR. &
( model_config_rec % sf_surf_irr_scheme(i) .EQ. DRIP ) ) .AND. &
( model_config_rec % irr_num_hours(i) .LE. 0 ) ) THEN
oops = oops + 1
END IF
ENDDO
IF ( oops .GT. 0 ) THEN
wrf_err_message = '--- ERROR: irr_num_hours must be greater than zero to work with irrigation'
CALL wrf_message ( wrf_err_message )
count_fatal_error = count_fatal_error + 1
END IF
!-----------------------------------------------------------------------
! Fix derived setting for irrigation. Since users may only want the irrigation
! to be active in the inner-most domain, we have a separate variable that is
! used to define packaging for the irrigation fields.
!-----------------------------------------------------------------------
DO i = 1, model_config_rec % max_dom
IF ( .NOT. model_config_rec % grid_allowed(i) ) CYCLE
IF ( model_config_rec % sf_surf_irr_scheme(i) .EQ. CHANNEL ) THEN
model_config_rec % sf_surf_irr_alloc = CHANNEL
END IF
IF ( model_config_rec % sf_surf_irr_scheme(i) .EQ. SPRINKLER ) THEN
model_config_rec % sf_surf_irr_alloc = SPRINKLER
END IF
IF ( model_config_rec % sf_surf_irr_scheme(i) .EQ. DRIP ) THEN
model_config_rec % sf_surf_irr_alloc = DRIP
END IF
ENDDO
!-----------------------------------------------------------------------
! Check that Deng Shallow Convection Must work with MYJ or MYNN PBL
!-----------------------------------------------------------------------
DO i = 1, model_config_rec % max_dom
IF ( .NOT. model_config_rec % grid_allowed(i) ) CYCLE
IF ( model_config_rec % shcu_physics(i) == dengshcuscheme .AND. &
(model_config_rec % bl_pbl_physics(i) /= myjpblscheme .AND. &
model_config_rec % bl_pbl_physics(i) /= mynnpblscheme ) ) THEN
wrf_err_message = '--- ERROR: Deng shallow convection can only work with MYJ or MYNN (with bl_mynn_edmf off) PBL '
CALL wrf_message ( wrf_err_message )
wrf_err_message = '--- ERROR: Fix shcu_physics or bl_pbl_physics in namelist.input.'
CALL wrf_debug ( 0, TRIM( wrf_err_message ) )
count_fatal_error = count_fatal_error + 1
END IF
ENDDO
!-----------------------------------------------------------------------
! If Deng Shallow Convection is on, icloud cannot be 3
!-----------------------------------------------------------------------
oops = 0
DO i = 1, model_config_rec % max_dom
IF ( .NOT. model_config_rec % grid_allowed(i) ) CYCLE
IF ( ( model_config_rec%shcu_physics(i) .EQ. dengshcuscheme ) .AND. &
( model_config_rec%icloud .EQ. 3 ) ) THEN
oops = oops + 1
END IF
ENDDO
IF ( oops .GT. 0 ) THEN
wrf_err_message = '--- ERROR: Options shcu_physics = 5 and icloud = 3 should not be used together'
CALL wrf_message ( wrf_err_message )
wrf_err_message = '--- ERROR: Choose either one in namelist.input and rerun the model'
CALL wrf_debug ( 0, TRIM( wrf_err_message ) )
count_fatal_error = count_fatal_error + 1
END IF
!-----------------------------------------------------------------------
! If Deng Shallow Convection is on, icloud_bl cannot be 1
!-----------------------------------------------------------------------
oops = 0
DO i = 1, model_config_rec % max_dom
IF ( .NOT. model_config_rec % grid_allowed(i) ) CYCLE
IF ( ( model_config_rec%shcu_physics(i) .EQ. dengshcuscheme ) .AND. &
( model_config_rec%icloud_bl .EQ. 1 ) ) THEN
oops = oops + 1
END IF
ENDDO
IF ( oops .GT. 0 ) THEN
wrf_err_message = '--- ERROR: Options shcu_physics = 5 and icloud_bl = 1 should not be used together'
CALL wrf_message ( wrf_err_message )
wrf_err_message = '--- ERROR: Choose either one in namelist.input and rerun the model'
CALL wrf_debug ( 0, TRIM( wrf_err_message ) )
count_fatal_error = count_fatal_error + 1
END IF
!-----------------------------------------------------------------------
! If couple_farms is true, swint_opt must be 2
!-----------------------------------------------------------------------
IF ( model_config_rec%couple_farms .AND. model_config_rec%swint_opt /= 2 ) THEN
wrf_err_message = '--- ERROR: Options couple_farms = T requires swint_opt = 2'
CALL wrf_message ( wrf_err_message )
wrf_err_message = '--- ERROR: Change either one in namelist.input and rerun the model'
CALL wrf_debug ( 0, TRIM( wrf_err_message ) )
count_fatal_error = count_fatal_error + 1
END IF
!-----------------------------------------------------------------------
! For ARW users, a request for CU=4 (SAS) should be switched to option
! CU = 95.
!-----------------------------------------------------------------------
oops = 0
DO i = 1, model_config_rec % max_dom
IF ( .NOT. model_config_rec % grid_allowed(i) ) CYCLE
IF ( model_config_rec%cu_physics(i) .EQ. scalesasscheme ) THEN
oops = oops + 1
END IF
ENDDO
IF ( oops .GT. 0 ) THEN
wrf_err_message = '--- ERROR: Option cu_physics = 4 should not be used for ARW; cu_physics = 95 is suggested'
CALL wrf_message ( wrf_err_message )
wrf_err_message = '--- ERROR: Choose a different cu_physics option in the namelist.input file'
CALL wrf_debug ( 0, TRIM( wrf_err_message ) )
count_fatal_error = count_fatal_error + 1
END IF
!-----------------------------------------------------------------------
! There is a binary file for Goddard radiation. It is single precision.
!-----------------------------------------------------------------------
# if ( defined(PROMOTE_FLOAT) || ( RWORDSIZE == DWORDSIZE ) )
god_r8 : DO i = 1, model_config_rec % max_dom
IF ( .NOT. model_config_rec % grid_allowed(i) ) CYCLE
IF ( ( model_config_rec % ra_lw_physics(i) == goddardlwscheme ) .OR. &
( model_config_rec % ra_sw_physics(i) == goddardswscheme ) ) THEN
wrf_err_message = '--- ERROR: Goddard radiation scheme cannot run with real*8 floats'
CALL wrf_message ( wrf_err_message )
wrf_err_message = '--- Fix ra_lw_physics and ra_sw_physics in namelist.input '
CALL wrf_debug ( 0, TRIM( wrf_err_message ) )
count_fatal_error = count_fatal_error + 1
EXIT god_r8
END IF
ENDDO god_r8
# endif
!-----------------------------------------------------------------------
! With CMAQ coupling, if the option "direct_sw_feedback" is activated,
! then the only SW radiation scheme set up to support this is RRTMG.
!-----------------------------------------------------------------------
# if ( WRF_CMAQ == 1 )
cmaq : DO i = 1, model_config_rec % max_dom
IF ( .NOT. model_config_rec % grid_allowed(i) ) CYCLE
IF ( ( model_config_rec % direct_sw_feedback ) .AND. &
( model_config_rec % wrf_cmaq_option .EQ. 1 ) .AND. &
( model_config_rec % ra_sw_physics(i) .NE. rrtmg_swscheme ) ) THEN
wrf_err_message = '--- ERROR: With CMAQ coupling, "direct_sw_feedback=T" requires RRTMG SW'
CALL wrf_message ( wrf_err_message )
count_fatal_error = count_fatal_error + 1
EXIT cmaq
END IF
ENDDO cmaq
# else
cmaq : DO i = 1, model_config_rec % max_dom
IF ( .NOT. model_config_rec % grid_allowed(i) ) CYCLE
IF ( ( model_config_rec % direct_sw_feedback ) .OR. &
( model_config_rec % wrf_cmaq_option .EQ. 1 ) ) THEN
wrf_err_message = '--- ERROR: The option "direct_sw_feedback=T" and "wrf_cmaq_option==1" require CMAQ coupling'
CALL wrf_message ( wrf_err_message )
count_fatal_error = count_fatal_error + 1
EXIT cmaq
END IF
ENDDO cmaq
# endif
!-----------------------------------------------------------------------
! Print a warning message for not using a combination of radiation and microphysics from Goddard
!-----------------------------------------------------------------------
DO i = 1, model_config_rec % max_dom
IF ( .NOT. model_config_rec % grid_allowed(i) ) CYCLE
IF ( ( (model_config_rec % ra_lw_physics(i) == goddardlwscheme .OR. &
model_config_rec % ra_sw_physics(i) == goddardswscheme) .AND. &
model_config_rec % mp_physics(i) /= nuwrf4icescheme ) .OR. &
( model_config_rec % mp_physics(i) == nuwrf4icescheme .AND. &
(model_config_rec % ra_lw_physics(i) /= goddardlwscheme .AND. &
model_config_rec % ra_sw_physics(i) /= goddardswscheme) ) ) THEN
wrf_err_message = '--- WARNING: Goddard radiation and Goddard 4ice microphysics are not used together'
CALL wrf_message ( wrf_err_message )
wrf_err_message = '--- WARNING: These options may be best to use together.'
CALL wrf_message ( wrf_err_message )
END IF
ENDDO
#endif
!-----------------------------------------------------------------------
! Check that all values of sf_surface_physics are the same for all domains
!-----------------------------------------------------------------------
DO i = 2, model_config_rec % max_dom
IF ( .NOT. model_config_rec % grid_allowed(i) ) CYCLE
IF ( model_config_rec % sf_surface_physics(i) .NE. &
model_config_rec % sf_surface_physics(1) ) THEN
wrf_err_message = '--- ERROR: sf_surface_physics must be equal for all domains '
CALL wrf_message ( wrf_err_message )
wrf_err_message = '--- Fix sf_surface_physics in namelist.input '
CALL wrf_debug ( 0, TRIM( wrf_err_message ) )
count_fatal_error = count_fatal_error + 1
END IF
ENDDO
!-----------------------------------------------------------------------
! Check that all values of sf_sfclay_physics are the same for all domains
!-----------------------------------------------------------------------
DO i = 2, model_config_rec % max_dom
IF ( .NOT. model_config_rec % grid_allowed(i) ) CYCLE
IF ( model_config_rec % sf_sfclay_physics(i) .NE. &
model_config_rec % sf_sfclay_physics(1) ) THEN
wrf_err_message = '--- ERROR: sf_sfclay_physics must be equal for all domains '
CALL wrf_message ( wrf_err_message )
wrf_err_message = '--- Fix sf_sfclay_physics in namelist.input '
CALL wrf_debug ( 0, TRIM( wrf_err_message ) )
count_fatal_error = count_fatal_error + 1
END IF
ENDDO
!-----------------------------------------------------------------------
! Check that all values of mp_physics are the same for all domains
!-----------------------------------------------------------------------
DO i = 2, model_config_rec % max_dom
IF ( .NOT. model_config_rec % grid_allowed(i) ) CYCLE
IF ( model_config_rec % mp_physics(i) .NE. &
model_config_rec % mp_physics(1) ) THEN
wrf_err_message = '--- NOTE: mp_physics must be equal for all domains '
CALL wrf_debug ( 1, wrf_err_message )
wrf_err_message = '--- NOTE: ----> Setting all mp_physics entries to value defined in the inner most domain'
CALL wrf_debug ( 1, wrf_err_message )
END IF
ENDDO
d1_value = model_config_rec%mp_physics(model_config_rec % max_dom)
DO i = 1, model_config_rec % max_dom-1
model_config_rec%mp_physics(i) = d1_value
END DO
#if (EM_CORE == 1)
!--------------------------------------------------------------------------------------------------
! Input tables must exist in running directory for fast bin microphysics scheme (mp_physics = 30)
!--------------------------------------------------------------------------------------------------
# if ( BUILD_SBM_FAST == 1 )
IF ( model_config_rec % mp_physics(1) .EQ. FAST_KHAIN_LYNN_SHPUND ) THEN
INQUIRE(FILE='./SBM_input_33/BLKD_SDC.dat', EXIST=fsbm_table1_exists)
IF (.not.fsbm_table1_exists ) THEN
wrf_err_message = "--- ERROR: Input directory SBM_input_33 doesn't exist !!!"
CALL wrf_message ( wrf_err_message )
wrf_err_message = '--- ERROR: Download this directory of table files from http://www2.mmm.ucar.edu/wrf/src/wrf_files/'
CALL wrf_message ( wrf_err_message )
count_fatal_error = count_fatal_error + 1
END IF
INQUIRE(FILE='./scattering_tables_2layer_high_quad_1dT_1%fw_110/GRAUPEL_+00C_000fvw.sct', EXIST=fsbm_table2_exists)
IF (.not.fsbm_table2_exists ) THEN
wrf_err_message = "--- ERROR: Input directory scattering_tables_2layer_high_quad_1dT_1%fw_110 doesn't exist !!!"
CALL wrf_message ( TRIM( wrf_err_message ) )
wrf_err_message = '--- ERROR: Download this directory of input table files from http://www2.mmm.ucar.edu/wrf/src/wrf_files/'
CALL wrf_message ( wrf_err_message )
count_fatal_error = count_fatal_error + 1
END IF
END IF
# endif
!-----------------------------------------------------------------------
! There are restrictions on the AFWA diagnostics regarding the choice
! of microphysics scheme. These are hard coded in the AFWA diags driver,
! so while this is inelegant, it is about as good as we can do.
!-----------------------------------------------------------------------
IF ( model_config_rec%afwa_diag_opt(1) .EQ. 1 ) THEN
IF ( ( model_config_rec % mp_physics(1) .EQ. GSFCGCESCHEME ) .OR. &
( model_config_rec % mp_physics(1) .EQ. ETAMPNEW ) .OR. &
( model_config_rec % mp_physics(1) .EQ. THOMPSON ) .OR. &
( model_config_rec % mp_physics(1) .EQ. WSM5SCHEME ) .OR. &
( model_config_rec % mp_physics(1) .EQ. WSM6SCHEME ) .OR. &
( model_config_rec % mp_physics(1) .EQ. WDM6SCHEME ) .OR. &
( model_config_rec % mp_physics(1) .EQ. MORR_TWO_MOMENT ) .OR. &
( model_config_rec % mp_physics(1) .EQ. MORR_TM_AERO ) ) THEN
! All is OK
ELSE
wrf_err_message = '--- WARNING: the AFWA diagnostics option knows only about the following MP schemes:'
CALL wrf_message ( wrf_err_message )
wrf_err_message = '--- GSFCGCESCHEME, ETAMPNEW, THOMPSON, WSM5SCHEME, WSM6SCHEME, MORR_TWO_MOMENT, MORR_TM_AERO, WDM6SCHEME'
CALL wrf_message ( wrf_err_message )
END IF
END IF
#endif
!-----------------------------------------------------------------------
! Check that all values of ra_physics are the same for all domains
!-----------------------------------------------------------------------
DO i = 2, model_config_rec % max_dom
IF ( .NOT. model_config_rec % grid_allowed(i) ) CYCLE
IF ( model_config_rec % ra_lw_physics(i) .NE. &
model_config_rec % ra_lw_physics(1) ) THEN
wrf_err_message = '--- ERROR: ra_lw_physics must be equal for all domains '
CALL wrf_message ( wrf_err_message )
wrf_err_message = '--- Fix ra_lw_physics in namelist.input '
CALL wrf_debug ( 0, TRIM( wrf_err_message ) )
count_fatal_error = count_fatal_error + 1
END IF
ENDDO
DO i = 2, model_config_rec % max_dom
IF ( .NOT. model_config_rec % grid_allowed(i) ) CYCLE
IF ( model_config_rec % ra_sw_physics(i) .NE. &
model_config_rec % ra_sw_physics(1) ) THEN
wrf_err_message = '--- ERROR: ra_sw_physics must be equal for all domains '
CALL wrf_message ( wrf_err_message )
wrf_err_message = '--- Fix ra_sw_physics in namelist.input '
CALL wrf_debug ( 0, TRIM( wrf_err_message ) )
count_fatal_error = count_fatal_error + 1
END IF
ENDDO
!------------------------------------------------------------------------------
! Check that a value for time_step is given, and is not just set to default (-1)
!------------------------------------------------------------------------------
IF ( ( model_config_rec % use_wps_input == 0 ) .AND. &
( model_config_rec % time_step .EQ. -1 ) ) THEN
wrf_err_message = '--- ERROR: Known problem. time_step must be set to a positive integer'
CALL wrf_debug ( 0, TRIM( wrf_err_message ) )
count_fatal_error = count_fatal_error + 1
END IF
!-----------------------------------------------------------------------
! Check that all values of bl_pbl_physics are the same for all domains
!-----------------------------------------------------------------------
DO i = 2, model_config_rec % max_dom
IF ( .NOT. model_config_rec % grid_allowed(i) ) CYCLE
IF ( ( model_config_rec % bl_pbl_physics(i) .NE. model_config_rec % bl_pbl_physics(1) ) .AND. &
( model_config_rec % bl_pbl_physics(i) .NE. 0 ) ) THEN
wrf_err_message = '--- ERROR: bl_pbl_physics must be equal for all domains (or = zero)'
CALL wrf_message ( wrf_err_message )
wrf_err_message = '--- Fix bl_pbl_physics in namelist.input '
CALL wrf_debug ( 0, TRIM( wrf_err_message ) )
count_fatal_error = count_fatal_error + 1
END IF
ENDDO
!-----------------------------------------------------------------------
! Check that all values of gwd_opt are the same for all domains
!-----------------------------------------------------------------------
DO i = 2, model_config_rec % max_dom
IF ( .NOT. model_config_rec % grid_allowed(i) ) CYCLE
IF ( ( model_config_rec % gwd_opt(i) .NE. model_config_rec % gwd_opt(1) ) .AND. &
( model_config_rec % gwd_opt(i) .NE. 0 ) ) THEN
wrf_err_message = '--- ERROR: gwd_opt must be equal for all domains (or = zero)'
CALL wrf_message ( wrf_err_message )
wrf_err_message = '--- Fix gwd_opt in namelist.input '
CALL wrf_debug ( 0, TRIM( wrf_err_message ) )
count_fatal_error = count_fatal_error + 1
END IF
ENDDO
!-----------------------------------------------------------------------
! Check that all values of cu_physics are the same for all domains
! Note that a zero option is OK.
!-----------------------------------------------------------------------
DO i = 2, model_config_rec % max_dom
IF ( .NOT. model_config_rec % grid_allowed(i) ) CYCLE
IF ( ( model_config_rec % cu_physics(i) .NE. model_config_rec % cu_physics(1) ) .AND. &
( model_config_rec % cu_physics(i) .NE. 0 ) ) THEN
wrf_err_message = '--- ERROR: cu_physics must be equal for all domains (or = zero)'
CALL wrf_message ( wrf_err_message )
wrf_err_message = '--- Fix cu_physics in namelist.input '
CALL wrf_debug ( 0, TRIM( wrf_err_message ) )
count_fatal_error = count_fatal_error + 1
END IF
ENDDO
#if ( defined NO_GAMMA_SUPPORT )
!-----------------------------------------------------------------------
! GF CU scheme requires an intrinsic gamma function. This is a 2008
! feature that not all compilers yet support.
!-----------------------------------------------------------------------
GF_test : DO i = 1, model_config_rec % max_dom
IF ( .NOT. model_config_rec % grid_allowed(i) ) CYCLE
IF ( model_config_rec % cu_physics(i) .EQ. GFSCHEME ) THEN
wrf_err_message = '--- ERROR: cu_physics GF uses an intrinsic gamma function that is not available with this compiler'
CALL wrf_message ( TRIM( wrf_err_message ) )
wrf_err_message = '--- Change compilers, or change cu_physics option in the namelist.input file.'
CALL wrf_message ( TRIM( wrf_err_message ) )
count_fatal_error = count_fatal_error + 1
EXIT GF_test
END IF
ENDDO GF_test
#endif
!-----------------------------------------------------------------------
! Climate GHG from an input file requires coordinated pairing of
! LW and SW schemes, and restricts which schemes are eligible.
! Only radiation schemes CAM, RRTM, RRTMG, RRTMG_fast may be used.
! CAM LW and CAM SW must be used together.
! RRTM, RRTMG, RRTMG_fast LW and SW may be wildly mixed and matched
! together.
!-----------------------------------------------------------------------
IF ( model_config_rec % ghg_input .EQ. 1 ) THEN
oops = 0
DO i = 1, model_config_rec % max_dom
IF ( .NOT. model_config_rec % grid_allowed(i) ) CYCLE
IF ( ( ( model_config_rec % ra_lw_physics(i) .EQ. CAMLWSCHEME ) .AND. &
( model_config_rec % ra_sw_physics(i) .EQ. CAMSWSCHEME ) ) .OR. &
( ( ( model_config_rec % ra_lw_physics(i) .EQ. RRTMSCHEME ) .OR. &
( model_config_rec % ra_lw_physics(i) .EQ. RRTMG_LWSCHEME ) .OR. &
( model_config_rec % ra_lw_physics(i) .EQ. RRTMG_LWSCHEME_FAST ) ) .AND. &
( ( model_config_rec % ra_sw_physics(i) .EQ. SWRADSCHEME ) .OR. &
( model_config_rec % ra_sw_physics(i) .EQ. RRTMG_SWSCHEME ) .OR. &
( model_config_rec % ra_sw_physics(i) .EQ. RRTMG_SWSCHEME_FAST ) ) ) ) THEN
! This is OK, no way would a negation have been understandable!
ELSE
oops = oops + 1
END IF
ENDDO
IF ( oops .GT. 0 ) THEN
wrf_err_message = '--- ERROR: ghg_input available only for these radiation schemes: CAM, RRTM, RRTMG, RRTMG_fast'
CALL wrf_message ( TRIM( wrf_err_message ) )
wrf_err_message = ' And the LW and SW schemes must be reasonably paired together:'
CALL wrf_message ( TRIM( wrf_err_message ) )
wrf_err_message = ' OK = CAM LW with CAM SW'
CALL wrf_message ( TRIM( wrf_err_message ) )
wrf_err_message = ' OK = RRTM, RRTMG LW or SW, RRTMG_fast LW or SW may be mixed'
CALL wrf_message ( TRIM( wrf_err_message ) )
END IF
END IF
!-----------------------------------------------------------------------
! If fractional_seaice = 0, and tice2tsk_if2cold = .true, nothing will happen
!-----------------------------------------------------------------------
IF ( ( model_config_rec%fractional_seaice .EQ. 0 ).AND. &
( model_config_rec%tice2tsk_if2cold ) ) THEN
wrf_err_message = '--- WARNING: You set tice2tsk_if2cold = .true., but fractional_seaice = 0'
CALL wrf_debug ( 1, wrf_err_message )
wrf_err_message = '--- WARNING: tice2tsk_if2cold will have no effect on results.'
CALL wrf_debug ( 1, wrf_err_message )