Skip to content

Commit 68b73b5

Browse files
committed
address next chunk of reviewer comments; through cam_history_support
1 parent 0784bcf commit 68b73b5

File tree

12 files changed

+724
-456
lines changed

12 files changed

+724
-456
lines changed

src/control/cam_comp.F90

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ end subroutine cam_run4
429429
!
430430
!-----------------------------------------------------------------------
431431
!
432-
subroutine cam_timestep_final(rstwr, nlend, do_ncdata_check)
432+
subroutine cam_timestep_final(rstwr, nlend, do_ncdata_check, do_history_write)
433433
!-----------------------------------------------------------------------
434434
!
435435
! Purpose: Timestep final runs at the end of each timestep
@@ -444,12 +444,23 @@ subroutine cam_timestep_final(rstwr, nlend, do_ncdata_check)
444444
!Flag for whether a snapshot (ncdata) check should be run or not
445445
! - flag is true if this is not the first or last step
446446
logical, intent(in) :: do_ncdata_check
447+
!Flag for whether to perform the history write
448+
logical, optional, intent(in) :: do_history_write
447449

448-
if (do_ncdata_check .or. get_nstep() == 0) then
450+
logical :: history_write_loc
451+
452+
if (present(do_history_write)) then
453+
history_write_loc = do_history_write
454+
else
455+
history_write_loc = .true.
456+
end if
457+
458+
if (history_write_loc) then
449459
call history_write_files()
450-
! peverwhee - todo: handle restarts
451-
call history_wrap_up(rstwr, nlend)
452460
end if
461+
! peverwhee - todo: handle restarts
462+
call history_wrap_up(rstwr, nlend)
463+
453464
!
454465
!----------------------------------------------------------
455466
! PHYS_TIMESTEP_FINAL Call the Physics package

src/control/cam_physics_control.F90

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module cam_physics_control
22
!------------------------------------------------------------------------------
33
!
4-
! High level control variables. Information received from the driver/coupler is
5-
! stored here.
4+
! High level physics control variables. Information received from the
5+
! driver/coupler is stored here.
66
!
77
!------------------------------------------------------------------------------
88

@@ -19,15 +19,8 @@ module cam_physics_control
1919
!
2020
! cam_ctrl_set_physics_type
2121

22-
logical, protected :: adiabatic ! true => no physics
23-
logical, protected :: ideal_phys ! true => run Held-Suarez (1994) physics
24-
logical, protected :: kessler_phys ! true => run Kessler physics
25-
logical, protected :: tj2016_phys ! true => run tj2016 physics
26-
logical, protected :: grayrad_phys ! true => run gray radiation (frierson) physics
2722
logical, protected :: simple_phys ! true => adiabatic or ideal_phys or kessler_phys
2823
! or tj2016 or grayrad
29-
logical, protected :: moist_physics ! true => moist physics enabled, i.e.,
30-
! (.not. ideal_phys) .and. (.not. adiabatic)
3124

3225

3326
!==============================================================================
@@ -45,6 +38,12 @@ subroutine cam_ctrl_set_physics_type()
4538
character(len=SHR_KIND_CS), allocatable :: suite_names(:)
4639
! suite_name: CCPP suite we are running
4740
character(len=SHR_KIND_CS) :: suite_name
41+
logical :: adiabatic
42+
logical :: ideal_phys
43+
logical :: kessler_phys
44+
logical :: tj2016_phys
45+
logical :: grayrad_phys
46+
logical :: moist_physics
4847

4948
character(len=*), parameter :: subname = 'cam_ctrl_set_physics_type'
5049

@@ -69,7 +68,7 @@ subroutine cam_ctrl_set_physics_type()
6968
if (masterproc) then
7069
if (adiabatic) then
7170
write(iulog,*) 'Run model ADIABATICALLY (i.e. no physics)'
72-
write(iulog,*) ' Global energy fixer is on for non-Eulerian dycores.'
71+
write(iulog,*) ' Global energy fixer is on for dycores.'
7372
else if (ideal_phys) then
7473
write(iulog,*) 'Run model with Held-Suarez physics forcing'
7574
else if (kessler_phys) then

src/cpl/nuopc/atm_comp_nuopc.F90

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1435,6 +1435,7 @@ subroutine ModelFinalize(gcomp, rc)
14351435
call ESMF_AlarmRingerOff( alarm, rc=rc )
14361436
if (ChkErr(rc,__LINE__,u_FILE_u)) return
14371437
else
1438+
if (ChkErr(rc,__LINE__,u_FILE_u)) return
14381439
rstwr = .false.
14391440
endif
14401441

@@ -1444,12 +1445,14 @@ subroutine ModelFinalize(gcomp, rc)
14441445
if (ChkErr(rc,__LINE__,u_FILE_u)) return
14451446

