Skip to content
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
9 changes: 8 additions & 1 deletion src/data/write_init_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,14 @@ def write_ic_params(outfile, host_vars, ic_names, registry_constituents):
# Add this variable to the ic_names dictionary
ic_names[stdname] = [locname]
# end if
# end if
# end for
# Also check registry constituents for longer IC names
for const in registry_constituents:
if const in ic_names:
max_loclen = max(max_loclen,
max(len(x) for x in ic_names[const]))
# end if
# end for
outfile.write(f"integer, public, parameter :: ic_name_len = {max_loclen}",
1)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module phys_vars_init_check_cnst
integer, public, parameter :: std_name_len = 25

! Max length of input (IC) file variable names:
integer, public, parameter :: ic_name_len = 12
integer, public, parameter :: ic_name_len = 13

! Physics-related input variable standard names:
character(len=25), public, protected :: phys_var_stdnames(phys_var_num) = (/ &
Expand All @@ -65,10 +65,10 @@ module phys_vars_init_check_cnst
"suite_name ", &
"suite_part " /)
!Array storing all registered IC file input names for each variable:
character(len=12), public, protected :: input_var_names(2, phys_var_num) = reshape((/ &
'theta ', 'pot_temp ', &
'slp ', 'sea_lev_pres', &
'COOL_CAT ', 'cnst_COOL_CAT' /), (/2, phys_var_num/))
character(len=13), public, protected :: input_var_names(2, phys_var_num) = reshape((/ &
'theta ', 'pot_temp ', &
'slp ', 'sea_lev_pres ', &
'COOL_CAT ', 'cnst_COOL_CAT' /), (/2, phys_var_num/))

! Array indicating whether or not variable is protected:
logical, public, protected :: protected_vars(phys_var_num)= (/ &
Expand Down
Loading