Skip to content

Commit 4a48220

Browse files
committed
address review comments; add test with dimensionless output variable
1 parent 8b9df0a commit 4a48220

22 files changed

+49
-30
lines changed

src/data/write_init_files.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,7 +1255,7 @@ def write_phys_check_subroutine(outfile, host_dict, host_vars, host_imports,
12551255
call_str += "min_difference, min_relative_value, is_first, diff_found)"
12561256
else:
12571257
# For check field, don't endrun
1258-
call_str = "! do nothing - variable can't be checked"
1258+
call_str = f"! do nothing - '{var_locname}' can't be checked against a file"
12591259
# end if
12601260
# Add string to dictionary:
12611261
call_string_dict[call_string_key] = call_str
@@ -1418,7 +1418,7 @@ def write_phys_check_subroutine(outfile, host_dict, host_vars, host_imports,
14181418
# Generate error message if required variable isn't found:
14191419
outfile.write("case (no_exist_idx)", 5)
14201420
outfile.blank_line()
1421-
outfile.comment("If an index was never found, then do nothing. We won't try to check these.", 6)
1421+
outfile.comment("If the index for an output variable was not found, then do nothing. We won't try to check these.", 6)
14221422
outfile.blank_line()
14231423

14241424
# start default case steps:

test/unit/python/sample_files/write_init_files/phys_vars_init_check_simple.F90

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,21 @@ module phys_vars_init_check_simple
3333
integer, public, parameter :: PARAM = 2
3434
integer, public, parameter :: READ_FROM_FILE = 3
3535
! Total number of physics-related variables:
36-
integer, public, parameter :: phys_var_num = 3
36+
integer, public, parameter :: phys_var_num = 4
3737
integer, public, parameter :: phys_const_num = 16
3838

3939
!Max length of physics-related variable standard names:
4040
integer, public, parameter :: std_name_len = 25
4141

4242
! Max length of input (IC) file variable names:
43-
integer, public, parameter :: ic_name_len = 5
43+
integer, public, parameter :: ic_name_len = 9
4444

4545
! Physics-related input variable standard names:
4646
character(len=25), public, protected :: phys_var_stdnames(phys_var_num) = (/ &
4747
'potential_temperature ', &
4848
'air_pressure_at_sea_level', &
49-
'tendency_of_peverwhee ' /)
49+
'tendency_of_peverwhee ', &
50+
'scalar_variable_llama ' /)
5051

5152
character(len=36), public, protected :: phys_const_stdnames(phys_const_num) = (/ &
5253
"ccpp_constituent_minimum_values ", &
@@ -66,19 +67,22 @@ module phys_vars_init_check_simple
6667
"suite_name ", &
6768
"suite_part " /)
6869
!Array storing all registered IC file input names for each variable:
69-
character(len=5), public, protected :: input_var_names(1, phys_var_num) = reshape((/ &
70-
'theta', &
71-
'slp ', &
72-
'ptend' /), (/1, phys_var_num/))
70+
character(len=9), public, protected :: input_var_names(1, phys_var_num) = reshape((/ &
71+
'theta ', &
72+
'slp ', &
73+
'ptend ', &
74+
'var_nodim' /), (/1, phys_var_num/))
7375

7476
! Array indicating whether or not variable is protected:
7577
logical, public, protected :: protected_vars(phys_var_num)= (/ &
78+
.false., &
7679
.false., &
7780
.false., &
7881
.false. /)
7982

8083
! Variable state (UNINITIALIZED, INTIIALIZED, PARAM or READ_FROM_FILE):
8184
integer, public, protected :: initialized_vars(phys_var_num)= (/ &
85+
UNINITIALIZED, &
8286
UNINITIALIZED, &
8387
UNINITIALIZED, &
8488
UNINITIALIZED /)

test/unit/python/sample_files/write_init_files/physics_inputs_4D.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference,
321321

322322
case (no_exist_idx)
323323

324-
! If an index was never found, then do nothing. We won't try to check these.
324+
! If the index for an output variable was not found, then do nothing. We won't try to check these.
325325

326326
case default
327327

test/unit/python/sample_files/write_init_files/physics_inputs_bvd.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference,
321321

322322
case (no_exist_idx)
323323

324-
! If an index was never found, then do nothing. We won't try to check these.
324+
! If the index for an output variable was not found, then do nothing. We won't try to check these.
325325

326326
case default
327327

test/unit/python/sample_files/write_init_files/physics_inputs_cnst.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference,
321321

322322
case (no_exist_idx)
323323

324-
! If an index was never found, then do nothing. We won't try to check these.
324+
! If the index for an output variable was not found, then do nothing. We won't try to check these.
325325

326326
case default
327327

test/unit/python/sample_files/write_init_files/physics_inputs_constituent_dim.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference,
329329

330330
case (no_exist_idx)
331331

332-
! If an index was never found, then do nothing. We won't try to check these.
332+
! If the index for an output variable was not found, then do nothing. We won't try to check these.
333333

334334
case default
335335

test/unit/python/sample_files/write_init_files/physics_inputs_ddt.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference,
321321

322322
case (no_exist_idx)
323323

324-
! If an index was never found, then do nothing. We won't try to check these.
324+
! If the index for an output variable was not found, then do nothing. We won't try to check these.
325325

326326
case default
327327

test/unit/python/sample_files/write_init_files/physics_inputs_ddt2.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference,
321321

322322
case (no_exist_idx)
323323

324-
! If an index was never found, then do nothing. We won't try to check these.
324+
! If the index for an output variable was not found, then do nothing. We won't try to check these.
325325

326326
case default
327327

test/unit/python/sample_files/write_init_files/physics_inputs_ddt_array.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference,
321321

322322
case (no_exist_idx)
323323

324-
! If an index was never found, then do nothing. We won't try to check these.
324+
! If the index for an output variable was not found, then do nothing. We won't try to check these.
325325

326326
case default
327327

test/unit/python/sample_files/write_init_files/physics_inputs_host_var.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ subroutine physics_check_data(file_name, suite_names, timestep, min_difference,
317317

318318
case (no_exist_idx)
319319

320-
! If an index was never found, then do nothing. We won't try to check these.
320+
! If the index for an output variable was not found, then do nothing. We won't try to check these.
321321

322322
case default
323323

0 commit comments

Comments
 (0)