diff --git a/src/chemistry/aerosol/wetdep.F90 b/src/chemistry/aerosol/wetdep.F90 index a1f80d9deb..fcb01eb48a 100644 --- a/src/chemistry/aerosol/wetdep.F90 +++ b/src/chemistry/aerosol/wetdep.F90 @@ -100,7 +100,7 @@ subroutine wetdep_init() !============================================================================== subroutine wetdep_inputs_set( state, pbuf, inputs ) use physics_types, only: physics_state - use physics_buffer, only: physics_buffer_desc, pbuf_get_field, pbuf_old_tim_idx + use physics_buffer, only: physics_buffer_desc, pbuf_get_field ! args @@ -122,12 +122,11 @@ subroutine wetdep_inputs_set( state, pbuf, inputs ) real(r8) :: rainmr(pcols,pver) ! mixing ratio of rain within cloud volume real(r8) :: cldst(pcols,pver) ! Stratiform cloud fraction - integer :: itim, ncol + integer :: ncol ncol = state%ncol - itim = pbuf_old_tim_idx() - call pbuf_get_field(pbuf, cld_idx, inputs%cldt, start=(/1,1,itim/), kount=(/pcols,pver,1/) ) + call pbuf_get_field(pbuf, cld_idx, inputs%cldt ) call pbuf_get_field(pbuf, qme_idx, inputs%qme ) call pbuf_get_field(pbuf, prain_idx, inputs%prain ) call pbuf_get_field(pbuf, nevapr_idx, inputs%evapr ) diff --git a/src/chemistry/geoschem/chemistry.F90 b/src/chemistry/geoschem/chemistry.F90 index 8c54d071f9..1f296fc010 100644 --- a/src/chemistry/geoschem/chemistry.F90 +++ b/src/chemistry/geoschem/chemistry.F90 @@ -1944,7 +1944,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) use mo_neu_wetdep, only : neu_wetdep_tend use mo_setinv, only : setinv use orbit, only : zenith ! For computing SZA - use physics_buffer, only : physics_buffer_desc, pbuf_get_field, pbuf_old_tim_idx + use physics_buffer, only : physics_buffer_desc, pbuf_get_field use physics_buffer, only : pbuf_get_chunk, pbuf_get_index use perf_mod, only : t_startf, t_stopf use phys_grid, only : get_ncols_p, get_rlat_all_p, get_rlon_all_p @@ -2141,7 +2141,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) REAL(r8), POINTER :: pbuf_i(:) ! ptr to pbuf data (/pcols/) horizontal only (horiz_only) INTEGER :: tmpIdx ! pbuf field id - INTEGER :: TIM_NDX INTEGER :: IERR INTEGER, SAVE :: iStep = 0 @@ -2660,11 +2659,10 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dT, pbuf, fh2o ) CALL Zenith( Calday, Rlats, Rlons, CSZA, nY ) ! Get all required data from physics buffer - TIM_NDX = pbuf_old_tim_idx() CALL pbuf_get_field( pbuf, NDX_PBLH, PblH ) CALL pbuf_get_field( pbuf, NDX_FSDS, Fsds ) CALL pbuf_get_field( pbuf, NDX_CLDTOP, cldTop ) - CALL pbuf_get_field( pbuf, NDX_CLDFRC, cldFrc, START=(/1,1,TIM_NDX/), KOUNT=(/NCOL,PVER,1/) ) + CALL pbuf_get_field( pbuf, NDX_CLDFRC, cldFrc ) CALL pbuf_get_field( pbuf, NDX_NEVAPR, NEvapr, START=(/1,1/), KOUNT=(/NCOL,PVER/)) CALL pbuf_get_field( pbuf, NDX_PRAIN, PRain, START=(/1,1/), KOUNT=(/NCOL,PVER/)) CALL pbuf_get_field( pbuf, NDX_LSFLXPRC, LsFlxPrc, START=(/1,1/), KOUNT=(/NCOL,PVERP/)) diff --git a/src/chemistry/mozart/chemistry.F90 b/src/chemistry/mozart/chemistry.F90 index 8181e0923e..4c53ebd3ff 100644 --- a/src/chemistry/mozart/chemistry.F90 +++ b/src/chemistry/mozart/chemistry.F90 @@ -1163,7 +1163,7 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dt, pbuf, fh2o) ! !----------------------------------------------------------------------- - use physics_buffer, only : physics_buffer_desc, pbuf_get_field, pbuf_old_tim_idx + use physics_buffer, only : physics_buffer_desc, pbuf_get_field use cam_history, only : outfld use time_manager, only : get_curr_calday use mo_gas_phase_chemdr, only : gas_phase_chemdr @@ -1214,7 +1214,6 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dt, pbuf, fh2o) real(r8) :: nhx_nitrogen_flx(pcols) real(r8) :: noy_nitrogen_flx(pcols) - integer :: tim_ndx logical :: lq(pcnst) @@ -1260,11 +1259,10 @@ subroutine chem_timestep_tend( state, ptend, cam_in, cam_out, dt, pbuf, fh2o) call tropopause_findChemTrop(state, tropLevChem) endif - tim_ndx = pbuf_old_tim_idx() call pbuf_get_field(pbuf, ndx_fsds, fsds) call pbuf_get_field(pbuf, ndx_pblh, pblh) call pbuf_get_field(pbuf, ndx_prain, prain, start=(/1,1/), kount=(/ncol,pver/)) - call pbuf_get_field(pbuf, ndx_cld, cldfr, start=(/1,1,tim_ndx/), kount=(/ncol,pver,1/) ) + call pbuf_get_field(pbuf, ndx_cld, cldfr ) call pbuf_get_field(pbuf, ndx_cmfdqr, cmfdqr, start=(/1,1/), kount=(/ncol,pver/)) call pbuf_get_field(pbuf, ndx_nevapr, nevapr, start=(/1,1/), kount=(/ncol,pver/)) call pbuf_get_field(pbuf, ndx_cldtop, cldtop ) diff --git a/src/chemistry/mozart/mo_gas_phase_chemdr.F90 b/src/chemistry/mozart/mo_gas_phase_chemdr.F90 index 51dd46ff73..ff66c2f90e 100644 --- a/src/chemistry/mozart/mo_gas_phase_chemdr.F90 +++ b/src/chemistry/mozart/mo_gas_phase_chemdr.F90 @@ -323,7 +323,7 @@ subroutine gas_phase_chemdr(state, lchnk, ncol, imozart, q, & use mo_chm_diags, only : chm_diags, het_diags use perf_mod, only : t_startf, t_stopf use gas_wetdep_opts, only : gas_wetdep_method - use physics_buffer, only : physics_buffer_desc, pbuf_get_field, pbuf_old_tim_idx + use physics_buffer, only : physics_buffer_desc, pbuf_get_field use physics_types, only : physics_state use infnan, only : nan, assignment(=) use rate_diags, only : rate_diags_calc, rate_diags_o3s_loss @@ -398,7 +398,6 @@ subroutine gas_phase_chemdr(state, lchnk, ncol, imozart, q, & real(r8), pointer :: cldtop(:) integer :: i, k, m, n - integer :: tim_ndx real(r8) :: delt_inverse real(r8) :: esfact real(r8) :: invariants(ncol,pver,nfs) @@ -530,9 +529,8 @@ subroutine gas_phase_chemdr(state, lchnk, ncol, imozart, q, & !----------------------------------------------------------------------- call get_rlat_all_p( lchnk, ncol, rlats ) call get_rlon_all_p( lchnk, ncol, rlons ) - tim_ndx = pbuf_old_tim_idx() call pbuf_get_field(pbuf, ndx_prain, prain, start=(/1,1/), kount=(/ncol,pver/)) - call pbuf_get_field(pbuf, ndx_cldfr, cldfr, start=(/1,1,tim_ndx/), kount=(/ncol,pver,1/) ) + call pbuf_get_field(pbuf, ndx_cldfr, cldfr ) call pbuf_get_field(pbuf, ndx_cmfdqr, cmfdqr, start=(/1,1/), kount=(/ncol,pver/)) call pbuf_get_field(pbuf, ndx_nevapr, nevapr, start=(/1,1/), kount=(/ncol,pver/)) call pbuf_get_field(pbuf, ndx_cldtop, cldtop ) diff --git a/src/chemistry/utils/modal_aero_calcsize.F90 b/src/chemistry/utils/modal_aero_calcsize.F90 index 696713af1e..1be210130b 100644 --- a/src/chemistry/utils/modal_aero_calcsize.F90 +++ b/src/chemistry/utils/modal_aero_calcsize.F90 @@ -8,7 +8,7 @@ module modal_aero_calcsize use ppgrid, only: pcols, pver use physics_types, only: physics_state, physics_ptend -use physics_buffer, only: physics_buffer_desc, pbuf_get_index, pbuf_old_tim_idx, pbuf_get_field +use physics_buffer, only: physics_buffer_desc, pbuf_get_index, pbuf_get_field use phys_control, only: phys_getopts use aerosol_properties_mod, only: aerosol_properties diff --git a/src/chemistry/utils/modal_aero_wateruptake.F90 b/src/chemistry/utils/modal_aero_wateruptake.F90 index 0f14d81fac..6183b73c82 100644 --- a/src/chemistry/utils/modal_aero_wateruptake.F90 +++ b/src/chemistry/utils/modal_aero_wateruptake.F90 @@ -6,7 +6,7 @@ module modal_aero_wateruptake use physconst, only: pi, rhoh2o, rair use ppgrid, only: pcols, pver use physics_types, only: physics_state -use physics_buffer, only: physics_buffer_desc, pbuf_get_index, pbuf_old_tim_idx, pbuf_get_field +use physics_buffer, only: physics_buffer_desc, pbuf_get_index, pbuf_get_field use wv_saturation, only: qsat_water use aerosol_properties_mod, only: aerosol_properties @@ -204,7 +204,6 @@ subroutine modal_aero_wateruptake_dr(state, pbuf, aero_props, aero_state, & integer :: stat integer :: i, k, l, m - integer :: itim_old integer :: nmodes integer :: nspec integer :: tropLev(pcols) @@ -419,8 +418,7 @@ subroutine modal_aero_wateruptake_dr(state, pbuf, aero_props, aero_state, & ! relative humidity calc - itim_old = pbuf_old_tim_idx() - call pbuf_get_field(pbuf, cld_idx, cldn, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) + call pbuf_get_field(pbuf, cld_idx, cldn ) do k = top_lev, pver call qsat_water(t(1:ncol,k), pmid(1:ncol,k), es(1:ncol), qs(1:ncol), ncol) diff --git a/src/dynamics/fv/dyn_grid.F90 b/src/dynamics/fv/dyn_grid.F90 index 610df45831..c1b824fb92 100644 --- a/src/dynamics/fv/dyn_grid.F90 +++ b/src/dynamics/fv/dyn_grid.F90 @@ -60,8 +60,6 @@ module dyn_grid integer, parameter, public :: dyn_vstag_decomp = 103 integer, parameter, public :: dyn_zonal_decomp = 104 -integer, parameter, public :: ptimelevels = 2 ! number of time levels in the dycore - integer :: ngcols_d = 0 ! number of dynamics columns type(t_fvdycore_grid), pointer :: grid diff --git a/src/dynamics/mpas/dyn_grid.F90 b/src/dynamics/mpas/dyn_grid.F90 index 3195e5ebbc..fec90d5069 100644 --- a/src/dynamics/mpas/dyn_grid.F90 +++ b/src/dynamics/mpas/dyn_grid.F90 @@ -45,11 +45,9 @@ module dyn_grid ! uses ncol, lat, lon integer, parameter :: edge_decomp = 102 ! edge node grid integer, parameter :: vertex_decomp = 103 ! vertex node grid -integer, parameter :: ptimelevels = 2 public :: & dyn_decomp, & - ptimelevels, & dyn_grid_init, & get_dyn_grid_info, & get_horiz_grid_dim_d, & diff --git a/src/dynamics/se/dyn_grid.F90 b/src/dynamics/se/dyn_grid.F90 index 69d9bbc520..816eaf7710 100644 --- a/src/dynamics/se/dyn_grid.F90 +++ b/src/dynamics/se/dyn_grid.F90 @@ -65,8 +65,6 @@ module dyn_grid ! Name of horizontal grid dimension in initial file. character(len=6), protected :: ini_grid_hdim_name = '' -integer, parameter :: ptimelevels = 2 - type (TimeLevel_t) :: TimeLevel ! main time level struct (used by tracers) type (hvcoord_t) :: hvcoord type(element_t), pointer :: elem(:) => null() ! local GLL elements for this task @@ -75,7 +73,6 @@ module dyn_grid public :: dyn_decomp public :: ini_grid_name public :: ini_grid_hdim_name -public :: ptimelevels public :: TimeLevel public :: hvcoord public :: elem diff --git a/src/physics/cam/cam_diagnostics.F90 b/src/physics/cam/cam_diagnostics.F90 index 80bf837865..8db5c363a9 100644 --- a/src/physics/cam/cam_diagnostics.F90 +++ b/src/physics/cam/cam_diagnostics.F90 @@ -10,7 +10,7 @@ module cam_diagnostics use physics_types, only: physics_state, physics_tend, physics_ptend use ppgrid, only: pcols, pver, begchunk, endchunk use physics_buffer, only: physics_buffer_desc, pbuf_add_field, dtype_r8 -use physics_buffer, only: dyn_time_lvls, pbuf_get_field, pbuf_get_index, pbuf_old_tim_idx +use physics_buffer, only: pbuf_get_field, pbuf_get_index use cam_history, only: outfld, write_inithist, hist_fld_active, inithist_all, write_camiop use cam_history_support, only: max_fieldname_len @@ -164,9 +164,9 @@ subroutine diag_register_dry() call pbuf_add_field('PSL', 'physpkg', dtype_r8, (/pcols/), psl_idx) ! Request physics buffer space for fields that persist across timesteps. - call pbuf_add_field('T_TTEND', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), t_ttend_idx) - call pbuf_add_field('T_UTEND', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), t_utend_idx) - call pbuf_add_field('T_VTEND', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), t_vtend_idx) + call pbuf_add_field('T_TTEND', 'global', dtype_r8, (/pcols,pver/), t_ttend_idx) + call pbuf_add_field('T_UTEND', 'global', dtype_r8, (/pcols,pver/), t_utend_idx) + call pbuf_add_field('T_VTEND', 'global', dtype_r8, (/pcols,pver/), t_vtend_idx) end subroutine diag_register_dry subroutine diag_register_moist() @@ -899,14 +899,12 @@ subroutine diag_conv_tend_ini(state,pbuf) !! initialize to pbuf T_TTEND to temperature at first timestep if (is_first_step()) then - do m = 1, dyn_time_lvls - call pbuf_get_field(pbuf, t_ttend_idx, t_ttend, start=(/1,1,m/), kount=(/pcols,pver,1/)) - t_ttend(:ncol,:) = state%t(:ncol,:) - call pbuf_get_field(pbuf, t_utend_idx, t_utend, start=(/1,1,m/), kount=(/pcols,pver,1/)) - t_utend(:ncol,:) = state%u(:ncol,:) - call pbuf_get_field(pbuf, t_vtend_idx, t_vtend, start=(/1,1,m/), kount=(/pcols,pver,1/)) - t_vtend(:ncol,:) = state%v(:ncol,:) - end do + call pbuf_get_field(pbuf, t_ttend_idx, t_ttend) + t_ttend(:ncol,:) = state%t(:ncol,:) + call pbuf_get_field(pbuf, t_utend_idx, t_utend) + t_utend(:ncol,:) = state%u(:ncol,:) + call pbuf_get_field(pbuf, t_vtend_idx, t_vtend) + t_vtend(:ncol,:) = state%v(:ncol,:) end if end subroutine diag_conv_tend_ini @@ -1950,7 +1948,6 @@ subroutine diag_physvar_ic (lchnk, pbuf, cam_out, cam_in) ! !---------------------------Local workspace----------------------------- ! - integer :: itim_old ! indices real(r8), pointer, dimension(:,:) :: cwat_var real(r8), pointer, dimension(:,:) :: conv_var_3d @@ -1964,35 +1961,34 @@ subroutine diag_physvar_ic (lchnk, pbuf, cam_out, cam_in) ! ! Associate pointers with physics buffer fields ! - itim_old = pbuf_old_tim_idx() if (qcwat_idx > 0) then - call pbuf_get_field(pbuf, qcwat_idx, cwat_var, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) + call pbuf_get_field(pbuf, qcwat_idx, cwat_var ) call outfld('QCWAT&IC ',cwat_var, pcols,lchnk) end if if (tcwat_idx > 0) then - call pbuf_get_field(pbuf, tcwat_idx, cwat_var, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) + call pbuf_get_field(pbuf, tcwat_idx, cwat_var ) call outfld('TCWAT&IC ',cwat_var, pcols,lchnk) end if if (lcwat_idx > 0) then - call pbuf_get_field(pbuf, lcwat_idx, cwat_var, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) + call pbuf_get_field(pbuf, lcwat_idx, cwat_var ) call outfld('LCWAT&IC ',cwat_var, pcols,lchnk) end if if (cld_idx > 0) then - call pbuf_get_field(pbuf, cld_idx, cwat_var, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) + call pbuf_get_field(pbuf, cld_idx, cwat_var ) call outfld('CLOUD&IC ',cwat_var, pcols,lchnk) end if if (concld_idx > 0) then - call pbuf_get_field(pbuf, concld_idx, cwat_var, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) + call pbuf_get_field(pbuf, concld_idx, cwat_var ) call outfld('CONCLD&IC ',cwat_var, pcols,lchnk) end if if (cush_idx > 0) then - call pbuf_get_field(pbuf, cush_idx, conv_var_2d ,(/1,itim_old/), (/pcols,1/)) + call pbuf_get_field(pbuf, cush_idx, conv_var_2d ) call outfld('CUSH&IC ',conv_var_2d, pcols,lchnk) end if @@ -2064,7 +2060,7 @@ subroutine diag_phys_tend_writeout_dry(state, pbuf, tend, ztodt) real(r8), pointer, dimension(:,:) :: t_ttend real(r8), pointer, dimension(:,:) :: t_utend real(r8), pointer, dimension(:,:) :: t_vtend - integer :: itim_old,m + integer :: m !----------------------------------------------------------------------- @@ -2093,10 +2089,9 @@ subroutine diag_phys_tend_writeout_dry(state, pbuf, tend, ztodt) ! Total (physics+dynamics, everything!) tendency for Temperature !! get temperature, U, and V stored in physics buffer - itim_old = pbuf_old_tim_idx() - call pbuf_get_field(pbuf, t_ttend_idx, t_ttend, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) - call pbuf_get_field(pbuf, t_utend_idx, t_utend, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) - call pbuf_get_field(pbuf, t_vtend_idx, t_vtend, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) + call pbuf_get_field(pbuf, t_ttend_idx, t_ttend) + call pbuf_get_field(pbuf, t_utend_idx, t_utend) + call pbuf_get_field(pbuf, t_vtend_idx, t_vtend) !! calculate and outfld the total temperature, U, and V tendencies ftem3(:ncol,:) = (state%t(:ncol,:) - t_ttend(:ncol,:))/ztodt diff --git a/src/physics/cam/check_energy.F90 b/src/physics/cam/check_energy.F90 index 7959f58c79..07f506ea6b 100644 --- a/src/physics/cam/check_energy.F90 +++ b/src/physics/cam/check_energy.F90 @@ -126,7 +126,7 @@ subroutine check_energy_register() ! !----------------------------------------------------------------------- - use physics_buffer, only : pbuf_add_field, dtype_r8, dyn_time_lvls + use physics_buffer, only : pbuf_add_field, dtype_r8 use physics_buffer, only : pbuf_register_subcol use subcol_utils, only : is_subcol_on @@ -134,12 +134,12 @@ subroutine check_energy_register() ! Request physics buffer space for fields that persist across timesteps. - call pbuf_add_field('TEOUT', 'global',dtype_r8 , (/pcols,dyn_time_lvls/), teout_idx) - call pbuf_add_field('DTCORE','global',dtype_r8, (/pcols,pver,dyn_time_lvls/),dtcore_idx) + call pbuf_add_field('TEOUT', 'global',dtype_r8 , (/pcols/), teout_idx) + call pbuf_add_field('DTCORE','global',dtype_r8, (/pcols,pver/),dtcore_idx) ! DQCORE refers to dycore tendency of water vapor - call pbuf_add_field('DQCORE','global',dtype_r8, (/pcols,pver,dyn_time_lvls/),dqcore_idx) - call pbuf_add_field('DUCORE','global',dtype_r8, (/pcols,pver,dyn_time_lvls/),ducore_idx) - call pbuf_add_field('DVCORE','global',dtype_r8, (/pcols,pver,dyn_time_lvls/),dvcore_idx) + call pbuf_add_field('DQCORE','global',dtype_r8, (/pcols,pver/),dqcore_idx) + call pbuf_add_field('DUCORE','global',dtype_r8, (/pcols,pver/),ducore_idx) + call pbuf_add_field('DVCORE','global',dtype_r8, (/pcols,pver/),dvcore_idx) if(is_subcol_on()) then call pbuf_register_subcol('TEOUT', 'phys_register', teout_idx) call pbuf_register_subcol('DTCORE', 'phys_register', dtcore_idx) diff --git a/src/physics/cam/cloud_diagnostics.F90 b/src/physics/cam/cloud_diagnostics.F90 index c1ad0fa99c..8b1e6343e0 100644 --- a/src/physics/cam/cloud_diagnostics.F90 +++ b/src/physics/cam/cloud_diagnostics.F90 @@ -219,7 +219,7 @@ subroutine cloud_diagnostics_calc(state, pbuf) ! **** mixes interface and physics code temporarily !----------------------------------------------------------------------- use physics_types, only: physics_state - use physics_buffer,only: physics_buffer_desc, pbuf_get_field, pbuf_old_tim_idx + use physics_buffer,only: physics_buffer_desc, pbuf_get_field use cloud_optical_properties, only: cldovrlap, cldclw, cldems_rk, cldems use conv_water, only: conv_water_in_rad, conv_water_4rad use radiation, only: radiation_do @@ -257,7 +257,6 @@ subroutine cloud_diagnostics_calc(state, pbuf) real(r8), pointer :: totg_ice(:,:) ! grid box total cloud ice mixing ratio real(r8), pointer :: totg_liq(:,:) ! grid box total cloud liquid mixing ratio - integer :: itim_old real(r8) :: cwp (pcols,pver) ! in-cloud cloud (total) water path real(r8) :: gicewp(pcols,pver) ! grid-box cloud ice water path @@ -307,8 +306,7 @@ subroutine cloud_diagnostics_calc(state, pbuf) ncol = state%ncol lchnk = state%lchnk - itim_old = pbuf_old_tim_idx() - call pbuf_get_field(pbuf, cld_idx, cld, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) + call pbuf_get_field(pbuf, cld_idx, cld ) call pbuf_get_field(pbuf, gb_totcldicemr_idx, totg_ice) call pbuf_get_field(pbuf, gb_totcldliqmr_idx, totg_liq) diff --git a/src/physics/cam/cloud_rad_props.F90 b/src/physics/cam/cloud_rad_props.F90 index da15a72a96..61fbaa780d 100644 --- a/src/physics/cam/cloud_rad_props.F90 +++ b/src/physics/cam/cloud_rad_props.F90 @@ -6,7 +6,7 @@ module cloud_rad_props use shr_kind_mod, only: r8 => shr_kind_r8 use ppgrid, only: pcols, pver, pverp use physics_types, only: physics_state -use physics_buffer, only: physics_buffer_desc, pbuf_get_index, pbuf_get_field, pbuf_old_tim_idx +use physics_buffer, only: physics_buffer_desc, pbuf_get_index, pbuf_get_field use constituents, only: cnst_get_ind use radconstants, only: nswbands, nlwbands, idx_sw_diag use rad_constituents, only: iceopticsfile, liqopticsfile diff --git a/src/physics/cam/clubb_intr.F90 b/src/physics/cam/clubb_intr.F90 index 0620c89a40..e3daf9daa9 100644 --- a/src/physics/cam/clubb_intr.F90 +++ b/src/physics/cam/clubb_intr.F90 @@ -518,7 +518,7 @@ subroutine clubb_register_cam( ) !------------------------------------------------ ! ! Add CLUBB fields to pbuf - use physics_buffer, only: pbuf_add_field, dtype_r8, dtype_i4, dyn_time_lvls + use physics_buffer, only: pbuf_add_field, dtype_r8, dtype_i4 use subcol_utils, only: subcol_get_scheme !----- Begin Code ----- @@ -561,13 +561,13 @@ subroutine clubb_register_cam( ) call pbuf_add_field('tke', 'global', dtype_r8, (/pcols, pverp/), tke_idx) call pbuf_add_field('kvh', 'global', dtype_r8, (/pcols, pverp/), kvh_idx) call pbuf_add_field('tpert', 'global', dtype_r8, (/pcols/), tpert_idx) - call pbuf_add_field('AST', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), ast_idx) - call pbuf_add_field('AIST', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), aist_idx) - call pbuf_add_field('ALST', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), alst_idx) - call pbuf_add_field('QIST', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), qist_idx) - call pbuf_add_field('QLST', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), qlst_idx) - call pbuf_add_field('CONCLD', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), concld_idx) - call pbuf_add_field('CLD', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), cld_idx) + call pbuf_add_field('AST', 'global', dtype_r8, (/pcols,pver/), ast_idx) + call pbuf_add_field('AIST', 'global', dtype_r8, (/pcols,pver/), aist_idx) + call pbuf_add_field('ALST', 'global', dtype_r8, (/pcols,pver/), alst_idx) + call pbuf_add_field('QIST', 'global', dtype_r8, (/pcols,pver/), qist_idx) + call pbuf_add_field('QLST', 'global', dtype_r8, (/pcols,pver/), qlst_idx) + call pbuf_add_field('CONCLD', 'global', dtype_r8, (/pcols,pver/), concld_idx) + call pbuf_add_field('CLD', 'global', dtype_r8, (/pcols,pver/), cld_idx) call pbuf_add_field('FICE', 'physpkg',dtype_r8, (/pcols,pver/), fice_idx) call pbuf_add_field('CMELIQ', 'physpkg',dtype_r8, (/pcols,pver/), cmeliq_idx) call pbuf_add_field('QSATFAC', 'physpkg',dtype_r8, (/pcols,pver/), qsatfac_idx) @@ -2073,7 +2073,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, & physics_state_copy, physics_ptend_init, & physics_ptend_sum, physics_update, set_wet_to_dry - use physics_buffer, only: pbuf_old_tim_idx, pbuf_get_field, physics_buffer_desc + use physics_buffer, only: pbuf_get_field, physics_buffer_desc use physics_buffer, only: pbuf_set_field use constituents, only: cnst_get_ind, cnst_type @@ -2550,7 +2550,6 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, & k_cam, k_clubb, sclr, iedsclr, & ! Loop variables ixcldice, ixcldliq, ixnumliq, & ixnumice, ixq, & - itim_old, & ncol, lchnk, & ! # of columns, and chunk identifier icnt, & stats_nsamp, stats_nout ! Stats sampling and output intervals for CLUBB [timestep] @@ -2592,7 +2591,6 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, & call cnst_get_ind('NUMICE',ixnumice) ! Determine time step of physics buffer - itim_old = pbuf_old_tim_idx() ! Establish associations between pointers and physics buffer fields call pbuf_get_field(pbuf, wp2_idx, wp2_pbuf ) @@ -2638,13 +2636,13 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, & call pbuf_get_field(pbuf, tke_idx, tke_pbuf) call pbuf_get_field(pbuf, qrl_idx, qrl_pbuf) - call pbuf_get_field(pbuf, cld_idx, cld_pbuf, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) - call pbuf_get_field(pbuf, concld_idx, concld_pbuf, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) - call pbuf_get_field(pbuf, ast_idx, ast_pbuf, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) - call pbuf_get_field(pbuf, alst_idx, alst_pbuf, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) - call pbuf_get_field(pbuf, aist_idx, aist_pbuf, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) - call pbuf_get_field(pbuf, qlst_idx, qlst_pbuf, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) - call pbuf_get_field(pbuf, qist_idx, qist_pbuf, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) + call pbuf_get_field(pbuf, cld_idx, cld_pbuf) + call pbuf_get_field(pbuf, concld_idx, concld_pbuf) + call pbuf_get_field(pbuf, ast_idx, ast_pbuf) + call pbuf_get_field(pbuf, alst_idx, alst_pbuf) + call pbuf_get_field(pbuf, aist_idx, aist_pbuf) + call pbuf_get_field(pbuf, qlst_idx, qlst_pbuf) + call pbuf_get_field(pbuf, qist_idx, qist_pbuf) call pbuf_get_field(pbuf, qsatfac_idx, qsatfac_pbuf) diff --git a/src/physics/cam/conv_water.F90 b/src/physics/cam/conv_water.F90 index fb054c87b1..3c0f56437e 100644 --- a/src/physics/cam/conv_water.F90 +++ b/src/physics/cam/conv_water.F90 @@ -186,7 +186,7 @@ subroutine conv_water_4rad(state, pbuf) !---------------------------------------------------------------------- ! - use physics_buffer, only : physics_buffer_desc, pbuf_get_field, pbuf_old_tim_idx + use physics_buffer, only : physics_buffer_desc, pbuf_get_field use physics_types, only: physics_state use cam_history, only: outfld @@ -228,7 +228,7 @@ subroutine conv_water_4rad(state, pbuf) real(r8) :: tot_ice(pcols,pver) ! Total IC ice real(r8) :: tot_liq(pcols,pver) ! Total IC liquid - integer :: i,k,itim_old ! Lon, lev indices buff stuff. + integer :: i, k ! Lon, lev indices buff stuff. real(r8) :: cu_icwmr ! Convective water for this grid-box. real(r8) :: ls_icwmr ! Large-scale water for this grid-box. real(r8) :: tot_icwmr ! Large-scale water for this grid-box. @@ -277,8 +277,7 @@ subroutine conv_water_4rad(state, pbuf) call pbuf_get_field(pbuf, dp_frac_idx, dp_frac ) call pbuf_get_field(pbuf, rei_idx, rei ) - itim_old = pbuf_old_tim_idx() - call pbuf_get_field(pbuf, ast_idx, ast, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) + call pbuf_get_field(pbuf, ast_idx, ast ) ! Fields computed below and stored in pbuf. call pbuf_get_field(pbuf, gb_totcldicemr_idx, totg_ice) diff --git a/src/physics/cam/convect_shallow.F90 b/src/physics/cam/convect_shallow.F90 index a6538d43fa..2a768d1476 100644 --- a/src/physics/cam/convect_shallow.F90 +++ b/src/physics/cam/convect_shallow.F90 @@ -83,7 +83,7 @@ subroutine convect_shallow_register ! Purpose : Register fields with the physics buffer ! !-------------------------------------------------- ! - use physics_buffer, only : pbuf_add_field, dtype_r8, dyn_time_lvls + use physics_buffer, only : pbuf_add_field, dtype_r8 use phys_control, only: use_gw_convect_sh call phys_getopts( shallow_scheme_out = shallow_scheme, microp_scheme_out = microp_scheme) @@ -93,7 +93,7 @@ subroutine convect_shallow_register call pbuf_add_field('RPRDTOT', 'physpkg' ,dtype_r8,(/pcols,pver/), rprdtot_idx ) call pbuf_add_field('CLDTOP', 'physpkg' ,dtype_r8,(/pcols,1/), cldtop_idx ) call pbuf_add_field('CLDBOT', 'physpkg' ,dtype_r8,(/pcols,1/), cldbot_idx ) - call pbuf_add_field('cush', 'global' ,dtype_r8,(/pcols,dyn_time_lvls/), cush_idx ) + call pbuf_add_field('cush', 'global' ,dtype_r8,(/pcols/), cush_idx ) call pbuf_add_field('NEVAPR_SHCU','physpkg' ,dtype_r8,(/pcols,pver/), nevapr_shcu_idx ) call pbuf_add_field('PREC_SH', 'physpkg' ,dtype_r8,(/pcols/), prec_sh_idx ) call pbuf_add_field('SNOW_SH', 'physpkg' ,dtype_r8,(/pcols/), snow_sh_idx ) @@ -309,7 +309,7 @@ subroutine convect_shallow_tend( ztodt , cmfmc , & qc , qc2 , rliq , rliq2 , & state , ptend_all, pbuf, cam_in) - use physics_buffer, only : physics_buffer_desc, pbuf_get_field, pbuf_set_field, pbuf_old_tim_idx + use physics_buffer, only : physics_buffer_desc, pbuf_get_field, pbuf_set_field use cam_history, only : outfld use physics_types, only : physics_state, physics_ptend use physics_types, only : physics_ptend_init, physics_update @@ -410,7 +410,7 @@ subroutine convect_shallow_tend( ztodt , cmfmc , & type(physics_state) :: state1 ! Locally modify for evaporation to use, not returned type(physics_ptend) :: ptend_loc ! Local tendency from processes, added up to return as ptend_all - integer itim_old, ifld + integer ifld real(r8), pointer, dimension(:,:) :: cld real(r8), pointer, dimension(:,:) :: concld real(r8), pointer, dimension(:,:) :: icwmr ! In cloud water + ice mixing ratio @@ -457,9 +457,8 @@ subroutine convect_shallow_tend( ztodt , cmfmc , & ! Associate pointers with physics buffer fields - itim_old = pbuf_old_tim_idx() - call pbuf_get_field(pbuf, cld_idx, cld, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) - call pbuf_get_field(pbuf, concld_idx, concld, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) + call pbuf_get_field(pbuf, cld_idx, cld) + call pbuf_get_field(pbuf, concld_idx, concld) call pbuf_get_field(pbuf, icwmrsh_idx, icwmr) @@ -545,7 +544,7 @@ subroutine convect_shallow_tend( ztodt , cmfmc , & lq(:) = .TRUE. call physics_ptend_init( ptend_loc, state%psetcols, 'UWSHCU', ls=.true., lu=.true., lv=.true., lq=lq ) - call pbuf_get_field(pbuf, cush_idx, cush ,(/1,itim_old/), (/pcols,1/)) + call pbuf_get_field(pbuf, cush_idx, cush ) call pbuf_get_field(pbuf, tke_idx, tke) diff --git a/src/physics/cam/cospsimulator_intr.F90 b/src/physics/cam/cospsimulator_intr.F90 index 3ecabe1340..6ce92fe325 100644 --- a/src/physics/cam/cospsimulator_intr.F90 +++ b/src/physics/cam/cospsimulator_intr.F90 @@ -1442,7 +1442,7 @@ subroutine cospsimulator_intr_run(state, pbuf, cam_in, emis, coszrs, & cld_swtau_in, snow_tau_in, snow_emis_in) use physics_types, only: physics_state - use physics_buffer, only: physics_buffer_desc, pbuf_get_field, pbuf_old_tim_idx + use physics_buffer, only: physics_buffer_desc, pbuf_get_field use camsrfexch, only: cam_in_t use constituents, only: cnst_get_ind use rad_constituents, only: rad_cnst_get_gas @@ -1479,7 +1479,6 @@ subroutine cospsimulator_intr_run(state, pbuf, cam_in, emis, coszrs, & integer :: lchnk ! chunk identifier integer :: ncol ! number of active atmospheric columns integer :: i, k, kk - integer :: itim_old integer :: ip, it integer :: ipt integer :: ih, ihd, ihs, ihsc, ihm, ihmt, ihml @@ -2104,9 +2103,8 @@ subroutine cospsimulator_intr_run(state, pbuf, cam_in, emis, coszrs, & ! Note: no radiatively active CO or SO2 in RRTMG or at least in CESM2. ! fields from physics buffer - itim_old = pbuf_old_tim_idx() - call pbuf_get_field(pbuf, cld_idx, cld, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) - call pbuf_get_field(pbuf, concld_idx, concld, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) + call pbuf_get_field(pbuf, cld_idx, cld ) + call pbuf_get_field(pbuf, concld_idx, concld ) call pbuf_get_field(pbuf, rel_idx, rel ) call pbuf_get_field(pbuf, rei_idx, rei ) call pbuf_get_field(pbuf, dei_idx, dei ) diff --git a/src/physics/cam/ebert_curry_ice_optics.F90 b/src/physics/cam/ebert_curry_ice_optics.F90 index 8d9b4985a7..95942767fa 100644 --- a/src/physics/cam/ebert_curry_ice_optics.F90 +++ b/src/physics/cam/ebert_curry_ice_optics.F90 @@ -5,7 +5,7 @@ module ebert_curry_ice_optics use physconst, only: gravit use ppgrid, only: pcols, pver use physics_types, only: physics_state -use physics_buffer, only: physics_buffer_desc, pbuf_get_index, pbuf_get_field, pbuf_old_tim_idx +use physics_buffer, only: physics_buffer_desc, pbuf_get_index, pbuf_get_field use constituents, only: cnst_get_ind use radconstants, only: nswbands, nlwbands, get_sw_spectral_boundaries use cam_abortutils, only: endrun @@ -102,14 +102,12 @@ subroutine ec_ice_optics_sw (state, pbuf, ice_tau, ice_tau_w, ice_tau_w_g, ice real(r8), parameter :: cldeps = 0.0_r8 integer :: ns, i, k, indxsl, lchnk, Nday - integer :: itim_old real(r8) :: tmp1i, tmp2i, tmp3i, g Nday = state%ncol lchnk = state%lchnk - itim_old = pbuf_old_tim_idx() - call pbuf_get_field(pbuf, cld_idx,cldn, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) + call pbuf_get_field(pbuf, cld_idx,cldn) call pbuf_get_field(pbuf, rei_idx,rei) if(oldicewp) then @@ -194,7 +192,7 @@ subroutine ec_ice_get_rad_props_lw(state, pbuf, abs_od, oldicewp) real(r8), pointer, dimension(:,:) :: cldn real(r8), pointer, dimension(:,:) :: rei - integer :: ncol, itim_old, lwband, i, k, lchnk + integer :: ncol, lwband, i, k, lchnk real(r8) :: kabs, kabsi @@ -207,9 +205,8 @@ subroutine ec_ice_get_rad_props_lw(state, pbuf, abs_od, oldicewp) ncol = state%ncol lchnk = state%lchnk - itim_old = pbuf_old_tim_idx() call pbuf_get_field(pbuf, rei_idx, rei) - call pbuf_get_field(pbuf, cld_idx, cldn, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) + call pbuf_get_field(pbuf, cld_idx, cldn) if(oldicewp) then diff --git a/src/physics/cam/hetfrz_classnuc_cam.F90 b/src/physics/cam/hetfrz_classnuc_cam.F90 index 175ba8cfbb..c5e72e6e46 100644 --- a/src/physics/cam/hetfrz_classnuc_cam.F90 +++ b/src/physics/cam/hetfrz_classnuc_cam.F90 @@ -12,9 +12,9 @@ module hetfrz_classnuc_cam use physconst, only: rair, cpair, rh2o, rhoh2o, mwh2o, tmelt, pi use constituents, only: cnst_get_ind use physics_types, only: physics_state -use physics_buffer, only: physics_buffer_desc, pbuf_get_index, pbuf_old_tim_idx, pbuf_get_field +use physics_buffer, only: physics_buffer_desc, pbuf_get_index, pbuf_get_field use phys_control, only: use_hetfrz_classnuc -use physics_buffer, only: pbuf_add_field, dtype_r8, pbuf_old_tim_idx, & +use physics_buffer, only: pbuf_add_field, dtype_r8, & pbuf_get_index, pbuf_get_field use cam_history, only: addfld, add_default, outfld, fieldname_len use ref_pres, only: top_lev => trop_cloud_top_lev @@ -362,7 +362,6 @@ subroutine hetfrz_classnuc_cam_calc(aero_props, aero_state, state, deltatin, fac real(r8), pointer :: frzcnt(:,:) real(r8), pointer :: frzdep(:,:) - integer :: itim_old integer :: i, k real(r8) :: rho(pcols,pver) ! air density (kg m-3) @@ -414,8 +413,7 @@ subroutine hetfrz_classnuc_cam_calc(aero_props, aero_state, state, deltatin, fac nc => state%q(:pcols,:pver,numliq_idx), & pmid => state%pmid ) - itim_old = pbuf_old_tim_idx() - call pbuf_get_field(pbuf, ast_idx, ast, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) + call pbuf_get_field(pbuf, ast_idx, ast) rho(:,:) = 0._r8 diff --git a/src/physics/cam/macrop_driver.F90 b/src/physics/cam/macrop_driver.F90 index 28982939d9..8c3dec6bc0 100644 --- a/src/physics/cam/macrop_driver.F90 +++ b/src/physics/cam/macrop_driver.F90 @@ -16,7 +16,7 @@ module macrop_driver use physconst, only: latice, latvap use phys_control, only: phys_getopts use constituents, only: cnst_get_ind, pcnst - use physics_buffer, only: physics_buffer_desc, pbuf_set_field, pbuf_get_field, pbuf_old_tim_idx + use physics_buffer, only: physics_buffer_desc, pbuf_set_field, pbuf_get_field use time_manager, only: is_first_step use cldwat2m_macro, only: ini_macro use perf_mod, only: t_startf, t_stopf @@ -163,26 +163,26 @@ subroutine macrop_driver_register !---------------------------------------------------------------------- ! - use physics_buffer, only : pbuf_add_field, dtype_r8, dyn_time_lvls + use physics_buffer, only : pbuf_add_field, dtype_r8 !----------------------------------------------------------------------- call phys_getopts(shallow_scheme_out=shallow_scheme) - call pbuf_add_field('AST', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), ast_idx) - call pbuf_add_field('AIST', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), aist_idx) - call pbuf_add_field('ALST', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), alst_idx) - call pbuf_add_field('QIST', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), qist_idx) - call pbuf_add_field('QLST', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), qlst_idx) - call pbuf_add_field('CLD', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), cld_idx) - call pbuf_add_field('CONCLD', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), concld_idx) - - call pbuf_add_field('QCWAT', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), qcwat_idx) - call pbuf_add_field('LCWAT', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), lcwat_idx) - call pbuf_add_field('ICCWAT', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), iccwat_idx) - call pbuf_add_field('NLWAT', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), nlwat_idx) - call pbuf_add_field('NIWAT', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), niwat_idx) - call pbuf_add_field('TCWAT', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), tcwat_idx) + call pbuf_add_field('AST', 'global', dtype_r8, (/pcols,pver/), ast_idx) + call pbuf_add_field('AIST', 'global', dtype_r8, (/pcols,pver/), aist_idx) + call pbuf_add_field('ALST', 'global', dtype_r8, (/pcols,pver/), alst_idx) + call pbuf_add_field('QIST', 'global', dtype_r8, (/pcols,pver/), qist_idx) + call pbuf_add_field('QLST', 'global', dtype_r8, (/pcols,pver/), qlst_idx) + call pbuf_add_field('CLD', 'global', dtype_r8, (/pcols,pver/), cld_idx) + call pbuf_add_field('CONCLD', 'global', dtype_r8, (/pcols,pver/), concld_idx) + + call pbuf_add_field('QCWAT', 'global', dtype_r8, (/pcols,pver/), qcwat_idx) + call pbuf_add_field('LCWAT', 'global', dtype_r8, (/pcols,pver/), lcwat_idx) + call pbuf_add_field('ICCWAT', 'global', dtype_r8, (/pcols,pver/), iccwat_idx) + call pbuf_add_field('NLWAT', 'global', dtype_r8, (/pcols,pver/), nlwat_idx) + call pbuf_add_field('NIWAT', 'global', dtype_r8, (/pcols,pver/), niwat_idx) + call pbuf_add_field('TCWAT', 'global', dtype_r8, (/pcols,pver/), tcwat_idx) call pbuf_add_field('FICE', 'physpkg', dtype_r8, (/pcols,pver/), fice_idx) @@ -425,7 +425,6 @@ subroutine macrop_driver_tend( & ! Physics buffer fields - integer itim_old real(r8), pointer, dimension(:,:) :: qcwat ! Cloud water old q real(r8), pointer, dimension(:,:) :: tcwat ! Cloud water old temperature real(r8), pointer, dimension(:,:) :: lcwat ! Cloud liquid water old q @@ -587,30 +586,29 @@ subroutine macrop_driver_tend( & ! Associate pointers with physics buffer fields - itim_old = pbuf_old_tim_idx() - - call pbuf_get_field(pbuf, qcwat_idx, qcwat, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) - call pbuf_get_field(pbuf, tcwat_idx, tcwat, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) - call pbuf_get_field(pbuf, lcwat_idx, lcwat, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) - call pbuf_get_field(pbuf, iccwat_idx, iccwat, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) - call pbuf_get_field(pbuf, nlwat_idx, nlwat, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) - call pbuf_get_field(pbuf, niwat_idx, niwat, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) - - call pbuf_get_field(pbuf, cc_t_idx, cc_t, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) - call pbuf_get_field(pbuf, cc_qv_idx, cc_qv, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) - call pbuf_get_field(pbuf, cc_ql_idx, cc_ql, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) - call pbuf_get_field(pbuf, cc_qi_idx, cc_qi, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) - call pbuf_get_field(pbuf, cc_nl_idx, cc_nl, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) - call pbuf_get_field(pbuf, cc_ni_idx, cc_ni, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) - call pbuf_get_field(pbuf, cc_qlst_idx, cc_qlst, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) - - call pbuf_get_field(pbuf, cld_idx, cld, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) - call pbuf_get_field(pbuf, concld_idx, concld, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) - call pbuf_get_field(pbuf, ast_idx, ast, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) - call pbuf_get_field(pbuf, aist_idx, aist, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) - call pbuf_get_field(pbuf, alst_idx, alst, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) - call pbuf_get_field(pbuf, qist_idx, qist, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) - call pbuf_get_field(pbuf, qlst_idx, qlst, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) + + call pbuf_get_field(pbuf, qcwat_idx, qcwat ) + call pbuf_get_field(pbuf, tcwat_idx, tcwat ) + call pbuf_get_field(pbuf, lcwat_idx, lcwat ) + call pbuf_get_field(pbuf, iccwat_idx, iccwat ) + call pbuf_get_field(pbuf, nlwat_idx, nlwat ) + call pbuf_get_field(pbuf, niwat_idx, niwat ) + + call pbuf_get_field(pbuf, cc_t_idx, cc_t ) + call pbuf_get_field(pbuf, cc_qv_idx, cc_qv ) + call pbuf_get_field(pbuf, cc_ql_idx, cc_ql ) + call pbuf_get_field(pbuf, cc_qi_idx, cc_qi ) + call pbuf_get_field(pbuf, cc_nl_idx, cc_nl ) + call pbuf_get_field(pbuf, cc_ni_idx, cc_ni ) + call pbuf_get_field(pbuf, cc_qlst_idx, cc_qlst ) + + call pbuf_get_field(pbuf, cld_idx, cld ) + call pbuf_get_field(pbuf, concld_idx, concld ) + call pbuf_get_field(pbuf, ast_idx, ast ) + call pbuf_get_field(pbuf, aist_idx, aist ) + call pbuf_get_field(pbuf, alst_idx, alst ) + call pbuf_get_field(pbuf, qist_idx, qist ) + call pbuf_get_field(pbuf, qlst_idx, qlst ) call pbuf_get_field(pbuf, cmeliq_idx, cmeliq) diff --git a/src/physics/cam/micro_pumas_cam.F90 b/src/physics/cam/micro_pumas_cam.F90 index 9e6f7cdc97..6156d594f3 100644 --- a/src/physics/cam/micro_pumas_cam.F90 +++ b/src/physics/cam/micro_pumas_cam.F90 @@ -22,8 +22,8 @@ module micro_pumas_cam physics_update, physics_state_dealloc, & physics_ptend_sum, physics_ptend_scale -use physics_buffer, only: physics_buffer_desc, pbuf_add_field, dyn_time_lvls, & - pbuf_old_tim_idx, pbuf_get_index, dtype_r8, dtype_i4, & +use physics_buffer, only: physics_buffer_desc, pbuf_add_field, & + pbuf_get_index, dtype_r8, dtype_i4, & pbuf_get_field, pbuf_set_field, col_type_subcol, & pbuf_register_subcol use constituents, only: cnst_add, cnst_get_ind, & @@ -585,7 +585,7 @@ subroutine micro_pumas_cam_register ! Request physics buffer space for fields that persist across timesteps. - call pbuf_add_field('CLDO','global',dtype_r8,(/pcols,pver,dyn_time_lvls/), cldo_idx) + call pbuf_add_field('CLDO','global',dtype_r8,(/pcols,pver/), cldo_idx) ! Physics buffer variables for convective cloud properties. @@ -619,7 +619,7 @@ subroutine micro_pumas_cam_register ! In cloud snow water path for radiation call pbuf_add_field('ICSWP', 'physpkg',dtype_r8,(/pcols,pver/), icswp_idx) ! Cloud fraction for liquid drops + snow - call pbuf_add_field('CLDFSNOW ', 'physpkg',dtype_r8,(/pcols,pver,dyn_time_lvls/), cldfsnow_idx) + call pbuf_add_field('CLDFSNOW ', 'physpkg',dtype_r8,(/pcols,pver/), cldfsnow_idx) if (micro_mg_version > 2) then ! Graupel effective diameter for radiation @@ -647,13 +647,13 @@ subroutine micro_pumas_cam_register call pbuf_add_field('CV_REFFICE', 'physpkg',dtype_r8,(/pcols,pver/), cv_reffice_idx) ! CC_* Fields needed by Park macrophysics - call pbuf_add_field('CC_T', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), cc_t_idx) - call pbuf_add_field('CC_qv', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), cc_qv_idx) - call pbuf_add_field('CC_ql', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), cc_ql_idx) - call pbuf_add_field('CC_qi', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), cc_qi_idx) - call pbuf_add_field('CC_nl', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), cc_nl_idx) - call pbuf_add_field('CC_ni', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), cc_ni_idx) - call pbuf_add_field('CC_qlst', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), cc_qlst_idx) + call pbuf_add_field('CC_T', 'global', dtype_r8, (/pcols,pver/), cc_t_idx) + call pbuf_add_field('CC_qv', 'global', dtype_r8, (/pcols,pver/), cc_qv_idx) + call pbuf_add_field('CC_ql', 'global', dtype_r8, (/pcols,pver/), cc_ql_idx) + call pbuf_add_field('CC_qi', 'global', dtype_r8, (/pcols,pver/), cc_qi_idx) + call pbuf_add_field('CC_nl', 'global', dtype_r8, (/pcols,pver/), cc_nl_idx) + call pbuf_add_field('CC_ni', 'global', dtype_r8, (/pcols,pver/), cc_ni_idx) + call pbuf_add_field('CC_qlst', 'global', dtype_r8, (/pcols,pver/), cc_qlst_idx) ! Register subcolumn pbuf fields if (use_subcol_microp) then @@ -1393,7 +1393,7 @@ subroutine micro_pumas_cam_tend(state, ptend, dtime, pbuf) ! Local variables integer :: lchnk, ncol, psetcols, ngrdcol - integer :: i, k, itim_old, it + integer :: i, k, it real(r8), pointer :: naai(:,:) ! ice nucleation number real(r8), pointer :: naai_hom(:,:) ! ice nucleation number (homogeneous) @@ -1872,7 +1872,6 @@ subroutine micro_pumas_cam_tend(state, ptend, dtime, pbuf) ncol = state%ncol psetcols = state%psetcols ngrdcol = state%ngrdcol - itim_old = pbuf_old_tim_idx() nlev = pver - top_lev + 1 nan_array = nan @@ -1896,11 +1895,11 @@ subroutine micro_pumas_cam_tend(state, ptend, dtime, pbuf) call pbuf_get_field(pbuf, accre_enhan_idx, accre_enhan, col_type=col_type, copy_if_needed=use_subcol_microp) call pbuf_get_field(pbuf, cmeliq_idx, cmeliq, col_type=col_type, copy_if_needed=use_subcol_microp) - call pbuf_get_field(pbuf, cld_idx, cld, start=(/1,1,itim_old/), kount=(/psetcols,pver,1/), & + call pbuf_get_field(pbuf, cld_idx, cld, & col_type=col_type, copy_if_needed=use_subcol_microp) - call pbuf_get_field(pbuf, concld_idx, concld, start=(/1,1,itim_old/), kount=(/psetcols,pver,1/), & + call pbuf_get_field(pbuf, concld_idx, concld, & col_type=col_type, copy_if_needed=use_subcol_microp) - call pbuf_get_field(pbuf, ast_idx, ast, start=(/1,1,itim_old/), kount=(/psetcols,pver,1/), & + call pbuf_get_field(pbuf, ast_idx, ast, & col_type=col_type, copy_if_needed=use_subcol_microp) ! Get convective precip @@ -2002,15 +2001,15 @@ subroutine micro_pumas_cam_tend(state, ptend, dtime, pbuf) if (icgrauwp_idx > 0) call pbuf_get_field(pbuf, icgrauwp_idx, icgrauwp, col_type=col_type) if (cldfgrau_idx > 0) call pbuf_get_field(pbuf, cldfgrau_idx, cldfgrau, col_type=col_type) - call pbuf_get_field(pbuf, cldo_idx, cldo, start=(/1,1,itim_old/), kount=(/psetcols,pver,1/), col_type=col_type) - call pbuf_get_field(pbuf, cldfsnow_idx, cldfsnow, start=(/1,1,itim_old/), kount=(/psetcols,pver,1/), col_type=col_type) - call pbuf_get_field(pbuf, cc_t_idx, CC_t, start=(/1,1,itim_old/), kount=(/psetcols,pver,1/), col_type=col_type) - call pbuf_get_field(pbuf, cc_qv_idx, CC_qv, start=(/1,1,itim_old/), kount=(/psetcols,pver,1/), col_type=col_type) - call pbuf_get_field(pbuf, cc_ql_idx, CC_ql, start=(/1,1,itim_old/), kount=(/psetcols,pver,1/), col_type=col_type) - call pbuf_get_field(pbuf, cc_qi_idx, CC_qi, start=(/1,1,itim_old/), kount=(/psetcols,pver,1/), col_type=col_type) - call pbuf_get_field(pbuf, cc_nl_idx, CC_nl, start=(/1,1,itim_old/), kount=(/psetcols,pver,1/), col_type=col_type) - call pbuf_get_field(pbuf, cc_ni_idx, CC_ni, start=(/1,1,itim_old/), kount=(/psetcols,pver,1/), col_type=col_type) - call pbuf_get_field(pbuf, cc_qlst_idx, CC_qlst, start=(/1,1,itim_old/), kount=(/psetcols,pver,1/), col_type=col_type) + call pbuf_get_field(pbuf, cldo_idx, cldo, col_type=col_type) + call pbuf_get_field(pbuf, cldfsnow_idx, cldfsnow, col_type=col_type) + call pbuf_get_field(pbuf, cc_t_idx, CC_t, col_type=col_type) + call pbuf_get_field(pbuf, cc_qv_idx, CC_qv, col_type=col_type) + call pbuf_get_field(pbuf, cc_ql_idx, CC_ql, col_type=col_type) + call pbuf_get_field(pbuf, cc_qi_idx, CC_qi, col_type=col_type) + call pbuf_get_field(pbuf, cc_nl_idx, CC_nl, col_type=col_type) + call pbuf_get_field(pbuf, cc_ni_idx, CC_ni, col_type=col_type) + call pbuf_get_field(pbuf, cc_qlst_idx, CC_qlst, col_type=col_type) if (rate1_cw2pr_st_idx > 0) then call pbuf_get_field(pbuf, rate1_cw2pr_st_idx, rate1ord_cw2pr_st, col_type=col_type) @@ -2068,15 +2067,15 @@ subroutine micro_pumas_cam_tend(state, ptend, dtime, pbuf) if (icgrauwp_idx > 0) call pbuf_get_field(pbuf, icgrauwp_idx, icgrauwp_grid) if (cldfgrau_idx > 0) call pbuf_get_field(pbuf, cldfgrau_idx, cldfgrau_grid) - call pbuf_get_field(pbuf, cldo_idx, cldo_grid, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) - call pbuf_get_field(pbuf, cldfsnow_idx, cldfsnow_grid, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) - call pbuf_get_field(pbuf, cc_t_idx, CC_t_grid, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) - call pbuf_get_field(pbuf, cc_qv_idx, CC_qv_grid, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) - call pbuf_get_field(pbuf, cc_ql_idx, CC_ql_grid, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) - call pbuf_get_field(pbuf, cc_qi_idx, CC_qi_grid, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) - call pbuf_get_field(pbuf, cc_nl_idx, CC_nl_grid, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) - call pbuf_get_field(pbuf, cc_ni_idx, CC_ni_grid, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) - call pbuf_get_field(pbuf, cc_qlst_idx, CC_qlst_grid, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) + call pbuf_get_field(pbuf, cldo_idx, cldo_grid) + call pbuf_get_field(pbuf, cldfsnow_idx, cldfsnow_grid) + call pbuf_get_field(pbuf, cc_t_idx, CC_t_grid) + call pbuf_get_field(pbuf, cc_qv_idx, CC_qv_grid) + call pbuf_get_field(pbuf, cc_ql_idx, CC_ql_grid) + call pbuf_get_field(pbuf, cc_qi_idx, CC_qi_grid) + call pbuf_get_field(pbuf, cc_nl_idx, CC_nl_grid) + call pbuf_get_field(pbuf, cc_ni_idx, CC_ni_grid) + call pbuf_get_field(pbuf, cc_qlst_idx, CC_qlst_grid) if (rate1_cw2pr_st_idx > 0) then call pbuf_get_field(pbuf, rate1_cw2pr_st_idx, rate1ord_cw2pr_st_grid) @@ -2092,7 +2091,7 @@ subroutine micro_pumas_cam_tend(state, ptend, dtime, pbuf) call pbuf_get_field(pbuf, acgcme_idx, acgcme_grid) call pbuf_get_field(pbuf, acnum_idx, acnum_grid) call pbuf_get_field(pbuf, cmeliq_idx, cmeliq_grid) - call pbuf_get_field(pbuf, ast_idx, ast_grid, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) + call pbuf_get_field(pbuf, ast_idx, ast_grid) !----------------------------------------------------------------------- ! ... Calculate cosine of zenith angle diff --git a/src/physics/cam/microp_aero.F90 b/src/physics/cam/microp_aero.F90 index ccc6383f63..4aa9d30255 100644 --- a/src/physics/cam/microp_aero.F90 +++ b/src/physics/cam/microp_aero.F90 @@ -30,7 +30,7 @@ module microp_aero use constituents, only: cnst_get_ind use physics_types, only: physics_state, physics_ptend, physics_ptend_init, physics_ptend_sum, & physics_state_copy, physics_update -use physics_buffer, only: physics_buffer_desc, pbuf_get_index, pbuf_old_tim_idx, pbuf_get_field +use physics_buffer, only: physics_buffer_desc, pbuf_get_index, pbuf_get_field use phys_control, only: phys_getopts, use_hetfrz_classnuc use aerosol_instances_mod, only: aerosol_instances_get_num_models, & aerosol_instances_is_active, & @@ -504,7 +504,6 @@ subroutine microp_aero_run ( & ! all units mks unless otherwise stated integer :: i, k, m - integer :: itim_old type(physics_state), target :: state1 ! Local copy of state variable type(physics_ptend) :: ptend_loc @@ -571,8 +570,6 @@ subroutine microp_aero_run ( & lchnk = state1%lchnk ncol = state1%ncol - itim_old = pbuf_old_tim_idx() - call pbuf_get_field(pbuf, npccn_idx, npccn) call pbuf_get_field(pbuf, nacon_idx, nacon) @@ -603,10 +600,8 @@ subroutine microp_aero_run ( & if (clim_modal_aero.or.clim_carma_aero) then - itim_old = pbuf_old_tim_idx() - - call pbuf_get_field(pbuf, ast_idx, cldn, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) - call pbuf_get_field(pbuf, cldo_idx, cldo, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) + call pbuf_get_field(pbuf, ast_idx, cldn ) + call pbuf_get_field(pbuf, cldo_idx, cldo ) end if if (clim_modal_aero) then @@ -648,7 +643,6 @@ subroutine microp_aero_run ( & errflg = errflg) if(errflg /= 0) call endrun('compute_subgrid_vertical_velocity_tke_run: ' // errmsg) case ('CLUBB_SGS') - itim_old = pbuf_old_tim_idx() call pbuf_get_field(pbuf, wp2_idx, wp2) ! The WP2_nadv pbuf field is dimensioned on the CLUBB momentum subgrid @@ -771,7 +765,7 @@ subroutine microp_aero_run ( & ! do not run for aquaplanet compsets which also gets in this path. if (associated(aero_state1_obj)) then ! get liquid cloud fraction. scaling is done within the ndrop_bam scheme. - call pbuf_get_field(pbuf, ast_idx, ast, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) + call pbuf_get_field(pbuf, ast_idx, ast) allocate(ccn_bam(pcols, pver, psat)) allocate(naer2_bam(pcols, pver, naer_all)) diff --git a/src/physics/cam/nucleate_ice_cam.F90 b/src/physics/cam/nucleate_ice_cam.F90 index 638892c3d1..1cd761c2f2 100644 --- a/src/physics/cam/nucleate_ice_cam.F90 +++ b/src/physics/cam/nucleate_ice_cam.F90 @@ -16,7 +16,7 @@ module nucleate_ice_cam use physics_buffer, only: physics_buffer_desc use phys_control, only: use_hetfrz_classnuc -use physics_buffer, only: pbuf_add_field, dtype_r8, pbuf_old_tim_idx, & +use physics_buffer, only: pbuf_add_field, dtype_r8, & pbuf_get_index, pbuf_get_field, & pbuf_set_field use cam_history, only: addfld, add_default, outfld @@ -348,7 +348,6 @@ subroutine nucleate_ice_cam_calc( & real(r8), pointer :: naai_hom(:,:) ! number of activated aerosol for ice nucleation (homogeneous freezing only) integer :: lchnk, ncol - integer :: itim_old integer :: i, k, l, m character(len=32) :: spectype @@ -469,8 +468,7 @@ subroutine nucleate_ice_cam_calc( & call physics_ptend_init(ptend, state%psetcols, 'nucleatei') end if - itim_old = pbuf_old_tim_idx() - call pbuf_get_field(pbuf, aist_idx, aist, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) + call pbuf_get_field(pbuf, aist_idx, aist) icecldf(:ncol,:pver) = aist(:ncol,:pver) ! naai and naai_hom are the outputs from this parameterization diff --git a/src/physics/cam/oldcloud_optics.F90 b/src/physics/cam/oldcloud_optics.F90 index bf53856ad6..a8c2796193 100644 --- a/src/physics/cam/oldcloud_optics.F90 +++ b/src/physics/cam/oldcloud_optics.F90 @@ -6,7 +6,7 @@ module oldcloud_optics use shr_kind_mod, only: r8 => shr_kind_r8 use ppgrid, only: pcols, pver, pverp use physics_types, only: physics_state -use physics_buffer, only: physics_buffer_desc, pbuf_get_index, pbuf_old_tim_idx, pbuf_get_field +use physics_buffer, only: physics_buffer_desc, pbuf_get_index, pbuf_get_field use constituents, only: cnst_get_ind use physconst, only: gravit use radconstants, only: nlwbands @@ -101,7 +101,7 @@ subroutine oldcloud_lw(state,pbuf,cld_abs_od,oldwp) real(r8), pointer, dimension(:,:) :: cldn real(r8), pointer, dimension(:,:) :: rei - integer :: ncol, itim_old, lwband, i, k, lchnk + integer :: ncol, lwband, i, k, lchnk real(r8), pointer, dimension(:,:) :: iclwpth, iciwpth real(r8) :: kabs, kabsi @@ -111,9 +111,8 @@ subroutine oldcloud_lw(state,pbuf,cld_abs_od,oldwp) ncol = state%ncol lchnk = state%lchnk - itim_old = pbuf_old_tim_idx() call pbuf_get_field(pbuf, rei_idx, rei) - call pbuf_get_field(pbuf, cld_idx, cldn, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) + call pbuf_get_field(pbuf, cld_idx, cldn) if (oldwp) then do k=1,pver @@ -177,7 +176,7 @@ subroutine old_liq_get_rad_props_lw(state, pbuf, abs_od, oldliqwp) real(r8), pointer, dimension(:,:) :: cldn real(r8), pointer, dimension(:,:) :: rei - integer :: ncol, itim_old, lwband, i, k, lchnk + integer :: ncol, lwband, i, k, lchnk real(r8) :: kabs, kabsi real(r8), parameter :: kabsl = 0.090361_r8 ! longwave liquid absorption coeff (m**2/g) @@ -187,9 +186,8 @@ subroutine old_liq_get_rad_props_lw(state, pbuf, abs_od, oldliqwp) ncol=state%ncol lchnk = state%lchnk - itim_old = pbuf_old_tim_idx() call pbuf_get_field(pbuf, rei_idx, rei) - call pbuf_get_field(pbuf, cld_idx, cldn, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) + call pbuf_get_field(pbuf, cld_idx, cldn) if (oldliqwp) then do k=1,pver @@ -258,7 +256,7 @@ subroutine old_ice_get_rad_props_lw(state, pbuf, abs_od, oldicewp) real(r8), pointer, dimension(:,:) :: cldn real(r8), pointer, dimension(:,:) :: rei - integer :: ncol, itim_old, lwband, i, k, lchnk + integer :: ncol, lwband, i, k, lchnk real(r8) :: kabs, kabsi real(r8), parameter :: kabsl = 0.090361_r8 ! longwave liquid absorption coeff (m**2/g) @@ -269,9 +267,8 @@ subroutine old_ice_get_rad_props_lw(state, pbuf, abs_od, oldicewp) ncol = state%ncol lchnk = state%lchnk - itim_old = pbuf_old_tim_idx() call pbuf_get_field(pbuf, rei_idx, rei) - call pbuf_get_field(pbuf, cld_idx, cldn, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) + call pbuf_get_field(pbuf, cld_idx, cldn) if(oldicewp) then do k=1,pver diff --git a/src/physics/cam/physics_buffer.F90.in b/src/physics/cam/physics_buffer.F90.in index b9af23610f..579265c878 100644 --- a/src/physics/cam/physics_buffer.F90.in +++ b/src/physics/cam/physics_buffer.F90.in @@ -16,7 +16,6 @@ module physics_buffer use ppgrid, only: pcols, begchunk, endchunk, psubcols use cam_logfile, only: iulog use pio, only: var_desc_t - use dyn_grid, only: ptimelevels use cam_abortutils, only: endrun use buffer, only: buffer_field_allocate, buffer_field_deallocate, buffer_get_field_ptr, buffer_set_field, & dtype_i4, dtype_r4, dtype_r8, buffer_field_default_type, buffer_field_is_alloc @@ -41,8 +40,6 @@ module physics_buffer ! character(len=5), parameter :: field_grid_suff(ngrid_types) = (/ " ", "_SCOL" /) - integer :: old_time_idx = 1 - ! The API has strings 'GLOBAL' and 'PHYSPKG' which correspond to these ! integer constants if global_allocate_all is false fields allocated with ! PHYSPKG persistence are deallocated at the end of each physics time step @@ -120,9 +117,6 @@ module physics_buffer public :: pbuf_initialize, & pbuf_readnl, &! read namelist options - pbuf_init_time, &! Initialize dyn_time_lvls - pbuf_old_tim_idx, &! return the index for the oldest time - pbuf_update_tim_idx, &! update the index for the oldest time pbuf_col_type_index, & pbuf_get_field_name, & pbuf_get_field, & @@ -147,9 +141,6 @@ module physics_buffer public :: pbuf_get_dim_strings public :: pbuf_cam_snapshot_register - integer, public :: dyn_time_lvls ! number of time levels in physics buffer (dycore dependent) - - ! ! Currentpbufflds is incremented in calls to pbuf_add_field and determines the size ! of the allocated pbuf2d @@ -164,11 +155,6 @@ module physics_buffer logical :: buffer_initialized =.false. - ! - ! private pio descriptor for time - ! - type(var_desc_t) :: timeidx_desc - ! Set to .true. for more output logical :: debug = .false. @@ -224,30 +210,6 @@ end subroutine pbuf_readnl !=============================================================================== - ! - ! Initialize dyn_time_lvls - ! - subroutine pbuf_init_time() - dyn_time_lvls = ptimelevels - 1 - end subroutine pbuf_init_time - - ! - ! Return index of oldest time sample in the physics buffer. - ! - - function pbuf_old_tim_idx() - integer :: pbuf_old_tim_idx - pbuf_old_tim_idx = old_time_idx - end function pbuf_old_tim_idx - - ! - ! Update index of old time sample in the physics buffer. - ! - - subroutine pbuf_update_tim_idx() - old_time_idx = mod(old_time_idx, dyn_time_lvls) + 1 - end subroutine pbuf_update_tim_idx - ! ! pbuf_col_type_index returns an index for use with pbuf calls ! @@ -1335,7 +1297,7 @@ end subroutine pbuf_readnl ! in the file if it does not already exist. ! subroutine pbuf_init_restart(File, pbuf2d) - use pio, only: file_desc_t, pio_int + use pio, only: file_desc_t use cam_pio_utils, only: cam_pio_def_dim, cam_pio_def_var use phys_grid, only: phys_decomp use cam_grid_support, only: cam_grid_get_file_dimids, cam_grid_dimensions @@ -1388,14 +1350,11 @@ end subroutine pbuf_readnl end do - call cam_pio_def_var(File, 'pbuf_time_idx', pio_int, timeidx_desc, & - existOK=.false.) - end subroutine pbuf_init_restart subroutine pbuf_write_restart(File, pbuf2d) - use pio, only: file_desc_t, pio_put_var + use pio, only: file_desc_t use cam_grid_support, only: cam_grid_dimensions use phys_grid, only: phys_decomp @@ -1406,7 +1365,7 @@ end subroutine pbuf_readnl ! Local Variables type(physics_buffer_desc), pointer :: pbufhdr(:) - integer :: index, dtype, ierr + integer :: index, dtype integer :: gdimlens(2) integer :: grank @@ -1427,7 +1386,6 @@ end subroutine pbuf_readnl end select end if end do - ierr = pio_put_var(File, timeidx_desc, (/old_time_idx/)) end subroutine pbuf_write_restart @@ -1521,7 +1479,7 @@ end subroutine pbuf_readnl subroutine pbuf_read_restart(File, pbuf2d) use cam_grid_support, only: cam_grid_dimensions use phys_grid, only: phys_decomp - use pio, only: file_desc_t, pio_inq_varid, pio_get_var + use pio, only: file_desc_t ! Dummy Variables type(File_desc_t), intent(inout) :: File @@ -1530,7 +1488,7 @@ end subroutine pbuf_readnl ! Local Variables type(physics_buffer_desc), pointer :: pbufhdr(:) - integer :: index, dtype, ierr + integer :: index, dtype integer :: gdimlens(2) ! Horizontal grid dimensions integer :: grank @@ -1540,8 +1498,6 @@ end subroutine pbuf_readnl gdimlens = 1 call cam_grid_dimensions(phys_decomp, gdimlens(1:2), grank) - ierr = pio_inq_varid(File, 'pbuf_time_idx', timeidx_desc) - ierr = pio_get_var(File, timeidx_desc, old_time_idx) do index = 1, currentpbufflds if(pbufhdr(index)%hdr%persistence == persistence_global) then diff --git a/src/physics/cam/physpkg.F90 b/src/physics/cam/physpkg.F90 index 28a9714c9c..3eaa519ece 100644 --- a/src/physics/cam/physpkg.F90 +++ b/src/physics/cam/physpkg.F90 @@ -115,7 +115,7 @@ subroutine phys_register ! !----------------------------------------------------------------------- use cam_abortutils, only: endrun - use physics_buffer, only: pbuf_init_time, pbuf_cam_snapshot_register + use physics_buffer, only: pbuf_cam_snapshot_register use physics_buffer, only: pbuf_add_field, dtype_r8, pbuf_register_subcol use shr_kind_mod, only: r8 => shr_kind_r8 use constituents, only: pcnst, cnst_add, cnst_chk_dim @@ -189,9 +189,6 @@ subroutine phys_register subcol_scheme = subcol_get_scheme() - ! Initialize dyn_time_lvls - call pbuf_init_time() - ! Register the subcol scheme call subcol_register() @@ -373,7 +370,7 @@ end subroutine phys_register subroutine phys_inidat( cam_out, pbuf2d ) use cam_abortutils, only: endrun - use physics_buffer, only: pbuf_get_index, physics_buffer_desc, pbuf_set_field, dyn_time_lvls + use physics_buffer, only: pbuf_get_index, physics_buffer_desc, pbuf_set_field use cam_initfiles, only: initial_file_get_id, topo_file_get_id @@ -389,7 +386,7 @@ subroutine phys_inidat( cam_out, pbuf2d ) type(cam_out_t), intent(inout) :: cam_out(begchunk:endchunk) type(physics_buffer_desc), pointer :: pbuf2d(:,:) - integer :: lchnk, m, n, ncol + integer :: lchnk, m, ncol type(file_desc_t), pointer :: fh_ini, fh_topo character(len=8) :: fieldname real(r8), pointer :: tptr(:,:), tptr_2(:,:), tptr3d(:,:,:), tptr3d_2(:,:,:) @@ -492,9 +489,7 @@ subroutine phys_inidat( cam_out, pbuf2d ) if(masterproc) write(iulog,*) trim(fieldname), ' initialized to 1000.' tptr=1000._r8 end if - do n=1,dyn_time_lvls - call pbuf_set_field(pbuf2d, m, tptr, start=(/1,n/), kount=(/pcols,1/)) - end do + call pbuf_set_field(pbuf2d, m, tptr) deallocate(tptr) end if @@ -509,9 +504,7 @@ subroutine phys_inidat( cam_out, pbuf2d ) call infld(fieldname, fh_ini, dim1name, 'lev', dim2name, 1, pcols, 1, pver, begchunk, endchunk, & tptr3d, found, gridname='physgrid') if(found) then - do n = 1, dyn_time_lvls - call pbuf_set_field(pbuf2d, m, tptr3d, (/1,1,n/),(/pcols,pver,1/)) - end do + call pbuf_set_field(pbuf2d, m, tptr3d) else call pbuf_set_field(pbuf2d, m, 0._r8) if (masterproc) write(iulog,*) trim(fieldname), ' initialized to 0.' @@ -533,9 +526,7 @@ subroutine phys_inidat( cam_out, pbuf2d ) tptr3d = huge(1.0_r8) end if end if - do n = 1, dyn_time_lvls - call pbuf_set_field(pbuf2d, m, tptr3d, (/1,1,n/),(/pcols,pver,1/)) - end do + call pbuf_set_field(pbuf2d, m, tptr3d) end if fieldname = 'ICCWAT' @@ -544,17 +535,13 @@ subroutine phys_inidat( cam_out, pbuf2d ) call infld(fieldname, fh_ini, dim1name, 'lev', dim2name, 1, pcols, 1, pver, begchunk, endchunk, & tptr3d, found, gridname='physgrid') if(found) then - do n = 1, dyn_time_lvls - call pbuf_set_field(pbuf2d, m, tptr3d, (/1,1,n/),(/pcols,pver,1/)) - end do + call pbuf_set_field(pbuf2d, m, tptr3d) else call cnst_get_ind('CLDICE', ixcldice) call infld('CLDICE',fh_ini,dim1name, 'lev', dim2name, 1, pcols, 1, pver, begchunk, endchunk, & tptr3d, found, gridname='physgrid') if(found) then - do n = 1, dyn_time_lvls - call pbuf_set_field(pbuf2d, m, tptr3d, (/1,1,n/),(/pcols,pver,1/)) - end do + call pbuf_set_field(pbuf2d, m, tptr3d) else call pbuf_set_field(pbuf2d, m, 0._r8) end if @@ -574,9 +561,7 @@ subroutine phys_inidat( cam_out, pbuf2d ) call infld(fieldname, fh_ini, dim1name, 'lev', dim2name, 1, pcols, 1, pver, begchunk, endchunk, & tptr3d, found, gridname='physgrid') if(found) then - do n = 1, dyn_time_lvls - call pbuf_set_field(pbuf2d, m, tptr3d, (/1,1,n/),(/pcols,pver,1/)) - end do + call pbuf_set_field(pbuf2d, m, tptr3d) else allocate(tptr3d_2(pcols,pver,begchunk:endchunk)) call cnst_get_ind('CLDICE', ixcldice) @@ -599,9 +584,7 @@ subroutine phys_inidat( cam_out, pbuf2d ) end if if (found .or. found2) then - do n = 1, dyn_time_lvls - call pbuf_set_field(pbuf2d, m, tptr3d, (/1,1,n/),(/pcols,pver,1/)) - end do + call pbuf_set_field(pbuf2d, m, tptr3d) if(dycore_is('LR')) call polar_average(pver, tptr3d) else call pbuf_set_field(pbuf2d, m, 0._r8) @@ -630,9 +613,7 @@ subroutine phys_inidat( cam_out, pbuf2d ) tptr3d = huge(1._r8) end if end if - do n = 1, dyn_time_lvls - call pbuf_set_field(pbuf2d, m, tptr3d, (/1,1,n/),(/pcols,pver,1/)) - end do + call pbuf_set_field(pbuf2d, m, tptr3d) end if deallocate(tptr3d) @@ -682,9 +663,7 @@ subroutine phys_inidat( cam_out, pbuf2d ) call infld(fieldname, fh_ini, dim1name, 'lev', dim2name, 1, pcols, 1, pver, begchunk, endchunk, & tptr3d, found, gridname='physgrid') if(found) then - do n = 1, dyn_time_lvls - call pbuf_set_field(pbuf2d, m, tptr3d, (/1,1,n/),(/pcols,pver,1/)) - end do + call pbuf_set_field(pbuf2d, m, tptr3d) else call pbuf_set_field(pbuf2d, m, 0._r8) if (masterproc) write(iulog,*) trim(fieldname), ' initialized to 0.' @@ -1210,7 +1189,7 @@ subroutine phys_run2(phys_state, ztodt, phys_tend, pbuf2d, cam_out, & ! Second part of atmospheric physics package after updating of surface models ! !----------------------------------------------------------------------- - use physics_buffer, only: physics_buffer_desc, pbuf_get_chunk, pbuf_deallocate, pbuf_update_tim_idx + use physics_buffer, only: physics_buffer_desc, pbuf_get_chunk, pbuf_deallocate use mo_lightning, only: lightning_no_prod use cam_diagnostics, only: diag_deallocate, diag_surf use carma_intr, only: carma_accumulate_stats @@ -1313,7 +1292,6 @@ subroutine phys_run2(phys_state, ztodt, phys_tend, pbuf2d, cam_out, & call t_startf ('physpkg_st2') call pbuf_deallocate(pbuf2d, 'physpkg') - call pbuf_update_tim_idx() call diag_deallocate() call t_stopf ('physpkg_st2') @@ -1387,7 +1365,7 @@ subroutine tphysac (ztodt, cam_in, & ! o Ion Drag ( Only for WACCM ) ! o Scale Dry Mass Energy !----------------------------------------------------------------------- - use physics_buffer, only: physics_buffer_desc, pbuf_set_field, pbuf_get_index, pbuf_get_field, pbuf_old_tim_idx + use physics_buffer, only: physics_buffer_desc, pbuf_set_field, pbuf_get_index, pbuf_get_field use shr_kind_mod, only: r8 => shr_kind_r8 use chemistry, only: chem_is_active, chem_timestep_tend, chem_emissions use cam_diagnostics, only: diag_phys_tend_writeout @@ -1470,7 +1448,7 @@ subroutine tphysac (ztodt, cam_in, & logical :: moist_mixing_ratio_dycore ! physics buffer fields for total energy and mass adjustment - integer itim_old, ifld + integer ifld real(r8), pointer, dimension(:,:) :: cld real(r8), pointer, dimension(:,:) :: qini @@ -1514,12 +1492,11 @@ subroutine tphysac (ztodt, cam_in, & call t_startf('tphysac_init') ! Associate pointers with physics buffer fields - itim_old = pbuf_old_tim_idx() - call pbuf_get_field(pbuf, dtcore_idx, dtcore, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) - call pbuf_get_field(pbuf, dqcore_idx, dqcore, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) - call pbuf_get_field(pbuf, ducore_idx, ducore, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) - call pbuf_get_field(pbuf, dvcore_idx, dvcore, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) + call pbuf_get_field(pbuf, dtcore_idx, dtcore ) + call pbuf_get_field(pbuf, dqcore_idx, dqcore ) + call pbuf_get_field(pbuf, ducore_idx, ducore ) + call pbuf_get_field(pbuf, dvcore_idx, dvcore ) call pbuf_get_field(pbuf, qini_idx, qini) call pbuf_get_field(pbuf, cldliqini_idx, cldliqini) @@ -1528,10 +1505,10 @@ subroutine tphysac (ztodt, cam_in, & call pbuf_get_field(pbuf, toticeini_idx, toticeini) ifld = pbuf_get_index('CLD') - call pbuf_get_field(pbuf, ifld, cld, start=(/1,1,itim_old/),kount=(/pcols,pver,1/)) + call pbuf_get_field(pbuf, ifld, cld) ifld = pbuf_get_index('AST') - call pbuf_get_field(pbuf, ifld, ast, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) + call pbuf_get_field(pbuf, ifld, ast ) ! zero out local variables that may be written to snapshot for safety. fh2o(:) = 0._r8 ! used in chem_timestep_tend. @@ -1972,7 +1949,7 @@ subroutine tphysac (ztodt, cam_in, & ! ! This call must be after the last parameterization and call to physics_update ! - call pbuf_set_field(pbuf, teout_idx, state%te_cur(:,dyn_te_idx), (/1,itim_old/),(/pcols,1/)) + call pbuf_set_field(pbuf, teout_idx, state%te_cur(:,dyn_te_idx)) ! FV: convert dry-type mixing ratios to moist here because physics_dme_adjust ! assumes moist. This is done in p_d_coupling for other dynamics. Bundy, Feb 2004. @@ -2126,8 +2103,8 @@ subroutine tphysbc (ztodt, state, & !----------------------------------------------------------------------- use physics_buffer, only: physics_buffer_desc, pbuf_get_field - use physics_buffer, only: pbuf_get_index, pbuf_old_tim_idx - use physics_buffer, only: col_type_subcol, dyn_time_lvls + use physics_buffer, only: pbuf_get_index + use physics_buffer, only: col_type_subcol use shr_kind_mod, only: r8 => shr_kind_r8 use dadadj_cam, only: dadadj_tend @@ -2231,7 +2208,7 @@ subroutine tphysbc (ztodt, state, & integer :: macmic_it ! iteration variables real(r8) :: cld_macmic_ztodt ! modified timestep ! physics buffer fields to compute tendencies for stratiform package - integer itim_old, ifld + integer ifld real(r8), pointer, dimension(:,:) :: cld ! cloud fraction @@ -2319,11 +2296,10 @@ subroutine tphysbc (ztodt, state, & nstep = get_nstep() ! Associate pointers with physics buffer fields - itim_old = pbuf_old_tim_idx() ifld = pbuf_get_index('CLD') - call pbuf_get_field(pbuf, ifld, cld, (/1,1,itim_old/),(/pcols,pver,1/)) + call pbuf_get_field(pbuf, ifld, cld) - call pbuf_get_field(pbuf, teout_idx, teout, (/1,itim_old/), (/pcols,1/)) + call pbuf_get_field(pbuf, teout_idx, teout) call pbuf_get_field(pbuf, qini_idx, qini) call pbuf_get_field(pbuf, cldliqini_idx, cldliqini) @@ -2331,10 +2307,10 @@ subroutine tphysbc (ztodt, state, & call pbuf_get_field(pbuf, totliqini_idx, totliqini) call pbuf_get_field(pbuf, toticeini_idx, toticeini) - call pbuf_get_field(pbuf, dtcore_idx, dtcore, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) - call pbuf_get_field(pbuf, dqcore_idx, dqcore, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) - call pbuf_get_field(pbuf, ducore_idx, ducore, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) - call pbuf_get_field(pbuf, dvcore_idx, dvcore, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) + call pbuf_get_field(pbuf, dtcore_idx, dtcore ) + call pbuf_get_field(pbuf, dqcore_idx, dqcore ) + call pbuf_get_field(pbuf, ducore_idx, ducore ) + call pbuf_get_field(pbuf, dvcore_idx, dvcore ) ifld = pbuf_get_index('FRACIS') call pbuf_get_field(pbuf, ifld, fracis, start=(/1,1,1/), kount=(/pcols, pver, pcnst/) ) @@ -2421,7 +2397,7 @@ subroutine tphysbc (ztodt, state, & call outfld('TEFIX', state%te_cur(:,dyn_te_idx), pcols, lchnk ) ! T, U, V tendency due to dynamics - if( nstep > dyn_time_lvls-1 ) then + if( nstep > 0 ) then dtcore(:ncol,:pver) = (state%t(:ncol,:pver) - dtcore(:ncol,:pver))/ztodt dqcore(:ncol,:pver) = (state%q(:ncol,:pver,ixq) - dqcore(:ncol,:pver))/ztodt ducore(:ncol,:pver) = (state%u(:ncol,:pver) - ducore(:ncol,:pver))/ztodt diff --git a/src/physics/cam/radiation_data.F90 b/src/physics/cam/radiation_data.F90 index cc0d039947..25b7b3a2d1 100644 --- a/src/physics/cam/radiation_data.F90 +++ b/src/physics/cam/radiation_data.F90 @@ -507,7 +507,7 @@ subroutine rad_data_write( pbuf, state, cam_in, coszen ) use physics_types, only: physics_state use camsrfexch, only: cam_in_t use constituents, only: cnst_get_ind - use physics_buffer, only: pbuf_get_field, pbuf_old_tim_idx + use physics_buffer, only: pbuf_get_field use drv_input_data, only: drv_input_data_freq use physconst, only: cpair @@ -524,7 +524,7 @@ subroutine rad_data_write( pbuf, state, cam_in, coszen ) character(len=32) :: name, aername real(r8), pointer :: mmr(:,:) - integer :: lchnk, itim_old, ifld + integer :: lchnk, ifld integer :: ixcldice ! cloud ice water index integer :: ixcldliq ! cloud liquid water index integer :: icol @@ -622,9 +622,8 @@ subroutine rad_data_write( pbuf, state, cam_in, coszen ) call outfld(lwup_fldn, cam_in%lwup, pcols, lchnk ) call outfld(ts_fldn, cam_in%ts, pcols, lchnk ) - itim_old = pbuf_old_tim_idx() - call pbuf_get_field(pbuf, cld_ifld, ptr, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) + call pbuf_get_field(pbuf, cld_ifld, ptr ) call outfld(cld_fldn, ptr, pcols, lchnk ) call pbuf_get_field(pbuf, rel_ifld, ptr ) @@ -656,7 +655,7 @@ subroutine rad_data_write( pbuf, state, cam_in, coszen ) call pbuf_get_field(pbuf, icswp_ifld, ptr ) call outfld(icswp_fldn, ptr, pcols, lchnk ) - call pbuf_get_field(pbuf, cldfsnow_ifld, ptr, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) + call pbuf_get_field(pbuf, cldfsnow_ifld, ptr ) call outfld(cldfsnow_fldn, ptr, pcols, lchnk ) else @@ -743,7 +742,7 @@ end subroutine rad_data_write subroutine rad_data_read(indata, phys_state, pbuf2d, cam_in, recno ) use camsrfexch, only: cam_in_t - use physics_buffer, only: pbuf_get_field, pbuf_old_tim_idx + use physics_buffer, only: pbuf_get_field use constituents, only: cnst_get_ind use tropopause, only: tropopause_find_cam, TROP_ALG_HYBSTOB, TROP_ALG_CLIMATE @@ -812,7 +811,7 @@ subroutine rad_data_read(indata, phys_state, pbuf2d, cam_in, recno ) type(drv_input_3d_t) :: volcgeom2_ptrs(begchunk:endchunk) type(drv_input_3d_t) :: volcgeom3_ptrs(begchunk:endchunk) - integer :: i, k, c, ncol, itim + integer :: i, k, c, ncol integer :: ixcldice ! cloud ice water index integer :: ixcldliq ! cloud liquid water index @@ -833,7 +832,6 @@ subroutine rad_data_read(indata, phys_state, pbuf2d, cam_in, recno ) call cnst_get_ind('CLDLIQ', ixcldliq) ! phys buffer time index - itim = pbuf_old_tim_idx() ! setup the data pointers !$OMP PARALLEL DO PRIVATE (C,pbuf) @@ -864,7 +862,7 @@ subroutine rad_data_read(indata, phys_state, pbuf2d, cam_in, recno ) lwup_ptrs (c)%array => cam_in(c)%lwup ts_ptrs (c)%array => cam_in(c)%ts - call pbuf_get_field(pbuf, cld_ifld, cld_ptrs (c)%array, start=(/1,1,itim/), kount=(/pcols,pver,1/) ) + call pbuf_get_field(pbuf, cld_ifld, cld_ptrs (c)%array ) call pbuf_get_field(pbuf, rel_ifld, rel_ptrs(c)%array ) call pbuf_get_field(pbuf, rei_ifld, rei_ptrs(c)%array ) @@ -879,7 +877,7 @@ subroutine rad_data_read(indata, phys_state, pbuf2d, cam_in, recno ) call pbuf_get_field(pbuf, iciwp_ifld, iciwp_ptrs (c)%array ) call pbuf_get_field(pbuf, iclwp_ifld, iclwp_ptrs (c)%array ) call pbuf_get_field(pbuf, icswp_ifld, icswp_ptrs (c)%array ) - call pbuf_get_field(pbuf, cldfsnow_ifld, cldfsnow_ptrs(c)%array, start=(/1,1,itim/), kount=(/pcols,pver,1/) ) + call pbuf_get_field(pbuf, cldfsnow_ifld, cldfsnow_ptrs(c)%array ) else call pbuf_get_field(pbuf, nmxrgn_ifld, nmxrgn_ptrs(c)%array ) call pbuf_get_field(pbuf, pmxrgn_ifld, pmxrgn_ptrs(c)%array ) diff --git a/src/physics/cam/rk_stratiform_cam.F90 b/src/physics/cam/rk_stratiform_cam.F90 index e751bc3ce7..c6965f6704 100644 --- a/src/physics/cam/rk_stratiform_cam.F90 +++ b/src/physics/cam/rk_stratiform_cam.F90 @@ -174,7 +174,7 @@ subroutine rk_stratiform_cam_register use constituents, only: cnst_add, pcnst use physconst, only: mwh2o, cpair - use physics_buffer, only : pbuf_add_field, dtype_r8, dyn_time_lvls + use physics_buffer, only : pbuf_add_field, dtype_r8 !----------------------------------------------------------------------- @@ -187,13 +187,13 @@ subroutine rk_stratiform_cam_register call cnst_add(cnst_names(2), mwh2o, cpair, 0._r8, ixcldice, & longname='Grid box averaged cloud ice amount', is_convtran1=.true.) - call pbuf_add_field('QCWAT', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), qcwat_idx) - call pbuf_add_field('LCWAT', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), lcwat_idx) - call pbuf_add_field('TCWAT', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), tcwat_idx) + call pbuf_add_field('QCWAT', 'global', dtype_r8, (/pcols,pver/), qcwat_idx) + call pbuf_add_field('LCWAT', 'global', dtype_r8, (/pcols,pver/), lcwat_idx) + call pbuf_add_field('TCWAT', 'global', dtype_r8, (/pcols,pver/), tcwat_idx) - call pbuf_add_field('CLD', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), cld_idx) ! cloud_area_fraction - call pbuf_add_field('AST', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), ast_idx) ! stratiform_cloud_area_fraction - call pbuf_add_field('CONCLD', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), concld_idx) ! convective_cloud_area_fraction + call pbuf_add_field('CLD', 'global', dtype_r8, (/pcols,pver/), cld_idx) ! cloud_area_fraction + call pbuf_add_field('AST', 'global', dtype_r8, (/pcols,pver/), ast_idx) ! stratiform_cloud_area_fraction + call pbuf_add_field('CONCLD', 'global', dtype_r8, (/pcols,pver/), concld_idx) ! convective_cloud_area_fraction call pbuf_add_field('FICE', 'physpkg', dtype_r8, (/pcols,pver/), fice_idx) ! mass_fraction_of_ice_content_within_stratiform_cloud @@ -457,7 +457,7 @@ subroutine rk_stratiform_cam_tend( & use physics_types, only: physics_ptend_sum, physics_state_copy use physics_types, only: physics_state_dealloc use cam_history, only: outfld - use physics_buffer, only: physics_buffer_desc, pbuf_get_field, pbuf_old_tim_idx + use physics_buffer, only: physics_buffer_desc, pbuf_get_field ! ccppized version of the RK scheme use rk_stratiform, only: rk_stratiform_sedimentation_run @@ -512,7 +512,6 @@ subroutine rk_stratiform_cam_tend( & integer :: i, k, m integer :: lchnk ! Chunk identifier integer :: ncol ! Number of atmospheric columns - integer :: itim_old ! Physics buffer fields real(r8), pointer :: landm(:) ! Land fraction ramped over water @@ -629,14 +628,13 @@ subroutine rk_stratiform_cam_tend( & call pbuf_get_field(pbuf, landm_idx, landm) ! smoothed_land_area_fraction - itim_old = pbuf_old_tim_idx() - call pbuf_get_field(pbuf, qcwat_idx, qcwat, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) - call pbuf_get_field(pbuf, tcwat_idx, tcwat, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) - call pbuf_get_field(pbuf, lcwat_idx, lcwat, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) + call pbuf_get_field(pbuf, qcwat_idx, qcwat ) + call pbuf_get_field(pbuf, tcwat_idx, tcwat ) + call pbuf_get_field(pbuf, lcwat_idx, lcwat ) - call pbuf_get_field(pbuf, cld_idx, cld, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) - call pbuf_get_field(pbuf, concld_idx, concld, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) - call pbuf_get_field(pbuf, ast_idx, ast, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) + call pbuf_get_field(pbuf, cld_idx, cld ) + call pbuf_get_field(pbuf, concld_idx, concld ) + call pbuf_get_field(pbuf, ast_idx, ast ) call pbuf_get_field(pbuf, fice_idx, fice) diff --git a/src/physics/cam/slingo_liq_optics.F90 b/src/physics/cam/slingo_liq_optics.F90 index 781a056b29..ed01f3eb43 100644 --- a/src/physics/cam/slingo_liq_optics.F90 +++ b/src/physics/cam/slingo_liq_optics.F90 @@ -9,7 +9,7 @@ module slingo_liq_optics use physconst, only: gravit use ppgrid, only: pcols, pver, pverp use physics_types, only: physics_state -use physics_buffer, only: physics_buffer_desc, pbuf_get_index, pbuf_get_field, pbuf_old_tim_idx +use physics_buffer, only: physics_buffer_desc, pbuf_get_index, pbuf_get_field use radconstants, only: nswbands, nlwbands, get_sw_spectral_boundaries use cam_abortutils, only: endrun @@ -120,7 +120,7 @@ subroutine slingo_liq_optics_sw(state, pbuf, liq_tau, liq_tau_w, liq_tau_w_g, li ! greater than 20 micro-meters integer :: ns, i, k, indxsl, Nday - integer :: i_rel, lchnk, icld, itim_old + integer :: i_rel, lchnk, icld real(r8) :: tmp1l, tmp2l, tmp3l, g real(r8) :: kext(pcols,pver) real(r8), pointer, dimension(:,:) :: iclwpth @@ -128,8 +128,7 @@ subroutine slingo_liq_optics_sw(state, pbuf, liq_tau, liq_tau_w, liq_tau_w_g, li Nday = state%ncol lchnk = state%lchnk - itim_old = pbuf_old_tim_idx() - call pbuf_get_field(pbuf, cld_idx, cldn, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) + call pbuf_get_field(pbuf, cld_idx, cldn) call pbuf_get_field(pbuf, rel_idx, rel) if (oldliqwp) then @@ -220,7 +219,7 @@ subroutine slingo_liq_get_rad_props_lw(state, pbuf, abs_od, oldliqwp) real(r8), pointer, dimension(:,:) :: cldn real(r8), pointer, dimension(:,:) :: rei - integer :: ncol, icld, itim_old, i_rei, lwband, i, k, lchnk + integer :: ncol, icld, i_rei, lwband, i, k, lchnk real(r8) :: kabs, kabsi real(r8) kabsl ! longwave liquid absorption coeff (m**2/g) @@ -231,9 +230,8 @@ subroutine slingo_liq_get_rad_props_lw(state, pbuf, abs_od, oldliqwp) ncol=state%ncol lchnk = state%lchnk - itim_old = pbuf_old_tim_idx() call pbuf_get_field(pbuf, rei_idx, rei) - call pbuf_get_field(pbuf, cld_idx, cldn, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) + call pbuf_get_field(pbuf, cld_idx, cldn) if (oldliqwp) then do k=1,pver diff --git a/src/physics/cam/ssatcontrail.F90 b/src/physics/cam/ssatcontrail.F90 index 204ba5ab8d..e102cc8ca6 100644 --- a/src/physics/cam/ssatcontrail.F90 +++ b/src/physics/cam/ssatcontrail.F90 @@ -7,7 +7,7 @@ module ssatcontrail use ppgrid, only: pcols, pver use physics_types, only: physics_state, physics_ptend, physics_ptend_init use physconst, only: cpair,mwdry,mwh2o, gravit, zvir, rair, pi, rearth, tmelt - use physics_buffer, only: pbuf_get_index, pbuf_get_field, physics_buffer_desc, pbuf_old_tim_idx + use physics_buffer, only: pbuf_get_index, pbuf_get_field, physics_buffer_desc use constituents, only: cnst_get_ind, pcnst use phys_grid, only: get_wght_all_p use wv_saturation, only: qsat_water, qsat_ice @@ -42,7 +42,7 @@ subroutine ssatcontrail_d0(state1,pbuf,dtime,ptend_loc) real(r8), pointer, dimension(:,:) :: cld ! cloud fraction real(r8), pointer, dimension(:,:) :: ac_H2O real(r8), pointer, dimension(:,:) :: ac_SLANT_DIST - integer :: itim, ifld + integer :: ifld integer :: ixcldice, ixcldliq ! indices for CLDICE and CLDLIQ integer :: ixnumice, ixnumliq real(r8):: zi, zm, rog @@ -116,9 +116,8 @@ subroutine ssatcontrail_d0(state1,pbuf,dtime,ptend_loc) call get_wght_all_p(lchnk, ncol, wght) - itim = pbuf_old_tim_idx() ifld = pbuf_get_index('CLD') - call pbuf_get_field(pbuf, ifld, cld, (/1,1,itim/),(/pcols,pver,1/)) + call pbuf_get_field(pbuf, ifld, cld) ifld = pbuf_get_index('ac_H2O') call pbuf_get_field(pbuf,ifld,ac_H2O) diff --git a/src/physics/cam/zm_conv_intr.F90 b/src/physics/cam/zm_conv_intr.F90 index 987f1f84ce..9ee7fe773f 100644 --- a/src/physics/cam/zm_conv_intr.F90 +++ b/src/physics/cam/zm_conv_intr.F90 @@ -374,7 +374,7 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , & use physics_types, only: physics_ptend_sum, physics_ptend_dealloc use time_manager, only: get_nstep, is_first_step - use physics_buffer, only : pbuf_get_field, physics_buffer_desc, pbuf_old_tim_idx + use physics_buffer, only : pbuf_get_field, physics_buffer_desc use constituents, only: pcnst, cnst_get_ind, cnst_is_convtran1 use physconst, only: gravit, latice, latvap, tmelt, cpwv, cpliq, rh2o use phys_grid, only: get_rlat_all_p, get_rlon_all_p @@ -411,7 +411,6 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , & integer :: ixcldice, ixcldliq ! constituent indices for cloud liquid and ice water. integer :: lchnk ! chunk identifier integer :: ncol ! number of atmospheric columns - integer :: itim_old ! for physics buffer fields real(r8) :: ftem(pcols,pver) ! Temporary workspace for outfld variables real(r8) :: ntprprd(pcols,pver) ! evap outfld: net precip production in layer @@ -505,8 +504,7 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , & ! ! Associate pointers with physics buffer fields ! - itim_old = pbuf_old_tim_idx() - call pbuf_get_field(pbuf, cld_idx, cld, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) + call pbuf_get_field(pbuf, cld_idx, cld ) call pbuf_get_field(pbuf, icwmrdp_idx, ql ) call pbuf_get_field(pbuf, rprddp_idx, rprd ) diff --git a/src/physics/cam7/micro_pumas_cam.F90 b/src/physics/cam7/micro_pumas_cam.F90 index 00731a3ef5..1325eb0430 100644 --- a/src/physics/cam7/micro_pumas_cam.F90 +++ b/src/physics/cam7/micro_pumas_cam.F90 @@ -24,8 +24,8 @@ module micro_pumas_cam physics_update, physics_state_dealloc, & physics_ptend_sum, physics_ptend_scale -use physics_buffer, only: physics_buffer_desc, pbuf_add_field, dyn_time_lvls, & - pbuf_old_tim_idx, pbuf_get_index, dtype_r8, dtype_i4, & +use physics_buffer, only: physics_buffer_desc, pbuf_add_field, & + pbuf_get_index, dtype_r8, dtype_i4, & pbuf_get_field, pbuf_set_field, col_type_subcol, & pbuf_register_subcol use constituents, only: cnst_add, cnst_get_ind, & @@ -626,7 +626,7 @@ subroutine micro_pumas_cam_register ! Request physics buffer space for fields that persist across timesteps. - call pbuf_add_field('CLDO','global',dtype_r8,(/pcols,pver,dyn_time_lvls/), cldo_idx) + call pbuf_add_field('CLDO','global',dtype_r8,(/pcols,pver/), cldo_idx) ! Physics buffer variables for convective cloud properties. @@ -660,7 +660,7 @@ subroutine micro_pumas_cam_register ! In cloud snow water path for radiation call pbuf_add_field('ICSWP', 'physpkg',dtype_r8,(/pcols,pver/), icswp_idx) ! Cloud fraction for liquid drops + snow - call pbuf_add_field('CLDFSNOW ', 'physpkg',dtype_r8,(/pcols,pver,dyn_time_lvls/), cldfsnow_idx) + call pbuf_add_field('CLDFSNOW ', 'physpkg',dtype_r8,(/pcols,pver/), cldfsnow_idx) if (micro_mg_version > 2) then ! Graupel effective diameter for radiation @@ -688,13 +688,13 @@ subroutine micro_pumas_cam_register call pbuf_add_field('CV_REFFICE', 'physpkg',dtype_r8,(/pcols,pver/), cv_reffice_idx) ! CC_* Fields needed by Park macrophysics - call pbuf_add_field('CC_T', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), cc_t_idx) - call pbuf_add_field('CC_qv', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), cc_qv_idx) - call pbuf_add_field('CC_ql', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), cc_ql_idx) - call pbuf_add_field('CC_qi', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), cc_qi_idx) - call pbuf_add_field('CC_nl', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), cc_nl_idx) - call pbuf_add_field('CC_ni', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), cc_ni_idx) - call pbuf_add_field('CC_qlst', 'global', dtype_r8, (/pcols,pver,dyn_time_lvls/), cc_qlst_idx) + call pbuf_add_field('CC_T', 'global', dtype_r8, (/pcols,pver/), cc_t_idx) + call pbuf_add_field('CC_qv', 'global', dtype_r8, (/pcols,pver/), cc_qv_idx) + call pbuf_add_field('CC_ql', 'global', dtype_r8, (/pcols,pver/), cc_ql_idx) + call pbuf_add_field('CC_qi', 'global', dtype_r8, (/pcols,pver/), cc_qi_idx) + call pbuf_add_field('CC_nl', 'global', dtype_r8, (/pcols,pver/), cc_nl_idx) + call pbuf_add_field('CC_ni', 'global', dtype_r8, (/pcols,pver/), cc_ni_idx) + call pbuf_add_field('CC_qlst', 'global', dtype_r8, (/pcols,pver/), cc_qlst_idx) ! Register subcolumn pbuf fields if (use_subcol_microp) then @@ -1489,7 +1489,7 @@ subroutine micro_pumas_cam_tend(state, ptend, dtime, pbuf) integer :: lchnk, ncol, psetcols, ngrdcol - integer :: i, k, itim_old, it + integer :: i, k, it real(r8), parameter :: micron2meter = 1.e6_r8 real(r8), parameter :: shapeparam = 1.e5_r8 @@ -1967,7 +1967,6 @@ subroutine micro_pumas_cam_tend(state, ptend, dtime, pbuf) ncol = state%ncol psetcols = state%psetcols ngrdcol = state%ngrdcol - itim_old = pbuf_old_tim_idx() nlev = pver - top_lev + 1 nan_array = nan @@ -2001,11 +2000,11 @@ subroutine micro_pumas_cam_tend(state, ptend, dtime, pbuf) call pbuf_get_field(pbuf, accre_enhan_idx, accre_enhan, col_type=col_type, copy_if_needed=use_subcol_microp) call pbuf_get_field(pbuf, cmeliq_idx, cmeliq, col_type=col_type, copy_if_needed=use_subcol_microp) - call pbuf_get_field(pbuf, cld_idx, cld, start=(/1,1,itim_old/), kount=(/psetcols,pver,1/), & + call pbuf_get_field(pbuf, cld_idx, cld, & col_type=col_type, copy_if_needed=use_subcol_microp) - call pbuf_get_field(pbuf, concld_idx, concld, start=(/1,1,itim_old/), kount=(/psetcols,pver,1/), & + call pbuf_get_field(pbuf, concld_idx, concld, & col_type=col_type, copy_if_needed=use_subcol_microp) - call pbuf_get_field(pbuf, ast_idx, ast, start=(/1,1,itim_old/), kount=(/psetcols,pver,1/), & + call pbuf_get_field(pbuf, ast_idx, ast, & col_type=col_type, copy_if_needed=use_subcol_microp) ! Get convective precip for rainbows @@ -2153,15 +2152,15 @@ subroutine micro_pumas_cam_tend(state, ptend, dtime, pbuf) if (icgrauwp_idx > 0) call pbuf_get_field(pbuf, icgrauwp_idx, icgrauwp, col_type=col_type) if (cldfgrau_idx > 0) call pbuf_get_field(pbuf, cldfgrau_idx, cldfgrau, col_type=col_type) - call pbuf_get_field(pbuf, cldo_idx, cldo, start=(/1,1,itim_old/), kount=(/psetcols,pver,1/), col_type=col_type) - call pbuf_get_field(pbuf, cldfsnow_idx, cldfsnow, start=(/1,1,itim_old/), kount=(/psetcols,pver,1/), col_type=col_type) - call pbuf_get_field(pbuf, cc_t_idx, CC_t, start=(/1,1,itim_old/), kount=(/psetcols,pver,1/), col_type=col_type) - call pbuf_get_field(pbuf, cc_qv_idx, CC_qv, start=(/1,1,itim_old/), kount=(/psetcols,pver,1/), col_type=col_type) - call pbuf_get_field(pbuf, cc_ql_idx, CC_ql, start=(/1,1,itim_old/), kount=(/psetcols,pver,1/), col_type=col_type) - call pbuf_get_field(pbuf, cc_qi_idx, CC_qi, start=(/1,1,itim_old/), kount=(/psetcols,pver,1/), col_type=col_type) - call pbuf_get_field(pbuf, cc_nl_idx, CC_nl, start=(/1,1,itim_old/), kount=(/psetcols,pver,1/), col_type=col_type) - call pbuf_get_field(pbuf, cc_ni_idx, CC_ni, start=(/1,1,itim_old/), kount=(/psetcols,pver,1/), col_type=col_type) - call pbuf_get_field(pbuf, cc_qlst_idx, CC_qlst, start=(/1,1,itim_old/), kount=(/psetcols,pver,1/), col_type=col_type) + call pbuf_get_field(pbuf, cldo_idx, cldo, col_type=col_type) + call pbuf_get_field(pbuf, cldfsnow_idx, cldfsnow, col_type=col_type) + call pbuf_get_field(pbuf, cc_t_idx, CC_t, col_type=col_type) + call pbuf_get_field(pbuf, cc_qv_idx, CC_qv, col_type=col_type) + call pbuf_get_field(pbuf, cc_ql_idx, CC_ql, col_type=col_type) + call pbuf_get_field(pbuf, cc_qi_idx, CC_qi, col_type=col_type) + call pbuf_get_field(pbuf, cc_nl_idx, CC_nl, col_type=col_type) + call pbuf_get_field(pbuf, cc_ni_idx, CC_ni, col_type=col_type) + call pbuf_get_field(pbuf, cc_qlst_idx, CC_qlst, col_type=col_type) if (rate1_cw2pr_st_idx > 0) then call pbuf_get_field(pbuf, rate1_cw2pr_st_idx, rate1ord_cw2pr_st, col_type=col_type) @@ -2219,15 +2218,15 @@ subroutine micro_pumas_cam_tend(state, ptend, dtime, pbuf) if (icgrauwp_idx > 0) call pbuf_get_field(pbuf, icgrauwp_idx, icgrauwp_grid) if (cldfgrau_idx > 0) call pbuf_get_field(pbuf, cldfgrau_idx, cldfgrau_grid) - call pbuf_get_field(pbuf, cldo_idx, cldo_grid, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) - call pbuf_get_field(pbuf, cldfsnow_idx, cldfsnow_grid, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) - call pbuf_get_field(pbuf, cc_t_idx, CC_t_grid, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) - call pbuf_get_field(pbuf, cc_qv_idx, CC_qv_grid, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) - call pbuf_get_field(pbuf, cc_ql_idx, CC_ql_grid, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) - call pbuf_get_field(pbuf, cc_qi_idx, CC_qi_grid, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) - call pbuf_get_field(pbuf, cc_nl_idx, CC_nl_grid, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) - call pbuf_get_field(pbuf, cc_ni_idx, CC_ni_grid, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) - call pbuf_get_field(pbuf, cc_qlst_idx, CC_qlst_grid, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) + call pbuf_get_field(pbuf, cldo_idx, cldo_grid) + call pbuf_get_field(pbuf, cldfsnow_idx, cldfsnow_grid) + call pbuf_get_field(pbuf, cc_t_idx, CC_t_grid) + call pbuf_get_field(pbuf, cc_qv_idx, CC_qv_grid) + call pbuf_get_field(pbuf, cc_ql_idx, CC_ql_grid) + call pbuf_get_field(pbuf, cc_qi_idx, CC_qi_grid) + call pbuf_get_field(pbuf, cc_nl_idx, CC_nl_grid) + call pbuf_get_field(pbuf, cc_ni_idx, CC_ni_grid) + call pbuf_get_field(pbuf, cc_qlst_idx, CC_qlst_grid) if (rate1_cw2pr_st_idx > 0) then call pbuf_get_field(pbuf, rate1_cw2pr_st_idx, rate1ord_cw2pr_st_grid) @@ -2247,7 +2246,7 @@ subroutine micro_pumas_cam_tend(state, ptend, dtime, pbuf) call pbuf_get_field(pbuf, acgcme_idx, acgcme_grid) call pbuf_get_field(pbuf, acnum_idx, acnum_grid) call pbuf_get_field(pbuf, cmeliq_idx, cmeliq_grid) - call pbuf_get_field(pbuf, ast_idx, ast_grid, start=(/1,1,itim_old/), kount=(/pcols,pver,1/)) + call pbuf_get_field(pbuf, ast_idx, ast_grid) !----------------------------------------------------------------------- ! ... Calculate cosine of zenith angle diff --git a/src/physics/cam7/physpkg.F90 b/src/physics/cam7/physpkg.F90 index d00643c8d0..02491eb95c 100644 --- a/src/physics/cam7/physpkg.F90 +++ b/src/physics/cam7/physpkg.F90 @@ -113,7 +113,7 @@ subroutine phys_register ! !----------------------------------------------------------------------- use cam_abortutils, only: endrun - use physics_buffer, only: pbuf_init_time, pbuf_cam_snapshot_register + use physics_buffer, only: pbuf_cam_snapshot_register use physics_buffer, only: pbuf_add_field, dtype_r8, pbuf_register_subcol use constituents, only: cnst_add, cnst_chk_dim @@ -184,9 +184,6 @@ subroutine phys_register subcol_scheme = subcol_get_scheme() - ! Initialize dyn_time_lvls - call pbuf_init_time() - ! Register the subcol scheme call subcol_register() @@ -366,7 +363,7 @@ end subroutine phys_register subroutine phys_inidat( cam_out, pbuf2d ) use cam_abortutils, only: endrun - use physics_buffer, only: pbuf_get_index, physics_buffer_desc, pbuf_set_field, dyn_time_lvls + use physics_buffer, only: pbuf_get_index, physics_buffer_desc, pbuf_set_field use cam_initfiles, only: initial_file_get_id, topo_file_get_id @@ -382,7 +379,7 @@ subroutine phys_inidat( cam_out, pbuf2d ) type(cam_out_t), intent(inout) :: cam_out(begchunk:endchunk) type(physics_buffer_desc), pointer :: pbuf2d(:,:) - integer :: lchnk, m, n, i, k, ncol + integer :: lchnk, m, i, k, ncol type(file_desc_t), pointer :: fh_ini, fh_topo character(len=8) :: fieldname real(r8), pointer :: tptr(:,:), tptr_2(:,:), tptr3d(:,:,:), tptr3d_2(:,:,:) @@ -491,9 +488,7 @@ subroutine phys_inidat( cam_out, pbuf2d ) if(masterproc) write(iulog,*) trim(fieldname), ' initialized to 1000.' tptr=1000._r8 end if - do n=1,dyn_time_lvls - call pbuf_set_field(pbuf2d, m, tptr, start=(/1,n/), kount=(/pcols,1/)) - end do + call pbuf_set_field(pbuf2d, m, tptr) deallocate(tptr) end if @@ -511,9 +506,7 @@ subroutine phys_inidat( cam_out, pbuf2d ) call infld(fieldname, fh_ini, dim1name, 'lev', dim2name, 1, pcols, 1, pver, begchunk, endchunk, & tptr3d, found, gridname='physgrid') if(found) then - do n = 1, dyn_time_lvls - call pbuf_set_field(pbuf2d, m, tptr3d, (/1,1,n/),(/pcols,pver,1/)) - end do + call pbuf_set_field(pbuf2d, m, tptr3d) else call pbuf_set_field(pbuf2d, m, 0._r8) if (masterproc) write(iulog,*) trim(fieldname), ' initialized to 0.' @@ -535,9 +528,7 @@ subroutine phys_inidat( cam_out, pbuf2d ) tptr3d = huge(1.0_r8) end if end if - do n = 1, dyn_time_lvls - call pbuf_set_field(pbuf2d, m, tptr3d, (/1,1,n/),(/pcols,pver,1/)) - end do + call pbuf_set_field(pbuf2d, m, tptr3d) end if fieldname = 'ICCWAT' @@ -546,17 +537,13 @@ subroutine phys_inidat( cam_out, pbuf2d ) call infld(fieldname, fh_ini, dim1name, 'lev', dim2name, 1, pcols, 1, pver, begchunk, endchunk, & tptr3d, found, gridname='physgrid') if(found) then - do n = 1, dyn_time_lvls - call pbuf_set_field(pbuf2d, m, tptr3d, (/1,1,n/),(/pcols,pver,1/)) - end do + call pbuf_set_field(pbuf2d, m, tptr3d) else call cnst_get_ind('CLDICE', ixcldice) call infld('CLDICE',fh_ini,dim1name, 'lev', dim2name, 1, pcols, 1, pver, begchunk, endchunk, & tptr3d, found, gridname='physgrid') if(found) then - do n = 1, dyn_time_lvls - call pbuf_set_field(pbuf2d, m, tptr3d, (/1,1,n/),(/pcols,pver,1/)) - end do + call pbuf_set_field(pbuf2d, m, tptr3d) else call pbuf_set_field(pbuf2d, m, 0._r8) end if @@ -576,9 +563,7 @@ subroutine phys_inidat( cam_out, pbuf2d ) call infld(fieldname, fh_ini, dim1name, 'lev', dim2name, 1, pcols, 1, pver, begchunk, endchunk, & tptr3d, found, gridname='physgrid') if(found) then - do n = 1, dyn_time_lvls - call pbuf_set_field(pbuf2d, m, tptr3d, (/1,1,n/),(/pcols,pver,1/)) - end do + call pbuf_set_field(pbuf2d, m, tptr3d) else allocate(tptr3d_2(pcols,pver,begchunk:endchunk), stat=ierr) if (ierr /= 0) then @@ -604,9 +589,7 @@ subroutine phys_inidat( cam_out, pbuf2d ) end if if (found .or. found2) then - do n = 1, dyn_time_lvls - call pbuf_set_field(pbuf2d, m, tptr3d, (/1,1,n/),(/pcols,pver,1/)) - end do + call pbuf_set_field(pbuf2d, m, tptr3d) if(dycore_is('LR')) call polar_average(pver, tptr3d) else call pbuf_set_field(pbuf2d, m, 0._r8) @@ -632,9 +615,7 @@ subroutine phys_inidat( cam_out, pbuf2d ) tptr3d = huge(1._r8) end if end if - do n = 1, dyn_time_lvls - call pbuf_set_field(pbuf2d, m, tptr3d, (/1,1,n/),(/pcols,pver,1/)) - end do + call pbuf_set_field(pbuf2d, m, tptr3d) end if fieldname = 'CONCLD' @@ -643,9 +624,7 @@ subroutine phys_inidat( cam_out, pbuf2d ) call infld(fieldname, fh_ini, dim1name, 'lev', dim2name, 1, pcols, 1, pver, begchunk, endchunk, & tptr3d, found, gridname='physgrid') if(found) then - do n = 1, dyn_time_lvls - call pbuf_set_field(pbuf2d, m, tptr3d, (/1,1,n/),(/pcols,pver,1/)) - end do + call pbuf_set_field(pbuf2d, m, tptr3d) else call pbuf_set_field(pbuf2d, m, 0._r8) if (masterproc) write(iulog,*) trim(fieldname), ' initialized to 0.' @@ -1208,7 +1187,7 @@ subroutine phys_run2(phys_state, ztodt, phys_tend, pbuf2d, cam_out, & ! Second part of atmospheric physics package after updating of surface models ! !----------------------------------------------------------------------- - use physics_buffer, only: physics_buffer_desc, pbuf_get_chunk, pbuf_deallocate, pbuf_update_tim_idx + use physics_buffer, only: physics_buffer_desc, pbuf_get_chunk, pbuf_deallocate use mo_lightning, only: lightning_no_prod use cam_diagnostics, only: diag_deallocate, diag_surf use carma_intr, only: carma_accumulate_stats @@ -1310,7 +1289,6 @@ subroutine phys_run2(phys_state, ztodt, phys_tend, pbuf2d, cam_out, & call t_startf ('physpkg_st2') call pbuf_deallocate(pbuf2d, 'physpkg') - call pbuf_update_tim_idx() call diag_deallocate() call t_stopf ('physpkg_st2') @@ -1387,7 +1365,7 @@ subroutine tphysac (ztodt, cam_in, & ! o Ion Drag ( Only for WACCM ) ! o Scale Dry Mass Energy !----------------------------------------------------------------------- - use physics_buffer, only: physics_buffer_desc, pbuf_set_field, pbuf_get_index, pbuf_get_field, pbuf_old_tim_idx + use physics_buffer, only: physics_buffer_desc, pbuf_set_field, pbuf_get_index, pbuf_get_field use chemistry, only: chem_is_active, chem_timestep_tend, chem_emissions use cam_diagnostics, only: diag_phys_tend_writeout use gw_drag_cam, only: gw_drag_cam_tend @@ -1548,7 +1526,7 @@ subroutine tphysac (ztodt, cam_in, & integer :: iaermod_lcl ! physics buffer fields for total energy and mass adjustment - integer itim_old, ifld + integer ifld real(r8), pointer, dimension(:,:) :: cld real(r8), pointer, dimension(:,:) :: qini @@ -1588,12 +1566,11 @@ subroutine tphysac (ztodt, cam_in, & call t_startf('tphysac_init') ! Associate pointers with physics buffer fields - itim_old = pbuf_old_tim_idx() - call pbuf_get_field(pbuf, dtcore_idx, dtcore, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) - call pbuf_get_field(pbuf, dqcore_idx, dqcore, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) - call pbuf_get_field(pbuf, ducore_idx, ducore, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) - call pbuf_get_field(pbuf, dvcore_idx, dvcore, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) + call pbuf_get_field(pbuf, dtcore_idx, dtcore ) + call pbuf_get_field(pbuf, dqcore_idx, dqcore ) + call pbuf_get_field(pbuf, ducore_idx, ducore ) + call pbuf_get_field(pbuf, dvcore_idx, dvcore ) call pbuf_get_field(pbuf, qini_idx, qini) call pbuf_get_field(pbuf, cldliqini_idx, cldliqini) @@ -1602,10 +1579,10 @@ subroutine tphysac (ztodt, cam_in, & call pbuf_get_field(pbuf, toticeini_idx, toticeini) ifld = pbuf_get_index('CLD') - call pbuf_get_field(pbuf, ifld, cld, start=(/1,1,itim_old/),kount=(/pcols,pver,1/)) + call pbuf_get_field(pbuf, ifld, cld) ifld = pbuf_get_index('AST') - call pbuf_get_field(pbuf, ifld, ast, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) + call pbuf_get_field(pbuf, ifld, ast ) call cnst_get_ind('Q', ixq) call cnst_get_ind('CLDLIQ', ixcldliq) @@ -2478,7 +2455,7 @@ subroutine tphysac (ztodt, cam_in, & ! ! This call must be after the last parameterization and call to physics_update ! - call pbuf_set_field(pbuf, teout_idx, state%te_cur(:,dyn_te_idx), (/1,itim_old/),(/pcols,1/)) + call pbuf_set_field(pbuf, teout_idx, state%te_cur(:,dyn_te_idx)) ! ! FV: convert dry-type mixing ratios to moist here because physics_dme_adjust ! assumes moist. This is done in p_d_coupling for other dynamics. Bundy, Feb 2004. @@ -2622,8 +2599,8 @@ subroutine tphysbc (ztodt, state, & !----------------------------------------------------------------------- use physics_buffer, only: physics_buffer_desc, pbuf_get_field - use physics_buffer, only: pbuf_get_index, pbuf_old_tim_idx - use physics_buffer, only: col_type_subcol, dyn_time_lvls + use physics_buffer, only: pbuf_get_index + use physics_buffer, only: col_type_subcol use dadadj_cam, only: dadadj_tend use physics_types, only: physics_update, & @@ -2700,7 +2677,7 @@ subroutine tphysbc (ztodt, state, & integer :: m, m_cnst ! physics buffer fields to compute tendencies for stratiform package - integer itim_old, ifld + integer ifld real(r8), pointer, dimension(:,:) :: cld ! cloud fraction ! physics buffer fields for total energy and mass adjustment @@ -2772,11 +2749,10 @@ subroutine tphysbc (ztodt, state, & nstep = get_nstep() ! Associate pointers with physics buffer fields - itim_old = pbuf_old_tim_idx() ifld = pbuf_get_index('CLD') - call pbuf_get_field(pbuf, ifld, cld, (/1,1,itim_old/),(/pcols,pver,1/)) + call pbuf_get_field(pbuf, ifld, cld) - call pbuf_get_field(pbuf, teout_idx, teout, (/1,itim_old/), (/pcols,1/)) + call pbuf_get_field(pbuf, teout_idx, teout) call pbuf_get_field(pbuf, qini_idx, qini) call pbuf_get_field(pbuf, cldliqini_idx, cldliqini) @@ -2784,10 +2760,10 @@ subroutine tphysbc (ztodt, state, & call pbuf_get_field(pbuf, totliqini_idx, totliqini) call pbuf_get_field(pbuf, toticeini_idx, toticeini) - call pbuf_get_field(pbuf, dtcore_idx, dtcore, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) - call pbuf_get_field(pbuf, dqcore_idx, dqcore, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) - call pbuf_get_field(pbuf, ducore_idx, ducore, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) - call pbuf_get_field(pbuf, dvcore_idx, dvcore, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) + call pbuf_get_field(pbuf, dtcore_idx, dtcore ) + call pbuf_get_field(pbuf, dqcore_idx, dqcore ) + call pbuf_get_field(pbuf, ducore_idx, ducore ) + call pbuf_get_field(pbuf, dvcore_idx, dvcore ) ifld = pbuf_get_index('FRACIS') call pbuf_get_field(pbuf, ifld, fracis, start=(/1,1,1/), kount=(/pcols, pver, pcnst/) ) @@ -2873,7 +2849,7 @@ subroutine tphysbc (ztodt, state, & call outfld('TEFIX', state%te_cur(:,dyn_te_idx), pcols, lchnk ) ! T, U, V tendency due to dynamics - if ( nstep > dyn_time_lvls-1 ) then + if ( nstep > 0 ) then dtcore(:ncol,:pver) = (state%t(:ncol,:pver) - dtcore(:ncol,:pver))/ztodt dqcore(:ncol,:pver) = (state%q(:ncol,:pver,ixq) - dqcore(:ncol,:pver))/ztodt ducore(:ncol,:pver) = (state%u(:ncol,:pver) - ducore(:ncol,:pver))/ztodt diff --git a/src/physics/camrt/radiation.F90 b/src/physics/camrt/radiation.F90 index 9cf078e0f6..09e176c8ce 100644 --- a/src/physics/camrt/radiation.F90 +++ b/src/physics/camrt/radiation.F90 @@ -779,7 +779,7 @@ subroutine radiation_tend( & ! model fields to radiation fields. !----------------------------------------------------------------------- - use physics_buffer, only: physics_buffer_desc, pbuf_get_field, pbuf_old_tim_idx + use physics_buffer, only: physics_buffer_desc, pbuf_get_field use phys_grid, only: get_rlat_all_p, get_rlon_all_p use physics_types, only: physics_state, physics_ptend use time_manager, only: get_curr_calday @@ -835,7 +835,6 @@ subroutine radiation_tend( & real(r8) :: ftem(pcols,pver) ! Temporary workspace for outfld variables - integer :: itim_old real(r8), pointer, dimension(:,:) :: rel ! liquid effective drop radius (microns) real(r8), pointer, dimension(:,:) :: rei ! ice effective drop size (microns) real(r8), pointer, dimension(:,:) :: cld ! cloud fraction @@ -915,8 +914,7 @@ subroutine radiation_tend( & write_output=.true. end if - itim_old = pbuf_old_tim_idx() - call pbuf_get_field(pbuf, cld_idx, cld, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) + call pbuf_get_field(pbuf, cld_idx, cld ) call pbuf_get_field(pbuf, qrs_idx,qrs) call pbuf_get_field(pbuf, qrl_idx,qrl) diff --git a/src/physics/carma/cam/carma_intr.F90 b/src/physics/carma/cam/carma_intr.F90 index 8a5e402767..69d12e566e 100644 --- a/src/physics/carma/cam/carma_intr.F90 +++ b/src/physics/carma/cam/carma_intr.F90 @@ -46,7 +46,7 @@ module carma_intr use constituents, only: pcnst, cnst_add, cnst_get_ind, & cnst_name, cnst_longname use cam_abortutils, only: endrun - use physics_buffer, only: physics_buffer_desc, pbuf_add_field, pbuf_old_tim_idx, & + use physics_buffer, only: physics_buffer_desc, pbuf_add_field, & pbuf_get_index, pbuf_get_field, dtype_r8, pbuf_set_field use pio, only: var_desc_t use radconstants, only: nlwbands, nswbands @@ -2098,7 +2098,6 @@ subroutine carma_wetdep_tend(state, ptend, dt, pbuf, dlf, cam_out) integer :: maxbin ! physics buffer - integer itim_old real(r8), pointer, dimension(:,:) :: cldn ! cloud fraction real(r8), pointer, dimension(:,:) :: cme real(r8), pointer, dimension(:,:) :: prain @@ -2126,9 +2125,8 @@ subroutine carma_wetdep_tend(state, ptend, dt, pbuf, dlf, cam_out) lchnk = state%lchnk ! Associate pointers with physics buffer fields - itim_old = pbuf_old_tim_idx() - call pbuf_get_field(pbuf, pbuf_get_index('CLD'), cldn, (/1,1,itim_old/),(/pcols,pver,1/)) + call pbuf_get_field(pbuf, pbuf_get_index('CLD'), cldn) call pbuf_get_field(pbuf, pbuf_get_index('QME'), cme ) call pbuf_get_field(pbuf, pbuf_get_index('PRAIN'), prain ) call pbuf_get_field(pbuf, pbuf_get_index('NEVAPR'), evapr ) diff --git a/src/physics/carma/models/cirrus/carma_model_mod.F90 b/src/physics/carma/models/cirrus/carma_model_mod.F90 index b751221964..ce1b1e3bda 100644 --- a/src/physics/carma/models/cirrus/carma_model_mod.F90 +++ b/src/physics/carma/models/cirrus/carma_model_mod.F90 @@ -92,7 +92,7 @@ module carma_model_mod use cam_abortutils, only: endrun use physics_types, only: physics_state, physics_ptend use ppgrid, only: pcols, pver - use physics_buffer, only: physics_buffer_desc, pbuf_old_tim_idx, pbuf_get_field, pbuf_get_index + use physics_buffer, only: physics_buffer_desc, pbuf_get_field, pbuf_get_index use physconst, only: gravit #if ( defined SPMD ) @@ -777,7 +777,6 @@ subroutine CARMA_DiagnoseBins(carma, cstate, state, pbuf, icol, dt, rc, rliq, pr real(r8) :: lon real(r8), pointer, dimension(:, :) :: sulf ! last saturation wrt ice - integer :: itim_old character(len=8) :: c_name ! constituent name @@ -821,9 +820,8 @@ subroutine CARMA_DiagnoseBins(carma, cstate, state, pbuf, icol, dt, rc, rliq, pr ! Get the index for the prescribed sulfates. This gives the mmr that should be ! present at this location. Use this to scale the size distribution that CARMA ! will generate. - itim_old = pbuf_old_tim_idx() - call pbuf_get_field(pbuf, pbuf_get_index('sulf'), sulf, (/1,1,itim_old/),(/pcols,pver,1/)) + call pbuf_get_field(pbuf, pbuf_get_index('sulf'), sulf) end if end if @@ -847,10 +845,9 @@ subroutine CARMA_DiagnoseBins(carma, cstate, state, pbuf, icol, dt, rc, rliq, pr ! and the size distribution. if (carma_sulfate_method == "carma") then ! Get the index for the prescribed sulfates. - itim_old = pbuf_old_tim_idx() write(c_name, '(A, I2.2)') "CRCN", ibin - call pbuf_get_field(pbuf, pbuf_get_index(c_name), sulf, (/1,1,itim_old/),(/pcols,pver,1/)) + call pbuf_get_field(pbuf, pbuf_get_index(c_name), sulf) mmr(ibin, :) = sulf(icol, :) end if diff --git a/src/physics/carma/models/cirrus_dust/carma_model_mod.F90 b/src/physics/carma/models/cirrus_dust/carma_model_mod.F90 index 0ff512539e..3d436caa8b 100644 --- a/src/physics/carma/models/cirrus_dust/carma_model_mod.F90 +++ b/src/physics/carma/models/cirrus_dust/carma_model_mod.F90 @@ -96,7 +96,7 @@ module carma_model_mod use cam_abortutils, only: endrun use physics_types, only: physics_state, physics_ptend use ppgrid, only: pcols, pver - use physics_buffer, only: physics_buffer_desc, pbuf_old_tim_idx, pbuf_get_field, pbuf_get_index + use physics_buffer, only: physics_buffer_desc, pbuf_get_field, pbuf_get_index use physconst, only: gravit #if ( defined SPMD ) @@ -813,7 +813,6 @@ subroutine CARMA_DiagnoseBins(carma, cstate, state, pbuf, icol, dt, rc, rliq, pr real(r8), pointer, dimension(:, :) :: sulf ! last saturation wrt ice integer :: lchnk ! chunk identifier - integer :: itim character(len=8) :: c_name ! constituent name @@ -858,9 +857,8 @@ subroutine CARMA_DiagnoseBins(carma, cstate, state, pbuf, icol, dt, rc, rliq, pr ! present at this location. Use this to scale the size distribution that CARMA ! will generate. lchnk = state%lchnk - itim = pbuf_old_tim_idx() - call pbuf_get_field(pbuf, pbuf_get_index('sulf'), sulf, (/1,1,itim/),(/pcols,pver,1/)) + call pbuf_get_field(pbuf, pbuf_get_index('sulf'), sulf) end if end if @@ -885,10 +883,9 @@ subroutine CARMA_DiagnoseBins(carma, cstate, state, pbuf, icol, dt, rc, rliq, pr if (carma_sulfate_method == "carma") then ! Get the index for the prescribed sulfates. lchnk = state%lchnk - itim = pbuf_old_tim_idx() write(c_name, '(A, I2.2)') "CRCN", ibin - call pbuf_get_field(pbuf, pbuf_get_index(c_name), sulf, (/1,1,itim/),(/pcols,pver,1/)) + call pbuf_get_field(pbuf, pbuf_get_index(c_name), sulf) mmr(ibin, :) = sulf(icol, :) end if diff --git a/src/physics/rrtmg/radiation.F90 b/src/physics/rrtmg/radiation.F90 index 15cd0c209e..e7dfdc2198 100644 --- a/src/physics/rrtmg/radiation.F90 +++ b/src/physics/rrtmg/radiation.F90 @@ -10,7 +10,7 @@ module radiation use spmd_utils, only: masterproc use ppgrid, only: pcols, pver, pverp, begchunk, endchunk use physics_types, only: physics_state, physics_ptend -use physics_buffer, only: physics_buffer_desc, pbuf_get_field, pbuf_old_tim_idx +use physics_buffer, only: physics_buffer_desc, pbuf_get_field use camsrfexch, only: cam_out_t, cam_in_t use physconst, only: cappa, cpair @@ -803,7 +803,6 @@ subroutine radiation_tend( & integer :: IdxDay(pcols) ! Indices of daylight columns integer :: IdxNite(pcols) ! Indices of night columns - integer :: itim_old real(r8), pointer :: cld(:,:) ! cloud fraction real(r8), pointer :: cldfsnow(:,:) ! cloud fraction of just "snow clouds- whatever they are" @@ -954,15 +953,14 @@ subroutine radiation_tend( & end do ! Associate pointers to physics buffer fields - itim_old = pbuf_old_tim_idx() if (cldfsnow_idx > 0) then - call pbuf_get_field(pbuf, cldfsnow_idx, cldfsnow, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) + call pbuf_get_field(pbuf, cldfsnow_idx, cldfsnow ) endif if (cldfgrau_idx > 0 .and. graupel_in_rad) then - call pbuf_get_field(pbuf, cldfgrau_idx, cldfgrau, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) + call pbuf_get_field(pbuf, cldfgrau_idx, cldfgrau ) endif - call pbuf_get_field(pbuf, cld_idx, cld, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) + call pbuf_get_field(pbuf, cld_idx, cld ) call pbuf_get_field(pbuf, qrs_idx, qrs) call pbuf_get_field(pbuf, qrl_idx, qrl) diff --git a/src/physics/rrtmgp/radiation.F90 b/src/physics/rrtmgp/radiation.F90 index 56e046752f..d945a78e64 100644 --- a/src/physics/rrtmgp/radiation.F90 +++ b/src/physics/rrtmgp/radiation.F90 @@ -13,7 +13,7 @@ module radiation use physics_types, only: physics_state, physics_ptend use phys_control, only: phys_getopts use physics_buffer, only: physics_buffer_desc, pbuf_add_field, dtype_r8, pbuf_get_index, & - pbuf_set_field, pbuf_get_field, pbuf_old_tim_idx + pbuf_set_field, pbuf_get_field use camsrfexch, only: cam_out_t, cam_in_t use physconst, only: cappa, cpair, gravit, stebol @@ -882,7 +882,6 @@ subroutine radiation_tend( & real(r8) :: clon(pcols) ! current longitudes(radians) real(r8) :: coszrs(pcols) ! Cosine solar zenith angle - integer :: itim_old integer :: nextsw_nstep integer :: offset real(r8) :: next_cday @@ -1089,17 +1088,16 @@ subroutine radiation_tend( & end if ! Associate pointers to physics buffer fields - itim_old = pbuf_old_tim_idx() nullify(cldfsnow) if (cldfsnow_idx > 0) then - call pbuf_get_field(pbuf, cldfsnow_idx, cldfsnow, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) + call pbuf_get_field(pbuf, cldfsnow_idx, cldfsnow ) end if nullify(cldfgrau) if (cldfgrau_idx > 0 .and. graupel_in_rad) then - call pbuf_get_field(pbuf, cldfgrau_idx, cldfgrau, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) + call pbuf_get_field(pbuf, cldfgrau_idx, cldfgrau ) endif - call pbuf_get_field(pbuf, cld_idx, cld, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) + call pbuf_get_field(pbuf, cld_idx, cld ) call pbuf_get_field(pbuf, qrs_idx, qrs) call pbuf_get_field(pbuf, qrl_idx, qrl) diff --git a/src/physics/simple/kessler_cam.F90 b/src/physics/simple/kessler_cam.F90 index 93e961cd97..59e62357d1 100644 --- a/src/physics/simple/kessler_cam.F90 +++ b/src/physics/simple/kessler_cam.F90 @@ -2,7 +2,7 @@ module kessler_cam use shr_kind_mod, only: r8 => shr_kind_r8 use ppgrid, only: pcols, pver - use physics_buffer, only: physics_buffer_desc, pbuf_init_time, dtype_r8, & + use physics_buffer, only: physics_buffer_desc, dtype_r8, & pbuf_add_field, pbuf_get_field implicit none diff --git a/src/physics/simple/physpkg.F90 b/src/physics/simple/physpkg.F90 index 4a96220a0a..f7d0559c34 100644 --- a/src/physics/simple/physpkg.F90 +++ b/src/physics/simple/physpkg.F90 @@ -72,7 +72,7 @@ subroutine phys_register use physconst, only: mwh2o, cpwv use constituents, only: cnst_add, cnst_chk_dim - use physics_buffer, only: pbuf_init_time, dtype_r8, pbuf_add_field, pbuf_cam_snapshot_register + use physics_buffer, only: dtype_r8, pbuf_add_field, pbuf_cam_snapshot_register use cam_diagnostics, only: diag_register use chemistry, only: chem_register @@ -94,9 +94,6 @@ subroutine phys_register cam_snapshot_before_num_out = cam_snapshot_before_num, & cam_snapshot_after_num_out = cam_snapshot_after_num) - ! Initialize dyn_time_lvls - call pbuf_init_time() - ! Register water vapor. ! ***** N.B. ***** This must be the first call to cnst_add so that ! water vapor is constituent 1. @@ -396,7 +393,7 @@ subroutine phys_run2(phys_state, ztodt, phys_tend, pbuf2d, cam_out, cam_in) ! Second part of atmospheric physics package after updating of surface models ! !----------------------------------------------------------------------- - use physics_buffer, only: physics_buffer_desc, pbuf_get_chunk, pbuf_deallocate, pbuf_update_tim_idx + use physics_buffer, only: physics_buffer_desc, pbuf_get_chunk, pbuf_deallocate use cam_diagnostics, only: diag_deallocate @@ -451,7 +448,6 @@ subroutine phys_run2(phys_state, ztodt, phys_tend, pbuf2d, cam_out, cam_in) call t_startf ('physpkg_st2') call pbuf_deallocate(pbuf2d, 'physpkg') - call pbuf_update_tim_idx() call diag_deallocate() call t_stopf ('physpkg_st2') @@ -490,7 +486,7 @@ subroutine tphysac (ztodt, cam_in, cam_out, state, tend, pbuf) ! ! o Moist Held-Suarez configuration: Compute surface fluxes and PBL mixing !----------------------------------------------------------------------- - use physics_buffer, only: physics_buffer_desc, pbuf_get_field, pbuf_old_tim_idx + use physics_buffer, only: physics_buffer_desc, pbuf_get_field use physics_types, only: physics_state, physics_tend, physics_state_check use physics_types, only: physics_dme_adjust, set_dry_to_wet use constituents, only: cnst_get_ind, pcnst @@ -537,7 +533,6 @@ subroutine tphysac (ztodt, cam_in, cam_out, state, tend, pbuf) integer :: ixcldice integer :: k integer :: ncol, lchnk - integer :: itim_old logical :: moist_mixing_ratio_dycore real(r8) :: tmp_trac (pcols,pver,pcnst) ! tmp space @@ -554,8 +549,6 @@ subroutine tphysac (ztodt, cam_in, cam_out, state, tend, pbuf) ! number of active atmospheric columns ncol = state%ncol lchnk = state%lchnk - ! Associate pointers with physics buffer fields - itim_old = pbuf_old_tim_idx() ! Validate the physics state. if (state_debug_checks) then @@ -690,8 +683,7 @@ subroutine tphysac (ztodt, cam_in, cam_out, state, tend, pbuf) end if ! store T in buffer for use in computing dynamics T-tendency in next timestep - call pbuf_get_field(pbuf, dtcore_idx, dtcore, & - start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) + call pbuf_get_field(pbuf, dtcore_idx, dtcore) do k = 1,pver dtcore(:ncol,k) = state%t(:ncol,k) end do @@ -726,8 +718,7 @@ subroutine tphysbc (ztodt, state, tend, pbuf, cam_out, cam_in ) !----------------------------------------------------------------------- use physics_buffer, only: physics_buffer_desc, pbuf_get_field - use physics_buffer, only: pbuf_get_index, pbuf_old_tim_idx - use physics_buffer, only: dyn_time_lvls + use physics_buffer, only: pbuf_get_index use physics_types, only: physics_state_check, physics_tend_init use constituents, only: cnst_get_ind @@ -767,7 +758,6 @@ subroutine tphysbc (ztodt, state, tend, pbuf, cam_out, cam_in ) integer :: nstep ! current timestep number integer :: lchnk ! chunk identifier integer :: ncol ! number of atmospheric columns - integer :: itim_old integer :: ixcldliq integer :: ixcldice integer :: m, m_cnst @@ -795,11 +785,8 @@ subroutine tphysbc (ztodt, state, tend, pbuf, cam_out, cam_in ) nstep = get_nstep() ! Associate pointers with physics buffer fields - itim_old = pbuf_old_tim_idx() - - ! Associate pointers with physics buffer fields - call pbuf_get_field(pbuf, teout_idx, teout, (/1,itim_old/), (/pcols,1/)) - call pbuf_get_field(pbuf, dtcore_idx, dtcore, start=(/1,1,itim_old/), kount=(/pcols,pver,1/) ) + call pbuf_get_field(pbuf, teout_idx, teout) + call pbuf_get_field(pbuf, dtcore_idx, dtcore) call pbuf_get_field(pbuf, qini_idx, qini) if (moist_physics) then @@ -875,7 +862,7 @@ subroutine tphysbc (ztodt, state, tend, pbuf, cam_out, cam_in ) call outfld('TEFIX', state%te_cur(:,dyn_te_idx), pcols, lchnk ) ! T tendency due to dynamics - if( nstep > dyn_time_lvls-1 ) then + if( nstep > 0 ) then dtcore(:ncol,:pver) = (state%t(:ncol,:pver) - dtcore(:ncol,:pver))/ztodt call outfld( 'DTCORE', dtcore, pcols, lchnk ) end if