14461447
if (ESMF_AlarmIsRinging(alarm, rc=rc)) then
1448+
if (ChkErr(rc,__LINE__,u_FILE_u)) return
14471449
nlend = .true.
14481450
else
1451+
if (ChkErr(rc,__LINE__,u_FILE_u)) return
14491452
nlend = .false.
14501453
endif
14511454

1452-
call cam_timestep_final(rstwr, nlend, do_ncdata_check=.false.)
1455+
call cam_timestep_final(rstwr, nlend, do_ncdata_check=.false., do_history_write=.false.)
14531456
call cam_final(cam_out, cam_in)
14541457

14551458
if (masterproc) then

src/data/registry_v1_0.xsd

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -92,18 +92,6 @@
9292
</xs:restriction>
9393
</xs:simpleType>
9494

95-
<xs:simpleType name="netcdf_name_type">
96-
<xs:restriction base="xs:string">
97-
<xs:pattern value="[A-Za-z][A-Za-z0-9_]{0,256}"/>
98-
</xs:restriction>
99-
</xs:simpleType>
100-
101-
<xs:simpleType name="avgflag_type">
102-
<xs:restriction base="xs:string">
103-
<xs:pattern value="[A-Za-z][A-Za-z_]{0,3}"/>
104-
</xs:restriction>
105-
</xs:simpleType>
106-
10795
<!-- attributes -->
10896

10997
<xs:attribute name="access" type="access_type"/>
@@ -137,10 +125,6 @@
137125
<xs:list itemType="input_name_type"/>
138126
</xs:simpleType>
139127

140-
<xs:simpleType name="netcdf_variable_names">
141-
<xs:list itemType="netcdf_name_type"/>
142-
</xs:simpleType>
143-
144128
<!-- definition of complex types -->
145129

146130
<xs:complexType name="initial_value">
@@ -151,21 +135,11 @@
151135
</xs:simpleContent>
152136
</xs:complexType>
153137

154-
<xs:complexType name="diagnostic_type">
155-
<xs:simpleContent>
156-
<xs:extension base="xs:string">
157-
<xs:attribute name="name" type="netcdf_name_type" />
158-
<xs:attribute name="flag" type="netcdf_name_type" />
159-
</xs:extension>
160-
</xs:simpleContent>
161-
</xs:complexType>
162-
163138
<xs:complexType name="array_element_type">
164139
<xs:sequence>
165140
<xs:element name="long_name" type="xs:string" minOccurs="0"/>
166141
<xs:element name="initial_value" type="initial_value" minOccurs="0"/>
167142
<xs:element name="ic_file_input_names" type="ic_file_input_names" minOccurs="0"/>
168-
<xs:element name="diagnostic" type="diagnostic_type" minOccurs="0"/>
169143
</xs:sequence>
170144
<xs:attribute ref="standard_name" use="required"/>
171145
<xs:attribute ref="units" use="optional"/>
@@ -185,7 +159,6 @@
185159
<xs:element name="dimensions" type="dimensions" minOccurs="0"/>
186160
<xs:element name="initial_value" type="initial_value" minOccurs="0" maxOccurs="unbounded"/>
187161
<xs:element name="ic_file_input_names" type="ic_file_input_names" minOccurs="0"/>
188-
<xs:element name="diagnostic" type="diagnostic_type" minOccurs="0"/>
189162
</xs:sequence>
190163
<xs:attribute ref="local_name" use="required"/>
191164
<xs:attribute ref="standard_name" use="required"/>

src/dynamics/utils/hycoef.F90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ subroutine hycoef_init(file, psdry)
258258
if (dry_coord) then
259259
call add_vert_coord('lev', pver, &
260260
'hybrid level at midpoints (1000*(A+B))', 'hPa', alev, &
261+
standard_name='atmosphere_hybrid_sigma_pressure_coordinate', &
261262
positive='down')
262263
call add_hist_coord('hyam', pver, &
263264
'hybrid A coefficient at layer midpoints', '1', hyam, dimname='lev')

src/history/cam_hist_file.F90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -454,9 +454,9 @@ subroutine config_configure(this, volume, out_prec, max_frames, &
454454
inst_fields, avg_fields, min_fields, max_fields, var_fields, &
455455
write_nstep0, interp_out, interp_nlat, interp_nlon, interp_grid, &
456456
interp_type)
457-
use shr_string_mod, only: to_lower => shr_string_toLower
458-
use string_utils, only: parse_multiplier
459-
use cam_abortutils, only: endrun, check_allocate
457+
use shr_string_mod, only: to_lower => shr_string_toLower
458+
use cam_history_support, only: parse_multiplier
459+
use cam_abortutils, only: endrun, check_allocate
460460
! Dummy arguments
461461
class(hist_file_t), intent(inout) :: this
462462
character(len=*), intent(in) :: volume

0 commit comments

Comments
 (0)