Skip to content

Commit

Permalink
Merge branch 'development' into develop-328-orbital-properties
Browse files Browse the repository at this point in the history
  • Loading branch information
mattldawson committed Dec 23, 2024
2 parents da5891c + 4501d8d commit 252cdb1
Show file tree
Hide file tree
Showing 25 changed files with 1,036 additions and 300 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
[submodule "ncar-physics"]
path = src/physics/ncar_ccpp
url = https://github.com/ESCOMP/atmospheric_physics
fxtag = e7a599f4bb1533f7cdcd8723b1f864e11578e96c
fxtag = 491e56247815ef23bfd8dba65d1e3c3b78ba164a
fxrequired = AlwaysRequired
fxDONOTUSEurl = https://github.com/ESCOMP/atmospheric_physics
[submodule "ccs_config"]
Expand Down
3 changes: 1 addition & 2 deletions cime_config/config_component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,7 @@
<value compset="_CAM\d0%WX.*%SDYN">-nlev 145</value> -->

<!-- Simple models -->
<!-- <value compset="_CAM%ADIAB">-phys adiabatic</value>
<value compset="_CAM%DABIP04">-phys adiabatic</value> -->
<value compset="_CAM%ADIAB">--physics-suites adiabatic</value>
<value compset="_CAM%TJ16">--physics-suites tj2016 --analytic_ic</value>
<!-- <value compset="_CAM%KESSLER">-phys kessler -chem terminator -analytic_ic</value> -->
<value compset="_CAM%KESSLER">--physics-suites kessler --analytic_ic</value>
Expand Down
31 changes: 18 additions & 13 deletions src/control/cam_comp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ module cam_comp
use physics_types, only: phys_state, phys_tend
use physics_types, only: dtime_phys
use physics_types, only: calday
use physics_types, only: is_first_timestep, nstep
use dyn_comp, only: dyn_import_t, dyn_export_t

use perf_mod, only: t_barrierf, t_startf, t_stopf
Expand Down Expand Up @@ -151,9 +152,6 @@ subroutine cam_init(caseid, ctitle, model_doi_url, &
character(len=cx) :: errmsg
!-----------------------------------------------------------------------

dtime_phys = 0.0_r8
call mark_as_initialized('timestep_for_physics')

call init_pio_subsystem()

! Initializations using data passed from coupler.
Expand All @@ -169,12 +167,20 @@ subroutine cam_init(caseid, ctitle, model_doi_url, &

call cam_ctrl_set_orbit(eccen, obliqr, lambm0, mvelpp)


call timemgr_init( &
dtime, calendar, start_ymd, start_tod, ref_ymd, &
ref_tod, stop_ymd, stop_tod, curr_ymd, curr_tod, &
perpetual_run, perpetual_ymd, initial_run_in)

dtime_phys = 0.0_r8
call mark_as_initialized('timestep_for_physics')

is_first_timestep = .true.
call mark_as_initialized('is_first_timestep')

nstep = get_nstep()
call mark_as_initialized('current_timestep_number')

! Get current fractional calendar day. Needs to be updated at every timestep.
calday = get_curr_calday()
call mark_as_initialized('fractional_calendar_days_on_end_of_current_timestep')
Expand Down Expand Up @@ -288,6 +294,10 @@ subroutine cam_timestep_init()
! Update the orbital data
call orbital_data_advance(calday, lat_rad, lon_rad)

! Update timestep flags in physics state
is_first_timestep = is_first_step()
nstep = get_nstep()

!----------------------------------------------------------
! First phase of dynamics (at least couple from dynamics to physics)
! Return time-step for physics from dynamics.
Expand Down Expand Up @@ -531,10 +541,6 @@ subroutine cam_final(cam_out, cam_in)
type(cam_out_t), pointer :: cam_out ! Output from CAM to surface
type(cam_in_t), pointer :: cam_in ! Input from merged surface to CAM

!
! Local variable
!
integer :: nstep ! Current timestep number.
!-----------------------------------------------------------------------

call phys_final()
Expand All @@ -557,7 +563,6 @@ subroutine cam_final(cam_out, cam_in)
call shr_sys_flush( iulog ) ! Flush all output to the CAM log file

if (masterproc) then
nstep = get_nstep()
write(iulog,9300) nstep-1,nstep
9300 format (//'Number of completed timesteps:',i6,/,'Time step ',i6, &
' partially done to provide convectively adjusted and ', &
Expand Down Expand Up @@ -615,9 +620,9 @@ subroutine cam_register_constituents(cam_runtime_opts)
if (.not. is_constituent) then

! Allocate host_constituents object:
allocate(host_constituents(1), stat=errflg)
allocate(host_constituents(1), stat=errflg, errmsg=errmsg)
call check_allocate(errflg, subname, 'host_constituents(1)', &
file=__FILE__, line=__LINE__)
file=__FILE__, line=__LINE__, errmsg=errmsg)

! Register the constituents so they can be advected:
call host_constituents(1)%instantiate( &
Expand All @@ -635,9 +640,9 @@ subroutine cam_register_constituents(cam_runtime_opts)
else
! Allocate zero-size object so nothing is added
! to main constituents object:
allocate(host_constituents(0), stat=errflg)
allocate(host_constituents(0), stat=errflg, errmsg=errmsg)
call check_allocate(errflg, subname, 'host_constituents(0)', &
file=__FILE__, line=__LINE__)
file=__FILE__, line=__LINE__, errmsg=errmsg)
end if
!-------------------------------------------

Expand Down
Loading

0 comments on commit 252cdb1

Please sign in to comment.