diff --git a/doc/ChangeLog b/doc/ChangeLog index ce4af05dfd..7c012868b7 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,80 @@ + +=============================================================== + +Tag name: cam6_3_158 +Originator(s): cacraig +Date: April 22, 2024 +One-line Summary: ZM clean up round 2 for CAM and cime update for GEOS-Chem +Github PR URL: https://github.com/ESCOMP/CAM/pull/992 + +Purpose of changes (include the issue number and title text for each relevant GitHub issue): + - change zm directory to be zhang_mcfarlane: https://github.com/ESCOMP/CAM/issues/965 + - Reimplement writing within ZM and remove pflx variable: https://github.com/ESCOMP/CAM/issues/978 + - ZM cleanup: https://github.com/ESCOMP/CAM/issues/984 + - Tag cam6_3_157 missing updated .gitignore: https://github.com/ESCOMP/CAM/issues/1012 + - GEOS-Chem compsets will fail due to bugs in CAM and CIME: https://github.com/ESCOMP/CAM/issues/1004 + +Describe any changes made to build system: N/A + +Describe any changes made to the namelist: N/A + +List any changes to the defaults for the boundary datasets: N/A + +Describe any substantial timing or memory changes: N/A + +Code reviewed by: nusbaume + +List all files eliminated: N/A + +List all files added and what they do: N/A + +List all existing files that have been modified, and describe the changes: +M .gitignore + - Update FV3 listing + +M externals.cfg + - Update cime to bring in bug fix for GEOS-Chem + +M Externals_CAM.cfg + - Update atmospheric_physics external to bring in changes for ZM + +M bld/configure + - Change directory from zm to zhang-mcfarlane + +M src/physics/cam/cam_snapshot.F90 +M src/physics/cam/convect_deep.F90 +M src/physics/cam/physpkg.F90 +M src/physics/cam_dev/cam_snapshot.F90 +M src/physics/cam_dev/physpkg.F90 + - Remove pflx variable which is not used + +M src/physics/cam/zm_conv_intr.F90 + - Split winds into separate variable + - remove pflx + - reintroduce writing within ZM + +If there were any failures reported from running test_driver.sh on any test +platform, and checkin with these failures has been OK'd by the gatekeeper, +then copy the lines from the td.*.status files for the failed tests to the +appropriate machine below. All failed tests must be justified. + +derecho/intel/aux_cam: all BFB, except: + ERP_Ln9.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s (Overall: FAIL) details: + - pre-existing failure + + SMS_Lh12.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq3h (Overall: DIFF) details: + - Answer change for HEMCO - approved by Francis and Lizzie due to HEMCO giving different answers when layout changes are made + + SMS_Ld1.f09_f09_mg17.FCHIST_GC.derecho_intel.cam-outfrq1d (Overall: DIFF) details: + - no previous baseline + +izumi/nag/aux_cam: + DAE.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details: + - pre-existing failure + +izumi/gnu/aux_cam: all BFB + +=============================================================== =============================================================== Tag name: cam6_3_157 diff --git a/src/physics/cam/cam_snapshot.F90 b/src/physics/cam/cam_snapshot.F90 index 92f25d775c..7e7d83e9ef 100644 --- a/src/physics/cam/cam_snapshot.F90 +++ b/src/physics/cam/cam_snapshot.F90 @@ -58,7 +58,7 @@ subroutine cam_snapshot_init(cam_in_arr, cam_out_arr, pbuf, index) call phys_getopts(cam_snapshot_before_num_out = cam_snapshot_before_num, & cam_snapshot_after_num_out = cam_snapshot_after_num) - + ! Return if not turned on if (cam_snapshot_before_num <= 0 .and. cam_snapshot_after_num <= 0) return ! No snapshot files are being requested @@ -76,7 +76,7 @@ subroutine cam_snapshot_init(cam_in_arr, cam_out_arr, pbuf, index) end subroutine cam_snapshot_init subroutine cam_snapshot_all_outfld_tphysbc(file_num, state, tend, cam_in, cam_out, pbuf, flx_heat, cmfmc, cmfcme, & - pflx, zdu, rliq, rice, dlf, dlf2, rliq2, det_s, det_ice, net_flx) + zdu, rliq, rice, dlf, dlf2, rliq2, det_s, det_ice, net_flx) use time_manager, only: is_first_step, is_first_restart_step @@ -95,7 +95,6 @@ subroutine cam_snapshot_all_outfld_tphysbc(file_num, state, tend, cam_in, cam_ou real(r8), intent(in) :: flx_heat(:) ! Heat flux for check_energy_chng. real(r8), intent(in) :: cmfmc(:,:) ! convective mass flux real(r8), intent(in) :: cmfcme(:,:) ! cmf condensation - evaporation - real(r8), intent(in) :: pflx(:,:) ! convective rain flux throughout bottom of level real(r8), intent(in) :: zdu(:,:) ! detraining mass flux from deep convection real(r8), intent(in) :: rliq(:) ! vertical integral of liquid not yet in q(ixcldliq) real(r8), intent(in) :: rice(:) ! vertical integral of ice not yet in q(ixcldice) @@ -111,7 +110,7 @@ subroutine cam_snapshot_all_outfld_tphysbc(file_num, state, tend, cam_in, cam_ou ! Return if the first timestep as not all fields may be filled in and this will cause a core dump if (is_first_step().or. is_first_restart_step()) return - ! Return if not turned on + ! Return if not turned on if (cam_snapshot_before_num <= 0 .and. cam_snapshot_after_num <= 0) return ! No snapshot files are being requested lchnk = state%lchnk @@ -119,7 +118,6 @@ subroutine cam_snapshot_all_outfld_tphysbc(file_num, state, tend, cam_in, cam_ou call outfld('tphysbc_flx_heat', flx_heat, pcols, lchnk) call outfld('tphysbc_cmfmc', cmfmc, pcols, lchnk) call outfld('tphysbc_cmfcme', cmfcme, pcols, lchnk) - call outfld('tphysbc_pflx', pflx, pcols, lchnk) call outfld('tphysbc_zdu', zdu, pcols, lchnk) call outfld('tphysbc_rliq', rliq, pcols, lchnk) call outfld('tphysbc_rice', rice, pcols, lchnk) @@ -160,7 +158,7 @@ subroutine cam_snapshot_all_outfld_tphysac(file_num, state, tend, cam_in, cam_ou ! Return if the first timestep as not all fields may be filled in and this will cause a core dump if (is_first_step()) return - ! Return if not turned on + ! Return if not turned on if (cam_snapshot_before_num <= 0 .and. cam_snapshot_after_num <= 0) return ! No snapshot files are being requested lchnk = state%lchnk @@ -182,7 +180,7 @@ subroutine cam_tphysbc_snapshot_init(cam_snapshot_before_num, cam_snapshot_after !-------------------------------------------------------- integer,intent(in) :: cam_snapshot_before_num, cam_snapshot_after_num - + ntphysbc_var = 0 !-------------------------------------------------------- @@ -199,9 +197,6 @@ subroutine cam_tphysbc_snapshot_init(cam_snapshot_before_num, cam_snapshot_after call snapshot_addfld( ntphysbc_var, tphysbc_snapshot, cam_snapshot_before_num, cam_snapshot_after_num, & 'cmfcme', 'tphysbc_cmfcme', 'unset', 'lev') - call snapshot_addfld( ntphysbc_var, tphysbc_snapshot, cam_snapshot_before_num, cam_snapshot_after_num, & - 'pflx', 'tphysbc_pflx', 'unset', 'lev') - call snapshot_addfld( ntphysbc_var, tphysbc_snapshot, cam_snapshot_before_num, cam_snapshot_after_num, & 'zdu', 'tphysbc_zdu', 'unset', 'lev') @@ -240,7 +235,7 @@ subroutine cam_tphysac_snapshot_init(cam_snapshot_before_num, cam_snapshot_after !-------------------------------------------------------- integer,intent(in) :: cam_snapshot_before_num, cam_snapshot_after_num - + ntphysac_var = 0 !-------------------------------------------------------- diff --git a/src/physics/cam/convect_deep.F90 b/src/physics/cam/convect_deep.F90 index edd2043623..ebba3ba9fa 100644 --- a/src/physics/cam/convect_deep.F90 +++ b/src/physics/cam/convect_deep.F90 @@ -5,7 +5,7 @@ module convect_deep ! ! CAM interface to several deep convection interfaces. Currently includes: ! Zhang-McFarlane (default) -! Kerry Emanuel +! Kerry Emanuel ! ! ! Author: D.B. Coleman, Sep 2004 @@ -28,34 +28,34 @@ module convect_deep convect_deep_tend, &! return tendencies convect_deep_tend_2, &! return tendencies deep_scheme_does_scav_trans ! = .t. if scheme does scavenging and conv. transport - + ! Private module data character(len=16) :: deep_scheme ! default set in phys_control.F90, use namelist to change -! Physics buffer indices - integer :: icwmrdp_idx = 0 - integer :: rprddp_idx = 0 - integer :: nevapr_dpcu_idx = 0 - integer :: cldtop_idx = 0 - integer :: cldbot_idx = 0 - integer :: cld_idx = 0 - integer :: fracis_idx = 0 - - integer :: pblh_idx = 0 - integer :: tpert_idx = 0 +! Physics buffer indices + integer :: icwmrdp_idx = 0 + integer :: rprddp_idx = 0 + integer :: nevapr_dpcu_idx = 0 + integer :: cldtop_idx = 0 + integer :: cldbot_idx = 0 + integer :: cld_idx = 0 + integer :: fracis_idx = 0 + + integer :: pblh_idx = 0 + integer :: tpert_idx = 0 integer :: prec_dp_idx = 0 integer :: snow_dp_idx = 0 integer :: ttend_dp_idx = 0 !========================================================================================= - contains + contains !========================================================================================= function deep_scheme_does_scav_trans() ! ! Function called by tphysbc to determine if it needs to do scavenging and convective transport ! or if those have been done by the deep convection scheme. Each scheme could have its own -! identical query function for a less-knowledgable interface but for now, we know that KE +! identical query function for a less-knowledgable interface but for now, we know that KE ! does scavenging & transport, and ZM doesn't ! @@ -76,7 +76,7 @@ subroutine convect_deep_register ! Purpose: register fields with the physics buffer !---------------------------------------- - + use physics_buffer, only : pbuf_add_field, dtype_r8 use zm_conv_intr, only: zm_conv_register use phys_control, only: phys_getopts, use_gw_convect_dp @@ -118,12 +118,12 @@ subroutine convect_deep_init(pref_edge) ! Purpose: declare output fields, initialize variables needed by convection !---------------------------------------- - use cam_history, only: addfld + use cam_history, only: addfld use pmgrid, only: plevp use spmd_utils, only: masterproc use zm_conv_intr, only: zm_conv_init use cam_abortutils, only: endrun - + use physics_buffer, only: physics_buffer_desc, pbuf_get_index implicit none @@ -169,14 +169,14 @@ end subroutine convect_deep_init subroutine convect_deep_tend( & mcon ,cme , & - pflx ,zdu , & + zdu , & rliq ,rice , & ztodt , & state ,ptend ,landfrac ,pbuf) use physics_types, only: physics_state, physics_ptend, physics_tend, physics_ptend_init - + use cam_history, only: outfld use constituents, only: pcnst use zm_conv_intr, only: zm_conv_tend @@ -187,15 +187,14 @@ subroutine convect_deep_tend( & ! Arguments type(physics_state), intent(in ) :: state ! Physics state variables type(physics_ptend), intent(out) :: ptend ! individual parameterization tendencies - + type(physics_buffer_desc), pointer :: pbuf(:) real(r8), intent(in) :: ztodt ! 2 delta t (model time increment) real(r8), intent(in) :: landfrac(pcols) ! Land fraction - + real(r8), intent(out) :: mcon(pcols,pverp) ! Convective mass flux--m sub c - real(r8), intent(out) :: pflx(pcols,pverp) ! scattered precip flux at each level real(r8), intent(out) :: cme(pcols,pver) ! cmf condensation - evaporation real(r8), intent(out) :: zdu(pcols,pver) ! detraining mass flux @@ -203,11 +202,11 @@ subroutine convect_deep_tend( & real(r8), intent(out) :: rice(pcols) ! reserved ice (not yet in cldice) for energy integrals real(r8), pointer :: prec(:) ! total precipitation - real(r8), pointer :: snow(:) ! snow from ZM convection + real(r8), pointer :: snow(:) ! snow from ZM convection real(r8), pointer, dimension(:) :: jctop real(r8), pointer, dimension(:) :: jcbot - real(r8), pointer, dimension(:,:,:) :: cld + real(r8), pointer, dimension(:,:,:) :: cld real(r8), pointer, dimension(:,:) :: ql ! wg grid slice of cloud liquid water. real(r8), pointer, dimension(:,:) :: rprd ! rain production rate real(r8), pointer, dimension(:,:,:) :: fracis ! fraction of transported species that are insoluble @@ -230,9 +229,8 @@ subroutine convect_deep_tend( & select case ( deep_scheme ) case('off', 'UNICON', 'CLUBB_SGS') ! in UNICON case the run method is called from convect_shallow_tend - zero = 0 + zero = 0 mcon = 0 - pflx = 0 cme = 0 zdu = 0 rliq = 0 @@ -244,7 +242,7 @@ subroutine convect_deep_tend( & ! Associate pointers with physics buffer fields ! - call pbuf_get_field(pbuf, cld_idx, cld, start=(/1,1/), kount=(/pcols,pver/) ) + call pbuf_get_field(pbuf, cld_idx, cld, start=(/1,1/), kount=(/pcols,pver/) ) call pbuf_get_field(pbuf, rprddp_idx, rprd ) call pbuf_get_field(pbuf, fracis_idx, fracis, start=(/1,1,1/), kount=(/pcols, pver, pcnst/) ) call pbuf_get_field(pbuf, nevapr_dpcu_idx, evapcdp ) @@ -267,7 +265,7 @@ subroutine convect_deep_tend( & call pbuf_get_field(pbuf, tpert_idx, tpert) call zm_conv_tend( pblh ,mcon ,cme , & - tpert ,pflx ,zdu , & + tpert ,zdu , & rliq ,rice , & ztodt , & jctop, jcbot , & @@ -291,7 +289,7 @@ end subroutine convect_deep_tend subroutine convect_deep_tend_2( state, ptend, ztodt, pbuf) use physics_types, only: physics_state, physics_ptend, physics_ptend_init - + use physics_buffer, only: physics_buffer_desc use constituents, only: pcnst use zm_conv_intr, only: zm_conv_tend_2 @@ -299,14 +297,14 @@ subroutine convect_deep_tend_2( state, ptend, ztodt, pbuf) ! Arguments type(physics_state), intent(in ) :: state ! Physics state variables type(physics_ptend), intent(out) :: ptend ! indivdual parameterization tendencies - + type(physics_buffer_desc), pointer :: pbuf(:) real(r8), intent(in) :: ztodt ! 2 delta t (model time increment) if ( deep_scheme .eq. 'ZM' ) then ! Zhang-McFarlane - call zm_conv_tend_2( state, ptend, ztodt, pbuf) + call zm_conv_tend_2( state, ptend, ztodt, pbuf) else call physics_ptend_init(ptend, state%psetcols, 'convect_deep') end if diff --git a/src/physics/cam/physpkg.F90 b/src/physics/cam/physpkg.F90 index a439f84423..cb7322254f 100644 --- a/src/physics/cam/physpkg.F90 +++ b/src/physics/cam/physpkg.F90 @@ -2126,7 +2126,6 @@ subroutine tphysbc (ztodt, state, & real(r8) dlf(pcols,pver) ! Detraining cld H20 from shallow + deep convections real(r8) dlf2(pcols,pver) ! Detraining cld H20 from shallow convections - real(r8) pflx(pcols,pverp) ! Conv rain flux thru out btm of lev real(r8) rtdt ! 1./ztodt integer lchnk ! chunk identifier @@ -2327,7 +2326,7 @@ subroutine tphysbc (ztodt, state, & if (trim(cam_take_snapshot_before) == "dadadj_tend") then call cam_snapshot_all_outfld_tphysbc(cam_snapshot_before_num, state, tend, cam_in, cam_out, pbuf, & - flx_heat, cmfmc, cmfcme, pflx, zdu, rliq, rice, dlf, dlf2, rliq2, det_s, det_ice, net_flx) + flx_heat, cmfmc, cmfcme, zdu, rliq, rice, dlf, dlf2, rliq2, det_s, det_ice, net_flx) end if call dadadj_tend(ztodt, state, ptend) @@ -2340,7 +2339,7 @@ subroutine tphysbc (ztodt, state, & if (trim(cam_take_snapshot_after) == "dadadj_tend") then call cam_snapshot_all_outfld_tphysbc(cam_snapshot_after_num, state, tend, cam_in, cam_out, pbuf, & - flx_heat, cmfmc, cmfcme, pflx, zdu, rliq, rice, dlf, dlf2, rliq2, det_s, det_ice, net_flx) + flx_heat, cmfmc, cmfcme, zdu, rliq, rice, dlf, dlf2, rliq2, det_s, det_ice, net_flx) end if call t_stopf('dry_adjustment') @@ -2354,12 +2353,12 @@ subroutine tphysbc (ztodt, state, & if (trim(cam_take_snapshot_before) == "convect_deep_tend") then call cam_snapshot_all_outfld_tphysbc(cam_snapshot_before_num, state, tend, cam_in, cam_out, pbuf, & - flx_heat, cmfmc, cmfcme, pflx, zdu, rliq, rice, dlf, dlf2, rliq2, det_s, det_ice, net_flx) + flx_heat, cmfmc, cmfcme, zdu, rliq, rice, dlf, dlf2, rliq2, det_s, det_ice, net_flx) end if call convect_deep_tend( & cmfmc, cmfcme, & - pflx, zdu, & + zdu, & rliq, rice, & ztodt, & state, ptend, cam_in%landfrac, pbuf) @@ -2379,7 +2378,7 @@ subroutine tphysbc (ztodt, state, & if (trim(cam_take_snapshot_after) == "convect_deep_tend") then call cam_snapshot_all_outfld_tphysbc(cam_snapshot_after_num, state, tend, cam_in, cam_out, pbuf, & - flx_heat, cmfmc, cmfcme, pflx, zdu, rliq, rice, dlf, dlf2, rliq2, det_s, det_ice, net_flx) + flx_heat, cmfmc, cmfcme, zdu, rliq, rice, dlf, dlf2, rliq2, det_s, det_ice, net_flx) end if call t_stopf('convect_deep_tend') @@ -2420,7 +2419,7 @@ subroutine tphysbc (ztodt, state, & if (trim(cam_take_snapshot_before) == "convect_shallow_tend") then call cam_snapshot_all_outfld_tphysbc(cam_snapshot_before_num, state, tend, cam_in, cam_out, pbuf, & - flx_heat, cmfmc, cmfcme, pflx, zdu, rliq, rice, dlf, dlf2, rliq2, det_s, det_ice, net_flx) + flx_heat, cmfmc, cmfcme, zdu, rliq, rice, dlf, dlf2, rliq2, det_s, det_ice, net_flx) end if call convect_shallow_tend (ztodt , cmfmc, & @@ -2442,7 +2441,7 @@ subroutine tphysbc (ztodt, state, & if (trim(cam_take_snapshot_after) == "convect_shallow_tend") then call cam_snapshot_all_outfld_tphysbc(cam_snapshot_after_num, state, tend, cam_in, cam_out, pbuf, & - flx_heat, cmfmc, cmfcme, pflx, zdu, rliq, rice, dlf, dlf2, rliq2, det_s, det_ice, net_flx) + flx_heat, cmfmc, cmfcme, zdu, rliq, rice, dlf, dlf2, rliq2, det_s, det_ice, net_flx) end if flx_cnd(:ncol) = prec_sh(:ncol) + rliq2(:ncol) @@ -2540,7 +2539,7 @@ subroutine tphysbc (ztodt, state, & if (trim(cam_take_snapshot_before) == "macrop_driver_tend") then call cam_snapshot_all_outfld_tphysbc(cam_snapshot_before_num, state, tend, cam_in, cam_out, pbuf, & - flx_heat, cmfmc, cmfcme, pflx, zdu, rliq, rice, dlf, dlf2, rliq2, det_s, det_ice, net_flx) + flx_heat, cmfmc, cmfcme, zdu, rliq, rice, dlf, dlf2, rliq2, det_s, det_ice, net_flx) end if call macrop_driver_tend( & @@ -2571,7 +2570,7 @@ subroutine tphysbc (ztodt, state, & if (trim(cam_take_snapshot_after) == "macrop_driver_tend") then call cam_snapshot_all_outfld_tphysbc(cam_snapshot_after_num, state, tend, cam_in, cam_out, pbuf, & - flx_heat, cmfmc, cmfcme, pflx, zdu, rliq, rice, dlf, dlf2, rliq2, det_s, det_ice, net_flx) + flx_heat, cmfmc, cmfcme, zdu, rliq, rice, dlf, dlf2, rliq2, det_s, det_ice, net_flx) end if call check_energy_chng(state, tend, "macrop_tend", nstep, ztodt, & @@ -2587,7 +2586,7 @@ subroutine tphysbc (ztodt, state, & if (trim(cam_take_snapshot_before) == "clubb_tend_cam") then call cam_snapshot_all_outfld_tphysbc(cam_snapshot_before_num, state, tend, cam_in, cam_out, pbuf, & - flx_heat, cmfmc, cmfcme, pflx, zdu, rliq, rice, dlf, dlf2, rliq2, det_s, det_ice, net_flx) + flx_heat, cmfmc, cmfcme, zdu, rliq, rice, dlf, dlf2, rliq2, det_s, det_ice, net_flx) end if call clubb_tend_cam(state, ptend, pbuf, cld_macmic_ztodt,& @@ -2617,7 +2616,7 @@ subroutine tphysbc (ztodt, state, & if (trim(cam_take_snapshot_after) == "clubb_tend_cam") then call cam_snapshot_all_outfld_tphysbc(cam_snapshot_after_num, state, tend, cam_in, cam_out, pbuf, & - flx_heat, cmfmc, cmfcme, pflx, zdu, rliq, rice, dlf, dlf2, rliq2, det_s, det_ice, net_flx) + flx_heat, cmfmc, cmfcme, zdu, rliq, rice, dlf, dlf2, rliq2, det_s, det_ice, net_flx) end if ! Use actual qflux (not lhf/latvap) for consistency with surface fluxes and revised code @@ -2654,7 +2653,7 @@ subroutine tphysbc (ztodt, state, & if (trim(cam_take_snapshot_before) == "microp_section") then call cam_snapshot_all_outfld_tphysbc(cam_snapshot_before_num, state, tend, cam_in, cam_out, pbuf, & - flx_heat, cmfmc, cmfcme, pflx, zdu, rliq, rice, dlf, dlf2, rliq2, det_s, det_ice, net_flx) + flx_heat, cmfmc, cmfcme, zdu, rliq, rice, dlf, dlf2, rliq2, det_s, det_ice, net_flx) end if call t_startf('microp_aero_run') @@ -2667,7 +2666,7 @@ subroutine tphysbc (ztodt, state, & if (trim(cam_take_snapshot_before) == "microp_driver_tend_subcol") then call cam_snapshot_all_outfld_tphysbc(cam_snapshot_before_num, state_sc, tend_sc, cam_in, cam_out, pbuf, & - flx_heat, cmfmc, cmfcme, pflx, zdu, rliq, rice, dlf, dlf2, rliq2, det_s, det_ice, net_flx) + flx_heat, cmfmc, cmfcme, zdu, rliq, rice, dlf, dlf2, rliq2, det_s, det_ice, net_flx) end if call microp_driver_tend(state_sc, ptend_sc, cld_macmic_ztodt, pbuf) @@ -2719,7 +2718,7 @@ subroutine tphysbc (ztodt, state, & if (trim(cam_take_snapshot_after) == "microp_driver_tend_subcol") then call cam_snapshot_all_outfld_tphysbc(cam_snapshot_after_num, state_sc, tend_sc, cam_in, cam_out, pbuf, & - flx_heat, cmfmc, cmfcme, pflx, zdu, rliq, rice, dlf, dlf2, rliq2, det_s, det_ice, net_flx) + flx_heat, cmfmc, cmfcme, zdu, rliq, rice, dlf, dlf2, rliq2, det_s, det_ice, net_flx) end if call check_energy_chng(state_sc, tend_sc, "microp_tend_subcol", & @@ -2751,7 +2750,7 @@ subroutine tphysbc (ztodt, state, & if (trim(cam_take_snapshot_after) == "microp_section") then call cam_snapshot_all_outfld_tphysbc(cam_snapshot_after_num, state, tend, cam_in, cam_out, pbuf, & - flx_heat, cmfmc, cmfcme, pflx, zdu, rliq, rice, dlf, dlf2, rliq2, det_s, det_ice, net_flx) + flx_heat, cmfmc, cmfcme, zdu, rliq, rice, dlf, dlf2, rliq2, det_s, det_ice, net_flx) end if call check_energy_chng(state, tend, "microp_tend", nstep, ztodt, & @@ -2806,7 +2805,7 @@ subroutine tphysbc (ztodt, state, & if (trim(cam_take_snapshot_before) == "aero_model_wetdep") then call cam_snapshot_all_outfld_tphysbc(cam_snapshot_before_num, state, tend, cam_in, cam_out, pbuf, & - flx_heat, cmfmc, cmfcme, pflx, zdu, rliq, rice, dlf, dlf2, rliq2, det_s, det_ice, net_flx) + flx_heat, cmfmc, cmfcme, zdu, rliq, rice, dlf, dlf2, rliq2, det_s, det_ice, net_flx) end if call aero_model_wetdep( state, ztodt, dlf, cam_out, ptend, pbuf) @@ -2818,7 +2817,7 @@ subroutine tphysbc (ztodt, state, & if (trim(cam_take_snapshot_after) == "aero_model_wetdep") then call cam_snapshot_all_outfld_tphysbc(cam_snapshot_after_num, state, tend, cam_in, cam_out, pbuf, & - flx_heat, cmfmc, cmfcme, pflx, zdu, rliq, rice, dlf, dlf2, rliq2, det_s, det_ice, net_flx) + flx_heat, cmfmc, cmfcme, zdu, rliq, rice, dlf, dlf2, rliq2, det_s, det_ice, net_flx) end if if (carma_do_wetdep) then @@ -2873,7 +2872,7 @@ subroutine tphysbc (ztodt, state, & if (trim(cam_take_snapshot_before) == "radiation_tend") then call cam_snapshot_all_outfld_tphysbc(cam_snapshot_before_num, state, tend, cam_in, cam_out, pbuf, & - flx_heat, cmfmc, cmfcme, pflx, zdu, rliq, rice, dlf, dlf2, rliq2, det_s, det_ice, net_flx) + flx_heat, cmfmc, cmfcme, zdu, rliq, rice, dlf, dlf2, rliq2, det_s, det_ice, net_flx) end if call radiation_tend( & @@ -2892,7 +2891,7 @@ subroutine tphysbc (ztodt, state, & if (trim(cam_take_snapshot_after) == "radiation_tend") then call cam_snapshot_all_outfld_tphysbc(cam_snapshot_after_num, state, tend, cam_in, cam_out, pbuf, & - flx_heat, cmfmc, cmfcme, pflx, zdu, rliq, rice, dlf, dlf2, rliq2, det_s, det_ice, net_flx) + flx_heat, cmfmc, cmfcme, zdu, rliq, rice, dlf, dlf2, rliq2, det_s, det_ice, net_flx) end if call check_energy_chng(state, tend, "radheat", nstep, ztodt, zero, zero, zero, net_flx) diff --git a/src/physics/cam/zm_conv_intr.F90 b/src/physics/cam/zm_conv_intr.F90 index d559ce4be4..febf576443 100644 --- a/src/physics/cam/zm_conv_intr.F90 +++ b/src/physics/cam/zm_conv_intr.F90 @@ -357,7 +357,8 @@ subroutine zm_conv_init(pref_edge) limcnv,zmconv_c0_lnd, zmconv_c0_ocn, zmconv_ke, zmconv_ke_lnd, & zmconv_momcu, zmconv_momcd, zmconv_num_cin, zmconv_org, & no_deep_pbl, zmconv_tiedke_add, & - zmconv_capelmt, zmconv_dmpdz,zmconv_parcel_pbl, zmconv_tau, errmsg, errflg) + zmconv_capelmt, zmconv_dmpdz,zmconv_parcel_pbl, zmconv_tau, & + masterproc, iulog, errmsg, errflg) cld_idx = pbuf_get_index('CLD') fracis_idx = pbuf_get_index('FRACIS') @@ -367,7 +368,7 @@ end subroutine zm_conv_init !subroutine zm_conv_tend(state, ptend, tdt) subroutine zm_conv_tend(pblh ,mcon ,cme , & - tpert ,pflx ,zdu , & + tpert ,zdu , & rliq ,rice ,ztodt , & jctop ,jcbot , & state ,ptend_all ,landfrac, pbuf) @@ -399,7 +400,6 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , & real(r8), intent(in) :: landfrac(pcols) ! RBN - Landfrac real(r8), intent(out) :: mcon(pcols,pverp) ! Convective mass flux--m sub c - real(r8), intent(out) :: pflx(pcols,pverp) ! scattered precip flux at each level real(r8), intent(out) :: cme(pcols,pver) ! cmf condensation - evaporation real(r8), intent(out) :: zdu(pcols,pver) ! detraining mass flux @@ -474,12 +474,14 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , & real(r8) :: md_out(pcols,pver) ! used in momentum transport calculation - real(r8) :: winds(pcols, pver, 2) - real(r8) :: wind_tends(pcols, pver, 2) - real(r8) :: pguall(pcols, pver, 2) - real(r8) :: pgdall(pcols, pver, 2) - real(r8) :: icwu(pcols,pver, 2) - real(r8) :: icwd(pcols,pver, 2) + real(r8) :: pguallu(pcols, pver) + real(r8) :: pguallv(pcols, pver) + real(r8) :: pgdallu(pcols, pver) + real(r8) :: pgdallv(pcols, pver) + real(r8) :: icwuu(pcols,pver) + real(r8) :: icwuv(pcols,pver) + real(r8) :: icwdu(pcols,pver) + real(r8) :: icwdv(pcols,pver) real(r8) :: seten(pcols, pver) logical :: l_windt(2) real(r8) :: tfinal1, tfinal2 @@ -503,7 +505,6 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , & ftem = 0._r8 mu_out(:,:) = 0._r8 md_out(:,:) = 0._r8 - wind_tends(:ncol,:pver,:) = 0.0_r8 call physics_state_copy(state,state1) ! copy state to local state1. @@ -561,7 +562,6 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , & ptend_loc%s(:,:) = 0._r8 mcon(:,:) = 0._r8 dlf(:,:) = 0._r8 - pflx(:,:) = 0._r8 cme(:,:) = 0._r8 cape(:) = 0._r8 zdu(:,:) = 0._r8 @@ -587,18 +587,19 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , & !CACNOTE - Need to check errflg and report errors call zm_convr_run(ncol, pver, & pverp, gravit, latice, cpwv, cpliq, rh2o, & - state%t(:ncol,:), state%q(:ncol,:,1), prec(:ncol), jctop(:ncol), jcbot(:ncol), & - pblh(:ncol), state%zm(:ncol,:), state%phis, state%zi(:ncol,:), ptend_loc%q(:ncol,:,1), & + state%t(:ncol,:), state%q(:ncol,:,1), prec(:ncol), & + pblh(:ncol), state%zm(:ncol,:), state%phis(:ncol), state%zi(:ncol,:), ptend_loc%q(:ncol,:,1), & ptend_loc%s(:ncol,:), state%pmid(:ncol,:), state%pint(:ncol,:), state%pdel(:ncol,:), & .5_r8*ztodt, mcon(:ncol,:), cme(:ncol,:), cape(:ncol), & - tpert(:ncol), dlf(:ncol,:), pflx(:ncol,:), zdu(:ncol,:), rprd(:ncol,:), & + tpert(:ncol), dlf(:ncol,:), zdu(:ncol,:), rprd(:ncol,:), & mu(:ncol,:), md(:ncol,:), du(:ncol,:), eu(:ncol,:), ed(:ncol,:), & dp(:ncol,:), dsubcld(:ncol), jt(:ncol), maxg(:ncol), ideep(:ncol), & ql(:ncol,:), rliq(:ncol), landfrac(:ncol), & - org_ncol(:,:), orgt_ncol(:,:), zm_org2d_ncol(:,:), & + org_ncol(:ncol,:), orgt_ncol(:ncol,:), zm_org2d_ncol(:ncol,:), & dif(:ncol,:), dnlf(:ncol,:), dnif(:ncol,:), & rice(:ncol), errmsg, errflg) + if (zmconv_org) then ptend_loc%q(:,:,ixorg)=orgt_ncol(:ncol,:) zm_org2d(:ncol,:) = zm_org2d_ncol(:ncol,:) @@ -607,6 +608,13 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , & lengath = count(ideep > 0) if (lengath > ncol) lengath = ncol ! should not happen, but force it to not be larger than ncol for safety sake + jctop(:) = real(pver,r8) + jcbot(:) = 1._r8 + do i = 1,lengath + jctop(ideep(i)) = real(jt(i), r8) + jcbot(ideep(i)) = real(maxg(i), r8) + end do + call outfld('CAPE', cape, pcols, lchnk) ! RBN - CAPE output ! ! Output fractional occurance of ZM convection @@ -746,33 +754,34 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , & call physics_ptend_init(ptend_loc, state1%psetcols, 'zm_conv_momtran_run', ls=.true., lu=.true., lv=.true.) - winds(:ncol,:pver,1) = state1%u(:ncol,:pver) - winds(:ncol,:pver,2) = state1%v(:ncol,:pver) - l_windt(1) = .true. l_windt(2) = .true. +!REMOVECAM - no longer need these when CAM is retired and pcols no longer exists + ptend_loc%s(:,:) = 0._r8 + ptend_loc%u(:,:) = 0._r8 + ptend_loc%v(:,:) = 0._r8 +!REMOVECAM_END call t_startf ('zm_conv_momtran_run') -!REMOVECAM - no longer need this when CAM is retired and pcols no longer exists - wind_tends(:,:,:) = 0._r8 -!REMOVECAM_END - call zm_conv_momtran_run (ncol, pver, pverp, & - l_windt,winds(:ncol,:,:), 2, mu(:ncol,:), md(:ncol,:), & + l_windt,state1%u(:ncol,:), state1%v(:ncol,:), 2, mu(:ncol,:), md(:ncol,:), & zmconv_momcu, zmconv_momcd, & du(:ncol,:), eu(:ncol,:), ed(:ncol,:), dp(:ncol,:), dsubcld(:ncol), & jt(:ncol), maxg(:ncol), ideep(:ncol), 1, lengath, & - nstep, wind_tends(:ncol,:,:), pguall(:ncol,:,:), pgdall(:ncol,:,:), & - icwu(:ncol,:,:), icwd(:ncol,:,:), ztodt, seten(:ncol,:) ) + nstep, ptend_loc%u(:ncol,:), ptend_loc%v(:ncol,:),& + pguallu(:ncol,:), pguallv(:ncol,:), pgdallu(:ncol,:), pgdallv(:ncol,:), & + icwuu(:ncol,:), icwuv(:ncol,:), icwdu(:ncol,:), icwdv(:ncol,:), ztodt, seten(:ncol,:) ) call t_stopf ('zm_conv_momtran_run') - ptend_loc%u(:ncol,:pver) = wind_tends(:ncol,:pver,1) - ptend_loc%v(:ncol,:pver) = wind_tends(:ncol,:pver,2) ptend_loc%s(:ncol,:pver) = seten(:ncol,:pver) call physics_ptend_sum(ptend_loc,ptend_all, ncol) + ! Output ptend variables before they are set to zero with physics_update + call outfld('ZMMTU', ptend_loc%u, pcols, lchnk) + call outfld('ZMMTV', ptend_loc%v, pcols, lchnk) + ! update physics state type state1 with ptend_loc call physics_update(state1, ptend_loc, ztodt) @@ -782,20 +791,18 @@ subroutine zm_conv_tend(pblh ,mcon ,cme , & call outfld('ZM_ORG2D', zm_org2d, pcols, lchnk) endif call outfld('ZMMTT', ftem , pcols, lchnk) - call outfld('ZMMTU', wind_tends(1,1,1), pcols, lchnk) - call outfld('ZMMTV', wind_tends(1,1,2), pcols, lchnk) ! Output apparent force from pressure gradient - call outfld('ZMUPGU', pguall(1,1,1), pcols, lchnk) - call outfld('ZMUPGD', pgdall(1,1,1), pcols, lchnk) - call outfld('ZMVPGU', pguall(1,1,2), pcols, lchnk) - call outfld('ZMVPGD', pgdall(1,1,2), pcols, lchnk) + call outfld('ZMUPGU', pguallu, pcols, lchnk) + call outfld('ZMUPGD', pgdallu, pcols, lchnk) + call outfld('ZMVPGU', pguallv, pcols, lchnk) + call outfld('ZMVPGD', pgdallv, pcols, lchnk) ! Output in-cloud winds - call outfld('ZMICUU', icwu(1,1,1), pcols, lchnk) - call outfld('ZMICUD', icwd(1,1,1), pcols, lchnk) - call outfld('ZMICVU', icwu(1,1,2), pcols, lchnk) - call outfld('ZMICVD', icwd(1,1,2), pcols, lchnk) + call outfld('ZMICUU', icwuu, pcols, lchnk) + call outfld('ZMICUD', icwdu, pcols, lchnk) + call outfld('ZMICVU', icwuv, pcols, lchnk) + call outfld('ZMICVD', icwdv, pcols, lchnk) end if diff --git a/src/physics/cam_dev/cam_snapshot.F90 b/src/physics/cam_dev/cam_snapshot.F90 index 898bcbf151..360516bd49 100644 --- a/src/physics/cam_dev/cam_snapshot.F90 +++ b/src/physics/cam_dev/cam_snapshot.F90 @@ -21,7 +21,7 @@ module cam_snapshot use cam_snapshot_common, only: snapshot_type, cam_snapshot_deactivate, cam_snapshot_all_outfld, cam_snapshot_ptend_outfld use cam_snapshot_common, only: snapshot_type, cam_state_snapshot_init, cam_cnst_snapshot_init, cam_tend_snapshot_init use cam_snapshot_common, only: cam_ptend_snapshot_init, cam_in_snapshot_init, cam_out_snapshot_init -use cam_snapshot_common, only: cam_pbuf_snapshot_init, snapshot_addfld +use cam_snapshot_common, only: cam_pbuf_snapshot_init, snapshot_addfld implicit none @@ -58,7 +58,7 @@ subroutine cam_snapshot_init(cam_in_arr, cam_out_arr, pbuf, index) call phys_getopts(cam_snapshot_before_num_out = cam_snapshot_before_num, & cam_snapshot_after_num_out = cam_snapshot_after_num) - + ! Return if not turned on if (cam_snapshot_before_num <= 0 .and. cam_snapshot_after_num <= 0) return ! No snapshot files are being requested @@ -76,7 +76,7 @@ subroutine cam_snapshot_init(cam_in_arr, cam_out_arr, pbuf, index) end subroutine cam_snapshot_init subroutine cam_snapshot_all_outfld_tphysbc(file_num, state, tend, cam_in, cam_out, pbuf, cmfmc, cmfcme, & - pflx, zdu, rliq, rice, dlf, dlf2, rliq2, net_flx) + zdu, rliq, rice, dlf, dlf2, rliq2, net_flx) use time_manager, only: is_first_step, is_first_restart_step @@ -94,7 +94,6 @@ subroutine cam_snapshot_all_outfld_tphysbc(file_num, state, tend, cam_in, cam_ou type(physics_buffer_desc), pointer, intent(in) :: pbuf(:) real(r8), intent(in) :: cmfmc(:,:) ! convective mass flux real(r8), intent(in) :: cmfcme(:,:) ! cmf condensation - evaporation - real(r8), intent(in) :: pflx(:,:) ! convective rain flux throughout bottom of level real(r8), intent(in) :: zdu(:,:) ! detraining mass flux from deep convection real(r8), intent(in) :: rliq(:) ! vertical integral of liquid not yet in q(ixcldliq) real(r8), intent(in) :: rice(:) ! vertical integral of ice not yet in q(ixcldice) @@ -108,14 +107,13 @@ subroutine cam_snapshot_all_outfld_tphysbc(file_num, state, tend, cam_in, cam_ou ! Return if the first timestep as not all fields may be filled in and this will cause a core dump if (is_first_step().or. is_first_restart_step()) return - ! Return if not turned on + ! Return if not turned on if (cam_snapshot_before_num <= 0 .and. cam_snapshot_after_num <= 0) return ! No snapshot files are being requested lchnk = state%lchnk call outfld('tphysbc_cmfmc', cmfmc, pcols, lchnk) call outfld('tphysbc_cmfcme', cmfcme, pcols, lchnk) - call outfld('tphysbc_pflx', pflx, pcols, lchnk) call outfld('tphysbc_zdu', zdu, pcols, lchnk) call outfld('tphysbc_rliq', rliq, pcols, lchnk) call outfld('tphysbc_rice', rice, pcols, lchnk) @@ -160,7 +158,7 @@ subroutine cam_snapshot_all_outfld_tphysac(file_num, state, tend, cam_in, cam_ou ! Return if the first timestep as not all fields may be filled in and this will cause a core dump if (is_first_step()) return - ! Return if not turned on + ! Return if not turned on if (cam_snapshot_before_num <= 0 .and. cam_snapshot_after_num <= 0) return ! No snapshot files are being requested lchnk = state%lchnk @@ -187,7 +185,7 @@ subroutine cam_tphysbc_snapshot_init(cam_snapshot_before_num, cam_snapshot_after !-------------------------------------------------------- integer,intent(in) :: cam_snapshot_before_num, cam_snapshot_after_num - + ntphysbc_var = 0 !-------------------------------------------------------- @@ -204,9 +202,6 @@ subroutine cam_tphysbc_snapshot_init(cam_snapshot_before_num, cam_snapshot_after call snapshot_addfld( ntphysbc_var, tphysbc_snapshot, cam_snapshot_before_num, cam_snapshot_after_num, & 'cmfcme', 'tphysbc_cmfcme', 'unset', 'lev') - call snapshot_addfld( ntphysbc_var, tphysbc_snapshot, cam_snapshot_before_num, cam_snapshot_after_num, & - 'pflx', 'tphysbc_pflx', 'unset', 'lev') - call snapshot_addfld( ntphysbc_var, tphysbc_snapshot, cam_snapshot_before_num, cam_snapshot_after_num, & 'zdu', 'tphysbc_zdu', 'unset', 'lev') @@ -239,7 +234,7 @@ subroutine cam_tphysac_snapshot_init(cam_snapshot_before_num, cam_snapshot_after !-------------------------------------------------------- integer,intent(in) :: cam_snapshot_before_num, cam_snapshot_after_num - + ntphysac_var = 0 !-------------------------------------------------------- diff --git a/src/physics/cam_dev/physpkg.F90 b/src/physics/cam_dev/physpkg.F90 index 46805c150e..aef997716f 100644 --- a/src/physics/cam_dev/physpkg.F90 +++ b/src/physics/cam_dev/physpkg.F90 @@ -2543,7 +2543,6 @@ subroutine tphysbc (ztodt, state, & real(r8) dlf(pcols,pver) ! Detraining cld H20 from shallow + deep convections real(r8) dlf2(pcols,pver) ! Detraining cld H20 from shallow convections - real(r8) pflx(pcols,pverp) ! Conv rain flux thru out btm of lev real(r8) rtdt ! 1./ztodt integer lchnk ! chunk identifier @@ -2735,7 +2734,7 @@ subroutine tphysbc (ztodt, state, & if (trim(cam_take_snapshot_before) == "dadadj_tend") then call cam_snapshot_all_outfld_tphysbc(cam_snapshot_before_num, state, tend, cam_in, cam_out, pbuf, & - cmfmc, cmfcme, pflx, zdu, rliq, rice, dlf, dlf2, rliq2, net_flx) + cmfmc, cmfcme, zdu, rliq, rice, dlf, dlf2, rliq2, net_flx) end if call dadadj_tend(ztodt, state, ptend) @@ -2748,7 +2747,7 @@ subroutine tphysbc (ztodt, state, & if (trim(cam_take_snapshot_after) == "dadadj_tend") then call cam_snapshot_all_outfld_tphysbc(cam_snapshot_after_num, state, tend, cam_in, cam_out, pbuf, & - cmfmc, cmfcme, pflx, zdu, rliq, rice, dlf, dlf2, rliq2, net_flx) + cmfmc, cmfcme, zdu, rliq, rice, dlf, dlf2, rliq2, net_flx) end if call t_stopf('dry_adjustment') @@ -2762,12 +2761,12 @@ subroutine tphysbc (ztodt, state, & if (trim(cam_take_snapshot_before) == "convect_deep_tend") then call cam_snapshot_all_outfld_tphysbc(cam_snapshot_before_num, state, tend, cam_in, cam_out, pbuf, & - cmfmc, cmfcme, pflx, zdu, rliq, rice, dlf, dlf2, rliq2, net_flx) + cmfmc, cmfcme, zdu, rliq, rice, dlf, dlf2, rliq2, net_flx) end if call convect_deep_tend( & cmfmc, cmfcme, & - pflx, zdu, & + zdu, & rliq, rice, & ztodt, & state, ptend, cam_in%landfrac, pbuf) @@ -2787,7 +2786,7 @@ subroutine tphysbc (ztodt, state, & if (trim(cam_take_snapshot_after) == "convect_deep_tend") then call cam_snapshot_all_outfld_tphysbc(cam_snapshot_after_num, state, tend, cam_in, cam_out, pbuf, & - cmfmc, cmfcme, pflx, zdu, rliq, rice, dlf, dlf2, rliq2, net_flx) + cmfmc, cmfcme, zdu, rliq, rice, dlf, dlf2, rliq2, net_flx) end if call t_stopf('convect_deep_tend') @@ -2828,7 +2827,7 @@ subroutine tphysbc (ztodt, state, & if (trim(cam_take_snapshot_before) == "convect_diagnostics_calc") then call cam_snapshot_all_outfld_tphysbc(cam_snapshot_before_num, state, tend, cam_in, cam_out, pbuf, & - cmfmc, cmfcme, pflx, zdu, rliq, rice, dlf, dlf2, rliq2, net_flx) + cmfmc, cmfcme, zdu, rliq, rice, dlf, dlf2, rliq2, net_flx) end if call convect_diagnostics_calc (ztodt , cmfmc, & dlf , dlf2 , rliq , rliq2, &