Scan through the diag_table searching for obsolete parameters and issue informational messages and optionallly a FATAL error.
23 type(param_file_type),
intent(in) :: param_file
24 type(diag_ctrl),
intent(in) :: diag
26 #include "version_variable.h"
28 character(len=40) :: mdl =
"MOM_obsolete_diagnostics"
29 logical :: foundEntry, causeFatal
32 call log_version(param_file, mdl, version)
33 call get_param(param_file, mdl,
"OBSOLETE_DIAGNOSTIC_IS_FATAL", causefatal, &
34 "If an obsolete diagnostic variable appears in the diag_table, "// &
35 "cause a FATAL error rather than issue a WARNING.", default=.true.)
39 if (found_in_diagtable(diag,
'Net_Heat',
'net_heat_surface or net_heat_coupler')) foundentry = .true.
40 if (found_in_diagtable(diag,
'PmE',
'PRCmE')) foundentry = .true.
41 if (found_in_diagtable(diag,
'froz_precip',
'fprec')) foundentry = .true.
42 if (found_in_diagtable(diag,
'liq_precip',
'lprec')) foundentry = .true.
43 if (found_in_diagtable(diag,
'virt_precip',
'vprec')) foundentry = .true.
44 if (found_in_diagtable(diag,
'froz_runoff',
'frunoff')) foundentry = .true.
45 if (found_in_diagtable(diag,
'liq_runoff',
'lrunoff')) foundentry = .true.
46 if (found_in_diagtable(diag,
'calving_heat_content',
'heat_content_frunoff')) foundentry = .true.
47 if (found_in_diagtable(diag,
'precip_heat_content',
'heat_content_lprec')) foundentry = .true.
48 if (found_in_diagtable(diag,
'evap_heat_content',
'heat_content_massout')) foundentry = .true.
49 if (found_in_diagtable(diag,
'runoff_heat_content',
'heat_content_lrunoff')) foundentry = .true.
50 if (found_in_diagtable(diag,
'latent_fprec')) foundentry = .true.
51 if (found_in_diagtable(diag,
'latent_calve')) foundentry = .true.
52 if (found_in_diagtable(diag,
'heat_rest',
'heat_restore')) foundentry = .true.
53 if (found_in_diagtable(diag,
'KPP_dTdt',
'KPP_NLT_dTdt')) foundentry = .true.
54 if (found_in_diagtable(diag,
'KPP_dSdt',
'KPP_NLT_dSdt')) foundentry = .true.
56 if (causefatal) then; errtype = fatal
57 else ; errtype = warning ;
endif
58 if (foundentry .and. is_root_pe()) &
59 call mom_error(errtype,
'MOM_obsolete_diagnostics: '//&
60 'Obsolete diagnostics found in diag_table')