From 370e3a94549578f3ebb78e9a2a98ffa9ab1a8b87 Mon Sep 17 00:00:00 2001 From: XiaSun-NOAA Date: Mon, 24 Aug 2020 21:54:22 +0000 Subject: [PATCH 01/25] change hard-coded dimensions to assumed sizes --- physics/GFS_DCNV_generic.F90 | 28 +- physics/GFS_GWD_generic.F90 | 6 +- physics/GFS_MP_generic.F90 | 56 +- physics/GFS_PBL_generic.F90 | 28 +- physics/GFS_SCNV_generic.F90 | 16 +- physics/GFS_cloud_diagnostics.F90 | 14 +- physics/GFS_debug.F90 | 36 +- physics/GFS_rrtmg_post.F90 | 14 +- physics/GFS_rrtmg_pre.F90 | 30 +- physics/GFS_rrtmgp_gfdlmp_pre.F90 | 12 +- physics/GFS_rrtmgp_lw_post.F90 | 26 +- physics/GFS_rrtmgp_pre.F90 | 16 +- physics/GFS_rrtmgp_setup.F90 | 4 +- physics/GFS_rrtmgp_sw_post.F90 | 32 +- physics/GFS_rrtmgp_sw_pre.F90 | 16 +- physics/GFS_rrtmgp_zhaocarr_pre.F90 | 12 +- physics/GFS_stochastics.F90 | 48 +- physics/GFS_suite_interstitial.F90 | 96 +- physics/GFS_surface_composites.F90 | 48 +- physics/GFS_surface_generic.F90 | 68 +- physics/GFS_surface_loop_control.F90 | 8 +- physics/GFS_time_vary_pre.fv3.F90 | 2 +- physics/GFS_time_vary_pre.scm.F90 | 2 +- physics/cires_ugwp.F90 | 34 +- physics/cnvc90.f | 20 +- physics/cs_conv.F90 | 74 +- physics/cs_conv_aw_adj.F90 | 18 +- physics/cu_gf_driver.F90 | 34 +- physics/cu_ntiedtke.F90 | 20 +- physics/dcyc2.f | 16 +- physics/drag_suite.F90 | 44 +- physics/flake_driver.F90 | 8 +- physics/gcm_shoc.F90 | 34 +- physics/get_prs_fv3.F90 | 22 +- physics/gfdl_cloud_microphys.F90 | 28 +- physics/gfdl_fv_sat_adj.F90 | 4 +- physics/gfdl_fv_sat_adj.F90_assumedsizes | 1431 +++++++ physics/gitdiff | 4397 +++++++++++++++++++++ physics/gscond.f | 16 +- physics/gwdc.f | 14 +- physics/gwdps.f | 2 +- physics/h2ophys.f | 8 +- physics/lsm_ruc_sfc_sice_interstitial.F90 | 16 +- physics/m_micro.F90 | 18 +- physics/m_micro_interstitial.F90 | 32 +- physics/maximum_hourly_diagnostics.F90 | 38 +- physics/module_MYJSFC_wrapper.F90 | 20 +- physics/module_MYNNPBL_wrapper.F90 | 26 +- physics/module_MYNNSFC_wrapper.F90 | 18 +- physics/module_SGSCloud_RadPost.F90 | 4 +- physics/module_SGSCloud_RadPre.F90 | 20 +- physics/moninedmf.f | 42 +- physics/moninedmf_hafs.f | 44 +- physics/moninshoc.f | 22 +- physics/mp_fer_hires.F90 | 44 +- physics/mp_thompson.F90 | 44 +- physics/mp_thompson_post.F90 | 6 +- physics/mp_thompson_pre.F90 | 4 +- physics/ozphys.f | 4 +- physics/ozphys_2015.f | 10 +- physics/precpd.f | 14 +- physics/radlw_main.f | 28 +- physics/radsw_main.f | 60 +- physics/rayleigh_damp.f | 6 +- physics/rrtmg_lw_post.F90 | 4 +- physics/rrtmg_lw_pre.F90 | 2 +- physics/rrtmg_sw_post.F90 | 6 +- physics/rrtmg_sw_pre.F90 | 8 +- physics/rrtmgp_lw_aerosol_optics.F90 | 12 +- physics/rrtmgp_lw_cloud_optics.F90 | 6 +- physics/rrtmgp_lw_cloud_sampling.F90 | 6 +- physics/rrtmgp_lw_gas_optics.F90 | 8 +- physics/rrtmgp_lw_pre.F90 | 6 +- physics/rrtmgp_lw_rte.F90 | 12 +- physics/rrtmgp_sw_aerosol_optics.F90 | 14 +- physics/rrtmgp_sw_cloud_optics.F90 | 6 +- physics/rrtmgp_sw_cloud_sampling.F90 | 8 +- physics/rrtmgp_sw_gas_optics.F90 | 12 +- physics/rrtmgp_sw_rte.F90 | 18 +- physics/samfdeepcnv.f | 26 +- physics/samfshalcnv.f | 18 +- physics/satmedmfvdif.F | 40 +- physics/satmedmfvdifq.F | 44 +- physics/sfc_cice.f | 4 +- physics/sfc_diag.f | 4 +- physics/sfc_diag_post.F90 | 8 +- physics/sfc_diff.f | 14 +- physics/sfc_drv.f | 14 +- physics/sfc_drv_ruc.F90 | 58 +- physics/sfc_noahmp_drv.f | 26 +- physics/sfc_nst.f | 14 +- physics/sfc_ocean.F | 6 +- physics/sfc_sice.f | 12 +- physics/shinhongvdif.F90 | 38 +- physics/ysuvdif.F90 | 18 +- 95 files changed, 6831 insertions(+), 1003 deletions(-) create mode 100644 physics/gfdl_fv_sat_adj.F90_assumedsizes create mode 100644 physics/gitdiff diff --git a/physics/GFS_DCNV_generic.F90 b/physics/GFS_DCNV_generic.F90 index bfe97bc707..def1e7f4ef 100644 --- a/physics/GFS_DCNV_generic.F90 +++ b/physics/GFS_DCNV_generic.F90 @@ -26,14 +26,14 @@ subroutine GFS_DCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, do_cnvgwd, cplc integer, intent(in) :: im, levs logical, intent(in) :: ldiag3d, qdiag3d, do_cnvgwd, cplchm - real(kind=kind_phys), dimension(im,levs), intent(in) :: gu0 - real(kind=kind_phys), dimension(im,levs), intent(in) :: gv0 - real(kind=kind_phys), dimension(im,levs), intent(in) :: gt0 - real(kind=kind_phys), dimension(im,levs), intent(inout) :: gq0_water_vapor - real(kind=kind_phys), dimension(im,levs), intent(inout) :: save_u - real(kind=kind_phys), dimension(im,levs), intent(inout) :: save_v - real(kind=kind_phys), dimension(im,levs), intent(inout) :: save_t - real(kind=kind_phys), dimension(im,levs), intent(inout) :: save_qv + real(kind=kind_phys), dimension(:,:), intent(in) :: gu0 + real(kind=kind_phys), dimension(:,:), intent(in) :: gv0 + real(kind=kind_phys), dimension(:,:), intent(in) :: gt0 + real(kind=kind_phys), dimension(:,:), intent(inout) :: gq0_water_vapor + real(kind=kind_phys), dimension(:,:), intent(inout) :: save_u + real(kind=kind_phys), dimension(:,:), intent(inout) :: save_v + real(kind=kind_phys), dimension(:,:), intent(inout) :: save_t + real(kind=kind_phys), dimension(:,:), intent(inout) :: save_qv ! dqdti only allocated if cplchm is .true. real(kind=kind_phys), dimension(:,:), intent(inout) :: dqdti character(len=*), intent(out) :: errmsg @@ -107,18 +107,18 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, qdiag3d, ras, cs logical, intent(in) :: flag_for_dcnv_generic_tend real(kind=kind_phys), intent(in) :: frain, dtf - real(kind=kind_phys), dimension(im), intent(in) :: rain1, cld1d - real(kind=kind_phys), dimension(im,levs), intent(in) :: save_u, save_v, save_t, save_qv - real(kind=kind_phys), dimension(im,levs), intent(in) :: gu0, gv0, gt0, gq0_water_vapor - real(kind=kind_phys), dimension(im,levs), intent(in) :: ud_mf, dd_mf, dt_mf + real(kind=kind_phys), dimension(:), intent(in) :: rain1, cld1d + real(kind=kind_phys), dimension(:,:), intent(in) :: save_u, save_v, save_t, save_qv + real(kind=kind_phys), dimension(:,:), intent(in) :: gu0, gv0, gt0, gq0_water_vapor + real(kind=kind_phys), dimension(:,:), intent(in) :: ud_mf, dd_mf, dt_mf real(kind=kind_phys), intent(in) :: con_g integer, intent(in) :: npdf3d, num_p3d, ncnvcld3d - real(kind=kind_phys), dimension(im), intent(inout) :: rainc, cldwrk + real(kind=kind_phys), dimension(:), intent(inout) :: rainc, cldwrk ! dt3dt, dq3dt, du3dt, dv3dt upd_mf, dwn_mf, det_mf only allocated if ldiag3d == .true. real(kind=kind_phys), dimension(:,:), intent(inout) :: dt3dt, dq3dt, du3dt, dv3dt real(kind=kind_phys), dimension(:,:), intent(inout) :: upd_mf, dwn_mf, det_mf - real(kind=kind_phys), dimension(im,levs), intent(inout) :: cnvw, cnvc + real(kind=kind_phys), dimension(:,:), intent(inout) :: cnvw, cnvc ! The following arrays may not be allocated, depending on certain flags and microphysics schemes. ! Since Intel 15 crashes when passing unallocated arrays to arrays defined with explicit shape, ! use assumed-shape arrays. Note that Intel 18 and GNU 6.2.0-8.1.0 tolerate explicit-shape arrays diff --git a/physics/GFS_GWD_generic.F90 b/physics/GFS_GWD_generic.F90 index 09c9691627..a6c6dd4672 100644 --- a/physics/GFS_GWD_generic.F90 +++ b/physics/GFS_GWD_generic.F90 @@ -30,12 +30,12 @@ subroutine GFS_GWD_generic_pre_run( & real(kind=kind_phys), intent(in) :: mntvar(im,nmtvr) real(kind=kind_phys), intent(out) :: & - & oc(im), oa4(im,4), clx(im,4), & + & oc(:), oa4(:,:), clx(:,:), & & varss(:), ocss(:), oa4ss(:,:), clxss(:,:), & - & theta(im), sigma(im), gamma(im), elvmax(im) + & theta(:), sigma(:), gamma(:), elvmax(:) logical, intent(in) :: lssav, ldiag3d, flag_for_gwd_generic_tend - real(kind=kind_phys), intent(in) :: dtdt(im,levs), dudt(im,levs), dvdt(im,levs) + real(kind=kind_phys), intent(in) :: dtdt(:,:), dudt(:,:), dvdt(:,:) ! dt3dt only allocated only if ldiag3d is .true. real(kind=kind_phys), intent(inout) :: dt3dt(:,:), du3dt(:,:), dv3dt(:,:) real(kind=kind_phys), intent(in) :: dtf diff --git a/physics/GFS_MP_generic.F90 b/physics/GFS_MP_generic.F90 index 8810cc7cf7..be1953633e 100644 --- a/physics/GFS_MP_generic.F90 +++ b/physics/GFS_MP_generic.F90 @@ -23,11 +23,11 @@ subroutine GFS_MP_generic_pre_run(im, levs, ldiag3d, qdiag3d, do_aw, ntcw, nncl, implicit none integer, intent(in) :: im, levs, ntcw, nncl, ntrac logical, intent(in) :: ldiag3d, qdiag3d, do_aw - real(kind=kind_phys), dimension(im, levs), intent(in) :: gt0 - real(kind=kind_phys), dimension(im, levs, ntrac), intent(in) :: gq0 + real(kind=kind_phys), dimension(:,:), intent(in) :: gt0 + real(kind=kind_phys), dimension(:,:,:), intent(in) :: gq0 - real(kind=kind_phys), dimension(im, levs), intent(inout) :: save_t, save_qv - real(kind=kind_phys), dimension(im, levs, ntrac), intent(inout) :: save_q + real(kind=kind_phys), dimension(:,:), intent(inout) :: save_t, save_qv + real(kind=kind_phys), dimension(:,:,:), intent(inout) :: save_q character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -109,16 +109,16 @@ subroutine GFS_MP_generic_post_run(im, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac, logical, intent(in) :: cal_pre, lssav, ldiag3d, qdiag3d, cplflx, cplchm real(kind=kind_phys), intent(in) :: dtf, frain, con_g - real(kind=kind_phys), dimension(im), intent(in) :: rain1, xlat, xlon, tsfc - real(kind=kind_phys), dimension(im), intent(inout) :: ice, snow, graupel, rainc - real(kind=kind_phys), dimension(im), intent(in) :: rain0, ice0, snow0, graupel0 - real(kind=kind_phys), dimension(im,nrcm), intent(in) :: rann - real(kind=kind_phys), dimension(im,levs), intent(in) :: gt0, prsl, save_t, save_qv, del - real(kind=kind_phys), dimension(im,levs+1), intent(in) :: prsi, phii - real(kind=kind_phys), dimension(im,levs,ntrac), intent(in) :: gq0 - - real(kind=kind_phys), dimension(im), intent(in ) :: sr - real(kind=kind_phys), dimension(im), intent(inout) :: rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, & + real(kind=kind_phys), dimension(:), intent(in) :: rain1, xlat, xlon, tsfc + real(kind=kind_phys), dimension(:), intent(inout) :: ice, snow, graupel, rainc + real(kind=kind_phys), dimension(:), intent(in) :: rain0, ice0, snow0, graupel0 + real(kind=kind_phys), dimension(:,:), intent(in) :: rann + real(kind=kind_phys), dimension(:,:), intent(in) :: gt0, prsl, save_t, save_qv, del + real(kind=kind_phys), dimension(:,:), intent(in) :: prsi, phii + real(kind=kind_phys), dimension(:,:,:), intent(in) :: gq0 + + real(kind=kind_phys), dimension(:), intent(in ) :: sr + real(kind=kind_phys), dimension(:), intent(inout) :: rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, & srflag, cnvprcp, totprcp, totice, totsnw, totgrp, cnvprcpb, & totprcpb, toticeb, totsnwb, totgrpb, rain_cpl, rainc_cpl, & snow_cpl, pwat @@ -128,23 +128,23 @@ subroutine GFS_MP_generic_post_run(im, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac, ! Stochastic physics / surface perturbations logical, intent(in) :: do_sppt, ca_global - real(kind=kind_phys), dimension(im,levs), intent(inout) :: dtdtr - real(kind=kind_phys), dimension(im,levs), intent(in) :: dtdtc - real(kind=kind_phys), dimension(im), intent(inout) :: drain_cpl - real(kind=kind_phys), dimension(im), intent(inout) :: dsnow_cpl + real(kind=kind_phys), dimension(:,:), intent(inout) :: dtdtr + real(kind=kind_phys), dimension(:,:), intent(in) :: dtdtc + real(kind=kind_phys), dimension(:), intent(inout) :: drain_cpl + real(kind=kind_phys), dimension(:), intent(inout) :: dsnow_cpl ! Rainfall variables previous time step integer, intent(in) :: lsm, lsm_ruc, lsm_noahmp - real(kind=kind_phys), dimension(im), intent(inout) :: raincprv - real(kind=kind_phys), dimension(im), intent(inout) :: rainncprv - real(kind=kind_phys), dimension(im), intent(inout) :: iceprv - real(kind=kind_phys), dimension(im), intent(inout) :: snowprv - real(kind=kind_phys), dimension(im), intent(inout) :: graupelprv - real(kind=kind_phys), dimension(im), intent(inout) :: draincprv - real(kind=kind_phys), dimension(im), intent(inout) :: drainncprv - real(kind=kind_phys), dimension(im), intent(inout) :: diceprv - real(kind=kind_phys), dimension(im), intent(inout) :: dsnowprv - real(kind=kind_phys), dimension(im), intent(inout) :: dgraupelprv + real(kind=kind_phys), dimension(:), intent(inout) :: raincprv + real(kind=kind_phys), dimension(:), intent(inout) :: rainncprv + real(kind=kind_phys), dimension(:), intent(inout) :: iceprv + real(kind=kind_phys), dimension(:), intent(inout) :: snowprv + real(kind=kind_phys), dimension(:), intent(inout) :: graupelprv + real(kind=kind_phys), dimension(:), intent(inout) :: draincprv + real(kind=kind_phys), dimension(:), intent(inout) :: drainncprv + real(kind=kind_phys), dimension(:), intent(inout) :: diceprv + real(kind=kind_phys), dimension(:), intent(inout) :: dsnowprv + real(kind=kind_phys), dimension(:), intent(inout) :: dgraupelprv real(kind=kind_phys), intent(in) :: dtp diff --git a/physics/GFS_PBL_generic.F90 b/physics/GFS_PBL_generic.F90 index 357309b2a1..95f626566b 100644 --- a/physics/GFS_PBL_generic.F90 +++ b/physics/GFS_PBL_generic.F90 @@ -101,11 +101,11 @@ subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac, integer, intent(in) :: imp_physics_zhao_carr, imp_physics_mg, imp_physics_fer_hires logical, intent(in) :: cplchm, ltaerosol, hybedmf, do_shoc, satmedmf - real(kind=kind_phys), dimension(im, levs, ntrac), intent(in) :: qgrs - real(kind=kind_phys), dimension(im, levs), intent(in) :: ugrs, vgrs, tgrs - real(kind=kind_phys), dimension(im, levs, nvdiff), intent(inout) :: vdftra - real(kind=kind_phys), dimension(im, levs), intent(out) :: save_u, save_v, save_t - real(kind=kind_phys), dimension(im, levs, ntrac), intent(out) :: save_q + real(kind=kind_phys), dimension(:,:,:), intent(in) :: qgrs + real(kind=kind_phys), dimension(:,:), intent(in) :: ugrs, vgrs, tgrs + real(kind=kind_phys), dimension(:,:, :), intent(inout) :: vdftra + real(kind=kind_phys), dimension(:,:), intent(out) :: save_u, save_v, save_t + real(kind=kind_phys), dimension(:,:, :), intent(out) :: save_q ! CCPP error handling variables character(len=*), intent(out) :: errmsg @@ -336,8 +336,8 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, logical, dimension(:), intent(in) :: flag_cice logical, intent(in) :: flag_for_pbl_generic_tend - real(kind=kind_phys), dimension(im, levs), intent(in) :: save_u, save_v, save_t - real(kind=kind_phys), dimension(im, levs, ntrac), intent(in) :: save_q + real(kind=kind_phys), dimension(:,:), intent(in) :: save_u, save_v, save_t + real(kind=kind_phys), dimension(:,:, :), intent(in) :: save_q real(kind=kind_phys), intent(in) :: dtf real(kind=kind_phys), intent(in) :: rd, cp, fvirt, hvap @@ -346,14 +346,14 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, real(kind=kind_phys), dimension(:), intent(in) :: dusfc_cice, dvsfc_cice, dtsfc_cice, dqsfc_cice, & wind, stress_wat, hflx_wat, evap_wat, ugrs1, vgrs1 - real(kind=kind_phys), dimension(im, levs, ntrac), intent(in) :: qgrs - real(kind=kind_phys), dimension(im, levs), intent(in) :: ugrs, vgrs, tgrs + real(kind=kind_phys), dimension(:,:, :), intent(in) :: qgrs + real(kind=kind_phys), dimension(:,:), intent(in) :: ugrs, vgrs, tgrs - real(kind=kind_phys), dimension(im, levs, nvdiff), intent(in) :: dvdftra - real(kind=kind_phys), dimension(im), intent(in) :: dusfc1, dvsfc1, dtsfc1, dqsfc1, xmu - real(kind=kind_phys), dimension(im, levs), intent(in) :: dudt, dvdt, dtdt, htrsw, htrlw + real(kind=kind_phys), dimension(:,:, :), intent(in) :: dvdftra + real(kind=kind_phys), dimension(:), intent(in) :: dusfc1, dvsfc1, dtsfc1, dqsfc1, xmu + real(kind=kind_phys), dimension(:,:), intent(in) :: dudt, dvdt, dtdt, htrsw, htrlw - real(kind=kind_phys), dimension(im, levs, ntrac), intent(inout) :: dqdt + real(kind=kind_phys), dimension(:,:, :), intent(inout) :: dqdt ! The following arrays may not be allocated, depending on certain flags (cplflx, ...). ! Since Intel 15 crashes when passing unallocated arrays to arrays defined with explicit shape, @@ -370,7 +370,7 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, real(kind=kind_phys), dimension(:,:), intent(in) :: dkt ! From canopy heat storage - reduction factors in latent/sensible heat flux due to surface roughness - real(kind=kind_phys), dimension(im), intent(in) :: hffac, hefac + real(kind=kind_phys), dimension(:), intent(in) :: hffac, hefac character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/GFS_SCNV_generic.F90 b/physics/GFS_SCNV_generic.F90 index ae8fac5f9f..450f0e5a9f 100644 --- a/physics/GFS_SCNV_generic.F90 +++ b/physics/GFS_SCNV_generic.F90 @@ -23,9 +23,9 @@ subroutine GFS_SCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, gu0, gv0, gt0, integer, intent(in) :: im, levs logical, intent(in) :: ldiag3d, qdiag3d, flag_for_scnv_generic_tend - real(kind=kind_phys), dimension(im,levs), intent(in) :: gu0, gv0, gt0, gq0_water_vapor + real(kind=kind_phys), dimension(:, :), intent(in) :: gu0, gv0, gt0, gq0_water_vapor - real(kind=kind_phys), dimension(im,levs), intent(inout) :: save_u, save_v, save_t, save_qv + real(kind=kind_phys), dimension(:, :), intent(inout) :: save_u, save_v, save_t, save_qv character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -84,20 +84,20 @@ subroutine GFS_SCNV_generic_post_run (im, levs, nn, lssav, ldiag3d, qdiag3d, cpl integer, intent(in) :: im, levs, nn logical, intent(in) :: lssav, ldiag3d, qdiag3d, cplchm, flag_for_scnv_generic_tend real(kind=kind_phys), intent(in) :: frain - real(kind=kind_phys), dimension(im,levs), intent(in) :: gu0, gv0, gt0, gq0_water_vapor - real(kind=kind_phys), dimension(im,levs), intent(in) :: save_u, save_v, save_t, save_qv + real(kind=kind_phys), dimension(:, :), intent(in) :: gu0, gv0, gt0, gq0_water_vapor + real(kind=kind_phys), dimension(:, :), intent(in) :: save_u, save_v, save_t, save_qv ! dqdti, dt3dt, dq3dt, only allocated if ldiag3d == .true. real(kind=kind_phys), dimension(:,:), intent(inout) :: dqdti real(kind=kind_phys), dimension(:,:), intent(inout) :: du3dt, dv3dt, dt3dt, dq3dt - real(kind=kind_phys), dimension(im,levs,nn), intent(inout) :: clw + real(kind=kind_phys), dimension(:, :,:), intent(inout) :: clw ! Post code for SAS/SAMF integer, intent(in) :: npdf3d, num_p3d, ncnvcld3d logical, intent(in) :: shcnvcw - real(kind=kind_phys), dimension(im), intent(in) :: rain1 - real(kind=kind_phys), dimension(im,levs), intent(in) :: cnvw, cnvc - real(kind=kind_phys), dimension(im), intent(inout) :: rainc, cnvprcp, cnvprcpb + real(kind=kind_phys), dimension(:), intent(in) :: rain1 + real(kind=kind_phys), dimension(:, :), intent(in) :: cnvw, cnvc + real(kind=kind_phys), dimension(:), intent(inout) :: rainc, cnvprcp, cnvprcpb ! The following arrays may not be allocated, depending on certain flags and microphysics schemes. ! Since Intel 15 crashes when passing unallocated arrays to arrays defined with explicit shape, ! use assumed-shape arrays. Note that Intel 18 and GNU 6.2.0-8.1.0 tolerate explicit-shape arrays diff --git a/physics/GFS_cloud_diagnostics.F90 b/physics/GFS_cloud_diagnostics.F90 index c62cc685d9..f5d09cd563 100644 --- a/physics/GFS_cloud_diagnostics.F90 +++ b/physics/GFS_cloud_diagnostics.F90 @@ -53,15 +53,15 @@ subroutine GFS_cloud_diagnostics_run(nCol, nLev, lsswr, lslwr, lat, de_lgth, p_l lslwr ! Call LW radiation real(kind_phys), intent(in) :: & con_pi ! Physical constant: pi - real(kind_phys), dimension(nCol), intent(in) :: & + real(kind_phys), dimension(:), intent(in) :: & lat, & ! Latitude de_lgth ! Decorrelation length - real(kind_phys), dimension(nCol,nLev), intent(in) :: & + real(kind_phys), dimension(:,:), intent(in) :: & p_lay, & ! Pressure at model-layer cld_frac ! Total cloud fraction - real(kind_phys), dimension(nCol,nLev+1), intent(in) :: & + real(kind_phys), dimension(:,:), intent(in) :: & p_lev ! Pressure at model interfaces - real(kind_phys), dimension(nCol,nLev), intent(in) :: & + real(kind_phys), dimension(:,:), intent(in) :: & deltaZ, & ! Layer thickness (km) cloud_overlap_param, & ! Cloud-overlap parameter precip_overlap_param ! Precipitation overlap parameter @@ -71,10 +71,10 @@ subroutine GFS_cloud_diagnostics_run(nCol, nLev, lsswr, lslwr, lat, de_lgth, p_l errmsg ! Error message integer, intent(out) :: & errflg ! Error flag - integer,dimension(ncol,3),intent(out) :: & + integer,dimension(:,:),intent(out) :: & mbota, & ! Vertical indices for cloud tops mtopa ! Vertical indices for cloud bases - real(kind_phys), dimension(ncol,5), intent(out) :: & + real(kind_phys), dimension(:,:), intent(out) :: & cldsa ! Fraction of clouds for low, middle, high, total and BL ! Local variables @@ -136,7 +136,7 @@ subroutine hml_cloud_diagnostics_initialize(imp_physics, imp_physics_fer_hires, integer, intent(in) :: & nLev, & ! Number of vertical-layers mpi_rank - real(kind_phys), dimension(nLev+1), intent(in) :: & + real(kind_phys), dimension(:), intent(in) :: & sigmainit ! Outputs integer, intent(out) :: & diff --git a/physics/GFS_debug.F90 b/physics/GFS_debug.F90 index 0562324eed..3c358a25f1 100644 --- a/physics/GFS_debug.F90 +++ b/physics/GFS_debug.F90 @@ -970,29 +970,29 @@ subroutine GFS_checkland_run (me, master, blkno, im, kdt, iter, flag_iter, flag_ integer, intent(in ) :: im integer, intent(in ) :: kdt integer, intent(in ) :: iter - logical, intent(in ) :: flag_iter(im) - logical, intent(in ) :: flag_guess(im) + logical, intent(in ) :: flag_iter(:) + logical, intent(in ) :: flag_guess(:) logical, intent(in ) :: flag_init logical, intent(in ) :: flag_restart logical, intent(in ) :: frac_grid integer, intent(in ) :: isot integer, intent(in ) :: ivegsrc - real(kind_phys), intent(in ) :: stype(im) - real(kind_phys), intent(in ) :: vtype(im) - real(kind_phys), intent(in ) :: slope(im) - integer, intent(in ) :: soiltyp(im) - integer, intent(in ) :: vegtype(im) - integer, intent(in ) :: slopetyp(im) - logical, intent(in ) :: dry(im) - logical, intent(in ) :: icy(im) - logical, intent(in ) :: wet(im) - logical, intent(in ) :: lake(im) - logical, intent(in ) :: ocean(im) - real(kind_phys), intent(in ) :: oceanfrac(im) - real(kind_phys), intent(in ) :: landfrac(im) - real(kind_phys), intent(in ) :: lakefrac(im) - real(kind_phys), intent(in ) :: slmsk(im) - integer, intent(in ) :: islmsk(im) + real(kind_phys), intent(in ) :: stype(:) + real(kind_phys), intent(in ) :: vtype(:) + real(kind_phys), intent(in ) :: slope(:) + integer, intent(in ) :: soiltyp(:) + integer, intent(in ) :: vegtype(:) + integer, intent(in ) :: slopetyp(:) + logical, intent(in ) :: dry(:) + logical, intent(in ) :: icy(:) + logical, intent(in ) :: wet(:) + logical, intent(in ) :: lake(:) + logical, intent(in ) :: ocean(:) + real(kind_phys), intent(in ) :: oceanfrac(:) + real(kind_phys), intent(in ) :: landfrac(:) + real(kind_phys), intent(in ) :: lakefrac(:) + real(kind_phys), intent(in ) :: slmsk(:) + integer, intent(in ) :: islmsk(:) character(len=*), intent( out) :: errmsg integer, intent( out) :: errflg diff --git a/physics/GFS_rrtmg_post.F90 b/physics/GFS_rrtmg_post.F90 index 7f80ca4c30..82cc4c87a3 100644 --- a/physics/GFS_rrtmg_post.F90 +++ b/physics/GFS_rrtmg_post.F90 @@ -39,17 +39,17 @@ subroutine GFS_rrtmg_post_run (Model, Grid, Diag, Radtend, Statein, & type(GFS_coupling_type), intent(inout) :: Coupling type(GFS_radtend_type), intent(in) :: Radtend type(GFS_diag_type), intent(inout) :: Diag - type(cmpfsw_type), dimension(size(Grid%xlon,1)), intent(in) :: scmpsw + type(cmpfsw_type), dimension(:), intent(in) :: scmpsw integer, intent(in) :: im, lm, ltp, kt, kb, kd, nday real(kind=kind_phys), intent(in) :: raddt - real(kind=kind_phys), dimension(size(Grid%xlon,1),NSPC1), intent(in) :: aerodp - real(kind=kind_phys), dimension(size(Grid%xlon,1),5), intent(in) :: cldsa - integer, dimension(size(Grid%xlon,1),3), intent(in) :: mbota, mtopa - real(kind=kind_phys), dimension(size(Grid%xlon,1),lm+LTP), intent(in) :: clouds1 - real(kind=kind_phys), dimension(size(Grid%xlon,1),lm+LTP), intent(in) :: cldtausw - real(kind=kind_phys), dimension(size(Grid%xlon,1),lm+LTP), intent(in) :: cldtaulw + real(kind=kind_phys), dimension(:,:), intent(in) :: aerodp + real(kind=kind_phys), dimension(:,:), intent(in) :: cldsa + integer, dimension(:,:), intent(in) :: mbota, mtopa + real(kind=kind_phys), dimension(:,:), intent(in) :: clouds1 + real(kind=kind_phys), dimension(:,:), intent(in) :: cldtausw + real(kind=kind_phys), dimension(:,:), intent(in) :: cldtaulw character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/GFS_rrtmg_pre.F90 b/physics/GFS_rrtmg_pre.F90 index ca76955285..514ea87452 100644 --- a/physics/GFS_rrtmg_pre.F90 +++ b/physics/GFS_rrtmg_pre.F90 @@ -95,39 +95,39 @@ subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input integer, intent(out) :: kd, kt, kb ! F-A mp scheme only - real(kind=kind_phys), dimension(size(Grid%xlon,1),lm+LTP), intent(in) :: f_ice, & + real(kind=kind_phys), dimension(:, :), intent(in) :: f_ice, & f_rain, f_rimef - real(kind=kind_phys), dimension(size(Grid%xlon,1),lm+LTP), intent(out) :: cwm - real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(in) :: flgmin + real(kind=kind_phys), dimension(:, :), intent(out) :: cwm + real(kind=kind_phys), dimension(:), intent(in) :: flgmin real(kind=kind_phys), intent(out) :: raddt - real(kind=kind_phys), dimension(size(Grid%xlon,1),lm+LTP), intent(out) :: delp, & + real(kind=kind_phys), dimension(:, :), intent(out) :: delp, & dz, plyr, tlyr, qlyr, olyr - real(kind=kind_phys), dimension(size(Grid%xlon,1),lm+1+LTP), intent(out) :: plvl, tlvl + real(kind=kind_phys), dimension(:, :), intent(out) :: plvl, tlvl - real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(out) :: tsfg, tsfa + real(kind=kind_phys), dimension(:), intent(out) :: tsfg, tsfa - real(kind=kind_phys), dimension(size(Grid%xlon,1),lm+LTP), intent(out) :: gasvmr_co2, & + real(kind=kind_phys), dimension(:, :), intent(out) :: gasvmr_co2, & gasvmr_n2o, gasvmr_ch4, gasvmr_o2, gasvmr_co, gasvmr_cfc11, & gasvmr_cfc12, gasvmr_cfc22, gasvmr_ccl4, gasvmr_cfc113 - real(kind=kind_phys), dimension(size(Grid%xlon,1),lm+LTP,NBDSW), intent(out) :: faersw1, & + real(kind=kind_phys), dimension(:,:,:), intent(out) :: faersw1, & faersw2, faersw3 - real(kind=kind_phys), dimension(size(Grid%xlon,1),lm+LTP,NBDLW), intent(out) :: faerlw1, & + real(kind=kind_phys), dimension(:,:,:), intent(out) :: faerlw1, & faerlw2, faerlw3 - real(kind=kind_phys), dimension(size(Grid%xlon,1),NSPC1), intent(out) :: aerodp + real(kind=kind_phys), dimension(:,:), intent(out) :: aerodp - real(kind=kind_phys), dimension(size(Grid%xlon,1),lm+LTP), intent(inout) :: clouds1, & + real(kind=kind_phys), dimension(:,:), intent(inout) :: clouds1, & clouds2, clouds3, clouds4, clouds5 - real(kind=kind_phys), dimension(size(Grid%xlon,1),lm+LTP), intent(out) :: clouds6, & + real(kind=kind_phys), dimension(:,:), intent(out) :: clouds6, & clouds7, clouds8, clouds9 - real(kind=kind_phys), dimension(size(Grid%xlon,1),5), intent(out) :: cldsa - integer, dimension(size(Grid%xlon,1),3), intent(out) :: mbota, mtopa - real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(out) :: de_lgth, alb1d + real(kind=kind_phys), dimension(:,:), intent(out) :: cldsa + integer, dimension(:,:), intent(out) :: mbota, mtopa + real(kind=kind_phys), dimension(:), intent(out) :: de_lgth, alb1d character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/GFS_rrtmgp_gfdlmp_pre.F90 b/physics/GFS_rrtmgp_gfdlmp_pre.F90 index b67b22d41d..a11f03c3b0 100644 --- a/physics/GFS_rrtmgp_gfdlmp_pre.F90 +++ b/physics/GFS_rrtmgp_gfdlmp_pre.F90 @@ -62,24 +62,24 @@ subroutine GFS_rrtmgp_gfdlmp_pre_run(nCol, nLev, nTracers, ncnd, i_cldliq, i_cld con_g, & ! Physical constant: gravitational constant con_rd, & ! Physical constant: gas-constant for dry air con_epsq ! Physical constant(?): Minimum value for specific humidity - real(kind_phys), dimension(nCol), intent(in) :: & + real(kind_phys), dimension(:), intent(in) :: & lat ! Latitude - real(kind_phys), dimension(nCol,nLev), intent(in) :: & + real(kind_phys), dimension(:, :), intent(in) :: & tv_lay, & ! Virtual temperature (K) p_lay, & ! Pressure at model-layers (Pa) effrin_cldliq, & ! Effective radius for liquid cloud-particles (microns) effrin_cldice, & ! Effective radius for ice cloud-particles (microns) effrin_cldrain, & ! Effective radius for rain cloud-particles (microns) effrin_cldsnow ! Effective radius for snow cloud-particles (microns) - real(kind_phys), dimension(nCol,nLev+1), intent(in) :: & + real(kind_phys), dimension(:, :), intent(in) :: & p_lev ! Pressure at model-level interfaces (Pa) - real(kind_phys), dimension(nCol, nLev, nTracers),intent(in) :: & + real(kind_phys), dimension(:, :, :),intent(in) :: & tracer ! Cloud condensate amount in layer by type () ! Outputs - real(kind_phys), dimension(nCol),intent(out) :: & + real(kind_phys), dimension(:),intent(out) :: & de_lgth ! Decorrelation length - real(kind_phys), dimension(nCol,nLev),intent(out) :: & + real(kind_phys), dimension(:, :),intent(out) :: & cld_frac, & ! Total cloud fraction cld_lwp, & ! Cloud liquid water path cld_reliq, & ! Cloud liquid effective radius diff --git a/physics/GFS_rrtmgp_lw_post.F90 b/physics/GFS_rrtmgp_lw_post.F90 index a6b37acfce..b508996bee 100644 --- a/physics/GFS_rrtmgp_lw_post.F90 +++ b/physics/GFS_rrtmgp_lw_post.F90 @@ -39,11 +39,11 @@ subroutine GFS_rrtmgp_lw_post_run (nCol, nLev, lslwr, do_lw_clrsky_hr, save_diag save_diag ! Output radiation diagnostics? real(kind_phys), intent(in) :: & fhlwr ! Frequency for SW radiation - real(kind_phys), dimension(nCol), intent(in) :: & + real(kind_phys), dimension(:), intent(in) :: & tsfa ! Lowest model layer air temperature for radiation (K) - real(kind_phys), dimension(nCol, nLev), intent(in) :: & + real(kind_phys), dimension(:, :), intent(in) :: & t_lay ! Temperature @ model layer centers (K) - real(kind_phys), dimension(nCol, nLev+1), intent(in) :: & + real(kind_phys), dimension(:, :), intent(in) :: & p_lev, & ! Pressure @ model layer-interfaces (Pa) fluxlwUP_allsky, & ! RRTMGP longwave all-sky flux (W/m2) fluxlwDOWN_allsky, & ! RRTMGP longwave all-sky flux (W/m2) @@ -51,26 +51,26 @@ subroutine GFS_rrtmgp_lw_post_run (nCol, nLev, lslwr, do_lw_clrsky_hr, save_diag fluxlwDOWN_clrsky ! RRTMGP longwave clear-sky flux (W/m2) real(kind_phys), intent(in) :: & raddt ! Radiation time step - real(kind_phys), dimension(nCol,NSPC1), intent(in) :: & + real(kind_phys), dimension(:, :), intent(in) :: & aerodp ! Vertical integrated optical depth for various aerosol species - real(kind_phys), dimension(nCol,5), intent(in) :: & + real(kind_phys), dimension(:, :), intent(in) :: & cldsa ! Fraction of clouds for low, middle, high, total and BL - integer, dimension(nCol,3), intent(in) ::& + integer, dimension(:, :), intent(in) ::& mbota, & ! vertical indices for low, middle and high cloud tops mtopa ! vertical indices for low, middle and high cloud bases - real(kind_phys), dimension(nCol,nLev), intent(in) :: & + real(kind_phys), dimension(:, :), intent(in) :: & cld_frac, & ! Total cloud fraction in each layer cldtaulw ! approx 10.mu band layer cloud optical depth ! Outputs (mandatory) - real(kind_phys), dimension(nCol), intent(out) :: & + real(kind_phys), dimension(:), intent(out) :: & sfcdlw, & ! Total sky sfc downward lw flux (W/m2) tsflw ! surface air temp during lw calculation (K) - type(sfcflw_type), dimension(nCol), intent(out) :: & + type(sfcflw_type), dimension(:), intent(out) :: & sfcflw ! LW radiation fluxes at sfc - real(kind_phys), dimension(nCol,nLev), intent(out) :: & + real(kind_phys), dimension(:, :), intent(out) :: & htrlw ! LW all-sky heating rate - type(topflw_type), dimension(nCol), intent(out) :: & + type(topflw_type), dimension(:), intent(out) :: & topflw ! lw_fluxes_top_atmosphere character(len=*), intent(out) :: & errmsg @@ -78,13 +78,13 @@ subroutine GFS_rrtmgp_lw_post_run (nCol, nLev, lslwr, do_lw_clrsky_hr, save_diag errflg ! Outputs (optional) - type(proflw_type), dimension(nCol, nLev+1), optional, intent(out) :: & + type(proflw_type), dimension(:, :), optional, intent(out) :: & flxprf_lw ! 2D radiative fluxes, components: ! upfxc - total sky upward flux (W/m2) ! dnfxc - total sky dnward flux (W/m2) ! upfx0 - clear sky upward flux (W/m2) ! dnfx0 - clear sky dnward flux (W/m2) - real(kind_phys),dimension(nCol, nLev),intent(out),optional :: & + real(kind_phys),dimension(:, :),intent(out),optional :: & htrlwc ! Longwave clear-sky heating-rate (K/sec) ! Local variables diff --git a/physics/GFS_rrtmgp_pre.F90 b/physics/GFS_rrtmgp_pre.F90 index 0e5d65f5ca..7d66339089 100644 --- a/physics/GFS_rrtmgp_pre.F90 +++ b/physics/GFS_rrtmgp_pre.F90 @@ -52,7 +52,7 @@ subroutine GFS_rrtmgp_pre_init(nGases, active_gases, active_gases_array, errmsg, character(len=*), intent(in) :: & active_gases ! List of active gases from namelist. ! Outputs - character(len=*),dimension(nGases), intent(out) :: & + character(len=*),dimension(:), intent(out) :: & active_gases_array ! Character array containing trace gases to include in RRTMGP character(len=*), intent(out) :: & errmsg ! Error message @@ -159,7 +159,7 @@ subroutine GFS_rrtmgp_pre_run(nCol, nLev, nGases, nTracers, i_o3, lsswr, lslwr, logical, intent(in) :: & lsswr, & ! Call SW radiation? lslwr ! Call LW radiation - character(len=*),dimension(nGases), intent(in) :: & + character(len=*),dimension(:), intent(in) :: & active_gases_array ! Character array containing trace gases to include in RRTMGP real(kind_phys), intent(in) :: & fhswr, & ! Frequency of SW radiation call. @@ -169,11 +169,11 @@ subroutine GFS_rrtmgp_pre_run(nCol, nLev, nGases, nTracers, i_o3, lsswr, lslwr, con_epsm1, & ! Physical constant: Epsilon (Rd/Rv) minus one con_fvirt, & ! Physical constant: Inverse of epsilon minus one con_epsqs ! Physical constant: Minimum saturation mixing-ratio (kg/kg) - real(kind_phys), dimension(nCol), intent(in) :: & + real(kind_phys), dimension(:), intent(in) :: & xlon, & ! Longitude xlat, & ! Latitude tsfc ! Surface skin temperature (K) - real(kind_phys), dimension(nCol,nLev), intent(in) :: & + real(kind_phys), dimension(:, :), intent(in) :: & prsl, & ! Pressure at model-layer centers (Pa) tgrs, & ! Temperature at model-layer centers (K) prslk ! Exner function at model layer centers (1) @@ -189,18 +189,18 @@ subroutine GFS_rrtmgp_pre_run(nCol, nLev, nGases, nTracers, i_o3, lsswr, lslwr, errflg ! Error flag real(kind_phys), intent(out) :: & raddt ! Radiation time-step - real(kind_phys), dimension(ncol), intent(out) :: & + real(kind_phys), dimension(:), intent(out) :: & tsfg, & ! Ground temperature tsfa ! Skin temperature - real(kind_phys), dimension(nCol,nLev), intent(out) :: & + real(kind_phys), dimension(:, :), intent(out) :: & p_lay, & ! Pressure at model-layer t_lay, & ! Temperature at model layer tv_lay, & ! Virtual temperature at model-layers relhum ! Relative-humidity at model-layers - real(kind_phys), dimension(nCol,nLev+1), intent(out) :: & + real(kind_phys), dimension(:, :), intent(out) :: & p_lev, & ! Pressure at model-interface t_lev ! Temperature at model-interface - real(kind_phys), dimension(nCol, nLev, nTracers),intent(out) :: & + real(kind_phys), dimension(:, :,:),intent(out) :: & tracer ! Array containing trace gases type(ty_gas_concs),intent(out) :: & gas_concentrations ! RRTMGP DDT: gas volumne mixing ratios diff --git a/physics/GFS_rrtmgp_setup.F90 b/physics/GFS_rrtmgp_setup.F90 index 9b503e3bc7..acc3024055 100644 --- a/physics/GFS_rrtmgp_setup.F90 +++ b/physics/GFS_rrtmgp_setup.F90 @@ -54,14 +54,14 @@ subroutine GFS_rrtmgp_setup_init(imp_physics, imp_physics_fer_hires, imp_physics imp_physics_zhao_carr, & ! Flag for zhao-carr scheme imp_physics_zhao_carr_pdf, & ! Flag for zhao-carr+PDF scheme imp_physics_mg ! Flag for MG scheme - real(kind_phys), dimension(levr+1), intent(in) :: & + real(kind_phys), dimension(:), intent(in) :: & si integer, intent(in) :: levr, ictm, isol, ico2, iaer, ialb, iems, & ntcw, num_p3d, ntoz, iovr_sw, iovr_lw, isubc_sw, isubc_lw, & icliq_sw, iflip, me logical, intent(in) :: & crick_proof, ccnorm, norad_precip - integer, intent(in), dimension(4) :: & + integer, intent(in), dimension(:) :: & idate ! Outputs character(len=*), intent(out) :: errmsg diff --git a/physics/GFS_rrtmgp_sw_post.F90 b/physics/GFS_rrtmgp_sw_post.F90 index 0d3991fcf6..8fdf3fa650 100644 --- a/physics/GFS_rrtmgp_sw_post.F90 +++ b/physics/GFS_rrtmgp_sw_post.F90 @@ -37,7 +37,7 @@ subroutine GFS_rrtmgp_sw_post_run (nCol, nLev, nDay, idxday, lsswr, do_sw_clrsky nCol, & ! Horizontal loop extent nLev, & ! Number of vertical layers nDay ! Number of daylit columns - integer, intent(in), dimension(nday) :: & + integer, intent(in), dimension(:) :: & idxday ! Index array for daytime points logical, intent(in) :: & lsswr, & ! Call SW radiation? @@ -47,37 +47,37 @@ subroutine GFS_rrtmgp_sw_post_run (nCol, nLev, nDay, idxday, lsswr, do_sw_clrsky sw_gas_props ! DDT containing SW spectral information real(kind_phys), intent(in) :: & fhswr ! Frequency for SW radiation - real(kind_phys), dimension(nCol), intent(in) :: & + real(kind_phys), dimension(ncol), intent(in) :: & t_lay, & ! Temperature at model layer centers (K) coszen, & ! Cosine(SZA) coszdg ! Cosine(SZA), daytime - real(kind_phys), dimension(nCol, nLev+1), intent(in) :: & + real(kind_phys), dimension(:, :), intent(in) :: & p_lev ! Pressure @ model layer-interfaces (Pa) - real(kind_phys), dimension(sw_gas_props%get_nband(),ncol), intent(in) :: & + real(kind_phys), dimension(:, :), intent(in) :: & sfc_alb_nir_dir, & ! Surface albedo (direct) sfc_alb_nir_dif, & ! Surface albedo (diffuse) sfc_alb_uvvis_dir, & ! Surface albedo (direct) sfc_alb_uvvis_dif ! Surface albedo (diffuse) - real(kind_phys), dimension(nCol, nLev+1), intent(in) :: & + real(kind_phys), dimension(:, :), intent(in) :: & fluxswUP_allsky, & ! SW All-sky flux (W/m2) fluxswDOWN_allsky, & ! SW All-sky flux (W/m2) fluxswUP_clrsky, & ! SW Clear-sky flux (W/m2) fluxswDOWN_clrsky ! SW All-sky flux (W/m2) real(kind_phys), intent(in) :: & raddt ! Radiation time step - real(kind_phys), dimension(nCol,NSPC1), intent(in) :: & + real(kind_phys), dimension(:, :), intent(in) :: & aerodp ! Vertical integrated optical depth for various aerosol species - real(kind_phys), dimension(nCol,5), intent(in) :: & + real(kind_phys), dimension(:, :), intent(in) :: & cldsa ! Fraction of clouds for low, middle, high, total and BL - integer, dimension(nCol,3), intent(in) ::& + integer, dimension(:, :), intent(in) ::& mbota, & ! vertical indices for low, middle and high cloud tops mtopa ! vertical indices for low, middle and high cloud bases - real(kind_phys), dimension(nCol,nLev), intent(in) :: & + real(kind_phys), dimension(:, :), intent(in) :: & cld_frac, & ! Total cloud fraction in each layer cldtausw ! approx .55mu band layer cloud optical depth ! Inputs (optional) - type(cmpfsw_type), dimension(nCol), intent(in), optional :: & + type(cmpfsw_type), dimension(:), intent(in), optional :: & scmpsw ! 2D surface fluxes, components: ! uvbfc - total sky downward uv-b flux at (W/m2) ! uvbf0 - clear sky downward uv-b flux at (W/m2) @@ -87,7 +87,7 @@ subroutine GFS_rrtmgp_sw_post_run (nCol, nLev, nDay, idxday, lsswr, do_sw_clrsky ! visdf - downward uv+vis diffused flux (W/m2) ! Outputs (mandatory) - real(kind_phys), dimension(nCol), intent(out) :: & + real(kind_phys), dimension(:), intent(out) :: & nirbmdi, & ! sfc nir beam sw downward flux (W/m2) nirdfdi, & ! sfc nir diff sw downward flux (W/m2) visbmdi, & ! sfc uv+vis beam sw downward flux (W/m2) @@ -98,11 +98,11 @@ subroutine GFS_rrtmgp_sw_post_run (nCol, nLev, nDay, idxday, lsswr, do_sw_clrsky visdfui, & ! sfc uv+vis diff sw upward flux (W/m2) sfcnsw, & ! total sky sfc netsw flx into ground sfcdsw ! - real(kind_phys), dimension(nCol,nLev), intent(out) :: & + real(kind_phys), dimension(:, :), intent(out) :: & htrsw ! SW all-sky heating rate - type(sfcfsw_type), dimension(nCol), intent(out) :: & + type(sfcfsw_type), dimension(:), intent(out) :: & sfcfsw ! sw radiation fluxes at sfc - type(topfsw_type), dimension(nCol), intent(out) :: & + type(topfsw_type), dimension(:), intent(out) :: & topfsw ! sw_fluxes_top_atmosphere character(len=*), intent(out) :: & errmsg @@ -110,13 +110,13 @@ subroutine GFS_rrtmgp_sw_post_run (nCol, nLev, nDay, idxday, lsswr, do_sw_clrsky errflg ! Outputs (optional) - type(profsw_type), dimension(nCol, nLev), intent(out), optional :: & + type(profsw_type), dimension(:, :), intent(out), optional :: & flxprf_sw ! 2D radiative fluxes, components: ! upfxc - total sky upward flux (W/m2) ! dnfxc - total sky dnward flux (W/m2) ! upfx0 - clear sky upward flux (W/m2) ! dnfx0 - clear sky dnward flux (W/m2) - real(kind_phys),dimension(nCol, nLev),intent(out),optional :: & + real(kind_phys),dimension(:, :),intent(out),optional :: & htrswc ! Clear-sky heating rate (K/s) ! Local variables diff --git a/physics/GFS_rrtmgp_sw_pre.F90 b/physics/GFS_rrtmgp_sw_pre.F90 index c4208d872f..5c741a77e5 100644 --- a/physics/GFS_rrtmgp_sw_pre.F90 +++ b/physics/GFS_rrtmgp_sw_pre.F90 @@ -45,9 +45,9 @@ subroutine GFS_rrtmgp_sw_pre_run(me, nCol, nLev, nsfcpert, lsswr, do_sfcperts, s do_sfcperts real(kind_phys), intent(in) :: & solhr ! Time in hours after 00z at the current timestep - real(kind_phys), dimension(5), intent(in) :: & + real(kind_phys), dimension(:), intent(in) :: & pertalb ! Magnitude of surface albedo perturbation (frac) - real(kind_phys), dimension(nCol), intent(in) :: & + real(kind_phys), dimension(:), intent(in) :: & lsmask, & ! Landmask: sea/land/ice=0/1/2 lon, & ! Longitude coslat, & ! Cosine(latitude) @@ -66,13 +66,13 @@ subroutine GFS_rrtmgp_sw_pre_run(me, nCol, nLev, nsfcpert, lsswr, do_sfcperts, s facwf, & ! Fractional coverage with weak cosz dependency (frac) fice, & ! Ice fraction over open water (frac) tisfc ! Sea ice surface skin temperature (K) - real(kind_phys), dimension(nCol,nsfcpert), intent(in) :: & + real(kind_phys), dimension(:, :), intent(in) :: & sfc_wts ! Weights for stochastic surface physics perturbation () - real(kind_phys), dimension(nCol,nLev),intent(in) :: & + real(kind_phys), dimension(:, :),intent(in) :: & p_lay, & ! Layer pressure tv_lay, & ! Layer virtual-temperature relhum ! Layer relative-humidity - real(kind_phys), dimension(nCol,nLev+1),intent(in) :: & + real(kind_phys), dimension(:, :),intent(in) :: & p_lev ! Pressure @ layer interfaces (Pa) type(ty_gas_optics_rrtmgp),intent(in) :: & sw_gas_props ! RRTMGP DDT: spectral information for SW calculation @@ -80,14 +80,14 @@ subroutine GFS_rrtmgp_sw_pre_run(me, nCol, nLev, nsfcpert, lsswr, do_sfcperts, s ! Outputs integer, intent(out) :: & nday ! Number of daylit points - integer, dimension(ncol), intent(out) :: & + integer, dimension(:), intent(out) :: & idxday ! Indices for daylit points - real(kind_phys), dimension(ncol), intent(out) :: & + real(kind_phys), dimension(:), intent(out) :: & alb1d, & ! Surface albedo pertubation coszen, & ! Cosine of SZA coszdg, & ! Cosine of SZA, daytime sfc_alb_dif ! Mean surface diffused (nIR+uvvis) sw albedo - real(kind_phys), dimension(sw_gas_props%get_nband(),ncol), intent(out) :: & + real(kind_phys), dimension(:, :), intent(out) :: & sfc_alb_nir_dir, & ! Surface albedo (direct) sfc_alb_nir_dif, & ! Surface albedo (diffuse) sfc_alb_uvvis_dir, & ! Surface albedo (direct) diff --git a/physics/GFS_rrtmgp_zhaocarr_pre.F90 b/physics/GFS_rrtmgp_zhaocarr_pre.F90 index ac9fb74461..0be3be7117 100644 --- a/physics/GFS_rrtmgp_zhaocarr_pre.F90 +++ b/physics/GFS_rrtmgp_zhaocarr_pre.F90 @@ -59,10 +59,10 @@ subroutine GFS_rrtmgp_zhaocarr_pre_run(nCol, nLev, nCnd, nTracers, i_cldliq, lss con_ttp, & ! Triple point temperature of water (K) con_rd, & ! Ideal gas constant for dry air (J/kg/K) con_pi ! Pi - real(kind_phys), dimension(nCol), intent(in) :: & + real(kind_phys), dimension(:), intent(in) :: & lsmask, & ! Land/Sea mask lat ! Latitude - real(kind_phys), dimension(nCol,nLev), intent(in) :: & + real(kind_phys), dimension(:, :), intent(in) :: & tv_lay, & ! Virtual temperature (K) p_lay, & ! Pressure at model-layers (Pa) t_lay, & ! Temperature at model-layers (K) @@ -73,15 +73,15 @@ subroutine GFS_rrtmgp_zhaocarr_pre_run(nCol, nLev, nCnd, nTracers, i_cldliq, lss effrin_cldsnow, & ! Effective radius for snow cloud-particles (microns) shoc_sgs_cldfrac, & ! Subgrid-scale cloud fraction from the SHOC scheme cncvw ! Convective cloud water mixing ratio (kg/kg) - real(kind_phys), dimension(nCol,nLev+1), intent(in) :: & + real(kind_phys), dimension(:, :), intent(in) :: & p_lev ! Pressure at model-level interfaces (Pa) - real(kind_phys), dimension(nCol, nLev, nTracers),intent(in) :: & + real(kind_phys), dimension(:, :, :),intent(in) :: & tracer ! Cloud condensate amount in layer by type () ! Outputs - real(kind_phys), dimension(nCol),intent(out) :: & + real(kind_phys), dimension(:),intent(out) :: & de_lgth ! Decorrelation length - real(kind_phys), dimension(nCol,nLev),intent(out) :: & + real(kind_phys), dimension(:, :),intent(out) :: & cld_frac, & ! Total cloud fraction cld_lwp, & ! Cloud liquid water path cld_reliq, & ! Cloud liquid effective radius diff --git a/physics/GFS_stochastics.F90 b/physics/GFS_stochastics.F90 index 9b4533cf96..ce3060ccfa 100644 --- a/physics/GFS_stochastics.F90 +++ b/physics/GFS_stochastics.F90 @@ -50,7 +50,7 @@ subroutine GFS_stochastics_run (im, km, kdt, do_sppt, use_zmtnblck, do_shum, logical, intent(in) :: use_zmtnblck logical, intent(in) :: do_shum logical, intent(in) :: do_skeb - real(kind_phys), dimension(1:im), intent(in) :: zmtnblck + real(kind_phys), dimension(:), intent(in) :: zmtnblck ! sppt_wts only allocated if do_sppt == .true. real(kind_phys), dimension(:,:), intent(inout) :: sppt_wts ! skebu_wts, skebv_wts only allocated if do_skeb == .true. @@ -59,28 +59,28 @@ subroutine GFS_stochastics_run (im, km, kdt, do_sppt, use_zmtnblck, do_shum, ! shum_wts only allocated if do_shum == .true. real(kind_phys), dimension(:,:), intent(in) :: shum_wts ! inverse/flipped weights are always allocated - real(kind_phys), dimension(1:im,1:km), intent(inout) :: sppt_wts_inv - real(kind_phys), dimension(1:im,1:km), intent(inout) :: skebu_wts_inv - real(kind_phys), dimension(1:im,1:km), intent(inout) :: skebv_wts_inv - real(kind_phys), dimension(1:im,1:km), intent(inout) :: shum_wts_inv - real(kind_phys), dimension(1:im,1:km), intent(in) :: diss_est - real(kind_phys), dimension(1:im,1:km), intent(in) :: ugrs - real(kind_phys), dimension(1:im,1:km), intent(in) :: vgrs - real(kind_phys), dimension(1:im,1:km), intent(in) :: tgrs - real(kind_phys), dimension(1:im,1:km), intent(in) :: qgrs - real(kind_phys), dimension(1:im,1:km), intent(inout) :: gu0 - real(kind_phys), dimension(1:im,1:km), intent(inout) :: gv0 - real(kind_phys), dimension(1:im,1:km), intent(inout) :: gt0 - real(kind_phys), dimension(1:im,1:km), intent(inout) :: gq0 + real(kind_phys), dimension(:,:), intent(inout) :: sppt_wts_inv + real(kind_phys), dimension(:,:), intent(inout) :: skebu_wts_inv + real(kind_phys), dimension(:,:), intent(inout) :: skebv_wts_inv + real(kind_phys), dimension(:,:), intent(inout) :: shum_wts_inv + real(kind_phys), dimension(:,:), intent(in) :: diss_est + real(kind_phys), dimension(:,:), intent(in) :: ugrs + real(kind_phys), dimension(:,:), intent(in) :: vgrs + real(kind_phys), dimension(:,:), intent(in) :: tgrs + real(kind_phys), dimension(:,:), intent(in) :: qgrs + real(kind_phys), dimension(:,:), intent(inout) :: gu0 + real(kind_phys), dimension(:,:), intent(inout) :: gv0 + real(kind_phys), dimension(:,:), intent(inout) :: gt0 + real(kind_phys), dimension(:,:), intent(inout) :: gq0 ! dtdtr only allocated if do_sppt == .true. real(kind_phys), dimension(:,:), intent(in) :: dtdtr - real(kind_phys), dimension(1:im), intent(in) :: rain - real(kind_phys), dimension(1:im), intent(in) :: rainc - real(kind_phys), dimension(1:im), intent(inout) :: tprcp - real(kind_phys), dimension(1:im), intent(inout) :: totprcp - real(kind_phys), dimension(1:im), intent(inout) :: cnvprcp - real(kind_phys), dimension(1:im), intent(inout) :: totprcpb - real(kind_phys), dimension(1:im), intent(inout) :: cnvprcpb + real(kind_phys), dimension(:), intent(in) :: rain + real(kind_phys), dimension(:), intent(in) :: rainc + real(kind_phys), dimension(:), intent(inout) :: tprcp + real(kind_phys), dimension(:), intent(inout) :: totprcp + real(kind_phys), dimension(:), intent(inout) :: cnvprcp + real(kind_phys), dimension(:), intent(inout) :: totprcpb + real(kind_phys), dimension(:), intent(inout) :: cnvprcpb logical, intent(in) :: cplflx ! rain_cpl, snow_cpl only allocated if cplflx == .true. or cplchm == .true. real(kind_phys), dimension(:), intent(inout) :: rain_cpl @@ -88,9 +88,9 @@ subroutine GFS_stochastics_run (im, km, kdt, do_sppt, use_zmtnblck, do_shum, ! drain_cpl, dsnow_cpl only allocated if cplflx == .true. or cplchm == .true. real(kind_phys), dimension(:), intent(in) :: drain_cpl real(kind_phys), dimension(:), intent(in) :: dsnow_cpl - real(kind_phys), dimension(1:km), intent(in) :: si - real(kind_phys), dimension(1:km), intent(inout) :: vfact_ca - real(kind_phys), dimension(1:im), intent(in) :: ca1 + real(kind_phys), dimension(:), intent(in) :: si + real(kind_phys), dimension(:), intent(inout) :: vfact_ca + real(kind_phys), dimension(:), intent(in) :: ca1 character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/GFS_suite_interstitial.F90 b/physics/GFS_suite_interstitial.F90 index 263e316a5e..4214dbf18c 100644 --- a/physics/GFS_suite_interstitial.F90 +++ b/physics/GFS_suite_interstitial.F90 @@ -94,12 +94,12 @@ subroutine GFS_suite_interstitial_1_run (im, levs, ntrac, dtf, dtp, slmsk, area, ! interface variables integer, intent(in) :: im, levs, ntrac real(kind=kind_phys), intent(in) :: dtf, dtp, dxmin, dxinv - real(kind=kind_phys), intent(in), dimension(im) :: slmsk, area, pgr + real(kind=kind_phys), intent(in), dimension(:) :: slmsk, area, pgr - integer, intent(out), dimension(im) :: islmsk - real(kind=kind_phys), intent(out), dimension(im) :: work1, work2, psurf - real(kind=kind_phys), intent(out), dimension(im,levs) :: dudt, dvdt, dtdt, dtdtc - real(kind=kind_phys), intent(out), dimension(im,levs,ntrac) :: dqdt + integer, intent(out), dimension(:) :: islmsk + real(kind=kind_phys), intent(out), dimension(:) :: work1, work2, psurf + real(kind=kind_phys), intent(out), dimension(:,:) :: dudt, dvdt, dtdt, dtdtc + real(kind=kind_phys), intent(out), dimension(:,:,:) :: dqdt real(kind=kind_phys), parameter :: zero = 0.0_kind_phys, one = 1.0_kind_phys character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -173,34 +173,34 @@ subroutine GFS_suite_interstitial_2_run (im, levs, lssav, ldiag3d, lsidea, cplfl logical, intent(in ) :: old_monin, mstrat, do_shoc, frac_grid real(kind=kind_phys), intent(in ) :: dtf, cp, hvap - logical, intent(in ), dimension(im) :: flag_cice - real(kind=kind_phys), intent(in ), dimension(2) :: ctei_rm - real(kind=kind_phys), intent(in ), dimension(im) :: xcosz, adjsfcdsw, adjsfcdlw, pgr, xmu, ulwsfc_cice, work1, work2 - real(kind=kind_phys), intent(in ), dimension(im) :: cice - real(kind=kind_phys), intent(in ), dimension(im, levs) :: htrsw, htrlw, tgrs, prsl, qgrs_water_vapor, qgrs_cloud_water, prslk - real(kind=kind_phys), intent(in ), dimension(im, levs+1) :: prsi - real(kind=kind_phys), intent(in ), dimension(im, levs, 6) :: lwhd - integer, intent(inout), dimension(im) :: kinver - real(kind=kind_phys), intent(inout), dimension(im) :: suntim, dlwsfc, ulwsfc, psmean, ctei_rml, ctei_r - real(kind=kind_phys), intent(in ), dimension(im) :: adjsfculw_lnd, adjsfculw_ice, adjsfculw_wat - real(kind=kind_phys), intent( out), dimension(im) :: adjsfculw + logical, intent(in ), dimension(:) :: flag_cice + real(kind=kind_phys), intent(in ), dimension(:) :: ctei_rm + real(kind=kind_phys), intent(in ), dimension(:) :: xcosz, adjsfcdsw, adjsfcdlw, pgr, xmu, ulwsfc_cice, work1, work2 + real(kind=kind_phys), intent(in ), dimension(:) :: cice + real(kind=kind_phys), intent(in ), dimension(:, :) :: htrsw, htrlw, tgrs, prsl, qgrs_water_vapor, qgrs_cloud_water, prslk + real(kind=kind_phys), intent(in ), dimension(:, :) :: prsi + real(kind=kind_phys), intent(in ), dimension(:, :, :) :: lwhd + integer, intent(inout), dimension(:) :: kinver + real(kind=kind_phys), intent(inout), dimension(:) :: suntim, dlwsfc, ulwsfc, psmean, ctei_rml, ctei_r + real(kind=kind_phys), intent(in ), dimension(:) :: adjsfculw_lnd, adjsfculw_ice, adjsfculw_wat + real(kind=kind_phys), intent( out), dimension(:) :: adjsfculw ! RRTMGP logical, intent(in ) :: & use_GP_jacobian ! Use RRTMGP LW Jacobian of upwelling to adjust the surface flux? - real(kind=kind_phys), intent(in ), dimension(im) :: & + real(kind=kind_phys), intent(in ), dimension(:) :: & skt ! Skin temperature - real(kind=kind_phys), intent(inout), dimension(im) :: & + real(kind=kind_phys), intent(inout), dimension(:) :: & sktp1r ! Skin temperature at previous timestep - real(kind=kind_phys), intent(in ), dimension(im,levs+1), optional :: & + real(kind=kind_phys), intent(in ), dimension(:,:), optional :: & fluxlwUP, & ! Upwelling LW flux (W/m2) fluxlwUP_jac ! Jacobian of upwelling LW flux (W/m2/K) ! These arrays are only allocated if ldiag3d is .true. real(kind=kind_phys), intent(inout), dimension(:,:) :: dt3dt_lw, dt3dt_sw, dt3dt_pbl, dt3dt_dcnv, dt3dt_scnv, dt3dt_mp - logical, intent(in ), dimension(im) :: dry, icy, wet - real(kind=kind_phys), intent(in ), dimension(im) :: frland + logical, intent(in ), dimension(:) :: dry, icy, wet + real(kind=kind_phys), intent(in ), dimension(:) :: frland real(kind=kind_phys), intent(in ) :: huge character(len=*), intent(out) :: errmsg @@ -402,10 +402,10 @@ subroutine GFS_suite_stateout_reset_run (im, levs, ntrac, & integer, intent(in) :: im integer, intent(in) :: levs integer, intent(in) :: ntrac - real(kind=kind_phys), dimension(im,levs), intent(in) :: tgrs, ugrs, vgrs - real(kind=kind_phys), dimension(im,levs,ntrac), intent(in) :: qgrs - real(kind=kind_phys), dimension(im,levs), intent(out) :: gt0, gu0, gv0 - real(kind=kind_phys), dimension(im,levs,ntrac), intent(out) :: gq0 + real(kind=kind_phys), dimension(:,:), intent(in) :: tgrs, ugrs, vgrs + real(kind=kind_phys), dimension(:,:,:), intent(in) :: qgrs + real(kind=kind_phys), dimension(:,:), intent(out) :: gt0, gu0, gv0 + real(kind=kind_phys), dimension(:,:,:), intent(out) :: gq0 character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -451,12 +451,12 @@ subroutine GFS_suite_stateout_update_run (im, levs, ntrac, dtp, & integer, intent(in) :: ntrac real(kind=kind_phys), intent(in) :: dtp - real(kind=kind_phys), dimension(im,levs), intent(in) :: tgrs, ugrs, vgrs - real(kind=kind_phys), dimension(im,levs,ntrac), intent(in) :: qgrs - real(kind=kind_phys), dimension(im,levs), intent(in) :: dudt, dvdt, dtdt - real(kind=kind_phys), dimension(im,levs,ntrac), intent(in) :: dqdt - real(kind=kind_phys), dimension(im,levs), intent(out) :: gt0, gu0, gv0 - real(kind=kind_phys), dimension(im,levs,ntrac), intent(out) :: gq0 + real(kind=kind_phys), dimension(:,:), intent(in) :: tgrs, ugrs, vgrs + real(kind=kind_phys), dimension(:,:,:), intent(in) :: qgrs + real(kind=kind_phys), dimension(:,:), intent(in) :: dudt, dvdt, dtdt + real(kind=kind_phys), dimension(:,:,:), intent(in) :: dqdt + real(kind=kind_phys), dimension(:,:), intent(out) :: gt0, gu0, gv0 + real(kind=kind_phys), dimension(:,:,:), intent(out) :: gq0 character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -509,22 +509,22 @@ subroutine GFS_suite_interstitial_3_run (im, levs, nn, cscnv, & integer, intent(in) :: im, levs, nn, ntrac, ntcw, ntiw, ntclamt, ntrw, & ntsw, ntrnc, ntsnc, ntgl, ntgnc, imp_physics, imp_physics_mg, imp_physics_zhao_carr, imp_physics_zhao_carr_pdf, & imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6,imp_physics_fer_hires, me - integer, dimension(im), intent(in) :: islmsk, kpbl, kinver + integer, dimension(:), intent(in) :: islmsk, kpbl, kinver logical, intent(in) :: cscnv, satmedmf, trans_trac, do_shoc, ltaerosol, ras real(kind=kind_phys), intent(in) :: rhcbot, rhcmax, rhcpbl, rhctop - real(kind=kind_phys), dimension(im), intent(in) :: work1, work2 - real(kind=kind_phys), dimension(im, levs), intent(in) :: prsl, prslk - real(kind=kind_phys), dimension(im, levs+1), intent(in) :: prsi - real(kind=kind_phys), dimension(im), intent(in) :: xlon, xlat - real(kind=kind_phys), dimension(im, levs), intent(in) :: gt0 - real(kind=kind_phys), dimension(im, levs, ntrac), intent(in) :: gq0 - - real(kind=kind_phys), dimension(im, levs), intent(inout) :: rhc, save_qc + real(kind=kind_phys), dimension(:), intent(in) :: work1, work2 + real(kind=kind_phys), dimension(:, :), intent(in) :: prsl, prslk + real(kind=kind_phys), dimension(:, :), intent(in) :: prsi + real(kind=kind_phys), dimension(:), intent(in) :: xlon, xlat + real(kind=kind_phys), dimension(:, :), intent(in) :: gt0 + real(kind=kind_phys), dimension(:, :, :), intent(in) :: gq0 + + real(kind=kind_phys), dimension(:, :), intent(inout) :: rhc, save_qc ! save_qi is not allocated for Zhao-Carr MP real(kind=kind_phys), dimension(:, :), intent(inout) :: save_qi real(kind=kind_phys), dimension(:, :), intent(inout) :: save_tcp ! ONLY ALLOCATE FOR THOMPSON! TODO - real(kind=kind_phys), dimension(im, levs, nn), intent(inout) :: clw + real(kind=kind_phys), dimension(:, :, :), intent(inout) :: clw character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -679,16 +679,16 @@ subroutine GFS_suite_interstitial_4_run (im, levs, ltaerosol, cplchm, tracers_to logical, intent(in) :: ltaerosol, cplchm real(kind=kind_phys), intent(in) :: con_pi, dtf - real(kind=kind_phys), dimension(im,levs), intent(in) :: save_qc + real(kind=kind_phys), dimension(:, :), intent(in) :: save_qc ! save_qi is not allocated for Zhao-Carr MP real(kind=kind_phys), dimension(:, :), intent(in) :: save_qi - real(kind=kind_phys), dimension(im,levs,ntrac), intent(inout) :: gq0 - real(kind=kind_phys), dimension(im,levs,nn), intent(inout) :: clw - real(kind=kind_phys), dimension(im,levs), intent(in) :: prsl + real(kind=kind_phys), dimension(:, :,:), intent(inout) :: gq0 + real(kind=kind_phys), dimension(:, :,:), intent(inout) :: clw + real(kind=kind_phys), dimension(:, :), intent(in) :: prsl real(kind=kind_phys), intent(in) :: con_rd real(kind=kind_phys), dimension(:,:), intent(in) :: nwfa, save_tcp - real(kind=kind_phys), dimension(im,levs), intent(in) :: spechum + real(kind=kind_phys), dimension(:, :), intent(in) :: spechum ! dqdti may not be allocated real(kind=kind_phys), dimension(:,:), intent(inout) :: dqdti @@ -828,9 +828,9 @@ subroutine GFS_suite_interstitial_5_run (im, levs, ntrac, ntcw, ntiw, nn, gq0, c ! interface variables integer, intent(in) :: im, levs, ntrac, ntcw, ntiw, nn - real(kind=kind_phys), dimension(im, levs, ntrac), intent(in) :: gq0 + real(kind=kind_phys), dimension(:, :, :), intent(in) :: gq0 - real(kind=kind_phys), dimension(im, levs, nn), intent(out) :: clw + real(kind=kind_phys), dimension(:, :, :), intent(out) :: clw character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/GFS_surface_composites.F90 b/physics/GFS_surface_composites.F90 index b3000b008b..ff513a1b6a 100644 --- a/physics/GFS_surface_composites.F90 +++ b/physics/GFS_surface_composites.F90 @@ -40,24 +40,24 @@ subroutine GFS_surface_composites_pre_run (im, lkm, frac_grid, flag_cice, cplflx ! Interface variables integer, intent(in ) :: im, lkm logical, intent(in ) :: frac_grid, cplflx, cplwav2atm - logical, dimension(im), intent(inout) :: flag_cice - logical, dimension(im), intent(inout) :: dry, icy, lake, ocean, wet + logical, dimension(:), intent(inout) :: flag_cice + logical, dimension(:), intent(inout) :: dry, icy, lake, ocean, wet real(kind=kind_phys), intent(in ) :: cimin - real(kind=kind_phys), dimension(im), intent(in ) :: landfrac, lakefrac, lakedepth, oceanfrac - real(kind=kind_phys), dimension(im), intent(inout) :: cice - real(kind=kind_phys), dimension(im), intent( out) :: frland - real(kind=kind_phys), dimension(im), intent(in ) :: zorl, snowd, tprcp, uustar, weasd, qss, hflx + real(kind=kind_phys), dimension(:), intent(in ) :: landfrac, lakefrac, lakedepth, oceanfrac + real(kind=kind_phys), dimension(:), intent(inout) :: cice + real(kind=kind_phys), dimension(:), intent( out) :: frland + real(kind=kind_phys), dimension(:), intent(in ) :: zorl, snowd, tprcp, uustar, weasd, qss, hflx - real(kind=kind_phys), dimension(im), intent(inout) :: zorlo, zorll, zorli, tsfc, tsfco, tsfcl, tisfc, tsurf - real(kind=kind_phys), dimension(im), intent(inout) :: snowd_wat, snowd_lnd, snowd_ice, tprcp_wat, & + real(kind=kind_phys), dimension(:), intent(inout) :: zorlo, zorll, zorli, tsfc, tsfco, tsfcl, tisfc, tsurf + real(kind=kind_phys), dimension(:), intent(inout) :: snowd_wat, snowd_lnd, snowd_ice, tprcp_wat, & tprcp_lnd, tprcp_ice, zorl_wat, zorl_lnd, zorl_ice, tsfc_wat, tsfc_lnd, tsfc_ice, tsurf_wat, & tsurf_lnd, tsurf_ice, uustar_wat, uustar_lnd, uustar_ice, weasd_wat, weasd_lnd, weasd_ice, & qss_wat, qss_lnd, qss_ice, hflx_wat, hflx_lnd, hflx_ice, ep1d_ice, gflx_ice - real(kind=kind_phys), dimension(im), intent( out) :: tice + real(kind=kind_phys), dimension(:), intent( out) :: tice real(kind=kind_phys), intent(in ) :: tgice - integer, dimension(im), intent(inout) :: islmsk - real(kind=kind_phys), dimension(im), intent(in ) :: semis_rad - real(kind=kind_phys), dimension(im), intent(inout) :: semis_wat, semis_lnd, semis_ice + integer, dimension(:), intent(inout) :: islmsk + real(kind=kind_phys), dimension(:), intent(in ) :: semis_rad + real(kind=kind_phys), dimension(:), intent(inout) :: semis_wat, semis_lnd, semis_ice real(kind=kind_phys), intent(in ) :: min_lakeice, min_seaice ! CCPP error handling @@ -252,11 +252,11 @@ subroutine GFS_surface_composites_inter_run (im, dry, icy, wet, semis_wat, semis ! Interface variables integer, intent(in ) :: im - logical, dimension(im), intent(in ) :: dry, icy, wet - real(kind=kind_phys), dimension(im), intent(in ) :: semis_wat, semis_lnd, semis_ice, adjsfcdlw, & + logical, dimension(:), intent(in ) :: dry, icy, wet + real(kind=kind_phys), dimension(:), intent(in ) :: semis_wat, semis_lnd, semis_ice, adjsfcdlw, & adjsfcdsw, adjsfcnsw - real(kind=kind_phys), dimension(im), intent(inout) :: gabsbdlw_lnd, gabsbdlw_ice, gabsbdlw_wat - real(kind=kind_phys), dimension(im), intent(out) :: adjsfcusw + real(kind=kind_phys), dimension(:), intent(inout) :: gabsbdlw_lnd, gabsbdlw_ice, gabsbdlw_wat + real(kind=kind_phys), dimension(:), intent(out) :: adjsfcusw ! CCPP error handling character(len=*), intent(out) :: errmsg @@ -339,9 +339,9 @@ subroutine GFS_surface_composites_post_run ( integer, intent(in) :: im, kice, km logical, intent(in) :: cplflx, frac_grid, cplwav2atm - logical, dimension(im), intent(in) :: flag_cice, dry, wet, icy - integer, dimension(im), intent(in) :: islmsk - real(kind=kind_phys), dimension(im), intent(in) :: landfrac, lakefrac, oceanfrac, & + logical, dimension(:), intent(in) :: flag_cice, dry, wet, icy + integer, dimension(:), intent(in) :: islmsk + real(kind=kind_phys), dimension(:), intent(in) :: landfrac, lakefrac, oceanfrac, & zorl_wat, zorl_lnd, zorl_ice, cd_wat, cd_lnd, cd_ice, cdq_wat, cdq_lnd, cdq_ice, rb_wat, rb_lnd, rb_ice, stress_wat, & stress_lnd, stress_ice, ffmm_wat, ffmm_lnd, ffmm_ice, ffhh_wat, ffhh_lnd, ffhh_ice, uustar_wat, uustar_lnd, uustar_ice, & fm10_wat, fm10_lnd, fm10_ice, fh2_wat, fh2_lnd, fh2_ice, tsurf_wat, tsurf_lnd, tsurf_ice, cmm_wat, cmm_lnd, cmm_ice, & @@ -349,15 +349,15 @@ subroutine GFS_surface_composites_post_run ( snowd_wat, snowd_lnd, snowd_ice,tprcp_wat, tprcp_lnd, tprcp_ice, evap_wat, evap_lnd, evap_ice, hflx_wat, hflx_lnd, & hflx_ice, qss_wat, qss_lnd, qss_ice, tsfc_wat, tsfc_lnd, tsfc_ice - real(kind=kind_phys), dimension(im), intent(inout) :: zorl, zorlo, zorll, zorli, cd, cdq, rb, stress, ffmm, ffhh, uustar, fm10, & + real(kind=kind_phys), dimension(:), intent(inout) :: zorl, zorlo, zorll, zorli, cd, cdq, rb, stress, ffmm, ffhh, uustar, fm10, & fh2, tsurf, cmm, chh, gflx, ep1d, weasd, snowd, tprcp, evap, hflx, qss, tsfc, tsfco, tsfcl, tisfc - real(kind=kind_phys), dimension(im), intent(in ) :: tice ! interstitial sea ice temperature - real(kind=kind_phys), dimension(im), intent(inout) :: hice, cice + real(kind=kind_phys), dimension(:), intent(in ) :: tice ! interstitial sea ice temperature + real(kind=kind_phys), dimension(:), intent(inout) :: hice, cice real(kind=kind_phys), intent(in ) :: min_seaice - real(kind=kind_phys), dimension(im, kice), intent(in ) :: tiice - real(kind=kind_phys), dimension(im, km), intent(inout) :: stc + real(kind=kind_phys), dimension(:, :), intent(in ) :: tiice + real(kind=kind_phys), dimension(:, :), intent(inout) :: stc character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/GFS_surface_generic.F90 b/physics/GFS_surface_generic.F90 index 337e4c58de..d65f4ad59f 100644 --- a/physics/GFS_surface_generic.F90 +++ b/physics/GFS_surface_generic.F90 @@ -38,51 +38,51 @@ subroutine GFS_surface_generic_pre_run (im, levs, vfrac, islmsk, isot, ivegsrc, ! Interface variables integer, intent(in) :: im, levs, isot, ivegsrc - integer, dimension(im), intent(in) :: islmsk - integer, dimension(im), intent(inout) :: soiltyp, vegtype, slopetyp + integer, dimension(:), intent(in) :: islmsk + integer, dimension(:), intent(inout) :: soiltyp, vegtype, slopetyp real(kind=kind_phys), intent(in) :: con_g - real(kind=kind_phys), dimension(im), intent(in) :: vfrac, stype, vtype, slope, prsik_1, prslk_1 + real(kind=kind_phys), dimension(:), intent(in) :: vfrac, stype, vtype, slope, prsik_1, prslk_1 - real(kind=kind_phys), dimension(im), intent(inout) :: tsfc - real(kind=kind_phys), dimension(im,levs), intent(in) :: phil + real(kind=kind_phys), dimension(:), intent(inout) :: tsfc + real(kind=kind_phys), dimension(:,:), intent(in) :: phil - real(kind=kind_phys), dimension(im), intent(inout) :: sigmaf, work3, tsurf, zlvl + real(kind=kind_phys), dimension(:), intent(inout) :: sigmaf, work3, tsurf, zlvl ! Stochastic physics / surface perturbations logical, intent(in) :: do_sppt, ca_global - real(kind=kind_phys), dimension(im,levs), intent(out) :: dtdtr - real(kind=kind_phys), dimension(im), intent(out) :: drain_cpl - real(kind=kind_phys), dimension(im), intent(out) :: dsnow_cpl - real(kind=kind_phys), dimension(im), intent(in) :: rain_cpl - real(kind=kind_phys), dimension(im), intent(in) :: snow_cpl + real(kind=kind_phys), dimension(:,:), intent(out) :: dtdtr + real(kind=kind_phys), dimension(:), intent(out) :: drain_cpl + real(kind=kind_phys), dimension(:), intent(out) :: dsnow_cpl + real(kind=kind_phys), dimension(:), intent(in) :: rain_cpl + real(kind=kind_phys), dimension(:), intent(in) :: snow_cpl logical, intent(in) :: do_sfcperts integer, intent(in) :: nsfcpert - real(kind=kind_phys), dimension(im,nsfcpert), intent(in) :: sfc_wts + real(kind=kind_phys), dimension(:,:), intent(in) :: sfc_wts real(kind=kind_phys), dimension(:), intent(in) :: pertz0 real(kind=kind_phys), dimension(:), intent(in) :: pertzt real(kind=kind_phys), dimension(:), intent(in) :: pertshc real(kind=kind_phys), dimension(:), intent(in) :: pertlai real(kind=kind_phys), dimension(:), intent(in) :: pertvegf - real(kind=kind_phys), dimension(im), intent(out) :: z01d - real(kind=kind_phys), dimension(im), intent(out) :: zt1d - real(kind=kind_phys), dimension(im), intent(out) :: bexp1d - real(kind=kind_phys), dimension(im), intent(out) :: xlai1d - real(kind=kind_phys), dimension(im), intent(out) :: vegf1d + real(kind=kind_phys), dimension(:), intent(out) :: z01d + real(kind=kind_phys), dimension(:), intent(out) :: zt1d + real(kind=kind_phys), dimension(:), intent(out) :: bexp1d + real(kind=kind_phys), dimension(:), intent(out) :: xlai1d + real(kind=kind_phys), dimension(:), intent(out) :: vegf1d logical, intent(in) :: cplflx - real(kind=kind_phys), dimension(im), intent(in) :: slimskin_cpl - logical, dimension(im), intent(inout) :: flag_cice - integer, dimension(im), intent(out) :: islmsk_cice - real(kind=kind_phys), dimension(im), intent(in) :: & + real(kind=kind_phys), dimension(:), intent(in) :: slimskin_cpl + logical, dimension(:), intent(inout) :: flag_cice + integer, dimension(:), intent(out) :: islmsk_cice + real(kind=kind_phys), dimension(:), intent(in) :: & tisfc, tsfco, fice, hice - real(kind=kind_phys), dimension(im), intent(out) :: wind - real(kind=kind_phys), dimension(im), intent(in ) :: u1, v1 + real(kind=kind_phys), dimension(:), intent(out) :: wind + real(kind=kind_phys), dimension(:), intent(in ) :: u1, v1 ! surface wind enhancement due to convection - real(kind=kind_phys), dimension(im), intent(inout ) :: cnvwind + real(kind=kind_phys), dimension(:), intent(inout ) :: cnvwind ! - real(kind=kind_phys), dimension(im), intent(out) :: smcwlt2, smcref2 + real(kind=kind_phys), dimension(:), intent(out) :: smcwlt2, smcref2 ! CCPP error handling character(len=*), intent(out) :: errmsg @@ -227,29 +227,29 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplwav, lssav, icy, wet, dt integer, intent(in) :: im logical, intent(in) :: cplflx, cplwav, lssav - logical, dimension(im), intent(in) :: icy, wet + logical, dimension(:), intent(in) :: icy, wet real(kind=kind_phys), intent(in) :: dtf - real(kind=kind_phys), dimension(im), intent(in) :: ep1d, gflx, tgrs_1, qgrs_1, ugrs_1, vgrs_1, adjsfcdlw, adjsfcdsw, & + real(kind=kind_phys), dimension(:), intent(in) :: ep1d, gflx, tgrs_1, qgrs_1, ugrs_1, vgrs_1, adjsfcdlw, adjsfcdsw, & adjnirbmd, adjnirdfd, adjvisbmd, adjvisdfd, adjsfculw, adjsfculw_wat, adjnirbmu, adjnirdfu, adjvisbmu, adjvisdfu, & t2m, q2m, u10m, v10m, tsfc, tsfc_wat, pgr, xcosz, evbs, evcw, trans, sbsno, snowc, snohf - real(kind=kind_phys), dimension(im), intent(inout) :: epi, gfluxi, t1, q1, u1, v1, dlwsfci_cpl, dswsfci_cpl, dlwsfc_cpl, & + real(kind=kind_phys), dimension(:), intent(inout) :: epi, gfluxi, t1, q1, u1, v1, dlwsfci_cpl, dswsfci_cpl, dlwsfc_cpl, & dswsfc_cpl, dnirbmi_cpl, dnirdfi_cpl, dvisbmi_cpl, dvisdfi_cpl, dnirbm_cpl, dnirdf_cpl, dvisbm_cpl, dvisdf_cpl, & nlwsfci_cpl, nlwsfc_cpl, t2mi_cpl, q2mi_cpl, u10mi_cpl, v10mi_cpl, tsfci_cpl, psurfi_cpl, nnirbmi_cpl, nnirdfi_cpl, & nvisbmi_cpl, nvisdfi_cpl, nswsfci_cpl, nswsfc_cpl, nnirbm_cpl, nnirdf_cpl, nvisbm_cpl, nvisdf_cpl, gflux, evbsa, & evcwa, transa, sbsnoa, snowca, snohfa, ep - real(kind=kind_phys), dimension(im), intent(inout) :: runoff, srunoff - real(kind=kind_phys), dimension(im), intent(in) :: drain, runof + real(kind=kind_phys), dimension(:), intent(inout) :: runoff, srunoff + real(kind=kind_phys), dimension(:), intent(in) :: drain, runof ! For canopy heat storage logical, intent(in) :: lheatstrg real(kind=kind_phys), intent(in) :: z0fac, e0fac - real(kind=kind_phys), dimension(im), intent(in) :: zorl - real(kind=kind_phys), dimension(im), intent(in) :: hflx, evap - real(kind=kind_phys), dimension(im), intent(out) :: hflxq, evapq - real(kind=kind_phys), dimension(im), intent(out) :: hffac, hefac + real(kind=kind_phys), dimension(:), intent(in) :: zorl + real(kind=kind_phys), dimension(:), intent(in) :: hflx, evap + real(kind=kind_phys), dimension(:), intent(out) :: hflxq, evapq + real(kind=kind_phys), dimension(:), intent(out) :: hffac, hefac ! CCPP error handling variables character(len=*), intent(out) :: errmsg diff --git a/physics/GFS_surface_loop_control.F90 b/physics/GFS_surface_loop_control.F90 index c7f727d273..afa34130d0 100644 --- a/physics/GFS_surface_loop_control.F90 +++ b/physics/GFS_surface_loop_control.F90 @@ -90,10 +90,10 @@ subroutine GFS_surface_loop_control_part2_run (im, iter, wind, & ! Interface variables integer, intent(in) :: im integer, intent(in) :: iter - real(kind=kind_phys), dimension(im), intent(in) :: wind - logical, dimension(im), intent(inout) :: flag_guess - logical, dimension(im), intent(inout) :: flag_iter - logical, dimension(im), intent(in) :: dry, wet, icy + real(kind=kind_phys), dimension(:), intent(in) :: wind + logical, dimension(:), intent(inout) :: flag_guess + logical, dimension(:), intent(inout) :: flag_iter + logical, dimension(:), intent(in) :: dry, wet, icy integer, intent(in) :: nstf_name1 character(len=*), intent(out) :: errmsg diff --git a/physics/GFS_time_vary_pre.fv3.F90 b/physics/GFS_time_vary_pre.fv3.F90 index dc9332bb90..66c91738b3 100644 --- a/physics/GFS_time_vary_pre.fv3.F90 +++ b/physics/GFS_time_vary_pre.fv3.F90 @@ -74,7 +74,7 @@ subroutine GFS_time_vary_pre_run (jdat, idat, dtp, lkm, lsm, lsm_noahmp, nsswr, implicit none integer, intent(in) :: idate(4) - integer, intent(in) :: jdat(1:8), idat(1:8) + integer, intent(in) :: jdat(:), idat(:) integer, intent(in) :: lkm, lsm, lsm_noahmp, & nsswr, nslwr, me, & master, nscyc, nhfrad diff --git a/physics/GFS_time_vary_pre.scm.F90 b/physics/GFS_time_vary_pre.scm.F90 index 2fa352710a..842423d1e8 100644 --- a/physics/GFS_time_vary_pre.scm.F90 +++ b/physics/GFS_time_vary_pre.scm.F90 @@ -74,7 +74,7 @@ subroutine GFS_time_vary_pre_run (jdat, idat, dtp, lsm, lsm_noahmp, nsswr, & implicit none integer, intent(in) :: idate(4) - integer, intent(in) :: jdat(1:8), idat(1:8) + integer, intent(in) :: jdat(:), idat(:) integer, intent(in) :: lsm, lsm_noahmp, & nsswr, nslwr, me, & master, nscyc diff --git a/physics/cires_ugwp.F90 b/physics/cires_ugwp.F90 index df0116cd01..018cf6ad96 100644 --- a/physics/cires_ugwp.F90 +++ b/physics/cires_ugwp.F90 @@ -54,7 +54,7 @@ subroutine cires_ugwp_init (me, master, nlunit, input_nml_file, logunit, & integer, intent (in) :: latr real(kind=kind_phys), intent (in) :: ak(:), bk(:) real(kind=kind_phys), intent (in) :: dtp - real(kind=kind_phys), intent (in) :: cdmbgwd(4), cgwf(2) ! "scaling" controls for "old" GFS-GW schemes + real(kind=kind_phys), intent (in) :: cdmbgwd(:), cgwf(:) ! "scaling" controls for "old" GFS-GW schemes real(kind=kind_phys), intent (in) :: pa_rf_in, tau_rf_in real(kind=kind_phys), intent (in) :: con_p0 logical, intent (in) :: do_ugwp @@ -163,24 +163,24 @@ subroutine cires_ugwp_run(do_ugwp, me, master, im, levs, ntrac, dtp, kdt, lonr ! interface variables integer, intent(in) :: me, master, im, levs, ntrac, kdt, lonr, nmtvr - integer, intent(in), dimension(im) :: kpbl - real(kind=kind_phys), intent(in), dimension(im) :: oro, oro_uf, hprime, oc, theta, sigma, gamma + integer, intent(in), dimension(:) :: kpbl + real(kind=kind_phys), intent(in), dimension(:) :: oro, oro_uf, hprime, oc, theta, sigma, gamma logical, intent(in) :: flag_for_gwd_generic_tend ! elvmax is intent(in) for CIRES UGWP, but intent(inout) for GFS GWDPS - real(kind=kind_phys), intent(inout), dimension(im) :: elvmax - real(kind=kind_phys), intent(in), dimension(im, 4) :: clx, oa4 - real(kind=kind_phys), intent(in), dimension(im) :: xlat, xlat_d, sinlat, coslat, area - real(kind=kind_phys), intent(in), dimension(im, levs) :: del, ugrs, vgrs, tgrs, prsl, prslk, phil - real(kind=kind_phys), intent(in), dimension(im, levs+1) :: prsi, phii - real(kind=kind_phys), intent(in), dimension(im, levs, ntrac):: qgrs - real(kind=kind_phys), intent(in) :: dtp, cdmbgwd(4) + real(kind=kind_phys), intent(inout), dimension(:) :: elvmax + real(kind=kind_phys), intent(in), dimension(:, :) :: clx, oa4 + real(kind=kind_phys), intent(in), dimension(:) :: xlat, xlat_d, sinlat, coslat, area + real(kind=kind_phys), intent(in), dimension(:, :) :: del, ugrs, vgrs, tgrs, prsl, prslk, phil + real(kind=kind_phys), intent(in), dimension(:, :) :: prsi, phii + real(kind=kind_phys), intent(in), dimension(:,:,:):: qgrs + real(kind=kind_phys), intent(in) :: dtp, cdmbgwd(:) logical, intent(in) :: do_ugwp, do_tofd, ldiag_ugwp - real(kind=kind_phys), intent(out), dimension(im) :: dusfcg, dvsfcg - real(kind=kind_phys), intent(out), dimension(im) :: zmtb, zlwb, zogw, rdxzb - real(kind=kind_phys), intent(out), dimension(im) :: tau_mtb, tau_ogw, tau_tofd, tau_ngw - real(kind=kind_phys), intent(out), dimension(im, levs):: gw_dudt, gw_dvdt, gw_dtdt, gw_kdis - real(kind=kind_phys), intent(out), dimension(im, levs):: dudt_mtb, dudt_ogw, dudt_tms + real(kind=kind_phys), intent(out), dimension(:) :: dusfcg, dvsfcg + real(kind=kind_phys), intent(out), dimension(:) :: zmtb, zlwb, zogw, rdxzb + real(kind=kind_phys), intent(out), dimension(:) :: tau_mtb, tau_ogw, tau_tofd, tau_ngw + real(kind=kind_phys), intent(out), dimension(:, :):: gw_dudt, gw_dvdt, gw_dtdt, gw_kdis + real(kind=kind_phys), intent(out), dimension(:, :):: dudt_mtb, dudt_ogw, dudt_tms ! These arrays are only allocated if ldiag=.true. real(kind=kind_phys), intent(inout), dimension(:,:) :: ldu3dt_ogw, ldv3dt_ogw, ldt3dt_ogw @@ -190,11 +190,11 @@ subroutine cires_ugwp_run(do_ugwp, me, master, im, levs, ntrac, dtp, kdt, lonr ! These arrays only allocated if ldiag_ugwp = .true. real(kind=kind_phys), intent(out), dimension(:,:) :: du3dt_mtb, du3dt_ogw, du3dt_tms - real(kind=kind_phys), intent(inout), dimension(im, levs):: dudt, dvdt, dtdt + real(kind=kind_phys), intent(inout), dimension(:, :):: dudt, dvdt, dtdt real(kind=kind_phys), intent(in) :: con_g, con_pi, con_cp, con_rd, con_rv, con_fvirt - real(kind=kind_phys), intent(in), dimension(im) :: rain + real(kind=kind_phys), intent(in), dimension(:) :: rain integer, intent(in) :: ntke real(kind=kind_phys), intent(in), dimension(:,:) :: q_tke, dqdt_tke diff --git a/physics/cnvc90.f b/physics/cnvc90.f index 9bef0ebf97..6a49158b4a 100644 --- a/physics/cnvc90.f +++ b/physics/cnvc90.f @@ -30,16 +30,16 @@ SUBROUTINE cnvc90_run(CLSTP,IM,RN,KBOT,KTOP,KM,PRSI, & ! Interface variables real(kind=kind_phys), intent(in) :: clstp integer, intent(in) :: im, km - real(kind=kind_phys), intent(in) :: RN(IM) - integer, intent(in) :: KBOT(IM) - integer, intent(in) :: KTOP(IM) - real(kind=kind_phys), intent(in) :: prsi(IM,km+1) - real(kind=kind_phys), intent(inout) :: ACV(IM) - real(kind=kind_phys), intent(inout) :: ACVB(IM) - real(kind=kind_phys), intent(inout) :: ACVT(IM) - real(kind=kind_phys), intent(inout) :: CV(IM) - real(kind=kind_phys), intent(inout) :: CVB(IM) - real(kind=kind_phys), intent(inout) :: CVT(IM) + real(kind=kind_phys), intent(in) :: RN(:) + integer, intent(in) :: KBOT(:) + integer, intent(in) :: KTOP(:) + real(kind=kind_phys), intent(in) :: prsi(:,:) + real(kind=kind_phys), intent(inout) :: ACV(:) + real(kind=kind_phys), intent(inout) :: ACVB(:) + real(kind=kind_phys), intent(inout) :: ACVT(:) + real(kind=kind_phys), intent(inout) :: CV(:) + real(kind=kind_phys), intent(inout) :: CVB(:) + real(kind=kind_phys), intent(inout) :: CVT(:) character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/cs_conv.F90 b/physics/cs_conv.F90 index 386349422f..f1d138eb54 100644 --- a/physics/cs_conv.F90 +++ b/physics/cs_conv.F90 @@ -31,15 +31,15 @@ subroutine cs_conv_pre_run(im, levs, ntrac, ncld, q, clw1, clw2, & ! --- inputs integer, intent(in) :: im, levs, ntrac, ncld - real(r8), dimension(im,levs), intent(in) :: q - real(r8), dimension(im,levs), intent(in) :: clw1,clw2 - real(r8), dimension(im), intent(in) :: work1, work2 + real(r8), dimension(:, :), intent(in) :: q + real(r8), dimension(:, :), intent(in) :: clw1,clw2 + real(r8), dimension(:), intent(in) :: work1, work2 real(r8), intent(in) :: cs_parm1, cs_parm2 ! --- input/output - real(r8), dimension(ntrac-ncld+2), intent(out) :: fswtr, fscav - real(r8), dimension(im), intent(out) :: wcbmax - real(r8), dimension(im,levs), intent(out) :: save_q1,save_q2 + real(r8), dimension(:), intent(out) :: fswtr, fscav + real(r8), dimension(:), intent(out) :: wcbmax + real(r8), dimension(:, :), intent(out) :: save_q1,save_q2 ! save_q3 is not allocated for Zhao-Carr MP real(r8), dimension(:,:), intent(out) :: save_q3 @@ -101,10 +101,10 @@ subroutine cs_conv_post_run(im, kmax, do_aw, sigmatot, sigmafrac, errmsg, errflg ! --- inputs integer, intent(in) :: im, kmax logical, intent(in) :: do_aw - real(r8), dimension(im,kmax), intent(in) :: sigmatot + real(r8), dimension(:, :), intent(in) :: sigmatot ! --- input/output - real(r8), dimension(im,kmax), intent(out) :: sigmafrac + real(r8), dimension(:, :), intent(out) :: sigmafrac character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -309,23 +309,23 @@ subroutine cs_conv_run( IJSDIM , KMAX , ntracp1 , NN, & ! input arguments ! INTEGER, INTENT(IN) :: IJSDIM, KMAX, ntracp1, nn, NTR, mype, nctp, mp_phys, kdt, lat !! DD, for GFS, pass in - logical, intent(in) :: otspt(1:ntracp1,1:2)! otspt(:,1) - on/off switch for tracer transport by updraft and + logical, intent(in) :: otspt(:, :)! otspt(:,1) - on/off switch for tracer transport by updraft and ! downdraft. should not include subgrid PDF and turbulence ! otspt(:,2) - on/off switch for tracer transport by subsidence ! should include subgrid PDF and turbulence - real(r8), intent(inout) :: t(IJSDIM,KMAX) ! temperature at mid-layer (K) - real(r8), intent(inout) :: q(IJSDIM,KMAX) ! water vapor array including moisture (kg/kg) - real(r8), intent(inout) :: clw(IJSDIM,KMAX,nn) ! tracer array including cloud condensate (kg/kg) - real(r8), intent(in) :: pap(IJSDIM,KMAX) ! pressure at mid-layer (Pa) - real(r8), intent(in) :: paph(IJSDIM,KMAX+1) ! pressure at boundaries (Pa) - real(r8), intent(in) :: zm(IJSDIM,KMAX) ! geopotential at mid-layer (m) - real(r8), intent(in) :: zi(IJSDIM,KMAX+1) ! geopotential at boundaries (m) - real(r8), intent(in) :: fscav(ntr), fswtr(ntr), wcbmaxm(ijsdim) + real(r8), intent(inout) :: t(:, :) ! temperature at mid-layer (K) + real(r8), intent(inout) :: q(:, :) ! water vapor array including moisture (kg/kg) + real(r8), intent(inout) :: clw(:, :, :) ! tracer array including cloud condensate (kg/kg) + real(r8), intent(in) :: pap(:, :) ! pressure at mid-layer (Pa) + real(r8), intent(in) :: paph(:, :) ! pressure at boundaries (Pa) + real(r8), intent(in) :: zm(:, :) ! geopotential at mid-layer (m) + real(r8), intent(in) :: zi(:, :) ! geopotential at boundaries (m) + real(r8), intent(in) :: fscav(:), fswtr(:), wcbmaxm(:) real(r8), intent(in) :: precz0in, preczhin, clmdin ! added for cs_convr - real(r8), intent(inout) :: u(IJSDIM,KMAX) ! zonal wind at mid-layer (m/s) - real(r8), intent(inout) :: v(IJSDIM,KMAX) ! meridional wind at mid-layer (m/s) + real(r8), intent(inout) :: u(:, :) ! zonal wind at mid-layer (m/s) + real(r8), intent(inout) :: v(:, :) ! meridional wind at mid-layer (m/s) real(r8), intent(in) :: DELTA ! physics time step real(r8), intent(in) :: DELTI ! dynamics time step (model time increment in seconds) @@ -333,12 +333,12 @@ subroutine cs_conv_run( IJSDIM , KMAX , ntracp1 , NN, & ! ! modified arguments ! - real(r8), intent(inout) :: CBMFX(IJSDIM,nctp) ! cloud base mass flux (kg/m2/s) + real(r8), intent(inout) :: CBMFX(:, :) ! cloud base mass flux (kg/m2/s) ! ! output arguments ! ! updraft, downdraft, and detrainment mass flux (kg/m2/s) - real(r8), intent(inout), dimension(IJSDIM,KMAX) :: ud_mf, dd_mf, dt_mf + real(r8), intent(inout), dimension(:, :) :: ud_mf, dd_mf, dt_mf real(r8), intent(out) :: rain1(IJSDIM) ! lwe thickness of deep convective precipitation amount (m) ! GJF* These variables are conditionally allocated depending on whether the @@ -348,14 +348,14 @@ subroutine cs_conv_run( IJSDIM , KMAX , ntracp1 , NN, & cnv_dqldt, clcn, cnv_fice, & cnv_ndrop, cnv_nice, cf_upi ! *GJF - integer, intent(inout) :: kcnv(ijsdim) ! zero if no deep convection and 1 otherwise + integer, intent(inout) :: kcnv(:) ! zero if no deep convection and 1 otherwise character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg !DDsigma - output added for AW sigma diagnostics ! interface sigma and vertical velocity by cloud type (1=sfc) ! real(r8), intent(out), dimension(IJSDIM,KMAX,nctp) :: sigmai, vverti - real(r8), intent(out), dimension(IJSDIM,KMAX) :: sigma ! sigma sigma totaled over cloud type - on interfaces (1=sfc) + real(r8), intent(out), dimension(:, :) :: sigma ! sigma sigma totaled over cloud type - on interfaces (1=sfc) ! sigma terms in eq 91 and 92 ! real(r8), dimension(IJSDIM,KMAX) :: sfluxterm, qvfluxterm, condterm !DDsigma @@ -738,19 +738,19 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions logical, intent(in) :: otspt1(ntr), otspt2(ntr), lprnt ! ! [OUTPUT] - REAL(r8), INTENT(OUT) :: GTT (IJSDIM, KMAX ) ! heating rate + REAL(r8), INTENT(OUT) :: GTT (IJSDIM, KMAX ) ! heating rate REAL(r8), INTENT(OUT) :: GTQ (IJSDIM, KMAX, NTR) ! change in q - REAL(r8), INTENT(OUT) :: GTU (IJSDIM, KMAX ) ! tendency of u - REAL(r8), INTENT(OUT) :: GTV (IJSDIM, KMAX ) ! tendency of v - REAL(r8), INTENT(OUT) :: CMDET (IJSDIM, KMAX ) ! detrainment mass flux + REAL(r8), INTENT(OUT) :: GTU (IJSDIM, KMAX ) ! tendency of u + REAL(r8), INTENT(OUT) :: GTV (IJSDIM, KMAX ) ! tendency of v + REAL(r8), INTENT(OUT) :: CMDET (IJSDIM, KMAX ) ! detrainment mass flux ! assuming there is no flux at the top of the atmospherea - Moorthi - REAL(r8), INTENT(OUT) :: GTPRP (IJSDIM, KMAX ) ! rain+snow flux - REAL(r8), INTENT(OUT) :: GSNWP (IJSDIM, KMAX ) ! snowfall flux - REAL(r8), INTENT(OUT) :: GMFX0 (IJSDIM, KMAX ) ! updraft mass flux - REAL(r8), INTENT(OUT) :: GMFX1 (IJSDIM, KMAX ) ! downdraft mass flux + REAL(r8), INTENT(OUT) :: GTPRP (IJSDIM, KMAX ) ! rain+snow flux + REAL(r8), INTENT(OUT) :: GSNWP (IJSDIM, KMAX ) ! snowfall flux + REAL(r8), INTENT(OUT) :: GMFX0 (IJSDIM, KMAX ) ! updraft mass flux + REAL(r8), INTENT(OUT) :: GMFX1 (IJSDIM, KMAX ) ! downdraft mass flux - REAL(r8), INTENT(OUT) :: CAPE (IJSDIM ) + REAL(r8), INTENT(OUT) :: CAPE (IJSDIM ) INTEGER , INTENT(OUT) :: KT (IJSDIM, NCTP ) ! cloud top ! ! [MODIFIED] @@ -774,14 +774,14 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions real(r8), allocatable, dimension(:,:,:) :: trfluxterm ! tendencies of tracers due to eddy mass flux ! ! [INPUT] - REAL(r8), INTENT(IN) :: GDT (IJSDIM, KMAX ) ! temperature T + REAL(r8), INTENT(IN) :: GDT (IJSDIM, KMAX ) ! temperature T REAL(r8), INTENT(IN) :: GDQ (IJSDIM, KMAX, NTR) ! humidity, tracer !DDsigmadiag - REAL(r8), INTENT(IN) :: GDU (IJSDIM, KMAX ) ! westerly u - REAL(r8), INTENT(IN) :: GDV (IJSDIM, KMAX ) ! southern wind v - REAL(r8), INTENT(IN) :: GDTM (IJSDIM, KMAX+1 ) ! temperature T + REAL(r8), INTENT(IN) :: GDU (IJSDIM, KMAX ) ! westerly u + REAL(r8), INTENT(IN) :: GDV (IJSDIM, KMAX ) ! southern wind v + REAL(r8), INTENT(IN) :: GDTM (IJSDIM, KMAX+1 ) ! temperature T REAL(r8), INTENT(IN) :: GDP (IJSDIM, KMAX ) ! pressure P REAL(r8), INTENT(IN) :: GDPM (IJSDIM, KMAX+1 ) ! pressure (half lev) - REAL(r8), INTENT(IN) :: GDZ (IJSDIM, KMAX ) ! altitude + REAL(r8), INTENT(IN) :: GDZ (IJSDIM, KMAX ) ! altitude REAL(r8), INTENT(IN) :: GDZM (IJSDIM, KMAX+1 ) ! altitude REAL(r8), INTENT(IN) :: DELTA ! delta(t) (dynamics) REAL(r8), INTENT(IN) :: DELTI ! delta(t) (internal variable) diff --git a/physics/cs_conv_aw_adj.F90 b/physics/cs_conv_aw_adj.F90 index 756161d8c9..74cac91841 100644 --- a/physics/cs_conv_aw_adj.F90 +++ b/physics/cs_conv_aw_adj.F90 @@ -40,15 +40,15 @@ subroutine cs_conv_aw_adj_run(im, levs, do_cscnv, do_aw, do_shoc, & logical, intent(in) :: do_cscnv, do_aw, do_shoc integer, intent(in) :: ntrac, ncld, ntcw, ntclamt, nncl real(kind_phys), intent(in) :: con_g - real(kind_phys), dimension(im,levs), intent(inout) :: sigmafrac - real(kind_phys), dimension(im,levs), intent(inout) :: gt0 - real(kind_phys), dimension(im,levs,ntrac), intent(inout) :: gq0 - real(kind_phys), dimension(im,levs), intent(in) :: save_t - real(kind_phys), dimension(im,levs,ntrac), intent(in) :: save_q - real(kind_phys), dimension(im,levs+1), intent(in) :: prsi - real(kind_phys), dimension(im,levs), intent(inout) :: cldfrac - real(kind_phys), dimension(im,levs), intent(inout) :: subcldfrac - real(kind_phys), dimension(im), intent(inout) :: prcp + real(kind_phys), dimension(:,:), intent(inout) :: sigmafrac + real(kind_phys), dimension(:,:), intent(inout) :: gt0 + real(kind_phys), dimension(:,:,:), intent(inout) :: gq0 + real(kind_phys), dimension(:,:), intent(in) :: save_t + real(kind_phys), dimension(:,:,:), intent(in) :: save_q + real(kind_phys), dimension(:,:), intent(in) :: prsi + real(kind_phys), dimension(:,:), intent(inout) :: cldfrac + real(kind_phys), dimension(:,:), intent(inout) :: subcldfrac + real(kind_phys), dimension(:), intent(inout) :: prcp integer, intent(in ) :: imp_physics, imp_physics_mg character(len=*), intent( out) :: errmsg integer, intent( out) :: errflg diff --git a/physics/cu_gf_driver.F90 b/physics/cu_gf_driver.F90 index 5c43709d15..4b9e423a64 100644 --- a/physics/cu_gf_driver.F90 +++ b/physics/cu_gf_driver.F90 @@ -101,42 +101,42 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,cactiv, & logical, intent(in ) :: flag_for_scnv_generic_tend,flag_for_dcnv_generic_tend logical, intent(in ) :: ldiag3d,qdiag3d - real(kind=kind_phys), dimension( im , km ), intent(in ) :: forcet,forceqv_spechum,w,phil - real(kind=kind_phys), dimension( im , km ), intent(inout ) :: t,us,vs - real(kind=kind_phys), dimension( im , km ), intent(inout ) :: qci_conv + real(kind=kind_phys), dimension( :, :), intent(in ) :: forcet,forceqv_spechum,w,phil + real(kind=kind_phys), dimension( :, : ), intent(inout ) :: t,us,vs + real(kind=kind_phys), dimension( :, : ), intent(inout ) :: qci_conv real(kind=kind_phys), dimension( im ) :: rand_mom,rand_vmas - real(kind=kind_phys), dimension( im,4 ) :: rand_clos + real(kind=kind_phys), dimension( im,4 ) :: rand_clos real(kind=kind_phys), dimension( im , km, 11 ) :: gdc,gdc2 - real(kind=kind_phys), dimension( im , km ), intent(out ) :: cnvw_moist,cnvc - real(kind=kind_phys), dimension( im , km ), intent(inout ) :: cliw, clcw + real(kind=kind_phys), dimension( :, :), intent(out ) :: cnvw_moist,cnvc + real(kind=kind_phys), dimension( :, : ), intent(inout ) :: cliw, clcw real(kind=kind_phys), dimension( : , : ), intent(inout ) :: & du3dt_SCNV,dv3dt_SCNV,dt3dt_SCNV,dq3dt_SCNV, & du3dt_DCNV,dv3dt_DCNV,dt3dt_DCNV,dq3dt_DCNV - integer, dimension (im), intent(inout) :: hbot,htop,kcnv - integer, dimension (im), intent(in) :: xland - real(kind=kind_phys), dimension (im), intent(in) :: pbl + integer, dimension (:), intent(inout) :: hbot,htop,kcnv + integer, dimension (:), intent(in) :: xland + real(kind=kind_phys), dimension (:), intent(in) :: pbl integer, dimension (im) :: tropics ! ruc variable - real(kind=kind_phys), dimension (im) :: hfx2,qfx2,psuri - real(kind=kind_phys), dimension (im,km) :: ud_mf,dd_mf,dt_mf - real(kind=kind_phys), dimension (im), intent(inout) :: raincv,cld1d - real(kind=kind_phys), dimension (im,km) :: t2di,p2di + real(kind=kind_phys), dimension (:) :: hfx2,qfx2,psuri + real(kind=kind_phys), dimension (:,:) :: ud_mf,dd_mf,dt_mf + real(kind=kind_phys), dimension (:), intent(inout) :: raincv,cld1d + real(kind=kind_phys), dimension (:,:) :: t2di,p2di ! Specific humidity from FV3 - real(kind=kind_phys), dimension (im,km), intent(in) :: qv2di_spechum - real(kind=kind_phys), dimension (im,km), intent(inout) :: qv_spechum + real(kind=kind_phys), dimension (:,:), intent(in) :: qv2di_spechum + real(kind=kind_phys), dimension (:,:), intent(inout) :: qv_spechum ! Local water vapor mixing ratios and cloud water mixing ratios real(kind=kind_phys), dimension (im,km) :: qv2di, qv, forceqv, cnvw ! - real(kind=kind_phys), dimension( im ),intent(in) :: garea + real(kind=kind_phys), dimension( : ),intent(in) :: garea real(kind=kind_phys), intent(in ) :: dt integer, intent(in ) :: imfshalcnv character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg ! define locally for now. - integer, dimension(im),intent(inout) :: cactiv + integer, dimension(:),intent(inout) :: cactiv integer, dimension(im) :: k22_shallow,kbcon_shallow,ktop_shallow real(kind=kind_phys), dimension(im) :: ht real(kind=kind_phys), dimension(im) :: dx diff --git a/physics/cu_ntiedtke.F90 b/physics/cu_ntiedtke.F90 index a824c6af46..66ae9d056a 100644 --- a/physics/cu_ntiedtke.F90 +++ b/physics/cu_ntiedtke.F90 @@ -159,16 +159,16 @@ subroutine cu_ntiedtke_run(pu,pv,pt,pqv,tdi,qvdi,pqvf,ptf,clw,poz,pzz,prsl,prsi, ! in&out variables integer, intent(in) :: lq, km, ktrac real(kind=kind_phys), intent(in ) :: dt - integer, dimension( lq ), intent(in) :: lmask - real(kind=kind_phys), dimension( lq ), intent(in ) :: evap, hfx, dx - real(kind=kind_phys), dimension( lq , km ), intent(inout) :: pu, pv, pt, pqv - real(kind=kind_phys), dimension( lq , km ), intent(in ) :: tdi, qvdi, poz, prsl, pomg, pqvf, ptf - real(kind=kind_phys), dimension( lq , km+1 ), intent(in ) :: pzz, prsi - real(kind=kind_phys), dimension( lq , km, ktrac ), intent(inout ) :: clw - - integer, dimension( lq ), intent(out) :: kbot, ktop, kcnv - real(kind=kind_phys), dimension( lq ), intent(out) :: zprecc - real(kind=kind_phys), dimension (lq,km), intent(out) :: ud_mf, dd_mf, dt_mf, cnvw, cnvc + integer, dimension( : ), intent(in) :: lmask + real(kind=kind_phys), dimension( : ), intent(in ) :: evap, hfx, dx + real(kind=kind_phys), dimension( :, : ), intent(inout) :: pu, pv, pt, pqv + real(kind=kind_phys), dimension( :, :), intent(in ) :: tdi, qvdi, poz, prsl, pomg, pqvf, ptf + real(kind=kind_phys), dimension( :, : ), intent(in ) :: pzz, prsi + real(kind=kind_phys), dimension( :, :, : ), intent(inout ) :: clw + + integer, dimension( : ), intent(out) :: kbot, ktop, kcnv + real(kind=kind_phys), dimension( : ), intent(out) :: zprecc + real(kind=kind_phys), dimension (:, :), intent(out) :: ud_mf, dd_mf, dt_mf, cnvw, cnvc ! error messages character(len=*), intent(out) :: errmsg diff --git a/physics/dcyc2.f b/physics/dcyc2.f index 6dca65cf55..347639d969 100644 --- a/physics/dcyc2.f +++ b/physics/dcyc2.f @@ -216,36 +216,36 @@ subroutine dcyc2t3_run & ! integer, intent(in) :: ipr ! logical lprnt - logical, dimension(im), intent(in) :: dry, icy, wet + logical, dimension(:), intent(in) :: dry, icy, wet real(kind=kind_phys), intent(in) :: solhr, slag, cdec, sdec, & & deltim, fhswr - real(kind=kind_phys), dimension(im), intent(in) :: & + real(kind=kind_phys), dimension(:), intent(in) :: & & sinlat, coslat, xlon, coszen, tf, tsflw, sfcdlw, & & sfcdsw, sfcnsw - real(kind=kind_phys), dimension(im), intent(in) :: & + real(kind=kind_phys), dimension(:), intent(in) :: & & tsfc_lnd, tsfc_ice, tsfc_wat, & & sfcemis_lnd, sfcemis_ice, sfcemis_wat - real(kind=kind_phys), dimension(im), intent(in) :: & + real(kind=kind_phys), dimension(:), intent(in) :: & & sfcnirbmu, sfcnirdfu, sfcvisbmu, sfcvisdfu, & & sfcnirbmd, sfcnirdfd, sfcvisbmd, sfcvisdfd - real(kind=kind_phys), dimension(im,levs), intent(in) :: swh, hlw & + real(kind=kind_phys), dimension(:,:), intent(in) :: swh, hlw & &, swhc, hlwc ! --- input/output: - real(kind=kind_phys), dimension(im,levs), intent(inout) :: dtdt & + real(kind=kind_phys), dimension(:,:), intent(inout) :: dtdt & &, dtdtc ! --- outputs: - real(kind=kind_phys), dimension(im), intent(out) :: & + real(kind=kind_phys), dimension(:), intent(out) :: & & adjsfcdsw, adjsfcnsw, adjsfcdlw, xmu, xcosz, & & adjnirbmu, adjnirdfu, adjvisbmu, adjvisdfu, & & adjnirbmd, adjnirdfd, adjvisbmd, adjvisdfd - real(kind=kind_phys), dimension(im), intent(out) :: & + real(kind=kind_phys), dimension(:), intent(out) :: & & adjsfculw_lnd, adjsfculw_ice, adjsfculw_wat character(len=*), intent(out) :: errmsg diff --git a/physics/drag_suite.F90 b/physics/drag_suite.F90 index 55ef9c268e..050d635969 100644 --- a/physics/drag_suite.F90 +++ b/physics/drag_suite.F90 @@ -298,8 +298,8 @@ subroutine drag_suite_run( & integer, intent(in) :: im, km, imx, kdt, ipr, me, master integer, intent(in) :: gwd_opt logical, intent(in) :: lprnt - integer, intent(in) :: KPBL(im) - real(kind=kind_phys), intent(in) :: deltim, G, CP, RD, RV, cdmbgwd(2) + integer, intent(in) :: KPBL(:) + real(kind=kind_phys), intent(in) :: deltim, G, CP, RD, RV, cdmbgwd(:) integer :: kpblmax integer, parameter :: ims=1, kms=1, its=1, kts=1 @@ -308,29 +308,29 @@ subroutine drag_suite_run( & real(kind=kind_phys) :: g_inv real(kind=kind_phys), intent(inout) :: & - & dudt(im,km),dvdt(im,km), & - & dtdt(im,km) - real(kind=kind_phys), intent(out) :: rdxzb(im) + & dudt(:,:),dvdt(:,:), & + & dtdt(:,:) + real(kind=kind_phys), intent(out) :: rdxzb(:) real(kind=kind_phys), intent(in) :: & - & u1(im,km),v1(im,km), & - & t1(im,km),q1(im,km), & - & PHII(im,km+1),prsl(im,km), & - & prslk(im,km),PHIL(im,km) - real(kind=kind_phys), intent(in) :: prsi(im,km+1), & - & del(im,km) - real(kind=kind_phys), intent(in) :: var(im),oc1(im), & - & oa4(im,4),ol4(im,4), & - & dx(im) - real(kind=kind_phys), intent(in) :: varss(im),oc1ss(im), & - & oa4ss(im,4),ol4ss(im,4) - real(kind=kind_phys), intent(in) :: THETA(im),SIGMA(im), & - & GAMMA(im),ELVMAX(im) + & u1(:,:),v1(:,:), & + & t1(:,:),q1(:,:), & + & PHII(:,:),prsl(:,:), & + & prslk(:,:),PHIL(:,:) + real(kind=kind_phys), intent(in) :: prsi(:,:), & + & del(:,:) + real(kind=kind_phys), intent(in) :: var(:),oc1(:), & + & oa4(:,:),ol4(:,:), & + & dx(:) + real(kind=kind_phys), intent(in) :: varss(:),oc1ss(:), & + & oa4ss(:,:),ol4ss(:,:) + real(kind=kind_phys), intent(in) :: THETA(:),SIGMA(:), & + & GAMMA(:),ELVMAX(:) ! added for small-scale orographic wave drag real(kind=kind_phys), dimension(im,km) :: utendwave,vtendwave,thx,thvx - real(kind=kind_phys), intent(in) :: br1(im), & - & hpbl(im), & - & slmsk(im) + real(kind=kind_phys), intent(in) :: br1(:), & + & hpbl(:), & + & slmsk(:) real(kind=kind_phys), dimension(im) :: govrth,xland !real(kind=kind_phys), dimension(im,km) :: dz2 real(kind=kind_phys) :: tauwavex0,tauwavey0, & @@ -344,7 +344,7 @@ subroutine drag_suite_run( & !Output: real(kind=kind_phys), intent(out) :: & - & dusfc(im), dvsfc(im) + & dusfc(:), dvsfc(:) !Output (optional): real(kind=kind_phys), intent(out) :: & & dusfc_ls(:),dvsfc_ls(:), & diff --git a/physics/flake_driver.F90 b/physics/flake_driver.F90 index b882c74041..a1edf69b1f 100644 --- a/physics/flake_driver.F90 +++ b/physics/flake_driver.F90 @@ -81,21 +81,21 @@ SUBROUTINE flake_driver_run ( & integer, intent(in) :: im, imon,yearlen ! integer, dimension(im), intent(in) :: islmsk - real (kind=kind_phys), dimension(im), intent(in) :: ps, wind, & + real (kind=kind_phys), dimension(:), intent(in) :: ps, wind, & & t1, q1, dlwflx, dswsfc, zlvl, elev real (kind=kind_phys), intent(in) :: delt - real (kind=kind_phys), dimension(im), intent(in) :: & + real (kind=kind_phys), dimension(:), intent(in) :: & & xlat, weasd, lakedepth - real (kind=kind_phys),dimension(im),intent(inout) :: & + real (kind=kind_phys),dimension(:),intent(inout) :: & & snwdph, hice, tsurf, t_sfc, hflx, evap, fice, ustar, qsfc, & & ch, cm, chh, cmm real (kind=kind_phys), intent(in) :: julian - logical, dimension(im), intent(in) :: flag_iter, wet, lake + logical, dimension(:), intent(in) :: flag_iter, wet, lake character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/gcm_shoc.F90 b/physics/gcm_shoc.F90 index dd7791e189..3d98a5dfbe 100644 --- a/physics/gcm_shoc.F90 +++ b/physics/gcm_shoc.F90 @@ -35,12 +35,12 @@ subroutine shoc_run (nx, nzm, tcr, tcrf, con_cp, con_g, con_hvap, con_hfus, con_ real(kind=kind_phys), intent(in) :: tcr, tcrf, con_cp, con_g, con_hvap, con_hfus, con_rv, con_rd, con_pi, con_fvirt, & dtp, supice, pcrit, cefac, cesfac, tkef1, dis_opt ! - real(kind=kind_phys), intent(in), dimension(nx) :: hflx, evap - real(kind=kind_phys), intent(in), dimension(nx,nzm) :: prsl, delp, phil, u, v, omega, rhc, prnum - real(kind=kind_phys), intent(in), dimension(nx,nzm+1) :: phii + real(kind=kind_phys), intent(in), dimension(:) :: hflx, evap + real(kind=kind_phys), intent(in), dimension(:,:) :: prsl, delp, phil, u, v, omega, rhc, prnum + real(kind=kind_phys), intent(in), dimension(:,:) :: phii ! - real(kind=kind_phys), intent(inout), dimension(nx,nzm) :: gt0, cld_sgs, tke, tkh, wthv_sec - real(kind=kind_phys), intent(inout), dimension(nx,nzm,ntrac) :: gq0 + real(kind=kind_phys), intent(inout), dimension(:,:) :: gt0, cld_sgs, tke, tkh, wthv_sec + real(kind=kind_phys), intent(inout), dimension(:,:,:) :: gq0 character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -1724,7 +1724,7 @@ end subroutine assumed_pdf real function esatw(t) - real t ! temperature (K) + real t ! temperature (K) real a0,a1,a2,a3,a4,a5,a6,a7,a8 data a0,a1,a2,a3,a4,a5,a6,a7,a8 / & 6.11239921, 0.443987641, 0.142986287e-1, & @@ -1737,8 +1737,8 @@ end function esatw real function qsatw(t,p) ! implicit none - real t ! temperature (K) - real p ! pressure (Pa) + real t ! temperature (K) + real p ! pressure (Pa) real esat ! esat = fpvs(t) esat = fpvsl(t) @@ -1749,7 +1749,7 @@ end function qsatw real function esati(t) - real t ! temperature (K) + real t ! temperature (K) real a0,a1,a2,a3,a4,a5,a6,a7,a8 data a0,a1,a2,a3,a4,a5,a6,a7,a8 / & 6.11147274, 0.503160820, 0.188439774e-1, & @@ -1769,8 +1769,8 @@ real function esati(t) end function esati real function qsati(t,p) - real t ! temperature (K) - real p ! pressure (Pa) + real t ! temperature (K) + real p ! pressure (Pa) real esat !,esati ! esat = fpvs(t) esat = fpvsi(t) @@ -1780,7 +1780,7 @@ real function qsati(t,p) end function qsati real function dtesatw(t) - real t ! temperature (K) + real t ! temperature (K) real a0,a1,a2,a3,a4,a5,a6,a7,a8 data a0,a1,a2,a3,a4,a5,a6,a7,a8 / & 0.443956472, 0.285976452e-1, 0.794747212e-3, & @@ -1792,14 +1792,14 @@ real function dtesatw(t) end function dtesatw real function dtqsatw(t,p) - real t ! temperature (K) - real p ! pressure (Pa) + real t ! temperature (K) + real p ! pressure (Pa) ! real dtesatw dtqsatw = 100.0*0.622*dtesatw(t)/p end function dtqsatw real function dtesati(t) - real t ! temperature (K) + real t ! temperature (K) real a0,a1,a2,a3,a4,a5,a6,a7,a8 data a0,a1,a2,a3,a4,a5,a6,a7,a8 / & 0.503223089, 0.377174432e-1, 0.126710138e-2, & @@ -1820,8 +1820,8 @@ end function dtesati real function dtqsati(t,p) - real t ! temperature (K) - real p ! pressure (Pa) + real t ! temperature (K) + real p ! pressure (Pa) ! real dtesati dtqsati = 100.0*0.622*dtesati(t)/p end function dtqsati diff --git a/physics/get_prs_fv3.F90 b/physics/get_prs_fv3.F90 index 352a618956..e520c3e0d9 100644 --- a/physics/get_prs_fv3.F90 +++ b/physics/get_prs_fv3.F90 @@ -28,12 +28,12 @@ subroutine get_prs_fv3_run(ix, levs, phii, prsi, tgrs, qgrs1, del, del_gz, errms ! Interface variables integer, intent(in) :: ix, levs - real(kind=kind_phys), dimension(ix,levs+1), intent(in) :: phii - real(kind=kind_phys), dimension(ix,levs+1), intent(in) :: prsi - real(kind=kind_phys), dimension(ix,levs), intent(in) :: tgrs - real(kind=kind_phys), dimension(ix,levs), intent(in) :: qgrs1 - real(kind=kind_phys), dimension(ix,levs), intent(out) :: del - real(kind=kind_phys), dimension(ix,levs+1), intent(out) :: del_gz + real(kind=kind_phys), dimension(:,:), intent(in) :: phii + real(kind=kind_phys), dimension(:,:), intent(in) :: prsi + real(kind=kind_phys), dimension(:,:), intent(in) :: tgrs + real(kind=kind_phys), dimension(:,:), intent(in) :: qgrs1 + real(kind=kind_phys), dimension(:,:), intent(out) :: del + real(kind=kind_phys), dimension(:,:), intent(out) :: del_gz character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -97,11 +97,11 @@ subroutine get_phi_fv3_run(ix, levs, gt0, gq01, del_gz, phii, phil, errmsg, errf ! Interface variables integer, intent(in) :: ix, levs - real(kind=kind_phys), dimension(ix,levs), intent(in) :: gt0 - real(kind=kind_phys), dimension(ix,levs), intent(in) :: gq01 - real(kind=kind_phys), dimension(ix,levs+1), intent(inout) :: del_gz - real(kind=kind_phys), dimension(ix,levs+1), intent(out) :: phii - real(kind=kind_phys), dimension(ix,levs), intent(out) :: phil + real(kind=kind_phys), dimension(:,:), intent(in) :: gt0 + real(kind=kind_phys), dimension(:,:), intent(in) :: gq01 + real(kind=kind_phys), dimension(:,:), intent(inout) :: del_gz + real(kind=kind_phys), dimension(:,:), intent(out) :: phii + real(kind=kind_phys), dimension(:,:), intent(out) :: phil character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/gfdl_cloud_microphys.F90 b/physics/gfdl_cloud_microphys.F90 index 1ccedb9565..de1e0ef6fa 100644 --- a/physics/gfdl_cloud_microphys.F90 +++ b/physics/gfdl_cloud_microphys.F90 @@ -135,29 +135,29 @@ subroutine gfdl_cloud_microphys_run( & ! interface variables integer, intent(in ) :: levs, im real(kind=kind_phys), intent(in ) :: con_g, con_fvirt, con_rd - real(kind=kind_phys), intent(in ), dimension(1:im) :: frland, garea - integer, intent(in ), dimension(1:im) :: islmsk - real(kind=kind_phys), intent(inout), dimension(1:im,1:levs) :: gq0, gq0_ntcw, gq0_ntrw, gq0_ntiw, & + real(kind=kind_phys), intent(in ), dimension(:) :: frland, garea + integer, intent(in ), dimension(:) :: islmsk + real(kind=kind_phys), intent(inout), dimension(:,:) :: gq0, gq0_ntcw, gq0_ntrw, gq0_ntiw, & gq0_ntsw, gq0_ntgl, gq0_ntclamt - real(kind=kind_phys), intent(inout), dimension(1:im,1:levs) :: gt0, gu0, gv0 - real(kind=kind_phys), intent(in ), dimension(1:im,1:levs) :: vvl, prsl, del - real(kind=kind_phys), intent(in ), dimension(1:im,1:levs+1) :: phii + real(kind=kind_phys), intent(inout), dimension(:,:) :: gt0, gu0, gv0 + real(kind=kind_phys), intent(in ), dimension(:,:) :: vvl, prsl, del + real(kind=kind_phys), intent(in ), dimension(:,:) :: phii ! rain/snow/ice/graupel/precip amounts, fraction of frozen precip - real(kind_phys), intent(out ), dimension(1:im) :: rain0 - real(kind_phys), intent(out ), dimension(1:im) :: snow0 - real(kind_phys), intent(out ), dimension(1:im) :: ice0 - real(kind_phys), intent(out ), dimension(1:im) :: graupel0 - real(kind_phys), intent(out ), dimension(1:im) :: prcp0 - real(kind_phys), intent(out ), dimension(1:im) :: sr + real(kind_phys), intent(out ), dimension(:) :: rain0 + real(kind_phys), intent(out ), dimension(:) :: snow0 + real(kind_phys), intent(out ), dimension(:) :: ice0 + real(kind_phys), intent(out ), dimension(:) :: graupel0 + real(kind_phys), intent(out ), dimension(:) :: prcp0 + real(kind_phys), intent(out ), dimension(:) :: sr real(kind_phys), intent(in) :: dtp ! physics time step logical, intent (in) :: hydrostatic, phys_hydrostatic logical, intent (in) :: lradar - real(kind=kind_phys), intent(inout), dimension(1:im,1:levs) :: refl_10cm + real(kind=kind_phys), intent(inout), dimension(:,:) :: refl_10cm logical, intent (in) :: reset, effr_in - real(kind=kind_phys), intent(inout), dimension(1:im,1:levs) :: rew, rei, rer, res, reg + real(kind=kind_phys), intent(inout), dimension(:,:) :: rew, rei, rer, res, reg character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/gfdl_fv_sat_adj.F90 b/physics/gfdl_fv_sat_adj.F90 index 816488f7a0..5cc3c91364 100644 --- a/physics/gfdl_fv_sat_adj.F90 +++ b/physics/gfdl_fv_sat_adj.F90 @@ -128,8 +128,8 @@ subroutine fv_sat_adj_init(do_sat_adj, kmp, nwat, ngas, rilist, cpilist, & integer, intent(in ) :: kmp integer, intent(in ) :: nwat integer, intent(in ) :: ngas - real(kind_dyn), intent(in ) :: rilist(0:ngas) - real(kind_dyn), intent(in ) :: cpilist(0:ngas) + real(kind_dyn), intent(in ) :: rilist(:) + real(kind_dyn), intent(in ) :: cpilist(:) integer, intent(in ) :: mpirank integer, intent(in ) :: mpiroot character(len=*), intent( out) :: errmsg diff --git a/physics/gfdl_fv_sat_adj.F90_assumedsizes b/physics/gfdl_fv_sat_adj.F90_assumedsizes new file mode 100644 index 0000000000..c48a5d2e8e --- /dev/null +++ b/physics/gfdl_fv_sat_adj.F90_assumedsizes @@ -0,0 +1,1431 @@ +!>\file gfdl_fv_sat_adj.F90 +!! This file contains the GFDL in-core fast saturation adjustment. +!! and it is an "intermediate physics" implemented in the remapping Lagrangian to +!! Eulerian loop of FV3 solver. +!*********************************************************************** +!* GNU Lesser General Public License +!* +!* This file is part of the GFDL Cloud Microphysics. +!* +!* The GFDL Cloud Microphysics is free software: you can +!8 redistribute it and/or modify it under the terms of the +!* GNU Lesser General Public License as published by the +!* Free Software Foundation, either version 3 of the License, or +!* (at your option) any later version. +!* +!* The GFDL Cloud Microphysics is distributed in the hope it will be +!* useful, but WITHOUT ANYWARRANTY; without even the implied warranty +!* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +!* See the GNU General Public License for more details. +!* +!* You should have received a copy of the GNU Lesser General Public +!* License along with the GFDL Cloud Microphysics. +!* If not, see . +!*********************************************************************** + +!> This module contains the GFDL in-core fast saturation adjustment +!! called in FV3 dynamics solver. +module fv_sat_adj +! Modules Included: +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +! +!
Module NameFunctions Included
constants_modrvgas, rdgas, grav, hlv, hlf, cp_air
fv_arrays_mod r_grid
fv_mp_modis_master
gfdl_cloud_microphys_modql_gen, qi_gen, qi0_max, ql_mlt, ql0_max, qi_lim, qs_mlt, +! tau_r2g, tau_smlt, tau_i2s, tau_v2l, tau_l2v, tau_imlt, tau_l2r, +! rad_rain, rad_snow, rad_graupel, dw_ocean, dw_land, tintqs
+ ! DH* TODO - MAKE THIS INPUT ARGUMENTS *DH + use physcons, only : rdgas => con_rd_dyn, & + rvgas => con_rv_dyn, & + grav => con_g_dyn, & + hlv => con_hvap_dyn, & + hlf => con_hfus_dyn, & + cp_air => con_cp_dyn + ! *DH + use machine, only: kind_grid, kind_dyn + use gfdl_cloud_microphys_mod, only: ql_gen, qi_gen, qi0_max, ql_mlt, ql0_max, qi_lim, qs_mlt + use gfdl_cloud_microphys_mod, only: icloud_f, sat_adj0, t_sub, cld_min + use gfdl_cloud_microphys_mod, only: tau_r2g, tau_smlt, tau_i2s, tau_v2l, tau_l2v, tau_imlt, tau_l2r + use gfdl_cloud_microphys_mod, only: rad_rain, rad_snow, rad_graupel, dw_ocean, dw_land, tintqs +#ifdef MULTI_GASES + use ccpp_multi_gases_mod, only: multi_gases_init, & + multi_gases_finalize, & + virq_qpz, vicpqd_qpz, & + vicvqd_qpz, num_gas +#endif + + implicit none + + private + + public fv_sat_adj_init, fv_sat_adj_run, fv_sat_adj_finalize + + logical :: is_initialized = .false. + + real(kind=kind_dyn), parameter :: rrg = -rdgas/grav + ! real, parameter :: cp_air = cp_air ! 1004.6, heat capacity of dry air at constant pressure, come from constants_mod + real(kind=kind_dyn), parameter :: cp_vap = 4.0 * rvgas !< 1846.0, heat capacity of water vapor at constant pressure + real(kind=kind_dyn), parameter :: cv_air = cp_air - rdgas !< 717.55, heat capacity of dry air at constant volume + real(kind=kind_dyn), parameter :: cv_vap = 3.0 * rvgas !< 1384.5, heat capacity of water vapor at constant volume + ! http: / / www.engineeringtoolbox.com / ice - thermal - properties - d_576.html + ! c_ice = 2050.0 at 0 deg c + ! c_ice = 1972.0 at - 15 deg c + ! c_ice = 1818.0 at - 40 deg c + ! http: / / www.engineeringtoolbox.com / water - thermal - properties - d_162.html + ! c_liq = 4205.0 at 4 deg c + ! c_liq = 4185.5 at 15 deg c + ! c_liq = 4178.0 at 30 deg c + ! real, parameter :: c_ice = 2106.0 ! ifs: heat capacity of ice at 0 deg c + ! real, parameter :: c_liq = 4218.0 ! ifs: heat capacity of liquid at 0 deg c + real(kind=kind_dyn), parameter :: c_ice = 1972.0 !< gfdl: heat capacity of ice at - 15 deg c + real(kind=kind_dyn), parameter :: c_liq = 4185.5 !< gfdl: heat capacity of liquid at 15 deg c + real(kind=kind_dyn), parameter :: dc_vap = cp_vap - c_liq !< - 2339.5, isobaric heating / cooling + real(kind=kind_dyn), parameter :: dc_ice = c_liq - c_ice !< 2213.5, isobaric heating / colling + real(kind=kind_dyn), parameter :: tice = 273.16 !< freezing temperature + real(kind=kind_dyn), parameter :: t_wfr = tice - 40. !< homogeneous freezing temperature + real(kind=kind_dyn), parameter :: lv0 = hlv - dc_vap * tice !< 3.13905782e6, evaporation latent heat coefficient at 0 deg k + real(kind=kind_dyn), parameter :: li00 = hlf - dc_ice * tice !< - 2.7105966e5, fusion latent heat coefficient at 0 deg k + ! real (kind_grid), parameter :: e00 = 610.71 ! gfdl: saturation vapor pressure at 0 deg c + real (kind_grid), parameter :: e00 = 611.21 !< ifs: saturation vapor pressure at 0 deg c + real (kind_grid), parameter :: d2ice = dc_vap + dc_ice !< - 126, isobaric heating / cooling + real (kind_grid), parameter :: li2 = lv0 + li00 !< 2.86799816e6, sublimation latent heat coefficient at 0 deg k + real(kind=kind_dyn), parameter :: lat2 = (hlv + hlf) ** 2 !< used in bigg mechanism + real(kind=kind_dyn) :: d0_vap !< the same as dc_vap, except that cp_vap can be cp_vap or cv_vap + real(kind=kind_dyn) :: lv00 !< the same as lv0, except that cp_vap can be cp_vap or cv_vap + real(kind=kind_dyn), allocatable :: table (:), table2 (:), tablew (:), des2 (:), desw (:) + +contains + +!>\brief The subroutine 'fv_sat_adj_init' initializes lookup tables for the saturation mixing ratio. +!! \section arg_table_fv_sat_adj_init Argument Table +!! \htmlinclude fv_sat_adj_init.html +!! +subroutine fv_sat_adj_init(do_sat_adj, kmp, nwat, ngas, rilist, cpilist, & + mpirank, mpiroot, errmsg, errflg) + + implicit none + + ! Interface variables + logical, intent(in ) :: do_sat_adj + integer, intent(in ) :: kmp + integer, intent(in ) :: nwat + integer, intent(in ) :: ngas + real(kind_dyn), intent(in ) :: rilist(:) + real(kind_dyn), intent(in ) :: cpilist(:) + integer, intent(in ) :: mpirank + integer, intent(in ) :: mpiroot + character(len=*), intent( out) :: errmsg + integer, intent( out) :: errflg + + ! Local variables + integer, parameter :: length = 2621 + integer :: i + + ! Initialize the CCPP error handling variables + errmsg = '' + errflg = 0 + + ! If saturation adjustment is not used, return immediately + if (.not.do_sat_adj) then + write(errmsg,'(a)') 'Logic error: fv_sat_adj_init is called but do_sat_adj is set to false' + errflg = 1 + return + end if + + if (.not.nwat==6) then + write(errmsg,'(a)') 'Logic error: fv_sat_adj requires six water species (nwat=6)' + errflg = 1 + return + end if + + if (is_initialized) return + + ! generate es table (dt = 0.1 deg c) + + allocate (table (length)) + allocate (table2 (length)) + allocate (tablew (length)) + allocate (des2 (length)) + allocate (desw (length)) + + call qs_table (length) + call qs_table2 (length) + call qs_tablew (length) + + do i = 1, length - 1 + des2 (i) = max (0., table2 (i + 1) - table2 (i)) + desw (i) = max (0., tablew (i + 1) - tablew (i)) + enddo + des2 (length) = des2 (length - 1) + desw (length) = desw (length - 1) + +#ifdef MULTI_GASES + call multi_gases_init(ngas,nwat,rilist,cpilist,mpirank==mpiroot) +#endif + + is_initialized = .true. + +end subroutine fv_sat_adj_init + +!\ingroup fast_sat_adj +!>\brief The subroutine 'fv_sat_adj_finalize' deallocates lookup tables for the saturation mixing ratio. +!! \section arg_table_fv_sat_adj_finalize Argument Table +!! \htmlinclude fv_sat_adj_finalize.html +!! +subroutine fv_sat_adj_finalize (errmsg, errflg) + + implicit none + + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + ! Initialize the CCPP error handling variables + errmsg = '' + errflg = 0 + + if (.not.is_initialized) return + + if (allocated(table )) deallocate(table ) + if (allocated(table2)) deallocate(table2) + if (allocated(tablew)) deallocate(tablew) + if (allocated(des2 )) deallocate(des2 ) + if (allocated(desw )) deallocate(desw ) + +#ifdef MULTI_GASES + call multi_gases_finalize() +#endif + + is_initialized = .false. + +end subroutine fv_sat_adj_finalize + +!>\defgroup fast_sat_adj GFDL In-Core Fast Saturation Adjustment Module +!> @{ +!! The subroutine 'fv_sat_adj' implements the fast processes in the GFDL +!! Cloud MP. It is part of the GFDL Cloud MP. +!>\author Shian-Jiann Lin, Linjiong Zhou +!! +!>\brief The subroutine 'fv_sat_adj' performs the fast processes in the GFDL microphysics. +!>\details This is designed for single-moment 6-class cloud microphysics schemes. +!! It handles the heat release due to in situ phase changes. +!! +!! \section arg_table_fv_sat_adj_run Argument Table +!! \htmlinclude fv_sat_adj_run.html +!! +subroutine fv_sat_adj_run(mdt, zvir, is, ie, isd, ied, kmp, km, kmdelz, js, je, jsd, jed, & + ng, hydrostatic, fast_mp_consv, te0_2d, te0, ngas, qvi, qv, ql, qi, qr, & + qs, qg, hs, peln, delz, delp, pt, pkz, q_con, akap, cappa, area, dtdt, & + out_dt, last_step, do_qa, qa, & + nthreads, errmsg, errflg) + + implicit none + + ! Interface variables + real(kind=kind_dyn), intent(in) :: mdt + real(kind=kind_dyn), intent(in) :: zvir + integer, intent(in) :: is + integer, intent(in) :: ie + integer, intent(in) :: isd + integer, intent(in) :: ied + integer, intent(in) :: kmp + integer, intent(in) :: km + integer, intent(in) :: kmdelz + integer, intent(in) :: js + integer, intent(in) :: je + integer, intent(in) :: jsd + integer, intent(in) :: jed + integer, intent(in) :: ng + logical, intent(in) :: hydrostatic + logical, intent(in) :: fast_mp_consv + real(kind=kind_dyn), intent(inout) :: te0_2d(:,:) + real(kind=kind_dyn), intent( out) :: te0(isd:ied, jsd:jed, 1:km) + ! If multi-gases physics are not used, ngas is one and qvi identical to qv + integer, intent(in) :: ngas + real(kind=kind_dyn), intent(inout) :: qvi(:,:,:, :) + real(kind=kind_dyn), intent(inout) :: qv(isd:ied, jsd:jed, 1:km) + real(kind=kind_dyn), intent(inout) :: ql(isd:ied, jsd:jed, 1:km) + real(kind=kind_dyn), intent(inout) :: qi(isd:ied, jsd:jed, 1:km) + real(kind=kind_dyn), intent(inout) :: qr(isd:ied, jsd:jed, 1:km) + real(kind=kind_dyn), intent(inout) :: qs(isd:ied, jsd:jed, 1:km) + real(kind=kind_dyn), intent(inout) :: qg(isd:ied, jsd:jed, 1:km) + real(kind=kind_dyn), intent(in) :: hs(isd:ied, jsd:jed) + real(kind=kind_dyn), intent(in) :: peln(:,:,:) + ! For hydrostatic build, kmdelz=1, otherwise kmdelz=km (see fv_arrays.F90) + real(kind=kind_dyn), intent(in) :: delz(:,:,:) + real(kind=kind_dyn), intent(in) :: delp(:,:,:) + real(kind=kind_dyn), intent(inout) :: pt(isd:ied, jsd:jed, 1:km) + real(kind=kind_dyn), intent(inout) :: pkz(:,:,:) +#ifdef USE_COND + real(kind=kind_dyn), intent(inout) :: q_con(:,:,:) +#else + real(kind=kind_dyn), intent(inout) :: q_con(:,:,:) +#endif + real(kind=kind_dyn), intent(in) :: akap +#ifdef MOIST_CAPPA + real(kind=kind_dyn), intent(inout) :: cappa(:,:,:) +#else + real(kind=kind_dyn), intent(inout) :: cappa(:,:,:) +#endif + ! DH* WARNING, allocation in fv_arrays.F90 is area(isd_2d:ied_2d, jsd_2d:jed_2d), + ! where normally isd_2d = isd etc, but for memory optimization, these can be set + ! to isd_2d=0, ied_2d=-1 etc. I don't believe this optimization is actually used, + ! as it would break a whole lot of code (including the one below)! + ! Assume thus that isd_2d = isd etc. + real(kind_grid), intent(in) :: area(:,:) + real(kind=kind_dyn), intent(inout) :: dtdt(is:ie, js:je, 1:km) + logical, intent(in) :: out_dt + logical, intent(in) :: last_step + logical, intent(in) :: do_qa + real(kind=kind_dyn), intent( out) :: qa(isd:ied, jsd:jed, 1:km) + integer, intent(in) :: nthreads + character(len=*), intent( out) :: errmsg + integer, intent( out) :: errflg + + ! Local variables + real(kind=kind_dyn), dimension(is:ie,js:je) :: dpln + integer :: kdelz + integer :: k, j, i + + ! Initialize the CCPP error handling variables + errmsg = '' + errflg = 0 + +#ifndef FV3 +! Open parallel region if not already opened by host model +!$OMP parallel num_threads(nthreads) default(none) & +!$OMP shared(kmp,km,js,je,is,ie,peln,mdt, & +!$OMP isd,jsd,delz,q_con,cappa,qa, & +!$OMP do_qa,last_step,out_dt,dtdt, & +!$OMP area,delp,pt,hs,qg,qs,qr,qi, & +!$OMP ql,qv,te0,fast_mp_consv, & +!$OMP hydrostatic,ng,zvir,pkz, & +!$OMP akap,te0_2d,ngas,qvi) & +!$OMP private(k,j,i,kdelz,dpln) +#endif + +!$OMP do + do k=kmp,km + do j=js,je + do i=is,ie + dpln(i,j) = peln(i,k+1,j) - peln(i,k,j) + enddo + enddo + if (hydrostatic) then + kdelz = 1 + else + kdelz = k + end if + call fv_sat_adj_work(abs(mdt), zvir, is, ie, js, je, ng, hydrostatic, fast_mp_consv, & + te0(isd,jsd,k), & +#ifdef MULTI_GASES + qvi(isd,jsd,k,1:ngas), & +#else + qv(isd,jsd,k), & +#endif + ql(isd,jsd,k), qi(isd,jsd,k), & + qr(isd,jsd,k), qs(isd,jsd,k), qg(isd,jsd,k), & + hs, dpln, delz(is:,js:,kdelz), pt(isd,jsd,k), delp(isd,jsd,k),& + q_con(isd:,jsd:,k), cappa(isd:,jsd:,k), area, dtdt(is,js,k), & + out_dt, last_step, do_qa, qa(isd,jsd,k)) + if ( .not. hydrostatic ) then + do j=js,je + do i=is,ie +#ifdef MOIST_CAPPA + pkz(i,j,k) = exp(cappa(i,j,k)*log(rrg*delp(i,j,k)/delz(i,j,k)*pt(i,j,k))) +#else +#ifdef MULTI_GASES + pkz(i,j,k) = exp(akap*(virqd(q(i,j,k,1:num_gas))/vicpqd(q(i,j,k,1:num_gas))*log(rrg*delp(i,j,k)/delz(i,j,k)*pt(i,j,k))) +#else + pkz(i,j,k) = exp(akap*log(rrg*delp(i,j,k)/delz(i,j,k)*pt(i,j,k))) +#endif +#endif + enddo + enddo + endif + enddo +!$OMP end do + + if ( fast_mp_consv ) then +!$OMP do + do j=js,je + do i=is,ie + do k=kmp,km + te0_2d(i,j) = te0_2d(i,j) + te0(i,j,k) + enddo + enddo + enddo +!$OMP end do + endif + +#ifndef FV3 +!$OMP end parallel +#endif + + return + +end subroutine fv_sat_adj_run + +!>\ingroup fast_sat_adj +!> This subroutine includes the entity of the fast saturation adjustment processes. +!>\section fast_gen GFDL Cloud Fast Physics General Algorithm +!> @{ +subroutine fv_sat_adj_work(mdt, zvir, is, ie, js, je, ng, hydrostatic, consv_te, te0, & +#ifdef MULTI_GASES + qvi, & +#else + qv, & +#endif + ql, qi, qr, qs, qg, hs, dpln, delz, pt, dp, q_con, cappa, & + area, dtdt, out_dt, last_step, do_qa, qa) + + implicit none + + ! Interface variables + integer, intent (in) :: is, ie, js, je, ng + logical, intent (in) :: hydrostatic, consv_te, out_dt, last_step, do_qa + real(kind=kind_dyn), intent (in) :: zvir, mdt ! remapping time step + real(kind=kind_dyn), intent (in), dimension (is - ng:ie + ng, js - ng:je + ng) :: dp, hs + real(kind=kind_dyn), intent (in), dimension (is:ie, js:je) :: dpln, delz + real(kind=kind_dyn), intent (inout), dimension (is - ng:ie + ng, js - ng:je + ng) :: pt +#ifdef MULTI_GASES + real(kind=kind_dyn), intent (inout), dimension (is - ng:ie + ng, js - ng:je + ng, 1:1, 1:num_gas) :: qvi +#else + real(kind=kind_dyn), intent (inout), dimension (is - ng:ie + ng, js - ng:je + ng) :: qv +#endif + real(kind=kind_dyn), intent (inout), dimension (is - ng:ie + ng, js - ng:je + ng) :: ql, qi, qr, qs, qg + real(kind=kind_dyn), intent (inout), dimension (is - ng:ie + ng, js - ng:je + ng) :: q_con, cappa + real(kind=kind_dyn), intent (inout), dimension (is:ie, js:je) :: dtdt + real(kind=kind_dyn), intent (out), dimension (is - ng:ie + ng, js - ng:je + ng) :: qa, te0 + real (kind_grid), intent (in), dimension (is - ng:ie + ng, js - ng:je + ng) :: area + + ! Local variables +#ifdef MULTI_GASES + real, dimension (is - ng:ie + ng, js - ng:je + ng) :: qv +#endif + real(kind=kind_dyn), dimension (is:ie) :: wqsat, dq2dt, qpz, cvm, t0, pt1, qstar + real(kind=kind_dyn), dimension (is:ie) :: icp2, lcp2, tcp2, tcp3 + real(kind=kind_dyn), dimension (is:ie) :: den, q_liq, q_sol, q_cond, src, sink, hvar + real(kind=kind_dyn), dimension (is:ie) :: mc_air, lhl, lhi + real(kind=kind_dyn) :: qsw, rh + real(kind=kind_dyn) :: tc, qsi, dqsdt, dq, dq0, pidep, qi_crt, tmp, dtmp + real(kind=kind_dyn) :: tin, rqi, q_plus, q_minus + real(kind=kind_dyn) :: sdt, dt_bigg, adj_fac + real(kind=kind_dyn) :: fac_smlt, fac_r2g, fac_i2s, fac_imlt, fac_l2r, fac_v2l, fac_l2v + real(kind=kind_dyn) :: factor, qim, tice0, c_air, c_vap, dw + integer :: i, j + +#ifdef MULTI_GASES + qv(:,:) = qvi(:,:,1,1) +#endif + sdt = 0.5 * mdt ! half remapping time step + dt_bigg = mdt ! bigg mechinism time step + + tice0 = tice - 0.01 ! 273.15, standard freezing temperature + + ! ----------------------------------------------------------------------- + !> - Define conversion scalar / factor. + ! ----------------------------------------------------------------------- + + fac_i2s = 1. - exp (- mdt / tau_i2s) + fac_v2l = 1. - exp (- sdt / tau_v2l) + fac_r2g = 1. - exp (- mdt / tau_r2g) + fac_l2r = 1. - exp (- mdt / tau_l2r) + + fac_l2v = 1. - exp (- sdt / tau_l2v) + fac_l2v = min (sat_adj0, fac_l2v) + + fac_imlt = 1. - exp (- sdt / tau_imlt) + fac_smlt = 1. - exp (- mdt / tau_smlt) + + ! ----------------------------------------------------------------------- + !> - Define heat capacity of dry air and water vapor based on hydrostatical property. + ! ----------------------------------------------------------------------- + + if (hydrostatic) then + c_air = cp_air + c_vap = cp_vap + else + c_air = cv_air + c_vap = cv_vap + endif + d0_vap = c_vap - c_liq + lv00 = hlv - d0_vap * tice + ! dc_vap = cp_vap - c_liq ! - 2339.5 + ! d0_vap = cv_vap - c_liq ! - 2801.0 + + do j = js, je ! start j loop + + do i = is, ie + q_liq (i) = ql (i, j) + qr (i, j) + q_sol (i) = qi (i, j) + qs (i, j) + qg (i, j) + qpz (i) = q_liq (i) + q_sol (i) +#ifdef MULTI_GASES + pt1 (i) = pt (i, j) / virq_qpz(qvi(i,j,1,1:num_gas),qpz(i)) +#else +#ifdef USE_COND + pt1 (i) = pt (i, j) / ((1 + zvir * qv (i, j)) * (1 - qpz (i))) +#else + pt1 (i) = pt (i, j) / (1 + zvir * qv (i, j)) +#endif +#endif + t0 (i) = pt1 (i) ! true temperature + qpz (i) = qpz (i) + qv (i, j) ! total_wat conserved in this routine + enddo + + ! ----------------------------------------------------------------------- + !> - Define air density based on hydrostatical property. + ! ----------------------------------------------------------------------- + + if (hydrostatic) then + do i = is, ie + den (i) = dp (i, j) / (dpln (i, j) * rdgas * pt (i, j)) + enddo + else + do i = is, ie + den (i) = - dp (i, j) / (grav * delz (i, j)) ! moist_air density + enddo + endif + + ! ----------------------------------------------------------------------- + !> - Define heat capacity and latend heat coefficient. + ! ----------------------------------------------------------------------- + + do i = is, ie +#ifdef MULTI_GASES + if (hydrostatic) then + c_air = cp_air * vicpqd_qpz(qvi(i,j,1,1:num_gas),qpz(i)) + else + c_air = cv_air * vicvqd_qpz(qvi(i,j,1,1:num_gas),qpz(i)) + endif +#endif + mc_air (i) = (1. - qpz (i)) * c_air ! constant + cvm (i) = mc_air (i) + qv (i, j) * c_vap + q_liq (i) * c_liq + q_sol (i) * c_ice + lhi (i) = li00 + dc_ice * pt1 (i) + icp2 (i) = lhi (i) / cvm (i) + enddo + + ! ----------------------------------------------------------------------- + !> - Fix energy conservation. + ! ----------------------------------------------------------------------- + + if (consv_te) then + if (hydrostatic) then + do i = is, ie +#ifdef MULTI_GASES + c_air = cp_air * vicpqd_qpz(qvi(i,j,1,1:num_gas),qpz(i)) +#endif + te0 (i, j) = - c_air * t0 (i) + enddo + else + do i = is, ie +#ifdef USE_COND + te0 (i, j) = - cvm (i) * t0 (i) +#else +#ifdef MULTI_GASES + c_air = cv_air * vicvqd_qpz(qvi(i,j,1,1:num_gas),qpz(i)) +#endif + te0 (i, j) = - c_air * t0 (i) +#endif + enddo + endif + endif + + ! ----------------------------------------------------------------------- + !> - Fix negative cloud ice with snow. + ! ----------------------------------------------------------------------- + + do i = is, ie + if (qi (i, j) < 0.) then + qs (i, j) = qs (i, j) + qi (i, j) + qi (i, j) = 0. + endif + enddo + + ! ----------------------------------------------------------------------- + !> - Melting of cloud ice to cloud water and rain. + ! ----------------------------------------------------------------------- + + do i = is, ie + if (qi (i, j) > 1.e-8 .and. pt1 (i) > tice) then + sink (i) = min (qi (i, j), fac_imlt * (pt1 (i) - tice) / icp2 (i)) + qi (i, j) = qi (i, j) - sink (i) + ! sjl, may 17, 2017 + ! tmp = min (sink (i), dim (ql_mlt, ql (i, j))) ! max ql amount + ! ql (i, j) = ql (i, j) + tmp + ! qr (i, j) = qr (i, j) + sink (i) - tmp + ! sjl, may 17, 2017 + ql (i, j) = ql (i, j) + sink (i) + q_liq (i) = q_liq (i) + sink (i) + q_sol (i) = q_sol (i) - sink (i) + cvm (i) = mc_air (i) + qv (i, j) * c_vap + q_liq (i) * c_liq + q_sol (i) * c_ice + pt1 (i) = pt1 (i) - sink (i) * lhi (i) / cvm (i) + endif + enddo + + ! ----------------------------------------------------------------------- + !> - Update latend heat coefficient. + ! ----------------------------------------------------------------------- + + do i = is, ie + lhi (i) = li00 + dc_ice * pt1 (i) + icp2 (i) = lhi (i) / cvm (i) + enddo + + ! ----------------------------------------------------------------------- + !> - Fix negative snow with graupel or graupel with available snow. + ! ----------------------------------------------------------------------- + + do i = is, ie + if (qs (i, j) < 0.) then + qg (i, j) = qg (i, j) + qs (i, j) + qs (i, j) = 0. + elseif (qg (i, j) < 0.) then + tmp = min (- qg (i, j), max (0., qs (i, j))) + qg (i, j) = qg (i, j) + tmp + qs (i, j) = qs (i, j) - tmp + endif + enddo + + ! after this point cloud ice & snow are positive definite + + ! ----------------------------------------------------------------------- + !> - Fix negative cloud water with rain or rain with available cloud water. + ! ----------------------------------------------------------------------- + + do i = is, ie + if (ql (i, j) < 0.) then + tmp = min (- ql (i, j), max (0., qr (i, j))) + ql (i, j) = ql (i, j) + tmp + qr (i, j) = qr (i, j) - tmp + elseif (qr (i, j) < 0.) then + tmp = min (- qr (i, j), max (0., ql (i, j))) + ql (i, j) = ql (i, j) - tmp + qr (i, j) = qr (i, j) + tmp + endif + enddo + + ! ----------------------------------------------------------------------- + !> - Enforce complete freezing of cloud water to cloud ice below - 48 c. + ! ----------------------------------------------------------------------- + + do i = is, ie + dtmp = tice - 48. - pt1 (i) + if (ql (i, j) > 0. .and. dtmp > 0.) then + sink (i) = min (ql (i, j), dtmp / icp2 (i)) + ql (i, j) = ql (i, j) - sink (i) + qi (i, j) = qi (i, j) + sink (i) + q_liq (i) = q_liq (i) - sink (i) + q_sol (i) = q_sol (i) + sink (i) + cvm (i) = mc_air (i) + qv (i, j) * c_vap + q_liq (i) * c_liq + q_sol (i) * c_ice + pt1 (i) = pt1 (i) + sink (i) * lhi (i) / cvm (i) + endif + enddo + + ! ----------------------------------------------------------------------- + !> - Update latend heat coefficient. + ! ----------------------------------------------------------------------- + + do i = is, ie + lhl (i) = lv00 + d0_vap * pt1 (i) + lhi (i) = li00 + dc_ice * pt1 (i) + lcp2 (i) = lhl (i) / cvm (i) + icp2 (i) = lhi (i) / cvm (i) + tcp3 (i) = lcp2 (i) + icp2 (i) * min (1., dim (tice, pt1 (i)) /48.) + enddo + + ! ----------------------------------------------------------------------- + !> - Condensation/evaporation between water vapor and cloud water. + ! ----------------------------------------------------------------------- + + call wqs2_vect (is, ie, pt1, den, wqsat, dq2dt) + + adj_fac = sat_adj0 + do i = is, ie + dq0 = (qv (i, j) - wqsat (i)) / (1. + tcp3 (i) * dq2dt (i)) + if (dq0 > 0.) then ! whole grid - box saturated + src (i) = min (adj_fac * dq0, max (ql_gen - ql (i, j), fac_v2l * dq0)) + else ! evaporation of ql + ! sjl 20170703 added ql factor to prevent the situation of high ql and rh<1 + ! factor = - min (1., fac_l2v * sqrt (max (0., ql (i, j)) / 1.e-5) * 10. * (1. - qv (i, j) / wqsat (i))) + ! factor = - fac_l2v + ! factor = - 1 + factor = - min (1., fac_l2v * 10. * (1. - qv (i, j) / wqsat (i))) ! the rh dependent factor = 1 at 90% + src (i) = - min (ql (i, j), factor * dq0) + endif + qv (i, j) = qv (i, j) - src (i) +#ifdef MULTI_GASES + qvi(i,j,1,1) = qv (i, j) +#endif + ql (i, j) = ql (i, j) + src (i) + q_liq (i) = q_liq (i) + src (i) + cvm (i) = mc_air (i) + qv (i, j) * c_vap + q_liq (i) * c_liq + q_sol (i) * c_ice + pt1 (i) = pt1 (i) + src (i) * lhl (i) / cvm (i) + enddo + + ! ----------------------------------------------------------------------- + !> - Update latend heat coefficient. + ! ----------------------------------------------------------------------- + + do i = is, ie + lhl (i) = lv00 + d0_vap * pt1 (i) + lhi (i) = li00 + dc_ice * pt1 (i) + lcp2 (i) = lhl (i) / cvm (i) + icp2 (i) = lhi (i) / cvm (i) + tcp3 (i) = lcp2 (i) + icp2 (i) * min (1., dim (tice, pt1 (i)) / 48.) + enddo + + if (last_step) then + + ! ----------------------------------------------------------------------- + !> - condensation/evaporation between water vapor and cloud water, last time step + !! enforce upper (no super_sat) & lower (critical rh) bounds. + ! final iteration: + ! ----------------------------------------------------------------------- + + call wqs2_vect (is, ie, pt1, den, wqsat, dq2dt) + + do i = is, ie + dq0 = (qv (i, j) - wqsat (i)) / (1. + tcp3 (i) * dq2dt (i)) + if (dq0 > 0.) then ! remove super - saturation, prevent super saturation over water + src (i) = dq0 + else ! evaporation of ql + ! factor = - min (1., fac_l2v * sqrt (max (0., ql (i, j)) / 1.e-5) * 10. * (1. - qv (i, j) / wqsat (i))) ! the rh dependent factor = 1 at 90% + ! factor = - fac_l2v + ! factor = - 1 + factor = - min (1., fac_l2v * 10. * (1. - qv (i, j) / wqsat (i))) ! the rh dependent factor = 1 at 90% + src (i) = - min (ql (i, j), factor * dq0) + endif + adj_fac = 1. + qv (i, j) = qv (i, j) - src (i) +#ifdef MULTI_GASES + qvi(i,j,1,1) = qv(i,j) +#endif + ql (i, j) = ql (i, j) + src (i) + q_liq (i) = q_liq (i) + src (i) + cvm (i) = mc_air (i) + qv (i, j) * c_vap + q_liq (i) * c_liq + q_sol (i) * c_ice + pt1 (i) = pt1 (i) + src (i) * lhl (i) / cvm (i) + enddo + + ! ----------------------------------------------------------------------- + !> - Update latend heat coefficient. + ! ----------------------------------------------------------------------- + + do i = is, ie + lhl (i) = lv00 + d0_vap * pt1 (i) + lhi (i) = li00 + dc_ice * pt1 (i) + lcp2 (i) = lhl (i) / cvm (i) + icp2 (i) = lhi (i) / cvm (i) + enddo + + endif + + ! ----------------------------------------------------------------------- + !> - Homogeneous freezing of cloud water to cloud ice. + ! ----------------------------------------------------------------------- + + do i = is, ie + dtmp = t_wfr - pt1 (i) ! [ - 40, - 48] + if (ql (i, j) > 0. .and. dtmp > 0.) then + sink (i) = min (ql (i, j), ql (i, j) * dtmp * 0.125, dtmp / icp2 (i)) + ql (i, j) = ql (i, j) - sink (i) + qi (i, j) = qi (i, j) + sink (i) + q_liq (i) = q_liq (i) - sink (i) + q_sol (i) = q_sol (i) + sink (i) + cvm (i) = mc_air (i) + qv (i, j) * c_vap + q_liq (i) * c_liq + q_sol (i) * c_ice + pt1 (i) = pt1 (i) + sink (i) * lhi (i) / cvm (i) + endif + enddo + + ! ----------------------------------------------------------------------- + !> - Update latend heat coefficient. + ! ----------------------------------------------------------------------- + + do i = is, ie + lhi (i) = li00 + dc_ice * pt1 (i) + icp2 (i) = lhi (i) / cvm (i) + enddo + + ! ----------------------------------------------------------------------- + !> - bigg mechanism (heterogeneous freezing of cloud water to cloud ice). + ! ----------------------------------------------------------------------- + + do i = is, ie + tc = tice0 - pt1 (i) + if (ql (i, j) > 0.0 .and. tc > 0.) then + sink (i) = 3.3333e-10 * dt_bigg * (exp (0.66 * tc) - 1.) * den (i) * ql (i, j) ** 2 + sink (i) = min (ql (i, j), tc / icp2 (i), sink (i)) + ql (i, j) = ql (i, j) - sink (i) + qi (i, j) = qi (i, j) + sink (i) + q_liq (i) = q_liq (i) - sink (i) + q_sol (i) = q_sol (i) + sink (i) + cvm (i) = mc_air (i) + qv (i, j) * c_vap + q_liq (i) * c_liq + q_sol (i) * c_ice + pt1 (i) = pt1 (i) + sink (i) * lhi (i) / cvm (i) + endif + enddo + + ! ----------------------------------------------------------------------- + !> - Update latend heat coefficient. + ! ----------------------------------------------------------------------- + + do i = is, ie + lhi (i) = li00 + dc_ice * pt1 (i) + icp2 (i) = lhi (i) / cvm (i) + enddo + + ! ----------------------------------------------------------------------- + !> - Freezing of rain to graupel. + ! ----------------------------------------------------------------------- + + do i = is, ie + dtmp = (tice - 0.1) - pt1 (i) + if (qr (i, j) > 1.e-7 .and. dtmp > 0.) then + tmp = min (1., (dtmp * 0.025) ** 2) * qr (i, j) ! no limit on freezing below - 40 deg c + sink (i) = min (tmp, fac_r2g * dtmp / icp2 (i)) + qr (i, j) = qr (i, j) - sink (i) + qg (i, j) = qg (i, j) + sink (i) + q_liq (i) = q_liq (i) - sink (i) + q_sol (i) = q_sol (i) + sink (i) + cvm (i) = mc_air (i) + qv (i, j) * c_vap + q_liq (i) * c_liq + q_sol (i) * c_ice + pt1 (i) = pt1 (i) + sink (i) * lhi (i) / cvm (i) + endif + enddo + + ! ----------------------------------------------------------------------- + !> - Update latend heat coefficient. + ! ----------------------------------------------------------------------- + + do i = is, ie + lhi (i) = li00 + dc_ice * pt1 (i) + icp2 (i) = lhi (i) / cvm (i) + enddo + + ! ----------------------------------------------------------------------- + !> - Melting of snow to rain or cloud water. + ! ----------------------------------------------------------------------- + + do i = is, ie + dtmp = pt1 (i) - (tice + 0.1) + if (qs (i, j) > 1.e-7 .and. dtmp > 0.) then + tmp = min (1., (dtmp * 0.1) ** 2) * qs (i, j) ! no limter on melting above 10 deg c + sink (i) = min (tmp, fac_smlt * dtmp / icp2 (i)) + tmp = min (sink (i), dim (qs_mlt, ql (i, j))) ! max ql due to snow melt + qs (i, j) = qs (i, j) - sink (i) + ql (i, j) = ql (i, j) + tmp + qr (i, j) = qr (i, j) + sink (i) - tmp + ! qr (i, j) = qr (i, j) + sink (i) + q_liq (i) = q_liq (i) + sink (i) + q_sol (i) = q_sol (i) - sink (i) + cvm (i) = mc_air (i) + qv (i, j) * c_vap + q_liq (i) * c_liq + q_sol (i) * c_ice + pt1 (i) = pt1 (i) - sink (i) * lhi (i) / cvm (i) + endif + enddo + + ! ----------------------------------------------------------------------- + !> - Autoconversion from cloud water to rain. + ! ----------------------------------------------------------------------- + + do i = is, ie + if (ql (i, j) > ql0_max) then + sink (i) = fac_l2r * (ql (i, j) - ql0_max) + qr (i, j) = qr (i, j) + sink (i) + ql (i, j) = ql (i, j) - sink (i) + endif + enddo + + ! ----------------------------------------------------------------------- + !> - Update latend heat coefficient. + ! ----------------------------------------------------------------------- + + do i = is, ie + lhi (i) = li00 + dc_ice * pt1 (i) + lhl (i) = lv00 + d0_vap * pt1 (i) + lcp2 (i) = lhl (i) / cvm (i) + icp2 (i) = lhi (i) / cvm (i) + tcp2 (i) = lcp2 (i) + icp2 (i) + enddo + + ! ----------------------------------------------------------------------- + !> - Sublimation/deposition between water vapor and cloud ice. + ! ----------------------------------------------------------------------- + + do i = is, ie + src (i) = 0. + if (pt1 (i) < t_sub) then ! too cold to be accurate; freeze qv as a fix + src (i) = dim (qv (i, j), 1.e-6) + elseif (pt1 (i) < tice0) then + qsi = iqs2 (pt1 (i), den (i), dqsdt) + dq = qv (i, j) - qsi + sink (i) = adj_fac * dq / (1. + tcp2 (i) * dqsdt) + if (qi (i, j) > 1.e-8) then + pidep = sdt * dq * 349138.78 * exp (0.875 * log (qi (i, j) * den (i))) & + / (qsi * den (i) * lat2 / (0.0243 * rvgas * pt1 (i) ** 2) + 4.42478e4) + else + pidep = 0. + endif + if (dq > 0.) then ! vapor - > ice + tmp = tice - pt1 (i) + qi_crt = qi_gen * min (qi_lim, 0.1 * tmp) / den (i) + src (i) = min (sink (i), max (qi_crt - qi (i, j), pidep), tmp / tcp2 (i)) + else + pidep = pidep * min (1., dim (pt1 (i), t_sub) * 0.2) + src (i) = max (pidep, sink (i), - qi (i, j)) + endif + endif + qv (i, j) = qv (i, j) - src (i) +#ifdef MULTI_GASES + qvi(i,j,1,1) = qv(i,j) +#endif + qi (i, j) = qi (i, j) + src (i) + q_sol (i) = q_sol (i) + src (i) + cvm (i) = mc_air (i) + qv (i, j) * c_vap + q_liq (i) * c_liq + q_sol (i) * c_ice + pt1 (i) = pt1 (i) + src (i) * (lhl (i) + lhi (i)) / cvm (i) + enddo + + ! ----------------------------------------------------------------------- + !> - Virtual temperature updated. + ! ----------------------------------------------------------------------- + + do i = is, ie +#ifdef USE_COND + q_con (i, j) = q_liq (i) + q_sol (i) +#ifdef MULTI_GASES + pt (i, j) = pt1 (i) * virq_qpz(qvi(i,j,1,1:num_gas),q_con(i,j)) +#else + tmp = 1. + zvir * qv (i, j) + pt (i, j) = pt1 (i) * tmp * (1. - q_con (i, j)) +#endif + tmp = rdgas * tmp + cappa (i, j) = tmp / (tmp + cvm (i)) +#else +#ifdef MULTI_GASES + q_con (i, j) = q_liq (i) + q_sol (i) + pt (i, j) = pt1 (i) * virq_qpz(qvi(i,j,1,1:num_gas),q_con(i,j)) * (1. - q_con(i,j)) +#else + pt (i, j) = pt1 (i) * (1. + zvir * qv (i, j)) +#endif +#endif + enddo + + ! ----------------------------------------------------------------------- + !> - Fix negative graupel with available cloud ice. + ! ----------------------------------------------------------------------- + + do i = is, ie + if (qg (i, j) < 0.) then + tmp = min (- qg (i, j), max (0., qi (i, j))) + qg (i, j) = qg (i, j) + tmp + qi (i, j) = qi (i, j) - tmp + endif + enddo + + ! ----------------------------------------------------------------------- + !> - Autoconversion from cloud ice to snow. + ! ----------------------------------------------------------------------- + + do i = is, ie + qim = qi0_max / den (i) + if (qi (i, j) > qim) then + sink (i) = fac_i2s * (qi (i, j) - qim) + qi (i, j) = qi (i, j) - sink (i) + qs (i, j) = qs (i, j) + sink (i) + endif + enddo + + if (out_dt) then + do i = is, ie + dtdt (i, j) = dtdt (i, j) + pt1 (i) - t0 (i) + enddo + endif + + ! ----------------------------------------------------------------------- + !> - Fix energy conservation. + ! ----------------------------------------------------------------------- + + if (consv_te) then + do i = is, ie + if (hydrostatic) then +#ifdef MULTI_GASES + c_air = cp_air * vicpqd_qpz(qvi(i,j,1,1:num_gas),qpz(i)) +#endif + te0 (i, j) = dp (i, j) * (te0 (i, j) + c_air * pt1 (i)) + else +#ifdef USE_COND + te0 (i, j) = dp (i, j) * (te0 (i, j) + cvm (i) * pt1 (i)) +#else +#ifdef MULTI_GASES + c_air = cv_air * vicvqd_qpz(qvi(i,j,1,1:num_gas),qpz(i)) +#endif + te0 (i, j) = dp (i, j) * (te0 (i, j) + c_air * pt1 (i)) +#endif + endif + enddo + endif + + ! ----------------------------------------------------------------------- + !> - Update latend heat coefficient. + ! ----------------------------------------------------------------------- + + do i = is, ie + lhi (i) = li00 + dc_ice * pt1 (i) + lhl (i) = lv00 + d0_vap * pt1 (i) + cvm (i) = mc_air (i) + (qv (i, j) + q_liq (i) + q_sol (i)) * c_vap + lcp2 (i) = lhl (i) / cvm (i) + icp2 (i) = lhi (i) / cvm (i) + enddo + + ! ----------------------------------------------------------------------- + !> - Compute cloud fraction. + ! ----------------------------------------------------------------------- + + if (do_qa .and. last_step) then + + ! ----------------------------------------------------------------------- + !> - If it is the last step, combine water species. + ! ----------------------------------------------------------------------- + + if (rad_snow) then + if (rad_graupel) then + do i = is, ie + q_sol (i) = qi (i, j) + qs (i, j) + qg (i, j) + enddo + else + do i = is, ie + q_sol (i) = qi (i, j) + qs (i, j) + enddo + endif + else + do i = is, ie + q_sol (i) = qi (i, j) + enddo + endif + if (rad_rain) then + do i = is, ie + q_liq (i) = ql (i, j) + qr (i, j) + enddo + else + do i = is, ie + q_liq (i) = ql (i, j) + enddo + endif + do i = is, ie + q_cond (i) = q_sol (i) + q_liq (i) + enddo + + ! ----------------------------------------------------------------------- + !> - Use the "liquid - frozen water temperature" (tin) to compute saturated specific humidity. + ! ----------------------------------------------------------------------- + + do i = is, ie + + if(tintqs) then + tin = pt1(i) + else + tin = pt1 (i) - (lcp2 (i) * q_cond (i) + icp2 (i) * q_sol (i)) ! minimum temperature + ! tin = pt1 (i) - ((lv00 + d0_vap * pt1 (i)) * q_cond (i) + & + ! (li00 + dc_ice * pt1 (i)) * q_sol (i)) / (mc_air (i) + qpz (i) * c_vap) + endif + + ! ----------------------------------------------------------------------- + ! determine saturated specific humidity + ! ----------------------------------------------------------------------- + + if (tin <= t_wfr) then + ! ice phase: + qstar (i) = iqs1 (tin, den (i)) + elseif (tin >= tice) then + ! liquid phase: + qstar (i) = wqs1 (tin, den (i)) + else + ! mixed phase: + qsi = iqs1 (tin, den (i)) + qsw = wqs1 (tin, den (i)) + if (q_cond (i) > 1.e-6) then + rqi = q_sol (i) / q_cond (i) + else + ! mostly liquid water clouds at initial cloud development stage + rqi = ((tice - tin) / (tice - t_wfr)) + endif + qstar (i) = rqi * qsi + (1. - rqi) * qsw + endif + !> - higher than 10 m is considered "land" and will have higher subgrid variability + dw = dw_ocean + (dw_land - dw_ocean) * min (1., abs (hs (i, j)) / (10. * grav)) + !> - "scale - aware" subgrid variability: 100 - km as the base + hvar (i) = min (0.2, max (0.01, dw * sqrt (sqrt (area (i, j)) / 100.e3))) + + ! ----------------------------------------------------------------------- + !> - calculate partial cloudiness by pdf; + !! assuming subgrid linear distribution in horizontal; this is effectively a smoother for the + !! binary cloud scheme; qa = 0.5 if qstar (i) == qpz + ! ----------------------------------------------------------------------- + + rh = qpz (i) / qstar (i) + + ! ----------------------------------------------------------------------- + ! icloud_f = 0: bug - fixed + ! icloud_f = 1: old fvgfs gfdl) mp implementation + ! icloud_f = 2: binary cloud scheme (0 / 1) + ! ----------------------------------------------------------------------- + + if (rh > 0.75 .and. qpz (i) > 1.e-8) then + dq = hvar (i) * qpz (i) + q_plus = qpz (i) + dq + q_minus = qpz (i) - dq + if (icloud_f == 2) then + if (qpz (i) > qstar (i)) then + qa (i, j) = 1. + elseif (qstar (i) < q_plus .and. q_cond (i) > 1.e-8) then + qa (i, j) = ((q_plus - qstar (i)) / dq) ** 2 + qa (i, j) = min (1., qa (i, j)) + else + qa (i, j) = 0. + endif + else + if (qstar (i) < q_minus) then + qa (i, j) = 1. + else + if (qstar (i) < q_plus) then + if (icloud_f == 0) then + qa (i, j) = (q_plus - qstar (i)) / (dq + dq) + else + qa (i, j) = (q_plus - qstar (i)) / (2. * dq * (1. - q_cond (i))) + endif + else + qa (i, j) = 0. + endif + ! impose minimum cloudiness if substantial q_cond (i) exist + if (q_cond (i) > 1.e-8) then + qa (i, j) = max (cld_min, qa (i, j)) + endif + qa (i, j) = min (1., qa (i, j)) + endif + endif + else + qa (i, j) = 0. + endif + + enddo + + endif + + enddo ! end j loop + +end subroutine fv_sat_adj_work +!> @} + +! ======================================================================= +!>\ingroup fast_sat_adj +!>\brief the function 'wqs1' computes the +!! saturated specific humidity for table ii. +! ======================================================================= +real(kind=kind_dyn) function wqs1 (ta, den) + + implicit none + + ! pure water phase; universal dry / moist formular using air density + ! input "den" can be either dry or moist air density + + real(kind=kind_dyn), intent (in) :: ta, den + + real(kind=kind_dyn) :: es, ap1, tmin + + integer :: it + + tmin = tice - 160. + ap1 = 10. * dim (ta, tmin) + 1. + ap1 = min (2621., ap1) + it = ap1 + es = tablew (it) + (ap1 - it) * desw (it) + wqs1 = es / (rvgas * ta * den) + +end function wqs1 + +! ======================================================================= +!>\ingroup fast_sat_adj +!>\brief the function 'wqs1' computes the saturated specific humidity +!! for table iii +! ======================================================================= +real(kind=kind_dyn) function iqs1 (ta, den) + + implicit none + + ! water - ice phase; universal dry / moist formular using air density + ! input "den" can be either dry or moist air density + + real(kind=kind_dyn), intent (in) :: ta, den + + real(kind=kind_dyn) :: es, ap1, tmin + + integer :: it + + tmin = tice - 160. + ap1 = 10. * dim (ta, tmin) + 1. + ap1 = min (2621., ap1) + it = ap1 + es = table2 (it) + (ap1 - it) * des2 (it) + iqs1 = es / (rvgas * ta * den) + +end function iqs1 + +! ======================================================================= +!>\ingroup fast_sat_adj +!>\brief The function 'wqs2'computes the gradient of saturated specific +!! humidity for table ii +! ======================================================================= +real(kind=kind_dyn) function wqs2 (ta, den, dqdt) + + implicit none + + ! pure water phase; universal dry / moist formular using air density + ! input "den" can be either dry or moist air density + + real(kind=kind_dyn), intent (in) :: ta, den + + real(kind=kind_dyn), intent (out) :: dqdt + + real(kind=kind_dyn) :: es, ap1, tmin + + integer :: it + + tmin = tice - 160. + ap1 = 10. * dim (ta, tmin) + 1. + ap1 = min (2621., ap1) + it = ap1 + es = tablew (it) + (ap1 - it) * desw (it) + wqs2 = es / (rvgas * ta * den) + it = ap1 - 0.5 + ! finite diff, del_t = 0.1: + dqdt = 10. * (desw (it) + (ap1 - it) * (desw (it + 1) - desw (it))) / (rvgas * ta * den) + +end function wqs2 + +! ======================================================================= +!>\ingroup fast_sat_adj +!>\brief The function wqs2_vect computes the gradient of saturated +!! specific humidity for table ii. +!! It is the same as "wqs2", but written as vector function. +! ======================================================================= +subroutine wqs2_vect (is, ie, ta, den, wqsat, dqdt) + + implicit none + + ! pure water phase; universal dry / moist formular using air density + ! input "den" can be either dry or moist air density + + integer, intent (in) :: is, ie + + real(kind=kind_dyn), intent (in), dimension (:) :: ta, den + + real(kind=kind_dyn), intent (out), dimension (:) :: wqsat, dqdt + + real(kind=kind_dyn) :: es, ap1, tmin + + integer :: i, it + + tmin = tice - 160. + + do i = is, ie + ap1 = 10. * dim (ta (i), tmin) + 1. + ap1 = min (2621., ap1) + it = ap1 + es = tablew (it) + (ap1 - it) * desw (it) + wqsat (i) = es / (rvgas * ta (i) * den (i)) + it = ap1 - 0.5 + ! finite diff, del_t = 0.1: + dqdt (i) = 10. * (desw (it) + (ap1 - it) * (desw (it + 1) - desw (it))) / (rvgas * ta (i) * den (i)) + enddo + +end subroutine wqs2_vect + +! ======================================================================= +!>\ingroup fast_sat_adj +!>\brief The function 'iqs2' computes the gradient of saturated specific +!! humidity for table iii. +! ======================================================================= +real(kind=kind_dyn) function iqs2 (ta, den, dqdt) + + implicit none + + ! water - ice phase; universal dry / moist formular using air density + ! input "den" can be either dry or moist air density + + real(kind=kind_dyn), intent (in) :: ta, den + + real(kind=kind_dyn), intent (out) :: dqdt + + real(kind=kind_dyn) :: es, ap1, tmin + + integer :: it + + tmin = tice - 160. + ap1 = 10. * dim (ta, tmin) + 1. + ap1 = min (2621., ap1) + it = ap1 + es = table2 (it) + (ap1 - it) * des2 (it) + iqs2 = es / (rvgas * ta * den) + it = ap1 - 0.5 + ! finite diff, del_t = 0.1: + dqdt = 10. * (des2 (it) + (ap1 - it) * (des2 (it + 1) - des2 (it))) / (rvgas * ta * den) + +end function iqs2 + +! ======================================================================= +!>\ingroup fast_sat_adj +!! saturation water vapor pressure table i +! 3 - phase table +! ======================================================================= + +subroutine qs_table (n) + + implicit none + + integer, intent (in) :: n + real (kind_grid) :: delt = 0.1 + real (kind_grid) :: tmin, tem, esh20 + real (kind_grid) :: wice, wh2o, fac0, fac1, fac2 + real (kind_grid) :: esupc (200) + integer :: i + + tmin = tice - 160. + + ! ----------------------------------------------------------------------- + ! compute es over ice between - 160 deg c and 0 deg c. + ! ----------------------------------------------------------------------- + + do i = 1, 1600 + tem = tmin + delt * real (i - 1) + fac0 = (tem - tice) / (tem * tice) + fac1 = fac0 * li2 + fac2 = (d2ice * log (tem / tice) + fac1) / rvgas + table (i) = e00 * exp (fac2) + enddo + + ! ----------------------------------------------------------------------- + ! compute es over water between - 20 deg c and 102 deg c. + ! ----------------------------------------------------------------------- + + do i = 1, 1221 + tem = 253.16 + delt * real (i - 1) + fac0 = (tem - tice) / (tem * tice) + fac1 = fac0 * lv0 + fac2 = (dc_vap * log (tem / tice) + fac1) / rvgas + esh20 = e00 * exp (fac2) + if (i <= 200) then + esupc (i) = esh20 + else + table (i + 1400) = esh20 + endif + enddo + + ! ----------------------------------------------------------------------- + ! derive blended es over ice and supercooled water between - 20 deg c and 0 deg c + ! ----------------------------------------------------------------------- + + do i = 1, 200 + tem = 253.16 + delt * real (i - 1) + wice = 0.05 * (tice - tem) + wh2o = 0.05 * (tem - 253.16) + table (i + 1400) = wice * table (i + 1400) + wh2o * esupc (i) + enddo + +end subroutine qs_table + +! ======================================================================= +!>\ingroup fast_sat_adj +!! saturation water vapor pressure table ii. +! 1 - phase table +! ======================================================================= + +subroutine qs_tablew (n) + + implicit none + + integer, intent (in) :: n + real (kind_grid) :: delt = 0.1 + real (kind_grid) :: tmin, tem, fac0, fac1, fac2 + integer :: i + + tmin = tice - 160. + + ! ----------------------------------------------------------------------- + ! compute es over water + ! ----------------------------------------------------------------------- + + do i = 1, n + tem = tmin + delt * real (i - 1) + fac0 = (tem - tice) / (tem * tice) + fac1 = fac0 * lv0 + fac2 = (dc_vap * log (tem / tice) + fac1) / rvgas + tablew (i) = e00 * exp (fac2) + enddo + +end subroutine qs_tablew + +! ======================================================================= +!>\ingroup fast_sat_adj +!! saturation water vapor pressure table iii. +! 2 - phase table +! ======================================================================= + +subroutine qs_table2 (n) + + implicit none + + integer, intent (in) :: n + real (kind_grid) :: delt = 0.1 + real (kind_grid) :: tmin, tem0, tem1, fac0, fac1, fac2 + integer :: i, i0, i1 + + tmin = tice - 160. + + do i = 1, n + tem0 = tmin + delt * real (i - 1) + fac0 = (tem0 - tice) / (tem0 * tice) + if (i <= 1600) then + ! ----------------------------------------------------------------------- + ! compute es over ice between - 160 deg c and 0 deg c. + ! ----------------------------------------------------------------------- + fac1 = fac0 * li2 + fac2 = (d2ice * log (tem0 / tice) + fac1) / rvgas + else + ! ----------------------------------------------------------------------- + ! compute es over water between 0 deg c and 102 deg c. + ! ----------------------------------------------------------------------- + fac1 = fac0 * lv0 + fac2 = (dc_vap * log (tem0 / tice) + fac1) / rvgas + endif + table2 (i) = e00 * exp (fac2) + enddo + + ! ----------------------------------------------------------------------- + ! smoother around 0 deg c + ! ----------------------------------------------------------------------- + + i0 = 1600 + i1 = 1601 + tem0 = 0.25 * (table2 (i0 - 1) + 2. * table (i0) + table2 (i0 + 1)) + tem1 = 0.25 * (table2 (i1 - 1) + 2. * table (i1) + table2 (i1 + 1)) + table2 (i0) = tem0 + table2 (i1) = tem1 + +end subroutine qs_table2 + +end module fv_sat_adj +!> @} diff --git a/physics/gitdiff b/physics/gitdiff new file mode 100644 index 0000000000..cba1236f22 --- /dev/null +++ b/physics/gitdiff @@ -0,0 +1,4397 @@ +diff --git a/physics/GFS_DCNV_generic.F90 b/physics/GFS_DCNV_generic.F90 +index bfe97bc..def1e7f 100644 +--- a/physics/GFS_DCNV_generic.F90 ++++ b/physics/GFS_DCNV_generic.F90 +@@ -26,14 +26,14 @@ + + integer, intent(in) :: im, levs + logical, intent(in) :: ldiag3d, qdiag3d, do_cnvgwd, cplchm +- real(kind=kind_phys), dimension(im,levs), intent(in) :: gu0 +- real(kind=kind_phys), dimension(im,levs), intent(in) :: gv0 +- real(kind=kind_phys), dimension(im,levs), intent(in) :: gt0 +- real(kind=kind_phys), dimension(im,levs), intent(inout) :: gq0_water_vapor +- real(kind=kind_phys), dimension(im,levs), intent(inout) :: save_u +- real(kind=kind_phys), dimension(im,levs), intent(inout) :: save_v +- real(kind=kind_phys), dimension(im,levs), intent(inout) :: save_t +- real(kind=kind_phys), dimension(im,levs), intent(inout) :: save_qv ++ real(kind=kind_phys), dimension(:,:), intent(in) :: gu0 ++ real(kind=kind_phys), dimension(:,:), intent(in) :: gv0 ++ real(kind=kind_phys), dimension(:,:), intent(in) :: gt0 ++ real(kind=kind_phys), dimension(:,:), intent(inout) :: gq0_water_vapor ++ real(kind=kind_phys), dimension(:,:), intent(inout) :: save_u ++ real(kind=kind_phys), dimension(:,:), intent(inout) :: save_v ++ real(kind=kind_phys), dimension(:,:), intent(inout) :: save_t ++ real(kind=kind_phys), dimension(:,:), intent(inout) :: save_qv + ! dqdti only allocated if cplchm is .true. + real(kind=kind_phys), dimension(:,:), intent(inout) :: dqdti + character(len=*), intent(out) :: errmsg +@@ -107,18 +107,18 @@ + logical, intent(in) :: flag_for_dcnv_generic_tend + + real(kind=kind_phys), intent(in) :: frain, dtf +- real(kind=kind_phys), dimension(im), intent(in) :: rain1, cld1d +- real(kind=kind_phys), dimension(im,levs), intent(in) :: save_u, save_v, save_t, save_qv +- real(kind=kind_phys), dimension(im,levs), intent(in) :: gu0, gv0, gt0, gq0_water_vapor +- real(kind=kind_phys), dimension(im,levs), intent(in) :: ud_mf, dd_mf, dt_mf ++ real(kind=kind_phys), dimension(:), intent(in) :: rain1, cld1d ++ real(kind=kind_phys), dimension(:,:), intent(in) :: save_u, save_v, save_t, save_qv ++ real(kind=kind_phys), dimension(:,:), intent(in) :: gu0, gv0, gt0, gq0_water_vapor ++ real(kind=kind_phys), dimension(:,:), intent(in) :: ud_mf, dd_mf, dt_mf + real(kind=kind_phys), intent(in) :: con_g + integer, intent(in) :: npdf3d, num_p3d, ncnvcld3d + +- real(kind=kind_phys), dimension(im), intent(inout) :: rainc, cldwrk ++ real(kind=kind_phys), dimension(:), intent(inout) :: rainc, cldwrk + ! dt3dt, dq3dt, du3dt, dv3dt upd_mf, dwn_mf, det_mf only allocated if ldiag3d == .true. + real(kind=kind_phys), dimension(:,:), intent(inout) :: dt3dt, dq3dt, du3dt, dv3dt + real(kind=kind_phys), dimension(:,:), intent(inout) :: upd_mf, dwn_mf, det_mf +- real(kind=kind_phys), dimension(im,levs), intent(inout) :: cnvw, cnvc ++ real(kind=kind_phys), dimension(:,:), intent(inout) :: cnvw, cnvc + ! The following arrays may not be allocated, depending on certain flags and microphysics schemes. + ! Since Intel 15 crashes when passing unallocated arrays to arrays defined with explicit shape, + ! use assumed-shape arrays. Note that Intel 18 and GNU 6.2.0-8.1.0 tolerate explicit-shape arrays +diff --git a/physics/GFS_GWD_generic.F90 b/physics/GFS_GWD_generic.F90 +index 09c9691..a6c6dd4 100644 +--- a/physics/GFS_GWD_generic.F90 ++++ b/physics/GFS_GWD_generic.F90 +@@ -30,12 +30,12 @@ contains + real(kind=kind_phys), intent(in) :: mntvar(im,nmtvr) + + real(kind=kind_phys), intent(out) :: & +- & oc(im), oa4(im,4), clx(im,4), & ++ & oc(:), oa4(:,:), clx(:,:), & + & varss(:), ocss(:), oa4ss(:,:), clxss(:,:), & +- & theta(im), sigma(im), gamma(im), elvmax(im) ++ & theta(:), sigma(:), gamma(:), elvmax(:) + + logical, intent(in) :: lssav, ldiag3d, flag_for_gwd_generic_tend +- real(kind=kind_phys), intent(in) :: dtdt(im,levs), dudt(im,levs), dvdt(im,levs) ++ real(kind=kind_phys), intent(in) :: dtdt(:,:), dudt(:,:), dvdt(:,:) + ! dt3dt only allocated only if ldiag3d is .true. + real(kind=kind_phys), intent(inout) :: dt3dt(:,:), du3dt(:,:), dv3dt(:,:) + real(kind=kind_phys), intent(in) :: dtf +diff --git a/physics/GFS_MP_generic.F90 b/physics/GFS_MP_generic.F90 +index 8810cc7..be19536 100644 +--- a/physics/GFS_MP_generic.F90 ++++ b/physics/GFS_MP_generic.F90 +@@ -23,11 +23,11 @@ + implicit none + integer, intent(in) :: im, levs, ntcw, nncl, ntrac + logical, intent(in) :: ldiag3d, qdiag3d, do_aw +- real(kind=kind_phys), dimension(im, levs), intent(in) :: gt0 +- real(kind=kind_phys), dimension(im, levs, ntrac), intent(in) :: gq0 ++ real(kind=kind_phys), dimension(:,:), intent(in) :: gt0 ++ real(kind=kind_phys), dimension(:,:,:), intent(in) :: gq0 + +- real(kind=kind_phys), dimension(im, levs), intent(inout) :: save_t, save_qv +- real(kind=kind_phys), dimension(im, levs, ntrac), intent(inout) :: save_q ++ real(kind=kind_phys), dimension(:,:), intent(inout) :: save_t, save_qv ++ real(kind=kind_phys), dimension(:,:,:), intent(inout) :: save_q + + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg +@@ -109,16 +109,16 @@ + logical, intent(in) :: cal_pre, lssav, ldiag3d, qdiag3d, cplflx, cplchm + + real(kind=kind_phys), intent(in) :: dtf, frain, con_g +- real(kind=kind_phys), dimension(im), intent(in) :: rain1, xlat, xlon, tsfc +- real(kind=kind_phys), dimension(im), intent(inout) :: ice, snow, graupel, rainc +- real(kind=kind_phys), dimension(im), intent(in) :: rain0, ice0, snow0, graupel0 +- real(kind=kind_phys), dimension(im,nrcm), intent(in) :: rann +- real(kind=kind_phys), dimension(im,levs), intent(in) :: gt0, prsl, save_t, save_qv, del +- real(kind=kind_phys), dimension(im,levs+1), intent(in) :: prsi, phii +- real(kind=kind_phys), dimension(im,levs,ntrac), intent(in) :: gq0 +- +- real(kind=kind_phys), dimension(im), intent(in ) :: sr +- real(kind=kind_phys), dimension(im), intent(inout) :: rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, & ++ real(kind=kind_phys), dimension(:), intent(in) :: rain1, xlat, xlon, tsfc ++ real(kind=kind_phys), dimension(:), intent(inout) :: ice, snow, graupel, rainc ++ real(kind=kind_phys), dimension(:), intent(in) :: rain0, ice0, snow0, graupel0 ++ real(kind=kind_phys), dimension(:,:), intent(in) :: rann ++ real(kind=kind_phys), dimension(:,:), intent(in) :: gt0, prsl, save_t, save_qv, del ++ real(kind=kind_phys), dimension(:,:), intent(in) :: prsi, phii ++ real(kind=kind_phys), dimension(:,:,:), intent(in) :: gq0 ++ ++ real(kind=kind_phys), dimension(:), intent(in ) :: sr ++ real(kind=kind_phys), dimension(:), intent(inout) :: rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, & + srflag, cnvprcp, totprcp, totice, totsnw, totgrp, cnvprcpb, & + totprcpb, toticeb, totsnwb, totgrpb, rain_cpl, rainc_cpl, & + snow_cpl, pwat +@@ -128,23 +128,23 @@ + + ! Stochastic physics / surface perturbations + logical, intent(in) :: do_sppt, ca_global +- real(kind=kind_phys), dimension(im,levs), intent(inout) :: dtdtr +- real(kind=kind_phys), dimension(im,levs), intent(in) :: dtdtc +- real(kind=kind_phys), dimension(im), intent(inout) :: drain_cpl +- real(kind=kind_phys), dimension(im), intent(inout) :: dsnow_cpl ++ real(kind=kind_phys), dimension(:,:), intent(inout) :: dtdtr ++ real(kind=kind_phys), dimension(:,:), intent(in) :: dtdtc ++ real(kind=kind_phys), dimension(:), intent(inout) :: drain_cpl ++ real(kind=kind_phys), dimension(:), intent(inout) :: dsnow_cpl + + ! Rainfall variables previous time step + integer, intent(in) :: lsm, lsm_ruc, lsm_noahmp +- real(kind=kind_phys), dimension(im), intent(inout) :: raincprv +- real(kind=kind_phys), dimension(im), intent(inout) :: rainncprv +- real(kind=kind_phys), dimension(im), intent(inout) :: iceprv +- real(kind=kind_phys), dimension(im), intent(inout) :: snowprv +- real(kind=kind_phys), dimension(im), intent(inout) :: graupelprv +- real(kind=kind_phys), dimension(im), intent(inout) :: draincprv +- real(kind=kind_phys), dimension(im), intent(inout) :: drainncprv +- real(kind=kind_phys), dimension(im), intent(inout) :: diceprv +- real(kind=kind_phys), dimension(im), intent(inout) :: dsnowprv +- real(kind=kind_phys), dimension(im), intent(inout) :: dgraupelprv ++ real(kind=kind_phys), dimension(:), intent(inout) :: raincprv ++ real(kind=kind_phys), dimension(:), intent(inout) :: rainncprv ++ real(kind=kind_phys), dimension(:), intent(inout) :: iceprv ++ real(kind=kind_phys), dimension(:), intent(inout) :: snowprv ++ real(kind=kind_phys), dimension(:), intent(inout) :: graupelprv ++ real(kind=kind_phys), dimension(:), intent(inout) :: draincprv ++ real(kind=kind_phys), dimension(:), intent(inout) :: drainncprv ++ real(kind=kind_phys), dimension(:), intent(inout) :: diceprv ++ real(kind=kind_phys), dimension(:), intent(inout) :: dsnowprv ++ real(kind=kind_phys), dimension(:), intent(inout) :: dgraupelprv + + real(kind=kind_phys), intent(in) :: dtp + +diff --git a/physics/GFS_PBL_generic.F90 b/physics/GFS_PBL_generic.F90 +index 357309b..95f6265 100644 +--- a/physics/GFS_PBL_generic.F90 ++++ b/physics/GFS_PBL_generic.F90 +@@ -101,11 +101,11 @@ + integer, intent(in) :: imp_physics_zhao_carr, imp_physics_mg, imp_physics_fer_hires + logical, intent(in) :: cplchm, ltaerosol, hybedmf, do_shoc, satmedmf + +- real(kind=kind_phys), dimension(im, levs, ntrac), intent(in) :: qgrs +- real(kind=kind_phys), dimension(im, levs), intent(in) :: ugrs, vgrs, tgrs +- real(kind=kind_phys), dimension(im, levs, nvdiff), intent(inout) :: vdftra +- real(kind=kind_phys), dimension(im, levs), intent(out) :: save_u, save_v, save_t +- real(kind=kind_phys), dimension(im, levs, ntrac), intent(out) :: save_q ++ real(kind=kind_phys), dimension(:,:,:), intent(in) :: qgrs ++ real(kind=kind_phys), dimension(:,:), intent(in) :: ugrs, vgrs, tgrs ++ real(kind=kind_phys), dimension(:,:, :), intent(inout) :: vdftra ++ real(kind=kind_phys), dimension(:,:), intent(out) :: save_u, save_v, save_t ++ real(kind=kind_phys), dimension(:,:, :), intent(out) :: save_q + + ! CCPP error handling variables + character(len=*), intent(out) :: errmsg +@@ -336,8 +336,8 @@ + logical, dimension(:), intent(in) :: flag_cice + + logical, intent(in) :: flag_for_pbl_generic_tend +- real(kind=kind_phys), dimension(im, levs), intent(in) :: save_u, save_v, save_t +- real(kind=kind_phys), dimension(im, levs, ntrac), intent(in) :: save_q ++ real(kind=kind_phys), dimension(:,:), intent(in) :: save_u, save_v, save_t ++ real(kind=kind_phys), dimension(:,:, :), intent(in) :: save_q + + real(kind=kind_phys), intent(in) :: dtf + real(kind=kind_phys), intent(in) :: rd, cp, fvirt, hvap +@@ -346,14 +346,14 @@ + real(kind=kind_phys), dimension(:), intent(in) :: dusfc_cice, dvsfc_cice, dtsfc_cice, dqsfc_cice, & + wind, stress_wat, hflx_wat, evap_wat, ugrs1, vgrs1 + +- real(kind=kind_phys), dimension(im, levs, ntrac), intent(in) :: qgrs +- real(kind=kind_phys), dimension(im, levs), intent(in) :: ugrs, vgrs, tgrs ++ real(kind=kind_phys), dimension(:,:, :), intent(in) :: qgrs ++ real(kind=kind_phys), dimension(:,:), intent(in) :: ugrs, vgrs, tgrs + +- real(kind=kind_phys), dimension(im, levs, nvdiff), intent(in) :: dvdftra +- real(kind=kind_phys), dimension(im), intent(in) :: dusfc1, dvsfc1, dtsfc1, dqsfc1, xmu +- real(kind=kind_phys), dimension(im, levs), intent(in) :: dudt, dvdt, dtdt, htrsw, htrlw ++ real(kind=kind_phys), dimension(:,:, :), intent(in) :: dvdftra ++ real(kind=kind_phys), dimension(:), intent(in) :: dusfc1, dvsfc1, dtsfc1, dqsfc1, xmu ++ real(kind=kind_phys), dimension(:,:), intent(in) :: dudt, dvdt, dtdt, htrsw, htrlw + +- real(kind=kind_phys), dimension(im, levs, ntrac), intent(inout) :: dqdt ++ real(kind=kind_phys), dimension(:,:, :), intent(inout) :: dqdt + + ! The following arrays may not be allocated, depending on certain flags (cplflx, ...). + ! Since Intel 15 crashes when passing unallocated arrays to arrays defined with explicit shape, +@@ -370,7 +370,7 @@ + real(kind=kind_phys), dimension(:,:), intent(in) :: dkt + + ! From canopy heat storage - reduction factors in latent/sensible heat flux due to surface roughness +- real(kind=kind_phys), dimension(im), intent(in) :: hffac, hefac ++ real(kind=kind_phys), dimension(:), intent(in) :: hffac, hefac + + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg +diff --git a/physics/GFS_SCNV_generic.F90 b/physics/GFS_SCNV_generic.F90 +index ae8fac5..450f0e5 100644 +--- a/physics/GFS_SCNV_generic.F90 ++++ b/physics/GFS_SCNV_generic.F90 +@@ -23,9 +23,9 @@ + + integer, intent(in) :: im, levs + logical, intent(in) :: ldiag3d, qdiag3d, flag_for_scnv_generic_tend +- real(kind=kind_phys), dimension(im,levs), intent(in) :: gu0, gv0, gt0, gq0_water_vapor ++ real(kind=kind_phys), dimension(:, :), intent(in) :: gu0, gv0, gt0, gq0_water_vapor + +- real(kind=kind_phys), dimension(im,levs), intent(inout) :: save_u, save_v, save_t, save_qv ++ real(kind=kind_phys), dimension(:, :), intent(inout) :: save_u, save_v, save_t, save_qv + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + +@@ -84,20 +84,20 @@ + integer, intent(in) :: im, levs, nn + logical, intent(in) :: lssav, ldiag3d, qdiag3d, cplchm, flag_for_scnv_generic_tend + real(kind=kind_phys), intent(in) :: frain +- real(kind=kind_phys), dimension(im,levs), intent(in) :: gu0, gv0, gt0, gq0_water_vapor +- real(kind=kind_phys), dimension(im,levs), intent(in) :: save_u, save_v, save_t, save_qv ++ real(kind=kind_phys), dimension(:, :), intent(in) :: gu0, gv0, gt0, gq0_water_vapor ++ real(kind=kind_phys), dimension(:, :), intent(in) :: save_u, save_v, save_t, save_qv + + ! dqdti, dt3dt, dq3dt, only allocated if ldiag3d == .true. + real(kind=kind_phys), dimension(:,:), intent(inout) :: dqdti + real(kind=kind_phys), dimension(:,:), intent(inout) :: du3dt, dv3dt, dt3dt, dq3dt +- real(kind=kind_phys), dimension(im,levs,nn), intent(inout) :: clw ++ real(kind=kind_phys), dimension(:, :,:), intent(inout) :: clw + + ! Post code for SAS/SAMF + integer, intent(in) :: npdf3d, num_p3d, ncnvcld3d + logical, intent(in) :: shcnvcw +- real(kind=kind_phys), dimension(im), intent(in) :: rain1 +- real(kind=kind_phys), dimension(im,levs), intent(in) :: cnvw, cnvc +- real(kind=kind_phys), dimension(im), intent(inout) :: rainc, cnvprcp, cnvprcpb ++ real(kind=kind_phys), dimension(:), intent(in) :: rain1 ++ real(kind=kind_phys), dimension(:, :), intent(in) :: cnvw, cnvc ++ real(kind=kind_phys), dimension(:), intent(inout) :: rainc, cnvprcp, cnvprcpb + ! The following arrays may not be allocated, depending on certain flags and microphysics schemes. + ! Since Intel 15 crashes when passing unallocated arrays to arrays defined with explicit shape, + ! use assumed-shape arrays. Note that Intel 18 and GNU 6.2.0-8.1.0 tolerate explicit-shape arrays +diff --git a/physics/GFS_cloud_diagnostics.F90 b/physics/GFS_cloud_diagnostics.F90 +index c62cc68..f5d09cd 100644 +--- a/physics/GFS_cloud_diagnostics.F90 ++++ b/physics/GFS_cloud_diagnostics.F90 +@@ -53,15 +53,15 @@ contains + lslwr ! Call LW radiation + real(kind_phys), intent(in) :: & + con_pi ! Physical constant: pi +- real(kind_phys), dimension(nCol), intent(in) :: & ++ real(kind_phys), dimension(:), intent(in) :: & + lat, & ! Latitude + de_lgth ! Decorrelation length +- real(kind_phys), dimension(nCol,nLev), intent(in) :: & ++ real(kind_phys), dimension(:,:), intent(in) :: & + p_lay, & ! Pressure at model-layer + cld_frac ! Total cloud fraction +- real(kind_phys), dimension(nCol,nLev+1), intent(in) :: & ++ real(kind_phys), dimension(:,:), intent(in) :: & + p_lev ! Pressure at model interfaces +- real(kind_phys), dimension(nCol,nLev), intent(in) :: & ++ real(kind_phys), dimension(:,:), intent(in) :: & + deltaZ, & ! Layer thickness (km) + cloud_overlap_param, & ! Cloud-overlap parameter + precip_overlap_param ! Precipitation overlap parameter +@@ -71,10 +71,10 @@ contains + errmsg ! Error message + integer, intent(out) :: & + errflg ! Error flag +- integer,dimension(ncol,3),intent(out) :: & ++ integer,dimension(:,:),intent(out) :: & + mbota, & ! Vertical indices for cloud tops + mtopa ! Vertical indices for cloud bases +- real(kind_phys), dimension(ncol,5), intent(out) :: & ++ real(kind_phys), dimension(:,:), intent(out) :: & + cldsa ! Fraction of clouds for low, middle, high, total and BL + + ! Local variables +@@ -136,7 +136,7 @@ contains + integer, intent(in) :: & + nLev, & ! Number of vertical-layers + mpi_rank +- real(kind_phys), dimension(nLev+1), intent(in) :: & ++ real(kind_phys), dimension(:), intent(in) :: & + sigmainit + ! Outputs + integer, intent(out) :: & +diff --git a/physics/GFS_debug.F90 b/physics/GFS_debug.F90 +index 0562324..3c358a2 100644 +--- a/physics/GFS_debug.F90 ++++ b/physics/GFS_debug.F90 +@@ -970,29 +970,29 @@ + integer, intent(in ) :: im + integer, intent(in ) :: kdt + integer, intent(in ) :: iter +- logical, intent(in ) :: flag_iter(im) +- logical, intent(in ) :: flag_guess(im) ++ logical, intent(in ) :: flag_iter(:) ++ logical, intent(in ) :: flag_guess(:) + logical, intent(in ) :: flag_init + logical, intent(in ) :: flag_restart + logical, intent(in ) :: frac_grid + integer, intent(in ) :: isot + integer, intent(in ) :: ivegsrc +- real(kind_phys), intent(in ) :: stype(im) +- real(kind_phys), intent(in ) :: vtype(im) +- real(kind_phys), intent(in ) :: slope(im) +- integer, intent(in ) :: soiltyp(im) +- integer, intent(in ) :: vegtype(im) +- integer, intent(in ) :: slopetyp(im) +- logical, intent(in ) :: dry(im) +- logical, intent(in ) :: icy(im) +- logical, intent(in ) :: wet(im) +- logical, intent(in ) :: lake(im) +- logical, intent(in ) :: ocean(im) +- real(kind_phys), intent(in ) :: oceanfrac(im) +- real(kind_phys), intent(in ) :: landfrac(im) +- real(kind_phys), intent(in ) :: lakefrac(im) +- real(kind_phys), intent(in ) :: slmsk(im) +- integer, intent(in ) :: islmsk(im) ++ real(kind_phys), intent(in ) :: stype(:) ++ real(kind_phys), intent(in ) :: vtype(:) ++ real(kind_phys), intent(in ) :: slope(:) ++ integer, intent(in ) :: soiltyp(:) ++ integer, intent(in ) :: vegtype(:) ++ integer, intent(in ) :: slopetyp(:) ++ logical, intent(in ) :: dry(:) ++ logical, intent(in ) :: icy(:) ++ logical, intent(in ) :: wet(:) ++ logical, intent(in ) :: lake(:) ++ logical, intent(in ) :: ocean(:) ++ real(kind_phys), intent(in ) :: oceanfrac(:) ++ real(kind_phys), intent(in ) :: landfrac(:) ++ real(kind_phys), intent(in ) :: lakefrac(:) ++ real(kind_phys), intent(in ) :: slmsk(:) ++ integer, intent(in ) :: islmsk(:) + character(len=*), intent( out) :: errmsg + integer, intent( out) :: errflg + +diff --git a/physics/GFS_rrtmg_post.F90 b/physics/GFS_rrtmg_post.F90 +index 7f80ca4..82cc4c8 100644 +--- a/physics/GFS_rrtmg_post.F90 ++++ b/physics/GFS_rrtmg_post.F90 +@@ -39,17 +39,17 @@ + type(GFS_coupling_type), intent(inout) :: Coupling + type(GFS_radtend_type), intent(in) :: Radtend + type(GFS_diag_type), intent(inout) :: Diag +- type(cmpfsw_type), dimension(size(Grid%xlon,1)), intent(in) :: scmpsw ++ type(cmpfsw_type), dimension(:), intent(in) :: scmpsw + + integer, intent(in) :: im, lm, ltp, kt, kb, kd, nday + real(kind=kind_phys), intent(in) :: raddt + +- real(kind=kind_phys), dimension(size(Grid%xlon,1),NSPC1), intent(in) :: aerodp +- real(kind=kind_phys), dimension(size(Grid%xlon,1),5), intent(in) :: cldsa +- integer, dimension(size(Grid%xlon,1),3), intent(in) :: mbota, mtopa +- real(kind=kind_phys), dimension(size(Grid%xlon,1),lm+LTP), intent(in) :: clouds1 +- real(kind=kind_phys), dimension(size(Grid%xlon,1),lm+LTP), intent(in) :: cldtausw +- real(kind=kind_phys), dimension(size(Grid%xlon,1),lm+LTP), intent(in) :: cldtaulw ++ real(kind=kind_phys), dimension(:,:), intent(in) :: aerodp ++ real(kind=kind_phys), dimension(:,:), intent(in) :: cldsa ++ integer, dimension(:,:), intent(in) :: mbota, mtopa ++ real(kind=kind_phys), dimension(:,:), intent(in) :: clouds1 ++ real(kind=kind_phys), dimension(:,:), intent(in) :: cldtausw ++ real(kind=kind_phys), dimension(:,:), intent(in) :: cldtaulw + + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg +diff --git a/physics/GFS_rrtmg_pre.F90 b/physics/GFS_rrtmg_pre.F90 +index ca76955..514ea87 100644 +--- a/physics/GFS_rrtmg_pre.F90 ++++ b/physics/GFS_rrtmg_pre.F90 +@@ -95,39 +95,39 @@ + integer, intent(out) :: kd, kt, kb + + ! F-A mp scheme only +- real(kind=kind_phys), dimension(size(Grid%xlon,1),lm+LTP), intent(in) :: f_ice, & ++ real(kind=kind_phys), dimension(:, :), intent(in) :: f_ice, & + f_rain, f_rimef +- real(kind=kind_phys), dimension(size(Grid%xlon,1),lm+LTP), intent(out) :: cwm +- real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(in) :: flgmin ++ real(kind=kind_phys), dimension(:, :), intent(out) :: cwm ++ real(kind=kind_phys), dimension(:), intent(in) :: flgmin + real(kind=kind_phys), intent(out) :: raddt + +- real(kind=kind_phys), dimension(size(Grid%xlon,1),lm+LTP), intent(out) :: delp, & ++ real(kind=kind_phys), dimension(:, :), intent(out) :: delp, & + dz, plyr, tlyr, qlyr, olyr + +- real(kind=kind_phys), dimension(size(Grid%xlon,1),lm+1+LTP), intent(out) :: plvl, tlvl ++ real(kind=kind_phys), dimension(:, :), intent(out) :: plvl, tlvl + +- real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(out) :: tsfg, tsfa ++ real(kind=kind_phys), dimension(:), intent(out) :: tsfg, tsfa + +- real(kind=kind_phys), dimension(size(Grid%xlon,1),lm+LTP), intent(out) :: gasvmr_co2, & ++ real(kind=kind_phys), dimension(:, :), intent(out) :: gasvmr_co2, & + gasvmr_n2o, gasvmr_ch4, gasvmr_o2, gasvmr_co, gasvmr_cfc11, & + gasvmr_cfc12, gasvmr_cfc22, gasvmr_ccl4, gasvmr_cfc113 + +- real(kind=kind_phys), dimension(size(Grid%xlon,1),lm+LTP,NBDSW), intent(out) :: faersw1, & ++ real(kind=kind_phys), dimension(:,:,:), intent(out) :: faersw1, & + faersw2, faersw3 + +- real(kind=kind_phys), dimension(size(Grid%xlon,1),lm+LTP,NBDLW), intent(out) :: faerlw1, & ++ real(kind=kind_phys), dimension(:,:,:), intent(out) :: faerlw1, & + faerlw2, faerlw3 + +- real(kind=kind_phys), dimension(size(Grid%xlon,1),NSPC1), intent(out) :: aerodp ++ real(kind=kind_phys), dimension(:,:), intent(out) :: aerodp + +- real(kind=kind_phys), dimension(size(Grid%xlon,1),lm+LTP), intent(inout) :: clouds1, & ++ real(kind=kind_phys), dimension(:,:), intent(inout) :: clouds1, & + clouds2, clouds3, clouds4, clouds5 +- real(kind=kind_phys), dimension(size(Grid%xlon,1),lm+LTP), intent(out) :: clouds6, & ++ real(kind=kind_phys), dimension(:,:), intent(out) :: clouds6, & + clouds7, clouds8, clouds9 + +- real(kind=kind_phys), dimension(size(Grid%xlon,1),5), intent(out) :: cldsa +- integer, dimension(size(Grid%xlon,1),3), intent(out) :: mbota, mtopa +- real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(out) :: de_lgth, alb1d ++ real(kind=kind_phys), dimension(:,:), intent(out) :: cldsa ++ integer, dimension(:,:), intent(out) :: mbota, mtopa ++ real(kind=kind_phys), dimension(:), intent(out) :: de_lgth, alb1d + + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg +diff --git a/physics/GFS_rrtmgp_gfdlmp_pre.F90 b/physics/GFS_rrtmgp_gfdlmp_pre.F90 +index b67b22d..a11f03c 100644 +--- a/physics/GFS_rrtmgp_gfdlmp_pre.F90 ++++ b/physics/GFS_rrtmgp_gfdlmp_pre.F90 +@@ -62,24 +62,24 @@ contains + con_g, & ! Physical constant: gravitational constant + con_rd, & ! Physical constant: gas-constant for dry air + con_epsq ! Physical constant(?): Minimum value for specific humidity +- real(kind_phys), dimension(nCol), intent(in) :: & ++ real(kind_phys), dimension(:), intent(in) :: & + lat ! Latitude +- real(kind_phys), dimension(nCol,nLev), intent(in) :: & ++ real(kind_phys), dimension(:, :), intent(in) :: & + tv_lay, & ! Virtual temperature (K) + p_lay, & ! Pressure at model-layers (Pa) + effrin_cldliq, & ! Effective radius for liquid cloud-particles (microns) + effrin_cldice, & ! Effective radius for ice cloud-particles (microns) + effrin_cldrain, & ! Effective radius for rain cloud-particles (microns) + effrin_cldsnow ! Effective radius for snow cloud-particles (microns) +- real(kind_phys), dimension(nCol,nLev+1), intent(in) :: & ++ real(kind_phys), dimension(:, :), intent(in) :: & + p_lev ! Pressure at model-level interfaces (Pa) +- real(kind_phys), dimension(nCol, nLev, nTracers),intent(in) :: & ++ real(kind_phys), dimension(:, :, :),intent(in) :: & + tracer ! Cloud condensate amount in layer by type () + + ! Outputs +- real(kind_phys), dimension(nCol),intent(out) :: & ++ real(kind_phys), dimension(:),intent(out) :: & + de_lgth ! Decorrelation length +- real(kind_phys), dimension(nCol,nLev),intent(out) :: & ++ real(kind_phys), dimension(:, :),intent(out) :: & + cld_frac, & ! Total cloud fraction + cld_lwp, & ! Cloud liquid water path + cld_reliq, & ! Cloud liquid effective radius +diff --git a/physics/GFS_rrtmgp_lw_post.F90 b/physics/GFS_rrtmgp_lw_post.F90 +index a6b37ac..b508996 100644 +--- a/physics/GFS_rrtmgp_lw_post.F90 ++++ b/physics/GFS_rrtmgp_lw_post.F90 +@@ -39,11 +39,11 @@ contains + save_diag ! Output radiation diagnostics? + real(kind_phys), intent(in) :: & + fhlwr ! Frequency for SW radiation +- real(kind_phys), dimension(nCol), intent(in) :: & ++ real(kind_phys), dimension(:), intent(in) :: & + tsfa ! Lowest model layer air temperature for radiation (K) +- real(kind_phys), dimension(nCol, nLev), intent(in) :: & ++ real(kind_phys), dimension(:, :), intent(in) :: & + t_lay ! Temperature @ model layer centers (K) +- real(kind_phys), dimension(nCol, nLev+1), intent(in) :: & ++ real(kind_phys), dimension(:, :), intent(in) :: & + p_lev, & ! Pressure @ model layer-interfaces (Pa) + fluxlwUP_allsky, & ! RRTMGP longwave all-sky flux (W/m2) + fluxlwDOWN_allsky, & ! RRTMGP longwave all-sky flux (W/m2) +@@ -51,26 +51,26 @@ contains + fluxlwDOWN_clrsky ! RRTMGP longwave clear-sky flux (W/m2) + real(kind_phys), intent(in) :: & + raddt ! Radiation time step +- real(kind_phys), dimension(nCol,NSPC1), intent(in) :: & ++ real(kind_phys), dimension(:, :), intent(in) :: & + aerodp ! Vertical integrated optical depth for various aerosol species +- real(kind_phys), dimension(nCol,5), intent(in) :: & ++ real(kind_phys), dimension(:, :), intent(in) :: & + cldsa ! Fraction of clouds for low, middle, high, total and BL +- integer, dimension(nCol,3), intent(in) ::& ++ integer, dimension(:, :), intent(in) ::& + mbota, & ! vertical indices for low, middle and high cloud tops + mtopa ! vertical indices for low, middle and high cloud bases +- real(kind_phys), dimension(nCol,nLev), intent(in) :: & ++ real(kind_phys), dimension(:, :), intent(in) :: & + cld_frac, & ! Total cloud fraction in each layer + cldtaulw ! approx 10.mu band layer cloud optical depth + + ! Outputs (mandatory) +- real(kind_phys), dimension(nCol), intent(out) :: & ++ real(kind_phys), dimension(:), intent(out) :: & + sfcdlw, & ! Total sky sfc downward lw flux (W/m2) + tsflw ! surface air temp during lw calculation (K) +- type(sfcflw_type), dimension(nCol), intent(out) :: & ++ type(sfcflw_type), dimension(:), intent(out) :: & + sfcflw ! LW radiation fluxes at sfc +- real(kind_phys), dimension(nCol,nLev), intent(out) :: & ++ real(kind_phys), dimension(:, :), intent(out) :: & + htrlw ! LW all-sky heating rate +- type(topflw_type), dimension(nCol), intent(out) :: & ++ type(topflw_type), dimension(:), intent(out) :: & + topflw ! lw_fluxes_top_atmosphere + character(len=*), intent(out) :: & + errmsg +@@ -78,13 +78,13 @@ contains + errflg + + ! Outputs (optional) +- type(proflw_type), dimension(nCol, nLev+1), optional, intent(out) :: & ++ type(proflw_type), dimension(:, :), optional, intent(out) :: & + flxprf_lw ! 2D radiative fluxes, components: + ! upfxc - total sky upward flux (W/m2) + ! dnfxc - total sky dnward flux (W/m2) + ! upfx0 - clear sky upward flux (W/m2) + ! dnfx0 - clear sky dnward flux (W/m2) +- real(kind_phys),dimension(nCol, nLev),intent(out),optional :: & ++ real(kind_phys),dimension(:, :),intent(out),optional :: & + htrlwc ! Longwave clear-sky heating-rate (K/sec) + + ! Local variables +diff --git a/physics/GFS_rrtmgp_pre.F90 b/physics/GFS_rrtmgp_pre.F90 +index 0e5d65f..7d66339 100644 +--- a/physics/GFS_rrtmgp_pre.F90 ++++ b/physics/GFS_rrtmgp_pre.F90 +@@ -52,7 +52,7 @@ contains + character(len=*), intent(in) :: & + active_gases ! List of active gases from namelist. + ! Outputs +- character(len=*),dimension(nGases), intent(out) :: & ++ character(len=*),dimension(:), intent(out) :: & + active_gases_array ! Character array containing trace gases to include in RRTMGP + character(len=*), intent(out) :: & + errmsg ! Error message +@@ -159,7 +159,7 @@ contains + logical, intent(in) :: & + lsswr, & ! Call SW radiation? + lslwr ! Call LW radiation +- character(len=*),dimension(nGases), intent(in) :: & ++ character(len=*),dimension(:), intent(in) :: & + active_gases_array ! Character array containing trace gases to include in RRTMGP + real(kind_phys), intent(in) :: & + fhswr, & ! Frequency of SW radiation call. +@@ -169,11 +169,11 @@ contains + con_epsm1, & ! Physical constant: Epsilon (Rd/Rv) minus one + con_fvirt, & ! Physical constant: Inverse of epsilon minus one + con_epsqs ! Physical constant: Minimum saturation mixing-ratio (kg/kg) +- real(kind_phys), dimension(nCol), intent(in) :: & ++ real(kind_phys), dimension(:), intent(in) :: & + xlon, & ! Longitude + xlat, & ! Latitude + tsfc ! Surface skin temperature (K) +- real(kind_phys), dimension(nCol,nLev), intent(in) :: & ++ real(kind_phys), dimension(:, :), intent(in) :: & + prsl, & ! Pressure at model-layer centers (Pa) + tgrs, & ! Temperature at model-layer centers (K) + prslk ! Exner function at model layer centers (1) +@@ -189,18 +189,18 @@ contains + errflg ! Error flag + real(kind_phys), intent(out) :: & + raddt ! Radiation time-step +- real(kind_phys), dimension(ncol), intent(out) :: & ++ real(kind_phys), dimension(:), intent(out) :: & + tsfg, & ! Ground temperature + tsfa ! Skin temperature +- real(kind_phys), dimension(nCol,nLev), intent(out) :: & ++ real(kind_phys), dimension(:, :), intent(out) :: & + p_lay, & ! Pressure at model-layer + t_lay, & ! Temperature at model layer + tv_lay, & ! Virtual temperature at model-layers + relhum ! Relative-humidity at model-layers +- real(kind_phys), dimension(nCol,nLev+1), intent(out) :: & ++ real(kind_phys), dimension(:, :), intent(out) :: & + p_lev, & ! Pressure at model-interface + t_lev ! Temperature at model-interface +- real(kind_phys), dimension(nCol, nLev, nTracers),intent(out) :: & ++ real(kind_phys), dimension(:, :,:),intent(out) :: & + tracer ! Array containing trace gases + type(ty_gas_concs),intent(out) :: & + gas_concentrations ! RRTMGP DDT: gas volumne mixing ratios +diff --git a/physics/GFS_rrtmgp_setup.F90 b/physics/GFS_rrtmgp_setup.F90 +index 9b503e3..acc3024 100644 +--- a/physics/GFS_rrtmgp_setup.F90 ++++ b/physics/GFS_rrtmgp_setup.F90 +@@ -54,14 +54,14 @@ module GFS_rrtmgp_setup + imp_physics_zhao_carr, & ! Flag for zhao-carr scheme + imp_physics_zhao_carr_pdf, & ! Flag for zhao-carr+PDF scheme + imp_physics_mg ! Flag for MG scheme +- real(kind_phys), dimension(levr+1), intent(in) :: & ++ real(kind_phys), dimension(:), intent(in) :: & + si + integer, intent(in) :: levr, ictm, isol, ico2, iaer, ialb, iems, & + ntcw, num_p3d, ntoz, iovr_sw, iovr_lw, isubc_sw, isubc_lw, & + icliq_sw, iflip, me + logical, intent(in) :: & + crick_proof, ccnorm, norad_precip +- integer, intent(in), dimension(4) :: & ++ integer, intent(in), dimension(:) :: & + idate + ! Outputs + character(len=*), intent(out) :: errmsg +diff --git a/physics/GFS_rrtmgp_sw_post.F90 b/physics/GFS_rrtmgp_sw_post.F90 +index 0d3991f..8fdf3fa 100644 +--- a/physics/GFS_rrtmgp_sw_post.F90 ++++ b/physics/GFS_rrtmgp_sw_post.F90 +@@ -37,7 +37,7 @@ contains + nCol, & ! Horizontal loop extent + nLev, & ! Number of vertical layers + nDay ! Number of daylit columns +- integer, intent(in), dimension(nday) :: & ++ integer, intent(in), dimension(:) :: & + idxday ! Index array for daytime points + logical, intent(in) :: & + lsswr, & ! Call SW radiation? +@@ -47,37 +47,37 @@ contains + sw_gas_props ! DDT containing SW spectral information + real(kind_phys), intent(in) :: & + fhswr ! Frequency for SW radiation +- real(kind_phys), dimension(nCol), intent(in) :: & ++ real(kind_phys), dimension(ncol), intent(in) :: & + t_lay, & ! Temperature at model layer centers (K) + coszen, & ! Cosine(SZA) + coszdg ! Cosine(SZA), daytime +- real(kind_phys), dimension(nCol, nLev+1), intent(in) :: & ++ real(kind_phys), dimension(:, :), intent(in) :: & + p_lev ! Pressure @ model layer-interfaces (Pa) +- real(kind_phys), dimension(sw_gas_props%get_nband(),ncol), intent(in) :: & ++ real(kind_phys), dimension(:, :), intent(in) :: & + sfc_alb_nir_dir, & ! Surface albedo (direct) + sfc_alb_nir_dif, & ! Surface albedo (diffuse) + sfc_alb_uvvis_dir, & ! Surface albedo (direct) + sfc_alb_uvvis_dif ! Surface albedo (diffuse) +- real(kind_phys), dimension(nCol, nLev+1), intent(in) :: & ++ real(kind_phys), dimension(:, :), intent(in) :: & + fluxswUP_allsky, & ! SW All-sky flux (W/m2) + fluxswDOWN_allsky, & ! SW All-sky flux (W/m2) + fluxswUP_clrsky, & ! SW Clear-sky flux (W/m2) + fluxswDOWN_clrsky ! SW All-sky flux (W/m2) + real(kind_phys), intent(in) :: & + raddt ! Radiation time step +- real(kind_phys), dimension(nCol,NSPC1), intent(in) :: & ++ real(kind_phys), dimension(:, :), intent(in) :: & + aerodp ! Vertical integrated optical depth for various aerosol species +- real(kind_phys), dimension(nCol,5), intent(in) :: & ++ real(kind_phys), dimension(:, :), intent(in) :: & + cldsa ! Fraction of clouds for low, middle, high, total and BL +- integer, dimension(nCol,3), intent(in) ::& ++ integer, dimension(:, :), intent(in) ::& + mbota, & ! vertical indices for low, middle and high cloud tops + mtopa ! vertical indices for low, middle and high cloud bases +- real(kind_phys), dimension(nCol,nLev), intent(in) :: & ++ real(kind_phys), dimension(:, :), intent(in) :: & + cld_frac, & ! Total cloud fraction in each layer + cldtausw ! approx .55mu band layer cloud optical depth + + ! Inputs (optional) +- type(cmpfsw_type), dimension(nCol), intent(in), optional :: & ++ type(cmpfsw_type), dimension(:), intent(in), optional :: & + scmpsw ! 2D surface fluxes, components: + ! uvbfc - total sky downward uv-b flux at (W/m2) + ! uvbf0 - clear sky downward uv-b flux at (W/m2) +@@ -87,7 +87,7 @@ contains + ! visdf - downward uv+vis diffused flux (W/m2) + + ! Outputs (mandatory) +- real(kind_phys), dimension(nCol), intent(out) :: & ++ real(kind_phys), dimension(:), intent(out) :: & + nirbmdi, & ! sfc nir beam sw downward flux (W/m2) + nirdfdi, & ! sfc nir diff sw downward flux (W/m2) + visbmdi, & ! sfc uv+vis beam sw downward flux (W/m2) +@@ -98,11 +98,11 @@ contains + visdfui, & ! sfc uv+vis diff sw upward flux (W/m2) + sfcnsw, & ! total sky sfc netsw flx into ground + sfcdsw ! +- real(kind_phys), dimension(nCol,nLev), intent(out) :: & ++ real(kind_phys), dimension(:, :), intent(out) :: & + htrsw ! SW all-sky heating rate +- type(sfcfsw_type), dimension(nCol), intent(out) :: & ++ type(sfcfsw_type), dimension(:), intent(out) :: & + sfcfsw ! sw radiation fluxes at sfc +- type(topfsw_type), dimension(nCol), intent(out) :: & ++ type(topfsw_type), dimension(:), intent(out) :: & + topfsw ! sw_fluxes_top_atmosphere + character(len=*), intent(out) :: & + errmsg +@@ -110,13 +110,13 @@ contains + errflg + + ! Outputs (optional) +- type(profsw_type), dimension(nCol, nLev), intent(out), optional :: & ++ type(profsw_type), dimension(:, :), intent(out), optional :: & + flxprf_sw ! 2D radiative fluxes, components: + ! upfxc - total sky upward flux (W/m2) + ! dnfxc - total sky dnward flux (W/m2) + ! upfx0 - clear sky upward flux (W/m2) + ! dnfx0 - clear sky dnward flux (W/m2) +- real(kind_phys),dimension(nCol, nLev),intent(out),optional :: & ++ real(kind_phys),dimension(:, :),intent(out),optional :: & + htrswc ! Clear-sky heating rate (K/s) + + ! Local variables +diff --git a/physics/GFS_rrtmgp_sw_pre.F90 b/physics/GFS_rrtmgp_sw_pre.F90 +index c4208d8..5c741a7 100644 +--- a/physics/GFS_rrtmgp_sw_pre.F90 ++++ b/physics/GFS_rrtmgp_sw_pre.F90 +@@ -45,9 +45,9 @@ contains + do_sfcperts + real(kind_phys), intent(in) :: & + solhr ! Time in hours after 00z at the current timestep +- real(kind_phys), dimension(5), intent(in) :: & ++ real(kind_phys), dimension(:), intent(in) :: & + pertalb ! Magnitude of surface albedo perturbation (frac) +- real(kind_phys), dimension(nCol), intent(in) :: & ++ real(kind_phys), dimension(:), intent(in) :: & + lsmask, & ! Landmask: sea/land/ice=0/1/2 + lon, & ! Longitude + coslat, & ! Cosine(latitude) +@@ -66,13 +66,13 @@ contains + facwf, & ! Fractional coverage with weak cosz dependency (frac) + fice, & ! Ice fraction over open water (frac) + tisfc ! Sea ice surface skin temperature (K) +- real(kind_phys), dimension(nCol,nsfcpert), intent(in) :: & ++ real(kind_phys), dimension(:, :), intent(in) :: & + sfc_wts ! Weights for stochastic surface physics perturbation () +- real(kind_phys), dimension(nCol,nLev),intent(in) :: & ++ real(kind_phys), dimension(:, :),intent(in) :: & + p_lay, & ! Layer pressure + tv_lay, & ! Layer virtual-temperature + relhum ! Layer relative-humidity +- real(kind_phys), dimension(nCol,nLev+1),intent(in) :: & ++ real(kind_phys), dimension(:, :),intent(in) :: & + p_lev ! Pressure @ layer interfaces (Pa) + type(ty_gas_optics_rrtmgp),intent(in) :: & + sw_gas_props ! RRTMGP DDT: spectral information for SW calculation +@@ -80,14 +80,14 @@ contains + ! Outputs + integer, intent(out) :: & + nday ! Number of daylit points +- integer, dimension(ncol), intent(out) :: & ++ integer, dimension(:), intent(out) :: & + idxday ! Indices for daylit points +- real(kind_phys), dimension(ncol), intent(out) :: & ++ real(kind_phys), dimension(:), intent(out) :: & + alb1d, & ! Surface albedo pertubation + coszen, & ! Cosine of SZA + coszdg, & ! Cosine of SZA, daytime + sfc_alb_dif ! Mean surface diffused (nIR+uvvis) sw albedo +- real(kind_phys), dimension(sw_gas_props%get_nband(),ncol), intent(out) :: & ++ real(kind_phys), dimension(:, :), intent(out) :: & + sfc_alb_nir_dir, & ! Surface albedo (direct) + sfc_alb_nir_dif, & ! Surface albedo (diffuse) + sfc_alb_uvvis_dir, & ! Surface albedo (direct) +diff --git a/physics/GFS_rrtmgp_zhaocarr_pre.F90 b/physics/GFS_rrtmgp_zhaocarr_pre.F90 +index ac9fb74..0be3be7 100644 +--- a/physics/GFS_rrtmgp_zhaocarr_pre.F90 ++++ b/physics/GFS_rrtmgp_zhaocarr_pre.F90 +@@ -59,10 +59,10 @@ contains + con_ttp, & ! Triple point temperature of water (K) + con_rd, & ! Ideal gas constant for dry air (J/kg/K) + con_pi ! Pi +- real(kind_phys), dimension(nCol), intent(in) :: & ++ real(kind_phys), dimension(:), intent(in) :: & + lsmask, & ! Land/Sea mask + lat ! Latitude +- real(kind_phys), dimension(nCol,nLev), intent(in) :: & ++ real(kind_phys), dimension(:, :), intent(in) :: & + tv_lay, & ! Virtual temperature (K) + p_lay, & ! Pressure at model-layers (Pa) + t_lay, & ! Temperature at model-layers (K) +@@ -73,15 +73,15 @@ contains + effrin_cldsnow, & ! Effective radius for snow cloud-particles (microns) + shoc_sgs_cldfrac, & ! Subgrid-scale cloud fraction from the SHOC scheme + cncvw ! Convective cloud water mixing ratio (kg/kg) +- real(kind_phys), dimension(nCol,nLev+1), intent(in) :: & ++ real(kind_phys), dimension(:, :), intent(in) :: & + p_lev ! Pressure at model-level interfaces (Pa) +- real(kind_phys), dimension(nCol, nLev, nTracers),intent(in) :: & ++ real(kind_phys), dimension(:, :, :),intent(in) :: & + tracer ! Cloud condensate amount in layer by type () + + ! Outputs +- real(kind_phys), dimension(nCol),intent(out) :: & ++ real(kind_phys), dimension(:),intent(out) :: & + de_lgth ! Decorrelation length +- real(kind_phys), dimension(nCol,nLev),intent(out) :: & ++ real(kind_phys), dimension(:, :),intent(out) :: & + cld_frac, & ! Total cloud fraction + cld_lwp, & ! Cloud liquid water path + cld_reliq, & ! Cloud liquid effective radius +diff --git a/physics/GFS_stochastics.F90 b/physics/GFS_stochastics.F90 +index 9b4533c..ce3060c 100644 +--- a/physics/GFS_stochastics.F90 ++++ b/physics/GFS_stochastics.F90 +@@ -50,7 +50,7 @@ + logical, intent(in) :: use_zmtnblck + logical, intent(in) :: do_shum + logical, intent(in) :: do_skeb +- real(kind_phys), dimension(1:im), intent(in) :: zmtnblck ++ real(kind_phys), dimension(:), intent(in) :: zmtnblck + ! sppt_wts only allocated if do_sppt == .true. + real(kind_phys), dimension(:,:), intent(inout) :: sppt_wts + ! skebu_wts, skebv_wts only allocated if do_skeb == .true. +@@ -59,28 +59,28 @@ + ! shum_wts only allocated if do_shum == .true. + real(kind_phys), dimension(:,:), intent(in) :: shum_wts + ! inverse/flipped weights are always allocated +- real(kind_phys), dimension(1:im,1:km), intent(inout) :: sppt_wts_inv +- real(kind_phys), dimension(1:im,1:km), intent(inout) :: skebu_wts_inv +- real(kind_phys), dimension(1:im,1:km), intent(inout) :: skebv_wts_inv +- real(kind_phys), dimension(1:im,1:km), intent(inout) :: shum_wts_inv +- real(kind_phys), dimension(1:im,1:km), intent(in) :: diss_est +- real(kind_phys), dimension(1:im,1:km), intent(in) :: ugrs +- real(kind_phys), dimension(1:im,1:km), intent(in) :: vgrs +- real(kind_phys), dimension(1:im,1:km), intent(in) :: tgrs +- real(kind_phys), dimension(1:im,1:km), intent(in) :: qgrs +- real(kind_phys), dimension(1:im,1:km), intent(inout) :: gu0 +- real(kind_phys), dimension(1:im,1:km), intent(inout) :: gv0 +- real(kind_phys), dimension(1:im,1:km), intent(inout) :: gt0 +- real(kind_phys), dimension(1:im,1:km), intent(inout) :: gq0 ++ real(kind_phys), dimension(:,:), intent(inout) :: sppt_wts_inv ++ real(kind_phys), dimension(:,:), intent(inout) :: skebu_wts_inv ++ real(kind_phys), dimension(:,:), intent(inout) :: skebv_wts_inv ++ real(kind_phys), dimension(:,:), intent(inout) :: shum_wts_inv ++ real(kind_phys), dimension(:,:), intent(in) :: diss_est ++ real(kind_phys), dimension(:,:), intent(in) :: ugrs ++ real(kind_phys), dimension(:,:), intent(in) :: vgrs ++ real(kind_phys), dimension(:,:), intent(in) :: tgrs ++ real(kind_phys), dimension(:,:), intent(in) :: qgrs ++ real(kind_phys), dimension(:,:), intent(inout) :: gu0 ++ real(kind_phys), dimension(:,:), intent(inout) :: gv0 ++ real(kind_phys), dimension(:,:), intent(inout) :: gt0 ++ real(kind_phys), dimension(:,:), intent(inout) :: gq0 + ! dtdtr only allocated if do_sppt == .true. + real(kind_phys), dimension(:,:), intent(in) :: dtdtr +- real(kind_phys), dimension(1:im), intent(in) :: rain +- real(kind_phys), dimension(1:im), intent(in) :: rainc +- real(kind_phys), dimension(1:im), intent(inout) :: tprcp +- real(kind_phys), dimension(1:im), intent(inout) :: totprcp +- real(kind_phys), dimension(1:im), intent(inout) :: cnvprcp +- real(kind_phys), dimension(1:im), intent(inout) :: totprcpb +- real(kind_phys), dimension(1:im), intent(inout) :: cnvprcpb ++ real(kind_phys), dimension(:), intent(in) :: rain ++ real(kind_phys), dimension(:), intent(in) :: rainc ++ real(kind_phys), dimension(:), intent(inout) :: tprcp ++ real(kind_phys), dimension(:), intent(inout) :: totprcp ++ real(kind_phys), dimension(:), intent(inout) :: cnvprcp ++ real(kind_phys), dimension(:), intent(inout) :: totprcpb ++ real(kind_phys), dimension(:), intent(inout) :: cnvprcpb + logical, intent(in) :: cplflx + ! rain_cpl, snow_cpl only allocated if cplflx == .true. or cplchm == .true. + real(kind_phys), dimension(:), intent(inout) :: rain_cpl +@@ -88,9 +88,9 @@ + ! drain_cpl, dsnow_cpl only allocated if cplflx == .true. or cplchm == .true. + real(kind_phys), dimension(:), intent(in) :: drain_cpl + real(kind_phys), dimension(:), intent(in) :: dsnow_cpl +- real(kind_phys), dimension(1:km), intent(in) :: si +- real(kind_phys), dimension(1:km), intent(inout) :: vfact_ca +- real(kind_phys), dimension(1:im), intent(in) :: ca1 ++ real(kind_phys), dimension(:), intent(in) :: si ++ real(kind_phys), dimension(:), intent(inout) :: vfact_ca ++ real(kind_phys), dimension(:), intent(in) :: ca1 + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + +diff --git a/physics/GFS_suite_interstitial.F90 b/physics/GFS_suite_interstitial.F90 +index 263e316..4214dbf 100644 +--- a/physics/GFS_suite_interstitial.F90 ++++ b/physics/GFS_suite_interstitial.F90 +@@ -94,12 +94,12 @@ + ! interface variables + integer, intent(in) :: im, levs, ntrac + real(kind=kind_phys), intent(in) :: dtf, dtp, dxmin, dxinv +- real(kind=kind_phys), intent(in), dimension(im) :: slmsk, area, pgr ++ real(kind=kind_phys), intent(in), dimension(:) :: slmsk, area, pgr + +- integer, intent(out), dimension(im) :: islmsk +- real(kind=kind_phys), intent(out), dimension(im) :: work1, work2, psurf +- real(kind=kind_phys), intent(out), dimension(im,levs) :: dudt, dvdt, dtdt, dtdtc +- real(kind=kind_phys), intent(out), dimension(im,levs,ntrac) :: dqdt ++ integer, intent(out), dimension(:) :: islmsk ++ real(kind=kind_phys), intent(out), dimension(:) :: work1, work2, psurf ++ real(kind=kind_phys), intent(out), dimension(:,:) :: dudt, dvdt, dtdt, dtdtc ++ real(kind=kind_phys), intent(out), dimension(:,:,:) :: dqdt + real(kind=kind_phys), parameter :: zero = 0.0_kind_phys, one = 1.0_kind_phys + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg +@@ -173,34 +173,34 @@ + logical, intent(in ) :: old_monin, mstrat, do_shoc, frac_grid + real(kind=kind_phys), intent(in ) :: dtf, cp, hvap + +- logical, intent(in ), dimension(im) :: flag_cice +- real(kind=kind_phys), intent(in ), dimension(2) :: ctei_rm +- real(kind=kind_phys), intent(in ), dimension(im) :: xcosz, adjsfcdsw, adjsfcdlw, pgr, xmu, ulwsfc_cice, work1, work2 +- real(kind=kind_phys), intent(in ), dimension(im) :: cice +- real(kind=kind_phys), intent(in ), dimension(im, levs) :: htrsw, htrlw, tgrs, prsl, qgrs_water_vapor, qgrs_cloud_water, prslk +- real(kind=kind_phys), intent(in ), dimension(im, levs+1) :: prsi +- real(kind=kind_phys), intent(in ), dimension(im, levs, 6) :: lwhd +- integer, intent(inout), dimension(im) :: kinver +- real(kind=kind_phys), intent(inout), dimension(im) :: suntim, dlwsfc, ulwsfc, psmean, ctei_rml, ctei_r +- real(kind=kind_phys), intent(in ), dimension(im) :: adjsfculw_lnd, adjsfculw_ice, adjsfculw_wat +- real(kind=kind_phys), intent( out), dimension(im) :: adjsfculw ++ logical, intent(in ), dimension(:) :: flag_cice ++ real(kind=kind_phys), intent(in ), dimension(:) :: ctei_rm ++ real(kind=kind_phys), intent(in ), dimension(:) :: xcosz, adjsfcdsw, adjsfcdlw, pgr, xmu, ulwsfc_cice, work1, work2 ++ real(kind=kind_phys), intent(in ), dimension(:) :: cice ++ real(kind=kind_phys), intent(in ), dimension(:, :) :: htrsw, htrlw, tgrs, prsl, qgrs_water_vapor, qgrs_cloud_water, prslk ++ real(kind=kind_phys), intent(in ), dimension(:, :) :: prsi ++ real(kind=kind_phys), intent(in ), dimension(:, :, :) :: lwhd ++ integer, intent(inout), dimension(:) :: kinver ++ real(kind=kind_phys), intent(inout), dimension(:) :: suntim, dlwsfc, ulwsfc, psmean, ctei_rml, ctei_r ++ real(kind=kind_phys), intent(in ), dimension(:) :: adjsfculw_lnd, adjsfculw_ice, adjsfculw_wat ++ real(kind=kind_phys), intent( out), dimension(:) :: adjsfculw + + ! RRTMGP + logical, intent(in ) :: & + use_GP_jacobian ! Use RRTMGP LW Jacobian of upwelling to adjust the surface flux? +- real(kind=kind_phys), intent(in ), dimension(im) :: & ++ real(kind=kind_phys), intent(in ), dimension(:) :: & + skt ! Skin temperature +- real(kind=kind_phys), intent(inout), dimension(im) :: & ++ real(kind=kind_phys), intent(inout), dimension(:) :: & + sktp1r ! Skin temperature at previous timestep +- real(kind=kind_phys), intent(in ), dimension(im,levs+1), optional :: & ++ real(kind=kind_phys), intent(in ), dimension(:,:), optional :: & + fluxlwUP, & ! Upwelling LW flux (W/m2) + fluxlwUP_jac ! Jacobian of upwelling LW flux (W/m2/K) + + ! These arrays are only allocated if ldiag3d is .true. + real(kind=kind_phys), intent(inout), dimension(:,:) :: dt3dt_lw, dt3dt_sw, dt3dt_pbl, dt3dt_dcnv, dt3dt_scnv, dt3dt_mp + +- logical, intent(in ), dimension(im) :: dry, icy, wet +- real(kind=kind_phys), intent(in ), dimension(im) :: frland ++ logical, intent(in ), dimension(:) :: dry, icy, wet ++ real(kind=kind_phys), intent(in ), dimension(:) :: frland + real(kind=kind_phys), intent(in ) :: huge + + character(len=*), intent(out) :: errmsg +@@ -402,10 +402,10 @@ + integer, intent(in) :: im + integer, intent(in) :: levs + integer, intent(in) :: ntrac +- real(kind=kind_phys), dimension(im,levs), intent(in) :: tgrs, ugrs, vgrs +- real(kind=kind_phys), dimension(im,levs,ntrac), intent(in) :: qgrs +- real(kind=kind_phys), dimension(im,levs), intent(out) :: gt0, gu0, gv0 +- real(kind=kind_phys), dimension(im,levs,ntrac), intent(out) :: gq0 ++ real(kind=kind_phys), dimension(:,:), intent(in) :: tgrs, ugrs, vgrs ++ real(kind=kind_phys), dimension(:,:,:), intent(in) :: qgrs ++ real(kind=kind_phys), dimension(:,:), intent(out) :: gt0, gu0, gv0 ++ real(kind=kind_phys), dimension(:,:,:), intent(out) :: gq0 + + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg +@@ -451,12 +451,12 @@ + integer, intent(in) :: ntrac + real(kind=kind_phys), intent(in) :: dtp + +- real(kind=kind_phys), dimension(im,levs), intent(in) :: tgrs, ugrs, vgrs +- real(kind=kind_phys), dimension(im,levs,ntrac), intent(in) :: qgrs +- real(kind=kind_phys), dimension(im,levs), intent(in) :: dudt, dvdt, dtdt +- real(kind=kind_phys), dimension(im,levs,ntrac), intent(in) :: dqdt +- real(kind=kind_phys), dimension(im,levs), intent(out) :: gt0, gu0, gv0 +- real(kind=kind_phys), dimension(im,levs,ntrac), intent(out) :: gq0 ++ real(kind=kind_phys), dimension(:,:), intent(in) :: tgrs, ugrs, vgrs ++ real(kind=kind_phys), dimension(:,:,:), intent(in) :: qgrs ++ real(kind=kind_phys), dimension(:,:), intent(in) :: dudt, dvdt, dtdt ++ real(kind=kind_phys), dimension(:,:,:), intent(in) :: dqdt ++ real(kind=kind_phys), dimension(:,:), intent(out) :: gt0, gu0, gv0 ++ real(kind=kind_phys), dimension(:,:,:), intent(out) :: gq0 + + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg +@@ -509,22 +509,22 @@ + integer, intent(in) :: im, levs, nn, ntrac, ntcw, ntiw, ntclamt, ntrw, & + ntsw, ntrnc, ntsnc, ntgl, ntgnc, imp_physics, imp_physics_mg, imp_physics_zhao_carr, imp_physics_zhao_carr_pdf, & + imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6,imp_physics_fer_hires, me +- integer, dimension(im), intent(in) :: islmsk, kpbl, kinver ++ integer, dimension(:), intent(in) :: islmsk, kpbl, kinver + logical, intent(in) :: cscnv, satmedmf, trans_trac, do_shoc, ltaerosol, ras + + real(kind=kind_phys), intent(in) :: rhcbot, rhcmax, rhcpbl, rhctop +- real(kind=kind_phys), dimension(im), intent(in) :: work1, work2 +- real(kind=kind_phys), dimension(im, levs), intent(in) :: prsl, prslk +- real(kind=kind_phys), dimension(im, levs+1), intent(in) :: prsi +- real(kind=kind_phys), dimension(im), intent(in) :: xlon, xlat +- real(kind=kind_phys), dimension(im, levs), intent(in) :: gt0 +- real(kind=kind_phys), dimension(im, levs, ntrac), intent(in) :: gq0 +- +- real(kind=kind_phys), dimension(im, levs), intent(inout) :: rhc, save_qc ++ real(kind=kind_phys), dimension(:), intent(in) :: work1, work2 ++ real(kind=kind_phys), dimension(:, :), intent(in) :: prsl, prslk ++ real(kind=kind_phys), dimension(:, :), intent(in) :: prsi ++ real(kind=kind_phys), dimension(:), intent(in) :: xlon, xlat ++ real(kind=kind_phys), dimension(:, :), intent(in) :: gt0 ++ real(kind=kind_phys), dimension(:, :, :), intent(in) :: gq0 ++ ++ real(kind=kind_phys), dimension(:, :), intent(inout) :: rhc, save_qc + ! save_qi is not allocated for Zhao-Carr MP + real(kind=kind_phys), dimension(:, :), intent(inout) :: save_qi + real(kind=kind_phys), dimension(:, :), intent(inout) :: save_tcp ! ONLY ALLOCATE FOR THOMPSON! TODO +- real(kind=kind_phys), dimension(im, levs, nn), intent(inout) :: clw ++ real(kind=kind_phys), dimension(:, :, :), intent(inout) :: clw + + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg +@@ -679,16 +679,16 @@ + logical, intent(in) :: ltaerosol, cplchm + + real(kind=kind_phys), intent(in) :: con_pi, dtf +- real(kind=kind_phys), dimension(im,levs), intent(in) :: save_qc ++ real(kind=kind_phys), dimension(:, :), intent(in) :: save_qc + ! save_qi is not allocated for Zhao-Carr MP + real(kind=kind_phys), dimension(:, :), intent(in) :: save_qi + +- real(kind=kind_phys), dimension(im,levs,ntrac), intent(inout) :: gq0 +- real(kind=kind_phys), dimension(im,levs,nn), intent(inout) :: clw +- real(kind=kind_phys), dimension(im,levs), intent(in) :: prsl ++ real(kind=kind_phys), dimension(:, :,:), intent(inout) :: gq0 ++ real(kind=kind_phys), dimension(:, :,:), intent(inout) :: clw ++ real(kind=kind_phys), dimension(:, :), intent(in) :: prsl + real(kind=kind_phys), intent(in) :: con_rd + real(kind=kind_phys), dimension(:,:), intent(in) :: nwfa, save_tcp +- real(kind=kind_phys), dimension(im,levs), intent(in) :: spechum ++ real(kind=kind_phys), dimension(:, :), intent(in) :: spechum + + ! dqdti may not be allocated + real(kind=kind_phys), dimension(:,:), intent(inout) :: dqdti +@@ -828,9 +828,9 @@ + ! interface variables + integer, intent(in) :: im, levs, ntrac, ntcw, ntiw, nn + +- real(kind=kind_phys), dimension(im, levs, ntrac), intent(in) :: gq0 ++ real(kind=kind_phys), dimension(:, :, :), intent(in) :: gq0 + +- real(kind=kind_phys), dimension(im, levs, nn), intent(out) :: clw ++ real(kind=kind_phys), dimension(:, :, :), intent(out) :: clw + + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg +diff --git a/physics/GFS_surface_composites.F90 b/physics/GFS_surface_composites.F90 +index b3000b0..ff513a1 100644 +--- a/physics/GFS_surface_composites.F90 ++++ b/physics/GFS_surface_composites.F90 +@@ -40,24 +40,24 @@ contains + ! Interface variables + integer, intent(in ) :: im, lkm + logical, intent(in ) :: frac_grid, cplflx, cplwav2atm +- logical, dimension(im), intent(inout) :: flag_cice +- logical, dimension(im), intent(inout) :: dry, icy, lake, ocean, wet ++ logical, dimension(:), intent(inout) :: flag_cice ++ logical, dimension(:), intent(inout) :: dry, icy, lake, ocean, wet + real(kind=kind_phys), intent(in ) :: cimin +- real(kind=kind_phys), dimension(im), intent(in ) :: landfrac, lakefrac, lakedepth, oceanfrac +- real(kind=kind_phys), dimension(im), intent(inout) :: cice +- real(kind=kind_phys), dimension(im), intent( out) :: frland +- real(kind=kind_phys), dimension(im), intent(in ) :: zorl, snowd, tprcp, uustar, weasd, qss, hflx ++ real(kind=kind_phys), dimension(:), intent(in ) :: landfrac, lakefrac, lakedepth, oceanfrac ++ real(kind=kind_phys), dimension(:), intent(inout) :: cice ++ real(kind=kind_phys), dimension(:), intent( out) :: frland ++ real(kind=kind_phys), dimension(:), intent(in ) :: zorl, snowd, tprcp, uustar, weasd, qss, hflx + +- real(kind=kind_phys), dimension(im), intent(inout) :: zorlo, zorll, zorli, tsfc, tsfco, tsfcl, tisfc, tsurf +- real(kind=kind_phys), dimension(im), intent(inout) :: snowd_wat, snowd_lnd, snowd_ice, tprcp_wat, & ++ real(kind=kind_phys), dimension(:), intent(inout) :: zorlo, zorll, zorli, tsfc, tsfco, tsfcl, tisfc, tsurf ++ real(kind=kind_phys), dimension(:), intent(inout) :: snowd_wat, snowd_lnd, snowd_ice, tprcp_wat, & + tprcp_lnd, tprcp_ice, zorl_wat, zorl_lnd, zorl_ice, tsfc_wat, tsfc_lnd, tsfc_ice, tsurf_wat, & + tsurf_lnd, tsurf_ice, uustar_wat, uustar_lnd, uustar_ice, weasd_wat, weasd_lnd, weasd_ice, & + qss_wat, qss_lnd, qss_ice, hflx_wat, hflx_lnd, hflx_ice, ep1d_ice, gflx_ice +- real(kind=kind_phys), dimension(im), intent( out) :: tice ++ real(kind=kind_phys), dimension(:), intent( out) :: tice + real(kind=kind_phys), intent(in ) :: tgice +- integer, dimension(im), intent(inout) :: islmsk +- real(kind=kind_phys), dimension(im), intent(in ) :: semis_rad +- real(kind=kind_phys), dimension(im), intent(inout) :: semis_wat, semis_lnd, semis_ice ++ integer, dimension(:), intent(inout) :: islmsk ++ real(kind=kind_phys), dimension(:), intent(in ) :: semis_rad ++ real(kind=kind_phys), dimension(:), intent(inout) :: semis_wat, semis_lnd, semis_ice + real(kind=kind_phys), intent(in ) :: min_lakeice, min_seaice + + ! CCPP error handling +@@ -252,11 +252,11 @@ contains + + ! Interface variables + integer, intent(in ) :: im +- logical, dimension(im), intent(in ) :: dry, icy, wet +- real(kind=kind_phys), dimension(im), intent(in ) :: semis_wat, semis_lnd, semis_ice, adjsfcdlw, & ++ logical, dimension(:), intent(in ) :: dry, icy, wet ++ real(kind=kind_phys), dimension(:), intent(in ) :: semis_wat, semis_lnd, semis_ice, adjsfcdlw, & + adjsfcdsw, adjsfcnsw +- real(kind=kind_phys), dimension(im), intent(inout) :: gabsbdlw_lnd, gabsbdlw_ice, gabsbdlw_wat +- real(kind=kind_phys), dimension(im), intent(out) :: adjsfcusw ++ real(kind=kind_phys), dimension(:), intent(inout) :: gabsbdlw_lnd, gabsbdlw_ice, gabsbdlw_wat ++ real(kind=kind_phys), dimension(:), intent(out) :: adjsfcusw + + ! CCPP error handling + character(len=*), intent(out) :: errmsg +@@ -339,9 +339,9 @@ contains + + integer, intent(in) :: im, kice, km + logical, intent(in) :: cplflx, frac_grid, cplwav2atm +- logical, dimension(im), intent(in) :: flag_cice, dry, wet, icy +- integer, dimension(im), intent(in) :: islmsk +- real(kind=kind_phys), dimension(im), intent(in) :: landfrac, lakefrac, oceanfrac, & ++ logical, dimension(:), intent(in) :: flag_cice, dry, wet, icy ++ integer, dimension(:), intent(in) :: islmsk ++ real(kind=kind_phys), dimension(:), intent(in) :: landfrac, lakefrac, oceanfrac, & + zorl_wat, zorl_lnd, zorl_ice, cd_wat, cd_lnd, cd_ice, cdq_wat, cdq_lnd, cdq_ice, rb_wat, rb_lnd, rb_ice, stress_wat, & + stress_lnd, stress_ice, ffmm_wat, ffmm_lnd, ffmm_ice, ffhh_wat, ffhh_lnd, ffhh_ice, uustar_wat, uustar_lnd, uustar_ice, & + fm10_wat, fm10_lnd, fm10_ice, fh2_wat, fh2_lnd, fh2_ice, tsurf_wat, tsurf_lnd, tsurf_ice, cmm_wat, cmm_lnd, cmm_ice, & +@@ -349,15 +349,15 @@ contains + snowd_wat, snowd_lnd, snowd_ice,tprcp_wat, tprcp_lnd, tprcp_ice, evap_wat, evap_lnd, evap_ice, hflx_wat, hflx_lnd, & + hflx_ice, qss_wat, qss_lnd, qss_ice, tsfc_wat, tsfc_lnd, tsfc_ice + +- real(kind=kind_phys), dimension(im), intent(inout) :: zorl, zorlo, zorll, zorli, cd, cdq, rb, stress, ffmm, ffhh, uustar, fm10, & ++ real(kind=kind_phys), dimension(:), intent(inout) :: zorl, zorlo, zorll, zorli, cd, cdq, rb, stress, ffmm, ffhh, uustar, fm10, & + fh2, tsurf, cmm, chh, gflx, ep1d, weasd, snowd, tprcp, evap, hflx, qss, tsfc, tsfco, tsfcl, tisfc + +- real(kind=kind_phys), dimension(im), intent(in ) :: tice ! interstitial sea ice temperature +- real(kind=kind_phys), dimension(im), intent(inout) :: hice, cice ++ real(kind=kind_phys), dimension(:), intent(in ) :: tice ! interstitial sea ice temperature ++ real(kind=kind_phys), dimension(:), intent(inout) :: hice, cice + real(kind=kind_phys), intent(in ) :: min_seaice + +- real(kind=kind_phys), dimension(im, kice), intent(in ) :: tiice +- real(kind=kind_phys), dimension(im, km), intent(inout) :: stc ++ real(kind=kind_phys), dimension(:, :), intent(in ) :: tiice ++ real(kind=kind_phys), dimension(:, :), intent(inout) :: stc + + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg +diff --git a/physics/GFS_surface_generic.F90 b/physics/GFS_surface_generic.F90 +index 337e4c5..d65f4ad 100644 +--- a/physics/GFS_surface_generic.F90 ++++ b/physics/GFS_surface_generic.F90 +@@ -38,51 +38,51 @@ + + ! Interface variables + integer, intent(in) :: im, levs, isot, ivegsrc +- integer, dimension(im), intent(in) :: islmsk +- integer, dimension(im), intent(inout) :: soiltyp, vegtype, slopetyp ++ integer, dimension(:), intent(in) :: islmsk ++ integer, dimension(:), intent(inout) :: soiltyp, vegtype, slopetyp + + real(kind=kind_phys), intent(in) :: con_g +- real(kind=kind_phys), dimension(im), intent(in) :: vfrac, stype, vtype, slope, prsik_1, prslk_1 ++ real(kind=kind_phys), dimension(:), intent(in) :: vfrac, stype, vtype, slope, prsik_1, prslk_1 + +- real(kind=kind_phys), dimension(im), intent(inout) :: tsfc +- real(kind=kind_phys), dimension(im,levs), intent(in) :: phil ++ real(kind=kind_phys), dimension(:), intent(inout) :: tsfc ++ real(kind=kind_phys), dimension(:,:), intent(in) :: phil + +- real(kind=kind_phys), dimension(im), intent(inout) :: sigmaf, work3, tsurf, zlvl ++ real(kind=kind_phys), dimension(:), intent(inout) :: sigmaf, work3, tsurf, zlvl + + ! Stochastic physics / surface perturbations + logical, intent(in) :: do_sppt, ca_global +- real(kind=kind_phys), dimension(im,levs), intent(out) :: dtdtr +- real(kind=kind_phys), dimension(im), intent(out) :: drain_cpl +- real(kind=kind_phys), dimension(im), intent(out) :: dsnow_cpl +- real(kind=kind_phys), dimension(im), intent(in) :: rain_cpl +- real(kind=kind_phys), dimension(im), intent(in) :: snow_cpl ++ real(kind=kind_phys), dimension(:,:), intent(out) :: dtdtr ++ real(kind=kind_phys), dimension(:), intent(out) :: drain_cpl ++ real(kind=kind_phys), dimension(:), intent(out) :: dsnow_cpl ++ real(kind=kind_phys), dimension(:), intent(in) :: rain_cpl ++ real(kind=kind_phys), dimension(:), intent(in) :: snow_cpl + logical, intent(in) :: do_sfcperts + integer, intent(in) :: nsfcpert +- real(kind=kind_phys), dimension(im,nsfcpert), intent(in) :: sfc_wts ++ real(kind=kind_phys), dimension(:,:), intent(in) :: sfc_wts + real(kind=kind_phys), dimension(:), intent(in) :: pertz0 + real(kind=kind_phys), dimension(:), intent(in) :: pertzt + real(kind=kind_phys), dimension(:), intent(in) :: pertshc + real(kind=kind_phys), dimension(:), intent(in) :: pertlai + real(kind=kind_phys), dimension(:), intent(in) :: pertvegf +- real(kind=kind_phys), dimension(im), intent(out) :: z01d +- real(kind=kind_phys), dimension(im), intent(out) :: zt1d +- real(kind=kind_phys), dimension(im), intent(out) :: bexp1d +- real(kind=kind_phys), dimension(im), intent(out) :: xlai1d +- real(kind=kind_phys), dimension(im), intent(out) :: vegf1d ++ real(kind=kind_phys), dimension(:), intent(out) :: z01d ++ real(kind=kind_phys), dimension(:), intent(out) :: zt1d ++ real(kind=kind_phys), dimension(:), intent(out) :: bexp1d ++ real(kind=kind_phys), dimension(:), intent(out) :: xlai1d ++ real(kind=kind_phys), dimension(:), intent(out) :: vegf1d + + logical, intent(in) :: cplflx +- real(kind=kind_phys), dimension(im), intent(in) :: slimskin_cpl +- logical, dimension(im), intent(inout) :: flag_cice +- integer, dimension(im), intent(out) :: islmsk_cice +- real(kind=kind_phys), dimension(im), intent(in) :: & ++ real(kind=kind_phys), dimension(:), intent(in) :: slimskin_cpl ++ logical, dimension(:), intent(inout) :: flag_cice ++ integer, dimension(:), intent(out) :: islmsk_cice ++ real(kind=kind_phys), dimension(:), intent(in) :: & + tisfc, tsfco, fice, hice + +- real(kind=kind_phys), dimension(im), intent(out) :: wind +- real(kind=kind_phys), dimension(im), intent(in ) :: u1, v1 ++ real(kind=kind_phys), dimension(:), intent(out) :: wind ++ real(kind=kind_phys), dimension(:), intent(in ) :: u1, v1 + ! surface wind enhancement due to convection +- real(kind=kind_phys), dimension(im), intent(inout ) :: cnvwind ++ real(kind=kind_phys), dimension(:), intent(inout ) :: cnvwind + ! +- real(kind=kind_phys), dimension(im), intent(out) :: smcwlt2, smcref2 ++ real(kind=kind_phys), dimension(:), intent(out) :: smcwlt2, smcref2 + + ! CCPP error handling + character(len=*), intent(out) :: errmsg +@@ -227,29 +227,29 @@ + + integer, intent(in) :: im + logical, intent(in) :: cplflx, cplwav, lssav +- logical, dimension(im), intent(in) :: icy, wet ++ logical, dimension(:), intent(in) :: icy, wet + real(kind=kind_phys), intent(in) :: dtf + +- real(kind=kind_phys), dimension(im), intent(in) :: ep1d, gflx, tgrs_1, qgrs_1, ugrs_1, vgrs_1, adjsfcdlw, adjsfcdsw, & ++ real(kind=kind_phys), dimension(:), intent(in) :: ep1d, gflx, tgrs_1, qgrs_1, ugrs_1, vgrs_1, adjsfcdlw, adjsfcdsw, & + adjnirbmd, adjnirdfd, adjvisbmd, adjvisdfd, adjsfculw, adjsfculw_wat, adjnirbmu, adjnirdfu, adjvisbmu, adjvisdfu, & + t2m, q2m, u10m, v10m, tsfc, tsfc_wat, pgr, xcosz, evbs, evcw, trans, sbsno, snowc, snohf + +- real(kind=kind_phys), dimension(im), intent(inout) :: epi, gfluxi, t1, q1, u1, v1, dlwsfci_cpl, dswsfci_cpl, dlwsfc_cpl, & ++ real(kind=kind_phys), dimension(:), intent(inout) :: epi, gfluxi, t1, q1, u1, v1, dlwsfci_cpl, dswsfci_cpl, dlwsfc_cpl, & + dswsfc_cpl, dnirbmi_cpl, dnirdfi_cpl, dvisbmi_cpl, dvisdfi_cpl, dnirbm_cpl, dnirdf_cpl, dvisbm_cpl, dvisdf_cpl, & + nlwsfci_cpl, nlwsfc_cpl, t2mi_cpl, q2mi_cpl, u10mi_cpl, v10mi_cpl, tsfci_cpl, psurfi_cpl, nnirbmi_cpl, nnirdfi_cpl, & + nvisbmi_cpl, nvisdfi_cpl, nswsfci_cpl, nswsfc_cpl, nnirbm_cpl, nnirdf_cpl, nvisbm_cpl, nvisdf_cpl, gflux, evbsa, & + evcwa, transa, sbsnoa, snowca, snohfa, ep + +- real(kind=kind_phys), dimension(im), intent(inout) :: runoff, srunoff +- real(kind=kind_phys), dimension(im), intent(in) :: drain, runof ++ real(kind=kind_phys), dimension(:), intent(inout) :: runoff, srunoff ++ real(kind=kind_phys), dimension(:), intent(in) :: drain, runof + + ! For canopy heat storage + logical, intent(in) :: lheatstrg + real(kind=kind_phys), intent(in) :: z0fac, e0fac +- real(kind=kind_phys), dimension(im), intent(in) :: zorl +- real(kind=kind_phys), dimension(im), intent(in) :: hflx, evap +- real(kind=kind_phys), dimension(im), intent(out) :: hflxq, evapq +- real(kind=kind_phys), dimension(im), intent(out) :: hffac, hefac ++ real(kind=kind_phys), dimension(:), intent(in) :: zorl ++ real(kind=kind_phys), dimension(:), intent(in) :: hflx, evap ++ real(kind=kind_phys), dimension(:), intent(out) :: hflxq, evapq ++ real(kind=kind_phys), dimension(:), intent(out) :: hffac, hefac + + ! CCPP error handling variables + character(len=*), intent(out) :: errmsg +diff --git a/physics/GFS_surface_loop_control.F90 b/physics/GFS_surface_loop_control.F90 +index c7f727d..afa3413 100644 +--- a/physics/GFS_surface_loop_control.F90 ++++ b/physics/GFS_surface_loop_control.F90 +@@ -90,10 +90,10 @@ + ! Interface variables + integer, intent(in) :: im + integer, intent(in) :: iter +- real(kind=kind_phys), dimension(im), intent(in) :: wind +- logical, dimension(im), intent(inout) :: flag_guess +- logical, dimension(im), intent(inout) :: flag_iter +- logical, dimension(im), intent(in) :: dry, wet, icy ++ real(kind=kind_phys), dimension(:), intent(in) :: wind ++ logical, dimension(:), intent(inout) :: flag_guess ++ logical, dimension(:), intent(inout) :: flag_iter ++ logical, dimension(:), intent(in) :: dry, wet, icy + integer, intent(in) :: nstf_name1 + + character(len=*), intent(out) :: errmsg +diff --git a/physics/GFS_time_vary_pre.fv3.F90 b/physics/GFS_time_vary_pre.fv3.F90 +index dc9332b..66c9173 100644 +--- a/physics/GFS_time_vary_pre.fv3.F90 ++++ b/physics/GFS_time_vary_pre.fv3.F90 +@@ -74,7 +74,7 @@ + implicit none + + integer, intent(in) :: idate(4) +- integer, intent(in) :: jdat(1:8), idat(1:8) ++ integer, intent(in) :: jdat(:), idat(:) + integer, intent(in) :: lkm, lsm, lsm_noahmp, & + nsswr, nslwr, me, & + master, nscyc, nhfrad +diff --git a/physics/GFS_time_vary_pre.scm.F90 b/physics/GFS_time_vary_pre.scm.F90 +index 2fa3527..842423d 100644 +--- a/physics/GFS_time_vary_pre.scm.F90 ++++ b/physics/GFS_time_vary_pre.scm.F90 +@@ -74,7 +74,7 @@ + implicit none + + integer, intent(in) :: idate(4) +- integer, intent(in) :: jdat(1:8), idat(1:8) ++ integer, intent(in) :: jdat(:), idat(:) + integer, intent(in) :: lsm, lsm_noahmp, & + nsswr, nslwr, me, & + master, nscyc +diff --git a/physics/cires_ugwp.F90 b/physics/cires_ugwp.F90 +index df0116c..018cf6a 100644 +--- a/physics/cires_ugwp.F90 ++++ b/physics/cires_ugwp.F90 +@@ -54,7 +54,7 @@ contains + integer, intent (in) :: latr + real(kind=kind_phys), intent (in) :: ak(:), bk(:) + real(kind=kind_phys), intent (in) :: dtp +- real(kind=kind_phys), intent (in) :: cdmbgwd(4), cgwf(2) ! "scaling" controls for "old" GFS-GW schemes ++ real(kind=kind_phys), intent (in) :: cdmbgwd(:), cgwf(:) ! "scaling" controls for "old" GFS-GW schemes + real(kind=kind_phys), intent (in) :: pa_rf_in, tau_rf_in + real(kind=kind_phys), intent (in) :: con_p0 + logical, intent (in) :: do_ugwp +@@ -163,24 +163,24 @@ contains + + ! interface variables + integer, intent(in) :: me, master, im, levs, ntrac, kdt, lonr, nmtvr +- integer, intent(in), dimension(im) :: kpbl +- real(kind=kind_phys), intent(in), dimension(im) :: oro, oro_uf, hprime, oc, theta, sigma, gamma ++ integer, intent(in), dimension(:) :: kpbl ++ real(kind=kind_phys), intent(in), dimension(:) :: oro, oro_uf, hprime, oc, theta, sigma, gamma + logical, intent(in) :: flag_for_gwd_generic_tend + ! elvmax is intent(in) for CIRES UGWP, but intent(inout) for GFS GWDPS +- real(kind=kind_phys), intent(inout), dimension(im) :: elvmax +- real(kind=kind_phys), intent(in), dimension(im, 4) :: clx, oa4 +- real(kind=kind_phys), intent(in), dimension(im) :: xlat, xlat_d, sinlat, coslat, area +- real(kind=kind_phys), intent(in), dimension(im, levs) :: del, ugrs, vgrs, tgrs, prsl, prslk, phil +- real(kind=kind_phys), intent(in), dimension(im, levs+1) :: prsi, phii +- real(kind=kind_phys), intent(in), dimension(im, levs, ntrac):: qgrs +- real(kind=kind_phys), intent(in) :: dtp, cdmbgwd(4) ++ real(kind=kind_phys), intent(inout), dimension(:) :: elvmax ++ real(kind=kind_phys), intent(in), dimension(:, :) :: clx, oa4 ++ real(kind=kind_phys), intent(in), dimension(:) :: xlat, xlat_d, sinlat, coslat, area ++ real(kind=kind_phys), intent(in), dimension(:, :) :: del, ugrs, vgrs, tgrs, prsl, prslk, phil ++ real(kind=kind_phys), intent(in), dimension(:, :) :: prsi, phii ++ real(kind=kind_phys), intent(in), dimension(:,:,:):: qgrs ++ real(kind=kind_phys), intent(in) :: dtp, cdmbgwd(:) + logical, intent(in) :: do_ugwp, do_tofd, ldiag_ugwp + +- real(kind=kind_phys), intent(out), dimension(im) :: dusfcg, dvsfcg +- real(kind=kind_phys), intent(out), dimension(im) :: zmtb, zlwb, zogw, rdxzb +- real(kind=kind_phys), intent(out), dimension(im) :: tau_mtb, tau_ogw, tau_tofd, tau_ngw +- real(kind=kind_phys), intent(out), dimension(im, levs):: gw_dudt, gw_dvdt, gw_dtdt, gw_kdis +- real(kind=kind_phys), intent(out), dimension(im, levs):: dudt_mtb, dudt_ogw, dudt_tms ++ real(kind=kind_phys), intent(out), dimension(:) :: dusfcg, dvsfcg ++ real(kind=kind_phys), intent(out), dimension(:) :: zmtb, zlwb, zogw, rdxzb ++ real(kind=kind_phys), intent(out), dimension(:) :: tau_mtb, tau_ogw, tau_tofd, tau_ngw ++ real(kind=kind_phys), intent(out), dimension(:, :):: gw_dudt, gw_dvdt, gw_dtdt, gw_kdis ++ real(kind=kind_phys), intent(out), dimension(:, :):: dudt_mtb, dudt_ogw, dudt_tms + + ! These arrays are only allocated if ldiag=.true. + real(kind=kind_phys), intent(inout), dimension(:,:) :: ldu3dt_ogw, ldv3dt_ogw, ldt3dt_ogw +@@ -190,11 +190,11 @@ contains + ! These arrays only allocated if ldiag_ugwp = .true. + real(kind=kind_phys), intent(out), dimension(:,:) :: du3dt_mtb, du3dt_ogw, du3dt_tms + +- real(kind=kind_phys), intent(inout), dimension(im, levs):: dudt, dvdt, dtdt ++ real(kind=kind_phys), intent(inout), dimension(:, :):: dudt, dvdt, dtdt + + real(kind=kind_phys), intent(in) :: con_g, con_pi, con_cp, con_rd, con_rv, con_fvirt + +- real(kind=kind_phys), intent(in), dimension(im) :: rain ++ real(kind=kind_phys), intent(in), dimension(:) :: rain + + integer, intent(in) :: ntke + real(kind=kind_phys), intent(in), dimension(:,:) :: q_tke, dqdt_tke +diff --git a/physics/cnvc90.f b/physics/cnvc90.f +index 9bef0eb..6a49158 100644 +--- a/physics/cnvc90.f ++++ b/physics/cnvc90.f +@@ -30,16 +30,16 @@ + ! Interface variables + real(kind=kind_phys), intent(in) :: clstp + integer, intent(in) :: im, km +- real(kind=kind_phys), intent(in) :: RN(IM) +- integer, intent(in) :: KBOT(IM) +- integer, intent(in) :: KTOP(IM) +- real(kind=kind_phys), intent(in) :: prsi(IM,km+1) +- real(kind=kind_phys), intent(inout) :: ACV(IM) +- real(kind=kind_phys), intent(inout) :: ACVB(IM) +- real(kind=kind_phys), intent(inout) :: ACVT(IM) +- real(kind=kind_phys), intent(inout) :: CV(IM) +- real(kind=kind_phys), intent(inout) :: CVB(IM) +- real(kind=kind_phys), intent(inout) :: CVT(IM) ++ real(kind=kind_phys), intent(in) :: RN(:) ++ integer, intent(in) :: KBOT(:) ++ integer, intent(in) :: KTOP(:) ++ real(kind=kind_phys), intent(in) :: prsi(:,:) ++ real(kind=kind_phys), intent(inout) :: ACV(:) ++ real(kind=kind_phys), intent(inout) :: ACVB(:) ++ real(kind=kind_phys), intent(inout) :: ACVT(:) ++ real(kind=kind_phys), intent(inout) :: CV(:) ++ real(kind=kind_phys), intent(inout) :: CVB(:) ++ real(kind=kind_phys), intent(inout) :: CVT(:) + + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg +diff --git a/physics/cs_conv.F90 b/physics/cs_conv.F90 +index 3863494..f1d138e 100644 +--- a/physics/cs_conv.F90 ++++ b/physics/cs_conv.F90 +@@ -31,15 +31,15 @@ module cs_conv_pre + + ! --- inputs + integer, intent(in) :: im, levs, ntrac, ncld +- real(r8), dimension(im,levs), intent(in) :: q +- real(r8), dimension(im,levs), intent(in) :: clw1,clw2 +- real(r8), dimension(im), intent(in) :: work1, work2 ++ real(r8), dimension(:, :), intent(in) :: q ++ real(r8), dimension(:, :), intent(in) :: clw1,clw2 ++ real(r8), dimension(:), intent(in) :: work1, work2 + real(r8), intent(in) :: cs_parm1, cs_parm2 + + ! --- input/output +- real(r8), dimension(ntrac-ncld+2), intent(out) :: fswtr, fscav +- real(r8), dimension(im), intent(out) :: wcbmax +- real(r8), dimension(im,levs), intent(out) :: save_q1,save_q2 ++ real(r8), dimension(:), intent(out) :: fswtr, fscav ++ real(r8), dimension(:), intent(out) :: wcbmax ++ real(r8), dimension(:, :), intent(out) :: save_q1,save_q2 + ! save_q3 is not allocated for Zhao-Carr MP + real(r8), dimension(:,:), intent(out) :: save_q3 + +@@ -101,10 +101,10 @@ module cs_conv_post + ! --- inputs + integer, intent(in) :: im, kmax + logical, intent(in) :: do_aw +- real(r8), dimension(im,kmax), intent(in) :: sigmatot ++ real(r8), dimension(:, :), intent(in) :: sigmatot + + ! --- input/output +- real(r8), dimension(im,kmax), intent(out) :: sigmafrac ++ real(r8), dimension(:, :), intent(out) :: sigmafrac + + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg +@@ -309,23 +309,23 @@ module cs_conv + ! input arguments + ! + INTEGER, INTENT(IN) :: IJSDIM, KMAX, ntracp1, nn, NTR, mype, nctp, mp_phys, kdt, lat !! DD, for GFS, pass in +- logical, intent(in) :: otspt(1:ntracp1,1:2)! otspt(:,1) - on/off switch for tracer transport by updraft and ++ logical, intent(in) :: otspt(:, :)! otspt(:,1) - on/off switch for tracer transport by updraft and + ! downdraft. should not include subgrid PDF and turbulence + ! otspt(:,2) - on/off switch for tracer transport by subsidence + ! should include subgrid PDF and turbulence + +- real(r8), intent(inout) :: t(IJSDIM,KMAX) ! temperature at mid-layer (K) +- real(r8), intent(inout) :: q(IJSDIM,KMAX) ! water vapor array including moisture (kg/kg) +- real(r8), intent(inout) :: clw(IJSDIM,KMAX,nn) ! tracer array including cloud condensate (kg/kg) +- real(r8), intent(in) :: pap(IJSDIM,KMAX) ! pressure at mid-layer (Pa) +- real(r8), intent(in) :: paph(IJSDIM,KMAX+1) ! pressure at boundaries (Pa) +- real(r8), intent(in) :: zm(IJSDIM,KMAX) ! geopotential at mid-layer (m) +- real(r8), intent(in) :: zi(IJSDIM,KMAX+1) ! geopotential at boundaries (m) +- real(r8), intent(in) :: fscav(ntr), fswtr(ntr), wcbmaxm(ijsdim) ++ real(r8), intent(inout) :: t(:, :) ! temperature at mid-layer (K) ++ real(r8), intent(inout) :: q(:, :) ! water vapor array including moisture (kg/kg) ++ real(r8), intent(inout) :: clw(:, :, :) ! tracer array including cloud condensate (kg/kg) ++ real(r8), intent(in) :: pap(:, :) ! pressure at mid-layer (Pa) ++ real(r8), intent(in) :: paph(:, :) ! pressure at boundaries (Pa) ++ real(r8), intent(in) :: zm(:, :) ! geopotential at mid-layer (m) ++ real(r8), intent(in) :: zi(:, :) ! geopotential at boundaries (m) ++ real(r8), intent(in) :: fscav(:), fswtr(:), wcbmaxm(:) + real(r8), intent(in) :: precz0in, preczhin, clmdin + ! added for cs_convr +- real(r8), intent(inout) :: u(IJSDIM,KMAX) ! zonal wind at mid-layer (m/s) +- real(r8), intent(inout) :: v(IJSDIM,KMAX) ! meridional wind at mid-layer (m/s) ++ real(r8), intent(inout) :: u(:, :) ! zonal wind at mid-layer (m/s) ++ real(r8), intent(inout) :: v(:, :) ! meridional wind at mid-layer (m/s) + + real(r8), intent(in) :: DELTA ! physics time step + real(r8), intent(in) :: DELTI ! dynamics time step (model time increment in seconds) +@@ -333,12 +333,12 @@ module cs_conv + ! + ! modified arguments + ! +- real(r8), intent(inout) :: CBMFX(IJSDIM,nctp) ! cloud base mass flux (kg/m2/s) ++ real(r8), intent(inout) :: CBMFX(:, :) ! cloud base mass flux (kg/m2/s) + ! + ! output arguments + ! + ! updraft, downdraft, and detrainment mass flux (kg/m2/s) +- real(r8), intent(inout), dimension(IJSDIM,KMAX) :: ud_mf, dd_mf, dt_mf ++ real(r8), intent(inout), dimension(:, :) :: ud_mf, dd_mf, dt_mf + + real(r8), intent(out) :: rain1(IJSDIM) ! lwe thickness of deep convective precipitation amount (m) + ! GJF* These variables are conditionally allocated depending on whether the +@@ -348,14 +348,14 @@ module cs_conv + cnv_dqldt, clcn, cnv_fice, & + cnv_ndrop, cnv_nice, cf_upi + ! *GJF +- integer, intent(inout) :: kcnv(ijsdim) ! zero if no deep convection and 1 otherwise ++ integer, intent(inout) :: kcnv(:) ! zero if no deep convection and 1 otherwise + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + !DDsigma - output added for AW sigma diagnostics + ! interface sigma and vertical velocity by cloud type (1=sfc) + ! real(r8), intent(out), dimension(IJSDIM,KMAX,nctp) :: sigmai, vverti +- real(r8), intent(out), dimension(IJSDIM,KMAX) :: sigma ! sigma sigma totaled over cloud type - on interfaces (1=sfc) ++ real(r8), intent(out), dimension(:, :) :: sigma ! sigma sigma totaled over cloud type - on interfaces (1=sfc) + ! sigma terms in eq 91 and 92 + ! real(r8), dimension(IJSDIM,KMAX) :: sfluxterm, qvfluxterm, condterm + !DDsigma +@@ -738,19 +738,19 @@ module cs_conv + logical, intent(in) :: otspt1(ntr), otspt2(ntr), lprnt + ! + ! [OUTPUT] +- REAL(r8), INTENT(OUT) :: GTT (IJSDIM, KMAX ) ! heating rate ++ REAL(r8), INTENT(OUT) :: GTT (IJSDIM, KMAX ) ! heating rate + REAL(r8), INTENT(OUT) :: GTQ (IJSDIM, KMAX, NTR) ! change in q +- REAL(r8), INTENT(OUT) :: GTU (IJSDIM, KMAX ) ! tendency of u +- REAL(r8), INTENT(OUT) :: GTV (IJSDIM, KMAX ) ! tendency of v +- REAL(r8), INTENT(OUT) :: CMDET (IJSDIM, KMAX ) ! detrainment mass flux ++ REAL(r8), INTENT(OUT) :: GTU (IJSDIM, KMAX ) ! tendency of u ++ REAL(r8), INTENT(OUT) :: GTV (IJSDIM, KMAX ) ! tendency of v ++ REAL(r8), INTENT(OUT) :: CMDET (IJSDIM, KMAX ) ! detrainment mass flux + + ! assuming there is no flux at the top of the atmospherea - Moorthi +- REAL(r8), INTENT(OUT) :: GTPRP (IJSDIM, KMAX ) ! rain+snow flux +- REAL(r8), INTENT(OUT) :: GSNWP (IJSDIM, KMAX ) ! snowfall flux +- REAL(r8), INTENT(OUT) :: GMFX0 (IJSDIM, KMAX ) ! updraft mass flux +- REAL(r8), INTENT(OUT) :: GMFX1 (IJSDIM, KMAX ) ! downdraft mass flux ++ REAL(r8), INTENT(OUT) :: GTPRP (IJSDIM, KMAX ) ! rain+snow flux ++ REAL(r8), INTENT(OUT) :: GSNWP (IJSDIM, KMAX ) ! snowfall flux ++ REAL(r8), INTENT(OUT) :: GMFX0 (IJSDIM, KMAX ) ! updraft mass flux ++ REAL(r8), INTENT(OUT) :: GMFX1 (IJSDIM, KMAX ) ! downdraft mass flux + +- REAL(r8), INTENT(OUT) :: CAPE (IJSDIM ) ++ REAL(r8), INTENT(OUT) :: CAPE (IJSDIM ) + INTEGER , INTENT(OUT) :: KT (IJSDIM, NCTP ) ! cloud top + ! + ! [MODIFIED] +@@ -774,14 +774,14 @@ module cs_conv + real(r8), allocatable, dimension(:,:,:) :: trfluxterm ! tendencies of tracers due to eddy mass flux + ! + ! [INPUT] +- REAL(r8), INTENT(IN) :: GDT (IJSDIM, KMAX ) ! temperature T ++ REAL(r8), INTENT(IN) :: GDT (IJSDIM, KMAX ) ! temperature T + REAL(r8), INTENT(IN) :: GDQ (IJSDIM, KMAX, NTR) ! humidity, tracer !DDsigmadiag +- REAL(r8), INTENT(IN) :: GDU (IJSDIM, KMAX ) ! westerly u +- REAL(r8), INTENT(IN) :: GDV (IJSDIM, KMAX ) ! southern wind v +- REAL(r8), INTENT(IN) :: GDTM (IJSDIM, KMAX+1 ) ! temperature T ++ REAL(r8), INTENT(IN) :: GDU (IJSDIM, KMAX ) ! westerly u ++ REAL(r8), INTENT(IN) :: GDV (IJSDIM, KMAX ) ! southern wind v ++ REAL(r8), INTENT(IN) :: GDTM (IJSDIM, KMAX+1 ) ! temperature T + REAL(r8), INTENT(IN) :: GDP (IJSDIM, KMAX ) ! pressure P + REAL(r8), INTENT(IN) :: GDPM (IJSDIM, KMAX+1 ) ! pressure (half lev) +- REAL(r8), INTENT(IN) :: GDZ (IJSDIM, KMAX ) ! altitude ++ REAL(r8), INTENT(IN) :: GDZ (IJSDIM, KMAX ) ! altitude + REAL(r8), INTENT(IN) :: GDZM (IJSDIM, KMAX+1 ) ! altitude + REAL(r8), INTENT(IN) :: DELTA ! delta(t) (dynamics) + REAL(r8), INTENT(IN) :: DELTI ! delta(t) (internal variable) +diff --git a/physics/cs_conv_aw_adj.F90 b/physics/cs_conv_aw_adj.F90 +index 756161d..74cac91 100644 +--- a/physics/cs_conv_aw_adj.F90 ++++ b/physics/cs_conv_aw_adj.F90 +@@ -40,15 +40,15 @@ module cs_conv_aw_adj + logical, intent(in) :: do_cscnv, do_aw, do_shoc + integer, intent(in) :: ntrac, ncld, ntcw, ntclamt, nncl + real(kind_phys), intent(in) :: con_g +- real(kind_phys), dimension(im,levs), intent(inout) :: sigmafrac +- real(kind_phys), dimension(im,levs), intent(inout) :: gt0 +- real(kind_phys), dimension(im,levs,ntrac), intent(inout) :: gq0 +- real(kind_phys), dimension(im,levs), intent(in) :: save_t +- real(kind_phys), dimension(im,levs,ntrac), intent(in) :: save_q +- real(kind_phys), dimension(im,levs+1), intent(in) :: prsi +- real(kind_phys), dimension(im,levs), intent(inout) :: cldfrac +- real(kind_phys), dimension(im,levs), intent(inout) :: subcldfrac +- real(kind_phys), dimension(im), intent(inout) :: prcp ++ real(kind_phys), dimension(:,:), intent(inout) :: sigmafrac ++ real(kind_phys), dimension(:,:), intent(inout) :: gt0 ++ real(kind_phys), dimension(:,:,:), intent(inout) :: gq0 ++ real(kind_phys), dimension(:,:), intent(in) :: save_t ++ real(kind_phys), dimension(:,:,:), intent(in) :: save_q ++ real(kind_phys), dimension(:,:), intent(in) :: prsi ++ real(kind_phys), dimension(:,:), intent(inout) :: cldfrac ++ real(kind_phys), dimension(:,:), intent(inout) :: subcldfrac ++ real(kind_phys), dimension(:), intent(inout) :: prcp + integer, intent(in ) :: imp_physics, imp_physics_mg + character(len=*), intent( out) :: errmsg + integer, intent( out) :: errflg +diff --git a/physics/cu_gf_driver.F90 b/physics/cu_gf_driver.F90 +index 5c43709..4b9e423 100644 +--- a/physics/cu_gf_driver.F90 ++++ b/physics/cu_gf_driver.F90 +@@ -101,42 +101,42 @@ contains + logical, intent(in ) :: flag_for_scnv_generic_tend,flag_for_dcnv_generic_tend + logical, intent(in ) :: ldiag3d,qdiag3d + +- real(kind=kind_phys), dimension( im , km ), intent(in ) :: forcet,forceqv_spechum,w,phil +- real(kind=kind_phys), dimension( im , km ), intent(inout ) :: t,us,vs +- real(kind=kind_phys), dimension( im , km ), intent(inout ) :: qci_conv ++ real(kind=kind_phys), dimension( :, :), intent(in ) :: forcet,forceqv_spechum,w,phil ++ real(kind=kind_phys), dimension( :, : ), intent(inout ) :: t,us,vs ++ real(kind=kind_phys), dimension( :, : ), intent(inout ) :: qci_conv + real(kind=kind_phys), dimension( im ) :: rand_mom,rand_vmas +- real(kind=kind_phys), dimension( im,4 ) :: rand_clos ++ real(kind=kind_phys), dimension( im,4 ) :: rand_clos + real(kind=kind_phys), dimension( im , km, 11 ) :: gdc,gdc2 +- real(kind=kind_phys), dimension( im , km ), intent(out ) :: cnvw_moist,cnvc +- real(kind=kind_phys), dimension( im , km ), intent(inout ) :: cliw, clcw ++ real(kind=kind_phys), dimension( :, :), intent(out ) :: cnvw_moist,cnvc ++ real(kind=kind_phys), dimension( :, : ), intent(inout ) :: cliw, clcw + + real(kind=kind_phys), dimension( : , : ), intent(inout ) :: & + du3dt_SCNV,dv3dt_SCNV,dt3dt_SCNV,dq3dt_SCNV, & + du3dt_DCNV,dv3dt_DCNV,dt3dt_DCNV,dq3dt_DCNV + +- integer, dimension (im), intent(inout) :: hbot,htop,kcnv +- integer, dimension (im), intent(in) :: xland +- real(kind=kind_phys), dimension (im), intent(in) :: pbl ++ integer, dimension (:), intent(inout) :: hbot,htop,kcnv ++ integer, dimension (:), intent(in) :: xland ++ real(kind=kind_phys), dimension (:), intent(in) :: pbl + integer, dimension (im) :: tropics + ! ruc variable +- real(kind=kind_phys), dimension (im) :: hfx2,qfx2,psuri +- real(kind=kind_phys), dimension (im,km) :: ud_mf,dd_mf,dt_mf +- real(kind=kind_phys), dimension (im), intent(inout) :: raincv,cld1d +- real(kind=kind_phys), dimension (im,km) :: t2di,p2di ++ real(kind=kind_phys), dimension (:) :: hfx2,qfx2,psuri ++ real(kind=kind_phys), dimension (:,:) :: ud_mf,dd_mf,dt_mf ++ real(kind=kind_phys), dimension (:), intent(inout) :: raincv,cld1d ++ real(kind=kind_phys), dimension (:,:) :: t2di,p2di + ! Specific humidity from FV3 +- real(kind=kind_phys), dimension (im,km), intent(in) :: qv2di_spechum +- real(kind=kind_phys), dimension (im,km), intent(inout) :: qv_spechum ++ real(kind=kind_phys), dimension (:,:), intent(in) :: qv2di_spechum ++ real(kind=kind_phys), dimension (:,:), intent(inout) :: qv_spechum + ! Local water vapor mixing ratios and cloud water mixing ratios + real(kind=kind_phys), dimension (im,km) :: qv2di, qv, forceqv, cnvw + ! +- real(kind=kind_phys), dimension( im ),intent(in) :: garea ++ real(kind=kind_phys), dimension( : ),intent(in) :: garea + real(kind=kind_phys), intent(in ) :: dt + + integer, intent(in ) :: imfshalcnv + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + ! define locally for now. +- integer, dimension(im),intent(inout) :: cactiv ++ integer, dimension(:),intent(inout) :: cactiv + integer, dimension(im) :: k22_shallow,kbcon_shallow,ktop_shallow + real(kind=kind_phys), dimension(im) :: ht + real(kind=kind_phys), dimension(im) :: dx +diff --git a/physics/cu_ntiedtke.F90 b/physics/cu_ntiedtke.F90 +index a824c6a..66ae9d0 100644 +--- a/physics/cu_ntiedtke.F90 ++++ b/physics/cu_ntiedtke.F90 +@@ -159,16 +159,16 @@ contains + ! in&out variables + integer, intent(in) :: lq, km, ktrac + real(kind=kind_phys), intent(in ) :: dt +- integer, dimension( lq ), intent(in) :: lmask +- real(kind=kind_phys), dimension( lq ), intent(in ) :: evap, hfx, dx +- real(kind=kind_phys), dimension( lq , km ), intent(inout) :: pu, pv, pt, pqv +- real(kind=kind_phys), dimension( lq , km ), intent(in ) :: tdi, qvdi, poz, prsl, pomg, pqvf, ptf +- real(kind=kind_phys), dimension( lq , km+1 ), intent(in ) :: pzz, prsi +- real(kind=kind_phys), dimension( lq , km, ktrac ), intent(inout ) :: clw +- +- integer, dimension( lq ), intent(out) :: kbot, ktop, kcnv +- real(kind=kind_phys), dimension( lq ), intent(out) :: zprecc +- real(kind=kind_phys), dimension (lq,km), intent(out) :: ud_mf, dd_mf, dt_mf, cnvw, cnvc ++ integer, dimension( : ), intent(in) :: lmask ++ real(kind=kind_phys), dimension( : ), intent(in ) :: evap, hfx, dx ++ real(kind=kind_phys), dimension( :, : ), intent(inout) :: pu, pv, pt, pqv ++ real(kind=kind_phys), dimension( :, :), intent(in ) :: tdi, qvdi, poz, prsl, pomg, pqvf, ptf ++ real(kind=kind_phys), dimension( :, : ), intent(in ) :: pzz, prsi ++ real(kind=kind_phys), dimension( :, :, : ), intent(inout ) :: clw ++ ++ integer, dimension( : ), intent(out) :: kbot, ktop, kcnv ++ real(kind=kind_phys), dimension( : ), intent(out) :: zprecc ++ real(kind=kind_phys), dimension (:, :), intent(out) :: ud_mf, dd_mf, dt_mf, cnvw, cnvc + + ! error messages + character(len=*), intent(out) :: errmsg +diff --git a/physics/dcyc2.f b/physics/dcyc2.f +index 6dca65c..347639d 100644 +--- a/physics/dcyc2.f ++++ b/physics/dcyc2.f +@@ -216,36 +216,36 @@ + + ! integer, intent(in) :: ipr + ! logical lprnt +- logical, dimension(im), intent(in) :: dry, icy, wet ++ logical, dimension(:), intent(in) :: dry, icy, wet + real(kind=kind_phys), intent(in) :: solhr, slag, cdec, sdec, & + & deltim, fhswr + +- real(kind=kind_phys), dimension(im), intent(in) :: & ++ real(kind=kind_phys), dimension(:), intent(in) :: & + & sinlat, coslat, xlon, coszen, tf, tsflw, sfcdlw, & + & sfcdsw, sfcnsw + +- real(kind=kind_phys), dimension(im), intent(in) :: & ++ real(kind=kind_phys), dimension(:), intent(in) :: & + & tsfc_lnd, tsfc_ice, tsfc_wat, & + & sfcemis_lnd, sfcemis_ice, sfcemis_wat + +- real(kind=kind_phys), dimension(im), intent(in) :: & ++ real(kind=kind_phys), dimension(:), intent(in) :: & + & sfcnirbmu, sfcnirdfu, sfcvisbmu, sfcvisdfu, & + & sfcnirbmd, sfcnirdfd, sfcvisbmd, sfcvisdfd + +- real(kind=kind_phys), dimension(im,levs), intent(in) :: swh, hlw & ++ real(kind=kind_phys), dimension(:,:), intent(in) :: swh, hlw & + &, swhc, hlwc + + ! --- input/output: +- real(kind=kind_phys), dimension(im,levs), intent(inout) :: dtdt & ++ real(kind=kind_phys), dimension(:,:), intent(inout) :: dtdt & + &, dtdtc + + ! --- outputs: +- real(kind=kind_phys), dimension(im), intent(out) :: & ++ real(kind=kind_phys), dimension(:), intent(out) :: & + & adjsfcdsw, adjsfcnsw, adjsfcdlw, xmu, xcosz, & + & adjnirbmu, adjnirdfu, adjvisbmu, adjvisdfu, & + & adjnirbmd, adjnirdfd, adjvisbmd, adjvisdfd + +- real(kind=kind_phys), dimension(im), intent(out) :: & ++ real(kind=kind_phys), dimension(:), intent(out) :: & + & adjsfculw_lnd, adjsfculw_ice, adjsfculw_wat + + character(len=*), intent(out) :: errmsg +diff --git a/physics/drag_suite.F90 b/physics/drag_suite.F90 +index 55ef9c2..050d635 100644 +--- a/physics/drag_suite.F90 ++++ b/physics/drag_suite.F90 +@@ -298,8 +298,8 @@ + integer, intent(in) :: im, km, imx, kdt, ipr, me, master + integer, intent(in) :: gwd_opt + logical, intent(in) :: lprnt +- integer, intent(in) :: KPBL(im) +- real(kind=kind_phys), intent(in) :: deltim, G, CP, RD, RV, cdmbgwd(2) ++ integer, intent(in) :: KPBL(:) ++ real(kind=kind_phys), intent(in) :: deltim, G, CP, RD, RV, cdmbgwd(:) + + integer :: kpblmax + integer, parameter :: ims=1, kms=1, its=1, kts=1 +@@ -308,29 +308,29 @@ + real(kind=kind_phys) :: g_inv + + real(kind=kind_phys), intent(inout) :: & +- & dudt(im,km),dvdt(im,km), & +- & dtdt(im,km) +- real(kind=kind_phys), intent(out) :: rdxzb(im) ++ & dudt(:,:),dvdt(:,:), & ++ & dtdt(:,:) ++ real(kind=kind_phys), intent(out) :: rdxzb(:) + real(kind=kind_phys), intent(in) :: & +- & u1(im,km),v1(im,km), & +- & t1(im,km),q1(im,km), & +- & PHII(im,km+1),prsl(im,km), & +- & prslk(im,km),PHIL(im,km) +- real(kind=kind_phys), intent(in) :: prsi(im,km+1), & +- & del(im,km) +- real(kind=kind_phys), intent(in) :: var(im),oc1(im), & +- & oa4(im,4),ol4(im,4), & +- & dx(im) +- real(kind=kind_phys), intent(in) :: varss(im),oc1ss(im), & +- & oa4ss(im,4),ol4ss(im,4) +- real(kind=kind_phys), intent(in) :: THETA(im),SIGMA(im), & +- & GAMMA(im),ELVMAX(im) ++ & u1(:,:),v1(:,:), & ++ & t1(:,:),q1(:,:), & ++ & PHII(:,:),prsl(:,:), & ++ & prslk(:,:),PHIL(:,:) ++ real(kind=kind_phys), intent(in) :: prsi(:,:), & ++ & del(:,:) ++ real(kind=kind_phys), intent(in) :: var(:),oc1(:), & ++ & oa4(:,:),ol4(:,:), & ++ & dx(:) ++ real(kind=kind_phys), intent(in) :: varss(:),oc1ss(:), & ++ & oa4ss(:,:),ol4ss(:,:) ++ real(kind=kind_phys), intent(in) :: THETA(:),SIGMA(:), & ++ & GAMMA(:),ELVMAX(:) + + ! added for small-scale orographic wave drag + real(kind=kind_phys), dimension(im,km) :: utendwave,vtendwave,thx,thvx +- real(kind=kind_phys), intent(in) :: br1(im), & +- & hpbl(im), & +- & slmsk(im) ++ real(kind=kind_phys), intent(in) :: br1(:), & ++ & hpbl(:), & ++ & slmsk(:) + real(kind=kind_phys), dimension(im) :: govrth,xland + !real(kind=kind_phys), dimension(im,km) :: dz2 + real(kind=kind_phys) :: tauwavex0,tauwavey0, & +@@ -344,7 +344,7 @@ + + !Output: + real(kind=kind_phys), intent(out) :: & +- & dusfc(im), dvsfc(im) ++ & dusfc(:), dvsfc(:) + !Output (optional): + real(kind=kind_phys), intent(out) :: & + & dusfc_ls(:),dvsfc_ls(:), & +diff --git a/physics/flake_driver.F90 b/physics/flake_driver.F90 +index b882c74..a1edf69 100644 +--- a/physics/flake_driver.F90 ++++ b/physics/flake_driver.F90 +@@ -81,21 +81,21 @@ IMPLICIT NONE + integer, intent(in) :: im, imon,yearlen + ! integer, dimension(im), intent(in) :: islmsk + +- real (kind=kind_phys), dimension(im), intent(in) :: ps, wind, & ++ real (kind=kind_phys), dimension(:), intent(in) :: ps, wind, & + & t1, q1, dlwflx, dswsfc, zlvl, elev + + real (kind=kind_phys), intent(in) :: delt + +- real (kind=kind_phys), dimension(im), intent(in) :: & ++ real (kind=kind_phys), dimension(:), intent(in) :: & + & xlat, weasd, lakedepth + +- real (kind=kind_phys),dimension(im),intent(inout) :: & ++ real (kind=kind_phys),dimension(:),intent(inout) :: & + & snwdph, hice, tsurf, t_sfc, hflx, evap, fice, ustar, qsfc, & + & ch, cm, chh, cmm + + real (kind=kind_phys), intent(in) :: julian + +- logical, dimension(im), intent(in) :: flag_iter, wet, lake ++ logical, dimension(:), intent(in) :: flag_iter, wet, lake + + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg +diff --git a/physics/gcm_shoc.F90 b/physics/gcm_shoc.F90 +index dd7791e..3d98a5d 100644 +--- a/physics/gcm_shoc.F90 ++++ b/physics/gcm_shoc.F90 +@@ -35,12 +35,12 @@ subroutine shoc_run (nx, nzm, tcr, tcrf, con_cp, con_g, con_hvap, con_hfus, con_ + real(kind=kind_phys), intent(in) :: tcr, tcrf, con_cp, con_g, con_hvap, con_hfus, con_rv, con_rd, con_pi, con_fvirt, & + dtp, supice, pcrit, cefac, cesfac, tkef1, dis_opt + ! +- real(kind=kind_phys), intent(in), dimension(nx) :: hflx, evap +- real(kind=kind_phys), intent(in), dimension(nx,nzm) :: prsl, delp, phil, u, v, omega, rhc, prnum +- real(kind=kind_phys), intent(in), dimension(nx,nzm+1) :: phii ++ real(kind=kind_phys), intent(in), dimension(:) :: hflx, evap ++ real(kind=kind_phys), intent(in), dimension(:,:) :: prsl, delp, phil, u, v, omega, rhc, prnum ++ real(kind=kind_phys), intent(in), dimension(:,:) :: phii + ! +- real(kind=kind_phys), intent(inout), dimension(nx,nzm) :: gt0, cld_sgs, tke, tkh, wthv_sec +- real(kind=kind_phys), intent(inout), dimension(nx,nzm,ntrac) :: gq0 ++ real(kind=kind_phys), intent(inout), dimension(:,:) :: gt0, cld_sgs, tke, tkh, wthv_sec ++ real(kind=kind_phys), intent(inout), dimension(:,:,:) :: gq0 + + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg +@@ -1724,7 +1724,7 @@ contains + + + real function esatw(t) +- real t ! temperature (K) ++ real t ! temperature (K) + real a0,a1,a2,a3,a4,a5,a6,a7,a8 + data a0,a1,a2,a3,a4,a5,a6,a7,a8 / & + 6.11239921, 0.443987641, 0.142986287e-1, & +@@ -1737,8 +1737,8 @@ contains + + real function qsatw(t,p) + ! implicit none +- real t ! temperature (K) +- real p ! pressure (Pa) ++ real t ! temperature (K) ++ real p ! pressure (Pa) + real esat + ! esat = fpvs(t) + esat = fpvsl(t) +@@ -1749,7 +1749,7 @@ contains + + + real function esati(t) +- real t ! temperature (K) ++ real t ! temperature (K) + real a0,a1,a2,a3,a4,a5,a6,a7,a8 + data a0,a1,a2,a3,a4,a5,a6,a7,a8 / & + 6.11147274, 0.503160820, 0.188439774e-1, & +@@ -1769,8 +1769,8 @@ contains + end function esati + + real function qsati(t,p) +- real t ! temperature (K) +- real p ! pressure (Pa) ++ real t ! temperature (K) ++ real p ! pressure (Pa) + real esat !,esati + ! esat = fpvs(t) + esat = fpvsi(t) +@@ -1780,7 +1780,7 @@ contains + end function qsati + + real function dtesatw(t) +- real t ! temperature (K) ++ real t ! temperature (K) + real a0,a1,a2,a3,a4,a5,a6,a7,a8 + data a0,a1,a2,a3,a4,a5,a6,a7,a8 / & + 0.443956472, 0.285976452e-1, 0.794747212e-3, & +@@ -1792,14 +1792,14 @@ contains + end function dtesatw + + real function dtqsatw(t,p) +- real t ! temperature (K) +- real p ! pressure (Pa) ++ real t ! temperature (K) ++ real p ! pressure (Pa) + ! real dtesatw + dtqsatw = 100.0*0.622*dtesatw(t)/p + end function dtqsatw + + real function dtesati(t) +- real t ! temperature (K) ++ real t ! temperature (K) + real a0,a1,a2,a3,a4,a5,a6,a7,a8 + data a0,a1,a2,a3,a4,a5,a6,a7,a8 / & + 0.503223089, 0.377174432e-1, 0.126710138e-2, & +@@ -1820,8 +1820,8 @@ contains + + + real function dtqsati(t,p) +- real t ! temperature (K) +- real p ! pressure (Pa) ++ real t ! temperature (K) ++ real p ! pressure (Pa) + ! real dtesati + dtqsati = 100.0*0.622*dtesati(t)/p + end function dtqsati +diff --git a/physics/get_prs_fv3.F90 b/physics/get_prs_fv3.F90 +index 352a618..e520c3e 100644 +--- a/physics/get_prs_fv3.F90 ++++ b/physics/get_prs_fv3.F90 +@@ -28,12 +28,12 @@ contains + + ! Interface variables + integer, intent(in) :: ix, levs +- real(kind=kind_phys), dimension(ix,levs+1), intent(in) :: phii +- real(kind=kind_phys), dimension(ix,levs+1), intent(in) :: prsi +- real(kind=kind_phys), dimension(ix,levs), intent(in) :: tgrs +- real(kind=kind_phys), dimension(ix,levs), intent(in) :: qgrs1 +- real(kind=kind_phys), dimension(ix,levs), intent(out) :: del +- real(kind=kind_phys), dimension(ix,levs+1), intent(out) :: del_gz ++ real(kind=kind_phys), dimension(:,:), intent(in) :: phii ++ real(kind=kind_phys), dimension(:,:), intent(in) :: prsi ++ real(kind=kind_phys), dimension(:,:), intent(in) :: tgrs ++ real(kind=kind_phys), dimension(:,:), intent(in) :: qgrs1 ++ real(kind=kind_phys), dimension(:,:), intent(out) :: del ++ real(kind=kind_phys), dimension(:,:), intent(out) :: del_gz + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + +@@ -97,11 +97,11 @@ contains + + ! Interface variables + integer, intent(in) :: ix, levs +- real(kind=kind_phys), dimension(ix,levs), intent(in) :: gt0 +- real(kind=kind_phys), dimension(ix,levs), intent(in) :: gq01 +- real(kind=kind_phys), dimension(ix,levs+1), intent(inout) :: del_gz +- real(kind=kind_phys), dimension(ix,levs+1), intent(out) :: phii +- real(kind=kind_phys), dimension(ix,levs), intent(out) :: phil ++ real(kind=kind_phys), dimension(:,:), intent(in) :: gt0 ++ real(kind=kind_phys), dimension(:,:), intent(in) :: gq01 ++ real(kind=kind_phys), dimension(:,:), intent(inout) :: del_gz ++ real(kind=kind_phys), dimension(:,:), intent(out) :: phii ++ real(kind=kind_phys), dimension(:,:), intent(out) :: phil + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + +diff --git a/physics/gfdl_cloud_microphys.F90 b/physics/gfdl_cloud_microphys.F90 +index 1ccedb9..de1e0ef 100644 +--- a/physics/gfdl_cloud_microphys.F90 ++++ b/physics/gfdl_cloud_microphys.F90 +@@ -135,29 +135,29 @@ contains + ! interface variables + integer, intent(in ) :: levs, im + real(kind=kind_phys), intent(in ) :: con_g, con_fvirt, con_rd +- real(kind=kind_phys), intent(in ), dimension(1:im) :: frland, garea +- integer, intent(in ), dimension(1:im) :: islmsk +- real(kind=kind_phys), intent(inout), dimension(1:im,1:levs) :: gq0, gq0_ntcw, gq0_ntrw, gq0_ntiw, & ++ real(kind=kind_phys), intent(in ), dimension(:) :: frland, garea ++ integer, intent(in ), dimension(:) :: islmsk ++ real(kind=kind_phys), intent(inout), dimension(:,:) :: gq0, gq0_ntcw, gq0_ntrw, gq0_ntiw, & + gq0_ntsw, gq0_ntgl, gq0_ntclamt +- real(kind=kind_phys), intent(inout), dimension(1:im,1:levs) :: gt0, gu0, gv0 +- real(kind=kind_phys), intent(in ), dimension(1:im,1:levs) :: vvl, prsl, del +- real(kind=kind_phys), intent(in ), dimension(1:im,1:levs+1) :: phii ++ real(kind=kind_phys), intent(inout), dimension(:,:) :: gt0, gu0, gv0 ++ real(kind=kind_phys), intent(in ), dimension(:,:) :: vvl, prsl, del ++ real(kind=kind_phys), intent(in ), dimension(:,:) :: phii + + ! rain/snow/ice/graupel/precip amounts, fraction of frozen precip +- real(kind_phys), intent(out ), dimension(1:im) :: rain0 +- real(kind_phys), intent(out ), dimension(1:im) :: snow0 +- real(kind_phys), intent(out ), dimension(1:im) :: ice0 +- real(kind_phys), intent(out ), dimension(1:im) :: graupel0 +- real(kind_phys), intent(out ), dimension(1:im) :: prcp0 +- real(kind_phys), intent(out ), dimension(1:im) :: sr ++ real(kind_phys), intent(out ), dimension(:) :: rain0 ++ real(kind_phys), intent(out ), dimension(:) :: snow0 ++ real(kind_phys), intent(out ), dimension(:) :: ice0 ++ real(kind_phys), intent(out ), dimension(:) :: graupel0 ++ real(kind_phys), intent(out ), dimension(:) :: prcp0 ++ real(kind_phys), intent(out ), dimension(:) :: sr + + real(kind_phys), intent(in) :: dtp ! physics time step + logical, intent (in) :: hydrostatic, phys_hydrostatic + + logical, intent (in) :: lradar +- real(kind=kind_phys), intent(inout), dimension(1:im,1:levs) :: refl_10cm ++ real(kind=kind_phys), intent(inout), dimension(:,:) :: refl_10cm + logical, intent (in) :: reset, effr_in +- real(kind=kind_phys), intent(inout), dimension(1:im,1:levs) :: rew, rei, rer, res, reg ++ real(kind=kind_phys), intent(inout), dimension(:,:) :: rew, rei, rer, res, reg + + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg +diff --git a/physics/gfdl_fv_sat_adj.F90 b/physics/gfdl_fv_sat_adj.F90 +index 816488f..5cc3c91 100644 +--- a/physics/gfdl_fv_sat_adj.F90 ++++ b/physics/gfdl_fv_sat_adj.F90 +@@ -128,8 +128,8 @@ subroutine fv_sat_adj_init(do_sat_adj, kmp, nwat, ngas, rilist, cpilist, & + integer, intent(in ) :: kmp + integer, intent(in ) :: nwat + integer, intent(in ) :: ngas +- real(kind_dyn), intent(in ) :: rilist(0:ngas) +- real(kind_dyn), intent(in ) :: cpilist(0:ngas) ++ real(kind_dyn), intent(in ) :: rilist(:) ++ real(kind_dyn), intent(in ) :: cpilist(:) + integer, intent(in ) :: mpirank + integer, intent(in ) :: mpiroot + character(len=*), intent( out) :: errmsg +diff --git a/physics/gscond.f b/physics/gscond.f +index 28f2476..7144ba2 100644 +--- a/physics/gscond.f ++++ b/physics/gscond.f +@@ -73,14 +73,14 @@ + ! Interface variables + integer, intent(in) :: im, km, ipr + real(kind=kind_phys), intent(in) :: dt, dtf +- real(kind=kind_phys), intent(in) :: prsl(im,km), ps(im) +- real(kind=kind_phys), intent(inout) :: q(im,km) +- real(kind=kind_phys), intent(in) :: clw1(im,km), clw2(im,km) +- real(kind=kind_phys), intent(out) :: cwm(im,km) +- real(kind=kind_phys), intent(inout) :: t(im,km) & +- &, tp(im,km), qp(im,km), psp(im) & +- &, tp1(im,km), qp1(im,km), psp1(im) +- real(kind=kind_phys), intent(in) :: u(im,km) ++ real(kind=kind_phys), intent(in) :: prsl(:,:), ps(:) ++ real(kind=kind_phys), intent(inout) :: q(:,:) ++ real(kind=kind_phys), intent(in) :: clw1(:,:), clw2(:,:) ++ real(kind=kind_phys), intent(out) :: cwm(:,:) ++ real(kind=kind_phys), intent(inout) :: t(:,:) & ++ &, tp(:,:), qp(:,:), psp(:) & ++ &, tp1(:,:), qp1(:,:), psp1(:) ++ real(kind=kind_phys), intent(in) :: u(:,:) + logical, intent(in) :: lprnt + ! + character(len=*), intent(out) :: errmsg +diff --git a/physics/gwdc.f b/physics/gwdc.f +index 5c6f8ec..0978a95 100644 +--- a/physics/gwdc.f ++++ b/physics/gwdc.f +@@ -187,15 +187,15 @@ + !----------------------------------------------------------------------- + + integer, intent(in) :: im, km, lat, ipr +- integer, intent(in) :: ktop(im),kbot(im),kcnv(im) ++ integer, intent(in) :: ktop(:),kbot(:),kcnv(:) + real(kind=kind_phys), intent(in) :: grav,cp,rd,fv,fhour,deltim,pi +- real(kind=kind_phys), dimension(im), intent(in) :: qmax +- real(kind=kind_phys), dimension(im), intent(out) :: tauctx,taucty +- real(kind=kind_phys), dimension(im), intent(in) :: cldf,dlength +- real(kind=kind_phys), dimension(im,km), intent(in) :: u1,v1,t1, & ++ real(kind=kind_phys), dimension(:), intent(in) :: qmax ++ real(kind=kind_phys), dimension(:), intent(out) :: tauctx,taucty ++ real(kind=kind_phys), dimension(:), intent(in) :: cldf,dlength ++ real(kind=kind_phys), dimension(:,:), intent(in) :: u1,v1,t1, & + & q1,pmid1,dpmid1 +- real(kind=kind_phys), dimension(im,km), intent(out) :: utgwc,vtgwc +- real(kind=kind_phys), dimension(im,km+1), intent(in) :: pint1 ++ real(kind=kind_phys), dimension(:,:), intent(out) :: utgwc,vtgwc ++ real(kind=kind_phys), dimension(:,:), intent(in) :: pint1 + ! + logical, intent(in) :: lprnt + ! +diff --git a/physics/gwdps.f b/physics/gwdps.f +index b09413f..486aa66 100644 +--- a/physics/gwdps.f ++++ b/physics/gwdps.f +@@ -1315,4 +1315,4 @@ + subroutine gwdps_finalize() + end subroutine gwdps_finalize + +- end module gwdps ++ end module gwdps +\ No newline at end of file +diff --git a/physics/h2ophys.f b/physics/h2ophys.f +index b3bdd27..ccbce7c 100644 +--- a/physics/h2ophys.f ++++ b/physics/h2ophys.f +@@ -41,10 +41,10 @@ + ! interface variables + integer, intent(in) :: im, levs, kh2o, h2o_coeff, me + real(kind=kind_phys), intent(in) :: dt +- real(kind=kind_phys), intent(inout) :: h2o(im,levs) +- real(kind=kind_phys), intent(in) :: ph2o(kh2o) +- real(kind=kind_phys), intent(in) :: prsl(im,levs) +- real(kind=kind_phys), intent(in) :: h2opltc(im,kh2o,h2o_coeff) ++ real(kind=kind_phys), intent(inout) :: h2o(:,:) ++ real(kind=kind_phys), intent(in) :: ph2o(:) ++ real(kind=kind_phys), intent(in) :: prsl(:,:) ++ real(kind=kind_phys), intent(in) :: h2opltc(:,:,:) + logical , intent(in) :: ldiag3d + !real(kind=kind_phys), intent(inout) :: h2op(im,levs,h2o_coeff) + character(len=*), intent(out) :: errmsg +diff --git a/physics/lsm_ruc_sfc_sice_interstitial.F90 b/physics/lsm_ruc_sfc_sice_interstitial.F90 +index 27033fc..54c514a 100644 +--- a/physics/lsm_ruc_sfc_sice_interstitial.F90 ++++ b/physics/lsm_ruc_sfc_sice_interstitial.F90 +@@ -27,12 +27,12 @@ contains + + ! Interface variables + integer, intent(in) :: im, lsoil_ruc, lsoil, kice +- logical, dimension(im), intent(in) :: land, icy ++ logical, dimension(:), intent(in) :: land, icy + ! --- on Noah levels +- real (kind=kind_phys), dimension(im,lsoil), intent(inout) :: stc ++ real (kind=kind_phys), dimension(:,:), intent(inout) :: stc + ! --- on RUC levels +- real (kind=kind_phys), dimension(im,lsoil_ruc), intent(in) :: tslb +- real (kind=kind_phys), dimension(im,kice), intent(inout) :: tiice ++ real (kind=kind_phys), dimension(:,:), intent(in) :: tslb ++ real (kind=kind_phys), dimension(:,:), intent(inout) :: tiice + + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg +@@ -89,12 +89,12 @@ contains + + ! Interface variables + integer, intent(in) :: im, lsoil_ruc, lsoil, kice +- logical, dimension(im), intent(in) :: land, icy ++ logical, dimension(:), intent(in) :: land, icy + ! --- on Noah levels +- real (kind=kind_phys), dimension(im,lsoil), intent(in) :: stc +- real (kind=kind_phys), dimension(im,kice), intent(in) :: tiice ++ real (kind=kind_phys), dimension(:,:), intent(in) :: stc ++ real (kind=kind_phys), dimension(:,:), intent(in) :: tiice + ! --- on RUC levels +- real (kind=kind_phys), dimension(im,lsoil_ruc), intent(inout) :: tslb ++ real (kind=kind_phys), dimension(:,:), intent(inout) :: tslb + + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg +diff --git a/physics/m_micro.F90 b/physics/m_micro.F90 +index 69690d5..67706ca 100644 +--- a/physics/m_micro.F90 ++++ b/physics/m_micro.F90 +@@ -181,10 +181,10 @@ end subroutine m_micro_init + logical,intent(in) :: flipv, skip_macro + real (kind=kind_phys), intent(in):: dt_i, alf_fac, qc_min(2) + +- real (kind=kind_phys), dimension(im,lm),intent(in) :: & ++ real (kind=kind_phys), dimension(:,:),intent(in) :: & + & prsl_i,u_i,v_i,phil, omega_i, QLLS_i,QILS_i, & + & lwheat_i,swheat_i +- real (kind=kind_phys), dimension(im,0:lm),intent(in):: prsi_i, & ++ real (kind=kind_phys), dimension(:,:),intent(in):: prsi_i, & + & phii + ! GJF* These variables are conditionally allocated depending on whether the + ! Morrison-Gettelman microphysics is used, so they must be declared +@@ -194,26 +194,26 @@ end subroutine m_micro_init + & CNV_MFD_i, cf_upi, CNV_FICE_i, CNV_NDROP_i, & + & CNV_NICE_i, w_upi + ! *GJF +- real (kind=kind_phys), dimension(im,lm),intent(in) :: & ++ real (kind=kind_phys), dimension(:,:),intent(in) :: & + & rhc_i, naai_i, npccn_i +- real (kind=kind_phys), dimension(im,lm,ntrcaer),intent(in) :: & ++ real (kind=kind_phys), dimension(:,:,:),intent(in) :: & + & aerfld_i +- real (kind=kind_phys),dimension(im),intent(in):: TAUGWX, & ++ real (kind=kind_phys),dimension(:),intent(in):: TAUGWX, & + & TAUGWY, TAUOROX, TAUOROY, FRLAND,ZPBL,xlat,xlon + ! & TAUGWY, TAUX, TAUY, TAUOROX, TAUOROY,ps_i,FRLAND,ZPBL + ! & CNVPRCP + + ! output +- real (kind=kind_phys),dimension(im,lm), intent(out) :: lwm_o, qi_o, & ++ real (kind=kind_phys),dimension(:,:), intent(out) :: lwm_o, qi_o, & + cldreffl, cldreffi, cldreffr, cldreffs, cldreffg +- real (kind=kind_phys),dimension(im), intent(out) :: rn_o, sr_o ++ real (kind=kind_phys),dimension(:), intent(out) :: rn_o, sr_o + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + ! input and output + ! Anning Cheng 10/24/2016 twat for total water, diagnostic purpose +- integer, dimension(IM), intent(inout):: KCBL +- real (kind=kind_phys),dimension(im,lm),intent(inout):: q_io, t_io, & ++ integer, dimension(:), intent(inout):: KCBL ++ real (kind=kind_phys),dimension(:,:),intent(inout):: q_io, t_io, & + & ncpl_io,ncpi_io,CLLS_io + ! GJF* These variables are conditionally allocated depending on whether the + ! Morrison-Gettelman microphysics is used, so they must be declared +diff --git a/physics/m_micro_interstitial.F90 b/physics/m_micro_interstitial.F90 +index 930b32b..00e6f8e 100644 +--- a/physics/m_micro_interstitial.F90 ++++ b/physics/m_micro_interstitial.F90 +@@ -183,22 +183,22 @@ + integer, intent(in) :: im, levs, fprcp + logical, intent(in) :: mg3_as_mg2 + +- real(kind=kind_phys), intent(in ) :: ncpr(1:im,1:levs) +- real(kind=kind_phys), intent(in ) :: ncps(1:im,1:levs) +- real(kind=kind_phys), intent(in ) :: ncgl(1:im,1:levs) +- real(kind=kind_phys), intent(inout) :: qrn(1:im,1:levs) +- real(kind=kind_phys), intent(inout) :: qsnw(1:im,1:levs) +- real(kind=kind_phys), intent(inout) :: qgl(1:im,1:levs) +- real(kind=kind_phys), intent(inout) :: gq0_ice(1:im,1:levs) +- real(kind=kind_phys), intent(inout) :: gq0_rain(1:im,1:levs) +- real(kind=kind_phys), intent(inout) :: gq0_snow(1:im,1:levs) +- real(kind=kind_phys), intent(inout) :: gq0_graupel(1:im,1:levs) +- real(kind=kind_phys), intent(inout) :: gq0_rain_nc(1:im,1:levs) +- real(kind=kind_phys), intent(inout) :: gq0_snow_nc(1:im,1:levs) +- real(kind=kind_phys), intent(inout) :: gq0_graupel_nc(1:im,1:levs) +- real(kind=kind_phys), intent( out) :: ice(1:im) +- real(kind=kind_phys), intent( out) :: snow(1:im) +- real(kind=kind_phys), intent( out) :: graupel(1:im) ++ real(kind=kind_phys), intent(in ) :: ncpr(:,:) ++ real(kind=kind_phys), intent(in ) :: ncps(:,:) ++ real(kind=kind_phys), intent(in ) :: ncgl(:,:) ++ real(kind=kind_phys), intent(inout) :: qrn(:,:) ++ real(kind=kind_phys), intent(inout) :: qsnw(:,:) ++ real(kind=kind_phys), intent(inout) :: qgl(:,:) ++ real(kind=kind_phys), intent(inout) :: gq0_ice(:,:) ++ real(kind=kind_phys), intent(inout) :: gq0_rain(:,:) ++ real(kind=kind_phys), intent(inout) :: gq0_snow(:,:) ++ real(kind=kind_phys), intent(inout) :: gq0_graupel(:,:) ++ real(kind=kind_phys), intent(inout) :: gq0_rain_nc(:,:) ++ real(kind=kind_phys), intent(inout) :: gq0_snow_nc(:,:) ++ real(kind=kind_phys), intent(inout) :: gq0_graupel_nc(:,:) ++ real(kind=kind_phys), intent( out) :: ice(:) ++ real(kind=kind_phys), intent( out) :: snow(:) ++ real(kind=kind_phys), intent( out) :: graupel(:) + real(kind=kind_phys), intent(in ) :: dtp + + character(len=*), intent(out) :: errmsg +diff --git a/physics/maximum_hourly_diagnostics.F90 b/physics/maximum_hourly_diagnostics.F90 +index 174e0c9..615c49b 100644 +--- a/physics/maximum_hourly_diagnostics.F90 ++++ b/physics/maximum_hourly_diagnostics.F90 +@@ -37,23 +37,23 @@ contains + logical, intent(in) :: reset, lradar + integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_fer_hires + real(kind_phys), intent(in ) :: con_g +- real(kind_phys), intent(in ) :: phil(im,levs) +- real(kind_phys), intent(in ) :: gt0(im,levs) +- real(kind_phys), intent(in ) :: refl_10cm(im,levs) +- real(kind_phys), intent(inout) :: refdmax(im) +- real(kind_phys), intent(inout) :: refdmax263k(im) +- real(kind_phys), intent(in ) :: u10m(im) +- real(kind_phys), intent(in ) :: v10m(im) +- real(kind_phys), intent(inout) :: u10max(im) +- real(kind_phys), intent(inout) :: v10max(im) +- real(kind_phys), intent(inout) :: spd10max(im) +- real(kind_phys), intent(in ) :: pgr(im) +- real(kind_phys), intent(in ) :: t2m(im) +- real(kind_phys), intent(in ) :: q2m(im) +- real(kind_phys), intent(inout) :: t02max(im) +- real(kind_phys), intent(inout) :: t02min(im) +- real(kind_phys), intent(inout) :: rh02max(im) +- real(kind_phys), intent(inout) :: rh02min(im) ++ real(kind_phys), intent(in ) :: phil(:,:) ++ real(kind_phys), intent(in ) :: gt0(:,:) ++ real(kind_phys), intent(in ) :: refl_10cm(:,:) ++ real(kind_phys), intent(inout) :: refdmax(:) ++ real(kind_phys), intent(inout) :: refdmax263k(:) ++ real(kind_phys), intent(in ) :: u10m(:) ++ real(kind_phys), intent(in ) :: v10m(:) ++ real(kind_phys), intent(inout) :: u10max(:) ++ real(kind_phys), intent(inout) :: v10max(:) ++ real(kind_phys), intent(inout) :: spd10max(:) ++ real(kind_phys), intent(in ) :: pgr(:) ++ real(kind_phys), intent(in ) :: t2m(:) ++ real(kind_phys), intent(in ) :: q2m(:) ++ real(kind_phys), intent(inout) :: t02max(:) ++ real(kind_phys), intent(inout) :: t02min(:) ++ real(kind_phys), intent(inout) :: rh02max(:) ++ real(kind_phys), intent(inout) :: rh02min(:) + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + +@@ -126,12 +126,12 @@ contains + subroutine max_fields(phil,ref3D,grav,im,levs,refd,tk,refd263k) + integer, intent(in) :: im,levs + real (kind=kind_phys), intent(in) :: grav +- real (kind=kind_phys), intent(in),dimension(im,levs) :: phil,ref3D,tk ++ real (kind=kind_phys), intent(in),dimension(:,:) :: phil,ref3D,tk + integer :: i,k,ll,ipt,kpt + real :: dbz1avg,zmidp1,zmidloc,refl,fact + real, dimension(im,levs) :: z + real, dimension(im) :: zintsfc +- real, dimension(im), intent(inout) :: refd,refd263k ++ real, dimension(:), intent(inout) :: refd,refd263k + REAL :: dbz1(2),dbzk,dbzk1 + logical :: counter + do i=1,im +diff --git a/physics/module_MYJSFC_wrapper.F90 b/physics/module_MYJSFC_wrapper.F90 +index e3dcf41..90c50ce 100644 +--- a/physics/module_MYJSFC_wrapper.F90 ++++ b/physics/module_MYJSFC_wrapper.F90 +@@ -91,22 +91,22 @@ + real(kind=kind_phys),intent(in) :: con_cp, con_g, con_rd + + !MYJ-2D +- logical,dimension(im),intent(in) :: flag_iter +- real(kind=kind_phys),dimension(im),intent(in) :: & ++ logical,dimension(:),intent(in) :: flag_iter ++ real(kind=kind_phys),dimension(:),intent(in) :: & + & prsik_1, prslk_1, tsfc, qsfc, slmsk +- real(kind=kind_phys),dimension(im),intent(inout) :: & ++ real(kind=kind_phys),dimension(:),intent(inout) :: & + & phy_myj_qsfc, phy_myj_thz0, phy_myj_qz0, & + & phy_myj_uz0, phy_myj_vz0, phy_myj_z0base, & + & phy_myj_akhs, phy_myj_akms, & + & phy_myj_chkqlm, phy_myj_elflx, & + & phy_myj_a1u, phy_myj_a1t, phy_myj_a1q +- real(kind=kind_phys),dimension(im),intent(inout) :: & ++ real(kind=kind_phys),dimension(:),intent(inout) :: & + & pblh, zorl, ustar, rib +- real(kind=kind_phys),dimension(im),intent(out) :: & ++ real(kind=kind_phys),dimension(:),intent(out) :: & + & cm, ch, stress, ffm, ffh, fm10, fh2 +- real(kind=kind_phys), dimension(im), intent(inout) :: & ++ real(kind=kind_phys), dimension(:), intent(inout) :: & + & landfrac, lakefrac, oceanfrac, fice +- real(kind=kind_phys), dimension(im), intent(inout) :: & ++ real(kind=kind_phys), dimension(:), intent(inout) :: & + & z0rl_wat, z0rl_lnd, z0rl_ice, & + & ustar_wat, ustar_lnd, ustar_ice, & + & cm_wat, cm_lnd, cm_ice, & +@@ -121,12 +121,12 @@ + + + !MYJ-3D +- real(kind=kind_phys),dimension(im,levs+1),intent(in) :: & ++ real(kind=kind_phys),dimension(:,:),intent(in) :: & + phii, prsi +- real(kind=kind_phys),dimension(im,levs),intent(in) :: & ++ real(kind=kind_phys),dimension(:,:),intent(in) :: & + & ugrs, vgrs, tgrs, prsl + !MYJ-4D +- real(kind=kind_phys),dimension(im,levs,ntrac),intent(in) :: & ++ real(kind=kind_phys),dimension(:,:,:),intent(in) :: & + & qgrs + + !LOCAL +diff --git a/physics/module_MYNNPBL_wrapper.F90 b/physics/module_MYNNPBL_wrapper.F90 +index 8fd7271..2d673e4 100644 +--- a/physics/module_MYNNPBL_wrapper.F90 ++++ b/physics/module_MYNNPBL_wrapper.F90 +@@ -234,13 +234,13 @@ SUBROUTINE mynnedmf_wrapper_run( & + REAL(kind=kind_phys) :: tem + + !MYNN-3D +- real(kind=kind_phys), dimension(im,levs+1), intent(in) :: phii +- real(kind=kind_phys), dimension(im,levs ), intent(inout) :: & ++ real(kind=kind_phys), dimension(:,:), intent(in) :: phii ++ real(kind=kind_phys), dimension(:,:), intent(inout) :: & + & dtdt, dudt, dvdt, & + & dqdt_water_vapor, dqdt_liquid_cloud, dqdt_ice_cloud, & + & dqdt_cloud_droplet_num_conc, dqdt_ice_num_conc, & + & dqdt_ozone, dqdt_water_aer_num_conc, dqdt_ice_aer_num_conc +- real(kind=kind_phys), dimension(im,levs), intent(inout) :: & ++ real(kind=kind_phys), dimension(:,:), intent(inout) :: & + & qke, qke_adv, EL_PBL, Sh3D, & + & qc_bl, qi_bl, cldfra_bl + !These 10 arrays are only allocated when bl_mynn_output > 0 +@@ -248,7 +248,7 @@ SUBROUTINE mynnedmf_wrapper_run( & + & edmf_a,edmf_w,edmf_qt, & + & edmf_thl,edmf_ent,edmf_qc, & + & sub_thl,sub_sqv,det_thl,det_sqv +- real(kind=kind_phys), dimension(im,levs), intent(in) :: & ++ real(kind=kind_phys), dimension(:,:), intent(in) :: & + & u,v,omega,t3d, & + & exner,prsl, & + & qgrs_water_vapor, & +@@ -259,13 +259,13 @@ SUBROUTINE mynnedmf_wrapper_run( & + & qgrs_ozone, & + & qgrs_water_aer_num_conc, & + & qgrs_ice_aer_num_conc +- real(kind=kind_phys), dimension(im,levs), intent(out) :: & ++ real(kind=kind_phys), dimension(:,:), intent(out) :: & + & Tsq, Qsq, Cov, exch_h, exch_m + real(kind=kind_phys), dimension(:,:), intent(inout) :: & + & du3dt_PBL, du3dt_OGWD, dv3dt_PBL, dv3dt_OGWD, & + & do3dt_PBL, dq3dt_PBL, dt3dt_PBL +- real(kind=kind_phys), dimension(im), intent(in) :: xmu +- real(kind=kind_phys), dimension(im, levs), intent(in) :: htrsw, htrlw ++ real(kind=kind_phys), dimension(:), intent(in) :: xmu ++ real(kind=kind_phys), dimension(:,:), intent(in) :: htrsw, htrlw + !LOCAL + real(kind=kind_phys), dimension(im,levs) :: & + & sqv,sqc,sqi,qnc,qni,ozone,qnwfa,qnifa, & +@@ -284,26 +284,26 @@ SUBROUTINE mynnedmf_wrapper_run( & + REAL(kind=kind_phys), DIMENSION( ndvel ) :: vd1 + + !MYNN-2D +- real(kind=kind_phys), dimension(im), intent(in) :: & ++ real(kind=kind_phys), dimension(:), intent(in) :: & + & dx,zorl,slmsk,tsurf,qsfc,ps, & + & hflx,qflx,ust,wspd,rb,recmol + +- real(kind=kind_phys), dimension(im), intent(in) :: & ++ real(kind=kind_phys), dimension(:), intent(in) :: & + & dusfc_cice,dvsfc_cice,dtsfc_cice,dqsfc_cice, & + & stress_ocn,hflx_ocn,qflx_ocn, & + & oceanfrac,fice + +- logical, dimension(im), intent(in) :: & ++ logical, dimension(:), intent(in) :: & + & wet, dry, icy + +- real(kind=kind_phys), dimension(im), intent(inout) :: & ++ real(kind=kind_phys), dimension(:), intent(inout) :: & + & pblh +- real(kind=kind_phys), dimension(im), intent(out) :: & ++ real(kind=kind_phys), dimension(:), intent(out) :: & + & ch,dtsfc1,dqsfc1,dusfc1,dvsfc1, & + & dtsfci_diag,dqsfci_diag,dtsfc_diag,dqsfc_diag, & + & dusfci_diag,dvsfci_diag,dusfc_diag,dvsfc_diag, & + & maxMF +- integer, dimension(im), intent(inout) :: & ++ integer, dimension(:), intent(inout) :: & + & kpbl,nupdraft,ktop_plume + + real(kind=kind_phys), dimension(:), intent(inout) :: & +diff --git a/physics/module_MYNNSFC_wrapper.F90 b/physics/module_MYNNSFC_wrapper.F90 +index 496db75..4bfb91c 100644 +--- a/physics/module_MYNNSFC_wrapper.F90 ++++ b/physics/module_MYNNSFC_wrapper.F90 +@@ -111,8 +111,8 @@ SUBROUTINE mynnsfc_wrapper_run( & + logical, intent(in) :: redrag ! reduced drag coeff. flag for high wind over sea (j.han) + + !Input data +- integer, dimension(im), intent(in) :: vegtype +- real(kind=kind_phys), dimension(im), intent(in) :: & ++ integer, dimension(:), intent(in) :: vegtype ++ real(kind=kind_phys), dimension(:), intent(in) :: & + & sigmaf,shdmax,z0pert,ztpert + + !MYNN-1D +@@ -124,23 +124,23 @@ SUBROUTINE mynnsfc_wrapper_run( & + & IMS,IME,JMS,JME,KMS,KME, & + & ITS,ITE,JTS,JTE,KTS,KTE + +- real(kind=kind_phys), dimension(im,levs+1), & ++ real(kind=kind_phys), dimension(:,:), & + & intent(in) :: phii +- real(kind=kind_phys), dimension(im,levs), & ++ real(kind=kind_phys), dimension(:,:), & + & intent(in) :: exner, PRSL, & + & u, v, t3d, qvsh, qc + + real(kind=kind_phys), dimension(im,levs) :: & + & pattern_spp_pbl, dz, th, qv + +- logical, dimension(im), intent(in) :: wet, dry, icy ++ logical, dimension(:), intent(in) :: wet, dry, icy + +- real(kind=kind_phys), dimension(im), intent(in) :: & ++ real(kind=kind_phys), dimension(:), intent(in) :: & + & tskin_ocn, tskin_lnd, tskin_ice, & + & tsurf_ocn, tsurf_lnd, tsurf_ice, & + & snowh_ocn, snowh_lnd, snowh_ice + +- real(kind=kind_phys), dimension(im), intent(inout) :: & ++ real(kind=kind_phys), dimension(:), intent(inout) :: & + & znt_ocn, znt_lnd, znt_ice, & + & ust_ocn, ust_lnd, ust_ice, & + & cm_ocn, cm_lnd, cm_ice, & +@@ -156,10 +156,10 @@ SUBROUTINE mynnsfc_wrapper_run( & + & qsfc_ocn, qsfc_lnd, qsfc_ice + + !MYNN-2D +- real(kind=kind_phys), dimension(im), intent(in) :: & ++ real(kind=kind_phys), dimension(:), intent(in) :: & + & dx, pblh, slmsk, ps + +- real(kind=kind_phys), dimension(im), intent(inout) :: & ++ real(kind=kind_phys), dimension(:), intent(inout) :: & + & ustm, hflx, qflx, wspd, qsfc, qsfc_ruc, & + & FLHC, FLQC, U10, V10, TH2, T2, Q2, & + & CHS2, CQS2, rmol, zol, mol, ch, & +diff --git a/physics/module_SGSCloud_RadPost.F90 b/physics/module_SGSCloud_RadPost.F90 +index bedb660..ea26259 100644 +--- a/physics/module_SGSCloud_RadPost.F90 ++++ b/physics/module_SGSCloud_RadPost.F90 +@@ -34,8 +34,8 @@ + + integer, intent(in) :: im, levs + logical, intent(in) :: flag_init, flag_restart +- real(kind=kind_phys), dimension(im,levs), intent(inout) :: qc, qi +- real(kind=kind_phys), dimension(im,levs), intent(in) :: qc_save, qi_save ++ real(kind=kind_phys), dimension(:,:), intent(inout) :: qc, qi ++ real(kind=kind_phys), dimension(:,:), intent(in) :: qc_save, qi_save + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + ! Local variable +diff --git a/physics/module_SGSCloud_RadPre.F90 b/physics/module_SGSCloud_RadPre.F90 +index 5a1a274..3380f8f 100644 +--- a/physics/module_SGSCloud_RadPre.F90 ++++ b/physics/module_SGSCloud_RadPre.F90 +@@ -67,20 +67,20 @@ + integer, intent(in) :: im, levs, imfdeepcnv, imfdeepcnv_gf, & + & nlay, imp_physics, imp_physics_gfdl + logical, intent(in) :: flag_init, flag_restart, do_mynnedmf +- real(kind=kind_phys), dimension(im,levs), intent(inout) :: qc, qi +- real(kind=kind_phys), dimension(im,levs), intent(inout) :: qr, qs, qg ++ real(kind=kind_phys), dimension(:,:), intent(inout) :: qc, qi ++ real(kind=kind_phys), dimension(:,:), intent(inout) :: qr, qs, qg + ! qci_conv only allocated if GF is used + real(kind=kind_phys), dimension(:,:), intent(inout) :: qci_conv +- real(kind=kind_phys), dimension(im,levs), intent(in) :: T3D,delp, & ++ real(kind=kind_phys), dimension(:,:), intent(in) :: T3D,delp, & + & qv,P3D +- real(kind=kind_phys), dimension(im,levs), intent(inout) :: & ++ real(kind=kind_phys), dimension(:,:), intent(inout) :: & + & clouds1,clouds2,clouds3,clouds4,clouds5 +- real(kind=kind_phys), dimension(im,levs), intent(inout) :: qc_save, qi_save +- real(kind=kind_phys), dimension(im,levs), intent(in) :: qc_bl, qi_bl, cldfra_bl +- real(kind=kind_phys), dimension(im), intent(in) :: slmsk, xlat, de_lgth +- real(kind=kind_phys), dimension(im,nlay), intent(in) :: plyr, dz +- real(kind=kind_phys), dimension(im,5), intent(inout) :: cldsa +- integer, dimension(im,3), intent(inout) :: mbota, mtopa ++ real(kind=kind_phys), dimension(:,:), intent(inout) :: qc_save, qi_save ++ real(kind=kind_phys), dimension(:,:), intent(in) :: qc_bl, qi_bl, cldfra_bl ++ real(kind=kind_phys), dimension(:), intent(in) :: slmsk, xlat, de_lgth ++ real(kind=kind_phys), dimension(:,:), intent(in) :: plyr, dz ++ real(kind=kind_phys), dimension(:,:), intent(inout) :: cldsa ++ integer, dimension(:,:), intent(inout) :: mbota, mtopa + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + ! Local variables +diff --git a/physics/moninedmf.f b/physics/moninedmf.f +index 63edc34..9a6e4a6 100644 +--- a/physics/moninedmf.f ++++ b/physics/moninedmf.f +@@ -79,38 +79,38 @@ + logical, intent(in) :: lprnt,lssav,ldiag3d,qdiag3d,lsidea + logical, intent(in) :: flag_for_pbl_generic_tend + integer, intent(in) :: ipr +- integer, intent(in) :: im, km, ntrac, ntcw, kinver(im), ntoz +- integer, intent(out) :: kpbl(im) ++ integer, intent(in) :: im, km, ntrac, ntcw, kinver(:), ntoz ++ integer, intent(out) :: kpbl(:) + + ! + real(kind=kind_phys), intent(in) :: delt, xkzm_m, xkzm_h, xkzm_s + real(kind=kind_phys), intent(in) :: xkzminv, moninq_fac +- real(kind=kind_phys), intent(inout) :: dv(im,km), du(im,km), & +- & tau(im,km), rtg(im,km,ntrac) ++ real(kind=kind_phys), intent(inout) :: dv(:,:), du(:,:), & ++ & tau(:,:), rtg(:,:,:) + ! Only allocated if ldiag3d or qdiag3d are true + real(kind=kind_phys), intent(inout), dimension(:,:) :: & + & du3dt_PBL,dv3dt_PBL,dt3dt_PBL,dq3dt_PBL,do3dt_PBL + real(kind=kind_phys), intent(in) :: & +- & u1(im,km), v1(im,km), & +- & t1(im,km), q1(im,km,ntrac), & +- & swh(im,km), hlw(im,km), & +- & xmu(im), psk(im), & +- & rbsoil(im), zorl(im), & +- & u10m(im), v10m(im), & +- & fm(im), fh(im), & +- & tsea(im), & +- & heat(im), evap(im), & +- & stress(im), spd1(im) ++ & u1(:,:), v1(:,:), & ++ & t1(:,:), q1(:,:,:), & ++ & swh(:,:), hlw(:,:), & ++ & xmu(:), psk(:), & ++ & rbsoil(:), zorl(:), & ++ & u10m(:), v10m(:), & ++ & fm(:), fh(:), & ++ & tsea(:), & ++ & heat(:), evap(:), & ++ & stress(:), spd1(:) + real(kind=kind_phys), intent(in) :: & +- & prsi(im,km+1), del(im,km), & +- & prsl(im,km), prslk(im,km), & +- & phii(im,km+1), phil(im,km) ++ & prsi(:,:), del(:,:), & ++ & prsl(:,:), prslk(:,:), & ++ & phii(:,:), phil(:,:) + real(kind=kind_phys), intent(out) :: & +- & dusfc(im), dvsfc(im), & +- & dtsfc(im), dqsfc(im), & +- & hpbl(im), dkt(im,km-1) ++ & dusfc(:), dvsfc(:), & ++ & dtsfc(:), dqsfc(:), & ++ & hpbl(:), dkt(:,:) + real(kind=kind_phys), intent(inout) :: & +- & hgamt(im), hgamq(im) ++ & hgamt(:), hgamq(:) + ! + logical, intent(in) :: dspheat + ! flag for tke dissipative heating +diff --git a/physics/moninedmf_hafs.f b/physics/moninedmf_hafs.f +index 00a8dbd..5b16a63 100644 +--- a/physics/moninedmf_hafs.f ++++ b/physics/moninedmf_hafs.f +@@ -76,37 +76,37 @@ + ! + logical, intent(in) :: lprnt + integer, intent(in) :: ipr +- integer, intent(in) :: im, km, ntrac, ntcw, kinver(im) +- integer, intent(in) :: islimsk(1:im) +- integer, intent(out) :: kpbl(im) ++ integer, intent(in) :: im, km, ntrac, ntcw, kinver(:) ++ integer, intent(in) :: islimsk(:) ++ integer, intent(out) :: kpbl(:) + + ! + real(kind=kind_phys), intent(in) :: delt, xkzm_m, xkzm_h, xkzm_s + real(kind=kind_phys), intent(in) :: xkzminv, moninq_fac +- real(kind=kind_phys), intent(inout) :: dv(im,km), du(im,km), & +- & tau(im,km), rtg(im,km,ntrac) ++ real(kind=kind_phys), intent(inout) :: dv(:,:), du(:,:), & ++ & tau(:,:), rtg(:,:,:) + real(kind=kind_phys), intent(in) :: & +- & u1(im,km), v1(im,km), & +- & t1(im,km), q1(im,km,ntrac), & +- & swh(im,km), hlw(im,km), & +- & xmu(im), psk(im), & +- & rbsoil(im), zorl(im), & +- & u10m(im), v10m(im), & +- & fm(im), fh(im), & +- & tsea(im), & +- & heat(im), evap(im), & +- & stress(im), spd1(im) ++ & u1(:,:), v1(:,:), & ++ & t1(:,:), q1(:,:,:), & ++ & swh(:,:), hlw(:,:), & ++ & xmu(:), psk(:), & ++ & rbsoil(:), zorl(:), & ++ & u10m(:), v10m(:), & ++ & fm(:), fh(:), & ++ & tsea(:), & ++ & heat(:), evap(:), & ++ & stress(:), spd1(:) + real(kind=kind_phys), intent(in) :: & +- & prsi(im,km+1), del(im,km), & +- & prsl(im,km), prslk(im,km), & +- & phii(im,km+1), phil(im,km) ++ & prsi(:,:), del(:,:), & ++ & prsl(:,:), prslk(:,:), & ++ & phii(:,:), phil(:,:) + real(kind=kind_phys), intent(out) :: & +- & dusfc(im), dvsfc(im), & +- & dtsfc(im), dqsfc(im), & +- & hpbl(im), dkt(im,km-1) ++ & dusfc(:), dvsfc(:), & ++ & dtsfc(:), dqsfc(:), & ++ & hpbl(:), dkt(:,:) + + real(kind=kind_phys), intent(inout) :: & +- & hgamt(im), hgamq(im) ++ & hgamt(:), hgamq(:) + ! + logical, intent(in) :: dspheat + ! flag for tke dissipative heating +diff --git a/physics/moninshoc.f b/physics/moninshoc.f +index 275d979..da5c102 100644 +--- a/physics/moninshoc.f ++++ b/physics/moninshoc.f +@@ -43,28 +43,28 @@ + ! + integer, intent(in) :: im, + & km, ntrac, ntcw, ncnd, ntke +- integer, dimension(im), intent(in) :: kinver ++ integer, dimension(:), intent(in) :: kinver + + real(kind=kind_phys), intent(in) :: delt, + & xkzm_m, xkzm_h, xkzm_s, xkzminv + real(kind=kind_phys), intent(in) :: grav, + & rd, cp, hvap, fv +- real(kind=kind_phys), dimension(im), intent(in) :: psk, ++ real(kind=kind_phys), dimension(:), intent(in) :: psk, + & rbsoil, zorl, u10m, v10m, fm, fh, tsea, heat, evap, stress, spd1 +- real(kind=kind_phys), dimension(im,km), intent(in) :: u1, v1, ++ real(kind=kind_phys), dimension(:,:), intent(in) :: u1, v1, + & t1, tkh, del, prsl, phil, prslk +- real(kind=kind_phys), dimension(im,km+1), intent(in) :: prsi, phii +- real(kind=kind_phys), dimension(im,km,ntrac), intent(in) :: q1 ++ real(kind=kind_phys), dimension(:,:), intent(in) :: prsi, phii ++ real(kind=kind_phys), dimension(:,:,:), intent(in) :: q1 + +- real(kind=kind_phys), dimension(im,km), intent(inout) :: du, dv, ++ real(kind=kind_phys), dimension(:,:), intent(inout) :: du, dv, + & tau +- real(kind=kind_phys), dimension(im,km,ntrac), intent(inout) :: rtg ++ real(kind=kind_phys), dimension(:,:,:), intent(inout) :: rtg + +- integer, dimension(im), intent(out) :: kpbl +- real(kind=kind_phys), dimension(im), intent(out) :: dusfc, ++ integer, dimension(:), intent(out) :: kpbl ++ real(kind=kind_phys), dimension(:), intent(out) :: dusfc, + & dvsfc, dtsfc, dqsfc, hpbl +- real(kind=kind_phys), dimension(im,km), intent(out) :: prnum +- real(kind=kind_phys), dimension(im,km-1), intent(out) :: dkt ++ real(kind=kind_phys), dimension(:,:), intent(out) :: prnum ++ real(kind=kind_phys), dimension(:,:), intent(out) :: dkt + + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg +diff --git a/physics/mp_fer_hires.F90 b/physics/mp_fer_hires.F90 +index 95e5211..a6907be 100644 +--- a/physics/mp_fer_hires.F90 ++++ b/physics/mp_fer_hires.F90 +@@ -53,9 +53,9 @@ module mp_fer_hires + logical, intent(in) :: restart + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg +- real(kind_phys), intent(out), optional :: f_ice(1:ncol,1:nlev) +- real(kind_phys), intent(out), optional :: f_rain(1:ncol,1:nlev) +- real(kind_phys), intent(out), optional :: f_rimef(1:ncol,1:nlev) ++ real(kind_phys), intent(out), optional :: f_ice(:,:) ++ real(kind_phys), intent(out), optional :: f_rain(:,:) ++ real(kind_phys), intent(out), optional :: f_rimef(:,:) + + + ! Local variables +@@ -153,28 +153,28 @@ module mp_fer_hires + logical, intent(in ) :: spec_adv + integer, intent(in ) :: mpirank + integer, intent(in ) :: mpiroot +- real(kind_phys), intent(in ) :: slmsk(1:ncol) +- real(kind_phys), intent(in ) :: prsi(1:ncol,1:nlev+1) +- real(kind_phys), intent(in ) :: p_phy(1:ncol,1:nlev) ++ real(kind_phys), intent(in ) :: slmsk(:) ++ real(kind_phys), intent(in ) :: prsi(:,:) ++ real(kind_phys), intent(in ) :: p_phy(:,:) + real(kind_phys), intent(in ) :: epsq,r_d,p608,cp,g +- real(kind_phys), intent(inout) :: t(1:ncol,1:nlev) +- real(kind_phys), intent(inout) :: q(1:ncol,1:nlev) +- real(kind_phys), intent(inout) :: cwm(1:ncol,1:nlev) +- real(kind_phys), intent(inout) :: train(1:ncol,1:nlev) +- real(kind_phys), intent(out ) :: sr(1:ncol) +- real(kind_phys), intent(inout) :: f_ice(1:ncol,1:nlev) +- real(kind_phys), intent(inout) :: f_rain(1:ncol,1:nlev) +- real(kind_phys), intent(inout) :: f_rimef(1:ncol,1:nlev) +- real(kind_phys), intent(inout) :: qc(1:ncol,1:nlev) +- real(kind_phys), intent(inout) :: qr(1:ncol,1:nlev) +- real(kind_phys), intent(inout) :: qi(1:ncol,1:nlev) +- real(kind_phys), intent(inout) :: qg(1:ncol,1:nlev) ! QRIMEF +- +- real(kind_phys), intent(inout) :: prec(1:ncol) ++ real(kind_phys), intent(inout) :: t(:,:) ++ real(kind_phys), intent(inout) :: q(:,:) ++ real(kind_phys), intent(inout) :: cwm(:,:) ++ real(kind_phys), intent(inout) :: train(:,:) ++ real(kind_phys), intent(out ) :: sr(:) ++ real(kind_phys), intent(inout) :: f_ice(:,:) ++ real(kind_phys), intent(inout) :: f_rain(:,:) ++ real(kind_phys), intent(inout) :: f_rimef(:,:) ++ real(kind_phys), intent(inout) :: qc(:,:) ++ real(kind_phys), intent(inout) :: qr(:,:) ++ real(kind_phys), intent(inout) :: qi(:,:) ++ real(kind_phys), intent(inout) :: qg(:,:) ! QRIMEF ++ ++ real(kind_phys), intent(inout) :: prec(:) + ! real(kind_phys) :: acprec(1:ncol) !MZ: change to local +- real(kind_phys), intent(inout) :: refl_10cm(1:ncol,1:nlev) ++ real(kind_phys), intent(inout) :: refl_10cm(:,:) + real(kind_phys), intent(in ) :: rhgrd +- real(kind_phys), intent(in ) :: dx(1:ncol) ++ real(kind_phys), intent(in ) :: dx(:) + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + ! +diff --git a/physics/mp_thompson.F90 b/physics/mp_thompson.F90 +index ec19945..ef4748c 100644 +--- a/physics/mp_thompson.F90 ++++ b/physics/mp_thompson.F90 +@@ -380,14 +380,14 @@ module mp_thompson + real(kind_phys), intent(in ) :: con_g + real(kind_phys), intent(in ) :: con_rd + ! Hydrometeors +- real(kind_phys), intent(inout) :: spechum(1:ncol,1:nlev) +- real(kind_phys), intent(inout) :: qc(1:ncol,1:nlev) +- real(kind_phys), intent(inout) :: qr(1:ncol,1:nlev) +- real(kind_phys), intent(inout) :: qi(1:ncol,1:nlev) +- real(kind_phys), intent(inout) :: qs(1:ncol,1:nlev) +- real(kind_phys), intent(inout) :: qg(1:ncol,1:nlev) +- real(kind_phys), intent(inout) :: ni(1:ncol,1:nlev) +- real(kind_phys), intent(inout) :: nr(1:ncol,1:nlev) ++ real(kind_phys), intent(inout) :: spechum(:,:) ++ real(kind_phys), intent(inout) :: qc(:,:) ++ real(kind_phys), intent(inout) :: qr(:,:) ++ real(kind_phys), intent(inout) :: qi(:,:) ++ real(kind_phys), intent(inout) :: qs(:,:) ++ real(kind_phys), intent(inout) :: qg(:,:) ++ real(kind_phys), intent(inout) :: ni(:,:) ++ real(kind_phys), intent(inout) :: nr(:,:) + ! Aerosols + logical, intent(in) :: is_aerosol_aware, reset + ! The following arrays are not allocated if is_aerosol_aware is false +@@ -397,25 +397,25 @@ module mp_thompson + real(kind_phys), optional, intent(in ) :: nwfa2d(:) + real(kind_phys), optional, intent(in ) :: nifa2d(:) + ! State variables and timestep information +- real(kind_phys), intent(inout) :: tgrs(1:ncol,1:nlev) +- real(kind_phys), intent(in ) :: prsl(1:ncol,1:nlev) +- real(kind_phys), intent(in ) :: phii(1:ncol,1:nlev+1) +- real(kind_phys), intent(in ) :: omega(1:ncol,1:nlev) ++ real(kind_phys), intent(inout) :: tgrs(:,:) ++ real(kind_phys), intent(in ) :: prsl(:,:) ++ real(kind_phys), intent(in ) :: phii(:,:) ++ real(kind_phys), intent(in ) :: omega(:,:) + real(kind_phys), intent(in ) :: dtp + ! Precip/rain/snow/graupel fall amounts and fraction of frozen precip +- real(kind_phys), intent( out) :: prcp(1:ncol) +- real(kind_phys), intent( out) :: rain(1:ncol) +- real(kind_phys), intent( out) :: graupel(1:ncol) +- real(kind_phys), intent( out) :: ice(1:ncol) +- real(kind_phys), intent( out) :: snow(1:ncol) +- real(kind_phys), intent( out) :: sr(1:ncol) ++ real(kind_phys), intent( out) :: prcp(:) ++ real(kind_phys), intent( out) :: rain(:) ++ real(kind_phys), intent( out) :: graupel(:) ++ real(kind_phys), intent( out) :: ice(:) ++ real(kind_phys), intent( out) :: snow(:) ++ real(kind_phys), intent( out) :: sr(:) + ! Radar reflectivity +- real(kind_phys), intent( out) :: refl_10cm(1:ncol,1:nlev) ++ real(kind_phys), intent( out) :: refl_10cm(:,:) + logical, optional, intent(in ) :: do_radar_ref + ! Cloud effective radii +- real(kind_phys), optional, intent( out) :: re_cloud(1:ncol,1:nlev) +- real(kind_phys), optional, intent( out) :: re_ice(1:ncol,1:nlev) +- real(kind_phys), optional, intent( out) :: re_snow(1:ncol,1:nlev) ++ real(kind_phys), optional, intent( out) :: re_cloud(:,:) ++ real(kind_phys), optional, intent( out) :: re_ice(:,:) ++ real(kind_phys), optional, intent( out) :: re_snow(:,:) + ! MPI information + integer, intent(in) :: mpicomm + integer, intent(in) :: mpirank +diff --git a/physics/mp_thompson_post.F90 b/physics/mp_thompson_post.F90 +index cca7495..36e3093 100644 +--- a/physics/mp_thompson_post.F90 ++++ b/physics/mp_thompson_post.F90 +@@ -59,9 +59,9 @@ contains + ! Interface variables + integer, intent(in) :: ncol + integer, intent(in) :: nlev +- real(kind_phys), dimension(1:ncol,1:nlev), intent(in) :: tgrs_save +- real(kind_phys), dimension(1:ncol,1:nlev), intent(inout) :: tgrs +- real(kind_phys), dimension(1:ncol,1:nlev), intent(in) :: prslk ++ real(kind_phys), dimension(:,:), intent(in) :: tgrs_save ++ real(kind_phys), dimension(:,:), intent(inout) :: tgrs ++ real(kind_phys), dimension(:,:), intent(in) :: prslk + real(kind_phys), intent(in) :: dtp + real(kind_phys), intent(in) :: ttendlim + integer, intent(in) :: kdt +diff --git a/physics/mp_thompson_pre.F90 b/physics/mp_thompson_pre.F90 +index 4087ac8..957c1f1 100644 +--- a/physics/mp_thompson_pre.F90 ++++ b/physics/mp_thompson_pre.F90 +@@ -28,8 +28,8 @@ module mp_thompson_pre + ! Interface variables + integer, intent(in ) :: ncol + integer, intent(in ) :: nlev +- real(kind_phys), intent(in ) :: tgrs(1:ncol,1:nlev) +- real(kind_phys), intent( out) :: tgrs_save(1:ncol,1:nlev) ++ real(kind_phys), intent(in ) :: tgrs(:,:) ++ real(kind_phys), intent( out) :: tgrs_save(:,:) + + ! CCPP error handling + character(len=*), intent( out) :: errmsg +diff --git a/physics/ozphys.f b/physics/ozphys.f +index f8da587..ba6cb45 100644 +--- a/physics/ozphys.f ++++ b/physics/ozphys.f +@@ -68,8 +68,8 @@ + real(kind=kind_phys), intent(inout) :: & + & ozp1(:,:), ozp2(:,:), ozp3(:,:), ozp4(:,:) + real(kind=kind_phys), intent(in) :: & +- & dt, po3(ko3), prdout(im,ko3,oz_coeff), & +- & prsl(im,levs), tin(im,levs), delp(im,levs), & ++ & dt, po3(:), prdout(:,:,:), & ++ & prsl(:,:), tin(:,:), delp(:,:), & + & con_g + real :: gravi + logical, intent(in) :: ldiag3d, qdiag3d +diff --git a/physics/ozphys_2015.f b/physics/ozphys_2015.f +index 238a8fb..113dc03 100644 +--- a/physics/ozphys_2015.f ++++ b/physics/ozphys_2015.f +@@ -67,14 +67,14 @@ + real(kind=kind_phys),intent(in) :: con_g + real :: gravi + integer, intent(in) :: im, levs, ko3, pl_coeff,me +- real(kind=kind_phys), intent(in) :: po3(ko3), & +- & prsl(im,levs), tin(im,levs), & +- & delp(im,levs), & +- & prdout(im,ko3,pl_coeff), dt ++ real(kind=kind_phys), intent(in) :: po3(:), & ++ & prsl(:,:), tin(:,:), & ++ & delp(:,:), & ++ & prdout(:,:,:), dt + ! These arrays may not be allocated and need assumed array sizes + real(kind=kind_phys), intent(inout) :: & + & ozp1(:,:), ozp2(:,:), ozp3(:,:),ozp4(:,:) +- real(kind=kind_phys), intent(inout) :: oz(im,levs) ++ real(kind=kind_phys), intent(inout) :: oz(:,:) + + + character(len=*), intent(out) :: errmsg +diff --git a/physics/precpd.f b/physics/precpd.f +index 0e33055..8d58a38 100644 +--- a/physics/precpd.f ++++ b/physics/precpd.f +@@ -102,13 +102,13 @@ + ! Interface variables + integer, intent(in) :: im, km, jpr + real (kind=kind_phys), intent(in) :: dt +- real (kind=kind_phys), intent(in) :: del(im,km), prsl(im,km) +- real (kind=kind_phys), intent(inout) :: q(im,km), t(im,km), & +- & cwm(im,km) +- real (kind=kind_phys), intent(out) :: rn(im), sr(im), rainp(im,km) +- real (kind=kind_phys), intent(in) :: u00k(im,km) +- real (kind=kind_phys), intent(in) :: psautco(2), prautco(2), & +- & evpco, wminco(2), wk1(im) ++ real (kind=kind_phys), intent(in) :: del(:,:), prsl(:,:) ++ real (kind=kind_phys), intent(inout) :: q(:,:), t(:,:), & ++ & cwm(:,:) ++ real (kind=kind_phys), intent(out) :: rn(:), sr(:), rainp(:,:) ++ real (kind=kind_phys), intent(in) :: u00k(:,:) ++ real (kind=kind_phys), intent(in) :: psautco(:), prautco(:), & ++ & evpco, wminco(:), wk1(:) + logical, intent(in) :: lprnt + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg +diff --git a/physics/radlw_main.f b/physics/radlw_main.f +index 7b029f8..e45e556 100644 +--- a/physics/radlw_main.f ++++ b/physics/radlw_main.f +@@ -572,44 +572,44 @@ + + logical, intent(in) :: lprnt + +- real (kind=kind_phys), dimension(npts,nlp1), intent(in) :: plvl, & ++ real (kind=kind_phys), dimension(:,:), intent(in) :: plvl, & + & tlvl +- real (kind=kind_phys), dimension(npts,nlay), intent(in) :: plyr, & ++ real (kind=kind_phys), dimension(:,:), intent(in) :: plyr, & + & tlyr, qlyr, olyr, dzlyr, delpin + +- real (kind=kind_phys),dimension(npts,nlay),intent(in)::gasvmr_co2,& ++ real (kind=kind_phys),dimension(:,:),intent(in)::gasvmr_co2, & + & gasvmr_n2o, gasvmr_ch4, gasvmr_o2, gasvmr_co, gasvmr_cfc11, & + & gasvmr_cfc12, gasvmr_cfc22, gasvmr_ccl4 + +- real (kind=kind_phys), dimension(npts,nlay),intent(in):: cld_cf +- real (kind=kind_phys), dimension(npts,nlay),intent(in),optional:: & ++ real (kind=kind_phys), dimension(:,:),intent(in):: cld_cf ++ real (kind=kind_phys), dimension(:,:),intent(in),optional:: & + & cld_lwp, cld_ref_liq, cld_iwp, cld_ref_ice, & + & cld_rwp, cld_ref_rain, cld_swp, cld_ref_snow, & + & cld_od + +- real (kind=kind_phys), dimension(npts), intent(in) :: sfemis, & ++ real (kind=kind_phys), dimension(:), intent(in) :: sfemis, & + & sfgtmp, de_lgth + +- real (kind=kind_phys), dimension(npts,nlay,nbands),intent(in):: & ++ real (kind=kind_phys), dimension(:,:,:),intent(in):: & + & aeraod, aerssa + + ! --- outputs: +- real (kind=kind_phys), dimension(npts,nlay), intent(inout) :: hlwc +- real (kind=kind_phys), dimension(npts,nlay), intent(inout) :: & ++ real (kind=kind_phys), dimension(:,:), intent(inout) :: hlwc ++ real (kind=kind_phys), dimension(:,:), intent(inout) :: & + & cldtau + +- type (topflw_type), dimension(npts), intent(inout) :: topflx +- type (sfcflw_type), dimension(npts), intent(inout) :: sfcflx ++ type (topflw_type), dimension(:), intent(inout) :: topflx ++ type (sfcflw_type), dimension(:), intent(inout) :: sfcflx + + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + !! --- optional outputs: +- real (kind=kind_phys), dimension(npts,nlay,nbands),optional, & ++ real (kind=kind_phys), dimension(:,:,:),optional, & + & intent(inout) :: hlwb +- real (kind=kind_phys), dimension(npts,nlay), optional, & ++ real (kind=kind_phys), dimension(:,:), optional, & + & intent(inout) :: hlw0 +- type (proflw_type), dimension(npts,nlp1), optional, & ++ type (proflw_type), dimension(:,:), optional, & + & intent(inout) :: flxprf + logical, intent(in) :: lslwr + +diff --git a/physics/radsw_main.f b/physics/radsw_main.f +index b10541f..7f41cca 100644 +--- a/physics/radsw_main.f ++++ b/physics/radsw_main.f +@@ -659,59 +659,59 @@ + + logical, intent(in) :: lprnt, lsswr + +- real (kind=kind_phys), dimension(npts,nlp1), intent(in) :: & ++ real (kind=kind_phys), dimension(:,:), intent(in) :: & + & plvl, tlvl +- real (kind=kind_phys), dimension(npts,nlay), intent(in) :: & ++ real (kind=kind_phys), dimension(:,:), intent(in) :: & + & plyr, tlyr, qlyr, olyr, dzlyr, delpin + +- real (kind=kind_phys),dimension(npts),intent(in):: sfcalb_nir_dir +- real (kind=kind_phys),dimension(npts),intent(in):: sfcalb_nir_dif +- real (kind=kind_phys),dimension(npts),intent(in):: sfcalb_uvis_dir +- real (kind=kind_phys),dimension(npts),intent(in):: sfcalb_uvis_dif +- +- real(kind=kind_phys),dimension(npts,nlay),intent(in)::gasvmr_co2 +- real(kind=kind_phys),dimension(npts,nlay),intent(in)::gasvmr_n2o +- real(kind=kind_phys),dimension(npts,nlay),intent(in)::gasvmr_ch4 +- real(kind=kind_phys),dimension(npts,nlay),intent(in)::gasvmr_o2 +- real(kind=kind_phys),dimension(npts,nlay),intent(in)::gasvmr_co +- real(kind=kind_phys),dimension(npts,nlay),intent(in)::gasvmr_cfc11 +- real(kind=kind_phys),dimension(npts,nlay),intent(in)::gasvmr_cfc12 +- real(kind=kind_phys),dimension(npts,nlay),intent(in)::gasvmr_cfc22 +- real(kind=kind_phys),dimension(npts,nlay),intent(in)::gasvmr_ccl4 +- +- real (kind=kind_phys), dimension(npts,nlay),intent(in):: cld_cf +- real (kind=kind_phys), dimension(npts,nlay),intent(in),optional:: & ++ real (kind=kind_phys),dimension(:),intent(in):: sfcalb_nir_dir ++ real (kind=kind_phys),dimension(:),intent(in):: sfcalb_nir_dif ++ real (kind=kind_phys),dimension(:),intent(in):: sfcalb_uvis_dir ++ real (kind=kind_phys),dimension(:),intent(in):: sfcalb_uvis_dif ++ ++ real(kind=kind_phys),dimension(:,:),intent(in)::gasvmr_co2 ++ real(kind=kind_phys),dimension(:,:),intent(in)::gasvmr_n2o ++ real(kind=kind_phys),dimension(:,:),intent(in)::gasvmr_ch4 ++ real(kind=kind_phys),dimension(:,:),intent(in)::gasvmr_o2 ++ real(kind=kind_phys),dimension(:,:),intent(in)::gasvmr_co ++ real(kind=kind_phys),dimension(:,:),intent(in)::gasvmr_cfc11 ++ real(kind=kind_phys),dimension(:,:),intent(in)::gasvmr_cfc12 ++ real(kind=kind_phys),dimension(:,:),intent(in)::gasvmr_cfc22 ++ real(kind=kind_phys),dimension(:,:),intent(in)::gasvmr_ccl4 ++ ++ real (kind=kind_phys), dimension(:,:),intent(in):: cld_cf ++ real (kind=kind_phys), dimension(:,:),intent(in),optional:: & + & cld_lwp, cld_ref_liq, cld_iwp, cld_ref_ice, & + & cld_rwp, cld_ref_rain, cld_swp, cld_ref_snow, & + & cld_od, cld_ssa, cld_asy + +- real(kind=kind_phys),dimension(npts,nlay,nbdsw),intent(in)::aeraod +- real(kind=kind_phys),dimension(npts,nlay,nbdsw),intent(in)::aerssa +- real(kind=kind_phys),dimension(npts,nlay,nbdsw),intent(in)::aerasy ++ real(kind=kind_phys),dimension(:,:,:),intent(in)::aeraod ++ real(kind=kind_phys),dimension(:,:,:),intent(in)::aerssa ++ real(kind=kind_phys),dimension(:,:,:),intent(in)::aerasy + + real (kind=kind_phys), intent(in) :: cosz(npts), solcon, & + & de_lgth(npts) + + ! --- outputs: +- real (kind=kind_phys), dimension(npts,nlay), intent(inout) :: hswc +- real (kind=kind_phys), dimension(npts,nlay), intent(inout) :: & ++ real (kind=kind_phys), dimension(:,:), intent(inout) :: hswc ++ real (kind=kind_phys), dimension(:,:), intent(inout) :: & + & cldtau + +- type (topfsw_type), dimension(npts), intent(inout) :: topflx +- type (sfcfsw_type), dimension(npts), intent(inout) :: sfcflx ++ type (topfsw_type), dimension(:), intent(inout) :: topflx ++ type (sfcfsw_type), dimension(:), intent(inout) :: sfcflx + + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + !! --- optional outputs: +- real (kind=kind_phys), dimension(npts,nlay,nbdsw), optional, & ++ real (kind=kind_phys), dimension(:,:,:), optional, & + & intent(inout) :: hswb + +- real (kind=kind_phys), dimension(npts,nlay), optional, & ++ real (kind=kind_phys), dimension(:,:), optional, & + & intent(inout) :: hsw0 +- type (profsw_type), dimension(npts,nlp1), optional, & ++ type (profsw_type), dimension(:,:), optional, & + & intent(inout) :: flxprf +- type (cmpfsw_type), dimension(npts), optional, & ++ type (cmpfsw_type), dimension(:), optional, & + & intent(inout) :: fdncmp + + ! --- locals: +diff --git a/physics/rayleigh_damp.f b/physics/rayleigh_damp.f +index a56a85e..579370c 100644 +--- a/physics/rayleigh_damp.f ++++ b/physics/rayleigh_damp.f +@@ -71,9 +71,9 @@ + logical,intent(in) :: lsidea,ldiag3d + integer,intent(in) :: im, km,levr + real(kind=kind_phys),intent(in) :: DT, CP, PRSLRD0, ral_ts +- real(kind=kind_phys),intent(in) :: pgr(im), PRSL(IM,KM) +- real(kind=kind_phys),intent(in) :: U1(IM,KM), V1(IM,KM) +- real(kind=kind_phys),intent(inout) :: A(IM,KM), B(IM,KM), C(IM,KM) ++ real(kind=kind_phys),intent(in) :: pgr(:), PRSL(:,:) ++ real(kind=kind_phys),intent(in) :: U1(:,:), V1(:,:) ++ real(kind=kind_phys),intent(inout) :: A(:,:), B(:,:), C(:,:) + real(kind=kind_phys),intent(inout) :: du3dt(:,:) + real(kind=kind_phys),intent(inout) :: dv3dt(:,:) + real(kind=kind_phys),intent(inout) :: dt3dt(:,:) +diff --git a/physics/rrtmg_lw_post.F90 b/physics/rrtmg_lw_post.F90 +index af83c5c..7715ed7 100644 +--- a/physics/rrtmg_lw_post.F90 ++++ b/physics/rrtmg_lw_post.F90 +@@ -30,8 +30,8 @@ + type(GFS_grid_type), intent(in) :: Grid + type(GFS_radtend_type), intent(inout) :: Radtend + integer, intent(in) :: im, ltp, LM, kd +- real(kind=kind_phys), dimension(size(Grid%xlon,1), lm+LTP), intent(in) :: htlwc, htlw0 +- real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(in) :: tsfa ++ real(kind=kind_phys), dimension(:,:), intent(in) :: htlwc, htlw0 ++ real(kind=kind_phys), dimension(:), intent(in) :: tsfa + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + ! local variables +diff --git a/physics/rrtmg_lw_pre.F90 b/physics/rrtmg_lw_pre.F90 +index 7de02ee..1e46717 100644 +--- a/physics/rrtmg_lw_pre.F90 ++++ b/physics/rrtmg_lw_pre.F90 +@@ -30,7 +30,7 @@ + type(GFS_sfcprop_type), intent(in) :: Sfcprop + type(GFS_grid_type), intent(in) :: Grid + integer, intent(in) :: im +- real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(in) :: tsfa, tsfg ++ real(kind=kind_phys), dimension(:), intent(in) :: tsfa, tsfg + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + +diff --git a/physics/rrtmg_sw_post.F90 b/physics/rrtmg_sw_post.F90 +index b0ab311..b9534e0 100644 +--- a/physics/rrtmg_sw_post.F90 ++++ b/physics/rrtmg_sw_post.F90 +@@ -35,9 +35,9 @@ + type(GFS_grid_type), intent(in) :: Grid + type(GFS_diag_type), intent(inout) :: Diag + integer, intent(in) :: im, lm, kd, nday, ltp +- type(cmpfsw_type), dimension(size(Grid%xlon,1)), intent(inout) :: scmpsw +- real(kind=kind_phys), dimension(Size(Grid%xlon,1), lm+LTP), intent(in) :: htswc, htsw0 +- real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(in) :: sfcalb1, sfcalb2, sfcalb3, sfcalb4 ++ type(cmpfsw_type), dimension(:), intent(inout) :: scmpsw ++ real(kind=kind_phys), dimension(:,:), intent(in) :: htswc, htsw0 ++ real(kind=kind_phys), dimension(:), intent(in) :: sfcalb1, sfcalb2, sfcalb3, sfcalb4 + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + ! Local variables +diff --git a/physics/rrtmg_sw_pre.F90 b/physics/rrtmg_sw_pre.F90 +index 05e8d4c..3ef89c8 100644 +--- a/physics/rrtmg_sw_pre.F90 ++++ b/physics/rrtmg_sw_pre.F90 +@@ -34,10 +34,10 @@ + type(GFS_grid_type), intent(in) :: Grid + integer, intent(in) :: im + integer, intent(out) :: nday +- integer, dimension(size(Grid%xlon,1)), intent(out) :: idxday +- real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(in) :: tsfa, tsfg +- real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(out) :: sfcalb1, sfcalb2, sfcalb3, sfcalb4 +- real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(in) :: alb1d ++ integer, dimension(:), intent(out) :: idxday ++ real(kind=kind_phys), dimension(:), intent(in) :: tsfa, tsfg ++ real(kind=kind_phys), dimension(:), intent(out) :: sfcalb1, sfcalb2, sfcalb3, sfcalb4 ++ real(kind=kind_phys), dimension(:), intent(in) :: alb1d + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + ! Local variables +diff --git a/physics/rrtmgp_lw_aerosol_optics.F90 b/physics/rrtmgp_lw_aerosol_optics.F90 +index 2047dea..0b4339b 100644 +--- a/physics/rrtmgp_lw_aerosol_optics.F90 ++++ b/physics/rrtmgp_lw_aerosol_optics.F90 +@@ -40,20 +40,20 @@ contains + nLev, & ! Number of vertical layers + nTracer, & ! Number of tracers + nTracerAer ! Number of aerosol tracers +- real(kind_phys), dimension(nCol), intent(in) :: & ++ real(kind_phys), dimension(:), intent(in) :: & + lon, & ! Longitude + lat, & ! Latitude + lsmask ! Land/sea/sea-ice mask +- real(kind_phys), dimension(nCol,Nlev),intent(in) :: & ++ real(kind_phys), dimension(:,:),intent(in) :: & + p_lay, & ! Pressure @ layer-centers (Pa) + tv_lay, & ! Virtual-temperature @ layer-centers (K) + relhum, & ! Relative-humidity @ layer-centers + p_lk ! Exner function @ layer-centers (1) +- real(kind_phys), dimension(nCol, nLev, nTracer),intent(in) :: & ++ real(kind_phys), dimension(:,:, :),intent(in) :: & + tracer ! trace gas concentrations +- real(kind_phys), dimension(nCol, nLev, nTracerAer),intent(in) :: & ++ real(kind_phys), dimension(:,:, :),intent(in) :: & + aerfld ! aerosol input concentrations +- real(kind_phys), dimension(nCol,nLev+1),intent(in) :: & ++ real(kind_phys), dimension(:,:),intent(in) :: & + p_lev ! Pressure @ layer-interfaces (Pa) + type(ty_gas_optics_rrtmgp),intent(in) :: & + sw_gas_props ! RRTMGP DDT: spectral information for SW calculation +@@ -61,7 +61,7 @@ contains + lw_gas_props ! RRTMGP DDT: spectral information for LW calculation + + ! Outputs +- real(kind_phys), dimension(nCol,NSPC1), intent(inout) :: & ++ real(kind_phys), dimension(:,:), intent(inout) :: & + aerodp ! Vertical integrated optical depth for various aerosol species + type(ty_optical_props_1scl),intent(out) :: & + lw_optical_props_aerosol ! RRTMGP DDT: Longwave aerosol optical properties (tau) +diff --git a/physics/rrtmgp_lw_cloud_optics.F90 b/physics/rrtmgp_lw_cloud_optics.F90 +index 93e3899..f679154 100644 +--- a/physics/rrtmgp_lw_cloud_optics.F90 ++++ b/physics/rrtmgp_lw_cloud_optics.F90 +@@ -286,10 +286,10 @@ contains + nCol, & ! Number of horizontal gridpoints + nLev, & ! Number of vertical levels + nrghice ! Number of ice-roughness categories +- real(kind_phys), dimension(nCol), intent(in) :: & ++ real(kind_phys), dimension(:), intent(in) :: & + lon, & ! Longitude + lat ! Latitude +- real(kind_phys), dimension(ncol,nLev),intent(in) :: & ++ real(kind_phys), dimension(:,:),intent(in) :: & + p_lay, & ! Layer pressure (Pa) + cld_frac, & ! Total cloud fraction by layer + cld_lwp, & ! Cloud liquid water path +@@ -314,7 +314,7 @@ contains + type(ty_optical_props_1scl),intent(out) :: & + lw_optical_props_cloudsByBand, & ! RRTMGP DDT: Longwave optical properties in each band (clouds) + lw_optical_props_precipByBand ! RRTMGP DDT: Longwave optical properties in each band (precipitation) +- real(kind_phys), dimension(ncol,nLev), intent(out) :: & ++ real(kind_phys), dimension(:,:), intent(out) :: & + cldtaulw ! Approx 10.mu band layer cloud optical depth + + ! Local variables +diff --git a/physics/rrtmgp_lw_cloud_sampling.F90 b/physics/rrtmgp_lw_cloud_sampling.F90 +index 1d6cc06..c5de7b5 100644 +--- a/physics/rrtmgp_lw_cloud_sampling.F90 ++++ b/physics/rrtmgp_lw_cloud_sampling.F90 +@@ -57,15 +57,15 @@ contains + nCol, & ! Number of horizontal gridpoints + nLev, & ! Number of vertical layers + ipsdlw0 ! Initial permutation seed for McICA +- integer,intent(in),dimension(ncol) :: & ++ integer,intent(in),dimension(:) :: & + icseed_lw ! auxiliary special cloud related array when module + ! variable isubclw=2, it provides permutation seed + ! for each column profile that are used for generating + ! random numbers. when isubclw /=2, it will not be used. +- real(kind_phys), dimension(ncol,nLev),intent(in) :: & ++ real(kind_phys), dimension(:,:),intent(in) :: & + cld_frac, & ! Total cloud fraction by layer + precip_frac ! Precipitation fraction by layer +- real(kind_phys), dimension(ncol,nLev), intent(in) :: & ++ real(kind_phys), dimension(:,:), intent(in) :: & + cloud_overlap_param, & ! Cloud overlap parameter + precip_overlap_param ! Precipitation overlap parameter + type(ty_gas_optics_rrtmgp),intent(in) :: & +diff --git a/physics/rrtmgp_lw_gas_optics.F90 b/physics/rrtmgp_lw_gas_optics.F90 +index 787db6b..deea465 100644 +--- a/physics/rrtmgp_lw_gas_optics.F90 ++++ b/physics/rrtmgp_lw_gas_optics.F90 +@@ -28,7 +28,7 @@ contains + rrtmgp_lw_file_gas ! RRTMGP file containing coefficients used to compute gaseous optical properties + integer, intent(in) :: & + rrtmgp_nGases ! Number of trace gases active in RRTMGP +- character(len=*),dimension(rrtmgp_nGases), intent(in) :: & ++ character(len=*),dimension(:), intent(in) :: & + active_gases_array ! Character array containing trace gases to include in RRTMGP + integer,intent(in) :: & + mpicomm, & ! MPI communicator +@@ -292,13 +292,13 @@ contains + nLev ! Number of vertical levels + type(ty_gas_optics_rrtmgp),intent(in) :: & + lw_gas_props ! RRTMGP DDT: +- real(kind_phys), dimension(ncol,nLev), intent(in) :: & ++ real(kind_phys), dimension(:,:), intent(in) :: & + p_lay, & ! Pressure @ model layer-centers (hPa) + t_lay ! Temperature (K) +- real(kind_phys), dimension(ncol,nLev+1), intent(in) :: & ++ real(kind_phys), dimension(:,:), intent(in) :: & + p_lev, & ! Pressure @ model layer-interfaces (hPa) + t_lev ! Temperature @ model levels +- real(kind_phys), dimension(ncol), intent(in) :: & ++ real(kind_phys), dimension(:), intent(in) :: & + skt ! Surface(skin) temperature (K) + type(ty_gas_concs),intent(in) :: & + gas_concentrations ! RRTMGP DDT: trace gas concentrations (vmr) +diff --git a/physics/rrtmgp_lw_pre.F90 b/physics/rrtmgp_lw_pre.F90 +index 1148c67..8bede8c 100644 +--- a/physics/rrtmgp_lw_pre.F90 ++++ b/physics/rrtmgp_lw_pre.F90 +@@ -39,7 +39,7 @@ contains + doLWrad ! Logical flag for longwave radiation call + integer, intent(in) :: & + nCol ! Number of horizontal grid points +- real(kind_phys), dimension(nCol), intent(in) :: & ++ real(kind_phys), dimension(:), intent(in) :: & + xlon, & ! Longitude + xlat, & ! Latitude + slmsk, & ! Land/sea/sea-ice mask +@@ -52,13 +52,13 @@ contains + lw_gas_props ! RRTMGP DDT: spectral information for LW calculation + + ! Outputs +- real(kind_phys), dimension(lw_gas_props%get_nband(),ncol), intent(out) :: & ++ real(kind_phys), dimension(:,:), intent(out) :: & + sfc_emiss_byband ! Surface emissivity in each band + character(len=*), intent(out) :: & + errmsg ! Error message + integer, intent(out) :: & + errflg ! Error flag +- real(kind_phys), dimension(nCol), intent(out) :: & ++ real(kind_phys), dimension(:), intent(out) :: & + semis + + ! Local variables +diff --git a/physics/rrtmgp_lw_rte.F90 b/physics/rrtmgp_lw_rte.F90 +index dc49260..137512c 100644 +--- a/physics/rrtmgp_lw_rte.F90 ++++ b/physics/rrtmgp_lw_rte.F90 +@@ -43,16 +43,16 @@ contains + nCol, & ! Number of horizontal gridpoints + nLev, & ! Number of vertical levels + nGauss_angles ! Number of angles used in Gaussian quadrature +- real(kind_phys), dimension(ncol,nLev), intent(in) :: & ++ real(kind_phys), dimension(:,:), intent(in) :: & + p_lay, & ! Pressure @ model layer-centers (hPa) + t_lay ! Temperature (K) +- real(kind_phys), dimension(ncol,nLev+1), intent(in) :: & ++ real(kind_phys), dimension(:,:), intent(in) :: & + p_lev ! Pressure @ model layer-interfaces (hPa) +- real(kind_phys), dimension(ncol), intent(in) :: & ++ real(kind_phys), dimension(:), intent(in) :: & + skt ! Surface(skin) temperature (K) + type(ty_gas_optics_rrtmgp),intent(in) :: & + lw_gas_props ! RRTMGP DDT: longwave spectral information +- real(kind_phys), dimension(lw_gas_props%get_nband(),ncol), intent(in) :: & ++ real(kind_phys), dimension(:,:), intent(in) :: & + sfc_emiss_byband ! Surface emissivity in each band + type(ty_source_func_lw),intent(in) :: & + sources ! RRTMGP DDT: longwave source functions +@@ -62,7 +62,7 @@ contains + lw_optical_props_clouds, & ! RRTMGP DDT: longwave cloud radiative properties + lw_optical_props_aerosol ! RRTMGP DDT: longwave aerosol radiative properties + ! Outputs +- real(kind_phys), dimension(ncol,nLev+1), intent(out) :: & ++ real(kind_phys), dimension(:,:), intent(out) :: & + fluxlwUP_allsky, & ! All-sky flux (W/m2) + fluxlwDOWN_allsky, & ! All-sky flux (W/m2) + fluxlwUP_clrsky, & ! Clear-sky flux (W/m2) +@@ -72,7 +72,7 @@ contains + integer, intent(out) :: & + errflg ! CCPP error flag + ! Outputs (optional) +- real(kind_phys), dimension(ncol,nLev+1), intent(out), optional :: & ++ real(kind_phys), dimension(:,:), intent(out), optional :: & + fluxlwUP_jac, & ! Jacobian of upward LW flux (W/m2/K) + fluxlwDOWN_jac ! Jacobian of downward LW flux (W/m2/K) + +diff --git a/physics/rrtmgp_sw_aerosol_optics.F90 b/physics/rrtmgp_sw_aerosol_optics.F90 +index 4bb0342..b689550 100644 +--- a/physics/rrtmgp_sw_aerosol_optics.F90 ++++ b/physics/rrtmgp_sw_aerosol_optics.F90 +@@ -41,22 +41,22 @@ contains + nLev, & ! Number of vertical layers + nTracer, & ! Number of tracers + nTracerAer ! Number of aerosol tracers +- integer,intent(in),dimension(nCol) :: & ++ integer,intent(in),dimension(:) :: & + idxday ! Indices for daylit points. +- real(kind_phys), dimension(nCol), intent(in) :: & ++ real(kind_phys), dimension(:), intent(in) :: & + lon, & ! Longitude + lat, & ! Latitude + lsmask ! Land/sea/sea-ice mask +- real(kind_phys), dimension(nCol,Nlev),intent(in) :: & ++ real(kind_phys), dimension(:,:),intent(in) :: & + p_lay, & ! Pressure @ layer-centers (Pa) + tv_lay, & ! Virtual-temperature @ layer-centers (K) + relhum, & ! Relative-humidity @ layer-centers + p_lk ! Exner function @ layer-centers (1) +- real(kind_phys), dimension(nCol, nLev, nTracer),intent(in) :: & ++ real(kind_phys), dimension(:, :,:),intent(in) :: & + tracer ! trace gas concentrations +- real(kind_phys), dimension(nCol, nLev, nTracerAer),intent(in) :: & ++ real(kind_phys), dimension(:, :,:),intent(in) :: & + aerfld ! aerosol input concentrations +- real(kind_phys), dimension(nCol,nLev+1),intent(in) :: & ++ real(kind_phys), dimension(:,:),intent(in) :: & + p_lev ! Pressure @ layer-interfaces (Pa) + type(ty_gas_optics_rrtmgp),intent(in) :: & + sw_gas_props ! RRTMGP DDT: spectral information for SW calculation +@@ -64,7 +64,7 @@ contains + lw_gas_props ! RRTMGP DDT: spectral information for LW calculation + + ! Outputs +- real(kind_phys), dimension(nCol,NSPC1), intent(inout) :: & ++ real(kind_phys), dimension(:,:), intent(inout) :: & + aerodp ! Vertical integrated optical depth for various aerosol species + type(ty_optical_props_2str),intent(out) :: & + sw_optical_props_aerosol ! RRTMGP DDT: Longwave aerosol optical properties (tau) +diff --git a/physics/rrtmgp_sw_cloud_optics.F90 b/physics/rrtmgp_sw_cloud_optics.F90 +index 7ab3c27..7907751 100644 +--- a/physics/rrtmgp_sw_cloud_optics.F90 ++++ b/physics/rrtmgp_sw_cloud_optics.F90 +@@ -304,9 +304,9 @@ contains + nLev, & ! Number of vertical levels + nday, & ! Number of daylit points. + nrghice ! Number of ice-roughness categories +- integer,intent(in),dimension(ncol) :: & ++ integer,intent(in),dimension(:) :: & + idxday ! Indices for daylit points. +- real(kind_phys), dimension(ncol,nLev),intent(in) :: & ++ real(kind_phys), dimension(:,:),intent(in) :: & + cld_frac, & ! Total cloud fraction by layer + cld_lwp, & ! Cloud liquid water path + cld_reliq, & ! Cloud liquid effective radius +@@ -330,7 +330,7 @@ contains + type(ty_optical_props_2str),intent(out) :: & + sw_optical_props_cloudsByBand, & ! RRTMGP DDT: Shortwave optical properties in each band (clouds) + sw_optical_props_precipByBand ! RRTMGP DDT: Shortwave optical properties in each band (cloud precipitation) +- real(kind_phys), dimension(ncol,NLev), intent(out) :: & ++ real(kind_phys), dimension(:,:), intent(out) :: & + cldtausw ! Approx 10.mu band layer cloud optical depth + + ! Local variables +diff --git a/physics/rrtmgp_sw_cloud_sampling.F90 b/physics/rrtmgp_sw_cloud_sampling.F90 +index 0a0511b..617bbfc 100644 +--- a/physics/rrtmgp_sw_cloud_sampling.F90 ++++ b/physics/rrtmgp_sw_cloud_sampling.F90 +@@ -58,17 +58,17 @@ contains + nDay, & ! Number of daylit points. + nLev, & ! Number of vertical layers + ipsdsw0 ! Initial permutation seed for McICA +- integer,intent(in),dimension(ncol) :: & ++ integer,intent(in),dimension(:) :: & + idxday ! Indices for daylit points. +- integer,intent(in),dimension(ncol) :: & ++ integer,intent(in),dimension(:) :: & + icseed_sw ! auxiliary special cloud related array when module + ! variable isubcsw=2, it provides permutation seed + ! for each column profile that are used for generating + ! random numbers. when isubcsw /=2, it will not be used. +- real(kind_phys), dimension(ncol,nLev),intent(in) :: & ++ real(kind_phys), dimension(:,:),intent(in) :: & + cld_frac, & ! Total cloud fraction by layer + precip_frac ! Precipitation fraction by layer +- real(kind_phys), dimension(ncol,nLev), intent(in) :: & ++ real(kind_phys), dimension(:,:), intent(in) :: & + cloud_overlap_param, & ! Cloud overlap parameter + precip_overlap_param ! Precipitation overlap parameter + type(ty_gas_optics_rrtmgp),intent(in) :: & +diff --git a/physics/rrtmgp_sw_gas_optics.F90 b/physics/rrtmgp_sw_gas_optics.F90 +index efe611e..fb14a57 100644 +--- a/physics/rrtmgp_sw_gas_optics.F90 ++++ b/physics/rrtmgp_sw_gas_optics.F90 +@@ -28,7 +28,7 @@ contains + rrtmgp_sw_file_gas ! RRTMGP file containing coefficients used to compute gaseous optical properties + integer, intent(in) :: & + rrtmgp_nGases ! Number of trace gases active in RRTMGP +- character(len=*),dimension(rrtmgp_nGases), intent(in) :: & ++ character(len=*),dimension(:), intent(in) :: & + active_gases_array ! Character array containing trace gases to include in RRTMGP + integer,intent(in) :: & + mpicomm, & ! MPI communicator +@@ -302,14 +302,14 @@ contains + nDay, & ! Number of daylit points. + nCol, & ! Number of horizontal points + nLev ! Number of vertical levels +- integer,intent(in),dimension(ncol) :: & ++ integer,intent(in),dimension(:) :: & + idxday ! Indices for daylit points. + type(ty_gas_optics_rrtmgp),intent(in) :: & + sw_gas_props ! RRTMGP DDT: spectral information for RRTMGP SW radiation scheme +- real(kind_phys), dimension(ncol,nLev), intent(in) :: & ++ real(kind_phys), dimension(:,:), intent(in) :: & + p_lay, & ! Pressure @ model layer-centers (hPa) + t_lay ! Temperature (K) +- real(kind_phys), dimension(ncol,nLev+1), intent(in) :: & ++ real(kind_phys), dimension(:,:), intent(in) :: & + p_lev, & ! Pressure @ model layer-interfaces (hPa) + t_lev ! Temperature @ model levels + type(ty_gas_concs),intent(in) :: & +@@ -318,7 +318,7 @@ contains + solcon ! Solar constant + integer, intent(in) :: & + rrtmgp_nGases ! Number of trace gases active in RRTMGP +- character(len=*),dimension(rrtmgp_nGases), intent(in) :: & ++ character(len=*),dimension(:), intent(in) :: & + active_gases_array ! Character array containing trace gases to include in RRTMGP + + ! Output +@@ -328,7 +328,7 @@ contains + errflg ! CCPP error code + type(ty_optical_props_2str),intent(out) :: & + sw_optical_props_clrsky ! RRTMGP DDT: clear-sky shortwave optical properties, spectral (tau,ssa,g) +- real(kind_phys), dimension(ncol,sw_gas_props%get_ngpt()), intent(out) :: & ++ real(kind_phys), dimension(:,:), intent(out) :: & + toa_src_sw ! TOA incident spectral flux (W/m2) + + ! Local variables +diff --git a/physics/rrtmgp_sw_rte.F90 b/physics/rrtmgp_sw_rte.F90 +index 9719c6e..2bcfe4f 100644 +--- a/physics/rrtmgp_sw_rte.F90 ++++ b/physics/rrtmgp_sw_rte.F90 +@@ -42,14 +42,14 @@ contains + nCol, & ! Number of horizontal gridpoints + nday, & ! Number of daytime points + nLev ! Number of vertical levels +- integer, intent(in), dimension(ncol) :: & ++ integer, intent(in), dimension(:) :: & + idxday ! Index array for daytime points +- real(kind_phys),intent(in), dimension(ncol) :: & ++ real(kind_phys),intent(in), dimension(:) :: & + coszen ! Cosize of SZA +- real(kind_phys), dimension(ncol,NLev), intent(in) :: & ++ real(kind_phys), dimension(:,:), intent(in) :: & + p_lay, & ! Pressure @ model layer-centers (Pa) + t_lay ! Temperature (K) +- real(kind_phys), dimension(ncol,NLev+1), intent(in) :: & ++ real(kind_phys), dimension(:,:), intent(in) :: & + p_lev ! Pressure @ model layer-interfaces (Pa) + type(ty_gas_optics_rrtmgp),intent(in) :: & + sw_gas_props ! RRTMGP DDT: SW spectral information +@@ -58,16 +58,16 @@ contains + type(ty_optical_props_2str),intent(in) :: & + sw_optical_props_clouds, & ! RRTMGP DDT: shortwave cloud radiative properties + sw_optical_props_aerosol ! RRTMGP DDT: shortwave aerosol radiative properties +- real(kind_phys), dimension(sw_gas_props%get_nband(),ncol), intent(in) :: & ++ real(kind_phys), dimension(:,:), intent(in) :: & + sfc_alb_nir_dir, & ! Surface albedo (direct) + sfc_alb_nir_dif, & ! Surface albedo (diffuse) + sfc_alb_uvvis_dir, & ! Surface albedo (direct) + sfc_alb_uvvis_dif ! Surface albedo (diffuse) +- real(kind_phys), dimension(ncol,sw_gas_props%get_ngpt()), intent(in) :: & ++ real(kind_phys), dimension(:,:), intent(in) :: & + toa_src_sw ! TOA incident spectral flux (W/m2) + integer, intent(in) :: & + rrtmgp_nGases ! Number of trace gases active in RRTMGP +- character(len=*),dimension(rrtmgp_nGases), intent(in) :: & ++ character(len=*),dimension(:), intent(in) :: & + active_gases_array ! Character array containing trace gases to include in RRTMGP + + ! Outputs +@@ -75,14 +75,14 @@ contains + errmsg ! CCPP error message + integer, intent(out) :: & + errflg ! CCPP error flag +- real(kind_phys), dimension(ncol,NLev+1), intent(inout) :: & ++ real(kind_phys), dimension(:,:), intent(inout) :: & + fluxswUP_allsky, & ! RRTMGP upward all-sky flux profiles (W/m2) + fluxswDOWN_allsky, & ! RRTMGP downward all-sky flux profiles (W/m2) + fluxswUP_clrsky, & ! RRTMGP upward clear-sky flux profiles (W/m2) + fluxswDOWN_clrsky ! RRTMGP downward clear-sky flux profiles (W/m2) + + ! Outputs (optional) +- type(cmpfsw_type), dimension(ncol), intent(inout),optional :: & ++ type(cmpfsw_type), dimension(:), intent(inout),optional :: & + scmpsw ! 2D surface fluxes, components: + ! uvbfc - total sky downward uv-b flux (W/m2) + ! uvbf0 - clear sky downward uv-b flux (W/m2) +diff --git a/physics/samfdeepcnv.f b/physics/samfdeepcnv.f +index 67576af..d67ebb7 100644 +--- a/physics/samfdeepcnv.f ++++ b/physics/samfdeepcnv.f +@@ -87,29 +87,29 @@ + implicit none + ! + integer, intent(in) :: im, km, itc, ntc, ntk, ntr, ncloud +- integer, intent(in) :: islimsk(im) ++ integer, intent(in) :: islimsk(:) + real(kind=kind_phys), intent(in) :: cliq, cp, cvap, eps, epsm1, & + & fv, grav, hvap, rd, rv, t0c + real(kind=kind_phys), intent(in) :: delt +- real(kind=kind_phys), intent(in) :: psp(im), delp(im,km), & +- & prslp(im,km), garea(im), dot(im,km), phil(im,km) ++ real(kind=kind_phys), intent(in) :: psp(:), delp(:,:), & ++ & prslp(:,:), garea(:), dot(:,:), phil(:,:) + real(kind=kind_phys), dimension(:), intent(in) :: fscav + logical, intent(in) :: hwrf_samfdeep + real(kind=kind_phys), intent(in) :: nthresh +- real(kind=kind_phys), intent(in) :: ca_deep(im) +- real(kind=kind_phys), intent(out) :: rainevap(im) ++ real(kind=kind_phys), intent(in) :: ca_deep(:) ++ real(kind=kind_phys), intent(out) :: rainevap(:) + logical, intent(in) :: do_ca,ca_closure,ca_entr,ca_trigger + +- integer, intent(inout) :: kcnv(im) ++ integer, intent(inout) :: kcnv(:) + ! DH* TODO - check dimensions of qtr, ntr+2 correct? *DH +- real(kind=kind_phys), intent(inout) :: qtr(im,km,ntr+2), & +- & q1(im,km), t1(im,km), u1(im,km), v1(im,km), & +- & cnvw(im,km), cnvc(im,km) ++ real(kind=kind_phys), intent(inout) :: qtr(:,:,:), & ++ & q1(:,:), t1(:,:), u1(:,:), v1(:,:), & ++ & cnvw(:,:), cnvc(:,:) + +- integer, intent(out) :: kbot(im), ktop(im) +- real(kind=kind_phys), intent(out) :: cldwrk(im), & +- & rn(im), & +- & ud_mf(im,km),dd_mf(im,km), dt_mf(im,km) ++ integer, intent(out) :: kbot(:), ktop(:) ++ real(kind=kind_phys), intent(out) :: cldwrk(:), & ++ & rn(:), & ++ & ud_mf(:,:),dd_mf(:,:), dt_mf(:,:) + + ! GJF* These variables are conditionally allocated depending on whether the + ! Morrison-Gettelman microphysics is used, so they must be declared +diff --git a/physics/samfshalcnv.f b/physics/samfshalcnv.f +index e489628..9571b55 100644 +--- a/physics/samfshalcnv.f ++++ b/physics/samfshalcnv.f +@@ -63,22 +63,22 @@ + implicit none + ! + integer, intent(in) :: im, km, itc, ntc, ntk, ntr, ncloud +- integer, intent(in) :: islimsk(im) ++ integer, intent(in) :: islimsk(:) + real(kind=kind_phys), intent(in) :: cliq, cp, cvap, & + & eps, epsm1, fv, grav, hvap, rd, rv, t0c + real(kind=kind_phys), intent(in) :: delt +- real(kind=kind_phys), intent(in) :: psp(im), delp(im,km), & +- & prslp(im,km), garea(im), hpbl(im), dot(im,km), phil(im,km) ++ real(kind=kind_phys), intent(in) :: psp(:), delp(:,:), & ++ & prslp(:,:), garea(:), hpbl(:), dot(:,:), phil(:,:) + ! + real(kind=kind_phys), dimension(:), intent(in) :: fscav +- integer, intent(inout) :: kcnv(im) ++ integer, intent(inout) :: kcnv(:) + ! DH* TODO - check dimensions of qtr, ntr+2 correct? *DH +- real(kind=kind_phys), intent(inout) :: qtr(im,km,ntr+2), & +- & q1(im,km), t1(im,km), u1(im,km), v1(im,km) ++ real(kind=kind_phys), intent(inout) :: qtr(:,:,:), & ++ & q1(:,:), t1(:,:), u1(:,:), v1(:,:) + ! +- integer, intent(out) :: kbot(im), ktop(im) +- real(kind=kind_phys), intent(out) :: rn(im), & +- & cnvw(im,km), cnvc(im,km), ud_mf(im,km), dt_mf(im,km) ++ integer, intent(out) :: kbot(:), ktop(:) ++ real(kind=kind_phys), intent(out) :: rn(:), & ++ & cnvw(:,:), cnvc(:,:), ud_mf(:,:), dt_mf(:,:) + ! + real(kind=kind_phys), intent(in) :: clam, c0s, c1, & + & asolfac, pgcon +diff --git a/physics/satmedmfvdif.F b/physics/satmedmfvdif.F +index f00fb37..69c0bb5 100644 +--- a/physics/satmedmfvdif.F ++++ b/physics/satmedmfvdif.F +@@ -71,8 +71,8 @@ + ! + !---------------------------------------------------------------------- + integer, intent(in) :: im, km, ntrac, ntcw, ntiw, ntke +- integer, intent(in) :: kinver(im) +- integer, intent(out) :: kpbl(im) ++ integer, intent(in) :: kinver(:) ++ integer, intent(out) :: kpbl(:) + ! + logical, intent(in) :: ldiag3d, qdiag3d + real(kind=kind_phys), intent(inout), dimension(:,:) :: & +@@ -81,26 +81,26 @@ + real(kind=kind_phys), intent(in) :: grav,rd,cp,rv,hvap,hfus,fv, & + & eps,epsm1 + real(kind=kind_phys), intent(in) :: delt, xkzm_m, xkzm_h, xkzm_s +- real(kind=kind_phys), intent(inout) :: dv(im,km), du(im,km), & +- & tdt(im,km), rtg(im,km,ntrac) ++ real(kind=kind_phys), intent(inout) :: dv(:,:), du(:,:), & ++ & tdt(:,:), rtg(:,:,:) + real(kind=kind_phys), intent(in) :: & +- & u1(im,km), v1(im,km), & +- & t1(im,km), q1(im,km,ntrac), & +- & swh(im,km), hlw(im,km), & +- & xmu(im), garea(im), & +- & psk(im), rbsoil(im), & +- & zorl(im), tsea(im), & +- & u10m(im), v10m(im), & +- & fm(im), fh(im), & +- & evap(im), heat(im), & +- & stress(im), spd1(im), & +- & prsi(im,km+1), del(im,km), & +- & prsl(im,km), prslk(im,km), & +- & phii(im,km+1), phil(im,km) ++ & u1(:,:), v1(:,:), & ++ & t1(:,:), q1(:,:,:), & ++ & swh(:,:), hlw(:,:), & ++ & xmu(:), garea(:), & ++ & psk(:), rbsoil(:), & ++ & zorl(:), tsea(:), & ++ & u10m(:), v10m(:), & ++ & fm(:), fh(:), & ++ & evap(:), heat(:), & ++ & stress(:), spd1(:), & ++ & prsi(:,:), del(:,:), & ++ & prsl(:,:), prslk(:,:), & ++ & phii(:,:), phil(:,:) + real(kind=kind_phys), intent(out) :: & +- & dusfc(im), dvsfc(im), & +- & dtsfc(im), dqsfc(im), & +- & hpbl(im) ++ & dusfc(:), dvsfc(:), & ++ & dtsfc(:), dqsfc(:), & ++ & hpbl(:) + ! + logical, intent(in) :: dspheat + character(len=*), intent(out) :: errmsg +diff --git a/physics/satmedmfvdifq.F b/physics/satmedmfvdifq.F +index f192788..0773137 100644 +--- a/physics/satmedmfvdifq.F ++++ b/physics/satmedmfvdifq.F +@@ -75,40 +75,40 @@ + ! + !---------------------------------------------------------------------- + integer, intent(in) :: im, km, ntrac, ntcw, ntiw, ntke, ntoz +- integer, intent(in) :: kinver(im) +- integer, intent(in) :: islimsk(im) +- integer, intent(out) :: kpbl(im) ++ integer, intent(in) :: kinver(:) ++ integer, intent(in) :: islimsk(:) ++ integer, intent(out) :: kpbl(:) + logical, intent(in) :: ldiag3d,qdiag3d + ! + real(kind=kind_phys), intent(in) :: grav,rd,cp,rv,hvap,hfus,fv, & + & eps,epsm1 + real(kind=kind_phys), intent(in) :: delt, xkzm_m, xkzm_h, xkzm_s + real(kind=kind_phys), intent(in) :: dspfac, bl_upfr, bl_dnfr +- real(kind=kind_phys), intent(inout) :: dv(im,km), du(im,km), & +- & tdt(im,km), rtg(im,km,ntrac) ++ real(kind=kind_phys), intent(inout) :: dv(:,:), du(:,:), & ++ & tdt(:,:), rtg(:,:,:) + real(kind=kind_phys), intent(in) :: & +- & u1(im,km), v1(im,km), & +- & t1(im,km), q1(im,km,ntrac), & +- & swh(im,km), hlw(im,km), & +- & xmu(im), garea(im), & +- & snwdph_lnd(im), & +- & psk(im), rbsoil(im), & +- & zorl(im), tsea(im), & +- & u10m(im), v10m(im), & +- & fm(im), fh(im), & +- & evap(im), heat(im), & +- & stress(im), spd1(im), & +- & prsi(im,km+1), del(im,km), & +- & prsl(im,km), prslk(im,km), & +- & phii(im,km+1), phil(im,km) ++ & u1(:,:), v1(:,:), & ++ & t1(:,:), q1(:,:,:), & ++ & swh(:,:), hlw(:,:), & ++ & xmu(:), garea(:), & ++ & snwdph_lnd(:), & ++ & psk(:), rbsoil(:), & ++ & zorl(:), tsea(:), & ++ & u10m(:), v10m(:), & ++ & fm(:), fh(:), & ++ & evap(:), heat(:), & ++ & stress(:), spd1(:), & ++ & prsi(:,:), del(:,:), & ++ & prsl(:,:), prslk(:,:), & ++ & phii(:,:), phil(:,:) + real(kind=kind_phys), intent(inout), dimension(:,:) :: & + & du3dt(:,:), dv3dt(:,:), & + & dt3dt(:,:), dq3dt(:,:), & + & do3dt(:,:) + real(kind=kind_phys), intent(out) :: & +- & dusfc(im), dvsfc(im), & +- & dtsfc(im), dqsfc(im), & +- & hpbl(im) ++ & dusfc(:), dvsfc(:), & ++ & dtsfc(:), dqsfc(:), & ++ & hpbl(:) + ! + logical, intent(in) :: dspheat + character(len=*), intent(out) :: errmsg +diff --git a/physics/sfc_cice.f b/physics/sfc_cice.f +index f845f60..44b3ee2 100644 +--- a/physics/sfc_cice.f ++++ b/physics/sfc_cice.f +@@ -107,14 +107,14 @@ + logical, intent(in) :: cplflx + + ! real (kind=kind_phys), dimension(im), intent(in) :: u1, v1, & +- real (kind=kind_phys), dimension(im), intent(in) :: & ++ real (kind=kind_phys), dimension(:), intent(in) :: & + & t1, q1, cm, ch, prsl1, wind, dqsfc, dtsfc, dusfc, dvsfc + &, snowd + + logical, intent(in) :: flag_cice(im), flag_iter(im) + + ! --- outputs: +- real (kind=kind_phys), dimension(im), intent(inout) :: qsurf, & ++ real (kind=kind_phys), dimension(:), intent(inout) :: qsurf, & + & cmm, chh, evap, hflx, stress + &, weasd, snwdph, ep + ! +diff --git a/physics/sfc_diag.f b/physics/sfc_diag.f +index b78c9b2..e91bd0e 100644 +--- a/physics/sfc_diag.f ++++ b/physics/sfc_diag.f +@@ -33,10 +33,10 @@ + ! + integer, intent(in) :: im + real(kind=kind_phys), intent(in) :: grav,cp,eps,epsm1 +- real(kind=kind_phys), dimension(im), intent(in) :: & ++ real(kind=kind_phys), dimension(:), intent(in) :: & + & ps, u1, v1, t1, q1, tskin, & + & qsurf, prslki, evap, fm, fh, fm10, fh2 +- real(kind=kind_phys), dimension(im), intent(out) :: & ++ real(kind=kind_phys), dimension(:), intent(out) :: & + & f10m, u10m, v10m, t2m, q2m + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg +diff --git a/physics/sfc_diag_post.F90 b/physics/sfc_diag_post.F90 +index 767e98d..1bf3e7e 100644 +--- a/physics/sfc_diag_post.F90 ++++ b/physics/sfc_diag_post.F90 +@@ -26,11 +26,11 @@ + integer, intent(in) :: im, lsm, lsm_noahmp + logical, intent(in) :: lssav + real(kind=kind_phys), intent(in) :: dtf, con_eps, con_epsm1 +- logical , dimension(im), intent(in) :: dry +- real(kind=kind_phys), dimension(im), intent(in) :: pgr, u10m, v10m ++ logical , dimension(:), intent(in) :: dry ++ real(kind=kind_phys), dimension(:), intent(in) :: pgr, u10m, v10m + real(kind=kind_phys), dimension(:) , intent(in) :: t2mmp, q2mp +- real(kind=kind_phys), dimension(im), intent(inout) :: t2m, q2m, tmpmin, tmpmax, spfhmin, spfhmax +- real(kind=kind_phys), dimension(im), intent(inout) :: wind10mmax, u10mmax, v10mmax, dpt2m ++ real(kind=kind_phys), dimension(:), intent(inout) :: t2m, q2m, tmpmin, tmpmax, spfhmin, spfhmax ++ real(kind=kind_phys), dimension(:), intent(inout) :: wind10mmax, u10mmax, v10mmax, dpt2m + + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg +diff --git a/physics/sfc_diff.f b/physics/sfc_diff.f +index b7ef1ea..93102e4 100644 +--- a/physics/sfc_diff.f ++++ b/physics/sfc_diff.f +@@ -90,24 +90,24 @@ + integer, intent(in) :: im, ivegsrc + integer, intent(in) :: sfc_z0_type ! option for calculating surface roughness length over ocean + +- integer, dimension(im), intent(in) :: vegtype ++ integer, dimension(:), intent(in) :: vegtype + + logical, intent(in) :: redrag ! reduced drag coeff. flag for high wind over sea (j.han) +- logical, dimension(im), intent(in) :: flag_iter, wet, dry, icy ++ logical, dimension(:), intent(in) :: flag_iter, wet, dry, icy + +- real(kind=kind_phys), dimension(im), intent(in) :: u10m,v10m ++ real(kind=kind_phys), dimension(:), intent(in) :: u10m,v10m + real(kind=kind_phys), intent(in) :: rvrdm1, eps, epsm1, grav +- real(kind=kind_phys), dimension(im), intent(in) :: & ++ real(kind=kind_phys), dimension(:), intent(in) :: & + & ps,t1,q1,z1,prsl1,prslki,prsik1,prslk1, & + & wind,sigmaf,shdmax, & + & z0pert,ztpert ! mg, sfc-perts +- real(kind=kind_phys), dimension(im), intent(in) :: & ++ real(kind=kind_phys), dimension(:), intent(in) :: & + & tskin_wat, tskin_lnd, tskin_ice, & + & tsurf_wat, tsurf_lnd, tsurf_ice, & + & snwdph_wat,snwdph_lnd,snwdph_ice + +- real(kind=kind_phys), dimension(im), intent(in) :: z0rl_wav +- real(kind=kind_phys), dimension(im), intent(inout) :: & ++ real(kind=kind_phys), dimension(:), intent(in) :: z0rl_wav ++ real(kind=kind_phys), dimension(:), intent(inout) :: & + & z0rl_wat, z0rl_lnd, z0rl_ice, & + & ustar_wat, ustar_lnd, ustar_ice, & + & cm_wat, cm_lnd, cm_ice, & +diff --git a/physics/sfc_drv.f b/physics/sfc_drv.f +index 5d8e196..878f08a 100644 +--- a/physics/sfc_drv.f ++++ b/physics/sfc_drv.f +@@ -211,11 +211,11 @@ + integer, intent(in) :: im, km, isot, ivegsrc + real (kind=kind_phys), intent(in) :: grav, cp, hvap, rd, eps, & + & epsm1, rvrdm1 +- real (kind=kind_phys), dimension(5), intent(in) :: pertvegf ++ real (kind=kind_phys), dimension(:), intent(in) :: pertvegf + +- integer, dimension(im), intent(in) :: soiltyp, vegtype, slopetyp ++ integer, dimension(:), intent(in) :: soiltyp, vegtype, slopetyp + +- real (kind=kind_phys), dimension(im), intent(in) :: ps, & ++ real (kind=kind_phys), dimension(:), intent(in) :: ps, & + & t1, q1, sigmaf, sfcemis, dlwflx, dswsfc, snet, tg3, cm, & + & ch, prsl1, prslki, wind, shdmin, shdmax, & + & snoalb, sfalb, zf, & +@@ -223,19 +223,19 @@ + + real (kind=kind_phys), intent(in) :: delt + +- logical, dimension(im), intent(in) :: flag_iter, flag_guess, land ++ logical, dimension(:), intent(in) :: flag_iter, flag_guess, land + + logical, intent(in) :: lheatstrg + + ! --- in/out: +- real (kind=kind_phys), dimension(im), intent(inout) :: weasd, & ++ real (kind=kind_phys), dimension(:), intent(inout) :: weasd, & + & snwdph, tskin, tprcp, srflag, canopy, trans, tsurf, zorl + +- real (kind=kind_phys), dimension(im,km), intent(inout) :: & ++ real (kind=kind_phys), dimension(:,:), intent(inout) :: & + & smc, stc, slc + + ! --- output: +- real (kind=kind_phys), dimension(im), intent(inout) :: sncovr1, & ++ real (kind=kind_phys), dimension(:), intent(inout) :: sncovr1, & + & qsurf, gflux, drain, evap, hflx, ep, runoff, cmm, chh, & + & evbs, evcw, sbsno, snowc, stm, snohf, smcwlt2, smcref2, & + & wet1 +diff --git a/physics/sfc_drv_ruc.F90 b/physics/sfc_drv_ruc.F90 +index 65935ef..ff72777 100644 +--- a/physics/sfc_drv_ruc.F90 ++++ b/physics/sfc_drv_ruc.F90 +@@ -168,9 +168,9 @@ module lsm_ruc + integer, intent(in) :: lsm_ruc, lsm + integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson + +- real (kind=kind_phys), dimension(im,lsoil), intent(inout) :: smc,stc,slc ++ real (kind=kind_phys), dimension(:,:), intent(inout) :: smc,stc,slc + +- real (kind=kind_phys), dimension(im), intent(in) :: & ++ real (kind=kind_phys), dimension(:), intent(in) :: & + & t1, sigmaf, sfcemis, dlwflx, dswsfc, snet, tg3, cm, & + & ch, prsl1, wind, shdmin, shdmax, & + & snoalb, alvwf, alnwf, zf, qc, q1 +@@ -182,30 +182,30 @@ module lsm_ruc + con_pi, con_rd, & + con_hvap, con_fvirt + +- logical, dimension(im), intent(in) :: flag_iter, flag_guess, land +- integer, dimension(im), intent(in) :: islimsk ! sea/land/ice mask (=0/1/2) ++ logical, dimension(:), intent(in) :: flag_iter, flag_guess, land ++ integer, dimension(:), intent(in) :: islimsk ! sea/land/ice mask (=0/1/2) + logical, intent(in) :: do_mynnsfclay + + logical, intent(in) :: rdlai + + ! --- in/out: +- integer, dimension(im), intent(inout) :: soiltyp, vegtype ++ integer, dimension(:), intent(inout) :: soiltyp, vegtype + real (kind=kind_phys), dimension(lsoil_ruc) :: dzs +- real (kind=kind_phys), dimension(lsoil_ruc), intent(inout ) :: zs +- real (kind=kind_phys), dimension(im), intent(inout) :: weasd, & ++ real (kind=kind_phys), dimension(:), intent(inout ) :: zs ++ real (kind=kind_phys), dimension(:), intent(inout) :: weasd, & + & snwdph, tskin, tskin_wat, & + & srflag, canopy, trans, tsurf, zorl, tsnow, & + & sfcqc, sfcqv, sfcdew, fice, tice, sfalb, smcwlt2, smcref2 + ! --- in +- real (kind=kind_phys), dimension(im), intent(in) :: & ++ real (kind=kind_phys), dimension(:), intent(in) :: & + & rainnc, rainc, ice, snow, graupel + ! --- in/out: + ! --- on RUC levels +- real (kind=kind_phys), dimension(im,lsoil_ruc), intent(inout) :: & ++ real (kind=kind_phys), dimension(:,:), intent(inout) :: & + & smois, tslb, sh2o, keepfr, smfrkeep + + ! --- output: +- real (kind=kind_phys), dimension(im), intent(inout) :: sncovr1, & ++ real (kind=kind_phys), dimension(:), intent(inout) :: sncovr1, & + & qsurf , gflux , evap , runof , drain , & + & runoff, srunoff, hflx, cmm, chh, & + & rhosnf, evbs, evcw, sbsno, stm, wetness, & +@@ -1053,25 +1053,25 @@ module lsm_ruc + integer, intent(in ) :: im, nlev + integer, intent(in ) :: lsoil_ruc + integer, intent(in ) :: lsoil +- logical, dimension(im), intent(in ) :: land +- real (kind=kind_phys), dimension(im), intent(in ) :: tsurf, tsurf_wat +- real (kind=kind_phys), dimension(im), intent(inout) :: smcref2 +- real (kind=kind_phys), dimension(im), intent(inout) :: smcwlt2 +- real (kind=kind_phys), dimension(im), intent(in ) :: tg3 +- real (kind=kind_phys), dimension(im,lsoil), intent(in ) :: smc ! Noah +- real (kind=kind_phys), dimension(im,lsoil), intent(in ) :: stc ! Noah +- real (kind=kind_phys), dimension(im,lsoil), intent(in ) :: slc ! Noah +- +- integer, dimension(im), intent(inout) :: soiltyp +- integer, dimension(im), intent(inout) :: vegtype +- real (kind=kind_phys), dimension(im), intent(inout) :: wetness +- real (kind=kind_phys), dimension(im), intent(inout) :: fice +- real (kind=kind_phys), dimension(im,lsoil_ruc), intent(inout) :: smois! ruc +- real (kind=kind_phys), dimension(im,lsoil_ruc), intent(inout) :: tslb ! ruc +- real (kind=kind_phys), dimension(im,lsoil_ruc), intent(inout) :: sh2o ! ruc +- real (kind=kind_phys), dimension(im,lsoil_ruc), intent(inout) :: smfrkeep ! ruc +- +- real (kind=kind_phys), dimension(1:lsoil_ruc), intent (out) :: zs ++ logical, dimension(:), intent(in ) :: land ++ real (kind=kind_phys), dimension(:), intent(in ) :: tsurf, tsurf_wat ++ real (kind=kind_phys), dimension(:), intent(inout) :: smcref2 ++ real (kind=kind_phys), dimension(:), intent(inout) :: smcwlt2 ++ real (kind=kind_phys), dimension(:), intent(in ) :: tg3 ++ real (kind=kind_phys), dimension(:,:), intent(in ) :: smc ! Noah ++ real (kind=kind_phys), dimension(:,:), intent(in ) :: stc ! Noah ++ real (kind=kind_phys), dimension(:,:), intent(in ) :: slc ! Noah ++ ++ integer, dimension(:), intent(inout) :: soiltyp ++ integer, dimension(:), intent(inout) :: vegtype ++ real (kind=kind_phys), dimension(:), intent(inout) :: wetness ++ real (kind=kind_phys), dimension(:), intent(inout) :: fice ++ real (kind=kind_phys), dimension(:,:), intent(inout) :: smois! ruc ++ real (kind=kind_phys), dimension(:,:), intent(inout) :: tslb ! ruc ++ real (kind=kind_phys), dimension(:,:), intent(inout) :: sh2o ! ruc ++ real (kind=kind_phys), dimension(:,:), intent(inout) :: smfrkeep ! ruc ++ ++ real (kind=kind_phys), dimension(:), intent (out) :: zs + + integer, intent(in ) :: me + integer, intent(in ) :: master +diff --git a/physics/sfc_noahmp_drv.f b/physics/sfc_noahmp_drv.f +index bdba632..f2c5809 100644 +--- a/physics/sfc_noahmp_drv.f ++++ b/physics/sfc_noahmp_drv.f +@@ -142,17 +142,17 @@ + + integer, intent(in) :: im, km, itime + +- integer, dimension(im), intent(in) :: soiltyp, vegtype, slopetyp ++ integer, dimension(:), intent(in) :: soiltyp, vegtype, slopetyp + +- real (kind=kind_phys), dimension(im), intent(in) :: ps, u1, v1, & ++ real (kind=kind_phys), dimension(:), intent(in) :: ps, u1, v1, & + & t1, q1, sigmaf, sfcemis, dlwflx, dswsfc, snet, tg3, cm, & + & ch, prsl1, prslki, wind, shdmin, shdmax, & + & snoalb, sfalb, zf, & + & rainn_mp,rainc_mp,snow_mp,graupel_mp,ice_mp + +- logical, dimension(im), intent(in) :: dry ++ logical, dimension(:), intent(in) :: dry + +- real (kind=kind_phys),dimension(im),intent(in) :: xlatin,xcoszin ++ real (kind=kind_phys),dimension(:),intent(in) :: xlatin,xcoszin + + integer, intent(in) :: idveg, iopt_crs,iopt_btr,iopt_run, & + & iopt_sfc,iopt_frz,iopt_inf,iopt_rad, & +@@ -170,24 +170,24 @@ + & con_rd, con_hfus + + ! --- in/out: +- real (kind=kind_phys), dimension(im), intent(inout) :: weasd, & ++ real (kind=kind_phys), dimension(:), intent(inout) :: weasd, & + & snwdph, tskin, tprcp, srflag, canopy, trans, tsurf, zorl + +- real (kind=kind_phys), dimension(im,km), intent(inout) :: & ++ real (kind=kind_phys), dimension(:,:), intent(inout) :: & + & smc, stc, slc + +- real (kind=kind_phys), dimension(im), intent(inout) :: snowxy, & ++ real (kind=kind_phys), dimension(:), intent(inout) :: snowxy, & + & tvxy,tgxy,canicexy,canliqxy,eahxy,tahxy, & + & cmxy,chxy,fwetxy,sneqvoxy,alboldxy,qsnowxy, & + & wslakexy,zwtxy,waxy,wtxy,lfmassxy,rtmassxy, & + & stmassxy,woodxy,stblcpxy,fastcpxy,xlaixy, & + & xsaixy,taussxy,smcwtdxy,deeprechxy,rechxy + +- real (kind=kind_phys),dimension(im,-2:0),intent(inout) :: tsnoxy +- real (kind=kind_phys),dimension(im,-2:0),intent(inout) :: snicexy +- real (kind=kind_phys),dimension(im,-2:0),intent(inout) :: snliqxy +- real (kind=kind_phys),dimension(im,1:4), intent(inout) :: smoiseq +- real (kind=kind_phys),dimension(im,-2:4),intent(inout) :: zsnsoxy ++ real (kind=kind_phys),dimension(:,:),intent(inout) :: tsnoxy ++ real (kind=kind_phys),dimension(:,:),intent(inout) :: snicexy ++ real (kind=kind_phys),dimension(:,:),intent(inout) :: snliqxy ++ real (kind=kind_phys),dimension(:,:), intent(inout) :: smoiseq ++ real (kind=kind_phys),dimension(:,:),intent(inout) :: zsnsoxy + + integer, dimension(im) :: jsnowxy + real (kind=kind_phys),dimension(im) :: snodep +@@ -195,7 +195,7 @@ + + ! --- output: + +- real (kind=kind_phys), dimension(im), intent(out) :: sncovr1, & ++ real (kind=kind_phys), dimension(:), intent(out) :: sncovr1, & + & qsurf, gflux, drain, evap, hflx, ep, runoff, cmm, chh, & + & evbs, evcw, sbsno, snowc, stm, snohf, smcwlt2, smcref2, wet1 + real (kind=kind_phys), dimension(:), intent(out) :: t2mmp, q2mp +diff --git a/physics/sfc_nst.f b/physics/sfc_nst.f +index 5920f37..0e6872c 100644 +--- a/physics/sfc_nst.f ++++ b/physics/sfc_nst.f +@@ -190,25 +190,25 @@ + & nstf_name5 + real (kind=kind_phys), intent(in) :: hvap, cp, hfus, jcal, eps, & + & epsm1, rvrdm1, rd, rhw0, sbc, pi +- real (kind=kind_phys), dimension(im), intent(in) :: ps, u1, v1, & ++ real (kind=kind_phys), dimension(:), intent(in) :: ps, u1, v1, & + & t1, q1, tref, cm, ch, prsl1, prslki, prsik1, prslk1, & + & xlon,xcosz, & + & sinlat, stress, sfcemis, dlwflx, sfcnsw, rain, wind + real (kind=kind_phys), intent(in) :: timestep + real (kind=kind_phys), intent(in) :: solhr + +- logical, dimension(im), intent(in) :: flag_iter, flag_guess, wet ++ logical, dimension(:), intent(in) :: flag_iter, flag_guess, wet + ! &, icy + logical, intent(in) :: lprnt + + ! --- input/outputs: + ! control variables of dtl system (5+2) and sl (2) and coefficients for d(tz)/d(ts) calculation +- real (kind=kind_phys), dimension(im), intent(inout) :: tskin, & ++ real (kind=kind_phys), dimension(:), intent(inout) :: tskin, & + & tsurf, xt, xs, xu, xv, xz, zm, xtts, xzts, dt_cool, & + & z_c, c_0, c_d, w_0, w_d, d_conv, ifd, qrain + + ! --- outputs: +- real (kind=kind_phys), dimension(im), intent(inout) :: & ++ real (kind=kind_phys), dimension(:), intent(inout) :: & + & qsurf, gflux, cmm, chh, evap, hflx, ep + + character(len=*), intent(out) :: errmsg +@@ -687,13 +687,13 @@ cc + + ! --- inputs: + integer, intent(in) :: im, nthreads +- logical, dimension(im), intent(in) :: wet +- real (kind=kind_phys), dimension(im), intent(in) :: ++ logical, dimension(:), intent(in) :: wet ++ real (kind=kind_phys), dimension(:), intent(in) :: + & tsfc_wat, xt, xz, dt_cool, z_c, oceanfrac + logical, intent(in) :: cplflx + + ! --- input/outputs: +- real (kind=kind_phys), dimension(im), intent(inout) :: ++ real (kind=kind_phys), dimension(:), intent(inout) :: + & tsurf_wat, tseal, tref + + ! --- outputs: +diff --git a/physics/sfc_ocean.F b/physics/sfc_ocean.F +index 20c8cdf..f6e511a 100644 +--- a/physics/sfc_ocean.F ++++ b/physics/sfc_ocean.F +@@ -103,13 +103,13 @@ + integer, intent(in) :: im + real (kind=kind_phys), intent(in) :: rd, eps, epsm1, rvrdm1 + +- real (kind=kind_phys), dimension(im), intent(in) :: ps, & ++ real (kind=kind_phys), dimension(:), intent(in) :: ps, & + & t1, q1, tskin, cm, ch, prsl1, prslki, wind + +- logical, dimension(im), intent(in) :: flag_iter, wet, lake ++ logical, dimension(:), intent(in) :: flag_iter, wet, lake + + ! --- outputs: +- real (kind=kind_phys), dimension(im), intent(inout) :: qsurf, & ++ real (kind=kind_phys), dimension(:), intent(inout) :: qsurf, & + & cmm, chh, gflux, evap, hflx, ep + + character(len=*), intent(out) :: errmsg +diff --git a/physics/sfc_sice.f b/physics/sfc_sice.f +index ab67f84..c18fd9d 100644 +--- a/physics/sfc_sice.f ++++ b/physics/sfc_sice.f +@@ -157,25 +157,25 @@ + real (kind=kind_phys), intent(in) :: sbc, hvap, tgice, cp, eps, & + & epsm1, grav, rvrdm1, t0c, rd + +- real (kind=kind_phys), dimension(im), intent(in) :: ps, & ++ real (kind=kind_phys), dimension(:), intent(in) :: ps, & + & t1, q1, sfcemis, dlwflx, sfcnsw, sfcdsw, srflag, cm, ch, & + & prsl1, prslki, prsik1, prslk1, wind, oceanfrac + + ! integer, dimension(im), intent(in) :: islimsk +- integer, dimension(im), intent(in) :: islmsk_cice ++ integer, dimension(:), intent(in) :: islmsk_cice + real (kind=kind_phys), intent(in) :: delt, min_seaice, & + & min_lakeice + +- logical, dimension(im), intent(in) :: flag_iter, icy ++ logical, dimension(:), intent(in) :: flag_iter, icy + + ! --- input/outputs: +- real (kind=kind_phys), dimension(im), intent(inout) :: hice, & ++ real (kind=kind_phys), dimension(:), intent(inout) :: hice, & + & fice, tice, weasd, tskin, tprcp, ep + +- real (kind=kind_phys), dimension(im,kice), intent(inout) :: tiice ++ real (kind=kind_phys), dimension(:,:), intent(inout) :: tiice + + ! --- outputs: +- real (kind=kind_phys), dimension(im), intent(inout) :: snwdph, & ++ real (kind=kind_phys), dimension(:), intent(inout) :: snwdph, & + & qsurf, snowmt, gflux, cmm, chh, evap, hflx + + character(len=*), intent(out) :: errmsg +diff --git a/physics/shinhongvdif.F90 b/physics/shinhongvdif.F90 +index 83270a0..da9c089 100644 +--- a/physics/shinhongvdif.F90 ++++ b/physics/shinhongvdif.F90 +@@ -107,7 +107,7 @@ + integer, intent(in ) :: im,km,ntrac,ndiff,ntcw,ntiw + real(kind=kind_phys), intent(in ) :: g,cp,rd,rv,ep1,ep2,xlv,dt + ! 3D in +- real(kind=kind_phys), dimension(im, km) , & ++ real(kind=kind_phys), dimension(:,:) , & + intent(in ) :: phil, & + pi2d, & + p2d, & +@@ -117,21 +117,21 @@ + real(kind=kind_phys), dimension( im, km, ntrac ) , & + intent(in ) :: qx + +- real(kind=kind_phys), dimension( im, km+1 ) , & ++ real(kind=kind_phys), dimension( :,: ) , & + intent(in ) :: p2di, & + phii + ! 3D in&out +- real(kind=kind_phys), dimension(im, km) , & ++ real(kind=kind_phys), dimension(:,:) , & + intent(inout) :: utnp, & + vtnp, & + ttnp +- real(kind=kind_phys), dimension(im, km, ntrac ) , & ++ real(kind=kind_phys), dimension(:,:, : ) , & + intent(inout) :: qtnp + ! 2D in +- integer, dimension(im) , & ++ integer, dimension(:) , & + intent(in ) :: landmask + +- real(kind=kind_phys), dimension(im) , & ++ real(kind=kind_phys), dimension(:) , & + intent(in ) :: heat, & + evap, & + br, & +@@ -145,10 +145,10 @@ + v10, & + dx + ! 2D: out +- integer, dimension(im) , & ++ integer, dimension(:) , & + intent(out ) :: kpbl1d + +- real(kind=kind_phys), dimension(im) , & ++ real(kind=kind_phys), dimension(:) , & + intent(out ) :: hpbl, & + dusfc, & + dvsfc, & +@@ -1435,13 +1435,13 @@ + ! + real(kind=kind_phys), dimension( its:ite, kts:kte ) , & + intent(in ) :: cm +- real(kind=kind_phys), dimension( its:ite, kts:kte,nt ) , & ++ real(kind=kind_phys), dimension( its:ite, kts:kte,nt) , & + intent(in ) :: r2 + ! + real(kind=kind_phys), dimension( its:ite, kts:kte ) , & + intent(inout) :: au, & + cu +- real(kind=kind_phys), dimension( its:ite, kts:kte,nt ) , & ++ real(kind=kind_phys), dimension( its:ite, kts:kte,nt) , & + intent(inout) :: f2 + ! + real(kind=kind_phys) :: fk +@@ -1582,7 +1582,7 @@ + qol2st,qol2un,qdzl,rdz,sq,srel,szq,tem,thm,vkrmz,rlambda, & + rlb,rln,f + real(kind=kind_phys) :: ckp +- real(kind=kind_phys), dimension( kts:kte ) :: q1, & ++ real(kind=kind_phys), dimension( kts:kte ) :: q1, & + en2 + real(kind=kind_phys), dimension( kts+1:kte ) :: dth, & + elm, & +@@ -1748,12 +1748,12 @@ + ! + logical, intent(in ) :: pblflg + ! +- real(kind=kind_phys), dimension( kts:kte ) , & ++ real(kind=kind_phys), dimension( : ) , & + intent(in ) :: uxk, & + vxk, & + thxk, & + thvxk +- real(kind=kind_phys), dimension( kts+1:kte ) , & ++ real(kind=kind_phys), dimension( : ) , & + intent(in ) :: s2, & + ri, & + akm, & +@@ -1764,10 +1764,10 @@ + vfxpbl, & + qfxpbl + ! +- real(kind=kind_phys), dimension( kts:kte+1 ) , & ++ real(kind=kind_phys), dimension( : ) , & + intent(in ) :: z + ! +- real(kind=kind_phys), dimension( kts:kte ) , & ++ real(kind=kind_phys), dimension( : ) , & + intent(inout) :: q2 + ! + ! local vars +@@ -1855,16 +1855,16 @@ + ! + logical, intent(in ) :: pblflg + ! +- real(kind=kind_phys), dimension( kts:kte ) , & ++ real(kind=kind_phys), dimension( : ) , & + intent(in ) :: hgame, & + ptke1 +- real(kind=kind_phys), dimension( kts+1:kte ) , & ++ real(kind=kind_phys), dimension( : ) , & + intent(in ) :: el, & + akhk +- real(kind=kind_phys), dimension( kts:kte+1 ) , & ++ real(kind=kind_phys), dimension( : ) , & + intent(in ) :: z + ! +- real(kind=kind_phys), dimension( kts:kte ) , & ++ real(kind=kind_phys), dimension( : ) , & + intent(inout) :: q2 + ! + ! local vars +diff --git a/physics/ysuvdif.F90 b/physics/ysuvdif.F90 +index 51ed599..420dfb7 100644 +--- a/physics/ysuvdif.F90 ++++ b/physics/ysuvdif.F90 +@@ -62,33 +62,33 @@ + integer, intent(in ) :: im,km,ntrac,ndiff,ntcw,ntiw + real(kind=kind_phys), intent(in ) :: g,cp,rd,rv,ep1,ep2,xlv,dt + +- real(kind=kind_phys), dimension( im,km ), & ++ real(kind=kind_phys), dimension( :,: ), & + intent(in) :: pi2d,p2d,phil,ux,vx,swh,hlw,tx + +- real(kind=kind_phys), dimension( im,km,ntrac ) , & ++ real(kind=kind_phys), dimension( :,:,: ) , & + intent(in ) :: qx + +- real(kind=kind_phys), dimension( im, km+1 ) , & ++ real(kind=kind_phys), dimension( :,: ) , & + intent(in ) :: p2di,phii + +- real(kind=kind_phys), dimension( im ) , & ++ real(kind=kind_phys), dimension( : ) , & + intent(in) :: stress,zorl,heat,evap,wspd,br,psim,psih,psfcpa, & + u10,v10,xmu +- integer, dimension(im) ,& ++ integer, dimension(:) ,& + intent(in ) :: landmask + ! + !---------------------------------------------------------------------------------- + ! input/output variables + ! +- real(kind=kind_phys), dimension( im,km ) , & ++ real(kind=kind_phys), dimension( :,: ) , & + intent(inout) :: utnp,vtnp,ttnp +- real(kind=kind_phys), dimension( im,km,ntrac ) , & ++ real(kind=kind_phys), dimension( :,:,: ) , & + intent(inout) :: qtnp + ! + !--------------------------------------------------------------------------------- + ! output variables +- integer, dimension( im ), intent(out ) :: kpbl1d +- real(kind=kind_phys), dimension( im ), & ++ integer, dimension( : ), intent(out ) :: kpbl1d ++ real(kind=kind_phys), dimension( : ), & + intent(out) :: hpbl + + ! error messages diff --git a/physics/gscond.f b/physics/gscond.f index 28f24763c9..7144ba2cf5 100644 --- a/physics/gscond.f +++ b/physics/gscond.f @@ -73,14 +73,14 @@ subroutine zhaocarr_gscond_run (im,km,dt,dtf,prsl,ps,q,clw1 & ! Interface variables integer, intent(in) :: im, km, ipr real(kind=kind_phys), intent(in) :: dt, dtf - real(kind=kind_phys), intent(in) :: prsl(im,km), ps(im) - real(kind=kind_phys), intent(inout) :: q(im,km) - real(kind=kind_phys), intent(in) :: clw1(im,km), clw2(im,km) - real(kind=kind_phys), intent(out) :: cwm(im,km) - real(kind=kind_phys), intent(inout) :: t(im,km) & - &, tp(im,km), qp(im,km), psp(im) & - &, tp1(im,km), qp1(im,km), psp1(im) - real(kind=kind_phys), intent(in) :: u(im,km) + real(kind=kind_phys), intent(in) :: prsl(:,:), ps(:) + real(kind=kind_phys), intent(inout) :: q(:,:) + real(kind=kind_phys), intent(in) :: clw1(:,:), clw2(:,:) + real(kind=kind_phys), intent(out) :: cwm(:,:) + real(kind=kind_phys), intent(inout) :: t(:,:) & + &, tp(:,:), qp(:,:), psp(:) & + &, tp1(:,:), qp1(:,:), psp1(:) + real(kind=kind_phys), intent(in) :: u(:,:) logical, intent(in) :: lprnt ! character(len=*), intent(out) :: errmsg diff --git a/physics/gwdc.f b/physics/gwdc.f index 5c6f8ecd7a..0978a956a1 100644 --- a/physics/gwdc.f +++ b/physics/gwdc.f @@ -187,15 +187,15 @@ subroutine gwdc_run (im,km,lat,u1,v1,t1,q1,deltim, & !----------------------------------------------------------------------- integer, intent(in) :: im, km, lat, ipr - integer, intent(in) :: ktop(im),kbot(im),kcnv(im) + integer, intent(in) :: ktop(:),kbot(:),kcnv(:) real(kind=kind_phys), intent(in) :: grav,cp,rd,fv,fhour,deltim,pi - real(kind=kind_phys), dimension(im), intent(in) :: qmax - real(kind=kind_phys), dimension(im), intent(out) :: tauctx,taucty - real(kind=kind_phys), dimension(im), intent(in) :: cldf,dlength - real(kind=kind_phys), dimension(im,km), intent(in) :: u1,v1,t1, & + real(kind=kind_phys), dimension(:), intent(in) :: qmax + real(kind=kind_phys), dimension(:), intent(out) :: tauctx,taucty + real(kind=kind_phys), dimension(:), intent(in) :: cldf,dlength + real(kind=kind_phys), dimension(:,:), intent(in) :: u1,v1,t1, & & q1,pmid1,dpmid1 - real(kind=kind_phys), dimension(im,km), intent(out) :: utgwc,vtgwc - real(kind=kind_phys), dimension(im,km+1), intent(in) :: pint1 + real(kind=kind_phys), dimension(:,:), intent(out) :: utgwc,vtgwc + real(kind=kind_phys), dimension(:,:), intent(in) :: pint1 ! logical, intent(in) :: lprnt ! diff --git a/physics/gwdps.f b/physics/gwdps.f index b09413f024..486aa66702 100644 --- a/physics/gwdps.f +++ b/physics/gwdps.f @@ -1315,4 +1315,4 @@ end subroutine gwdps_run subroutine gwdps_finalize() end subroutine gwdps_finalize - end module gwdps + end module gwdps \ No newline at end of file diff --git a/physics/h2ophys.f b/physics/h2ophys.f index b3bdd279f3..ccbce7cdad 100644 --- a/physics/h2ophys.f +++ b/physics/h2ophys.f @@ -41,10 +41,10 @@ subroutine h2ophys_run(im, levs, kh2o, dt, h2o, ph2o, prsl, & ! interface variables integer, intent(in) :: im, levs, kh2o, h2o_coeff, me real(kind=kind_phys), intent(in) :: dt - real(kind=kind_phys), intent(inout) :: h2o(im,levs) - real(kind=kind_phys), intent(in) :: ph2o(kh2o) - real(kind=kind_phys), intent(in) :: prsl(im,levs) - real(kind=kind_phys), intent(in) :: h2opltc(im,kh2o,h2o_coeff) + real(kind=kind_phys), intent(inout) :: h2o(:,:) + real(kind=kind_phys), intent(in) :: ph2o(:) + real(kind=kind_phys), intent(in) :: prsl(:,:) + real(kind=kind_phys), intent(in) :: h2opltc(:,:,:) logical , intent(in) :: ldiag3d !real(kind=kind_phys), intent(inout) :: h2op(im,levs,h2o_coeff) character(len=*), intent(out) :: errmsg diff --git a/physics/lsm_ruc_sfc_sice_interstitial.F90 b/physics/lsm_ruc_sfc_sice_interstitial.F90 index 27033fcc86..54c514affb 100644 --- a/physics/lsm_ruc_sfc_sice_interstitial.F90 +++ b/physics/lsm_ruc_sfc_sice_interstitial.F90 @@ -27,12 +27,12 @@ subroutine lsm_ruc_sfc_sice_pre_run(im, lsoil_ruc, lsoil, kice, land, icy, stc, ! Interface variables integer, intent(in) :: im, lsoil_ruc, lsoil, kice - logical, dimension(im), intent(in) :: land, icy + logical, dimension(:), intent(in) :: land, icy ! --- on Noah levels - real (kind=kind_phys), dimension(im,lsoil), intent(inout) :: stc + real (kind=kind_phys), dimension(:,:), intent(inout) :: stc ! --- on RUC levels - real (kind=kind_phys), dimension(im,lsoil_ruc), intent(in) :: tslb - real (kind=kind_phys), dimension(im,kice), intent(inout) :: tiice + real (kind=kind_phys), dimension(:,:), intent(in) :: tslb + real (kind=kind_phys), dimension(:,:), intent(inout) :: tiice character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -89,12 +89,12 @@ subroutine lsm_ruc_sfc_sice_post_run(im, lsoil_ruc, lsoil, kice, land, icy, stc, ! Interface variables integer, intent(in) :: im, lsoil_ruc, lsoil, kice - logical, dimension(im), intent(in) :: land, icy + logical, dimension(:), intent(in) :: land, icy ! --- on Noah levels - real (kind=kind_phys), dimension(im,lsoil), intent(in) :: stc - real (kind=kind_phys), dimension(im,kice), intent(in) :: tiice + real (kind=kind_phys), dimension(:,:), intent(in) :: stc + real (kind=kind_phys), dimension(:,:), intent(in) :: tiice ! --- on RUC levels - real (kind=kind_phys), dimension(im,lsoil_ruc), intent(inout) :: tslb + real (kind=kind_phys), dimension(:,:), intent(inout) :: tslb character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/m_micro.F90 b/physics/m_micro.F90 index 69690d52e1..67706ca424 100644 --- a/physics/m_micro.F90 +++ b/physics/m_micro.F90 @@ -181,10 +181,10 @@ subroutine m_micro_run( im, lm, flipv, dt_i & logical,intent(in) :: flipv, skip_macro real (kind=kind_phys), intent(in):: dt_i, alf_fac, qc_min(2) - real (kind=kind_phys), dimension(im,lm),intent(in) :: & + real (kind=kind_phys), dimension(:,:),intent(in) :: & & prsl_i,u_i,v_i,phil, omega_i, QLLS_i,QILS_i, & & lwheat_i,swheat_i - real (kind=kind_phys), dimension(im,0:lm),intent(in):: prsi_i, & + real (kind=kind_phys), dimension(:,:),intent(in):: prsi_i, & & phii ! GJF* These variables are conditionally allocated depending on whether the ! Morrison-Gettelman microphysics is used, so they must be declared @@ -194,26 +194,26 @@ subroutine m_micro_run( im, lm, flipv, dt_i & & CNV_MFD_i, cf_upi, CNV_FICE_i, CNV_NDROP_i, & & CNV_NICE_i, w_upi ! *GJF - real (kind=kind_phys), dimension(im,lm),intent(in) :: & + real (kind=kind_phys), dimension(:,:),intent(in) :: & & rhc_i, naai_i, npccn_i - real (kind=kind_phys), dimension(im,lm,ntrcaer),intent(in) :: & + real (kind=kind_phys), dimension(:,:,:),intent(in) :: & & aerfld_i - real (kind=kind_phys),dimension(im),intent(in):: TAUGWX, & + real (kind=kind_phys),dimension(:),intent(in):: TAUGWX, & & TAUGWY, TAUOROX, TAUOROY, FRLAND,ZPBL,xlat,xlon ! & TAUGWY, TAUX, TAUY, TAUOROX, TAUOROY,ps_i,FRLAND,ZPBL ! & CNVPRCP ! output - real (kind=kind_phys),dimension(im,lm), intent(out) :: lwm_o, qi_o, & + real (kind=kind_phys),dimension(:,:), intent(out) :: lwm_o, qi_o, & cldreffl, cldreffi, cldreffr, cldreffs, cldreffg - real (kind=kind_phys),dimension(im), intent(out) :: rn_o, sr_o + real (kind=kind_phys),dimension(:), intent(out) :: rn_o, sr_o character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg ! input and output ! Anning Cheng 10/24/2016 twat for total water, diagnostic purpose - integer, dimension(IM), intent(inout):: KCBL - real (kind=kind_phys),dimension(im,lm),intent(inout):: q_io, t_io, & + integer, dimension(:), intent(inout):: KCBL + real (kind=kind_phys),dimension(:,:),intent(inout):: q_io, t_io, & & ncpl_io,ncpi_io,CLLS_io ! GJF* These variables are conditionally allocated depending on whether the ! Morrison-Gettelman microphysics is used, so they must be declared diff --git a/physics/m_micro_interstitial.F90 b/physics/m_micro_interstitial.F90 index 930b32b3d6..00e6f8e463 100644 --- a/physics/m_micro_interstitial.F90 +++ b/physics/m_micro_interstitial.F90 @@ -183,22 +183,22 @@ subroutine m_micro_post_run( & integer, intent(in) :: im, levs, fprcp logical, intent(in) :: mg3_as_mg2 - real(kind=kind_phys), intent(in ) :: ncpr(1:im,1:levs) - real(kind=kind_phys), intent(in ) :: ncps(1:im,1:levs) - real(kind=kind_phys), intent(in ) :: ncgl(1:im,1:levs) - real(kind=kind_phys), intent(inout) :: qrn(1:im,1:levs) - real(kind=kind_phys), intent(inout) :: qsnw(1:im,1:levs) - real(kind=kind_phys), intent(inout) :: qgl(1:im,1:levs) - real(kind=kind_phys), intent(inout) :: gq0_ice(1:im,1:levs) - real(kind=kind_phys), intent(inout) :: gq0_rain(1:im,1:levs) - real(kind=kind_phys), intent(inout) :: gq0_snow(1:im,1:levs) - real(kind=kind_phys), intent(inout) :: gq0_graupel(1:im,1:levs) - real(kind=kind_phys), intent(inout) :: gq0_rain_nc(1:im,1:levs) - real(kind=kind_phys), intent(inout) :: gq0_snow_nc(1:im,1:levs) - real(kind=kind_phys), intent(inout) :: gq0_graupel_nc(1:im,1:levs) - real(kind=kind_phys), intent( out) :: ice(1:im) - real(kind=kind_phys), intent( out) :: snow(1:im) - real(kind=kind_phys), intent( out) :: graupel(1:im) + real(kind=kind_phys), intent(in ) :: ncpr(:,:) + real(kind=kind_phys), intent(in ) :: ncps(:,:) + real(kind=kind_phys), intent(in ) :: ncgl(:,:) + real(kind=kind_phys), intent(inout) :: qrn(:,:) + real(kind=kind_phys), intent(inout) :: qsnw(:,:) + real(kind=kind_phys), intent(inout) :: qgl(:,:) + real(kind=kind_phys), intent(inout) :: gq0_ice(:,:) + real(kind=kind_phys), intent(inout) :: gq0_rain(:,:) + real(kind=kind_phys), intent(inout) :: gq0_snow(:,:) + real(kind=kind_phys), intent(inout) :: gq0_graupel(:,:) + real(kind=kind_phys), intent(inout) :: gq0_rain_nc(:,:) + real(kind=kind_phys), intent(inout) :: gq0_snow_nc(:,:) + real(kind=kind_phys), intent(inout) :: gq0_graupel_nc(:,:) + real(kind=kind_phys), intent( out) :: ice(:) + real(kind=kind_phys), intent( out) :: snow(:) + real(kind=kind_phys), intent( out) :: graupel(:) real(kind=kind_phys), intent(in ) :: dtp character(len=*), intent(out) :: errmsg diff --git a/physics/maximum_hourly_diagnostics.F90 b/physics/maximum_hourly_diagnostics.F90 index 174e0c95c2..615c49bedd 100644 --- a/physics/maximum_hourly_diagnostics.F90 +++ b/physics/maximum_hourly_diagnostics.F90 @@ -37,23 +37,23 @@ subroutine maximum_hourly_diagnostics_run(im, levs, reset, lradar, imp_physics, logical, intent(in) :: reset, lradar integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_fer_hires real(kind_phys), intent(in ) :: con_g - real(kind_phys), intent(in ) :: phil(im,levs) - real(kind_phys), intent(in ) :: gt0(im,levs) - real(kind_phys), intent(in ) :: refl_10cm(im,levs) - real(kind_phys), intent(inout) :: refdmax(im) - real(kind_phys), intent(inout) :: refdmax263k(im) - real(kind_phys), intent(in ) :: u10m(im) - real(kind_phys), intent(in ) :: v10m(im) - real(kind_phys), intent(inout) :: u10max(im) - real(kind_phys), intent(inout) :: v10max(im) - real(kind_phys), intent(inout) :: spd10max(im) - real(kind_phys), intent(in ) :: pgr(im) - real(kind_phys), intent(in ) :: t2m(im) - real(kind_phys), intent(in ) :: q2m(im) - real(kind_phys), intent(inout) :: t02max(im) - real(kind_phys), intent(inout) :: t02min(im) - real(kind_phys), intent(inout) :: rh02max(im) - real(kind_phys), intent(inout) :: rh02min(im) + real(kind_phys), intent(in ) :: phil(:,:) + real(kind_phys), intent(in ) :: gt0(:,:) + real(kind_phys), intent(in ) :: refl_10cm(:,:) + real(kind_phys), intent(inout) :: refdmax(:) + real(kind_phys), intent(inout) :: refdmax263k(:) + real(kind_phys), intent(in ) :: u10m(:) + real(kind_phys), intent(in ) :: v10m(:) + real(kind_phys), intent(inout) :: u10max(:) + real(kind_phys), intent(inout) :: v10max(:) + real(kind_phys), intent(inout) :: spd10max(:) + real(kind_phys), intent(in ) :: pgr(:) + real(kind_phys), intent(in ) :: t2m(:) + real(kind_phys), intent(in ) :: q2m(:) + real(kind_phys), intent(inout) :: t02max(:) + real(kind_phys), intent(inout) :: t02min(:) + real(kind_phys), intent(inout) :: rh02max(:) + real(kind_phys), intent(inout) :: rh02min(:) character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -126,12 +126,12 @@ end subroutine maximum_hourly_diagnostics_run subroutine max_fields(phil,ref3D,grav,im,levs,refd,tk,refd263k) integer, intent(in) :: im,levs real (kind=kind_phys), intent(in) :: grav - real (kind=kind_phys), intent(in),dimension(im,levs) :: phil,ref3D,tk + real (kind=kind_phys), intent(in),dimension(:,:) :: phil,ref3D,tk integer :: i,k,ll,ipt,kpt real :: dbz1avg,zmidp1,zmidloc,refl,fact real, dimension(im,levs) :: z real, dimension(im) :: zintsfc - real, dimension(im), intent(inout) :: refd,refd263k + real, dimension(:), intent(inout) :: refd,refd263k REAL :: dbz1(2),dbzk,dbzk1 logical :: counter do i=1,im diff --git a/physics/module_MYJSFC_wrapper.F90 b/physics/module_MYJSFC_wrapper.F90 index e3dcf41112..90c50cee93 100644 --- a/physics/module_MYJSFC_wrapper.F90 +++ b/physics/module_MYJSFC_wrapper.F90 @@ -91,22 +91,22 @@ SUBROUTINE myjsfc_wrapper_run( & real(kind=kind_phys),intent(in) :: con_cp, con_g, con_rd !MYJ-2D - logical,dimension(im),intent(in) :: flag_iter - real(kind=kind_phys),dimension(im),intent(in) :: & + logical,dimension(:),intent(in) :: flag_iter + real(kind=kind_phys),dimension(:),intent(in) :: & & prsik_1, prslk_1, tsfc, qsfc, slmsk - real(kind=kind_phys),dimension(im),intent(inout) :: & + real(kind=kind_phys),dimension(:),intent(inout) :: & & phy_myj_qsfc, phy_myj_thz0, phy_myj_qz0, & & phy_myj_uz0, phy_myj_vz0, phy_myj_z0base, & & phy_myj_akhs, phy_myj_akms, & & phy_myj_chkqlm, phy_myj_elflx, & & phy_myj_a1u, phy_myj_a1t, phy_myj_a1q - real(kind=kind_phys),dimension(im),intent(inout) :: & + real(kind=kind_phys),dimension(:),intent(inout) :: & & pblh, zorl, ustar, rib - real(kind=kind_phys),dimension(im),intent(out) :: & + real(kind=kind_phys),dimension(:),intent(out) :: & & cm, ch, stress, ffm, ffh, fm10, fh2 - real(kind=kind_phys), dimension(im), intent(inout) :: & + real(kind=kind_phys), dimension(:), intent(inout) :: & & landfrac, lakefrac, oceanfrac, fice - real(kind=kind_phys), dimension(im), intent(inout) :: & + real(kind=kind_phys), dimension(:), intent(inout) :: & & z0rl_wat, z0rl_lnd, z0rl_ice, & & ustar_wat, ustar_lnd, ustar_ice, & & cm_wat, cm_lnd, cm_ice, & @@ -121,12 +121,12 @@ SUBROUTINE myjsfc_wrapper_run( & !MYJ-3D - real(kind=kind_phys),dimension(im,levs+1),intent(in) :: & + real(kind=kind_phys),dimension(:,:),intent(in) :: & phii, prsi - real(kind=kind_phys),dimension(im,levs),intent(in) :: & + real(kind=kind_phys),dimension(:,:),intent(in) :: & & ugrs, vgrs, tgrs, prsl !MYJ-4D - real(kind=kind_phys),dimension(im,levs,ntrac),intent(in) :: & + real(kind=kind_phys),dimension(:,:,:),intent(in) :: & & qgrs !LOCAL diff --git a/physics/module_MYNNPBL_wrapper.F90 b/physics/module_MYNNPBL_wrapper.F90 index 8fd727148a..2d673e4314 100644 --- a/physics/module_MYNNPBL_wrapper.F90 +++ b/physics/module_MYNNPBL_wrapper.F90 @@ -234,13 +234,13 @@ SUBROUTINE mynnedmf_wrapper_run( & REAL(kind=kind_phys) :: tem !MYNN-3D - real(kind=kind_phys), dimension(im,levs+1), intent(in) :: phii - real(kind=kind_phys), dimension(im,levs ), intent(inout) :: & + real(kind=kind_phys), dimension(:,:), intent(in) :: phii + real(kind=kind_phys), dimension(:,:), intent(inout) :: & & dtdt, dudt, dvdt, & & dqdt_water_vapor, dqdt_liquid_cloud, dqdt_ice_cloud, & & dqdt_cloud_droplet_num_conc, dqdt_ice_num_conc, & & dqdt_ozone, dqdt_water_aer_num_conc, dqdt_ice_aer_num_conc - real(kind=kind_phys), dimension(im,levs), intent(inout) :: & + real(kind=kind_phys), dimension(:,:), intent(inout) :: & & qke, qke_adv, EL_PBL, Sh3D, & & qc_bl, qi_bl, cldfra_bl !These 10 arrays are only allocated when bl_mynn_output > 0 @@ -248,7 +248,7 @@ SUBROUTINE mynnedmf_wrapper_run( & & edmf_a,edmf_w,edmf_qt, & & edmf_thl,edmf_ent,edmf_qc, & & sub_thl,sub_sqv,det_thl,det_sqv - real(kind=kind_phys), dimension(im,levs), intent(in) :: & + real(kind=kind_phys), dimension(:,:), intent(in) :: & & u,v,omega,t3d, & & exner,prsl, & & qgrs_water_vapor, & @@ -259,13 +259,13 @@ SUBROUTINE mynnedmf_wrapper_run( & & qgrs_ozone, & & qgrs_water_aer_num_conc, & & qgrs_ice_aer_num_conc - real(kind=kind_phys), dimension(im,levs), intent(out) :: & + real(kind=kind_phys), dimension(:,:), intent(out) :: & & Tsq, Qsq, Cov, exch_h, exch_m real(kind=kind_phys), dimension(:,:), intent(inout) :: & & du3dt_PBL, du3dt_OGWD, dv3dt_PBL, dv3dt_OGWD, & & do3dt_PBL, dq3dt_PBL, dt3dt_PBL - real(kind=kind_phys), dimension(im), intent(in) :: xmu - real(kind=kind_phys), dimension(im, levs), intent(in) :: htrsw, htrlw + real(kind=kind_phys), dimension(:), intent(in) :: xmu + real(kind=kind_phys), dimension(:,:), intent(in) :: htrsw, htrlw !LOCAL real(kind=kind_phys), dimension(im,levs) :: & & sqv,sqc,sqi,qnc,qni,ozone,qnwfa,qnifa, & @@ -284,26 +284,26 @@ SUBROUTINE mynnedmf_wrapper_run( & REAL(kind=kind_phys), DIMENSION( ndvel ) :: vd1 !MYNN-2D - real(kind=kind_phys), dimension(im), intent(in) :: & + real(kind=kind_phys), dimension(:), intent(in) :: & & dx,zorl,slmsk,tsurf,qsfc,ps, & & hflx,qflx,ust,wspd,rb,recmol - real(kind=kind_phys), dimension(im), intent(in) :: & + real(kind=kind_phys), dimension(:), intent(in) :: & & dusfc_cice,dvsfc_cice,dtsfc_cice,dqsfc_cice, & & stress_ocn,hflx_ocn,qflx_ocn, & & oceanfrac,fice - logical, dimension(im), intent(in) :: & + logical, dimension(:), intent(in) :: & & wet, dry, icy - real(kind=kind_phys), dimension(im), intent(inout) :: & + real(kind=kind_phys), dimension(:), intent(inout) :: & & pblh - real(kind=kind_phys), dimension(im), intent(out) :: & + real(kind=kind_phys), dimension(:), intent(out) :: & & ch,dtsfc1,dqsfc1,dusfc1,dvsfc1, & & dtsfci_diag,dqsfci_diag,dtsfc_diag,dqsfc_diag, & & dusfci_diag,dvsfci_diag,dusfc_diag,dvsfc_diag, & & maxMF - integer, dimension(im), intent(inout) :: & + integer, dimension(:), intent(inout) :: & & kpbl,nupdraft,ktop_plume real(kind=kind_phys), dimension(:), intent(inout) :: & diff --git a/physics/module_MYNNSFC_wrapper.F90 b/physics/module_MYNNSFC_wrapper.F90 index 496db75808..4bfb91c26f 100644 --- a/physics/module_MYNNSFC_wrapper.F90 +++ b/physics/module_MYNNSFC_wrapper.F90 @@ -111,8 +111,8 @@ SUBROUTINE mynnsfc_wrapper_run( & logical, intent(in) :: redrag ! reduced drag coeff. flag for high wind over sea (j.han) !Input data - integer, dimension(im), intent(in) :: vegtype - real(kind=kind_phys), dimension(im), intent(in) :: & + integer, dimension(:), intent(in) :: vegtype + real(kind=kind_phys), dimension(:), intent(in) :: & & sigmaf,shdmax,z0pert,ztpert !MYNN-1D @@ -124,23 +124,23 @@ SUBROUTINE mynnsfc_wrapper_run( & & IMS,IME,JMS,JME,KMS,KME, & & ITS,ITE,JTS,JTE,KTS,KTE - real(kind=kind_phys), dimension(im,levs+1), & + real(kind=kind_phys), dimension(:,:), & & intent(in) :: phii - real(kind=kind_phys), dimension(im,levs), & + real(kind=kind_phys), dimension(:,:), & & intent(in) :: exner, PRSL, & & u, v, t3d, qvsh, qc real(kind=kind_phys), dimension(im,levs) :: & & pattern_spp_pbl, dz, th, qv - logical, dimension(im), intent(in) :: wet, dry, icy + logical, dimension(:), intent(in) :: wet, dry, icy - real(kind=kind_phys), dimension(im), intent(in) :: & + real(kind=kind_phys), dimension(:), intent(in) :: & & tskin_ocn, tskin_lnd, tskin_ice, & & tsurf_ocn, tsurf_lnd, tsurf_ice, & & snowh_ocn, snowh_lnd, snowh_ice - real(kind=kind_phys), dimension(im), intent(inout) :: & + real(kind=kind_phys), dimension(:), intent(inout) :: & & znt_ocn, znt_lnd, znt_ice, & & ust_ocn, ust_lnd, ust_ice, & & cm_ocn, cm_lnd, cm_ice, & @@ -156,10 +156,10 @@ SUBROUTINE mynnsfc_wrapper_run( & & qsfc_ocn, qsfc_lnd, qsfc_ice !MYNN-2D - real(kind=kind_phys), dimension(im), intent(in) :: & + real(kind=kind_phys), dimension(:), intent(in) :: & & dx, pblh, slmsk, ps - real(kind=kind_phys), dimension(im), intent(inout) :: & + real(kind=kind_phys), dimension(:), intent(inout) :: & & ustm, hflx, qflx, wspd, qsfc, qsfc_ruc, & & FLHC, FLQC, U10, V10, TH2, T2, Q2, & & CHS2, CQS2, rmol, zol, mol, ch, & diff --git a/physics/module_SGSCloud_RadPost.F90 b/physics/module_SGSCloud_RadPost.F90 index bedb660a60..ea262596f5 100644 --- a/physics/module_SGSCloud_RadPost.F90 +++ b/physics/module_SGSCloud_RadPost.F90 @@ -34,8 +34,8 @@ subroutine sgscloud_radpost_run( & integer, intent(in) :: im, levs logical, intent(in) :: flag_init, flag_restart - real(kind=kind_phys), dimension(im,levs), intent(inout) :: qc, qi - real(kind=kind_phys), dimension(im,levs), intent(in) :: qc_save, qi_save + real(kind=kind_phys), dimension(:,:), intent(inout) :: qc, qi + real(kind=kind_phys), dimension(:,:), intent(in) :: qc_save, qi_save character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg ! Local variable diff --git a/physics/module_SGSCloud_RadPre.F90 b/physics/module_SGSCloud_RadPre.F90 index 5a1a2744f9..3380f8f1a8 100644 --- a/physics/module_SGSCloud_RadPre.F90 +++ b/physics/module_SGSCloud_RadPre.F90 @@ -67,20 +67,20 @@ subroutine sgscloud_radpre_run( & integer, intent(in) :: im, levs, imfdeepcnv, imfdeepcnv_gf, & & nlay, imp_physics, imp_physics_gfdl logical, intent(in) :: flag_init, flag_restart, do_mynnedmf - real(kind=kind_phys), dimension(im,levs), intent(inout) :: qc, qi - real(kind=kind_phys), dimension(im,levs), intent(inout) :: qr, qs, qg + real(kind=kind_phys), dimension(:,:), intent(inout) :: qc, qi + real(kind=kind_phys), dimension(:,:), intent(inout) :: qr, qs, qg ! qci_conv only allocated if GF is used real(kind=kind_phys), dimension(:,:), intent(inout) :: qci_conv - real(kind=kind_phys), dimension(im,levs), intent(in) :: T3D,delp, & + real(kind=kind_phys), dimension(:,:), intent(in) :: T3D,delp, & & qv,P3D - real(kind=kind_phys), dimension(im,levs), intent(inout) :: & + real(kind=kind_phys), dimension(:,:), intent(inout) :: & & clouds1,clouds2,clouds3,clouds4,clouds5 - real(kind=kind_phys), dimension(im,levs), intent(inout) :: qc_save, qi_save - real(kind=kind_phys), dimension(im,levs), intent(in) :: qc_bl, qi_bl, cldfra_bl - real(kind=kind_phys), dimension(im), intent(in) :: slmsk, xlat, de_lgth - real(kind=kind_phys), dimension(im,nlay), intent(in) :: plyr, dz - real(kind=kind_phys), dimension(im,5), intent(inout) :: cldsa - integer, dimension(im,3), intent(inout) :: mbota, mtopa + real(kind=kind_phys), dimension(:,:), intent(inout) :: qc_save, qi_save + real(kind=kind_phys), dimension(:,:), intent(in) :: qc_bl, qi_bl, cldfra_bl + real(kind=kind_phys), dimension(:), intent(in) :: slmsk, xlat, de_lgth + real(kind=kind_phys), dimension(:,:), intent(in) :: plyr, dz + real(kind=kind_phys), dimension(:,:), intent(inout) :: cldsa + integer, dimension(:,:), intent(inout) :: mbota, mtopa character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg ! Local variables diff --git a/physics/moninedmf.f b/physics/moninedmf.f index 63edc34869..9a6e4a6ddc 100644 --- a/physics/moninedmf.f +++ b/physics/moninedmf.f @@ -79,38 +79,38 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & logical, intent(in) :: lprnt,lssav,ldiag3d,qdiag3d,lsidea logical, intent(in) :: flag_for_pbl_generic_tend integer, intent(in) :: ipr - integer, intent(in) :: im, km, ntrac, ntcw, kinver(im), ntoz - integer, intent(out) :: kpbl(im) + integer, intent(in) :: im, km, ntrac, ntcw, kinver(:), ntoz + integer, intent(out) :: kpbl(:) ! real(kind=kind_phys), intent(in) :: delt, xkzm_m, xkzm_h, xkzm_s real(kind=kind_phys), intent(in) :: xkzminv, moninq_fac - real(kind=kind_phys), intent(inout) :: dv(im,km), du(im,km), & - & tau(im,km), rtg(im,km,ntrac) + real(kind=kind_phys), intent(inout) :: dv(:,:), du(:,:), & + & tau(:,:), rtg(:,:,:) ! Only allocated if ldiag3d or qdiag3d are true real(kind=kind_phys), intent(inout), dimension(:,:) :: & & du3dt_PBL,dv3dt_PBL,dt3dt_PBL,dq3dt_PBL,do3dt_PBL real(kind=kind_phys), intent(in) :: & - & u1(im,km), v1(im,km), & - & t1(im,km), q1(im,km,ntrac), & - & swh(im,km), hlw(im,km), & - & xmu(im), psk(im), & - & rbsoil(im), zorl(im), & - & u10m(im), v10m(im), & - & fm(im), fh(im), & - & tsea(im), & - & heat(im), evap(im), & - & stress(im), spd1(im) + & u1(:,:), v1(:,:), & + & t1(:,:), q1(:,:,:), & + & swh(:,:), hlw(:,:), & + & xmu(:), psk(:), & + & rbsoil(:), zorl(:), & + & u10m(:), v10m(:), & + & fm(:), fh(:), & + & tsea(:), & + & heat(:), evap(:), & + & stress(:), spd1(:) real(kind=kind_phys), intent(in) :: & - & prsi(im,km+1), del(im,km), & - & prsl(im,km), prslk(im,km), & - & phii(im,km+1), phil(im,km) + & prsi(:,:), del(:,:), & + & prsl(:,:), prslk(:,:), & + & phii(:,:), phil(:,:) real(kind=kind_phys), intent(out) :: & - & dusfc(im), dvsfc(im), & - & dtsfc(im), dqsfc(im), & - & hpbl(im), dkt(im,km-1) + & dusfc(:), dvsfc(:), & + & dtsfc(:), dqsfc(:), & + & hpbl(:), dkt(:,:) real(kind=kind_phys), intent(inout) :: & - & hgamt(im), hgamq(im) + & hgamt(:), hgamq(:) ! logical, intent(in) :: dspheat ! flag for tke dissipative heating diff --git a/physics/moninedmf_hafs.f b/physics/moninedmf_hafs.f index 00a8dbd0b5..5b16a63c35 100644 --- a/physics/moninedmf_hafs.f +++ b/physics/moninedmf_hafs.f @@ -76,37 +76,37 @@ subroutine hedmf_hafs_run(im,km,ntrac,ntcw,dv,du,tau,rtg, & ! logical, intent(in) :: lprnt integer, intent(in) :: ipr - integer, intent(in) :: im, km, ntrac, ntcw, kinver(im) - integer, intent(in) :: islimsk(1:im) - integer, intent(out) :: kpbl(im) + integer, intent(in) :: im, km, ntrac, ntcw, kinver(:) + integer, intent(in) :: islimsk(:) + integer, intent(out) :: kpbl(:) ! real(kind=kind_phys), intent(in) :: delt, xkzm_m, xkzm_h, xkzm_s real(kind=kind_phys), intent(in) :: xkzminv, moninq_fac - real(kind=kind_phys), intent(inout) :: dv(im,km), du(im,km), & - & tau(im,km), rtg(im,km,ntrac) + real(kind=kind_phys), intent(inout) :: dv(:,:), du(:,:), & + & tau(:,:), rtg(:,:,:) real(kind=kind_phys), intent(in) :: & - & u1(im,km), v1(im,km), & - & t1(im,km), q1(im,km,ntrac), & - & swh(im,km), hlw(im,km), & - & xmu(im), psk(im), & - & rbsoil(im), zorl(im), & - & u10m(im), v10m(im), & - & fm(im), fh(im), & - & tsea(im), & - & heat(im), evap(im), & - & stress(im), spd1(im) + & u1(:,:), v1(:,:), & + & t1(:,:), q1(:,:,:), & + & swh(:,:), hlw(:,:), & + & xmu(:), psk(:), & + & rbsoil(:), zorl(:), & + & u10m(:), v10m(:), & + & fm(:), fh(:), & + & tsea(:), & + & heat(:), evap(:), & + & stress(:), spd1(:) real(kind=kind_phys), intent(in) :: & - & prsi(im,km+1), del(im,km), & - & prsl(im,km), prslk(im,km), & - & phii(im,km+1), phil(im,km) + & prsi(:,:), del(:,:), & + & prsl(:,:), prslk(:,:), & + & phii(:,:), phil(:,:) real(kind=kind_phys), intent(out) :: & - & dusfc(im), dvsfc(im), & - & dtsfc(im), dqsfc(im), & - & hpbl(im), dkt(im,km-1) + & dusfc(:), dvsfc(:), & + & dtsfc(:), dqsfc(:), & + & hpbl(:), dkt(:,:) real(kind=kind_phys), intent(inout) :: & - & hgamt(im), hgamq(im) + & hgamt(:), hgamq(:) ! logical, intent(in) :: dspheat ! flag for tke dissipative heating diff --git a/physics/moninshoc.f b/physics/moninshoc.f index 275d979fe9..da5c102a26 100644 --- a/physics/moninshoc.f +++ b/physics/moninshoc.f @@ -43,28 +43,28 @@ subroutine moninshoc_run (im,km,ntrac,ntcw,ncnd,dv,du,tau,rtg, ! integer, intent(in) :: im, & km, ntrac, ntcw, ncnd, ntke - integer, dimension(im), intent(in) :: kinver + integer, dimension(:), intent(in) :: kinver real(kind=kind_phys), intent(in) :: delt, & xkzm_m, xkzm_h, xkzm_s, xkzminv real(kind=kind_phys), intent(in) :: grav, & rd, cp, hvap, fv - real(kind=kind_phys), dimension(im), intent(in) :: psk, + real(kind=kind_phys), dimension(:), intent(in) :: psk, & rbsoil, zorl, u10m, v10m, fm, fh, tsea, heat, evap, stress, spd1 - real(kind=kind_phys), dimension(im,km), intent(in) :: u1, v1, + real(kind=kind_phys), dimension(:,:), intent(in) :: u1, v1, & t1, tkh, del, prsl, phil, prslk - real(kind=kind_phys), dimension(im,km+1), intent(in) :: prsi, phii - real(kind=kind_phys), dimension(im,km,ntrac), intent(in) :: q1 + real(kind=kind_phys), dimension(:,:), intent(in) :: prsi, phii + real(kind=kind_phys), dimension(:,:,:), intent(in) :: q1 - real(kind=kind_phys), dimension(im,km), intent(inout) :: du, dv, + real(kind=kind_phys), dimension(:,:), intent(inout) :: du, dv, & tau - real(kind=kind_phys), dimension(im,km,ntrac), intent(inout) :: rtg + real(kind=kind_phys), dimension(:,:,:), intent(inout) :: rtg - integer, dimension(im), intent(out) :: kpbl - real(kind=kind_phys), dimension(im), intent(out) :: dusfc, + integer, dimension(:), intent(out) :: kpbl + real(kind=kind_phys), dimension(:), intent(out) :: dusfc, & dvsfc, dtsfc, dqsfc, hpbl - real(kind=kind_phys), dimension(im,km), intent(out) :: prnum - real(kind=kind_phys), dimension(im,km-1), intent(out) :: dkt + real(kind=kind_phys), dimension(:,:), intent(out) :: prnum + real(kind=kind_phys), dimension(:,:), intent(out) :: dkt character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/mp_fer_hires.F90 b/physics/mp_fer_hires.F90 index 95e5211411..a6907bed1f 100644 --- a/physics/mp_fer_hires.F90 +++ b/physics/mp_fer_hires.F90 @@ -53,9 +53,9 @@ subroutine mp_fer_hires_init(ncol, nlev, dtp, imp_physics, & logical, intent(in) :: restart character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg - real(kind_phys), intent(out), optional :: f_ice(1:ncol,1:nlev) - real(kind_phys), intent(out), optional :: f_rain(1:ncol,1:nlev) - real(kind_phys), intent(out), optional :: f_rimef(1:ncol,1:nlev) + real(kind_phys), intent(out), optional :: f_ice(:,:) + real(kind_phys), intent(out), optional :: f_rain(:,:) + real(kind_phys), intent(out), optional :: f_rimef(:,:) ! Local variables @@ -153,28 +153,28 @@ SUBROUTINE mp_fer_hires_run(NCOL, NLEV, DT ,SPEC_ADV & logical, intent(in ) :: spec_adv integer, intent(in ) :: mpirank integer, intent(in ) :: mpiroot - real(kind_phys), intent(in ) :: slmsk(1:ncol) - real(kind_phys), intent(in ) :: prsi(1:ncol,1:nlev+1) - real(kind_phys), intent(in ) :: p_phy(1:ncol,1:nlev) + real(kind_phys), intent(in ) :: slmsk(:) + real(kind_phys), intent(in ) :: prsi(:,:) + real(kind_phys), intent(in ) :: p_phy(:,:) real(kind_phys), intent(in ) :: epsq,r_d,p608,cp,g - real(kind_phys), intent(inout) :: t(1:ncol,1:nlev) - real(kind_phys), intent(inout) :: q(1:ncol,1:nlev) - real(kind_phys), intent(inout) :: cwm(1:ncol,1:nlev) - real(kind_phys), intent(inout) :: train(1:ncol,1:nlev) - real(kind_phys), intent(out ) :: sr(1:ncol) - real(kind_phys), intent(inout) :: f_ice(1:ncol,1:nlev) - real(kind_phys), intent(inout) :: f_rain(1:ncol,1:nlev) - real(kind_phys), intent(inout) :: f_rimef(1:ncol,1:nlev) - real(kind_phys), intent(inout) :: qc(1:ncol,1:nlev) - real(kind_phys), intent(inout) :: qr(1:ncol,1:nlev) - real(kind_phys), intent(inout) :: qi(1:ncol,1:nlev) - real(kind_phys), intent(inout) :: qg(1:ncol,1:nlev) ! QRIMEF - - real(kind_phys), intent(inout) :: prec(1:ncol) + real(kind_phys), intent(inout) :: t(:,:) + real(kind_phys), intent(inout) :: q(:,:) + real(kind_phys), intent(inout) :: cwm(:,:) + real(kind_phys), intent(inout) :: train(:,:) + real(kind_phys), intent(out ) :: sr(:) + real(kind_phys), intent(inout) :: f_ice(:,:) + real(kind_phys), intent(inout) :: f_rain(:,:) + real(kind_phys), intent(inout) :: f_rimef(:,:) + real(kind_phys), intent(inout) :: qc(:,:) + real(kind_phys), intent(inout) :: qr(:,:) + real(kind_phys), intent(inout) :: qi(:,:) + real(kind_phys), intent(inout) :: qg(:,:) ! QRIMEF + + real(kind_phys), intent(inout) :: prec(:) ! real(kind_phys) :: acprec(1:ncol) !MZ: change to local - real(kind_phys), intent(inout) :: refl_10cm(1:ncol,1:nlev) + real(kind_phys), intent(inout) :: refl_10cm(:,:) real(kind_phys), intent(in ) :: rhgrd - real(kind_phys), intent(in ) :: dx(1:ncol) + real(kind_phys), intent(in ) :: dx(:) character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg ! diff --git a/physics/mp_thompson.F90 b/physics/mp_thompson.F90 index ec19945b03..ef4748c322 100644 --- a/physics/mp_thompson.F90 +++ b/physics/mp_thompson.F90 @@ -380,14 +380,14 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, & real(kind_phys), intent(in ) :: con_g real(kind_phys), intent(in ) :: con_rd ! Hydrometeors - real(kind_phys), intent(inout) :: spechum(1:ncol,1:nlev) - real(kind_phys), intent(inout) :: qc(1:ncol,1:nlev) - real(kind_phys), intent(inout) :: qr(1:ncol,1:nlev) - real(kind_phys), intent(inout) :: qi(1:ncol,1:nlev) - real(kind_phys), intent(inout) :: qs(1:ncol,1:nlev) - real(kind_phys), intent(inout) :: qg(1:ncol,1:nlev) - real(kind_phys), intent(inout) :: ni(1:ncol,1:nlev) - real(kind_phys), intent(inout) :: nr(1:ncol,1:nlev) + real(kind_phys), intent(inout) :: spechum(:,:) + real(kind_phys), intent(inout) :: qc(:,:) + real(kind_phys), intent(inout) :: qr(:,:) + real(kind_phys), intent(inout) :: qi(:,:) + real(kind_phys), intent(inout) :: qs(:,:) + real(kind_phys), intent(inout) :: qg(:,:) + real(kind_phys), intent(inout) :: ni(:,:) + real(kind_phys), intent(inout) :: nr(:,:) ! Aerosols logical, intent(in) :: is_aerosol_aware, reset ! The following arrays are not allocated if is_aerosol_aware is false @@ -397,25 +397,25 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, & real(kind_phys), optional, intent(in ) :: nwfa2d(:) real(kind_phys), optional, intent(in ) :: nifa2d(:) ! State variables and timestep information - real(kind_phys), intent(inout) :: tgrs(1:ncol,1:nlev) - real(kind_phys), intent(in ) :: prsl(1:ncol,1:nlev) - real(kind_phys), intent(in ) :: phii(1:ncol,1:nlev+1) - real(kind_phys), intent(in ) :: omega(1:ncol,1:nlev) + real(kind_phys), intent(inout) :: tgrs(:,:) + real(kind_phys), intent(in ) :: prsl(:,:) + real(kind_phys), intent(in ) :: phii(:,:) + real(kind_phys), intent(in ) :: omega(:,:) real(kind_phys), intent(in ) :: dtp ! Precip/rain/snow/graupel fall amounts and fraction of frozen precip - real(kind_phys), intent( out) :: prcp(1:ncol) - real(kind_phys), intent( out) :: rain(1:ncol) - real(kind_phys), intent( out) :: graupel(1:ncol) - real(kind_phys), intent( out) :: ice(1:ncol) - real(kind_phys), intent( out) :: snow(1:ncol) - real(kind_phys), intent( out) :: sr(1:ncol) + real(kind_phys), intent( out) :: prcp(:) + real(kind_phys), intent( out) :: rain(:) + real(kind_phys), intent( out) :: graupel(:) + real(kind_phys), intent( out) :: ice(:) + real(kind_phys), intent( out) :: snow(:) + real(kind_phys), intent( out) :: sr(:) ! Radar reflectivity - real(kind_phys), intent( out) :: refl_10cm(1:ncol,1:nlev) + real(kind_phys), intent( out) :: refl_10cm(:,:) logical, optional, intent(in ) :: do_radar_ref ! Cloud effective radii - real(kind_phys), optional, intent( out) :: re_cloud(1:ncol,1:nlev) - real(kind_phys), optional, intent( out) :: re_ice(1:ncol,1:nlev) - real(kind_phys), optional, intent( out) :: re_snow(1:ncol,1:nlev) + real(kind_phys), optional, intent( out) :: re_cloud(:,:) + real(kind_phys), optional, intent( out) :: re_ice(:,:) + real(kind_phys), optional, intent( out) :: re_snow(:,:) ! MPI information integer, intent(in) :: mpicomm integer, intent(in) :: mpirank diff --git a/physics/mp_thompson_post.F90 b/physics/mp_thompson_post.F90 index cca74951dd..36e309387d 100644 --- a/physics/mp_thompson_post.F90 +++ b/physics/mp_thompson_post.F90 @@ -59,9 +59,9 @@ subroutine mp_thompson_post_run(ncol, nlev, tgrs_save, tgrs, prslk, dtp, ttendli ! Interface variables integer, intent(in) :: ncol integer, intent(in) :: nlev - real(kind_phys), dimension(1:ncol,1:nlev), intent(in) :: tgrs_save - real(kind_phys), dimension(1:ncol,1:nlev), intent(inout) :: tgrs - real(kind_phys), dimension(1:ncol,1:nlev), intent(in) :: prslk + real(kind_phys), dimension(:,:), intent(in) :: tgrs_save + real(kind_phys), dimension(:,:), intent(inout) :: tgrs + real(kind_phys), dimension(:,:), intent(in) :: prslk real(kind_phys), intent(in) :: dtp real(kind_phys), intent(in) :: ttendlim integer, intent(in) :: kdt diff --git a/physics/mp_thompson_pre.F90 b/physics/mp_thompson_pre.F90 index 4087ac8154..957c1f118e 100644 --- a/physics/mp_thompson_pre.F90 +++ b/physics/mp_thompson_pre.F90 @@ -28,8 +28,8 @@ subroutine mp_thompson_pre_run(ncol, nlev, tgrs, tgrs_save, errmsg, errflg) ! Interface variables integer, intent(in ) :: ncol integer, intent(in ) :: nlev - real(kind_phys), intent(in ) :: tgrs(1:ncol,1:nlev) - real(kind_phys), intent( out) :: tgrs_save(1:ncol,1:nlev) + real(kind_phys), intent(in ) :: tgrs(:,:) + real(kind_phys), intent( out) :: tgrs_save(:,:) ! CCPP error handling character(len=*), intent( out) :: errmsg diff --git a/physics/ozphys.f b/physics/ozphys.f index f8da587600..ba6cb45eb1 100644 --- a/physics/ozphys.f +++ b/physics/ozphys.f @@ -68,8 +68,8 @@ subroutine ozphys_run ( & real(kind=kind_phys), intent(inout) :: & & ozp1(:,:), ozp2(:,:), ozp3(:,:), ozp4(:,:) real(kind=kind_phys), intent(in) :: & - & dt, po3(ko3), prdout(im,ko3,oz_coeff), & - & prsl(im,levs), tin(im,levs), delp(im,levs), & + & dt, po3(:), prdout(:,:,:), & + & prsl(:,:), tin(:,:), delp(:,:), & & con_g real :: gravi logical, intent(in) :: ldiag3d, qdiag3d diff --git a/physics/ozphys_2015.f b/physics/ozphys_2015.f index 238a8fb212..113dc03f34 100644 --- a/physics/ozphys_2015.f +++ b/physics/ozphys_2015.f @@ -67,14 +67,14 @@ subroutine ozphys_2015_run ( & real(kind=kind_phys),intent(in) :: con_g real :: gravi integer, intent(in) :: im, levs, ko3, pl_coeff,me - real(kind=kind_phys), intent(in) :: po3(ko3), & - & prsl(im,levs), tin(im,levs), & - & delp(im,levs), & - & prdout(im,ko3,pl_coeff), dt + real(kind=kind_phys), intent(in) :: po3(:), & + & prsl(:,:), tin(:,:), & + & delp(:,:), & + & prdout(:,:,:), dt ! These arrays may not be allocated and need assumed array sizes real(kind=kind_phys), intent(inout) :: & & ozp1(:,:), ozp2(:,:), ozp3(:,:),ozp4(:,:) - real(kind=kind_phys), intent(inout) :: oz(im,levs) + real(kind=kind_phys), intent(inout) :: oz(:,:) character(len=*), intent(out) :: errmsg diff --git a/physics/precpd.f b/physics/precpd.f index 0e330558bd..8d58a38b1b 100644 --- a/physics/precpd.f +++ b/physics/precpd.f @@ -102,13 +102,13 @@ subroutine zhaocarr_precpd_run (im,km,dt,del,prsl,q,cwm,t,rn & ! Interface variables integer, intent(in) :: im, km, jpr real (kind=kind_phys), intent(in) :: dt - real (kind=kind_phys), intent(in) :: del(im,km), prsl(im,km) - real (kind=kind_phys), intent(inout) :: q(im,km), t(im,km), & - & cwm(im,km) - real (kind=kind_phys), intent(out) :: rn(im), sr(im), rainp(im,km) - real (kind=kind_phys), intent(in) :: u00k(im,km) - real (kind=kind_phys), intent(in) :: psautco(2), prautco(2), & - & evpco, wminco(2), wk1(im) + real (kind=kind_phys), intent(in) :: del(:,:), prsl(:,:) + real (kind=kind_phys), intent(inout) :: q(:,:), t(:,:), & + & cwm(:,:) + real (kind=kind_phys), intent(out) :: rn(:), sr(:), rainp(:,:) + real (kind=kind_phys), intent(in) :: u00k(:,:) + real (kind=kind_phys), intent(in) :: psautco(:), prautco(:), & + & evpco, wminco(:), wk1(:) logical, intent(in) :: lprnt character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/radlw_main.f b/physics/radlw_main.f index 7b029f8b0d..e45e556a70 100644 --- a/physics/radlw_main.f +++ b/physics/radlw_main.f @@ -572,44 +572,44 @@ subroutine rrtmg_lw_run & logical, intent(in) :: lprnt - real (kind=kind_phys), dimension(npts,nlp1), intent(in) :: plvl, & + real (kind=kind_phys), dimension(:,:), intent(in) :: plvl, & & tlvl - real (kind=kind_phys), dimension(npts,nlay), intent(in) :: plyr, & + real (kind=kind_phys), dimension(:,:), intent(in) :: plyr, & & tlyr, qlyr, olyr, dzlyr, delpin - real (kind=kind_phys),dimension(npts,nlay),intent(in)::gasvmr_co2,& + real (kind=kind_phys),dimension(:,:),intent(in)::gasvmr_co2, & & gasvmr_n2o, gasvmr_ch4, gasvmr_o2, gasvmr_co, gasvmr_cfc11, & & gasvmr_cfc12, gasvmr_cfc22, gasvmr_ccl4 - real (kind=kind_phys), dimension(npts,nlay),intent(in):: cld_cf - real (kind=kind_phys), dimension(npts,nlay),intent(in),optional:: & + real (kind=kind_phys), dimension(:,:),intent(in):: cld_cf + real (kind=kind_phys), dimension(:,:),intent(in),optional:: & & cld_lwp, cld_ref_liq, cld_iwp, cld_ref_ice, & & cld_rwp, cld_ref_rain, cld_swp, cld_ref_snow, & & cld_od - real (kind=kind_phys), dimension(npts), intent(in) :: sfemis, & + real (kind=kind_phys), dimension(:), intent(in) :: sfemis, & & sfgtmp, de_lgth - real (kind=kind_phys), dimension(npts,nlay,nbands),intent(in):: & + real (kind=kind_phys), dimension(:,:,:),intent(in):: & & aeraod, aerssa ! --- outputs: - real (kind=kind_phys), dimension(npts,nlay), intent(inout) :: hlwc - real (kind=kind_phys), dimension(npts,nlay), intent(inout) :: & + real (kind=kind_phys), dimension(:,:), intent(inout) :: hlwc + real (kind=kind_phys), dimension(:,:), intent(inout) :: & & cldtau - type (topflw_type), dimension(npts), intent(inout) :: topflx - type (sfcflw_type), dimension(npts), intent(inout) :: sfcflx + type (topflw_type), dimension(:), intent(inout) :: topflx + type (sfcflw_type), dimension(:), intent(inout) :: sfcflx character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg !! --- optional outputs: - real (kind=kind_phys), dimension(npts,nlay,nbands),optional, & + real (kind=kind_phys), dimension(:,:,:),optional, & & intent(inout) :: hlwb - real (kind=kind_phys), dimension(npts,nlay), optional, & + real (kind=kind_phys), dimension(:,:), optional, & & intent(inout) :: hlw0 - type (proflw_type), dimension(npts,nlp1), optional, & + type (proflw_type), dimension(:,:), optional, & & intent(inout) :: flxprf logical, intent(in) :: lslwr diff --git a/physics/radsw_main.f b/physics/radsw_main.f index b10541fb70..7f41cca204 100644 --- a/physics/radsw_main.f +++ b/physics/radsw_main.f @@ -659,59 +659,59 @@ subroutine rrtmg_sw_run & logical, intent(in) :: lprnt, lsswr - real (kind=kind_phys), dimension(npts,nlp1), intent(in) :: & + real (kind=kind_phys), dimension(:,:), intent(in) :: & & plvl, tlvl - real (kind=kind_phys), dimension(npts,nlay), intent(in) :: & + real (kind=kind_phys), dimension(:,:), intent(in) :: & & plyr, tlyr, qlyr, olyr, dzlyr, delpin - real (kind=kind_phys),dimension(npts),intent(in):: sfcalb_nir_dir - real (kind=kind_phys),dimension(npts),intent(in):: sfcalb_nir_dif - real (kind=kind_phys),dimension(npts),intent(in):: sfcalb_uvis_dir - real (kind=kind_phys),dimension(npts),intent(in):: sfcalb_uvis_dif - - real(kind=kind_phys),dimension(npts,nlay),intent(in)::gasvmr_co2 - real(kind=kind_phys),dimension(npts,nlay),intent(in)::gasvmr_n2o - real(kind=kind_phys),dimension(npts,nlay),intent(in)::gasvmr_ch4 - real(kind=kind_phys),dimension(npts,nlay),intent(in)::gasvmr_o2 - real(kind=kind_phys),dimension(npts,nlay),intent(in)::gasvmr_co - real(kind=kind_phys),dimension(npts,nlay),intent(in)::gasvmr_cfc11 - real(kind=kind_phys),dimension(npts,nlay),intent(in)::gasvmr_cfc12 - real(kind=kind_phys),dimension(npts,nlay),intent(in)::gasvmr_cfc22 - real(kind=kind_phys),dimension(npts,nlay),intent(in)::gasvmr_ccl4 - - real (kind=kind_phys), dimension(npts,nlay),intent(in):: cld_cf - real (kind=kind_phys), dimension(npts,nlay),intent(in),optional:: & + real (kind=kind_phys),dimension(:),intent(in):: sfcalb_nir_dir + real (kind=kind_phys),dimension(:),intent(in):: sfcalb_nir_dif + real (kind=kind_phys),dimension(:),intent(in):: sfcalb_uvis_dir + real (kind=kind_phys),dimension(:),intent(in):: sfcalb_uvis_dif + + real(kind=kind_phys),dimension(:,:),intent(in)::gasvmr_co2 + real(kind=kind_phys),dimension(:,:),intent(in)::gasvmr_n2o + real(kind=kind_phys),dimension(:,:),intent(in)::gasvmr_ch4 + real(kind=kind_phys),dimension(:,:),intent(in)::gasvmr_o2 + real(kind=kind_phys),dimension(:,:),intent(in)::gasvmr_co + real(kind=kind_phys),dimension(:,:),intent(in)::gasvmr_cfc11 + real(kind=kind_phys),dimension(:,:),intent(in)::gasvmr_cfc12 + real(kind=kind_phys),dimension(:,:),intent(in)::gasvmr_cfc22 + real(kind=kind_phys),dimension(:,:),intent(in)::gasvmr_ccl4 + + real (kind=kind_phys), dimension(:,:),intent(in):: cld_cf + real (kind=kind_phys), dimension(:,:),intent(in),optional:: & & cld_lwp, cld_ref_liq, cld_iwp, cld_ref_ice, & & cld_rwp, cld_ref_rain, cld_swp, cld_ref_snow, & & cld_od, cld_ssa, cld_asy - real(kind=kind_phys),dimension(npts,nlay,nbdsw),intent(in)::aeraod - real(kind=kind_phys),dimension(npts,nlay,nbdsw),intent(in)::aerssa - real(kind=kind_phys),dimension(npts,nlay,nbdsw),intent(in)::aerasy + real(kind=kind_phys),dimension(:,:,:),intent(in)::aeraod + real(kind=kind_phys),dimension(:,:,:),intent(in)::aerssa + real(kind=kind_phys),dimension(:,:,:),intent(in)::aerasy real (kind=kind_phys), intent(in) :: cosz(npts), solcon, & & de_lgth(npts) ! --- outputs: - real (kind=kind_phys), dimension(npts,nlay), intent(inout) :: hswc - real (kind=kind_phys), dimension(npts,nlay), intent(inout) :: & + real (kind=kind_phys), dimension(:,:), intent(inout) :: hswc + real (kind=kind_phys), dimension(:,:), intent(inout) :: & & cldtau - type (topfsw_type), dimension(npts), intent(inout) :: topflx - type (sfcfsw_type), dimension(npts), intent(inout) :: sfcflx + type (topfsw_type), dimension(:), intent(inout) :: topflx + type (sfcfsw_type), dimension(:), intent(inout) :: sfcflx character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg !! --- optional outputs: - real (kind=kind_phys), dimension(npts,nlay,nbdsw), optional, & + real (kind=kind_phys), dimension(:,:,:), optional, & & intent(inout) :: hswb - real (kind=kind_phys), dimension(npts,nlay), optional, & + real (kind=kind_phys), dimension(:,:), optional, & & intent(inout) :: hsw0 - type (profsw_type), dimension(npts,nlp1), optional, & + type (profsw_type), dimension(:,:), optional, & & intent(inout) :: flxprf - type (cmpfsw_type), dimension(npts), optional, & + type (cmpfsw_type), dimension(:), optional, & & intent(inout) :: fdncmp ! --- locals: diff --git a/physics/rayleigh_damp.f b/physics/rayleigh_damp.f index a56a85e8c7..579370cb21 100644 --- a/physics/rayleigh_damp.f +++ b/physics/rayleigh_damp.f @@ -71,9 +71,9 @@ subroutine rayleigh_damp_run ( & logical,intent(in) :: lsidea,ldiag3d integer,intent(in) :: im, km,levr real(kind=kind_phys),intent(in) :: DT, CP, PRSLRD0, ral_ts - real(kind=kind_phys),intent(in) :: pgr(im), PRSL(IM,KM) - real(kind=kind_phys),intent(in) :: U1(IM,KM), V1(IM,KM) - real(kind=kind_phys),intent(inout) :: A(IM,KM), B(IM,KM), C(IM,KM) + real(kind=kind_phys),intent(in) :: pgr(:), PRSL(:,:) + real(kind=kind_phys),intent(in) :: U1(:,:), V1(:,:) + real(kind=kind_phys),intent(inout) :: A(:,:), B(:,:), C(:,:) real(kind=kind_phys),intent(inout) :: du3dt(:,:) real(kind=kind_phys),intent(inout) :: dv3dt(:,:) real(kind=kind_phys),intent(inout) :: dt3dt(:,:) diff --git a/physics/rrtmg_lw_post.F90 b/physics/rrtmg_lw_post.F90 index af83c5cc7c..7715ed7b8e 100644 --- a/physics/rrtmg_lw_post.F90 +++ b/physics/rrtmg_lw_post.F90 @@ -30,8 +30,8 @@ subroutine rrtmg_lw_post_run (Model, Grid, Radtend, Coupling, & type(GFS_grid_type), intent(in) :: Grid type(GFS_radtend_type), intent(inout) :: Radtend integer, intent(in) :: im, ltp, LM, kd - real(kind=kind_phys), dimension(size(Grid%xlon,1), lm+LTP), intent(in) :: htlwc, htlw0 - real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(in) :: tsfa + real(kind=kind_phys), dimension(:,:), intent(in) :: htlwc, htlw0 + real(kind=kind_phys), dimension(:), intent(in) :: tsfa character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg ! local variables diff --git a/physics/rrtmg_lw_pre.F90 b/physics/rrtmg_lw_pre.F90 index 7de02eed1e..1e46717830 100644 --- a/physics/rrtmg_lw_pre.F90 +++ b/physics/rrtmg_lw_pre.F90 @@ -30,7 +30,7 @@ subroutine rrtmg_lw_pre_run (Model, Grid, Sfcprop, Radtend, im, tsfg, tsfa, errm type(GFS_sfcprop_type), intent(in) :: Sfcprop type(GFS_grid_type), intent(in) :: Grid integer, intent(in) :: im - real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(in) :: tsfa, tsfg + real(kind=kind_phys), dimension(:), intent(in) :: tsfa, tsfg character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/rrtmg_sw_post.F90 b/physics/rrtmg_sw_post.F90 index b0ab311295..b9534e0b4f 100644 --- a/physics/rrtmg_sw_post.F90 +++ b/physics/rrtmg_sw_post.F90 @@ -35,9 +35,9 @@ subroutine rrtmg_sw_post_run (Model, Grid, Diag, Radtend, Coupling, & type(GFS_grid_type), intent(in) :: Grid type(GFS_diag_type), intent(inout) :: Diag integer, intent(in) :: im, lm, kd, nday, ltp - type(cmpfsw_type), dimension(size(Grid%xlon,1)), intent(inout) :: scmpsw - real(kind=kind_phys), dimension(Size(Grid%xlon,1), lm+LTP), intent(in) :: htswc, htsw0 - real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(in) :: sfcalb1, sfcalb2, sfcalb3, sfcalb4 + type(cmpfsw_type), dimension(:), intent(inout) :: scmpsw + real(kind=kind_phys), dimension(:,:), intent(in) :: htswc, htsw0 + real(kind=kind_phys), dimension(:), intent(in) :: sfcalb1, sfcalb2, sfcalb3, sfcalb4 character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg ! Local variables diff --git a/physics/rrtmg_sw_pre.F90 b/physics/rrtmg_sw_pre.F90 index 05e8d4c7bb..3ef89c86c7 100644 --- a/physics/rrtmg_sw_pre.F90 +++ b/physics/rrtmg_sw_pre.F90 @@ -34,10 +34,10 @@ subroutine rrtmg_sw_pre_run (Model, Grid, Sfcprop, Radtend, im, & type(GFS_grid_type), intent(in) :: Grid integer, intent(in) :: im integer, intent(out) :: nday - integer, dimension(size(Grid%xlon,1)), intent(out) :: idxday - real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(in) :: tsfa, tsfg - real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(out) :: sfcalb1, sfcalb2, sfcalb3, sfcalb4 - real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(in) :: alb1d + integer, dimension(:), intent(out) :: idxday + real(kind=kind_phys), dimension(:), intent(in) :: tsfa, tsfg + real(kind=kind_phys), dimension(:), intent(out) :: sfcalb1, sfcalb2, sfcalb3, sfcalb4 + real(kind=kind_phys), dimension(:), intent(in) :: alb1d character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg ! Local variables diff --git a/physics/rrtmgp_lw_aerosol_optics.F90 b/physics/rrtmgp_lw_aerosol_optics.F90 index 2047deaf40..0b4339bda0 100644 --- a/physics/rrtmgp_lw_aerosol_optics.F90 +++ b/physics/rrtmgp_lw_aerosol_optics.F90 @@ -40,20 +40,20 @@ subroutine rrtmgp_lw_aerosol_optics_run(doLWrad, nCol, nLev, nTracer, nTracerAer nLev, & ! Number of vertical layers nTracer, & ! Number of tracers nTracerAer ! Number of aerosol tracers - real(kind_phys), dimension(nCol), intent(in) :: & + real(kind_phys), dimension(:), intent(in) :: & lon, & ! Longitude lat, & ! Latitude lsmask ! Land/sea/sea-ice mask - real(kind_phys), dimension(nCol,Nlev),intent(in) :: & + real(kind_phys), dimension(:,:),intent(in) :: & p_lay, & ! Pressure @ layer-centers (Pa) tv_lay, & ! Virtual-temperature @ layer-centers (K) relhum, & ! Relative-humidity @ layer-centers p_lk ! Exner function @ layer-centers (1) - real(kind_phys), dimension(nCol, nLev, nTracer),intent(in) :: & + real(kind_phys), dimension(:,:, :),intent(in) :: & tracer ! trace gas concentrations - real(kind_phys), dimension(nCol, nLev, nTracerAer),intent(in) :: & + real(kind_phys), dimension(:,:, :),intent(in) :: & aerfld ! aerosol input concentrations - real(kind_phys), dimension(nCol,nLev+1),intent(in) :: & + real(kind_phys), dimension(:,:),intent(in) :: & p_lev ! Pressure @ layer-interfaces (Pa) type(ty_gas_optics_rrtmgp),intent(in) :: & sw_gas_props ! RRTMGP DDT: spectral information for SW calculation @@ -61,7 +61,7 @@ subroutine rrtmgp_lw_aerosol_optics_run(doLWrad, nCol, nLev, nTracer, nTracerAer lw_gas_props ! RRTMGP DDT: spectral information for LW calculation ! Outputs - real(kind_phys), dimension(nCol,NSPC1), intent(inout) :: & + real(kind_phys), dimension(:,:), intent(inout) :: & aerodp ! Vertical integrated optical depth for various aerosol species type(ty_optical_props_1scl),intent(out) :: & lw_optical_props_aerosol ! RRTMGP DDT: Longwave aerosol optical properties (tau) diff --git a/physics/rrtmgp_lw_cloud_optics.F90 b/physics/rrtmgp_lw_cloud_optics.F90 index 93e38994b4..f679154832 100644 --- a/physics/rrtmgp_lw_cloud_optics.F90 +++ b/physics/rrtmgp_lw_cloud_optics.F90 @@ -286,10 +286,10 @@ subroutine rrtmgp_lw_cloud_optics_run(doLWrad, doG_cldoptics, doGP_cldoptics_PAD nCol, & ! Number of horizontal gridpoints nLev, & ! Number of vertical levels nrghice ! Number of ice-roughness categories - real(kind_phys), dimension(nCol), intent(in) :: & + real(kind_phys), dimension(:), intent(in) :: & lon, & ! Longitude lat ! Latitude - real(kind_phys), dimension(ncol,nLev),intent(in) :: & + real(kind_phys), dimension(:,:),intent(in) :: & p_lay, & ! Layer pressure (Pa) cld_frac, & ! Total cloud fraction by layer cld_lwp, & ! Cloud liquid water path @@ -314,7 +314,7 @@ subroutine rrtmgp_lw_cloud_optics_run(doLWrad, doG_cldoptics, doGP_cldoptics_PAD type(ty_optical_props_1scl),intent(out) :: & lw_optical_props_cloudsByBand, & ! RRTMGP DDT: Longwave optical properties in each band (clouds) lw_optical_props_precipByBand ! RRTMGP DDT: Longwave optical properties in each band (precipitation) - real(kind_phys), dimension(ncol,nLev), intent(out) :: & + real(kind_phys), dimension(:,:), intent(out) :: & cldtaulw ! Approx 10.mu band layer cloud optical depth ! Local variables diff --git a/physics/rrtmgp_lw_cloud_sampling.F90 b/physics/rrtmgp_lw_cloud_sampling.F90 index 1d6cc06a1b..c5de7b5ec1 100644 --- a/physics/rrtmgp_lw_cloud_sampling.F90 +++ b/physics/rrtmgp_lw_cloud_sampling.F90 @@ -57,15 +57,15 @@ subroutine rrtmgp_lw_cloud_sampling_run(doLWrad, nCol, nLev, ipsdlw0, icseed_lw, nCol, & ! Number of horizontal gridpoints nLev, & ! Number of vertical layers ipsdlw0 ! Initial permutation seed for McICA - integer,intent(in),dimension(ncol) :: & + integer,intent(in),dimension(:) :: & icseed_lw ! auxiliary special cloud related array when module ! variable isubclw=2, it provides permutation seed ! for each column profile that are used for generating ! random numbers. when isubclw /=2, it will not be used. - real(kind_phys), dimension(ncol,nLev),intent(in) :: & + real(kind_phys), dimension(:,:),intent(in) :: & cld_frac, & ! Total cloud fraction by layer precip_frac ! Precipitation fraction by layer - real(kind_phys), dimension(ncol,nLev), intent(in) :: & + real(kind_phys), dimension(:,:), intent(in) :: & cloud_overlap_param, & ! Cloud overlap parameter precip_overlap_param ! Precipitation overlap parameter type(ty_gas_optics_rrtmgp),intent(in) :: & diff --git a/physics/rrtmgp_lw_gas_optics.F90 b/physics/rrtmgp_lw_gas_optics.F90 index 787db6bb41..deea46578e 100644 --- a/physics/rrtmgp_lw_gas_optics.F90 +++ b/physics/rrtmgp_lw_gas_optics.F90 @@ -28,7 +28,7 @@ subroutine rrtmgp_lw_gas_optics_init(rrtmgp_root_dir, rrtmgp_lw_file_gas, rrtmgp rrtmgp_lw_file_gas ! RRTMGP file containing coefficients used to compute gaseous optical properties integer, intent(in) :: & rrtmgp_nGases ! Number of trace gases active in RRTMGP - character(len=*),dimension(rrtmgp_nGases), intent(in) :: & + character(len=*),dimension(:), intent(in) :: & active_gases_array ! Character array containing trace gases to include in RRTMGP integer,intent(in) :: & mpicomm, & ! MPI communicator @@ -292,13 +292,13 @@ subroutine rrtmgp_lw_gas_optics_run(doLWrad, nCol, nLev, lw_gas_props, p_lay, p_ nLev ! Number of vertical levels type(ty_gas_optics_rrtmgp),intent(in) :: & lw_gas_props ! RRTMGP DDT: - real(kind_phys), dimension(ncol,nLev), intent(in) :: & + real(kind_phys), dimension(:,:), intent(in) :: & p_lay, & ! Pressure @ model layer-centers (hPa) t_lay ! Temperature (K) - real(kind_phys), dimension(ncol,nLev+1), intent(in) :: & + real(kind_phys), dimension(:,:), intent(in) :: & p_lev, & ! Pressure @ model layer-interfaces (hPa) t_lev ! Temperature @ model levels - real(kind_phys), dimension(ncol), intent(in) :: & + real(kind_phys), dimension(:), intent(in) :: & skt ! Surface(skin) temperature (K) type(ty_gas_concs),intent(in) :: & gas_concentrations ! RRTMGP DDT: trace gas concentrations (vmr) diff --git a/physics/rrtmgp_lw_pre.F90 b/physics/rrtmgp_lw_pre.F90 index 1148c6705f..8bede8c0e3 100644 --- a/physics/rrtmgp_lw_pre.F90 +++ b/physics/rrtmgp_lw_pre.F90 @@ -39,7 +39,7 @@ subroutine rrtmgp_lw_pre_run (doLWrad, nCol, xlon, xlat, slmsk, zorl, snowd, snc doLWrad ! Logical flag for longwave radiation call integer, intent(in) :: & nCol ! Number of horizontal grid points - real(kind_phys), dimension(nCol), intent(in) :: & + real(kind_phys), dimension(:), intent(in) :: & xlon, & ! Longitude xlat, & ! Latitude slmsk, & ! Land/sea/sea-ice mask @@ -52,13 +52,13 @@ subroutine rrtmgp_lw_pre_run (doLWrad, nCol, xlon, xlat, slmsk, zorl, snowd, snc lw_gas_props ! RRTMGP DDT: spectral information for LW calculation ! Outputs - real(kind_phys), dimension(lw_gas_props%get_nband(),ncol), intent(out) :: & + real(kind_phys), dimension(:,:), intent(out) :: & sfc_emiss_byband ! Surface emissivity in each band character(len=*), intent(out) :: & errmsg ! Error message integer, intent(out) :: & errflg ! Error flag - real(kind_phys), dimension(nCol), intent(out) :: & + real(kind_phys), dimension(:), intent(out) :: & semis ! Local variables diff --git a/physics/rrtmgp_lw_rte.F90 b/physics/rrtmgp_lw_rte.F90 index dc49260f6f..137512cf6d 100644 --- a/physics/rrtmgp_lw_rte.F90 +++ b/physics/rrtmgp_lw_rte.F90 @@ -43,16 +43,16 @@ subroutine rrtmgp_lw_rte_run(doLWrad, doLWclrsky, use_LW_jacobian, nCol, nLev, p nCol, & ! Number of horizontal gridpoints nLev, & ! Number of vertical levels nGauss_angles ! Number of angles used in Gaussian quadrature - real(kind_phys), dimension(ncol,nLev), intent(in) :: & + real(kind_phys), dimension(:,:), intent(in) :: & p_lay, & ! Pressure @ model layer-centers (hPa) t_lay ! Temperature (K) - real(kind_phys), dimension(ncol,nLev+1), intent(in) :: & + real(kind_phys), dimension(:,:), intent(in) :: & p_lev ! Pressure @ model layer-interfaces (hPa) - real(kind_phys), dimension(ncol), intent(in) :: & + real(kind_phys), dimension(:), intent(in) :: & skt ! Surface(skin) temperature (K) type(ty_gas_optics_rrtmgp),intent(in) :: & lw_gas_props ! RRTMGP DDT: longwave spectral information - real(kind_phys), dimension(lw_gas_props%get_nband(),ncol), intent(in) :: & + real(kind_phys), dimension(:,:), intent(in) :: & sfc_emiss_byband ! Surface emissivity in each band type(ty_source_func_lw),intent(in) :: & sources ! RRTMGP DDT: longwave source functions @@ -62,7 +62,7 @@ subroutine rrtmgp_lw_rte_run(doLWrad, doLWclrsky, use_LW_jacobian, nCol, nLev, p lw_optical_props_clouds, & ! RRTMGP DDT: longwave cloud radiative properties lw_optical_props_aerosol ! RRTMGP DDT: longwave aerosol radiative properties ! Outputs - real(kind_phys), dimension(ncol,nLev+1), intent(out) :: & + real(kind_phys), dimension(:,:), intent(out) :: & fluxlwUP_allsky, & ! All-sky flux (W/m2) fluxlwDOWN_allsky, & ! All-sky flux (W/m2) fluxlwUP_clrsky, & ! Clear-sky flux (W/m2) @@ -72,7 +72,7 @@ subroutine rrtmgp_lw_rte_run(doLWrad, doLWclrsky, use_LW_jacobian, nCol, nLev, p integer, intent(out) :: & errflg ! CCPP error flag ! Outputs (optional) - real(kind_phys), dimension(ncol,nLev+1), intent(out), optional :: & + real(kind_phys), dimension(:,:), intent(out), optional :: & fluxlwUP_jac, & ! Jacobian of upward LW flux (W/m2/K) fluxlwDOWN_jac ! Jacobian of downward LW flux (W/m2/K) diff --git a/physics/rrtmgp_sw_aerosol_optics.F90 b/physics/rrtmgp_sw_aerosol_optics.F90 index 4bb034279d..b6895501a3 100644 --- a/physics/rrtmgp_sw_aerosol_optics.F90 +++ b/physics/rrtmgp_sw_aerosol_optics.F90 @@ -41,22 +41,22 @@ subroutine rrtmgp_sw_aerosol_optics_run(doSWrad, nCol, nLev, nTracer, nTracerAer nLev, & ! Number of vertical layers nTracer, & ! Number of tracers nTracerAer ! Number of aerosol tracers - integer,intent(in),dimension(nCol) :: & + integer,intent(in),dimension(:) :: & idxday ! Indices for daylit points. - real(kind_phys), dimension(nCol), intent(in) :: & + real(kind_phys), dimension(:), intent(in) :: & lon, & ! Longitude lat, & ! Latitude lsmask ! Land/sea/sea-ice mask - real(kind_phys), dimension(nCol,Nlev),intent(in) :: & + real(kind_phys), dimension(:,:),intent(in) :: & p_lay, & ! Pressure @ layer-centers (Pa) tv_lay, & ! Virtual-temperature @ layer-centers (K) relhum, & ! Relative-humidity @ layer-centers p_lk ! Exner function @ layer-centers (1) - real(kind_phys), dimension(nCol, nLev, nTracer),intent(in) :: & + real(kind_phys), dimension(:, :,:),intent(in) :: & tracer ! trace gas concentrations - real(kind_phys), dimension(nCol, nLev, nTracerAer),intent(in) :: & + real(kind_phys), dimension(:, :,:),intent(in) :: & aerfld ! aerosol input concentrations - real(kind_phys), dimension(nCol,nLev+1),intent(in) :: & + real(kind_phys), dimension(:,:),intent(in) :: & p_lev ! Pressure @ layer-interfaces (Pa) type(ty_gas_optics_rrtmgp),intent(in) :: & sw_gas_props ! RRTMGP DDT: spectral information for SW calculation @@ -64,7 +64,7 @@ subroutine rrtmgp_sw_aerosol_optics_run(doSWrad, nCol, nLev, nTracer, nTracerAer lw_gas_props ! RRTMGP DDT: spectral information for LW calculation ! Outputs - real(kind_phys), dimension(nCol,NSPC1), intent(inout) :: & + real(kind_phys), dimension(:,:), intent(inout) :: & aerodp ! Vertical integrated optical depth for various aerosol species type(ty_optical_props_2str),intent(out) :: & sw_optical_props_aerosol ! RRTMGP DDT: Longwave aerosol optical properties (tau) diff --git a/physics/rrtmgp_sw_cloud_optics.F90 b/physics/rrtmgp_sw_cloud_optics.F90 index 7ab3c27e36..79077518c9 100644 --- a/physics/rrtmgp_sw_cloud_optics.F90 +++ b/physics/rrtmgp_sw_cloud_optics.F90 @@ -304,9 +304,9 @@ subroutine rrtmgp_sw_cloud_optics_run(doSWrad, doG_cldoptics, doGP_cldoptics_PAD nLev, & ! Number of vertical levels nday, & ! Number of daylit points. nrghice ! Number of ice-roughness categories - integer,intent(in),dimension(ncol) :: & + integer,intent(in),dimension(:) :: & idxday ! Indices for daylit points. - real(kind_phys), dimension(ncol,nLev),intent(in) :: & + real(kind_phys), dimension(:,:),intent(in) :: & cld_frac, & ! Total cloud fraction by layer cld_lwp, & ! Cloud liquid water path cld_reliq, & ! Cloud liquid effective radius @@ -330,7 +330,7 @@ subroutine rrtmgp_sw_cloud_optics_run(doSWrad, doG_cldoptics, doGP_cldoptics_PAD type(ty_optical_props_2str),intent(out) :: & sw_optical_props_cloudsByBand, & ! RRTMGP DDT: Shortwave optical properties in each band (clouds) sw_optical_props_precipByBand ! RRTMGP DDT: Shortwave optical properties in each band (cloud precipitation) - real(kind_phys), dimension(ncol,NLev), intent(out) :: & + real(kind_phys), dimension(:,:), intent(out) :: & cldtausw ! Approx 10.mu band layer cloud optical depth ! Local variables diff --git a/physics/rrtmgp_sw_cloud_sampling.F90 b/physics/rrtmgp_sw_cloud_sampling.F90 index 0a0511bc29..617bbfcb1f 100644 --- a/physics/rrtmgp_sw_cloud_sampling.F90 +++ b/physics/rrtmgp_sw_cloud_sampling.F90 @@ -58,17 +58,17 @@ subroutine rrtmgp_sw_cloud_sampling_run(doSWrad, nCol, nDay, nLev, ipsdsw0, idxd nDay, & ! Number of daylit points. nLev, & ! Number of vertical layers ipsdsw0 ! Initial permutation seed for McICA - integer,intent(in),dimension(ncol) :: & + integer,intent(in),dimension(:) :: & idxday ! Indices for daylit points. - integer,intent(in),dimension(ncol) :: & + integer,intent(in),dimension(:) :: & icseed_sw ! auxiliary special cloud related array when module ! variable isubcsw=2, it provides permutation seed ! for each column profile that are used for generating ! random numbers. when isubcsw /=2, it will not be used. - real(kind_phys), dimension(ncol,nLev),intent(in) :: & + real(kind_phys), dimension(:,:),intent(in) :: & cld_frac, & ! Total cloud fraction by layer precip_frac ! Precipitation fraction by layer - real(kind_phys), dimension(ncol,nLev), intent(in) :: & + real(kind_phys), dimension(:,:), intent(in) :: & cloud_overlap_param, & ! Cloud overlap parameter precip_overlap_param ! Precipitation overlap parameter type(ty_gas_optics_rrtmgp),intent(in) :: & diff --git a/physics/rrtmgp_sw_gas_optics.F90 b/physics/rrtmgp_sw_gas_optics.F90 index efe611e0c1..fb14a57ed9 100644 --- a/physics/rrtmgp_sw_gas_optics.F90 +++ b/physics/rrtmgp_sw_gas_optics.F90 @@ -28,7 +28,7 @@ subroutine rrtmgp_sw_gas_optics_init(rrtmgp_root_dir, rrtmgp_sw_file_gas, rrtmgp rrtmgp_sw_file_gas ! RRTMGP file containing coefficients used to compute gaseous optical properties integer, intent(in) :: & rrtmgp_nGases ! Number of trace gases active in RRTMGP - character(len=*),dimension(rrtmgp_nGases), intent(in) :: & + character(len=*),dimension(:), intent(in) :: & active_gases_array ! Character array containing trace gases to include in RRTMGP integer,intent(in) :: & mpicomm, & ! MPI communicator @@ -302,14 +302,14 @@ subroutine rrtmgp_sw_gas_optics_run(doSWrad, nCol, nLev, nday, idxday, sw_gas_pr nDay, & ! Number of daylit points. nCol, & ! Number of horizontal points nLev ! Number of vertical levels - integer,intent(in),dimension(ncol) :: & + integer,intent(in),dimension(:) :: & idxday ! Indices for daylit points. type(ty_gas_optics_rrtmgp),intent(in) :: & sw_gas_props ! RRTMGP DDT: spectral information for RRTMGP SW radiation scheme - real(kind_phys), dimension(ncol,nLev), intent(in) :: & + real(kind_phys), dimension(:,:), intent(in) :: & p_lay, & ! Pressure @ model layer-centers (hPa) t_lay ! Temperature (K) - real(kind_phys), dimension(ncol,nLev+1), intent(in) :: & + real(kind_phys), dimension(:,:), intent(in) :: & p_lev, & ! Pressure @ model layer-interfaces (hPa) t_lev ! Temperature @ model levels type(ty_gas_concs),intent(in) :: & @@ -318,7 +318,7 @@ subroutine rrtmgp_sw_gas_optics_run(doSWrad, nCol, nLev, nday, idxday, sw_gas_pr solcon ! Solar constant integer, intent(in) :: & rrtmgp_nGases ! Number of trace gases active in RRTMGP - character(len=*),dimension(rrtmgp_nGases), intent(in) :: & + character(len=*),dimension(:), intent(in) :: & active_gases_array ! Character array containing trace gases to include in RRTMGP ! Output @@ -328,7 +328,7 @@ subroutine rrtmgp_sw_gas_optics_run(doSWrad, nCol, nLev, nday, idxday, sw_gas_pr errflg ! CCPP error code type(ty_optical_props_2str),intent(out) :: & sw_optical_props_clrsky ! RRTMGP DDT: clear-sky shortwave optical properties, spectral (tau,ssa,g) - real(kind_phys), dimension(ncol,sw_gas_props%get_ngpt()), intent(out) :: & + real(kind_phys), dimension(:,:), intent(out) :: & toa_src_sw ! TOA incident spectral flux (W/m2) ! Local variables diff --git a/physics/rrtmgp_sw_rte.F90 b/physics/rrtmgp_sw_rte.F90 index 9719c6e861..2bcfe4fd06 100644 --- a/physics/rrtmgp_sw_rte.F90 +++ b/physics/rrtmgp_sw_rte.F90 @@ -42,14 +42,14 @@ subroutine rrtmgp_sw_rte_run(doSWrad, doSWclrsky, nCol, nLev, nDay, idxday, cosz nCol, & ! Number of horizontal gridpoints nday, & ! Number of daytime points nLev ! Number of vertical levels - integer, intent(in), dimension(ncol) :: & + integer, intent(in), dimension(:) :: & idxday ! Index array for daytime points - real(kind_phys),intent(in), dimension(ncol) :: & + real(kind_phys),intent(in), dimension(:) :: & coszen ! Cosize of SZA - real(kind_phys), dimension(ncol,NLev), intent(in) :: & + real(kind_phys), dimension(:,:), intent(in) :: & p_lay, & ! Pressure @ model layer-centers (Pa) t_lay ! Temperature (K) - real(kind_phys), dimension(ncol,NLev+1), intent(in) :: & + real(kind_phys), dimension(:,:), intent(in) :: & p_lev ! Pressure @ model layer-interfaces (Pa) type(ty_gas_optics_rrtmgp),intent(in) :: & sw_gas_props ! RRTMGP DDT: SW spectral information @@ -58,16 +58,16 @@ subroutine rrtmgp_sw_rte_run(doSWrad, doSWclrsky, nCol, nLev, nDay, idxday, cosz type(ty_optical_props_2str),intent(in) :: & sw_optical_props_clouds, & ! RRTMGP DDT: shortwave cloud radiative properties sw_optical_props_aerosol ! RRTMGP DDT: shortwave aerosol radiative properties - real(kind_phys), dimension(sw_gas_props%get_nband(),ncol), intent(in) :: & + real(kind_phys), dimension(:,:), intent(in) :: & sfc_alb_nir_dir, & ! Surface albedo (direct) sfc_alb_nir_dif, & ! Surface albedo (diffuse) sfc_alb_uvvis_dir, & ! Surface albedo (direct) sfc_alb_uvvis_dif ! Surface albedo (diffuse) - real(kind_phys), dimension(ncol,sw_gas_props%get_ngpt()), intent(in) :: & + real(kind_phys), dimension(:,:), intent(in) :: & toa_src_sw ! TOA incident spectral flux (W/m2) integer, intent(in) :: & rrtmgp_nGases ! Number of trace gases active in RRTMGP - character(len=*),dimension(rrtmgp_nGases), intent(in) :: & + character(len=*),dimension(:), intent(in) :: & active_gases_array ! Character array containing trace gases to include in RRTMGP ! Outputs @@ -75,14 +75,14 @@ subroutine rrtmgp_sw_rte_run(doSWrad, doSWclrsky, nCol, nLev, nDay, idxday, cosz errmsg ! CCPP error message integer, intent(out) :: & errflg ! CCPP error flag - real(kind_phys), dimension(ncol,NLev+1), intent(inout) :: & + real(kind_phys), dimension(:,:), intent(inout) :: & fluxswUP_allsky, & ! RRTMGP upward all-sky flux profiles (W/m2) fluxswDOWN_allsky, & ! RRTMGP downward all-sky flux profiles (W/m2) fluxswUP_clrsky, & ! RRTMGP upward clear-sky flux profiles (W/m2) fluxswDOWN_clrsky ! RRTMGP downward clear-sky flux profiles (W/m2) ! Outputs (optional) - type(cmpfsw_type), dimension(ncol), intent(inout),optional :: & + type(cmpfsw_type), dimension(:), intent(inout),optional :: & scmpsw ! 2D surface fluxes, components: ! uvbfc - total sky downward uv-b flux (W/m2) ! uvbf0 - clear sky downward uv-b flux (W/m2) diff --git a/physics/samfdeepcnv.f b/physics/samfdeepcnv.f index 67576af155..d67ebb718b 100644 --- a/physics/samfdeepcnv.f +++ b/physics/samfdeepcnv.f @@ -87,29 +87,29 @@ subroutine samfdeepcnv_run (im,km,itc,ntc,cliq,cp,cvap, & implicit none ! integer, intent(in) :: im, km, itc, ntc, ntk, ntr, ncloud - integer, intent(in) :: islimsk(im) + integer, intent(in) :: islimsk(:) real(kind=kind_phys), intent(in) :: cliq, cp, cvap, eps, epsm1, & & fv, grav, hvap, rd, rv, t0c real(kind=kind_phys), intent(in) :: delt - real(kind=kind_phys), intent(in) :: psp(im), delp(im,km), & - & prslp(im,km), garea(im), dot(im,km), phil(im,km) + real(kind=kind_phys), intent(in) :: psp(:), delp(:,:), & + & prslp(:,:), garea(:), dot(:,:), phil(:,:) real(kind=kind_phys), dimension(:), intent(in) :: fscav logical, intent(in) :: hwrf_samfdeep real(kind=kind_phys), intent(in) :: nthresh - real(kind=kind_phys), intent(in) :: ca_deep(im) - real(kind=kind_phys), intent(out) :: rainevap(im) + real(kind=kind_phys), intent(in) :: ca_deep(:) + real(kind=kind_phys), intent(out) :: rainevap(:) logical, intent(in) :: do_ca,ca_closure,ca_entr,ca_trigger - integer, intent(inout) :: kcnv(im) + integer, intent(inout) :: kcnv(:) ! DH* TODO - check dimensions of qtr, ntr+2 correct? *DH - real(kind=kind_phys), intent(inout) :: qtr(im,km,ntr+2), & - & q1(im,km), t1(im,km), u1(im,km), v1(im,km), & - & cnvw(im,km), cnvc(im,km) + real(kind=kind_phys), intent(inout) :: qtr(:,:,:), & + & q1(:,:), t1(:,:), u1(:,:), v1(:,:), & + & cnvw(:,:), cnvc(:,:) - integer, intent(out) :: kbot(im), ktop(im) - real(kind=kind_phys), intent(out) :: cldwrk(im), & - & rn(im), & - & ud_mf(im,km),dd_mf(im,km), dt_mf(im,km) + integer, intent(out) :: kbot(:), ktop(:) + real(kind=kind_phys), intent(out) :: cldwrk(:), & + & rn(:), & + & ud_mf(:,:),dd_mf(:,:), dt_mf(:,:) ! GJF* These variables are conditionally allocated depending on whether the ! Morrison-Gettelman microphysics is used, so they must be declared diff --git a/physics/samfshalcnv.f b/physics/samfshalcnv.f index e489628229..9571b55d35 100644 --- a/physics/samfshalcnv.f +++ b/physics/samfshalcnv.f @@ -63,22 +63,22 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, & implicit none ! integer, intent(in) :: im, km, itc, ntc, ntk, ntr, ncloud - integer, intent(in) :: islimsk(im) + integer, intent(in) :: islimsk(:) real(kind=kind_phys), intent(in) :: cliq, cp, cvap, & & eps, epsm1, fv, grav, hvap, rd, rv, t0c real(kind=kind_phys), intent(in) :: delt - real(kind=kind_phys), intent(in) :: psp(im), delp(im,km), & - & prslp(im,km), garea(im), hpbl(im), dot(im,km), phil(im,km) + real(kind=kind_phys), intent(in) :: psp(:), delp(:,:), & + & prslp(:,:), garea(:), hpbl(:), dot(:,:), phil(:,:) ! real(kind=kind_phys), dimension(:), intent(in) :: fscav - integer, intent(inout) :: kcnv(im) + integer, intent(inout) :: kcnv(:) ! DH* TODO - check dimensions of qtr, ntr+2 correct? *DH - real(kind=kind_phys), intent(inout) :: qtr(im,km,ntr+2), & - & q1(im,km), t1(im,km), u1(im,km), v1(im,km) + real(kind=kind_phys), intent(inout) :: qtr(:,:,:), & + & q1(:,:), t1(:,:), u1(:,:), v1(:,:) ! - integer, intent(out) :: kbot(im), ktop(im) - real(kind=kind_phys), intent(out) :: rn(im), & - & cnvw(im,km), cnvc(im,km), ud_mf(im,km), dt_mf(im,km) + integer, intent(out) :: kbot(:), ktop(:) + real(kind=kind_phys), intent(out) :: rn(:), & + & cnvw(:,:), cnvc(:,:), ud_mf(:,:), dt_mf(:,:) ! real(kind=kind_phys), intent(in) :: clam, c0s, c1, & & asolfac, pgcon diff --git a/physics/satmedmfvdif.F b/physics/satmedmfvdif.F index f00fb3776e..69c0bb5371 100644 --- a/physics/satmedmfvdif.F +++ b/physics/satmedmfvdif.F @@ -71,8 +71,8 @@ subroutine satmedmfvdif_run(im,km,ntrac,ntcw,ntiw,ntke, & ! !---------------------------------------------------------------------- integer, intent(in) :: im, km, ntrac, ntcw, ntiw, ntke - integer, intent(in) :: kinver(im) - integer, intent(out) :: kpbl(im) + integer, intent(in) :: kinver(:) + integer, intent(out) :: kpbl(:) ! logical, intent(in) :: ldiag3d, qdiag3d real(kind=kind_phys), intent(inout), dimension(:,:) :: & @@ -81,26 +81,26 @@ subroutine satmedmfvdif_run(im,km,ntrac,ntcw,ntiw,ntke, & real(kind=kind_phys), intent(in) :: grav,rd,cp,rv,hvap,hfus,fv, & & eps,epsm1 real(kind=kind_phys), intent(in) :: delt, xkzm_m, xkzm_h, xkzm_s - real(kind=kind_phys), intent(inout) :: dv(im,km), du(im,km), & - & tdt(im,km), rtg(im,km,ntrac) + real(kind=kind_phys), intent(inout) :: dv(:,:), du(:,:), & + & tdt(:,:), rtg(:,:,:) real(kind=kind_phys), intent(in) :: & - & u1(im,km), v1(im,km), & - & t1(im,km), q1(im,km,ntrac), & - & swh(im,km), hlw(im,km), & - & xmu(im), garea(im), & - & psk(im), rbsoil(im), & - & zorl(im), tsea(im), & - & u10m(im), v10m(im), & - & fm(im), fh(im), & - & evap(im), heat(im), & - & stress(im), spd1(im), & - & prsi(im,km+1), del(im,km), & - & prsl(im,km), prslk(im,km), & - & phii(im,km+1), phil(im,km) + & u1(:,:), v1(:,:), & + & t1(:,:), q1(:,:,:), & + & swh(:,:), hlw(:,:), & + & xmu(:), garea(:), & + & psk(:), rbsoil(:), & + & zorl(:), tsea(:), & + & u10m(:), v10m(:), & + & fm(:), fh(:), & + & evap(:), heat(:), & + & stress(:), spd1(:), & + & prsi(:,:), del(:,:), & + & prsl(:,:), prslk(:,:), & + & phii(:,:), phil(:,:) real(kind=kind_phys), intent(out) :: & - & dusfc(im), dvsfc(im), & - & dtsfc(im), dqsfc(im), & - & hpbl(im) + & dusfc(:), dvsfc(:), & + & dtsfc(:), dqsfc(:), & + & hpbl(:) ! logical, intent(in) :: dspheat character(len=*), intent(out) :: errmsg diff --git a/physics/satmedmfvdifq.F b/physics/satmedmfvdifq.F index f192788fe6..077313761b 100644 --- a/physics/satmedmfvdifq.F +++ b/physics/satmedmfvdifq.F @@ -75,40 +75,40 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntiw,ntke, & ! !---------------------------------------------------------------------- integer, intent(in) :: im, km, ntrac, ntcw, ntiw, ntke, ntoz - integer, intent(in) :: kinver(im) - integer, intent(in) :: islimsk(im) - integer, intent(out) :: kpbl(im) + integer, intent(in) :: kinver(:) + integer, intent(in) :: islimsk(:) + integer, intent(out) :: kpbl(:) logical, intent(in) :: ldiag3d,qdiag3d ! real(kind=kind_phys), intent(in) :: grav,rd,cp,rv,hvap,hfus,fv, & & eps,epsm1 real(kind=kind_phys), intent(in) :: delt, xkzm_m, xkzm_h, xkzm_s real(kind=kind_phys), intent(in) :: dspfac, bl_upfr, bl_dnfr - real(kind=kind_phys), intent(inout) :: dv(im,km), du(im,km), & - & tdt(im,km), rtg(im,km,ntrac) + real(kind=kind_phys), intent(inout) :: dv(:,:), du(:,:), & + & tdt(:,:), rtg(:,:,:) real(kind=kind_phys), intent(in) :: & - & u1(im,km), v1(im,km), & - & t1(im,km), q1(im,km,ntrac), & - & swh(im,km), hlw(im,km), & - & xmu(im), garea(im), & - & snwdph_lnd(im), & - & psk(im), rbsoil(im), & - & zorl(im), tsea(im), & - & u10m(im), v10m(im), & - & fm(im), fh(im), & - & evap(im), heat(im), & - & stress(im), spd1(im), & - & prsi(im,km+1), del(im,km), & - & prsl(im,km), prslk(im,km), & - & phii(im,km+1), phil(im,km) + & u1(:,:), v1(:,:), & + & t1(:,:), q1(:,:,:), & + & swh(:,:), hlw(:,:), & + & xmu(:), garea(:), & + & snwdph_lnd(:), & + & psk(:), rbsoil(:), & + & zorl(:), tsea(:), & + & u10m(:), v10m(:), & + & fm(:), fh(:), & + & evap(:), heat(:), & + & stress(:), spd1(:), & + & prsi(:,:), del(:,:), & + & prsl(:,:), prslk(:,:), & + & phii(:,:), phil(:,:) real(kind=kind_phys), intent(inout), dimension(:,:) :: & & du3dt(:,:), dv3dt(:,:), & & dt3dt(:,:), dq3dt(:,:), & & do3dt(:,:) real(kind=kind_phys), intent(out) :: & - & dusfc(im), dvsfc(im), & - & dtsfc(im), dqsfc(im), & - & hpbl(im) + & dusfc(:), dvsfc(:), & + & dtsfc(:), dqsfc(:), & + & hpbl(:) ! logical, intent(in) :: dspheat character(len=*), intent(out) :: errmsg diff --git a/physics/sfc_cice.f b/physics/sfc_cice.f index f845f60912..44b3ee2e8d 100644 --- a/physics/sfc_cice.f +++ b/physics/sfc_cice.f @@ -107,14 +107,14 @@ subroutine sfc_cice_run & logical, intent(in) :: cplflx ! real (kind=kind_phys), dimension(im), intent(in) :: u1, v1, & - real (kind=kind_phys), dimension(im), intent(in) :: & + real (kind=kind_phys), dimension(:), intent(in) :: & & t1, q1, cm, ch, prsl1, wind, dqsfc, dtsfc, dusfc, dvsfc &, snowd logical, intent(in) :: flag_cice(im), flag_iter(im) ! --- outputs: - real (kind=kind_phys), dimension(im), intent(inout) :: qsurf, & + real (kind=kind_phys), dimension(:), intent(inout) :: qsurf, & & cmm, chh, evap, hflx, stress &, weasd, snwdph, ep ! diff --git a/physics/sfc_diag.f b/physics/sfc_diag.f index b78c9b2f7c..e91bd0e14e 100644 --- a/physics/sfc_diag.f +++ b/physics/sfc_diag.f @@ -33,10 +33,10 @@ subroutine sfc_diag_run & ! integer, intent(in) :: im real(kind=kind_phys), intent(in) :: grav,cp,eps,epsm1 - real(kind=kind_phys), dimension(im), intent(in) :: & + real(kind=kind_phys), dimension(:), intent(in) :: & & ps, u1, v1, t1, q1, tskin, & & qsurf, prslki, evap, fm, fh, fm10, fh2 - real(kind=kind_phys), dimension(im), intent(out) :: & + real(kind=kind_phys), dimension(:), intent(out) :: & & f10m, u10m, v10m, t2m, q2m character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/sfc_diag_post.F90 b/physics/sfc_diag_post.F90 index 767e98db5c..1bf3e7e676 100644 --- a/physics/sfc_diag_post.F90 +++ b/physics/sfc_diag_post.F90 @@ -26,11 +26,11 @@ subroutine sfc_diag_post_run (im, lsm, lsm_noahmp, dry, lssav, dtf, con_eps, con integer, intent(in) :: im, lsm, lsm_noahmp logical, intent(in) :: lssav real(kind=kind_phys), intent(in) :: dtf, con_eps, con_epsm1 - logical , dimension(im), intent(in) :: dry - real(kind=kind_phys), dimension(im), intent(in) :: pgr, u10m, v10m + logical , dimension(:), intent(in) :: dry + real(kind=kind_phys), dimension(:), intent(in) :: pgr, u10m, v10m real(kind=kind_phys), dimension(:) , intent(in) :: t2mmp, q2mp - real(kind=kind_phys), dimension(im), intent(inout) :: t2m, q2m, tmpmin, tmpmax, spfhmin, spfhmax - real(kind=kind_phys), dimension(im), intent(inout) :: wind10mmax, u10mmax, v10mmax, dpt2m + real(kind=kind_phys), dimension(:), intent(inout) :: t2m, q2m, tmpmin, tmpmax, spfhmin, spfhmax + real(kind=kind_phys), dimension(:), intent(inout) :: wind10mmax, u10mmax, v10mmax, dpt2m character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/sfc_diff.f b/physics/sfc_diff.f index b7ef1ea680..93102e4675 100644 --- a/physics/sfc_diff.f +++ b/physics/sfc_diff.f @@ -90,24 +90,24 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) integer, intent(in) :: im, ivegsrc integer, intent(in) :: sfc_z0_type ! option for calculating surface roughness length over ocean - integer, dimension(im), intent(in) :: vegtype + integer, dimension(:), intent(in) :: vegtype logical, intent(in) :: redrag ! reduced drag coeff. flag for high wind over sea (j.han) - logical, dimension(im), intent(in) :: flag_iter, wet, dry, icy + logical, dimension(:), intent(in) :: flag_iter, wet, dry, icy - real(kind=kind_phys), dimension(im), intent(in) :: u10m,v10m + real(kind=kind_phys), dimension(:), intent(in) :: u10m,v10m real(kind=kind_phys), intent(in) :: rvrdm1, eps, epsm1, grav - real(kind=kind_phys), dimension(im), intent(in) :: & + real(kind=kind_phys), dimension(:), intent(in) :: & & ps,t1,q1,z1,prsl1,prslki,prsik1,prslk1, & & wind,sigmaf,shdmax, & & z0pert,ztpert ! mg, sfc-perts - real(kind=kind_phys), dimension(im), intent(in) :: & + real(kind=kind_phys), dimension(:), intent(in) :: & & tskin_wat, tskin_lnd, tskin_ice, & & tsurf_wat, tsurf_lnd, tsurf_ice, & & snwdph_wat,snwdph_lnd,snwdph_ice - real(kind=kind_phys), dimension(im), intent(in) :: z0rl_wav - real(kind=kind_phys), dimension(im), intent(inout) :: & + real(kind=kind_phys), dimension(:), intent(in) :: z0rl_wav + real(kind=kind_phys), dimension(:), intent(inout) :: & & z0rl_wat, z0rl_lnd, z0rl_ice, & & ustar_wat, ustar_lnd, ustar_ice, & & cm_wat, cm_lnd, cm_ice, & diff --git a/physics/sfc_drv.f b/physics/sfc_drv.f index 5d8e196437..878f08a097 100644 --- a/physics/sfc_drv.f +++ b/physics/sfc_drv.f @@ -211,11 +211,11 @@ subroutine lsm_noah_run & integer, intent(in) :: im, km, isot, ivegsrc real (kind=kind_phys), intent(in) :: grav, cp, hvap, rd, eps, & & epsm1, rvrdm1 - real (kind=kind_phys), dimension(5), intent(in) :: pertvegf + real (kind=kind_phys), dimension(:), intent(in) :: pertvegf - integer, dimension(im), intent(in) :: soiltyp, vegtype, slopetyp + integer, dimension(:), intent(in) :: soiltyp, vegtype, slopetyp - real (kind=kind_phys), dimension(im), intent(in) :: ps, & + real (kind=kind_phys), dimension(:), intent(in) :: ps, & & t1, q1, sigmaf, sfcemis, dlwflx, dswsfc, snet, tg3, cm, & & ch, prsl1, prslki, wind, shdmin, shdmax, & & snoalb, sfalb, zf, & @@ -223,19 +223,19 @@ subroutine lsm_noah_run & real (kind=kind_phys), intent(in) :: delt - logical, dimension(im), intent(in) :: flag_iter, flag_guess, land + logical, dimension(:), intent(in) :: flag_iter, flag_guess, land logical, intent(in) :: lheatstrg ! --- in/out: - real (kind=kind_phys), dimension(im), intent(inout) :: weasd, & + real (kind=kind_phys), dimension(:), intent(inout) :: weasd, & & snwdph, tskin, tprcp, srflag, canopy, trans, tsurf, zorl - real (kind=kind_phys), dimension(im,km), intent(inout) :: & + real (kind=kind_phys), dimension(:,:), intent(inout) :: & & smc, stc, slc ! --- output: - real (kind=kind_phys), dimension(im), intent(inout) :: sncovr1, & + real (kind=kind_phys), dimension(:), intent(inout) :: sncovr1, & & qsurf, gflux, drain, evap, hflx, ep, runoff, cmm, chh, & & evbs, evcw, sbsno, snowc, stm, snohf, smcwlt2, smcref2, & & wet1 diff --git a/physics/sfc_drv_ruc.F90 b/physics/sfc_drv_ruc.F90 index 65935ef1c9..ff727773cd 100644 --- a/physics/sfc_drv_ruc.F90 +++ b/physics/sfc_drv_ruc.F90 @@ -168,9 +168,9 @@ subroutine lsm_ruc_run & ! inputs integer, intent(in) :: lsm_ruc, lsm integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson - real (kind=kind_phys), dimension(im,lsoil), intent(inout) :: smc,stc,slc + real (kind=kind_phys), dimension(:,:), intent(inout) :: smc,stc,slc - real (kind=kind_phys), dimension(im), intent(in) :: & + real (kind=kind_phys), dimension(:), intent(in) :: & & t1, sigmaf, sfcemis, dlwflx, dswsfc, snet, tg3, cm, & & ch, prsl1, wind, shdmin, shdmax, & & snoalb, alvwf, alnwf, zf, qc, q1 @@ -182,30 +182,30 @@ subroutine lsm_ruc_run & ! inputs con_pi, con_rd, & con_hvap, con_fvirt - logical, dimension(im), intent(in) :: flag_iter, flag_guess, land - integer, dimension(im), intent(in) :: islimsk ! sea/land/ice mask (=0/1/2) + logical, dimension(:), intent(in) :: flag_iter, flag_guess, land + integer, dimension(:), intent(in) :: islimsk ! sea/land/ice mask (=0/1/2) logical, intent(in) :: do_mynnsfclay logical, intent(in) :: rdlai ! --- in/out: - integer, dimension(im), intent(inout) :: soiltyp, vegtype + integer, dimension(:), intent(inout) :: soiltyp, vegtype real (kind=kind_phys), dimension(lsoil_ruc) :: dzs - real (kind=kind_phys), dimension(lsoil_ruc), intent(inout ) :: zs - real (kind=kind_phys), dimension(im), intent(inout) :: weasd, & + real (kind=kind_phys), dimension(:), intent(inout ) :: zs + real (kind=kind_phys), dimension(:), intent(inout) :: weasd, & & snwdph, tskin, tskin_wat, & & srflag, canopy, trans, tsurf, zorl, tsnow, & & sfcqc, sfcqv, sfcdew, fice, tice, sfalb, smcwlt2, smcref2 ! --- in - real (kind=kind_phys), dimension(im), intent(in) :: & + real (kind=kind_phys), dimension(:), intent(in) :: & & rainnc, rainc, ice, snow, graupel ! --- in/out: ! --- on RUC levels - real (kind=kind_phys), dimension(im,lsoil_ruc), intent(inout) :: & + real (kind=kind_phys), dimension(:,:), intent(inout) :: & & smois, tslb, sh2o, keepfr, smfrkeep ! --- output: - real (kind=kind_phys), dimension(im), intent(inout) :: sncovr1, & + real (kind=kind_phys), dimension(:), intent(inout) :: sncovr1, & & qsurf , gflux , evap , runof , drain , & & runoff, srunoff, hflx, cmm, chh, & & rhosnf, evbs, evcw, sbsno, stm, wetness, & @@ -1053,25 +1053,25 @@ subroutine rucinit (restart, im, lsoil_ruc, lsoil, nlev, & ! in integer, intent(in ) :: im, nlev integer, intent(in ) :: lsoil_ruc integer, intent(in ) :: lsoil - logical, dimension(im), intent(in ) :: land - real (kind=kind_phys), dimension(im), intent(in ) :: tsurf, tsurf_wat - real (kind=kind_phys), dimension(im), intent(inout) :: smcref2 - real (kind=kind_phys), dimension(im), intent(inout) :: smcwlt2 - real (kind=kind_phys), dimension(im), intent(in ) :: tg3 - real (kind=kind_phys), dimension(im,lsoil), intent(in ) :: smc ! Noah - real (kind=kind_phys), dimension(im,lsoil), intent(in ) :: stc ! Noah - real (kind=kind_phys), dimension(im,lsoil), intent(in ) :: slc ! Noah - - integer, dimension(im), intent(inout) :: soiltyp - integer, dimension(im), intent(inout) :: vegtype - real (kind=kind_phys), dimension(im), intent(inout) :: wetness - real (kind=kind_phys), dimension(im), intent(inout) :: fice - real (kind=kind_phys), dimension(im,lsoil_ruc), intent(inout) :: smois! ruc - real (kind=kind_phys), dimension(im,lsoil_ruc), intent(inout) :: tslb ! ruc - real (kind=kind_phys), dimension(im,lsoil_ruc), intent(inout) :: sh2o ! ruc - real (kind=kind_phys), dimension(im,lsoil_ruc), intent(inout) :: smfrkeep ! ruc - - real (kind=kind_phys), dimension(1:lsoil_ruc), intent (out) :: zs + logical, dimension(:), intent(in ) :: land + real (kind=kind_phys), dimension(:), intent(in ) :: tsurf, tsurf_wat + real (kind=kind_phys), dimension(:), intent(inout) :: smcref2 + real (kind=kind_phys), dimension(:), intent(inout) :: smcwlt2 + real (kind=kind_phys), dimension(:), intent(in ) :: tg3 + real (kind=kind_phys), dimension(:,:), intent(in ) :: smc ! Noah + real (kind=kind_phys), dimension(:,:), intent(in ) :: stc ! Noah + real (kind=kind_phys), dimension(:,:), intent(in ) :: slc ! Noah + + integer, dimension(:), intent(inout) :: soiltyp + integer, dimension(:), intent(inout) :: vegtype + real (kind=kind_phys), dimension(:), intent(inout) :: wetness + real (kind=kind_phys), dimension(:), intent(inout) :: fice + real (kind=kind_phys), dimension(:,:), intent(inout) :: smois! ruc + real (kind=kind_phys), dimension(:,:), intent(inout) :: tslb ! ruc + real (kind=kind_phys), dimension(:,:), intent(inout) :: sh2o ! ruc + real (kind=kind_phys), dimension(:,:), intent(inout) :: smfrkeep ! ruc + + real (kind=kind_phys), dimension(:), intent (out) :: zs integer, intent(in ) :: me integer, intent(in ) :: master diff --git a/physics/sfc_noahmp_drv.f b/physics/sfc_noahmp_drv.f index bdba632bf9..f2c5809091 100644 --- a/physics/sfc_noahmp_drv.f +++ b/physics/sfc_noahmp_drv.f @@ -142,17 +142,17 @@ subroutine noahmpdrv_run & integer, intent(in) :: im, km, itime - integer, dimension(im), intent(in) :: soiltyp, vegtype, slopetyp + integer, dimension(:), intent(in) :: soiltyp, vegtype, slopetyp - real (kind=kind_phys), dimension(im), intent(in) :: ps, u1, v1, & + real (kind=kind_phys), dimension(:), intent(in) :: ps, u1, v1, & & t1, q1, sigmaf, sfcemis, dlwflx, dswsfc, snet, tg3, cm, & & ch, prsl1, prslki, wind, shdmin, shdmax, & & snoalb, sfalb, zf, & & rainn_mp,rainc_mp,snow_mp,graupel_mp,ice_mp - logical, dimension(im), intent(in) :: dry + logical, dimension(:), intent(in) :: dry - real (kind=kind_phys),dimension(im),intent(in) :: xlatin,xcoszin + real (kind=kind_phys),dimension(:),intent(in) :: xlatin,xcoszin integer, intent(in) :: idveg, iopt_crs,iopt_btr,iopt_run, & & iopt_sfc,iopt_frz,iopt_inf,iopt_rad, & @@ -170,24 +170,24 @@ subroutine noahmpdrv_run & & con_rd, con_hfus ! --- in/out: - real (kind=kind_phys), dimension(im), intent(inout) :: weasd, & + real (kind=kind_phys), dimension(:), intent(inout) :: weasd, & & snwdph, tskin, tprcp, srflag, canopy, trans, tsurf, zorl - real (kind=kind_phys), dimension(im,km), intent(inout) :: & + real (kind=kind_phys), dimension(:,:), intent(inout) :: & & smc, stc, slc - real (kind=kind_phys), dimension(im), intent(inout) :: snowxy, & + real (kind=kind_phys), dimension(:), intent(inout) :: snowxy, & & tvxy,tgxy,canicexy,canliqxy,eahxy,tahxy, & & cmxy,chxy,fwetxy,sneqvoxy,alboldxy,qsnowxy, & & wslakexy,zwtxy,waxy,wtxy,lfmassxy,rtmassxy, & & stmassxy,woodxy,stblcpxy,fastcpxy,xlaixy, & & xsaixy,taussxy,smcwtdxy,deeprechxy,rechxy - real (kind=kind_phys),dimension(im,-2:0),intent(inout) :: tsnoxy - real (kind=kind_phys),dimension(im,-2:0),intent(inout) :: snicexy - real (kind=kind_phys),dimension(im,-2:0),intent(inout) :: snliqxy - real (kind=kind_phys),dimension(im,1:4), intent(inout) :: smoiseq - real (kind=kind_phys),dimension(im,-2:4),intent(inout) :: zsnsoxy + real (kind=kind_phys),dimension(:,:),intent(inout) :: tsnoxy + real (kind=kind_phys),dimension(:,:),intent(inout) :: snicexy + real (kind=kind_phys),dimension(:,:),intent(inout) :: snliqxy + real (kind=kind_phys),dimension(:,:), intent(inout) :: smoiseq + real (kind=kind_phys),dimension(:,:),intent(inout) :: zsnsoxy integer, dimension(im) :: jsnowxy real (kind=kind_phys),dimension(im) :: snodep @@ -195,7 +195,7 @@ subroutine noahmpdrv_run & ! --- output: - real (kind=kind_phys), dimension(im), intent(out) :: sncovr1, & + real (kind=kind_phys), dimension(:), intent(out) :: sncovr1, & & qsurf, gflux, drain, evap, hflx, ep, runoff, cmm, chh, & & evbs, evcw, sbsno, snowc, stm, snohf, smcwlt2, smcref2, wet1 real (kind=kind_phys), dimension(:), intent(out) :: t2mmp, q2mp diff --git a/physics/sfc_nst.f b/physics/sfc_nst.f index 5920f375ca..0e6872cc0d 100644 --- a/physics/sfc_nst.f +++ b/physics/sfc_nst.f @@ -190,25 +190,25 @@ subroutine sfc_nst_run & & nstf_name5 real (kind=kind_phys), intent(in) :: hvap, cp, hfus, jcal, eps, & & epsm1, rvrdm1, rd, rhw0, sbc, pi - real (kind=kind_phys), dimension(im), intent(in) :: ps, u1, v1, & + real (kind=kind_phys), dimension(:), intent(in) :: ps, u1, v1, & & t1, q1, tref, cm, ch, prsl1, prslki, prsik1, prslk1, & & xlon,xcosz, & & sinlat, stress, sfcemis, dlwflx, sfcnsw, rain, wind real (kind=kind_phys), intent(in) :: timestep real (kind=kind_phys), intent(in) :: solhr - logical, dimension(im), intent(in) :: flag_iter, flag_guess, wet + logical, dimension(:), intent(in) :: flag_iter, flag_guess, wet ! &, icy logical, intent(in) :: lprnt ! --- input/outputs: ! control variables of dtl system (5+2) and sl (2) and coefficients for d(tz)/d(ts) calculation - real (kind=kind_phys), dimension(im), intent(inout) :: tskin, & + real (kind=kind_phys), dimension(:), intent(inout) :: tskin, & & tsurf, xt, xs, xu, xv, xz, zm, xtts, xzts, dt_cool, & & z_c, c_0, c_d, w_0, w_d, d_conv, ifd, qrain ! --- outputs: - real (kind=kind_phys), dimension(im), intent(inout) :: & + real (kind=kind_phys), dimension(:), intent(inout) :: & & qsurf, gflux, cmm, chh, evap, hflx, ep character(len=*), intent(out) :: errmsg @@ -687,13 +687,13 @@ subroutine sfc_nst_pre_run ! --- inputs: integer, intent(in) :: im, nthreads - logical, dimension(im), intent(in) :: wet - real (kind=kind_phys), dimension(im), intent(in) :: + logical, dimension(:), intent(in) :: wet + real (kind=kind_phys), dimension(:), intent(in) :: & tsfc_wat, xt, xz, dt_cool, z_c, oceanfrac logical, intent(in) :: cplflx ! --- input/outputs: - real (kind=kind_phys), dimension(im), intent(inout) :: + real (kind=kind_phys), dimension(:), intent(inout) :: & tsurf_wat, tseal, tref ! --- outputs: diff --git a/physics/sfc_ocean.F b/physics/sfc_ocean.F index 20c8cdf026..f6e511a891 100644 --- a/physics/sfc_ocean.F +++ b/physics/sfc_ocean.F @@ -103,13 +103,13 @@ subroutine sfc_ocean_run & integer, intent(in) :: im real (kind=kind_phys), intent(in) :: rd, eps, epsm1, rvrdm1 - real (kind=kind_phys), dimension(im), intent(in) :: ps, & + real (kind=kind_phys), dimension(:), intent(in) :: ps, & & t1, q1, tskin, cm, ch, prsl1, prslki, wind - logical, dimension(im), intent(in) :: flag_iter, wet, lake + logical, dimension(:), intent(in) :: flag_iter, wet, lake ! --- outputs: - real (kind=kind_phys), dimension(im), intent(inout) :: qsurf, & + real (kind=kind_phys), dimension(:), intent(inout) :: qsurf, & & cmm, chh, gflux, evap, hflx, ep character(len=*), intent(out) :: errmsg diff --git a/physics/sfc_sice.f b/physics/sfc_sice.f index ab67f849e6..c18fd9d014 100644 --- a/physics/sfc_sice.f +++ b/physics/sfc_sice.f @@ -157,25 +157,25 @@ subroutine sfc_sice_run & real (kind=kind_phys), intent(in) :: sbc, hvap, tgice, cp, eps, & & epsm1, grav, rvrdm1, t0c, rd - real (kind=kind_phys), dimension(im), intent(in) :: ps, & + real (kind=kind_phys), dimension(:), intent(in) :: ps, & & t1, q1, sfcemis, dlwflx, sfcnsw, sfcdsw, srflag, cm, ch, & & prsl1, prslki, prsik1, prslk1, wind, oceanfrac ! integer, dimension(im), intent(in) :: islimsk - integer, dimension(im), intent(in) :: islmsk_cice + integer, dimension(:), intent(in) :: islmsk_cice real (kind=kind_phys), intent(in) :: delt, min_seaice, & & min_lakeice - logical, dimension(im), intent(in) :: flag_iter, icy + logical, dimension(:), intent(in) :: flag_iter, icy ! --- input/outputs: - real (kind=kind_phys), dimension(im), intent(inout) :: hice, & + real (kind=kind_phys), dimension(:), intent(inout) :: hice, & & fice, tice, weasd, tskin, tprcp, ep - real (kind=kind_phys), dimension(im,kice), intent(inout) :: tiice + real (kind=kind_phys), dimension(:,:), intent(inout) :: tiice ! --- outputs: - real (kind=kind_phys), dimension(im), intent(inout) :: snwdph, & + real (kind=kind_phys), dimension(:), intent(inout) :: snwdph, & & qsurf, snowmt, gflux, cmm, chh, evap, hflx character(len=*), intent(out) :: errmsg diff --git a/physics/shinhongvdif.F90 b/physics/shinhongvdif.F90 index 83270a08d9..da9c0892f1 100644 --- a/physics/shinhongvdif.F90 +++ b/physics/shinhongvdif.F90 @@ -107,7 +107,7 @@ subroutine shinhongvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & integer, intent(in ) :: im,km,ntrac,ndiff,ntcw,ntiw real(kind=kind_phys), intent(in ) :: g,cp,rd,rv,ep1,ep2,xlv,dt ! 3D in - real(kind=kind_phys), dimension(im, km) , & + real(kind=kind_phys), dimension(:,:) , & intent(in ) :: phil, & pi2d, & p2d, & @@ -117,21 +117,21 @@ subroutine shinhongvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & real(kind=kind_phys), dimension( im, km, ntrac ) , & intent(in ) :: qx - real(kind=kind_phys), dimension( im, km+1 ) , & + real(kind=kind_phys), dimension( :,: ) , & intent(in ) :: p2di, & phii ! 3D in&out - real(kind=kind_phys), dimension(im, km) , & + real(kind=kind_phys), dimension(:,:) , & intent(inout) :: utnp, & vtnp, & ttnp - real(kind=kind_phys), dimension(im, km, ntrac ) , & + real(kind=kind_phys), dimension(:,:, : ) , & intent(inout) :: qtnp ! 2D in - integer, dimension(im) , & + integer, dimension(:) , & intent(in ) :: landmask - real(kind=kind_phys), dimension(im) , & + real(kind=kind_phys), dimension(:) , & intent(in ) :: heat, & evap, & br, & @@ -145,10 +145,10 @@ subroutine shinhongvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & v10, & dx ! 2D: out - integer, dimension(im) , & + integer, dimension(:) , & intent(out ) :: kpbl1d - real(kind=kind_phys), dimension(im) , & + real(kind=kind_phys), dimension(:) , & intent(out ) :: hpbl, & dusfc, & dvsfc, & @@ -1435,13 +1435,13 @@ subroutine tridin_ysu(cl,cm,cu,r2,au,f2,its,ite,kts,kte,nt) ! real(kind=kind_phys), dimension( its:ite, kts:kte ) , & intent(in ) :: cm - real(kind=kind_phys), dimension( its:ite, kts:kte,nt ) , & + real(kind=kind_phys), dimension( its:ite, kts:kte,nt) , & intent(in ) :: r2 ! real(kind=kind_phys), dimension( its:ite, kts:kte ) , & intent(inout) :: au, & cu - real(kind=kind_phys), dimension( its:ite, kts:kte,nt ) , & + real(kind=kind_phys), dimension( its:ite, kts:kte,nt) , & intent(inout) :: f2 ! real(kind=kind_phys) :: fk @@ -1582,7 +1582,7 @@ subroutine mixlen(lmh,u,v,t,the,q,cwm,q2,z,ustar,corf,epshol, & qol2st,qol2un,qdzl,rdz,sq,srel,szq,tem,thm,vkrmz,rlambda, & rlb,rln,f real(kind=kind_phys) :: ckp - real(kind=kind_phys), dimension( kts:kte ) :: q1, & + real(kind=kind_phys), dimension( kts:kte ) :: q1, & en2 real(kind=kind_phys), dimension( kts+1:kte ) :: dth, & elm, & @@ -1748,12 +1748,12 @@ subroutine prodq2(lmh,dtturbl,ustar,s2,ri,q2,el,z,akm,akh, & ! logical, intent(in ) :: pblflg ! - real(kind=kind_phys), dimension( kts:kte ) , & + real(kind=kind_phys), dimension( : ) , & intent(in ) :: uxk, & vxk, & thxk, & thvxk - real(kind=kind_phys), dimension( kts+1:kte ) , & + real(kind=kind_phys), dimension( : ) , & intent(in ) :: s2, & ri, & akm, & @@ -1764,10 +1764,10 @@ subroutine prodq2(lmh,dtturbl,ustar,s2,ri,q2,el,z,akm,akh, & vfxpbl, & qfxpbl ! - real(kind=kind_phys), dimension( kts:kte+1 ) , & + real(kind=kind_phys), dimension( : ) , & intent(in ) :: z ! - real(kind=kind_phys), dimension( kts:kte ) , & + real(kind=kind_phys), dimension( : ) , & intent(inout) :: q2 ! ! local vars @@ -1855,16 +1855,16 @@ subroutine vdifq(lmh,dtdif,q2,el,z, & ! logical, intent(in ) :: pblflg ! - real(kind=kind_phys), dimension( kts:kte ) , & + real(kind=kind_phys), dimension( : ) , & intent(in ) :: hgame, & ptke1 - real(kind=kind_phys), dimension( kts+1:kte ) , & + real(kind=kind_phys), dimension( : ) , & intent(in ) :: el, & akhk - real(kind=kind_phys), dimension( kts:kte+1 ) , & + real(kind=kind_phys), dimension( : ) , & intent(in ) :: z ! - real(kind=kind_phys), dimension( kts:kte ) , & + real(kind=kind_phys), dimension( : ) , & intent(inout) :: q2 ! ! local vars diff --git a/physics/ysuvdif.F90 b/physics/ysuvdif.F90 index 51ed599f02..420dfb7f43 100644 --- a/physics/ysuvdif.F90 +++ b/physics/ysuvdif.F90 @@ -62,33 +62,33 @@ subroutine ysuvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & integer, intent(in ) :: im,km,ntrac,ndiff,ntcw,ntiw real(kind=kind_phys), intent(in ) :: g,cp,rd,rv,ep1,ep2,xlv,dt - real(kind=kind_phys), dimension( im,km ), & + real(kind=kind_phys), dimension( :,: ), & intent(in) :: pi2d,p2d,phil,ux,vx,swh,hlw,tx - real(kind=kind_phys), dimension( im,km,ntrac ) , & + real(kind=kind_phys), dimension( :,:,: ) , & intent(in ) :: qx - real(kind=kind_phys), dimension( im, km+1 ) , & + real(kind=kind_phys), dimension( :,: ) , & intent(in ) :: p2di,phii - real(kind=kind_phys), dimension( im ) , & + real(kind=kind_phys), dimension( : ) , & intent(in) :: stress,zorl,heat,evap,wspd,br,psim,psih,psfcpa, & u10,v10,xmu - integer, dimension(im) ,& + integer, dimension(:) ,& intent(in ) :: landmask ! !---------------------------------------------------------------------------------- ! input/output variables ! - real(kind=kind_phys), dimension( im,km ) , & + real(kind=kind_phys), dimension( :,: ) , & intent(inout) :: utnp,vtnp,ttnp - real(kind=kind_phys), dimension( im,km,ntrac ) , & + real(kind=kind_phys), dimension( :,:,: ) , & intent(inout) :: qtnp ! !--------------------------------------------------------------------------------- ! output variables - integer, dimension( im ), intent(out ) :: kpbl1d - real(kind=kind_phys), dimension( im ), & + integer, dimension( : ), intent(out ) :: kpbl1d + real(kind=kind_phys), dimension( : ), & intent(out) :: hpbl ! error messages From 18701332738ea452354eb2d25ab4ffefbb7d5d90 Mon Sep 17 00:00:00 2001 From: XiaSun-NOAA Date: Mon, 24 Aug 2020 21:56:28 +0000 Subject: [PATCH 02/25] delete personal experimental files --- physics/gfdl_fv_sat_adj.F90_assumedsizes | 1431 ------- physics/gitdiff | 4397 ---------------------- 2 files changed, 5828 deletions(-) delete mode 100644 physics/gfdl_fv_sat_adj.F90_assumedsizes delete mode 100644 physics/gitdiff diff --git a/physics/gfdl_fv_sat_adj.F90_assumedsizes b/physics/gfdl_fv_sat_adj.F90_assumedsizes deleted file mode 100644 index c48a5d2e8e..0000000000 --- a/physics/gfdl_fv_sat_adj.F90_assumedsizes +++ /dev/null @@ -1,1431 +0,0 @@ -!>\file gfdl_fv_sat_adj.F90 -!! This file contains the GFDL in-core fast saturation adjustment. -!! and it is an "intermediate physics" implemented in the remapping Lagrangian to -!! Eulerian loop of FV3 solver. -!*********************************************************************** -!* GNU Lesser General Public License -!* -!* This file is part of the GFDL Cloud Microphysics. -!* -!* The GFDL Cloud Microphysics is free software: you can -!8 redistribute it and/or modify it under the terms of the -!* GNU Lesser General Public License as published by the -!* Free Software Foundation, either version 3 of the License, or -!* (at your option) any later version. -!* -!* The GFDL Cloud Microphysics is distributed in the hope it will be -!* useful, but WITHOUT ANYWARRANTY; without even the implied warranty -!* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -!* See the GNU General Public License for more details. -!* -!* You should have received a copy of the GNU Lesser General Public -!* License along with the GFDL Cloud Microphysics. -!* If not, see . -!*********************************************************************** - -!> This module contains the GFDL in-core fast saturation adjustment -!! called in FV3 dynamics solver. -module fv_sat_adj -! Modules Included: -! -! -! -! -! -! -! -! -! -! -! -! -! -! -! -! -! -! -! -! -! -! -!
Module NameFunctions Included
constants_modrvgas, rdgas, grav, hlv, hlf, cp_air
fv_arrays_mod r_grid
fv_mp_modis_master
gfdl_cloud_microphys_modql_gen, qi_gen, qi0_max, ql_mlt, ql0_max, qi_lim, qs_mlt, -! tau_r2g, tau_smlt, tau_i2s, tau_v2l, tau_l2v, tau_imlt, tau_l2r, -! rad_rain, rad_snow, rad_graupel, dw_ocean, dw_land, tintqs
- ! DH* TODO - MAKE THIS INPUT ARGUMENTS *DH - use physcons, only : rdgas => con_rd_dyn, & - rvgas => con_rv_dyn, & - grav => con_g_dyn, & - hlv => con_hvap_dyn, & - hlf => con_hfus_dyn, & - cp_air => con_cp_dyn - ! *DH - use machine, only: kind_grid, kind_dyn - use gfdl_cloud_microphys_mod, only: ql_gen, qi_gen, qi0_max, ql_mlt, ql0_max, qi_lim, qs_mlt - use gfdl_cloud_microphys_mod, only: icloud_f, sat_adj0, t_sub, cld_min - use gfdl_cloud_microphys_mod, only: tau_r2g, tau_smlt, tau_i2s, tau_v2l, tau_l2v, tau_imlt, tau_l2r - use gfdl_cloud_microphys_mod, only: rad_rain, rad_snow, rad_graupel, dw_ocean, dw_land, tintqs -#ifdef MULTI_GASES - use ccpp_multi_gases_mod, only: multi_gases_init, & - multi_gases_finalize, & - virq_qpz, vicpqd_qpz, & - vicvqd_qpz, num_gas -#endif - - implicit none - - private - - public fv_sat_adj_init, fv_sat_adj_run, fv_sat_adj_finalize - - logical :: is_initialized = .false. - - real(kind=kind_dyn), parameter :: rrg = -rdgas/grav - ! real, parameter :: cp_air = cp_air ! 1004.6, heat capacity of dry air at constant pressure, come from constants_mod - real(kind=kind_dyn), parameter :: cp_vap = 4.0 * rvgas !< 1846.0, heat capacity of water vapor at constant pressure - real(kind=kind_dyn), parameter :: cv_air = cp_air - rdgas !< 717.55, heat capacity of dry air at constant volume - real(kind=kind_dyn), parameter :: cv_vap = 3.0 * rvgas !< 1384.5, heat capacity of water vapor at constant volume - ! http: / / www.engineeringtoolbox.com / ice - thermal - properties - d_576.html - ! c_ice = 2050.0 at 0 deg c - ! c_ice = 1972.0 at - 15 deg c - ! c_ice = 1818.0 at - 40 deg c - ! http: / / www.engineeringtoolbox.com / water - thermal - properties - d_162.html - ! c_liq = 4205.0 at 4 deg c - ! c_liq = 4185.5 at 15 deg c - ! c_liq = 4178.0 at 30 deg c - ! real, parameter :: c_ice = 2106.0 ! ifs: heat capacity of ice at 0 deg c - ! real, parameter :: c_liq = 4218.0 ! ifs: heat capacity of liquid at 0 deg c - real(kind=kind_dyn), parameter :: c_ice = 1972.0 !< gfdl: heat capacity of ice at - 15 deg c - real(kind=kind_dyn), parameter :: c_liq = 4185.5 !< gfdl: heat capacity of liquid at 15 deg c - real(kind=kind_dyn), parameter :: dc_vap = cp_vap - c_liq !< - 2339.5, isobaric heating / cooling - real(kind=kind_dyn), parameter :: dc_ice = c_liq - c_ice !< 2213.5, isobaric heating / colling - real(kind=kind_dyn), parameter :: tice = 273.16 !< freezing temperature - real(kind=kind_dyn), parameter :: t_wfr = tice - 40. !< homogeneous freezing temperature - real(kind=kind_dyn), parameter :: lv0 = hlv - dc_vap * tice !< 3.13905782e6, evaporation latent heat coefficient at 0 deg k - real(kind=kind_dyn), parameter :: li00 = hlf - dc_ice * tice !< - 2.7105966e5, fusion latent heat coefficient at 0 deg k - ! real (kind_grid), parameter :: e00 = 610.71 ! gfdl: saturation vapor pressure at 0 deg c - real (kind_grid), parameter :: e00 = 611.21 !< ifs: saturation vapor pressure at 0 deg c - real (kind_grid), parameter :: d2ice = dc_vap + dc_ice !< - 126, isobaric heating / cooling - real (kind_grid), parameter :: li2 = lv0 + li00 !< 2.86799816e6, sublimation latent heat coefficient at 0 deg k - real(kind=kind_dyn), parameter :: lat2 = (hlv + hlf) ** 2 !< used in bigg mechanism - real(kind=kind_dyn) :: d0_vap !< the same as dc_vap, except that cp_vap can be cp_vap or cv_vap - real(kind=kind_dyn) :: lv00 !< the same as lv0, except that cp_vap can be cp_vap or cv_vap - real(kind=kind_dyn), allocatable :: table (:), table2 (:), tablew (:), des2 (:), desw (:) - -contains - -!>\brief The subroutine 'fv_sat_adj_init' initializes lookup tables for the saturation mixing ratio. -!! \section arg_table_fv_sat_adj_init Argument Table -!! \htmlinclude fv_sat_adj_init.html -!! -subroutine fv_sat_adj_init(do_sat_adj, kmp, nwat, ngas, rilist, cpilist, & - mpirank, mpiroot, errmsg, errflg) - - implicit none - - ! Interface variables - logical, intent(in ) :: do_sat_adj - integer, intent(in ) :: kmp - integer, intent(in ) :: nwat - integer, intent(in ) :: ngas - real(kind_dyn), intent(in ) :: rilist(:) - real(kind_dyn), intent(in ) :: cpilist(:) - integer, intent(in ) :: mpirank - integer, intent(in ) :: mpiroot - character(len=*), intent( out) :: errmsg - integer, intent( out) :: errflg - - ! Local variables - integer, parameter :: length = 2621 - integer :: i - - ! Initialize the CCPP error handling variables - errmsg = '' - errflg = 0 - - ! If saturation adjustment is not used, return immediately - if (.not.do_sat_adj) then - write(errmsg,'(a)') 'Logic error: fv_sat_adj_init is called but do_sat_adj is set to false' - errflg = 1 - return - end if - - if (.not.nwat==6) then - write(errmsg,'(a)') 'Logic error: fv_sat_adj requires six water species (nwat=6)' - errflg = 1 - return - end if - - if (is_initialized) return - - ! generate es table (dt = 0.1 deg c) - - allocate (table (length)) - allocate (table2 (length)) - allocate (tablew (length)) - allocate (des2 (length)) - allocate (desw (length)) - - call qs_table (length) - call qs_table2 (length) - call qs_tablew (length) - - do i = 1, length - 1 - des2 (i) = max (0., table2 (i + 1) - table2 (i)) - desw (i) = max (0., tablew (i + 1) - tablew (i)) - enddo - des2 (length) = des2 (length - 1) - desw (length) = desw (length - 1) - -#ifdef MULTI_GASES - call multi_gases_init(ngas,nwat,rilist,cpilist,mpirank==mpiroot) -#endif - - is_initialized = .true. - -end subroutine fv_sat_adj_init - -!\ingroup fast_sat_adj -!>\brief The subroutine 'fv_sat_adj_finalize' deallocates lookup tables for the saturation mixing ratio. -!! \section arg_table_fv_sat_adj_finalize Argument Table -!! \htmlinclude fv_sat_adj_finalize.html -!! -subroutine fv_sat_adj_finalize (errmsg, errflg) - - implicit none - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - - ! Initialize the CCPP error handling variables - errmsg = '' - errflg = 0 - - if (.not.is_initialized) return - - if (allocated(table )) deallocate(table ) - if (allocated(table2)) deallocate(table2) - if (allocated(tablew)) deallocate(tablew) - if (allocated(des2 )) deallocate(des2 ) - if (allocated(desw )) deallocate(desw ) - -#ifdef MULTI_GASES - call multi_gases_finalize() -#endif - - is_initialized = .false. - -end subroutine fv_sat_adj_finalize - -!>\defgroup fast_sat_adj GFDL In-Core Fast Saturation Adjustment Module -!> @{ -!! The subroutine 'fv_sat_adj' implements the fast processes in the GFDL -!! Cloud MP. It is part of the GFDL Cloud MP. -!>\author Shian-Jiann Lin, Linjiong Zhou -!! -!>\brief The subroutine 'fv_sat_adj' performs the fast processes in the GFDL microphysics. -!>\details This is designed for single-moment 6-class cloud microphysics schemes. -!! It handles the heat release due to in situ phase changes. -!! -!! \section arg_table_fv_sat_adj_run Argument Table -!! \htmlinclude fv_sat_adj_run.html -!! -subroutine fv_sat_adj_run(mdt, zvir, is, ie, isd, ied, kmp, km, kmdelz, js, je, jsd, jed, & - ng, hydrostatic, fast_mp_consv, te0_2d, te0, ngas, qvi, qv, ql, qi, qr, & - qs, qg, hs, peln, delz, delp, pt, pkz, q_con, akap, cappa, area, dtdt, & - out_dt, last_step, do_qa, qa, & - nthreads, errmsg, errflg) - - implicit none - - ! Interface variables - real(kind=kind_dyn), intent(in) :: mdt - real(kind=kind_dyn), intent(in) :: zvir - integer, intent(in) :: is - integer, intent(in) :: ie - integer, intent(in) :: isd - integer, intent(in) :: ied - integer, intent(in) :: kmp - integer, intent(in) :: km - integer, intent(in) :: kmdelz - integer, intent(in) :: js - integer, intent(in) :: je - integer, intent(in) :: jsd - integer, intent(in) :: jed - integer, intent(in) :: ng - logical, intent(in) :: hydrostatic - logical, intent(in) :: fast_mp_consv - real(kind=kind_dyn), intent(inout) :: te0_2d(:,:) - real(kind=kind_dyn), intent( out) :: te0(isd:ied, jsd:jed, 1:km) - ! If multi-gases physics are not used, ngas is one and qvi identical to qv - integer, intent(in) :: ngas - real(kind=kind_dyn), intent(inout) :: qvi(:,:,:, :) - real(kind=kind_dyn), intent(inout) :: qv(isd:ied, jsd:jed, 1:km) - real(kind=kind_dyn), intent(inout) :: ql(isd:ied, jsd:jed, 1:km) - real(kind=kind_dyn), intent(inout) :: qi(isd:ied, jsd:jed, 1:km) - real(kind=kind_dyn), intent(inout) :: qr(isd:ied, jsd:jed, 1:km) - real(kind=kind_dyn), intent(inout) :: qs(isd:ied, jsd:jed, 1:km) - real(kind=kind_dyn), intent(inout) :: qg(isd:ied, jsd:jed, 1:km) - real(kind=kind_dyn), intent(in) :: hs(isd:ied, jsd:jed) - real(kind=kind_dyn), intent(in) :: peln(:,:,:) - ! For hydrostatic build, kmdelz=1, otherwise kmdelz=km (see fv_arrays.F90) - real(kind=kind_dyn), intent(in) :: delz(:,:,:) - real(kind=kind_dyn), intent(in) :: delp(:,:,:) - real(kind=kind_dyn), intent(inout) :: pt(isd:ied, jsd:jed, 1:km) - real(kind=kind_dyn), intent(inout) :: pkz(:,:,:) -#ifdef USE_COND - real(kind=kind_dyn), intent(inout) :: q_con(:,:,:) -#else - real(kind=kind_dyn), intent(inout) :: q_con(:,:,:) -#endif - real(kind=kind_dyn), intent(in) :: akap -#ifdef MOIST_CAPPA - real(kind=kind_dyn), intent(inout) :: cappa(:,:,:) -#else - real(kind=kind_dyn), intent(inout) :: cappa(:,:,:) -#endif - ! DH* WARNING, allocation in fv_arrays.F90 is area(isd_2d:ied_2d, jsd_2d:jed_2d), - ! where normally isd_2d = isd etc, but for memory optimization, these can be set - ! to isd_2d=0, ied_2d=-1 etc. I don't believe this optimization is actually used, - ! as it would break a whole lot of code (including the one below)! - ! Assume thus that isd_2d = isd etc. - real(kind_grid), intent(in) :: area(:,:) - real(kind=kind_dyn), intent(inout) :: dtdt(is:ie, js:je, 1:km) - logical, intent(in) :: out_dt - logical, intent(in) :: last_step - logical, intent(in) :: do_qa - real(kind=kind_dyn), intent( out) :: qa(isd:ied, jsd:jed, 1:km) - integer, intent(in) :: nthreads - character(len=*), intent( out) :: errmsg - integer, intent( out) :: errflg - - ! Local variables - real(kind=kind_dyn), dimension(is:ie,js:je) :: dpln - integer :: kdelz - integer :: k, j, i - - ! Initialize the CCPP error handling variables - errmsg = '' - errflg = 0 - -#ifndef FV3 -! Open parallel region if not already opened by host model -!$OMP parallel num_threads(nthreads) default(none) & -!$OMP shared(kmp,km,js,je,is,ie,peln,mdt, & -!$OMP isd,jsd,delz,q_con,cappa,qa, & -!$OMP do_qa,last_step,out_dt,dtdt, & -!$OMP area,delp,pt,hs,qg,qs,qr,qi, & -!$OMP ql,qv,te0,fast_mp_consv, & -!$OMP hydrostatic,ng,zvir,pkz, & -!$OMP akap,te0_2d,ngas,qvi) & -!$OMP private(k,j,i,kdelz,dpln) -#endif - -!$OMP do - do k=kmp,km - do j=js,je - do i=is,ie - dpln(i,j) = peln(i,k+1,j) - peln(i,k,j) - enddo - enddo - if (hydrostatic) then - kdelz = 1 - else - kdelz = k - end if - call fv_sat_adj_work(abs(mdt), zvir, is, ie, js, je, ng, hydrostatic, fast_mp_consv, & - te0(isd,jsd,k), & -#ifdef MULTI_GASES - qvi(isd,jsd,k,1:ngas), & -#else - qv(isd,jsd,k), & -#endif - ql(isd,jsd,k), qi(isd,jsd,k), & - qr(isd,jsd,k), qs(isd,jsd,k), qg(isd,jsd,k), & - hs, dpln, delz(is:,js:,kdelz), pt(isd,jsd,k), delp(isd,jsd,k),& - q_con(isd:,jsd:,k), cappa(isd:,jsd:,k), area, dtdt(is,js,k), & - out_dt, last_step, do_qa, qa(isd,jsd,k)) - if ( .not. hydrostatic ) then - do j=js,je - do i=is,ie -#ifdef MOIST_CAPPA - pkz(i,j,k) = exp(cappa(i,j,k)*log(rrg*delp(i,j,k)/delz(i,j,k)*pt(i,j,k))) -#else -#ifdef MULTI_GASES - pkz(i,j,k) = exp(akap*(virqd(q(i,j,k,1:num_gas))/vicpqd(q(i,j,k,1:num_gas))*log(rrg*delp(i,j,k)/delz(i,j,k)*pt(i,j,k))) -#else - pkz(i,j,k) = exp(akap*log(rrg*delp(i,j,k)/delz(i,j,k)*pt(i,j,k))) -#endif -#endif - enddo - enddo - endif - enddo -!$OMP end do - - if ( fast_mp_consv ) then -!$OMP do - do j=js,je - do i=is,ie - do k=kmp,km - te0_2d(i,j) = te0_2d(i,j) + te0(i,j,k) - enddo - enddo - enddo -!$OMP end do - endif - -#ifndef FV3 -!$OMP end parallel -#endif - - return - -end subroutine fv_sat_adj_run - -!>\ingroup fast_sat_adj -!> This subroutine includes the entity of the fast saturation adjustment processes. -!>\section fast_gen GFDL Cloud Fast Physics General Algorithm -!> @{ -subroutine fv_sat_adj_work(mdt, zvir, is, ie, js, je, ng, hydrostatic, consv_te, te0, & -#ifdef MULTI_GASES - qvi, & -#else - qv, & -#endif - ql, qi, qr, qs, qg, hs, dpln, delz, pt, dp, q_con, cappa, & - area, dtdt, out_dt, last_step, do_qa, qa) - - implicit none - - ! Interface variables - integer, intent (in) :: is, ie, js, je, ng - logical, intent (in) :: hydrostatic, consv_te, out_dt, last_step, do_qa - real(kind=kind_dyn), intent (in) :: zvir, mdt ! remapping time step - real(kind=kind_dyn), intent (in), dimension (is - ng:ie + ng, js - ng:je + ng) :: dp, hs - real(kind=kind_dyn), intent (in), dimension (is:ie, js:je) :: dpln, delz - real(kind=kind_dyn), intent (inout), dimension (is - ng:ie + ng, js - ng:je + ng) :: pt -#ifdef MULTI_GASES - real(kind=kind_dyn), intent (inout), dimension (is - ng:ie + ng, js - ng:je + ng, 1:1, 1:num_gas) :: qvi -#else - real(kind=kind_dyn), intent (inout), dimension (is - ng:ie + ng, js - ng:je + ng) :: qv -#endif - real(kind=kind_dyn), intent (inout), dimension (is - ng:ie + ng, js - ng:je + ng) :: ql, qi, qr, qs, qg - real(kind=kind_dyn), intent (inout), dimension (is - ng:ie + ng, js - ng:je + ng) :: q_con, cappa - real(kind=kind_dyn), intent (inout), dimension (is:ie, js:je) :: dtdt - real(kind=kind_dyn), intent (out), dimension (is - ng:ie + ng, js - ng:je + ng) :: qa, te0 - real (kind_grid), intent (in), dimension (is - ng:ie + ng, js - ng:je + ng) :: area - - ! Local variables -#ifdef MULTI_GASES - real, dimension (is - ng:ie + ng, js - ng:je + ng) :: qv -#endif - real(kind=kind_dyn), dimension (is:ie) :: wqsat, dq2dt, qpz, cvm, t0, pt1, qstar - real(kind=kind_dyn), dimension (is:ie) :: icp2, lcp2, tcp2, tcp3 - real(kind=kind_dyn), dimension (is:ie) :: den, q_liq, q_sol, q_cond, src, sink, hvar - real(kind=kind_dyn), dimension (is:ie) :: mc_air, lhl, lhi - real(kind=kind_dyn) :: qsw, rh - real(kind=kind_dyn) :: tc, qsi, dqsdt, dq, dq0, pidep, qi_crt, tmp, dtmp - real(kind=kind_dyn) :: tin, rqi, q_plus, q_minus - real(kind=kind_dyn) :: sdt, dt_bigg, adj_fac - real(kind=kind_dyn) :: fac_smlt, fac_r2g, fac_i2s, fac_imlt, fac_l2r, fac_v2l, fac_l2v - real(kind=kind_dyn) :: factor, qim, tice0, c_air, c_vap, dw - integer :: i, j - -#ifdef MULTI_GASES - qv(:,:) = qvi(:,:,1,1) -#endif - sdt = 0.5 * mdt ! half remapping time step - dt_bigg = mdt ! bigg mechinism time step - - tice0 = tice - 0.01 ! 273.15, standard freezing temperature - - ! ----------------------------------------------------------------------- - !> - Define conversion scalar / factor. - ! ----------------------------------------------------------------------- - - fac_i2s = 1. - exp (- mdt / tau_i2s) - fac_v2l = 1. - exp (- sdt / tau_v2l) - fac_r2g = 1. - exp (- mdt / tau_r2g) - fac_l2r = 1. - exp (- mdt / tau_l2r) - - fac_l2v = 1. - exp (- sdt / tau_l2v) - fac_l2v = min (sat_adj0, fac_l2v) - - fac_imlt = 1. - exp (- sdt / tau_imlt) - fac_smlt = 1. - exp (- mdt / tau_smlt) - - ! ----------------------------------------------------------------------- - !> - Define heat capacity of dry air and water vapor based on hydrostatical property. - ! ----------------------------------------------------------------------- - - if (hydrostatic) then - c_air = cp_air - c_vap = cp_vap - else - c_air = cv_air - c_vap = cv_vap - endif - d0_vap = c_vap - c_liq - lv00 = hlv - d0_vap * tice - ! dc_vap = cp_vap - c_liq ! - 2339.5 - ! d0_vap = cv_vap - c_liq ! - 2801.0 - - do j = js, je ! start j loop - - do i = is, ie - q_liq (i) = ql (i, j) + qr (i, j) - q_sol (i) = qi (i, j) + qs (i, j) + qg (i, j) - qpz (i) = q_liq (i) + q_sol (i) -#ifdef MULTI_GASES - pt1 (i) = pt (i, j) / virq_qpz(qvi(i,j,1,1:num_gas),qpz(i)) -#else -#ifdef USE_COND - pt1 (i) = pt (i, j) / ((1 + zvir * qv (i, j)) * (1 - qpz (i))) -#else - pt1 (i) = pt (i, j) / (1 + zvir * qv (i, j)) -#endif -#endif - t0 (i) = pt1 (i) ! true temperature - qpz (i) = qpz (i) + qv (i, j) ! total_wat conserved in this routine - enddo - - ! ----------------------------------------------------------------------- - !> - Define air density based on hydrostatical property. - ! ----------------------------------------------------------------------- - - if (hydrostatic) then - do i = is, ie - den (i) = dp (i, j) / (dpln (i, j) * rdgas * pt (i, j)) - enddo - else - do i = is, ie - den (i) = - dp (i, j) / (grav * delz (i, j)) ! moist_air density - enddo - endif - - ! ----------------------------------------------------------------------- - !> - Define heat capacity and latend heat coefficient. - ! ----------------------------------------------------------------------- - - do i = is, ie -#ifdef MULTI_GASES - if (hydrostatic) then - c_air = cp_air * vicpqd_qpz(qvi(i,j,1,1:num_gas),qpz(i)) - else - c_air = cv_air * vicvqd_qpz(qvi(i,j,1,1:num_gas),qpz(i)) - endif -#endif - mc_air (i) = (1. - qpz (i)) * c_air ! constant - cvm (i) = mc_air (i) + qv (i, j) * c_vap + q_liq (i) * c_liq + q_sol (i) * c_ice - lhi (i) = li00 + dc_ice * pt1 (i) - icp2 (i) = lhi (i) / cvm (i) - enddo - - ! ----------------------------------------------------------------------- - !> - Fix energy conservation. - ! ----------------------------------------------------------------------- - - if (consv_te) then - if (hydrostatic) then - do i = is, ie -#ifdef MULTI_GASES - c_air = cp_air * vicpqd_qpz(qvi(i,j,1,1:num_gas),qpz(i)) -#endif - te0 (i, j) = - c_air * t0 (i) - enddo - else - do i = is, ie -#ifdef USE_COND - te0 (i, j) = - cvm (i) * t0 (i) -#else -#ifdef MULTI_GASES - c_air = cv_air * vicvqd_qpz(qvi(i,j,1,1:num_gas),qpz(i)) -#endif - te0 (i, j) = - c_air * t0 (i) -#endif - enddo - endif - endif - - ! ----------------------------------------------------------------------- - !> - Fix negative cloud ice with snow. - ! ----------------------------------------------------------------------- - - do i = is, ie - if (qi (i, j) < 0.) then - qs (i, j) = qs (i, j) + qi (i, j) - qi (i, j) = 0. - endif - enddo - - ! ----------------------------------------------------------------------- - !> - Melting of cloud ice to cloud water and rain. - ! ----------------------------------------------------------------------- - - do i = is, ie - if (qi (i, j) > 1.e-8 .and. pt1 (i) > tice) then - sink (i) = min (qi (i, j), fac_imlt * (pt1 (i) - tice) / icp2 (i)) - qi (i, j) = qi (i, j) - sink (i) - ! sjl, may 17, 2017 - ! tmp = min (sink (i), dim (ql_mlt, ql (i, j))) ! max ql amount - ! ql (i, j) = ql (i, j) + tmp - ! qr (i, j) = qr (i, j) + sink (i) - tmp - ! sjl, may 17, 2017 - ql (i, j) = ql (i, j) + sink (i) - q_liq (i) = q_liq (i) + sink (i) - q_sol (i) = q_sol (i) - sink (i) - cvm (i) = mc_air (i) + qv (i, j) * c_vap + q_liq (i) * c_liq + q_sol (i) * c_ice - pt1 (i) = pt1 (i) - sink (i) * lhi (i) / cvm (i) - endif - enddo - - ! ----------------------------------------------------------------------- - !> - Update latend heat coefficient. - ! ----------------------------------------------------------------------- - - do i = is, ie - lhi (i) = li00 + dc_ice * pt1 (i) - icp2 (i) = lhi (i) / cvm (i) - enddo - - ! ----------------------------------------------------------------------- - !> - Fix negative snow with graupel or graupel with available snow. - ! ----------------------------------------------------------------------- - - do i = is, ie - if (qs (i, j) < 0.) then - qg (i, j) = qg (i, j) + qs (i, j) - qs (i, j) = 0. - elseif (qg (i, j) < 0.) then - tmp = min (- qg (i, j), max (0., qs (i, j))) - qg (i, j) = qg (i, j) + tmp - qs (i, j) = qs (i, j) - tmp - endif - enddo - - ! after this point cloud ice & snow are positive definite - - ! ----------------------------------------------------------------------- - !> - Fix negative cloud water with rain or rain with available cloud water. - ! ----------------------------------------------------------------------- - - do i = is, ie - if (ql (i, j) < 0.) then - tmp = min (- ql (i, j), max (0., qr (i, j))) - ql (i, j) = ql (i, j) + tmp - qr (i, j) = qr (i, j) - tmp - elseif (qr (i, j) < 0.) then - tmp = min (- qr (i, j), max (0., ql (i, j))) - ql (i, j) = ql (i, j) - tmp - qr (i, j) = qr (i, j) + tmp - endif - enddo - - ! ----------------------------------------------------------------------- - !> - Enforce complete freezing of cloud water to cloud ice below - 48 c. - ! ----------------------------------------------------------------------- - - do i = is, ie - dtmp = tice - 48. - pt1 (i) - if (ql (i, j) > 0. .and. dtmp > 0.) then - sink (i) = min (ql (i, j), dtmp / icp2 (i)) - ql (i, j) = ql (i, j) - sink (i) - qi (i, j) = qi (i, j) + sink (i) - q_liq (i) = q_liq (i) - sink (i) - q_sol (i) = q_sol (i) + sink (i) - cvm (i) = mc_air (i) + qv (i, j) * c_vap + q_liq (i) * c_liq + q_sol (i) * c_ice - pt1 (i) = pt1 (i) + sink (i) * lhi (i) / cvm (i) - endif - enddo - - ! ----------------------------------------------------------------------- - !> - Update latend heat coefficient. - ! ----------------------------------------------------------------------- - - do i = is, ie - lhl (i) = lv00 + d0_vap * pt1 (i) - lhi (i) = li00 + dc_ice * pt1 (i) - lcp2 (i) = lhl (i) / cvm (i) - icp2 (i) = lhi (i) / cvm (i) - tcp3 (i) = lcp2 (i) + icp2 (i) * min (1., dim (tice, pt1 (i)) /48.) - enddo - - ! ----------------------------------------------------------------------- - !> - Condensation/evaporation between water vapor and cloud water. - ! ----------------------------------------------------------------------- - - call wqs2_vect (is, ie, pt1, den, wqsat, dq2dt) - - adj_fac = sat_adj0 - do i = is, ie - dq0 = (qv (i, j) - wqsat (i)) / (1. + tcp3 (i) * dq2dt (i)) - if (dq0 > 0.) then ! whole grid - box saturated - src (i) = min (adj_fac * dq0, max (ql_gen - ql (i, j), fac_v2l * dq0)) - else ! evaporation of ql - ! sjl 20170703 added ql factor to prevent the situation of high ql and rh<1 - ! factor = - min (1., fac_l2v * sqrt (max (0., ql (i, j)) / 1.e-5) * 10. * (1. - qv (i, j) / wqsat (i))) - ! factor = - fac_l2v - ! factor = - 1 - factor = - min (1., fac_l2v * 10. * (1. - qv (i, j) / wqsat (i))) ! the rh dependent factor = 1 at 90% - src (i) = - min (ql (i, j), factor * dq0) - endif - qv (i, j) = qv (i, j) - src (i) -#ifdef MULTI_GASES - qvi(i,j,1,1) = qv (i, j) -#endif - ql (i, j) = ql (i, j) + src (i) - q_liq (i) = q_liq (i) + src (i) - cvm (i) = mc_air (i) + qv (i, j) * c_vap + q_liq (i) * c_liq + q_sol (i) * c_ice - pt1 (i) = pt1 (i) + src (i) * lhl (i) / cvm (i) - enddo - - ! ----------------------------------------------------------------------- - !> - Update latend heat coefficient. - ! ----------------------------------------------------------------------- - - do i = is, ie - lhl (i) = lv00 + d0_vap * pt1 (i) - lhi (i) = li00 + dc_ice * pt1 (i) - lcp2 (i) = lhl (i) / cvm (i) - icp2 (i) = lhi (i) / cvm (i) - tcp3 (i) = lcp2 (i) + icp2 (i) * min (1., dim (tice, pt1 (i)) / 48.) - enddo - - if (last_step) then - - ! ----------------------------------------------------------------------- - !> - condensation/evaporation between water vapor and cloud water, last time step - !! enforce upper (no super_sat) & lower (critical rh) bounds. - ! final iteration: - ! ----------------------------------------------------------------------- - - call wqs2_vect (is, ie, pt1, den, wqsat, dq2dt) - - do i = is, ie - dq0 = (qv (i, j) - wqsat (i)) / (1. + tcp3 (i) * dq2dt (i)) - if (dq0 > 0.) then ! remove super - saturation, prevent super saturation over water - src (i) = dq0 - else ! evaporation of ql - ! factor = - min (1., fac_l2v * sqrt (max (0., ql (i, j)) / 1.e-5) * 10. * (1. - qv (i, j) / wqsat (i))) ! the rh dependent factor = 1 at 90% - ! factor = - fac_l2v - ! factor = - 1 - factor = - min (1., fac_l2v * 10. * (1. - qv (i, j) / wqsat (i))) ! the rh dependent factor = 1 at 90% - src (i) = - min (ql (i, j), factor * dq0) - endif - adj_fac = 1. - qv (i, j) = qv (i, j) - src (i) -#ifdef MULTI_GASES - qvi(i,j,1,1) = qv(i,j) -#endif - ql (i, j) = ql (i, j) + src (i) - q_liq (i) = q_liq (i) + src (i) - cvm (i) = mc_air (i) + qv (i, j) * c_vap + q_liq (i) * c_liq + q_sol (i) * c_ice - pt1 (i) = pt1 (i) + src (i) * lhl (i) / cvm (i) - enddo - - ! ----------------------------------------------------------------------- - !> - Update latend heat coefficient. - ! ----------------------------------------------------------------------- - - do i = is, ie - lhl (i) = lv00 + d0_vap * pt1 (i) - lhi (i) = li00 + dc_ice * pt1 (i) - lcp2 (i) = lhl (i) / cvm (i) - icp2 (i) = lhi (i) / cvm (i) - enddo - - endif - - ! ----------------------------------------------------------------------- - !> - Homogeneous freezing of cloud water to cloud ice. - ! ----------------------------------------------------------------------- - - do i = is, ie - dtmp = t_wfr - pt1 (i) ! [ - 40, - 48] - if (ql (i, j) > 0. .and. dtmp > 0.) then - sink (i) = min (ql (i, j), ql (i, j) * dtmp * 0.125, dtmp / icp2 (i)) - ql (i, j) = ql (i, j) - sink (i) - qi (i, j) = qi (i, j) + sink (i) - q_liq (i) = q_liq (i) - sink (i) - q_sol (i) = q_sol (i) + sink (i) - cvm (i) = mc_air (i) + qv (i, j) * c_vap + q_liq (i) * c_liq + q_sol (i) * c_ice - pt1 (i) = pt1 (i) + sink (i) * lhi (i) / cvm (i) - endif - enddo - - ! ----------------------------------------------------------------------- - !> - Update latend heat coefficient. - ! ----------------------------------------------------------------------- - - do i = is, ie - lhi (i) = li00 + dc_ice * pt1 (i) - icp2 (i) = lhi (i) / cvm (i) - enddo - - ! ----------------------------------------------------------------------- - !> - bigg mechanism (heterogeneous freezing of cloud water to cloud ice). - ! ----------------------------------------------------------------------- - - do i = is, ie - tc = tice0 - pt1 (i) - if (ql (i, j) > 0.0 .and. tc > 0.) then - sink (i) = 3.3333e-10 * dt_bigg * (exp (0.66 * tc) - 1.) * den (i) * ql (i, j) ** 2 - sink (i) = min (ql (i, j), tc / icp2 (i), sink (i)) - ql (i, j) = ql (i, j) - sink (i) - qi (i, j) = qi (i, j) + sink (i) - q_liq (i) = q_liq (i) - sink (i) - q_sol (i) = q_sol (i) + sink (i) - cvm (i) = mc_air (i) + qv (i, j) * c_vap + q_liq (i) * c_liq + q_sol (i) * c_ice - pt1 (i) = pt1 (i) + sink (i) * lhi (i) / cvm (i) - endif - enddo - - ! ----------------------------------------------------------------------- - !> - Update latend heat coefficient. - ! ----------------------------------------------------------------------- - - do i = is, ie - lhi (i) = li00 + dc_ice * pt1 (i) - icp2 (i) = lhi (i) / cvm (i) - enddo - - ! ----------------------------------------------------------------------- - !> - Freezing of rain to graupel. - ! ----------------------------------------------------------------------- - - do i = is, ie - dtmp = (tice - 0.1) - pt1 (i) - if (qr (i, j) > 1.e-7 .and. dtmp > 0.) then - tmp = min (1., (dtmp * 0.025) ** 2) * qr (i, j) ! no limit on freezing below - 40 deg c - sink (i) = min (tmp, fac_r2g * dtmp / icp2 (i)) - qr (i, j) = qr (i, j) - sink (i) - qg (i, j) = qg (i, j) + sink (i) - q_liq (i) = q_liq (i) - sink (i) - q_sol (i) = q_sol (i) + sink (i) - cvm (i) = mc_air (i) + qv (i, j) * c_vap + q_liq (i) * c_liq + q_sol (i) * c_ice - pt1 (i) = pt1 (i) + sink (i) * lhi (i) / cvm (i) - endif - enddo - - ! ----------------------------------------------------------------------- - !> - Update latend heat coefficient. - ! ----------------------------------------------------------------------- - - do i = is, ie - lhi (i) = li00 + dc_ice * pt1 (i) - icp2 (i) = lhi (i) / cvm (i) - enddo - - ! ----------------------------------------------------------------------- - !> - Melting of snow to rain or cloud water. - ! ----------------------------------------------------------------------- - - do i = is, ie - dtmp = pt1 (i) - (tice + 0.1) - if (qs (i, j) > 1.e-7 .and. dtmp > 0.) then - tmp = min (1., (dtmp * 0.1) ** 2) * qs (i, j) ! no limter on melting above 10 deg c - sink (i) = min (tmp, fac_smlt * dtmp / icp2 (i)) - tmp = min (sink (i), dim (qs_mlt, ql (i, j))) ! max ql due to snow melt - qs (i, j) = qs (i, j) - sink (i) - ql (i, j) = ql (i, j) + tmp - qr (i, j) = qr (i, j) + sink (i) - tmp - ! qr (i, j) = qr (i, j) + sink (i) - q_liq (i) = q_liq (i) + sink (i) - q_sol (i) = q_sol (i) - sink (i) - cvm (i) = mc_air (i) + qv (i, j) * c_vap + q_liq (i) * c_liq + q_sol (i) * c_ice - pt1 (i) = pt1 (i) - sink (i) * lhi (i) / cvm (i) - endif - enddo - - ! ----------------------------------------------------------------------- - !> - Autoconversion from cloud water to rain. - ! ----------------------------------------------------------------------- - - do i = is, ie - if (ql (i, j) > ql0_max) then - sink (i) = fac_l2r * (ql (i, j) - ql0_max) - qr (i, j) = qr (i, j) + sink (i) - ql (i, j) = ql (i, j) - sink (i) - endif - enddo - - ! ----------------------------------------------------------------------- - !> - Update latend heat coefficient. - ! ----------------------------------------------------------------------- - - do i = is, ie - lhi (i) = li00 + dc_ice * pt1 (i) - lhl (i) = lv00 + d0_vap * pt1 (i) - lcp2 (i) = lhl (i) / cvm (i) - icp2 (i) = lhi (i) / cvm (i) - tcp2 (i) = lcp2 (i) + icp2 (i) - enddo - - ! ----------------------------------------------------------------------- - !> - Sublimation/deposition between water vapor and cloud ice. - ! ----------------------------------------------------------------------- - - do i = is, ie - src (i) = 0. - if (pt1 (i) < t_sub) then ! too cold to be accurate; freeze qv as a fix - src (i) = dim (qv (i, j), 1.e-6) - elseif (pt1 (i) < tice0) then - qsi = iqs2 (pt1 (i), den (i), dqsdt) - dq = qv (i, j) - qsi - sink (i) = adj_fac * dq / (1. + tcp2 (i) * dqsdt) - if (qi (i, j) > 1.e-8) then - pidep = sdt * dq * 349138.78 * exp (0.875 * log (qi (i, j) * den (i))) & - / (qsi * den (i) * lat2 / (0.0243 * rvgas * pt1 (i) ** 2) + 4.42478e4) - else - pidep = 0. - endif - if (dq > 0.) then ! vapor - > ice - tmp = tice - pt1 (i) - qi_crt = qi_gen * min (qi_lim, 0.1 * tmp) / den (i) - src (i) = min (sink (i), max (qi_crt - qi (i, j), pidep), tmp / tcp2 (i)) - else - pidep = pidep * min (1., dim (pt1 (i), t_sub) * 0.2) - src (i) = max (pidep, sink (i), - qi (i, j)) - endif - endif - qv (i, j) = qv (i, j) - src (i) -#ifdef MULTI_GASES - qvi(i,j,1,1) = qv(i,j) -#endif - qi (i, j) = qi (i, j) + src (i) - q_sol (i) = q_sol (i) + src (i) - cvm (i) = mc_air (i) + qv (i, j) * c_vap + q_liq (i) * c_liq + q_sol (i) * c_ice - pt1 (i) = pt1 (i) + src (i) * (lhl (i) + lhi (i)) / cvm (i) - enddo - - ! ----------------------------------------------------------------------- - !> - Virtual temperature updated. - ! ----------------------------------------------------------------------- - - do i = is, ie -#ifdef USE_COND - q_con (i, j) = q_liq (i) + q_sol (i) -#ifdef MULTI_GASES - pt (i, j) = pt1 (i) * virq_qpz(qvi(i,j,1,1:num_gas),q_con(i,j)) -#else - tmp = 1. + zvir * qv (i, j) - pt (i, j) = pt1 (i) * tmp * (1. - q_con (i, j)) -#endif - tmp = rdgas * tmp - cappa (i, j) = tmp / (tmp + cvm (i)) -#else -#ifdef MULTI_GASES - q_con (i, j) = q_liq (i) + q_sol (i) - pt (i, j) = pt1 (i) * virq_qpz(qvi(i,j,1,1:num_gas),q_con(i,j)) * (1. - q_con(i,j)) -#else - pt (i, j) = pt1 (i) * (1. + zvir * qv (i, j)) -#endif -#endif - enddo - - ! ----------------------------------------------------------------------- - !> - Fix negative graupel with available cloud ice. - ! ----------------------------------------------------------------------- - - do i = is, ie - if (qg (i, j) < 0.) then - tmp = min (- qg (i, j), max (0., qi (i, j))) - qg (i, j) = qg (i, j) + tmp - qi (i, j) = qi (i, j) - tmp - endif - enddo - - ! ----------------------------------------------------------------------- - !> - Autoconversion from cloud ice to snow. - ! ----------------------------------------------------------------------- - - do i = is, ie - qim = qi0_max / den (i) - if (qi (i, j) > qim) then - sink (i) = fac_i2s * (qi (i, j) - qim) - qi (i, j) = qi (i, j) - sink (i) - qs (i, j) = qs (i, j) + sink (i) - endif - enddo - - if (out_dt) then - do i = is, ie - dtdt (i, j) = dtdt (i, j) + pt1 (i) - t0 (i) - enddo - endif - - ! ----------------------------------------------------------------------- - !> - Fix energy conservation. - ! ----------------------------------------------------------------------- - - if (consv_te) then - do i = is, ie - if (hydrostatic) then -#ifdef MULTI_GASES - c_air = cp_air * vicpqd_qpz(qvi(i,j,1,1:num_gas),qpz(i)) -#endif - te0 (i, j) = dp (i, j) * (te0 (i, j) + c_air * pt1 (i)) - else -#ifdef USE_COND - te0 (i, j) = dp (i, j) * (te0 (i, j) + cvm (i) * pt1 (i)) -#else -#ifdef MULTI_GASES - c_air = cv_air * vicvqd_qpz(qvi(i,j,1,1:num_gas),qpz(i)) -#endif - te0 (i, j) = dp (i, j) * (te0 (i, j) + c_air * pt1 (i)) -#endif - endif - enddo - endif - - ! ----------------------------------------------------------------------- - !> - Update latend heat coefficient. - ! ----------------------------------------------------------------------- - - do i = is, ie - lhi (i) = li00 + dc_ice * pt1 (i) - lhl (i) = lv00 + d0_vap * pt1 (i) - cvm (i) = mc_air (i) + (qv (i, j) + q_liq (i) + q_sol (i)) * c_vap - lcp2 (i) = lhl (i) / cvm (i) - icp2 (i) = lhi (i) / cvm (i) - enddo - - ! ----------------------------------------------------------------------- - !> - Compute cloud fraction. - ! ----------------------------------------------------------------------- - - if (do_qa .and. last_step) then - - ! ----------------------------------------------------------------------- - !> - If it is the last step, combine water species. - ! ----------------------------------------------------------------------- - - if (rad_snow) then - if (rad_graupel) then - do i = is, ie - q_sol (i) = qi (i, j) + qs (i, j) + qg (i, j) - enddo - else - do i = is, ie - q_sol (i) = qi (i, j) + qs (i, j) - enddo - endif - else - do i = is, ie - q_sol (i) = qi (i, j) - enddo - endif - if (rad_rain) then - do i = is, ie - q_liq (i) = ql (i, j) + qr (i, j) - enddo - else - do i = is, ie - q_liq (i) = ql (i, j) - enddo - endif - do i = is, ie - q_cond (i) = q_sol (i) + q_liq (i) - enddo - - ! ----------------------------------------------------------------------- - !> - Use the "liquid - frozen water temperature" (tin) to compute saturated specific humidity. - ! ----------------------------------------------------------------------- - - do i = is, ie - - if(tintqs) then - tin = pt1(i) - else - tin = pt1 (i) - (lcp2 (i) * q_cond (i) + icp2 (i) * q_sol (i)) ! minimum temperature - ! tin = pt1 (i) - ((lv00 + d0_vap * pt1 (i)) * q_cond (i) + & - ! (li00 + dc_ice * pt1 (i)) * q_sol (i)) / (mc_air (i) + qpz (i) * c_vap) - endif - - ! ----------------------------------------------------------------------- - ! determine saturated specific humidity - ! ----------------------------------------------------------------------- - - if (tin <= t_wfr) then - ! ice phase: - qstar (i) = iqs1 (tin, den (i)) - elseif (tin >= tice) then - ! liquid phase: - qstar (i) = wqs1 (tin, den (i)) - else - ! mixed phase: - qsi = iqs1 (tin, den (i)) - qsw = wqs1 (tin, den (i)) - if (q_cond (i) > 1.e-6) then - rqi = q_sol (i) / q_cond (i) - else - ! mostly liquid water clouds at initial cloud development stage - rqi = ((tice - tin) / (tice - t_wfr)) - endif - qstar (i) = rqi * qsi + (1. - rqi) * qsw - endif - !> - higher than 10 m is considered "land" and will have higher subgrid variability - dw = dw_ocean + (dw_land - dw_ocean) * min (1., abs (hs (i, j)) / (10. * grav)) - !> - "scale - aware" subgrid variability: 100 - km as the base - hvar (i) = min (0.2, max (0.01, dw * sqrt (sqrt (area (i, j)) / 100.e3))) - - ! ----------------------------------------------------------------------- - !> - calculate partial cloudiness by pdf; - !! assuming subgrid linear distribution in horizontal; this is effectively a smoother for the - !! binary cloud scheme; qa = 0.5 if qstar (i) == qpz - ! ----------------------------------------------------------------------- - - rh = qpz (i) / qstar (i) - - ! ----------------------------------------------------------------------- - ! icloud_f = 0: bug - fixed - ! icloud_f = 1: old fvgfs gfdl) mp implementation - ! icloud_f = 2: binary cloud scheme (0 / 1) - ! ----------------------------------------------------------------------- - - if (rh > 0.75 .and. qpz (i) > 1.e-8) then - dq = hvar (i) * qpz (i) - q_plus = qpz (i) + dq - q_minus = qpz (i) - dq - if (icloud_f == 2) then - if (qpz (i) > qstar (i)) then - qa (i, j) = 1. - elseif (qstar (i) < q_plus .and. q_cond (i) > 1.e-8) then - qa (i, j) = ((q_plus - qstar (i)) / dq) ** 2 - qa (i, j) = min (1., qa (i, j)) - else - qa (i, j) = 0. - endif - else - if (qstar (i) < q_minus) then - qa (i, j) = 1. - else - if (qstar (i) < q_plus) then - if (icloud_f == 0) then - qa (i, j) = (q_plus - qstar (i)) / (dq + dq) - else - qa (i, j) = (q_plus - qstar (i)) / (2. * dq * (1. - q_cond (i))) - endif - else - qa (i, j) = 0. - endif - ! impose minimum cloudiness if substantial q_cond (i) exist - if (q_cond (i) > 1.e-8) then - qa (i, j) = max (cld_min, qa (i, j)) - endif - qa (i, j) = min (1., qa (i, j)) - endif - endif - else - qa (i, j) = 0. - endif - - enddo - - endif - - enddo ! end j loop - -end subroutine fv_sat_adj_work -!> @} - -! ======================================================================= -!>\ingroup fast_sat_adj -!>\brief the function 'wqs1' computes the -!! saturated specific humidity for table ii. -! ======================================================================= -real(kind=kind_dyn) function wqs1 (ta, den) - - implicit none - - ! pure water phase; universal dry / moist formular using air density - ! input "den" can be either dry or moist air density - - real(kind=kind_dyn), intent (in) :: ta, den - - real(kind=kind_dyn) :: es, ap1, tmin - - integer :: it - - tmin = tice - 160. - ap1 = 10. * dim (ta, tmin) + 1. - ap1 = min (2621., ap1) - it = ap1 - es = tablew (it) + (ap1 - it) * desw (it) - wqs1 = es / (rvgas * ta * den) - -end function wqs1 - -! ======================================================================= -!>\ingroup fast_sat_adj -!>\brief the function 'wqs1' computes the saturated specific humidity -!! for table iii -! ======================================================================= -real(kind=kind_dyn) function iqs1 (ta, den) - - implicit none - - ! water - ice phase; universal dry / moist formular using air density - ! input "den" can be either dry or moist air density - - real(kind=kind_dyn), intent (in) :: ta, den - - real(kind=kind_dyn) :: es, ap1, tmin - - integer :: it - - tmin = tice - 160. - ap1 = 10. * dim (ta, tmin) + 1. - ap1 = min (2621., ap1) - it = ap1 - es = table2 (it) + (ap1 - it) * des2 (it) - iqs1 = es / (rvgas * ta * den) - -end function iqs1 - -! ======================================================================= -!>\ingroup fast_sat_adj -!>\brief The function 'wqs2'computes the gradient of saturated specific -!! humidity for table ii -! ======================================================================= -real(kind=kind_dyn) function wqs2 (ta, den, dqdt) - - implicit none - - ! pure water phase; universal dry / moist formular using air density - ! input "den" can be either dry or moist air density - - real(kind=kind_dyn), intent (in) :: ta, den - - real(kind=kind_dyn), intent (out) :: dqdt - - real(kind=kind_dyn) :: es, ap1, tmin - - integer :: it - - tmin = tice - 160. - ap1 = 10. * dim (ta, tmin) + 1. - ap1 = min (2621., ap1) - it = ap1 - es = tablew (it) + (ap1 - it) * desw (it) - wqs2 = es / (rvgas * ta * den) - it = ap1 - 0.5 - ! finite diff, del_t = 0.1: - dqdt = 10. * (desw (it) + (ap1 - it) * (desw (it + 1) - desw (it))) / (rvgas * ta * den) - -end function wqs2 - -! ======================================================================= -!>\ingroup fast_sat_adj -!>\brief The function wqs2_vect computes the gradient of saturated -!! specific humidity for table ii. -!! It is the same as "wqs2", but written as vector function. -! ======================================================================= -subroutine wqs2_vect (is, ie, ta, den, wqsat, dqdt) - - implicit none - - ! pure water phase; universal dry / moist formular using air density - ! input "den" can be either dry or moist air density - - integer, intent (in) :: is, ie - - real(kind=kind_dyn), intent (in), dimension (:) :: ta, den - - real(kind=kind_dyn), intent (out), dimension (:) :: wqsat, dqdt - - real(kind=kind_dyn) :: es, ap1, tmin - - integer :: i, it - - tmin = tice - 160. - - do i = is, ie - ap1 = 10. * dim (ta (i), tmin) + 1. - ap1 = min (2621., ap1) - it = ap1 - es = tablew (it) + (ap1 - it) * desw (it) - wqsat (i) = es / (rvgas * ta (i) * den (i)) - it = ap1 - 0.5 - ! finite diff, del_t = 0.1: - dqdt (i) = 10. * (desw (it) + (ap1 - it) * (desw (it + 1) - desw (it))) / (rvgas * ta (i) * den (i)) - enddo - -end subroutine wqs2_vect - -! ======================================================================= -!>\ingroup fast_sat_adj -!>\brief The function 'iqs2' computes the gradient of saturated specific -!! humidity for table iii. -! ======================================================================= -real(kind=kind_dyn) function iqs2 (ta, den, dqdt) - - implicit none - - ! water - ice phase; universal dry / moist formular using air density - ! input "den" can be either dry or moist air density - - real(kind=kind_dyn), intent (in) :: ta, den - - real(kind=kind_dyn), intent (out) :: dqdt - - real(kind=kind_dyn) :: es, ap1, tmin - - integer :: it - - tmin = tice - 160. - ap1 = 10. * dim (ta, tmin) + 1. - ap1 = min (2621., ap1) - it = ap1 - es = table2 (it) + (ap1 - it) * des2 (it) - iqs2 = es / (rvgas * ta * den) - it = ap1 - 0.5 - ! finite diff, del_t = 0.1: - dqdt = 10. * (des2 (it) + (ap1 - it) * (des2 (it + 1) - des2 (it))) / (rvgas * ta * den) - -end function iqs2 - -! ======================================================================= -!>\ingroup fast_sat_adj -!! saturation water vapor pressure table i -! 3 - phase table -! ======================================================================= - -subroutine qs_table (n) - - implicit none - - integer, intent (in) :: n - real (kind_grid) :: delt = 0.1 - real (kind_grid) :: tmin, tem, esh20 - real (kind_grid) :: wice, wh2o, fac0, fac1, fac2 - real (kind_grid) :: esupc (200) - integer :: i - - tmin = tice - 160. - - ! ----------------------------------------------------------------------- - ! compute es over ice between - 160 deg c and 0 deg c. - ! ----------------------------------------------------------------------- - - do i = 1, 1600 - tem = tmin + delt * real (i - 1) - fac0 = (tem - tice) / (tem * tice) - fac1 = fac0 * li2 - fac2 = (d2ice * log (tem / tice) + fac1) / rvgas - table (i) = e00 * exp (fac2) - enddo - - ! ----------------------------------------------------------------------- - ! compute es over water between - 20 deg c and 102 deg c. - ! ----------------------------------------------------------------------- - - do i = 1, 1221 - tem = 253.16 + delt * real (i - 1) - fac0 = (tem - tice) / (tem * tice) - fac1 = fac0 * lv0 - fac2 = (dc_vap * log (tem / tice) + fac1) / rvgas - esh20 = e00 * exp (fac2) - if (i <= 200) then - esupc (i) = esh20 - else - table (i + 1400) = esh20 - endif - enddo - - ! ----------------------------------------------------------------------- - ! derive blended es over ice and supercooled water between - 20 deg c and 0 deg c - ! ----------------------------------------------------------------------- - - do i = 1, 200 - tem = 253.16 + delt * real (i - 1) - wice = 0.05 * (tice - tem) - wh2o = 0.05 * (tem - 253.16) - table (i + 1400) = wice * table (i + 1400) + wh2o * esupc (i) - enddo - -end subroutine qs_table - -! ======================================================================= -!>\ingroup fast_sat_adj -!! saturation water vapor pressure table ii. -! 1 - phase table -! ======================================================================= - -subroutine qs_tablew (n) - - implicit none - - integer, intent (in) :: n - real (kind_grid) :: delt = 0.1 - real (kind_grid) :: tmin, tem, fac0, fac1, fac2 - integer :: i - - tmin = tice - 160. - - ! ----------------------------------------------------------------------- - ! compute es over water - ! ----------------------------------------------------------------------- - - do i = 1, n - tem = tmin + delt * real (i - 1) - fac0 = (tem - tice) / (tem * tice) - fac1 = fac0 * lv0 - fac2 = (dc_vap * log (tem / tice) + fac1) / rvgas - tablew (i) = e00 * exp (fac2) - enddo - -end subroutine qs_tablew - -! ======================================================================= -!>\ingroup fast_sat_adj -!! saturation water vapor pressure table iii. -! 2 - phase table -! ======================================================================= - -subroutine qs_table2 (n) - - implicit none - - integer, intent (in) :: n - real (kind_grid) :: delt = 0.1 - real (kind_grid) :: tmin, tem0, tem1, fac0, fac1, fac2 - integer :: i, i0, i1 - - tmin = tice - 160. - - do i = 1, n - tem0 = tmin + delt * real (i - 1) - fac0 = (tem0 - tice) / (tem0 * tice) - if (i <= 1600) then - ! ----------------------------------------------------------------------- - ! compute es over ice between - 160 deg c and 0 deg c. - ! ----------------------------------------------------------------------- - fac1 = fac0 * li2 - fac2 = (d2ice * log (tem0 / tice) + fac1) / rvgas - else - ! ----------------------------------------------------------------------- - ! compute es over water between 0 deg c and 102 deg c. - ! ----------------------------------------------------------------------- - fac1 = fac0 * lv0 - fac2 = (dc_vap * log (tem0 / tice) + fac1) / rvgas - endif - table2 (i) = e00 * exp (fac2) - enddo - - ! ----------------------------------------------------------------------- - ! smoother around 0 deg c - ! ----------------------------------------------------------------------- - - i0 = 1600 - i1 = 1601 - tem0 = 0.25 * (table2 (i0 - 1) + 2. * table (i0) + table2 (i0 + 1)) - tem1 = 0.25 * (table2 (i1 - 1) + 2. * table (i1) + table2 (i1 + 1)) - table2 (i0) = tem0 - table2 (i1) = tem1 - -end subroutine qs_table2 - -end module fv_sat_adj -!> @} diff --git a/physics/gitdiff b/physics/gitdiff deleted file mode 100644 index cba1236f22..0000000000 --- a/physics/gitdiff +++ /dev/null @@ -1,4397 +0,0 @@ -diff --git a/physics/GFS_DCNV_generic.F90 b/physics/GFS_DCNV_generic.F90 -index bfe97bc..def1e7f 100644 ---- a/physics/GFS_DCNV_generic.F90 -+++ b/physics/GFS_DCNV_generic.F90 -@@ -26,14 +26,14 @@ - - integer, intent(in) :: im, levs - logical, intent(in) :: ldiag3d, qdiag3d, do_cnvgwd, cplchm -- real(kind=kind_phys), dimension(im,levs), intent(in) :: gu0 -- real(kind=kind_phys), dimension(im,levs), intent(in) :: gv0 -- real(kind=kind_phys), dimension(im,levs), intent(in) :: gt0 -- real(kind=kind_phys), dimension(im,levs), intent(inout) :: gq0_water_vapor -- real(kind=kind_phys), dimension(im,levs), intent(inout) :: save_u -- real(kind=kind_phys), dimension(im,levs), intent(inout) :: save_v -- real(kind=kind_phys), dimension(im,levs), intent(inout) :: save_t -- real(kind=kind_phys), dimension(im,levs), intent(inout) :: save_qv -+ real(kind=kind_phys), dimension(:,:), intent(in) :: gu0 -+ real(kind=kind_phys), dimension(:,:), intent(in) :: gv0 -+ real(kind=kind_phys), dimension(:,:), intent(in) :: gt0 -+ real(kind=kind_phys), dimension(:,:), intent(inout) :: gq0_water_vapor -+ real(kind=kind_phys), dimension(:,:), intent(inout) :: save_u -+ real(kind=kind_phys), dimension(:,:), intent(inout) :: save_v -+ real(kind=kind_phys), dimension(:,:), intent(inout) :: save_t -+ real(kind=kind_phys), dimension(:,:), intent(inout) :: save_qv - ! dqdti only allocated if cplchm is .true. - real(kind=kind_phys), dimension(:,:), intent(inout) :: dqdti - character(len=*), intent(out) :: errmsg -@@ -107,18 +107,18 @@ - logical, intent(in) :: flag_for_dcnv_generic_tend - - real(kind=kind_phys), intent(in) :: frain, dtf -- real(kind=kind_phys), dimension(im), intent(in) :: rain1, cld1d -- real(kind=kind_phys), dimension(im,levs), intent(in) :: save_u, save_v, save_t, save_qv -- real(kind=kind_phys), dimension(im,levs), intent(in) :: gu0, gv0, gt0, gq0_water_vapor -- real(kind=kind_phys), dimension(im,levs), intent(in) :: ud_mf, dd_mf, dt_mf -+ real(kind=kind_phys), dimension(:), intent(in) :: rain1, cld1d -+ real(kind=kind_phys), dimension(:,:), intent(in) :: save_u, save_v, save_t, save_qv -+ real(kind=kind_phys), dimension(:,:), intent(in) :: gu0, gv0, gt0, gq0_water_vapor -+ real(kind=kind_phys), dimension(:,:), intent(in) :: ud_mf, dd_mf, dt_mf - real(kind=kind_phys), intent(in) :: con_g - integer, intent(in) :: npdf3d, num_p3d, ncnvcld3d - -- real(kind=kind_phys), dimension(im), intent(inout) :: rainc, cldwrk -+ real(kind=kind_phys), dimension(:), intent(inout) :: rainc, cldwrk - ! dt3dt, dq3dt, du3dt, dv3dt upd_mf, dwn_mf, det_mf only allocated if ldiag3d == .true. - real(kind=kind_phys), dimension(:,:), intent(inout) :: dt3dt, dq3dt, du3dt, dv3dt - real(kind=kind_phys), dimension(:,:), intent(inout) :: upd_mf, dwn_mf, det_mf -- real(kind=kind_phys), dimension(im,levs), intent(inout) :: cnvw, cnvc -+ real(kind=kind_phys), dimension(:,:), intent(inout) :: cnvw, cnvc - ! The following arrays may not be allocated, depending on certain flags and microphysics schemes. - ! Since Intel 15 crashes when passing unallocated arrays to arrays defined with explicit shape, - ! use assumed-shape arrays. Note that Intel 18 and GNU 6.2.0-8.1.0 tolerate explicit-shape arrays -diff --git a/physics/GFS_GWD_generic.F90 b/physics/GFS_GWD_generic.F90 -index 09c9691..a6c6dd4 100644 ---- a/physics/GFS_GWD_generic.F90 -+++ b/physics/GFS_GWD_generic.F90 -@@ -30,12 +30,12 @@ contains - real(kind=kind_phys), intent(in) :: mntvar(im,nmtvr) - - real(kind=kind_phys), intent(out) :: & -- & oc(im), oa4(im,4), clx(im,4), & -+ & oc(:), oa4(:,:), clx(:,:), & - & varss(:), ocss(:), oa4ss(:,:), clxss(:,:), & -- & theta(im), sigma(im), gamma(im), elvmax(im) -+ & theta(:), sigma(:), gamma(:), elvmax(:) - - logical, intent(in) :: lssav, ldiag3d, flag_for_gwd_generic_tend -- real(kind=kind_phys), intent(in) :: dtdt(im,levs), dudt(im,levs), dvdt(im,levs) -+ real(kind=kind_phys), intent(in) :: dtdt(:,:), dudt(:,:), dvdt(:,:) - ! dt3dt only allocated only if ldiag3d is .true. - real(kind=kind_phys), intent(inout) :: dt3dt(:,:), du3dt(:,:), dv3dt(:,:) - real(kind=kind_phys), intent(in) :: dtf -diff --git a/physics/GFS_MP_generic.F90 b/physics/GFS_MP_generic.F90 -index 8810cc7..be19536 100644 ---- a/physics/GFS_MP_generic.F90 -+++ b/physics/GFS_MP_generic.F90 -@@ -23,11 +23,11 @@ - implicit none - integer, intent(in) :: im, levs, ntcw, nncl, ntrac - logical, intent(in) :: ldiag3d, qdiag3d, do_aw -- real(kind=kind_phys), dimension(im, levs), intent(in) :: gt0 -- real(kind=kind_phys), dimension(im, levs, ntrac), intent(in) :: gq0 -+ real(kind=kind_phys), dimension(:,:), intent(in) :: gt0 -+ real(kind=kind_phys), dimension(:,:,:), intent(in) :: gq0 - -- real(kind=kind_phys), dimension(im, levs), intent(inout) :: save_t, save_qv -- real(kind=kind_phys), dimension(im, levs, ntrac), intent(inout) :: save_q -+ real(kind=kind_phys), dimension(:,:), intent(inout) :: save_t, save_qv -+ real(kind=kind_phys), dimension(:,:,:), intent(inout) :: save_q - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg -@@ -109,16 +109,16 @@ - logical, intent(in) :: cal_pre, lssav, ldiag3d, qdiag3d, cplflx, cplchm - - real(kind=kind_phys), intent(in) :: dtf, frain, con_g -- real(kind=kind_phys), dimension(im), intent(in) :: rain1, xlat, xlon, tsfc -- real(kind=kind_phys), dimension(im), intent(inout) :: ice, snow, graupel, rainc -- real(kind=kind_phys), dimension(im), intent(in) :: rain0, ice0, snow0, graupel0 -- real(kind=kind_phys), dimension(im,nrcm), intent(in) :: rann -- real(kind=kind_phys), dimension(im,levs), intent(in) :: gt0, prsl, save_t, save_qv, del -- real(kind=kind_phys), dimension(im,levs+1), intent(in) :: prsi, phii -- real(kind=kind_phys), dimension(im,levs,ntrac), intent(in) :: gq0 -- -- real(kind=kind_phys), dimension(im), intent(in ) :: sr -- real(kind=kind_phys), dimension(im), intent(inout) :: rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, & -+ real(kind=kind_phys), dimension(:), intent(in) :: rain1, xlat, xlon, tsfc -+ real(kind=kind_phys), dimension(:), intent(inout) :: ice, snow, graupel, rainc -+ real(kind=kind_phys), dimension(:), intent(in) :: rain0, ice0, snow0, graupel0 -+ real(kind=kind_phys), dimension(:,:), intent(in) :: rann -+ real(kind=kind_phys), dimension(:,:), intent(in) :: gt0, prsl, save_t, save_qv, del -+ real(kind=kind_phys), dimension(:,:), intent(in) :: prsi, phii -+ real(kind=kind_phys), dimension(:,:,:), intent(in) :: gq0 -+ -+ real(kind=kind_phys), dimension(:), intent(in ) :: sr -+ real(kind=kind_phys), dimension(:), intent(inout) :: rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, & - srflag, cnvprcp, totprcp, totice, totsnw, totgrp, cnvprcpb, & - totprcpb, toticeb, totsnwb, totgrpb, rain_cpl, rainc_cpl, & - snow_cpl, pwat -@@ -128,23 +128,23 @@ - - ! Stochastic physics / surface perturbations - logical, intent(in) :: do_sppt, ca_global -- real(kind=kind_phys), dimension(im,levs), intent(inout) :: dtdtr -- real(kind=kind_phys), dimension(im,levs), intent(in) :: dtdtc -- real(kind=kind_phys), dimension(im), intent(inout) :: drain_cpl -- real(kind=kind_phys), dimension(im), intent(inout) :: dsnow_cpl -+ real(kind=kind_phys), dimension(:,:), intent(inout) :: dtdtr -+ real(kind=kind_phys), dimension(:,:), intent(in) :: dtdtc -+ real(kind=kind_phys), dimension(:), intent(inout) :: drain_cpl -+ real(kind=kind_phys), dimension(:), intent(inout) :: dsnow_cpl - - ! Rainfall variables previous time step - integer, intent(in) :: lsm, lsm_ruc, lsm_noahmp -- real(kind=kind_phys), dimension(im), intent(inout) :: raincprv -- real(kind=kind_phys), dimension(im), intent(inout) :: rainncprv -- real(kind=kind_phys), dimension(im), intent(inout) :: iceprv -- real(kind=kind_phys), dimension(im), intent(inout) :: snowprv -- real(kind=kind_phys), dimension(im), intent(inout) :: graupelprv -- real(kind=kind_phys), dimension(im), intent(inout) :: draincprv -- real(kind=kind_phys), dimension(im), intent(inout) :: drainncprv -- real(kind=kind_phys), dimension(im), intent(inout) :: diceprv -- real(kind=kind_phys), dimension(im), intent(inout) :: dsnowprv -- real(kind=kind_phys), dimension(im), intent(inout) :: dgraupelprv -+ real(kind=kind_phys), dimension(:), intent(inout) :: raincprv -+ real(kind=kind_phys), dimension(:), intent(inout) :: rainncprv -+ real(kind=kind_phys), dimension(:), intent(inout) :: iceprv -+ real(kind=kind_phys), dimension(:), intent(inout) :: snowprv -+ real(kind=kind_phys), dimension(:), intent(inout) :: graupelprv -+ real(kind=kind_phys), dimension(:), intent(inout) :: draincprv -+ real(kind=kind_phys), dimension(:), intent(inout) :: drainncprv -+ real(kind=kind_phys), dimension(:), intent(inout) :: diceprv -+ real(kind=kind_phys), dimension(:), intent(inout) :: dsnowprv -+ real(kind=kind_phys), dimension(:), intent(inout) :: dgraupelprv - - real(kind=kind_phys), intent(in) :: dtp - -diff --git a/physics/GFS_PBL_generic.F90 b/physics/GFS_PBL_generic.F90 -index 357309b..95f6265 100644 ---- a/physics/GFS_PBL_generic.F90 -+++ b/physics/GFS_PBL_generic.F90 -@@ -101,11 +101,11 @@ - integer, intent(in) :: imp_physics_zhao_carr, imp_physics_mg, imp_physics_fer_hires - logical, intent(in) :: cplchm, ltaerosol, hybedmf, do_shoc, satmedmf - -- real(kind=kind_phys), dimension(im, levs, ntrac), intent(in) :: qgrs -- real(kind=kind_phys), dimension(im, levs), intent(in) :: ugrs, vgrs, tgrs -- real(kind=kind_phys), dimension(im, levs, nvdiff), intent(inout) :: vdftra -- real(kind=kind_phys), dimension(im, levs), intent(out) :: save_u, save_v, save_t -- real(kind=kind_phys), dimension(im, levs, ntrac), intent(out) :: save_q -+ real(kind=kind_phys), dimension(:,:,:), intent(in) :: qgrs -+ real(kind=kind_phys), dimension(:,:), intent(in) :: ugrs, vgrs, tgrs -+ real(kind=kind_phys), dimension(:,:, :), intent(inout) :: vdftra -+ real(kind=kind_phys), dimension(:,:), intent(out) :: save_u, save_v, save_t -+ real(kind=kind_phys), dimension(:,:, :), intent(out) :: save_q - - ! CCPP error handling variables - character(len=*), intent(out) :: errmsg -@@ -336,8 +336,8 @@ - logical, dimension(:), intent(in) :: flag_cice - - logical, intent(in) :: flag_for_pbl_generic_tend -- real(kind=kind_phys), dimension(im, levs), intent(in) :: save_u, save_v, save_t -- real(kind=kind_phys), dimension(im, levs, ntrac), intent(in) :: save_q -+ real(kind=kind_phys), dimension(:,:), intent(in) :: save_u, save_v, save_t -+ real(kind=kind_phys), dimension(:,:, :), intent(in) :: save_q - - real(kind=kind_phys), intent(in) :: dtf - real(kind=kind_phys), intent(in) :: rd, cp, fvirt, hvap -@@ -346,14 +346,14 @@ - real(kind=kind_phys), dimension(:), intent(in) :: dusfc_cice, dvsfc_cice, dtsfc_cice, dqsfc_cice, & - wind, stress_wat, hflx_wat, evap_wat, ugrs1, vgrs1 - -- real(kind=kind_phys), dimension(im, levs, ntrac), intent(in) :: qgrs -- real(kind=kind_phys), dimension(im, levs), intent(in) :: ugrs, vgrs, tgrs -+ real(kind=kind_phys), dimension(:,:, :), intent(in) :: qgrs -+ real(kind=kind_phys), dimension(:,:), intent(in) :: ugrs, vgrs, tgrs - -- real(kind=kind_phys), dimension(im, levs, nvdiff), intent(in) :: dvdftra -- real(kind=kind_phys), dimension(im), intent(in) :: dusfc1, dvsfc1, dtsfc1, dqsfc1, xmu -- real(kind=kind_phys), dimension(im, levs), intent(in) :: dudt, dvdt, dtdt, htrsw, htrlw -+ real(kind=kind_phys), dimension(:,:, :), intent(in) :: dvdftra -+ real(kind=kind_phys), dimension(:), intent(in) :: dusfc1, dvsfc1, dtsfc1, dqsfc1, xmu -+ real(kind=kind_phys), dimension(:,:), intent(in) :: dudt, dvdt, dtdt, htrsw, htrlw - -- real(kind=kind_phys), dimension(im, levs, ntrac), intent(inout) :: dqdt -+ real(kind=kind_phys), dimension(:,:, :), intent(inout) :: dqdt - - ! The following arrays may not be allocated, depending on certain flags (cplflx, ...). - ! Since Intel 15 crashes when passing unallocated arrays to arrays defined with explicit shape, -@@ -370,7 +370,7 @@ - real(kind=kind_phys), dimension(:,:), intent(in) :: dkt - - ! From canopy heat storage - reduction factors in latent/sensible heat flux due to surface roughness -- real(kind=kind_phys), dimension(im), intent(in) :: hffac, hefac -+ real(kind=kind_phys), dimension(:), intent(in) :: hffac, hefac - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg -diff --git a/physics/GFS_SCNV_generic.F90 b/physics/GFS_SCNV_generic.F90 -index ae8fac5..450f0e5 100644 ---- a/physics/GFS_SCNV_generic.F90 -+++ b/physics/GFS_SCNV_generic.F90 -@@ -23,9 +23,9 @@ - - integer, intent(in) :: im, levs - logical, intent(in) :: ldiag3d, qdiag3d, flag_for_scnv_generic_tend -- real(kind=kind_phys), dimension(im,levs), intent(in) :: gu0, gv0, gt0, gq0_water_vapor -+ real(kind=kind_phys), dimension(:, :), intent(in) :: gu0, gv0, gt0, gq0_water_vapor - -- real(kind=kind_phys), dimension(im,levs), intent(inout) :: save_u, save_v, save_t, save_qv -+ real(kind=kind_phys), dimension(:, :), intent(inout) :: save_u, save_v, save_t, save_qv - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - -@@ -84,20 +84,20 @@ - integer, intent(in) :: im, levs, nn - logical, intent(in) :: lssav, ldiag3d, qdiag3d, cplchm, flag_for_scnv_generic_tend - real(kind=kind_phys), intent(in) :: frain -- real(kind=kind_phys), dimension(im,levs), intent(in) :: gu0, gv0, gt0, gq0_water_vapor -- real(kind=kind_phys), dimension(im,levs), intent(in) :: save_u, save_v, save_t, save_qv -+ real(kind=kind_phys), dimension(:, :), intent(in) :: gu0, gv0, gt0, gq0_water_vapor -+ real(kind=kind_phys), dimension(:, :), intent(in) :: save_u, save_v, save_t, save_qv - - ! dqdti, dt3dt, dq3dt, only allocated if ldiag3d == .true. - real(kind=kind_phys), dimension(:,:), intent(inout) :: dqdti - real(kind=kind_phys), dimension(:,:), intent(inout) :: du3dt, dv3dt, dt3dt, dq3dt -- real(kind=kind_phys), dimension(im,levs,nn), intent(inout) :: clw -+ real(kind=kind_phys), dimension(:, :,:), intent(inout) :: clw - - ! Post code for SAS/SAMF - integer, intent(in) :: npdf3d, num_p3d, ncnvcld3d - logical, intent(in) :: shcnvcw -- real(kind=kind_phys), dimension(im), intent(in) :: rain1 -- real(kind=kind_phys), dimension(im,levs), intent(in) :: cnvw, cnvc -- real(kind=kind_phys), dimension(im), intent(inout) :: rainc, cnvprcp, cnvprcpb -+ real(kind=kind_phys), dimension(:), intent(in) :: rain1 -+ real(kind=kind_phys), dimension(:, :), intent(in) :: cnvw, cnvc -+ real(kind=kind_phys), dimension(:), intent(inout) :: rainc, cnvprcp, cnvprcpb - ! The following arrays may not be allocated, depending on certain flags and microphysics schemes. - ! Since Intel 15 crashes when passing unallocated arrays to arrays defined with explicit shape, - ! use assumed-shape arrays. Note that Intel 18 and GNU 6.2.0-8.1.0 tolerate explicit-shape arrays -diff --git a/physics/GFS_cloud_diagnostics.F90 b/physics/GFS_cloud_diagnostics.F90 -index c62cc68..f5d09cd 100644 ---- a/physics/GFS_cloud_diagnostics.F90 -+++ b/physics/GFS_cloud_diagnostics.F90 -@@ -53,15 +53,15 @@ contains - lslwr ! Call LW radiation - real(kind_phys), intent(in) :: & - con_pi ! Physical constant: pi -- real(kind_phys), dimension(nCol), intent(in) :: & -+ real(kind_phys), dimension(:), intent(in) :: & - lat, & ! Latitude - de_lgth ! Decorrelation length -- real(kind_phys), dimension(nCol,nLev), intent(in) :: & -+ real(kind_phys), dimension(:,:), intent(in) :: & - p_lay, & ! Pressure at model-layer - cld_frac ! Total cloud fraction -- real(kind_phys), dimension(nCol,nLev+1), intent(in) :: & -+ real(kind_phys), dimension(:,:), intent(in) :: & - p_lev ! Pressure at model interfaces -- real(kind_phys), dimension(nCol,nLev), intent(in) :: & -+ real(kind_phys), dimension(:,:), intent(in) :: & - deltaZ, & ! Layer thickness (km) - cloud_overlap_param, & ! Cloud-overlap parameter - precip_overlap_param ! Precipitation overlap parameter -@@ -71,10 +71,10 @@ contains - errmsg ! Error message - integer, intent(out) :: & - errflg ! Error flag -- integer,dimension(ncol,3),intent(out) :: & -+ integer,dimension(:,:),intent(out) :: & - mbota, & ! Vertical indices for cloud tops - mtopa ! Vertical indices for cloud bases -- real(kind_phys), dimension(ncol,5), intent(out) :: & -+ real(kind_phys), dimension(:,:), intent(out) :: & - cldsa ! Fraction of clouds for low, middle, high, total and BL - - ! Local variables -@@ -136,7 +136,7 @@ contains - integer, intent(in) :: & - nLev, & ! Number of vertical-layers - mpi_rank -- real(kind_phys), dimension(nLev+1), intent(in) :: & -+ real(kind_phys), dimension(:), intent(in) :: & - sigmainit - ! Outputs - integer, intent(out) :: & -diff --git a/physics/GFS_debug.F90 b/physics/GFS_debug.F90 -index 0562324..3c358a2 100644 ---- a/physics/GFS_debug.F90 -+++ b/physics/GFS_debug.F90 -@@ -970,29 +970,29 @@ - integer, intent(in ) :: im - integer, intent(in ) :: kdt - integer, intent(in ) :: iter -- logical, intent(in ) :: flag_iter(im) -- logical, intent(in ) :: flag_guess(im) -+ logical, intent(in ) :: flag_iter(:) -+ logical, intent(in ) :: flag_guess(:) - logical, intent(in ) :: flag_init - logical, intent(in ) :: flag_restart - logical, intent(in ) :: frac_grid - integer, intent(in ) :: isot - integer, intent(in ) :: ivegsrc -- real(kind_phys), intent(in ) :: stype(im) -- real(kind_phys), intent(in ) :: vtype(im) -- real(kind_phys), intent(in ) :: slope(im) -- integer, intent(in ) :: soiltyp(im) -- integer, intent(in ) :: vegtype(im) -- integer, intent(in ) :: slopetyp(im) -- logical, intent(in ) :: dry(im) -- logical, intent(in ) :: icy(im) -- logical, intent(in ) :: wet(im) -- logical, intent(in ) :: lake(im) -- logical, intent(in ) :: ocean(im) -- real(kind_phys), intent(in ) :: oceanfrac(im) -- real(kind_phys), intent(in ) :: landfrac(im) -- real(kind_phys), intent(in ) :: lakefrac(im) -- real(kind_phys), intent(in ) :: slmsk(im) -- integer, intent(in ) :: islmsk(im) -+ real(kind_phys), intent(in ) :: stype(:) -+ real(kind_phys), intent(in ) :: vtype(:) -+ real(kind_phys), intent(in ) :: slope(:) -+ integer, intent(in ) :: soiltyp(:) -+ integer, intent(in ) :: vegtype(:) -+ integer, intent(in ) :: slopetyp(:) -+ logical, intent(in ) :: dry(:) -+ logical, intent(in ) :: icy(:) -+ logical, intent(in ) :: wet(:) -+ logical, intent(in ) :: lake(:) -+ logical, intent(in ) :: ocean(:) -+ real(kind_phys), intent(in ) :: oceanfrac(:) -+ real(kind_phys), intent(in ) :: landfrac(:) -+ real(kind_phys), intent(in ) :: lakefrac(:) -+ real(kind_phys), intent(in ) :: slmsk(:) -+ integer, intent(in ) :: islmsk(:) - character(len=*), intent( out) :: errmsg - integer, intent( out) :: errflg - -diff --git a/physics/GFS_rrtmg_post.F90 b/physics/GFS_rrtmg_post.F90 -index 7f80ca4..82cc4c8 100644 ---- a/physics/GFS_rrtmg_post.F90 -+++ b/physics/GFS_rrtmg_post.F90 -@@ -39,17 +39,17 @@ - type(GFS_coupling_type), intent(inout) :: Coupling - type(GFS_radtend_type), intent(in) :: Radtend - type(GFS_diag_type), intent(inout) :: Diag -- type(cmpfsw_type), dimension(size(Grid%xlon,1)), intent(in) :: scmpsw -+ type(cmpfsw_type), dimension(:), intent(in) :: scmpsw - - integer, intent(in) :: im, lm, ltp, kt, kb, kd, nday - real(kind=kind_phys), intent(in) :: raddt - -- real(kind=kind_phys), dimension(size(Grid%xlon,1),NSPC1), intent(in) :: aerodp -- real(kind=kind_phys), dimension(size(Grid%xlon,1),5), intent(in) :: cldsa -- integer, dimension(size(Grid%xlon,1),3), intent(in) :: mbota, mtopa -- real(kind=kind_phys), dimension(size(Grid%xlon,1),lm+LTP), intent(in) :: clouds1 -- real(kind=kind_phys), dimension(size(Grid%xlon,1),lm+LTP), intent(in) :: cldtausw -- real(kind=kind_phys), dimension(size(Grid%xlon,1),lm+LTP), intent(in) :: cldtaulw -+ real(kind=kind_phys), dimension(:,:), intent(in) :: aerodp -+ real(kind=kind_phys), dimension(:,:), intent(in) :: cldsa -+ integer, dimension(:,:), intent(in) :: mbota, mtopa -+ real(kind=kind_phys), dimension(:,:), intent(in) :: clouds1 -+ real(kind=kind_phys), dimension(:,:), intent(in) :: cldtausw -+ real(kind=kind_phys), dimension(:,:), intent(in) :: cldtaulw - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg -diff --git a/physics/GFS_rrtmg_pre.F90 b/physics/GFS_rrtmg_pre.F90 -index ca76955..514ea87 100644 ---- a/physics/GFS_rrtmg_pre.F90 -+++ b/physics/GFS_rrtmg_pre.F90 -@@ -95,39 +95,39 @@ - integer, intent(out) :: kd, kt, kb - - ! F-A mp scheme only -- real(kind=kind_phys), dimension(size(Grid%xlon,1),lm+LTP), intent(in) :: f_ice, & -+ real(kind=kind_phys), dimension(:, :), intent(in) :: f_ice, & - f_rain, f_rimef -- real(kind=kind_phys), dimension(size(Grid%xlon,1),lm+LTP), intent(out) :: cwm -- real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(in) :: flgmin -+ real(kind=kind_phys), dimension(:, :), intent(out) :: cwm -+ real(kind=kind_phys), dimension(:), intent(in) :: flgmin - real(kind=kind_phys), intent(out) :: raddt - -- real(kind=kind_phys), dimension(size(Grid%xlon,1),lm+LTP), intent(out) :: delp, & -+ real(kind=kind_phys), dimension(:, :), intent(out) :: delp, & - dz, plyr, tlyr, qlyr, olyr - -- real(kind=kind_phys), dimension(size(Grid%xlon,1),lm+1+LTP), intent(out) :: plvl, tlvl -+ real(kind=kind_phys), dimension(:, :), intent(out) :: plvl, tlvl - -- real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(out) :: tsfg, tsfa -+ real(kind=kind_phys), dimension(:), intent(out) :: tsfg, tsfa - -- real(kind=kind_phys), dimension(size(Grid%xlon,1),lm+LTP), intent(out) :: gasvmr_co2, & -+ real(kind=kind_phys), dimension(:, :), intent(out) :: gasvmr_co2, & - gasvmr_n2o, gasvmr_ch4, gasvmr_o2, gasvmr_co, gasvmr_cfc11, & - gasvmr_cfc12, gasvmr_cfc22, gasvmr_ccl4, gasvmr_cfc113 - -- real(kind=kind_phys), dimension(size(Grid%xlon,1),lm+LTP,NBDSW), intent(out) :: faersw1, & -+ real(kind=kind_phys), dimension(:,:,:), intent(out) :: faersw1, & - faersw2, faersw3 - -- real(kind=kind_phys), dimension(size(Grid%xlon,1),lm+LTP,NBDLW), intent(out) :: faerlw1, & -+ real(kind=kind_phys), dimension(:,:,:), intent(out) :: faerlw1, & - faerlw2, faerlw3 - -- real(kind=kind_phys), dimension(size(Grid%xlon,1),NSPC1), intent(out) :: aerodp -+ real(kind=kind_phys), dimension(:,:), intent(out) :: aerodp - -- real(kind=kind_phys), dimension(size(Grid%xlon,1),lm+LTP), intent(inout) :: clouds1, & -+ real(kind=kind_phys), dimension(:,:), intent(inout) :: clouds1, & - clouds2, clouds3, clouds4, clouds5 -- real(kind=kind_phys), dimension(size(Grid%xlon,1),lm+LTP), intent(out) :: clouds6, & -+ real(kind=kind_phys), dimension(:,:), intent(out) :: clouds6, & - clouds7, clouds8, clouds9 - -- real(kind=kind_phys), dimension(size(Grid%xlon,1),5), intent(out) :: cldsa -- integer, dimension(size(Grid%xlon,1),3), intent(out) :: mbota, mtopa -- real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(out) :: de_lgth, alb1d -+ real(kind=kind_phys), dimension(:,:), intent(out) :: cldsa -+ integer, dimension(:,:), intent(out) :: mbota, mtopa -+ real(kind=kind_phys), dimension(:), intent(out) :: de_lgth, alb1d - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg -diff --git a/physics/GFS_rrtmgp_gfdlmp_pre.F90 b/physics/GFS_rrtmgp_gfdlmp_pre.F90 -index b67b22d..a11f03c 100644 ---- a/physics/GFS_rrtmgp_gfdlmp_pre.F90 -+++ b/physics/GFS_rrtmgp_gfdlmp_pre.F90 -@@ -62,24 +62,24 @@ contains - con_g, & ! Physical constant: gravitational constant - con_rd, & ! Physical constant: gas-constant for dry air - con_epsq ! Physical constant(?): Minimum value for specific humidity -- real(kind_phys), dimension(nCol), intent(in) :: & -+ real(kind_phys), dimension(:), intent(in) :: & - lat ! Latitude -- real(kind_phys), dimension(nCol,nLev), intent(in) :: & -+ real(kind_phys), dimension(:, :), intent(in) :: & - tv_lay, & ! Virtual temperature (K) - p_lay, & ! Pressure at model-layers (Pa) - effrin_cldliq, & ! Effective radius for liquid cloud-particles (microns) - effrin_cldice, & ! Effective radius for ice cloud-particles (microns) - effrin_cldrain, & ! Effective radius for rain cloud-particles (microns) - effrin_cldsnow ! Effective radius for snow cloud-particles (microns) -- real(kind_phys), dimension(nCol,nLev+1), intent(in) :: & -+ real(kind_phys), dimension(:, :), intent(in) :: & - p_lev ! Pressure at model-level interfaces (Pa) -- real(kind_phys), dimension(nCol, nLev, nTracers),intent(in) :: & -+ real(kind_phys), dimension(:, :, :),intent(in) :: & - tracer ! Cloud condensate amount in layer by type () - - ! Outputs -- real(kind_phys), dimension(nCol),intent(out) :: & -+ real(kind_phys), dimension(:),intent(out) :: & - de_lgth ! Decorrelation length -- real(kind_phys), dimension(nCol,nLev),intent(out) :: & -+ real(kind_phys), dimension(:, :),intent(out) :: & - cld_frac, & ! Total cloud fraction - cld_lwp, & ! Cloud liquid water path - cld_reliq, & ! Cloud liquid effective radius -diff --git a/physics/GFS_rrtmgp_lw_post.F90 b/physics/GFS_rrtmgp_lw_post.F90 -index a6b37ac..b508996 100644 ---- a/physics/GFS_rrtmgp_lw_post.F90 -+++ b/physics/GFS_rrtmgp_lw_post.F90 -@@ -39,11 +39,11 @@ contains - save_diag ! Output radiation diagnostics? - real(kind_phys), intent(in) :: & - fhlwr ! Frequency for SW radiation -- real(kind_phys), dimension(nCol), intent(in) :: & -+ real(kind_phys), dimension(:), intent(in) :: & - tsfa ! Lowest model layer air temperature for radiation (K) -- real(kind_phys), dimension(nCol, nLev), intent(in) :: & -+ real(kind_phys), dimension(:, :), intent(in) :: & - t_lay ! Temperature @ model layer centers (K) -- real(kind_phys), dimension(nCol, nLev+1), intent(in) :: & -+ real(kind_phys), dimension(:, :), intent(in) :: & - p_lev, & ! Pressure @ model layer-interfaces (Pa) - fluxlwUP_allsky, & ! RRTMGP longwave all-sky flux (W/m2) - fluxlwDOWN_allsky, & ! RRTMGP longwave all-sky flux (W/m2) -@@ -51,26 +51,26 @@ contains - fluxlwDOWN_clrsky ! RRTMGP longwave clear-sky flux (W/m2) - real(kind_phys), intent(in) :: & - raddt ! Radiation time step -- real(kind_phys), dimension(nCol,NSPC1), intent(in) :: & -+ real(kind_phys), dimension(:, :), intent(in) :: & - aerodp ! Vertical integrated optical depth for various aerosol species -- real(kind_phys), dimension(nCol,5), intent(in) :: & -+ real(kind_phys), dimension(:, :), intent(in) :: & - cldsa ! Fraction of clouds for low, middle, high, total and BL -- integer, dimension(nCol,3), intent(in) ::& -+ integer, dimension(:, :), intent(in) ::& - mbota, & ! vertical indices for low, middle and high cloud tops - mtopa ! vertical indices for low, middle and high cloud bases -- real(kind_phys), dimension(nCol,nLev), intent(in) :: & -+ real(kind_phys), dimension(:, :), intent(in) :: & - cld_frac, & ! Total cloud fraction in each layer - cldtaulw ! approx 10.mu band layer cloud optical depth - - ! Outputs (mandatory) -- real(kind_phys), dimension(nCol), intent(out) :: & -+ real(kind_phys), dimension(:), intent(out) :: & - sfcdlw, & ! Total sky sfc downward lw flux (W/m2) - tsflw ! surface air temp during lw calculation (K) -- type(sfcflw_type), dimension(nCol), intent(out) :: & -+ type(sfcflw_type), dimension(:), intent(out) :: & - sfcflw ! LW radiation fluxes at sfc -- real(kind_phys), dimension(nCol,nLev), intent(out) :: & -+ real(kind_phys), dimension(:, :), intent(out) :: & - htrlw ! LW all-sky heating rate -- type(topflw_type), dimension(nCol), intent(out) :: & -+ type(topflw_type), dimension(:), intent(out) :: & - topflw ! lw_fluxes_top_atmosphere - character(len=*), intent(out) :: & - errmsg -@@ -78,13 +78,13 @@ contains - errflg - - ! Outputs (optional) -- type(proflw_type), dimension(nCol, nLev+1), optional, intent(out) :: & -+ type(proflw_type), dimension(:, :), optional, intent(out) :: & - flxprf_lw ! 2D radiative fluxes, components: - ! upfxc - total sky upward flux (W/m2) - ! dnfxc - total sky dnward flux (W/m2) - ! upfx0 - clear sky upward flux (W/m2) - ! dnfx0 - clear sky dnward flux (W/m2) -- real(kind_phys),dimension(nCol, nLev),intent(out),optional :: & -+ real(kind_phys),dimension(:, :),intent(out),optional :: & - htrlwc ! Longwave clear-sky heating-rate (K/sec) - - ! Local variables -diff --git a/physics/GFS_rrtmgp_pre.F90 b/physics/GFS_rrtmgp_pre.F90 -index 0e5d65f..7d66339 100644 ---- a/physics/GFS_rrtmgp_pre.F90 -+++ b/physics/GFS_rrtmgp_pre.F90 -@@ -52,7 +52,7 @@ contains - character(len=*), intent(in) :: & - active_gases ! List of active gases from namelist. - ! Outputs -- character(len=*),dimension(nGases), intent(out) :: & -+ character(len=*),dimension(:), intent(out) :: & - active_gases_array ! Character array containing trace gases to include in RRTMGP - character(len=*), intent(out) :: & - errmsg ! Error message -@@ -159,7 +159,7 @@ contains - logical, intent(in) :: & - lsswr, & ! Call SW radiation? - lslwr ! Call LW radiation -- character(len=*),dimension(nGases), intent(in) :: & -+ character(len=*),dimension(:), intent(in) :: & - active_gases_array ! Character array containing trace gases to include in RRTMGP - real(kind_phys), intent(in) :: & - fhswr, & ! Frequency of SW radiation call. -@@ -169,11 +169,11 @@ contains - con_epsm1, & ! Physical constant: Epsilon (Rd/Rv) minus one - con_fvirt, & ! Physical constant: Inverse of epsilon minus one - con_epsqs ! Physical constant: Minimum saturation mixing-ratio (kg/kg) -- real(kind_phys), dimension(nCol), intent(in) :: & -+ real(kind_phys), dimension(:), intent(in) :: & - xlon, & ! Longitude - xlat, & ! Latitude - tsfc ! Surface skin temperature (K) -- real(kind_phys), dimension(nCol,nLev), intent(in) :: & -+ real(kind_phys), dimension(:, :), intent(in) :: & - prsl, & ! Pressure at model-layer centers (Pa) - tgrs, & ! Temperature at model-layer centers (K) - prslk ! Exner function at model layer centers (1) -@@ -189,18 +189,18 @@ contains - errflg ! Error flag - real(kind_phys), intent(out) :: & - raddt ! Radiation time-step -- real(kind_phys), dimension(ncol), intent(out) :: & -+ real(kind_phys), dimension(:), intent(out) :: & - tsfg, & ! Ground temperature - tsfa ! Skin temperature -- real(kind_phys), dimension(nCol,nLev), intent(out) :: & -+ real(kind_phys), dimension(:, :), intent(out) :: & - p_lay, & ! Pressure at model-layer - t_lay, & ! Temperature at model layer - tv_lay, & ! Virtual temperature at model-layers - relhum ! Relative-humidity at model-layers -- real(kind_phys), dimension(nCol,nLev+1), intent(out) :: & -+ real(kind_phys), dimension(:, :), intent(out) :: & - p_lev, & ! Pressure at model-interface - t_lev ! Temperature at model-interface -- real(kind_phys), dimension(nCol, nLev, nTracers),intent(out) :: & -+ real(kind_phys), dimension(:, :,:),intent(out) :: & - tracer ! Array containing trace gases - type(ty_gas_concs),intent(out) :: & - gas_concentrations ! RRTMGP DDT: gas volumne mixing ratios -diff --git a/physics/GFS_rrtmgp_setup.F90 b/physics/GFS_rrtmgp_setup.F90 -index 9b503e3..acc3024 100644 ---- a/physics/GFS_rrtmgp_setup.F90 -+++ b/physics/GFS_rrtmgp_setup.F90 -@@ -54,14 +54,14 @@ module GFS_rrtmgp_setup - imp_physics_zhao_carr, & ! Flag for zhao-carr scheme - imp_physics_zhao_carr_pdf, & ! Flag for zhao-carr+PDF scheme - imp_physics_mg ! Flag for MG scheme -- real(kind_phys), dimension(levr+1), intent(in) :: & -+ real(kind_phys), dimension(:), intent(in) :: & - si - integer, intent(in) :: levr, ictm, isol, ico2, iaer, ialb, iems, & - ntcw, num_p3d, ntoz, iovr_sw, iovr_lw, isubc_sw, isubc_lw, & - icliq_sw, iflip, me - logical, intent(in) :: & - crick_proof, ccnorm, norad_precip -- integer, intent(in), dimension(4) :: & -+ integer, intent(in), dimension(:) :: & - idate - ! Outputs - character(len=*), intent(out) :: errmsg -diff --git a/physics/GFS_rrtmgp_sw_post.F90 b/physics/GFS_rrtmgp_sw_post.F90 -index 0d3991f..8fdf3fa 100644 ---- a/physics/GFS_rrtmgp_sw_post.F90 -+++ b/physics/GFS_rrtmgp_sw_post.F90 -@@ -37,7 +37,7 @@ contains - nCol, & ! Horizontal loop extent - nLev, & ! Number of vertical layers - nDay ! Number of daylit columns -- integer, intent(in), dimension(nday) :: & -+ integer, intent(in), dimension(:) :: & - idxday ! Index array for daytime points - logical, intent(in) :: & - lsswr, & ! Call SW radiation? -@@ -47,37 +47,37 @@ contains - sw_gas_props ! DDT containing SW spectral information - real(kind_phys), intent(in) :: & - fhswr ! Frequency for SW radiation -- real(kind_phys), dimension(nCol), intent(in) :: & -+ real(kind_phys), dimension(ncol), intent(in) :: & - t_lay, & ! Temperature at model layer centers (K) - coszen, & ! Cosine(SZA) - coszdg ! Cosine(SZA), daytime -- real(kind_phys), dimension(nCol, nLev+1), intent(in) :: & -+ real(kind_phys), dimension(:, :), intent(in) :: & - p_lev ! Pressure @ model layer-interfaces (Pa) -- real(kind_phys), dimension(sw_gas_props%get_nband(),ncol), intent(in) :: & -+ real(kind_phys), dimension(:, :), intent(in) :: & - sfc_alb_nir_dir, & ! Surface albedo (direct) - sfc_alb_nir_dif, & ! Surface albedo (diffuse) - sfc_alb_uvvis_dir, & ! Surface albedo (direct) - sfc_alb_uvvis_dif ! Surface albedo (diffuse) -- real(kind_phys), dimension(nCol, nLev+1), intent(in) :: & -+ real(kind_phys), dimension(:, :), intent(in) :: & - fluxswUP_allsky, & ! SW All-sky flux (W/m2) - fluxswDOWN_allsky, & ! SW All-sky flux (W/m2) - fluxswUP_clrsky, & ! SW Clear-sky flux (W/m2) - fluxswDOWN_clrsky ! SW All-sky flux (W/m2) - real(kind_phys), intent(in) :: & - raddt ! Radiation time step -- real(kind_phys), dimension(nCol,NSPC1), intent(in) :: & -+ real(kind_phys), dimension(:, :), intent(in) :: & - aerodp ! Vertical integrated optical depth for various aerosol species -- real(kind_phys), dimension(nCol,5), intent(in) :: & -+ real(kind_phys), dimension(:, :), intent(in) :: & - cldsa ! Fraction of clouds for low, middle, high, total and BL -- integer, dimension(nCol,3), intent(in) ::& -+ integer, dimension(:, :), intent(in) ::& - mbota, & ! vertical indices for low, middle and high cloud tops - mtopa ! vertical indices for low, middle and high cloud bases -- real(kind_phys), dimension(nCol,nLev), intent(in) :: & -+ real(kind_phys), dimension(:, :), intent(in) :: & - cld_frac, & ! Total cloud fraction in each layer - cldtausw ! approx .55mu band layer cloud optical depth - - ! Inputs (optional) -- type(cmpfsw_type), dimension(nCol), intent(in), optional :: & -+ type(cmpfsw_type), dimension(:), intent(in), optional :: & - scmpsw ! 2D surface fluxes, components: - ! uvbfc - total sky downward uv-b flux at (W/m2) - ! uvbf0 - clear sky downward uv-b flux at (W/m2) -@@ -87,7 +87,7 @@ contains - ! visdf - downward uv+vis diffused flux (W/m2) - - ! Outputs (mandatory) -- real(kind_phys), dimension(nCol), intent(out) :: & -+ real(kind_phys), dimension(:), intent(out) :: & - nirbmdi, & ! sfc nir beam sw downward flux (W/m2) - nirdfdi, & ! sfc nir diff sw downward flux (W/m2) - visbmdi, & ! sfc uv+vis beam sw downward flux (W/m2) -@@ -98,11 +98,11 @@ contains - visdfui, & ! sfc uv+vis diff sw upward flux (W/m2) - sfcnsw, & ! total sky sfc netsw flx into ground - sfcdsw ! -- real(kind_phys), dimension(nCol,nLev), intent(out) :: & -+ real(kind_phys), dimension(:, :), intent(out) :: & - htrsw ! SW all-sky heating rate -- type(sfcfsw_type), dimension(nCol), intent(out) :: & -+ type(sfcfsw_type), dimension(:), intent(out) :: & - sfcfsw ! sw radiation fluxes at sfc -- type(topfsw_type), dimension(nCol), intent(out) :: & -+ type(topfsw_type), dimension(:), intent(out) :: & - topfsw ! sw_fluxes_top_atmosphere - character(len=*), intent(out) :: & - errmsg -@@ -110,13 +110,13 @@ contains - errflg - - ! Outputs (optional) -- type(profsw_type), dimension(nCol, nLev), intent(out), optional :: & -+ type(profsw_type), dimension(:, :), intent(out), optional :: & - flxprf_sw ! 2D radiative fluxes, components: - ! upfxc - total sky upward flux (W/m2) - ! dnfxc - total sky dnward flux (W/m2) - ! upfx0 - clear sky upward flux (W/m2) - ! dnfx0 - clear sky dnward flux (W/m2) -- real(kind_phys),dimension(nCol, nLev),intent(out),optional :: & -+ real(kind_phys),dimension(:, :),intent(out),optional :: & - htrswc ! Clear-sky heating rate (K/s) - - ! Local variables -diff --git a/physics/GFS_rrtmgp_sw_pre.F90 b/physics/GFS_rrtmgp_sw_pre.F90 -index c4208d8..5c741a7 100644 ---- a/physics/GFS_rrtmgp_sw_pre.F90 -+++ b/physics/GFS_rrtmgp_sw_pre.F90 -@@ -45,9 +45,9 @@ contains - do_sfcperts - real(kind_phys), intent(in) :: & - solhr ! Time in hours after 00z at the current timestep -- real(kind_phys), dimension(5), intent(in) :: & -+ real(kind_phys), dimension(:), intent(in) :: & - pertalb ! Magnitude of surface albedo perturbation (frac) -- real(kind_phys), dimension(nCol), intent(in) :: & -+ real(kind_phys), dimension(:), intent(in) :: & - lsmask, & ! Landmask: sea/land/ice=0/1/2 - lon, & ! Longitude - coslat, & ! Cosine(latitude) -@@ -66,13 +66,13 @@ contains - facwf, & ! Fractional coverage with weak cosz dependency (frac) - fice, & ! Ice fraction over open water (frac) - tisfc ! Sea ice surface skin temperature (K) -- real(kind_phys), dimension(nCol,nsfcpert), intent(in) :: & -+ real(kind_phys), dimension(:, :), intent(in) :: & - sfc_wts ! Weights for stochastic surface physics perturbation () -- real(kind_phys), dimension(nCol,nLev),intent(in) :: & -+ real(kind_phys), dimension(:, :),intent(in) :: & - p_lay, & ! Layer pressure - tv_lay, & ! Layer virtual-temperature - relhum ! Layer relative-humidity -- real(kind_phys), dimension(nCol,nLev+1),intent(in) :: & -+ real(kind_phys), dimension(:, :),intent(in) :: & - p_lev ! Pressure @ layer interfaces (Pa) - type(ty_gas_optics_rrtmgp),intent(in) :: & - sw_gas_props ! RRTMGP DDT: spectral information for SW calculation -@@ -80,14 +80,14 @@ contains - ! Outputs - integer, intent(out) :: & - nday ! Number of daylit points -- integer, dimension(ncol), intent(out) :: & -+ integer, dimension(:), intent(out) :: & - idxday ! Indices for daylit points -- real(kind_phys), dimension(ncol), intent(out) :: & -+ real(kind_phys), dimension(:), intent(out) :: & - alb1d, & ! Surface albedo pertubation - coszen, & ! Cosine of SZA - coszdg, & ! Cosine of SZA, daytime - sfc_alb_dif ! Mean surface diffused (nIR+uvvis) sw albedo -- real(kind_phys), dimension(sw_gas_props%get_nband(),ncol), intent(out) :: & -+ real(kind_phys), dimension(:, :), intent(out) :: & - sfc_alb_nir_dir, & ! Surface albedo (direct) - sfc_alb_nir_dif, & ! Surface albedo (diffuse) - sfc_alb_uvvis_dir, & ! Surface albedo (direct) -diff --git a/physics/GFS_rrtmgp_zhaocarr_pre.F90 b/physics/GFS_rrtmgp_zhaocarr_pre.F90 -index ac9fb74..0be3be7 100644 ---- a/physics/GFS_rrtmgp_zhaocarr_pre.F90 -+++ b/physics/GFS_rrtmgp_zhaocarr_pre.F90 -@@ -59,10 +59,10 @@ contains - con_ttp, & ! Triple point temperature of water (K) - con_rd, & ! Ideal gas constant for dry air (J/kg/K) - con_pi ! Pi -- real(kind_phys), dimension(nCol), intent(in) :: & -+ real(kind_phys), dimension(:), intent(in) :: & - lsmask, & ! Land/Sea mask - lat ! Latitude -- real(kind_phys), dimension(nCol,nLev), intent(in) :: & -+ real(kind_phys), dimension(:, :), intent(in) :: & - tv_lay, & ! Virtual temperature (K) - p_lay, & ! Pressure at model-layers (Pa) - t_lay, & ! Temperature at model-layers (K) -@@ -73,15 +73,15 @@ contains - effrin_cldsnow, & ! Effective radius for snow cloud-particles (microns) - shoc_sgs_cldfrac, & ! Subgrid-scale cloud fraction from the SHOC scheme - cncvw ! Convective cloud water mixing ratio (kg/kg) -- real(kind_phys), dimension(nCol,nLev+1), intent(in) :: & -+ real(kind_phys), dimension(:, :), intent(in) :: & - p_lev ! Pressure at model-level interfaces (Pa) -- real(kind_phys), dimension(nCol, nLev, nTracers),intent(in) :: & -+ real(kind_phys), dimension(:, :, :),intent(in) :: & - tracer ! Cloud condensate amount in layer by type () - - ! Outputs -- real(kind_phys), dimension(nCol),intent(out) :: & -+ real(kind_phys), dimension(:),intent(out) :: & - de_lgth ! Decorrelation length -- real(kind_phys), dimension(nCol,nLev),intent(out) :: & -+ real(kind_phys), dimension(:, :),intent(out) :: & - cld_frac, & ! Total cloud fraction - cld_lwp, & ! Cloud liquid water path - cld_reliq, & ! Cloud liquid effective radius -diff --git a/physics/GFS_stochastics.F90 b/physics/GFS_stochastics.F90 -index 9b4533c..ce3060c 100644 ---- a/physics/GFS_stochastics.F90 -+++ b/physics/GFS_stochastics.F90 -@@ -50,7 +50,7 @@ - logical, intent(in) :: use_zmtnblck - logical, intent(in) :: do_shum - logical, intent(in) :: do_skeb -- real(kind_phys), dimension(1:im), intent(in) :: zmtnblck -+ real(kind_phys), dimension(:), intent(in) :: zmtnblck - ! sppt_wts only allocated if do_sppt == .true. - real(kind_phys), dimension(:,:), intent(inout) :: sppt_wts - ! skebu_wts, skebv_wts only allocated if do_skeb == .true. -@@ -59,28 +59,28 @@ - ! shum_wts only allocated if do_shum == .true. - real(kind_phys), dimension(:,:), intent(in) :: shum_wts - ! inverse/flipped weights are always allocated -- real(kind_phys), dimension(1:im,1:km), intent(inout) :: sppt_wts_inv -- real(kind_phys), dimension(1:im,1:km), intent(inout) :: skebu_wts_inv -- real(kind_phys), dimension(1:im,1:km), intent(inout) :: skebv_wts_inv -- real(kind_phys), dimension(1:im,1:km), intent(inout) :: shum_wts_inv -- real(kind_phys), dimension(1:im,1:km), intent(in) :: diss_est -- real(kind_phys), dimension(1:im,1:km), intent(in) :: ugrs -- real(kind_phys), dimension(1:im,1:km), intent(in) :: vgrs -- real(kind_phys), dimension(1:im,1:km), intent(in) :: tgrs -- real(kind_phys), dimension(1:im,1:km), intent(in) :: qgrs -- real(kind_phys), dimension(1:im,1:km), intent(inout) :: gu0 -- real(kind_phys), dimension(1:im,1:km), intent(inout) :: gv0 -- real(kind_phys), dimension(1:im,1:km), intent(inout) :: gt0 -- real(kind_phys), dimension(1:im,1:km), intent(inout) :: gq0 -+ real(kind_phys), dimension(:,:), intent(inout) :: sppt_wts_inv -+ real(kind_phys), dimension(:,:), intent(inout) :: skebu_wts_inv -+ real(kind_phys), dimension(:,:), intent(inout) :: skebv_wts_inv -+ real(kind_phys), dimension(:,:), intent(inout) :: shum_wts_inv -+ real(kind_phys), dimension(:,:), intent(in) :: diss_est -+ real(kind_phys), dimension(:,:), intent(in) :: ugrs -+ real(kind_phys), dimension(:,:), intent(in) :: vgrs -+ real(kind_phys), dimension(:,:), intent(in) :: tgrs -+ real(kind_phys), dimension(:,:), intent(in) :: qgrs -+ real(kind_phys), dimension(:,:), intent(inout) :: gu0 -+ real(kind_phys), dimension(:,:), intent(inout) :: gv0 -+ real(kind_phys), dimension(:,:), intent(inout) :: gt0 -+ real(kind_phys), dimension(:,:), intent(inout) :: gq0 - ! dtdtr only allocated if do_sppt == .true. - real(kind_phys), dimension(:,:), intent(in) :: dtdtr -- real(kind_phys), dimension(1:im), intent(in) :: rain -- real(kind_phys), dimension(1:im), intent(in) :: rainc -- real(kind_phys), dimension(1:im), intent(inout) :: tprcp -- real(kind_phys), dimension(1:im), intent(inout) :: totprcp -- real(kind_phys), dimension(1:im), intent(inout) :: cnvprcp -- real(kind_phys), dimension(1:im), intent(inout) :: totprcpb -- real(kind_phys), dimension(1:im), intent(inout) :: cnvprcpb -+ real(kind_phys), dimension(:), intent(in) :: rain -+ real(kind_phys), dimension(:), intent(in) :: rainc -+ real(kind_phys), dimension(:), intent(inout) :: tprcp -+ real(kind_phys), dimension(:), intent(inout) :: totprcp -+ real(kind_phys), dimension(:), intent(inout) :: cnvprcp -+ real(kind_phys), dimension(:), intent(inout) :: totprcpb -+ real(kind_phys), dimension(:), intent(inout) :: cnvprcpb - logical, intent(in) :: cplflx - ! rain_cpl, snow_cpl only allocated if cplflx == .true. or cplchm == .true. - real(kind_phys), dimension(:), intent(inout) :: rain_cpl -@@ -88,9 +88,9 @@ - ! drain_cpl, dsnow_cpl only allocated if cplflx == .true. or cplchm == .true. - real(kind_phys), dimension(:), intent(in) :: drain_cpl - real(kind_phys), dimension(:), intent(in) :: dsnow_cpl -- real(kind_phys), dimension(1:km), intent(in) :: si -- real(kind_phys), dimension(1:km), intent(inout) :: vfact_ca -- real(kind_phys), dimension(1:im), intent(in) :: ca1 -+ real(kind_phys), dimension(:), intent(in) :: si -+ real(kind_phys), dimension(:), intent(inout) :: vfact_ca -+ real(kind_phys), dimension(:), intent(in) :: ca1 - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - -diff --git a/physics/GFS_suite_interstitial.F90 b/physics/GFS_suite_interstitial.F90 -index 263e316..4214dbf 100644 ---- a/physics/GFS_suite_interstitial.F90 -+++ b/physics/GFS_suite_interstitial.F90 -@@ -94,12 +94,12 @@ - ! interface variables - integer, intent(in) :: im, levs, ntrac - real(kind=kind_phys), intent(in) :: dtf, dtp, dxmin, dxinv -- real(kind=kind_phys), intent(in), dimension(im) :: slmsk, area, pgr -+ real(kind=kind_phys), intent(in), dimension(:) :: slmsk, area, pgr - -- integer, intent(out), dimension(im) :: islmsk -- real(kind=kind_phys), intent(out), dimension(im) :: work1, work2, psurf -- real(kind=kind_phys), intent(out), dimension(im,levs) :: dudt, dvdt, dtdt, dtdtc -- real(kind=kind_phys), intent(out), dimension(im,levs,ntrac) :: dqdt -+ integer, intent(out), dimension(:) :: islmsk -+ real(kind=kind_phys), intent(out), dimension(:) :: work1, work2, psurf -+ real(kind=kind_phys), intent(out), dimension(:,:) :: dudt, dvdt, dtdt, dtdtc -+ real(kind=kind_phys), intent(out), dimension(:,:,:) :: dqdt - real(kind=kind_phys), parameter :: zero = 0.0_kind_phys, one = 1.0_kind_phys - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg -@@ -173,34 +173,34 @@ - logical, intent(in ) :: old_monin, mstrat, do_shoc, frac_grid - real(kind=kind_phys), intent(in ) :: dtf, cp, hvap - -- logical, intent(in ), dimension(im) :: flag_cice -- real(kind=kind_phys), intent(in ), dimension(2) :: ctei_rm -- real(kind=kind_phys), intent(in ), dimension(im) :: xcosz, adjsfcdsw, adjsfcdlw, pgr, xmu, ulwsfc_cice, work1, work2 -- real(kind=kind_phys), intent(in ), dimension(im) :: cice -- real(kind=kind_phys), intent(in ), dimension(im, levs) :: htrsw, htrlw, tgrs, prsl, qgrs_water_vapor, qgrs_cloud_water, prslk -- real(kind=kind_phys), intent(in ), dimension(im, levs+1) :: prsi -- real(kind=kind_phys), intent(in ), dimension(im, levs, 6) :: lwhd -- integer, intent(inout), dimension(im) :: kinver -- real(kind=kind_phys), intent(inout), dimension(im) :: suntim, dlwsfc, ulwsfc, psmean, ctei_rml, ctei_r -- real(kind=kind_phys), intent(in ), dimension(im) :: adjsfculw_lnd, adjsfculw_ice, adjsfculw_wat -- real(kind=kind_phys), intent( out), dimension(im) :: adjsfculw -+ logical, intent(in ), dimension(:) :: flag_cice -+ real(kind=kind_phys), intent(in ), dimension(:) :: ctei_rm -+ real(kind=kind_phys), intent(in ), dimension(:) :: xcosz, adjsfcdsw, adjsfcdlw, pgr, xmu, ulwsfc_cice, work1, work2 -+ real(kind=kind_phys), intent(in ), dimension(:) :: cice -+ real(kind=kind_phys), intent(in ), dimension(:, :) :: htrsw, htrlw, tgrs, prsl, qgrs_water_vapor, qgrs_cloud_water, prslk -+ real(kind=kind_phys), intent(in ), dimension(:, :) :: prsi -+ real(kind=kind_phys), intent(in ), dimension(:, :, :) :: lwhd -+ integer, intent(inout), dimension(:) :: kinver -+ real(kind=kind_phys), intent(inout), dimension(:) :: suntim, dlwsfc, ulwsfc, psmean, ctei_rml, ctei_r -+ real(kind=kind_phys), intent(in ), dimension(:) :: adjsfculw_lnd, adjsfculw_ice, adjsfculw_wat -+ real(kind=kind_phys), intent( out), dimension(:) :: adjsfculw - - ! RRTMGP - logical, intent(in ) :: & - use_GP_jacobian ! Use RRTMGP LW Jacobian of upwelling to adjust the surface flux? -- real(kind=kind_phys), intent(in ), dimension(im) :: & -+ real(kind=kind_phys), intent(in ), dimension(:) :: & - skt ! Skin temperature -- real(kind=kind_phys), intent(inout), dimension(im) :: & -+ real(kind=kind_phys), intent(inout), dimension(:) :: & - sktp1r ! Skin temperature at previous timestep -- real(kind=kind_phys), intent(in ), dimension(im,levs+1), optional :: & -+ real(kind=kind_phys), intent(in ), dimension(:,:), optional :: & - fluxlwUP, & ! Upwelling LW flux (W/m2) - fluxlwUP_jac ! Jacobian of upwelling LW flux (W/m2/K) - - ! These arrays are only allocated if ldiag3d is .true. - real(kind=kind_phys), intent(inout), dimension(:,:) :: dt3dt_lw, dt3dt_sw, dt3dt_pbl, dt3dt_dcnv, dt3dt_scnv, dt3dt_mp - -- logical, intent(in ), dimension(im) :: dry, icy, wet -- real(kind=kind_phys), intent(in ), dimension(im) :: frland -+ logical, intent(in ), dimension(:) :: dry, icy, wet -+ real(kind=kind_phys), intent(in ), dimension(:) :: frland - real(kind=kind_phys), intent(in ) :: huge - - character(len=*), intent(out) :: errmsg -@@ -402,10 +402,10 @@ - integer, intent(in) :: im - integer, intent(in) :: levs - integer, intent(in) :: ntrac -- real(kind=kind_phys), dimension(im,levs), intent(in) :: tgrs, ugrs, vgrs -- real(kind=kind_phys), dimension(im,levs,ntrac), intent(in) :: qgrs -- real(kind=kind_phys), dimension(im,levs), intent(out) :: gt0, gu0, gv0 -- real(kind=kind_phys), dimension(im,levs,ntrac), intent(out) :: gq0 -+ real(kind=kind_phys), dimension(:,:), intent(in) :: tgrs, ugrs, vgrs -+ real(kind=kind_phys), dimension(:,:,:), intent(in) :: qgrs -+ real(kind=kind_phys), dimension(:,:), intent(out) :: gt0, gu0, gv0 -+ real(kind=kind_phys), dimension(:,:,:), intent(out) :: gq0 - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg -@@ -451,12 +451,12 @@ - integer, intent(in) :: ntrac - real(kind=kind_phys), intent(in) :: dtp - -- real(kind=kind_phys), dimension(im,levs), intent(in) :: tgrs, ugrs, vgrs -- real(kind=kind_phys), dimension(im,levs,ntrac), intent(in) :: qgrs -- real(kind=kind_phys), dimension(im,levs), intent(in) :: dudt, dvdt, dtdt -- real(kind=kind_phys), dimension(im,levs,ntrac), intent(in) :: dqdt -- real(kind=kind_phys), dimension(im,levs), intent(out) :: gt0, gu0, gv0 -- real(kind=kind_phys), dimension(im,levs,ntrac), intent(out) :: gq0 -+ real(kind=kind_phys), dimension(:,:), intent(in) :: tgrs, ugrs, vgrs -+ real(kind=kind_phys), dimension(:,:,:), intent(in) :: qgrs -+ real(kind=kind_phys), dimension(:,:), intent(in) :: dudt, dvdt, dtdt -+ real(kind=kind_phys), dimension(:,:,:), intent(in) :: dqdt -+ real(kind=kind_phys), dimension(:,:), intent(out) :: gt0, gu0, gv0 -+ real(kind=kind_phys), dimension(:,:,:), intent(out) :: gq0 - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg -@@ -509,22 +509,22 @@ - integer, intent(in) :: im, levs, nn, ntrac, ntcw, ntiw, ntclamt, ntrw, & - ntsw, ntrnc, ntsnc, ntgl, ntgnc, imp_physics, imp_physics_mg, imp_physics_zhao_carr, imp_physics_zhao_carr_pdf, & - imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6,imp_physics_fer_hires, me -- integer, dimension(im), intent(in) :: islmsk, kpbl, kinver -+ integer, dimension(:), intent(in) :: islmsk, kpbl, kinver - logical, intent(in) :: cscnv, satmedmf, trans_trac, do_shoc, ltaerosol, ras - - real(kind=kind_phys), intent(in) :: rhcbot, rhcmax, rhcpbl, rhctop -- real(kind=kind_phys), dimension(im), intent(in) :: work1, work2 -- real(kind=kind_phys), dimension(im, levs), intent(in) :: prsl, prslk -- real(kind=kind_phys), dimension(im, levs+1), intent(in) :: prsi -- real(kind=kind_phys), dimension(im), intent(in) :: xlon, xlat -- real(kind=kind_phys), dimension(im, levs), intent(in) :: gt0 -- real(kind=kind_phys), dimension(im, levs, ntrac), intent(in) :: gq0 -- -- real(kind=kind_phys), dimension(im, levs), intent(inout) :: rhc, save_qc -+ real(kind=kind_phys), dimension(:), intent(in) :: work1, work2 -+ real(kind=kind_phys), dimension(:, :), intent(in) :: prsl, prslk -+ real(kind=kind_phys), dimension(:, :), intent(in) :: prsi -+ real(kind=kind_phys), dimension(:), intent(in) :: xlon, xlat -+ real(kind=kind_phys), dimension(:, :), intent(in) :: gt0 -+ real(kind=kind_phys), dimension(:, :, :), intent(in) :: gq0 -+ -+ real(kind=kind_phys), dimension(:, :), intent(inout) :: rhc, save_qc - ! save_qi is not allocated for Zhao-Carr MP - real(kind=kind_phys), dimension(:, :), intent(inout) :: save_qi - real(kind=kind_phys), dimension(:, :), intent(inout) :: save_tcp ! ONLY ALLOCATE FOR THOMPSON! TODO -- real(kind=kind_phys), dimension(im, levs, nn), intent(inout) :: clw -+ real(kind=kind_phys), dimension(:, :, :), intent(inout) :: clw - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg -@@ -679,16 +679,16 @@ - logical, intent(in) :: ltaerosol, cplchm - - real(kind=kind_phys), intent(in) :: con_pi, dtf -- real(kind=kind_phys), dimension(im,levs), intent(in) :: save_qc -+ real(kind=kind_phys), dimension(:, :), intent(in) :: save_qc - ! save_qi is not allocated for Zhao-Carr MP - real(kind=kind_phys), dimension(:, :), intent(in) :: save_qi - -- real(kind=kind_phys), dimension(im,levs,ntrac), intent(inout) :: gq0 -- real(kind=kind_phys), dimension(im,levs,nn), intent(inout) :: clw -- real(kind=kind_phys), dimension(im,levs), intent(in) :: prsl -+ real(kind=kind_phys), dimension(:, :,:), intent(inout) :: gq0 -+ real(kind=kind_phys), dimension(:, :,:), intent(inout) :: clw -+ real(kind=kind_phys), dimension(:, :), intent(in) :: prsl - real(kind=kind_phys), intent(in) :: con_rd - real(kind=kind_phys), dimension(:,:), intent(in) :: nwfa, save_tcp -- real(kind=kind_phys), dimension(im,levs), intent(in) :: spechum -+ real(kind=kind_phys), dimension(:, :), intent(in) :: spechum - - ! dqdti may not be allocated - real(kind=kind_phys), dimension(:,:), intent(inout) :: dqdti -@@ -828,9 +828,9 @@ - ! interface variables - integer, intent(in) :: im, levs, ntrac, ntcw, ntiw, nn - -- real(kind=kind_phys), dimension(im, levs, ntrac), intent(in) :: gq0 -+ real(kind=kind_phys), dimension(:, :, :), intent(in) :: gq0 - -- real(kind=kind_phys), dimension(im, levs, nn), intent(out) :: clw -+ real(kind=kind_phys), dimension(:, :, :), intent(out) :: clw - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg -diff --git a/physics/GFS_surface_composites.F90 b/physics/GFS_surface_composites.F90 -index b3000b0..ff513a1 100644 ---- a/physics/GFS_surface_composites.F90 -+++ b/physics/GFS_surface_composites.F90 -@@ -40,24 +40,24 @@ contains - ! Interface variables - integer, intent(in ) :: im, lkm - logical, intent(in ) :: frac_grid, cplflx, cplwav2atm -- logical, dimension(im), intent(inout) :: flag_cice -- logical, dimension(im), intent(inout) :: dry, icy, lake, ocean, wet -+ logical, dimension(:), intent(inout) :: flag_cice -+ logical, dimension(:), intent(inout) :: dry, icy, lake, ocean, wet - real(kind=kind_phys), intent(in ) :: cimin -- real(kind=kind_phys), dimension(im), intent(in ) :: landfrac, lakefrac, lakedepth, oceanfrac -- real(kind=kind_phys), dimension(im), intent(inout) :: cice -- real(kind=kind_phys), dimension(im), intent( out) :: frland -- real(kind=kind_phys), dimension(im), intent(in ) :: zorl, snowd, tprcp, uustar, weasd, qss, hflx -+ real(kind=kind_phys), dimension(:), intent(in ) :: landfrac, lakefrac, lakedepth, oceanfrac -+ real(kind=kind_phys), dimension(:), intent(inout) :: cice -+ real(kind=kind_phys), dimension(:), intent( out) :: frland -+ real(kind=kind_phys), dimension(:), intent(in ) :: zorl, snowd, tprcp, uustar, weasd, qss, hflx - -- real(kind=kind_phys), dimension(im), intent(inout) :: zorlo, zorll, zorli, tsfc, tsfco, tsfcl, tisfc, tsurf -- real(kind=kind_phys), dimension(im), intent(inout) :: snowd_wat, snowd_lnd, snowd_ice, tprcp_wat, & -+ real(kind=kind_phys), dimension(:), intent(inout) :: zorlo, zorll, zorli, tsfc, tsfco, tsfcl, tisfc, tsurf -+ real(kind=kind_phys), dimension(:), intent(inout) :: snowd_wat, snowd_lnd, snowd_ice, tprcp_wat, & - tprcp_lnd, tprcp_ice, zorl_wat, zorl_lnd, zorl_ice, tsfc_wat, tsfc_lnd, tsfc_ice, tsurf_wat, & - tsurf_lnd, tsurf_ice, uustar_wat, uustar_lnd, uustar_ice, weasd_wat, weasd_lnd, weasd_ice, & - qss_wat, qss_lnd, qss_ice, hflx_wat, hflx_lnd, hflx_ice, ep1d_ice, gflx_ice -- real(kind=kind_phys), dimension(im), intent( out) :: tice -+ real(kind=kind_phys), dimension(:), intent( out) :: tice - real(kind=kind_phys), intent(in ) :: tgice -- integer, dimension(im), intent(inout) :: islmsk -- real(kind=kind_phys), dimension(im), intent(in ) :: semis_rad -- real(kind=kind_phys), dimension(im), intent(inout) :: semis_wat, semis_lnd, semis_ice -+ integer, dimension(:), intent(inout) :: islmsk -+ real(kind=kind_phys), dimension(:), intent(in ) :: semis_rad -+ real(kind=kind_phys), dimension(:), intent(inout) :: semis_wat, semis_lnd, semis_ice - real(kind=kind_phys), intent(in ) :: min_lakeice, min_seaice - - ! CCPP error handling -@@ -252,11 +252,11 @@ contains - - ! Interface variables - integer, intent(in ) :: im -- logical, dimension(im), intent(in ) :: dry, icy, wet -- real(kind=kind_phys), dimension(im), intent(in ) :: semis_wat, semis_lnd, semis_ice, adjsfcdlw, & -+ logical, dimension(:), intent(in ) :: dry, icy, wet -+ real(kind=kind_phys), dimension(:), intent(in ) :: semis_wat, semis_lnd, semis_ice, adjsfcdlw, & - adjsfcdsw, adjsfcnsw -- real(kind=kind_phys), dimension(im), intent(inout) :: gabsbdlw_lnd, gabsbdlw_ice, gabsbdlw_wat -- real(kind=kind_phys), dimension(im), intent(out) :: adjsfcusw -+ real(kind=kind_phys), dimension(:), intent(inout) :: gabsbdlw_lnd, gabsbdlw_ice, gabsbdlw_wat -+ real(kind=kind_phys), dimension(:), intent(out) :: adjsfcusw - - ! CCPP error handling - character(len=*), intent(out) :: errmsg -@@ -339,9 +339,9 @@ contains - - integer, intent(in) :: im, kice, km - logical, intent(in) :: cplflx, frac_grid, cplwav2atm -- logical, dimension(im), intent(in) :: flag_cice, dry, wet, icy -- integer, dimension(im), intent(in) :: islmsk -- real(kind=kind_phys), dimension(im), intent(in) :: landfrac, lakefrac, oceanfrac, & -+ logical, dimension(:), intent(in) :: flag_cice, dry, wet, icy -+ integer, dimension(:), intent(in) :: islmsk -+ real(kind=kind_phys), dimension(:), intent(in) :: landfrac, lakefrac, oceanfrac, & - zorl_wat, zorl_lnd, zorl_ice, cd_wat, cd_lnd, cd_ice, cdq_wat, cdq_lnd, cdq_ice, rb_wat, rb_lnd, rb_ice, stress_wat, & - stress_lnd, stress_ice, ffmm_wat, ffmm_lnd, ffmm_ice, ffhh_wat, ffhh_lnd, ffhh_ice, uustar_wat, uustar_lnd, uustar_ice, & - fm10_wat, fm10_lnd, fm10_ice, fh2_wat, fh2_lnd, fh2_ice, tsurf_wat, tsurf_lnd, tsurf_ice, cmm_wat, cmm_lnd, cmm_ice, & -@@ -349,15 +349,15 @@ contains - snowd_wat, snowd_lnd, snowd_ice,tprcp_wat, tprcp_lnd, tprcp_ice, evap_wat, evap_lnd, evap_ice, hflx_wat, hflx_lnd, & - hflx_ice, qss_wat, qss_lnd, qss_ice, tsfc_wat, tsfc_lnd, tsfc_ice - -- real(kind=kind_phys), dimension(im), intent(inout) :: zorl, zorlo, zorll, zorli, cd, cdq, rb, stress, ffmm, ffhh, uustar, fm10, & -+ real(kind=kind_phys), dimension(:), intent(inout) :: zorl, zorlo, zorll, zorli, cd, cdq, rb, stress, ffmm, ffhh, uustar, fm10, & - fh2, tsurf, cmm, chh, gflx, ep1d, weasd, snowd, tprcp, evap, hflx, qss, tsfc, tsfco, tsfcl, tisfc - -- real(kind=kind_phys), dimension(im), intent(in ) :: tice ! interstitial sea ice temperature -- real(kind=kind_phys), dimension(im), intent(inout) :: hice, cice -+ real(kind=kind_phys), dimension(:), intent(in ) :: tice ! interstitial sea ice temperature -+ real(kind=kind_phys), dimension(:), intent(inout) :: hice, cice - real(kind=kind_phys), intent(in ) :: min_seaice - -- real(kind=kind_phys), dimension(im, kice), intent(in ) :: tiice -- real(kind=kind_phys), dimension(im, km), intent(inout) :: stc -+ real(kind=kind_phys), dimension(:, :), intent(in ) :: tiice -+ real(kind=kind_phys), dimension(:, :), intent(inout) :: stc - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg -diff --git a/physics/GFS_surface_generic.F90 b/physics/GFS_surface_generic.F90 -index 337e4c5..d65f4ad 100644 ---- a/physics/GFS_surface_generic.F90 -+++ b/physics/GFS_surface_generic.F90 -@@ -38,51 +38,51 @@ - - ! Interface variables - integer, intent(in) :: im, levs, isot, ivegsrc -- integer, dimension(im), intent(in) :: islmsk -- integer, dimension(im), intent(inout) :: soiltyp, vegtype, slopetyp -+ integer, dimension(:), intent(in) :: islmsk -+ integer, dimension(:), intent(inout) :: soiltyp, vegtype, slopetyp - - real(kind=kind_phys), intent(in) :: con_g -- real(kind=kind_phys), dimension(im), intent(in) :: vfrac, stype, vtype, slope, prsik_1, prslk_1 -+ real(kind=kind_phys), dimension(:), intent(in) :: vfrac, stype, vtype, slope, prsik_1, prslk_1 - -- real(kind=kind_phys), dimension(im), intent(inout) :: tsfc -- real(kind=kind_phys), dimension(im,levs), intent(in) :: phil -+ real(kind=kind_phys), dimension(:), intent(inout) :: tsfc -+ real(kind=kind_phys), dimension(:,:), intent(in) :: phil - -- real(kind=kind_phys), dimension(im), intent(inout) :: sigmaf, work3, tsurf, zlvl -+ real(kind=kind_phys), dimension(:), intent(inout) :: sigmaf, work3, tsurf, zlvl - - ! Stochastic physics / surface perturbations - logical, intent(in) :: do_sppt, ca_global -- real(kind=kind_phys), dimension(im,levs), intent(out) :: dtdtr -- real(kind=kind_phys), dimension(im), intent(out) :: drain_cpl -- real(kind=kind_phys), dimension(im), intent(out) :: dsnow_cpl -- real(kind=kind_phys), dimension(im), intent(in) :: rain_cpl -- real(kind=kind_phys), dimension(im), intent(in) :: snow_cpl -+ real(kind=kind_phys), dimension(:,:), intent(out) :: dtdtr -+ real(kind=kind_phys), dimension(:), intent(out) :: drain_cpl -+ real(kind=kind_phys), dimension(:), intent(out) :: dsnow_cpl -+ real(kind=kind_phys), dimension(:), intent(in) :: rain_cpl -+ real(kind=kind_phys), dimension(:), intent(in) :: snow_cpl - logical, intent(in) :: do_sfcperts - integer, intent(in) :: nsfcpert -- real(kind=kind_phys), dimension(im,nsfcpert), intent(in) :: sfc_wts -+ real(kind=kind_phys), dimension(:,:), intent(in) :: sfc_wts - real(kind=kind_phys), dimension(:), intent(in) :: pertz0 - real(kind=kind_phys), dimension(:), intent(in) :: pertzt - real(kind=kind_phys), dimension(:), intent(in) :: pertshc - real(kind=kind_phys), dimension(:), intent(in) :: pertlai - real(kind=kind_phys), dimension(:), intent(in) :: pertvegf -- real(kind=kind_phys), dimension(im), intent(out) :: z01d -- real(kind=kind_phys), dimension(im), intent(out) :: zt1d -- real(kind=kind_phys), dimension(im), intent(out) :: bexp1d -- real(kind=kind_phys), dimension(im), intent(out) :: xlai1d -- real(kind=kind_phys), dimension(im), intent(out) :: vegf1d -+ real(kind=kind_phys), dimension(:), intent(out) :: z01d -+ real(kind=kind_phys), dimension(:), intent(out) :: zt1d -+ real(kind=kind_phys), dimension(:), intent(out) :: bexp1d -+ real(kind=kind_phys), dimension(:), intent(out) :: xlai1d -+ real(kind=kind_phys), dimension(:), intent(out) :: vegf1d - - logical, intent(in) :: cplflx -- real(kind=kind_phys), dimension(im), intent(in) :: slimskin_cpl -- logical, dimension(im), intent(inout) :: flag_cice -- integer, dimension(im), intent(out) :: islmsk_cice -- real(kind=kind_phys), dimension(im), intent(in) :: & -+ real(kind=kind_phys), dimension(:), intent(in) :: slimskin_cpl -+ logical, dimension(:), intent(inout) :: flag_cice -+ integer, dimension(:), intent(out) :: islmsk_cice -+ real(kind=kind_phys), dimension(:), intent(in) :: & - tisfc, tsfco, fice, hice - -- real(kind=kind_phys), dimension(im), intent(out) :: wind -- real(kind=kind_phys), dimension(im), intent(in ) :: u1, v1 -+ real(kind=kind_phys), dimension(:), intent(out) :: wind -+ real(kind=kind_phys), dimension(:), intent(in ) :: u1, v1 - ! surface wind enhancement due to convection -- real(kind=kind_phys), dimension(im), intent(inout ) :: cnvwind -+ real(kind=kind_phys), dimension(:), intent(inout ) :: cnvwind - ! -- real(kind=kind_phys), dimension(im), intent(out) :: smcwlt2, smcref2 -+ real(kind=kind_phys), dimension(:), intent(out) :: smcwlt2, smcref2 - - ! CCPP error handling - character(len=*), intent(out) :: errmsg -@@ -227,29 +227,29 @@ - - integer, intent(in) :: im - logical, intent(in) :: cplflx, cplwav, lssav -- logical, dimension(im), intent(in) :: icy, wet -+ logical, dimension(:), intent(in) :: icy, wet - real(kind=kind_phys), intent(in) :: dtf - -- real(kind=kind_phys), dimension(im), intent(in) :: ep1d, gflx, tgrs_1, qgrs_1, ugrs_1, vgrs_1, adjsfcdlw, adjsfcdsw, & -+ real(kind=kind_phys), dimension(:), intent(in) :: ep1d, gflx, tgrs_1, qgrs_1, ugrs_1, vgrs_1, adjsfcdlw, adjsfcdsw, & - adjnirbmd, adjnirdfd, adjvisbmd, adjvisdfd, adjsfculw, adjsfculw_wat, adjnirbmu, adjnirdfu, adjvisbmu, adjvisdfu, & - t2m, q2m, u10m, v10m, tsfc, tsfc_wat, pgr, xcosz, evbs, evcw, trans, sbsno, snowc, snohf - -- real(kind=kind_phys), dimension(im), intent(inout) :: epi, gfluxi, t1, q1, u1, v1, dlwsfci_cpl, dswsfci_cpl, dlwsfc_cpl, & -+ real(kind=kind_phys), dimension(:), intent(inout) :: epi, gfluxi, t1, q1, u1, v1, dlwsfci_cpl, dswsfci_cpl, dlwsfc_cpl, & - dswsfc_cpl, dnirbmi_cpl, dnirdfi_cpl, dvisbmi_cpl, dvisdfi_cpl, dnirbm_cpl, dnirdf_cpl, dvisbm_cpl, dvisdf_cpl, & - nlwsfci_cpl, nlwsfc_cpl, t2mi_cpl, q2mi_cpl, u10mi_cpl, v10mi_cpl, tsfci_cpl, psurfi_cpl, nnirbmi_cpl, nnirdfi_cpl, & - nvisbmi_cpl, nvisdfi_cpl, nswsfci_cpl, nswsfc_cpl, nnirbm_cpl, nnirdf_cpl, nvisbm_cpl, nvisdf_cpl, gflux, evbsa, & - evcwa, transa, sbsnoa, snowca, snohfa, ep - -- real(kind=kind_phys), dimension(im), intent(inout) :: runoff, srunoff -- real(kind=kind_phys), dimension(im), intent(in) :: drain, runof -+ real(kind=kind_phys), dimension(:), intent(inout) :: runoff, srunoff -+ real(kind=kind_phys), dimension(:), intent(in) :: drain, runof - - ! For canopy heat storage - logical, intent(in) :: lheatstrg - real(kind=kind_phys), intent(in) :: z0fac, e0fac -- real(kind=kind_phys), dimension(im), intent(in) :: zorl -- real(kind=kind_phys), dimension(im), intent(in) :: hflx, evap -- real(kind=kind_phys), dimension(im), intent(out) :: hflxq, evapq -- real(kind=kind_phys), dimension(im), intent(out) :: hffac, hefac -+ real(kind=kind_phys), dimension(:), intent(in) :: zorl -+ real(kind=kind_phys), dimension(:), intent(in) :: hflx, evap -+ real(kind=kind_phys), dimension(:), intent(out) :: hflxq, evapq -+ real(kind=kind_phys), dimension(:), intent(out) :: hffac, hefac - - ! CCPP error handling variables - character(len=*), intent(out) :: errmsg -diff --git a/physics/GFS_surface_loop_control.F90 b/physics/GFS_surface_loop_control.F90 -index c7f727d..afa3413 100644 ---- a/physics/GFS_surface_loop_control.F90 -+++ b/physics/GFS_surface_loop_control.F90 -@@ -90,10 +90,10 @@ - ! Interface variables - integer, intent(in) :: im - integer, intent(in) :: iter -- real(kind=kind_phys), dimension(im), intent(in) :: wind -- logical, dimension(im), intent(inout) :: flag_guess -- logical, dimension(im), intent(inout) :: flag_iter -- logical, dimension(im), intent(in) :: dry, wet, icy -+ real(kind=kind_phys), dimension(:), intent(in) :: wind -+ logical, dimension(:), intent(inout) :: flag_guess -+ logical, dimension(:), intent(inout) :: flag_iter -+ logical, dimension(:), intent(in) :: dry, wet, icy - integer, intent(in) :: nstf_name1 - - character(len=*), intent(out) :: errmsg -diff --git a/physics/GFS_time_vary_pre.fv3.F90 b/physics/GFS_time_vary_pre.fv3.F90 -index dc9332b..66c9173 100644 ---- a/physics/GFS_time_vary_pre.fv3.F90 -+++ b/physics/GFS_time_vary_pre.fv3.F90 -@@ -74,7 +74,7 @@ - implicit none - - integer, intent(in) :: idate(4) -- integer, intent(in) :: jdat(1:8), idat(1:8) -+ integer, intent(in) :: jdat(:), idat(:) - integer, intent(in) :: lkm, lsm, lsm_noahmp, & - nsswr, nslwr, me, & - master, nscyc, nhfrad -diff --git a/physics/GFS_time_vary_pre.scm.F90 b/physics/GFS_time_vary_pre.scm.F90 -index 2fa3527..842423d 100644 ---- a/physics/GFS_time_vary_pre.scm.F90 -+++ b/physics/GFS_time_vary_pre.scm.F90 -@@ -74,7 +74,7 @@ - implicit none - - integer, intent(in) :: idate(4) -- integer, intent(in) :: jdat(1:8), idat(1:8) -+ integer, intent(in) :: jdat(:), idat(:) - integer, intent(in) :: lsm, lsm_noahmp, & - nsswr, nslwr, me, & - master, nscyc -diff --git a/physics/cires_ugwp.F90 b/physics/cires_ugwp.F90 -index df0116c..018cf6a 100644 ---- a/physics/cires_ugwp.F90 -+++ b/physics/cires_ugwp.F90 -@@ -54,7 +54,7 @@ contains - integer, intent (in) :: latr - real(kind=kind_phys), intent (in) :: ak(:), bk(:) - real(kind=kind_phys), intent (in) :: dtp -- real(kind=kind_phys), intent (in) :: cdmbgwd(4), cgwf(2) ! "scaling" controls for "old" GFS-GW schemes -+ real(kind=kind_phys), intent (in) :: cdmbgwd(:), cgwf(:) ! "scaling" controls for "old" GFS-GW schemes - real(kind=kind_phys), intent (in) :: pa_rf_in, tau_rf_in - real(kind=kind_phys), intent (in) :: con_p0 - logical, intent (in) :: do_ugwp -@@ -163,24 +163,24 @@ contains - - ! interface variables - integer, intent(in) :: me, master, im, levs, ntrac, kdt, lonr, nmtvr -- integer, intent(in), dimension(im) :: kpbl -- real(kind=kind_phys), intent(in), dimension(im) :: oro, oro_uf, hprime, oc, theta, sigma, gamma -+ integer, intent(in), dimension(:) :: kpbl -+ real(kind=kind_phys), intent(in), dimension(:) :: oro, oro_uf, hprime, oc, theta, sigma, gamma - logical, intent(in) :: flag_for_gwd_generic_tend - ! elvmax is intent(in) for CIRES UGWP, but intent(inout) for GFS GWDPS -- real(kind=kind_phys), intent(inout), dimension(im) :: elvmax -- real(kind=kind_phys), intent(in), dimension(im, 4) :: clx, oa4 -- real(kind=kind_phys), intent(in), dimension(im) :: xlat, xlat_d, sinlat, coslat, area -- real(kind=kind_phys), intent(in), dimension(im, levs) :: del, ugrs, vgrs, tgrs, prsl, prslk, phil -- real(kind=kind_phys), intent(in), dimension(im, levs+1) :: prsi, phii -- real(kind=kind_phys), intent(in), dimension(im, levs, ntrac):: qgrs -- real(kind=kind_phys), intent(in) :: dtp, cdmbgwd(4) -+ real(kind=kind_phys), intent(inout), dimension(:) :: elvmax -+ real(kind=kind_phys), intent(in), dimension(:, :) :: clx, oa4 -+ real(kind=kind_phys), intent(in), dimension(:) :: xlat, xlat_d, sinlat, coslat, area -+ real(kind=kind_phys), intent(in), dimension(:, :) :: del, ugrs, vgrs, tgrs, prsl, prslk, phil -+ real(kind=kind_phys), intent(in), dimension(:, :) :: prsi, phii -+ real(kind=kind_phys), intent(in), dimension(:,:,:):: qgrs -+ real(kind=kind_phys), intent(in) :: dtp, cdmbgwd(:) - logical, intent(in) :: do_ugwp, do_tofd, ldiag_ugwp - -- real(kind=kind_phys), intent(out), dimension(im) :: dusfcg, dvsfcg -- real(kind=kind_phys), intent(out), dimension(im) :: zmtb, zlwb, zogw, rdxzb -- real(kind=kind_phys), intent(out), dimension(im) :: tau_mtb, tau_ogw, tau_tofd, tau_ngw -- real(kind=kind_phys), intent(out), dimension(im, levs):: gw_dudt, gw_dvdt, gw_dtdt, gw_kdis -- real(kind=kind_phys), intent(out), dimension(im, levs):: dudt_mtb, dudt_ogw, dudt_tms -+ real(kind=kind_phys), intent(out), dimension(:) :: dusfcg, dvsfcg -+ real(kind=kind_phys), intent(out), dimension(:) :: zmtb, zlwb, zogw, rdxzb -+ real(kind=kind_phys), intent(out), dimension(:) :: tau_mtb, tau_ogw, tau_tofd, tau_ngw -+ real(kind=kind_phys), intent(out), dimension(:, :):: gw_dudt, gw_dvdt, gw_dtdt, gw_kdis -+ real(kind=kind_phys), intent(out), dimension(:, :):: dudt_mtb, dudt_ogw, dudt_tms - - ! These arrays are only allocated if ldiag=.true. - real(kind=kind_phys), intent(inout), dimension(:,:) :: ldu3dt_ogw, ldv3dt_ogw, ldt3dt_ogw -@@ -190,11 +190,11 @@ contains - ! These arrays only allocated if ldiag_ugwp = .true. - real(kind=kind_phys), intent(out), dimension(:,:) :: du3dt_mtb, du3dt_ogw, du3dt_tms - -- real(kind=kind_phys), intent(inout), dimension(im, levs):: dudt, dvdt, dtdt -+ real(kind=kind_phys), intent(inout), dimension(:, :):: dudt, dvdt, dtdt - - real(kind=kind_phys), intent(in) :: con_g, con_pi, con_cp, con_rd, con_rv, con_fvirt - -- real(kind=kind_phys), intent(in), dimension(im) :: rain -+ real(kind=kind_phys), intent(in), dimension(:) :: rain - - integer, intent(in) :: ntke - real(kind=kind_phys), intent(in), dimension(:,:) :: q_tke, dqdt_tke -diff --git a/physics/cnvc90.f b/physics/cnvc90.f -index 9bef0eb..6a49158 100644 ---- a/physics/cnvc90.f -+++ b/physics/cnvc90.f -@@ -30,16 +30,16 @@ - ! Interface variables - real(kind=kind_phys), intent(in) :: clstp - integer, intent(in) :: im, km -- real(kind=kind_phys), intent(in) :: RN(IM) -- integer, intent(in) :: KBOT(IM) -- integer, intent(in) :: KTOP(IM) -- real(kind=kind_phys), intent(in) :: prsi(IM,km+1) -- real(kind=kind_phys), intent(inout) :: ACV(IM) -- real(kind=kind_phys), intent(inout) :: ACVB(IM) -- real(kind=kind_phys), intent(inout) :: ACVT(IM) -- real(kind=kind_phys), intent(inout) :: CV(IM) -- real(kind=kind_phys), intent(inout) :: CVB(IM) -- real(kind=kind_phys), intent(inout) :: CVT(IM) -+ real(kind=kind_phys), intent(in) :: RN(:) -+ integer, intent(in) :: KBOT(:) -+ integer, intent(in) :: KTOP(:) -+ real(kind=kind_phys), intent(in) :: prsi(:,:) -+ real(kind=kind_phys), intent(inout) :: ACV(:) -+ real(kind=kind_phys), intent(inout) :: ACVB(:) -+ real(kind=kind_phys), intent(inout) :: ACVT(:) -+ real(kind=kind_phys), intent(inout) :: CV(:) -+ real(kind=kind_phys), intent(inout) :: CVB(:) -+ real(kind=kind_phys), intent(inout) :: CVT(:) - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg -diff --git a/physics/cs_conv.F90 b/physics/cs_conv.F90 -index 3863494..f1d138e 100644 ---- a/physics/cs_conv.F90 -+++ b/physics/cs_conv.F90 -@@ -31,15 +31,15 @@ module cs_conv_pre - - ! --- inputs - integer, intent(in) :: im, levs, ntrac, ncld -- real(r8), dimension(im,levs), intent(in) :: q -- real(r8), dimension(im,levs), intent(in) :: clw1,clw2 -- real(r8), dimension(im), intent(in) :: work1, work2 -+ real(r8), dimension(:, :), intent(in) :: q -+ real(r8), dimension(:, :), intent(in) :: clw1,clw2 -+ real(r8), dimension(:), intent(in) :: work1, work2 - real(r8), intent(in) :: cs_parm1, cs_parm2 - - ! --- input/output -- real(r8), dimension(ntrac-ncld+2), intent(out) :: fswtr, fscav -- real(r8), dimension(im), intent(out) :: wcbmax -- real(r8), dimension(im,levs), intent(out) :: save_q1,save_q2 -+ real(r8), dimension(:), intent(out) :: fswtr, fscav -+ real(r8), dimension(:), intent(out) :: wcbmax -+ real(r8), dimension(:, :), intent(out) :: save_q1,save_q2 - ! save_q3 is not allocated for Zhao-Carr MP - real(r8), dimension(:,:), intent(out) :: save_q3 - -@@ -101,10 +101,10 @@ module cs_conv_post - ! --- inputs - integer, intent(in) :: im, kmax - logical, intent(in) :: do_aw -- real(r8), dimension(im,kmax), intent(in) :: sigmatot -+ real(r8), dimension(:, :), intent(in) :: sigmatot - - ! --- input/output -- real(r8), dimension(im,kmax), intent(out) :: sigmafrac -+ real(r8), dimension(:, :), intent(out) :: sigmafrac - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg -@@ -309,23 +309,23 @@ module cs_conv - ! input arguments - ! - INTEGER, INTENT(IN) :: IJSDIM, KMAX, ntracp1, nn, NTR, mype, nctp, mp_phys, kdt, lat !! DD, for GFS, pass in -- logical, intent(in) :: otspt(1:ntracp1,1:2)! otspt(:,1) - on/off switch for tracer transport by updraft and -+ logical, intent(in) :: otspt(:, :)! otspt(:,1) - on/off switch for tracer transport by updraft and - ! downdraft. should not include subgrid PDF and turbulence - ! otspt(:,2) - on/off switch for tracer transport by subsidence - ! should include subgrid PDF and turbulence - -- real(r8), intent(inout) :: t(IJSDIM,KMAX) ! temperature at mid-layer (K) -- real(r8), intent(inout) :: q(IJSDIM,KMAX) ! water vapor array including moisture (kg/kg) -- real(r8), intent(inout) :: clw(IJSDIM,KMAX,nn) ! tracer array including cloud condensate (kg/kg) -- real(r8), intent(in) :: pap(IJSDIM,KMAX) ! pressure at mid-layer (Pa) -- real(r8), intent(in) :: paph(IJSDIM,KMAX+1) ! pressure at boundaries (Pa) -- real(r8), intent(in) :: zm(IJSDIM,KMAX) ! geopotential at mid-layer (m) -- real(r8), intent(in) :: zi(IJSDIM,KMAX+1) ! geopotential at boundaries (m) -- real(r8), intent(in) :: fscav(ntr), fswtr(ntr), wcbmaxm(ijsdim) -+ real(r8), intent(inout) :: t(:, :) ! temperature at mid-layer (K) -+ real(r8), intent(inout) :: q(:, :) ! water vapor array including moisture (kg/kg) -+ real(r8), intent(inout) :: clw(:, :, :) ! tracer array including cloud condensate (kg/kg) -+ real(r8), intent(in) :: pap(:, :) ! pressure at mid-layer (Pa) -+ real(r8), intent(in) :: paph(:, :) ! pressure at boundaries (Pa) -+ real(r8), intent(in) :: zm(:, :) ! geopotential at mid-layer (m) -+ real(r8), intent(in) :: zi(:, :) ! geopotential at boundaries (m) -+ real(r8), intent(in) :: fscav(:), fswtr(:), wcbmaxm(:) - real(r8), intent(in) :: precz0in, preczhin, clmdin - ! added for cs_convr -- real(r8), intent(inout) :: u(IJSDIM,KMAX) ! zonal wind at mid-layer (m/s) -- real(r8), intent(inout) :: v(IJSDIM,KMAX) ! meridional wind at mid-layer (m/s) -+ real(r8), intent(inout) :: u(:, :) ! zonal wind at mid-layer (m/s) -+ real(r8), intent(inout) :: v(:, :) ! meridional wind at mid-layer (m/s) - - real(r8), intent(in) :: DELTA ! physics time step - real(r8), intent(in) :: DELTI ! dynamics time step (model time increment in seconds) -@@ -333,12 +333,12 @@ module cs_conv - ! - ! modified arguments - ! -- real(r8), intent(inout) :: CBMFX(IJSDIM,nctp) ! cloud base mass flux (kg/m2/s) -+ real(r8), intent(inout) :: CBMFX(:, :) ! cloud base mass flux (kg/m2/s) - ! - ! output arguments - ! - ! updraft, downdraft, and detrainment mass flux (kg/m2/s) -- real(r8), intent(inout), dimension(IJSDIM,KMAX) :: ud_mf, dd_mf, dt_mf -+ real(r8), intent(inout), dimension(:, :) :: ud_mf, dd_mf, dt_mf - - real(r8), intent(out) :: rain1(IJSDIM) ! lwe thickness of deep convective precipitation amount (m) - ! GJF* These variables are conditionally allocated depending on whether the -@@ -348,14 +348,14 @@ module cs_conv - cnv_dqldt, clcn, cnv_fice, & - cnv_ndrop, cnv_nice, cf_upi - ! *GJF -- integer, intent(inout) :: kcnv(ijsdim) ! zero if no deep convection and 1 otherwise -+ integer, intent(inout) :: kcnv(:) ! zero if no deep convection and 1 otherwise - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - - !DDsigma - output added for AW sigma diagnostics - ! interface sigma and vertical velocity by cloud type (1=sfc) - ! real(r8), intent(out), dimension(IJSDIM,KMAX,nctp) :: sigmai, vverti -- real(r8), intent(out), dimension(IJSDIM,KMAX) :: sigma ! sigma sigma totaled over cloud type - on interfaces (1=sfc) -+ real(r8), intent(out), dimension(:, :) :: sigma ! sigma sigma totaled over cloud type - on interfaces (1=sfc) - ! sigma terms in eq 91 and 92 - ! real(r8), dimension(IJSDIM,KMAX) :: sfluxterm, qvfluxterm, condterm - !DDsigma -@@ -738,19 +738,19 @@ module cs_conv - logical, intent(in) :: otspt1(ntr), otspt2(ntr), lprnt - ! - ! [OUTPUT] -- REAL(r8), INTENT(OUT) :: GTT (IJSDIM, KMAX ) ! heating rate -+ REAL(r8), INTENT(OUT) :: GTT (IJSDIM, KMAX ) ! heating rate - REAL(r8), INTENT(OUT) :: GTQ (IJSDIM, KMAX, NTR) ! change in q -- REAL(r8), INTENT(OUT) :: GTU (IJSDIM, KMAX ) ! tendency of u -- REAL(r8), INTENT(OUT) :: GTV (IJSDIM, KMAX ) ! tendency of v -- REAL(r8), INTENT(OUT) :: CMDET (IJSDIM, KMAX ) ! detrainment mass flux -+ REAL(r8), INTENT(OUT) :: GTU (IJSDIM, KMAX ) ! tendency of u -+ REAL(r8), INTENT(OUT) :: GTV (IJSDIM, KMAX ) ! tendency of v -+ REAL(r8), INTENT(OUT) :: CMDET (IJSDIM, KMAX ) ! detrainment mass flux - - ! assuming there is no flux at the top of the atmospherea - Moorthi -- REAL(r8), INTENT(OUT) :: GTPRP (IJSDIM, KMAX ) ! rain+snow flux -- REAL(r8), INTENT(OUT) :: GSNWP (IJSDIM, KMAX ) ! snowfall flux -- REAL(r8), INTENT(OUT) :: GMFX0 (IJSDIM, KMAX ) ! updraft mass flux -- REAL(r8), INTENT(OUT) :: GMFX1 (IJSDIM, KMAX ) ! downdraft mass flux -+ REAL(r8), INTENT(OUT) :: GTPRP (IJSDIM, KMAX ) ! rain+snow flux -+ REAL(r8), INTENT(OUT) :: GSNWP (IJSDIM, KMAX ) ! snowfall flux -+ REAL(r8), INTENT(OUT) :: GMFX0 (IJSDIM, KMAX ) ! updraft mass flux -+ REAL(r8), INTENT(OUT) :: GMFX1 (IJSDIM, KMAX ) ! downdraft mass flux - -- REAL(r8), INTENT(OUT) :: CAPE (IJSDIM ) -+ REAL(r8), INTENT(OUT) :: CAPE (IJSDIM ) - INTEGER , INTENT(OUT) :: KT (IJSDIM, NCTP ) ! cloud top - ! - ! [MODIFIED] -@@ -774,14 +774,14 @@ module cs_conv - real(r8), allocatable, dimension(:,:,:) :: trfluxterm ! tendencies of tracers due to eddy mass flux - ! - ! [INPUT] -- REAL(r8), INTENT(IN) :: GDT (IJSDIM, KMAX ) ! temperature T -+ REAL(r8), INTENT(IN) :: GDT (IJSDIM, KMAX ) ! temperature T - REAL(r8), INTENT(IN) :: GDQ (IJSDIM, KMAX, NTR) ! humidity, tracer !DDsigmadiag -- REAL(r8), INTENT(IN) :: GDU (IJSDIM, KMAX ) ! westerly u -- REAL(r8), INTENT(IN) :: GDV (IJSDIM, KMAX ) ! southern wind v -- REAL(r8), INTENT(IN) :: GDTM (IJSDIM, KMAX+1 ) ! temperature T -+ REAL(r8), INTENT(IN) :: GDU (IJSDIM, KMAX ) ! westerly u -+ REAL(r8), INTENT(IN) :: GDV (IJSDIM, KMAX ) ! southern wind v -+ REAL(r8), INTENT(IN) :: GDTM (IJSDIM, KMAX+1 ) ! temperature T - REAL(r8), INTENT(IN) :: GDP (IJSDIM, KMAX ) ! pressure P - REAL(r8), INTENT(IN) :: GDPM (IJSDIM, KMAX+1 ) ! pressure (half lev) -- REAL(r8), INTENT(IN) :: GDZ (IJSDIM, KMAX ) ! altitude -+ REAL(r8), INTENT(IN) :: GDZ (IJSDIM, KMAX ) ! altitude - REAL(r8), INTENT(IN) :: GDZM (IJSDIM, KMAX+1 ) ! altitude - REAL(r8), INTENT(IN) :: DELTA ! delta(t) (dynamics) - REAL(r8), INTENT(IN) :: DELTI ! delta(t) (internal variable) -diff --git a/physics/cs_conv_aw_adj.F90 b/physics/cs_conv_aw_adj.F90 -index 756161d..74cac91 100644 ---- a/physics/cs_conv_aw_adj.F90 -+++ b/physics/cs_conv_aw_adj.F90 -@@ -40,15 +40,15 @@ module cs_conv_aw_adj - logical, intent(in) :: do_cscnv, do_aw, do_shoc - integer, intent(in) :: ntrac, ncld, ntcw, ntclamt, nncl - real(kind_phys), intent(in) :: con_g -- real(kind_phys), dimension(im,levs), intent(inout) :: sigmafrac -- real(kind_phys), dimension(im,levs), intent(inout) :: gt0 -- real(kind_phys), dimension(im,levs,ntrac), intent(inout) :: gq0 -- real(kind_phys), dimension(im,levs), intent(in) :: save_t -- real(kind_phys), dimension(im,levs,ntrac), intent(in) :: save_q -- real(kind_phys), dimension(im,levs+1), intent(in) :: prsi -- real(kind_phys), dimension(im,levs), intent(inout) :: cldfrac -- real(kind_phys), dimension(im,levs), intent(inout) :: subcldfrac -- real(kind_phys), dimension(im), intent(inout) :: prcp -+ real(kind_phys), dimension(:,:), intent(inout) :: sigmafrac -+ real(kind_phys), dimension(:,:), intent(inout) :: gt0 -+ real(kind_phys), dimension(:,:,:), intent(inout) :: gq0 -+ real(kind_phys), dimension(:,:), intent(in) :: save_t -+ real(kind_phys), dimension(:,:,:), intent(in) :: save_q -+ real(kind_phys), dimension(:,:), intent(in) :: prsi -+ real(kind_phys), dimension(:,:), intent(inout) :: cldfrac -+ real(kind_phys), dimension(:,:), intent(inout) :: subcldfrac -+ real(kind_phys), dimension(:), intent(inout) :: prcp - integer, intent(in ) :: imp_physics, imp_physics_mg - character(len=*), intent( out) :: errmsg - integer, intent( out) :: errflg -diff --git a/physics/cu_gf_driver.F90 b/physics/cu_gf_driver.F90 -index 5c43709..4b9e423 100644 ---- a/physics/cu_gf_driver.F90 -+++ b/physics/cu_gf_driver.F90 -@@ -101,42 +101,42 @@ contains - logical, intent(in ) :: flag_for_scnv_generic_tend,flag_for_dcnv_generic_tend - logical, intent(in ) :: ldiag3d,qdiag3d - -- real(kind=kind_phys), dimension( im , km ), intent(in ) :: forcet,forceqv_spechum,w,phil -- real(kind=kind_phys), dimension( im , km ), intent(inout ) :: t,us,vs -- real(kind=kind_phys), dimension( im , km ), intent(inout ) :: qci_conv -+ real(kind=kind_phys), dimension( :, :), intent(in ) :: forcet,forceqv_spechum,w,phil -+ real(kind=kind_phys), dimension( :, : ), intent(inout ) :: t,us,vs -+ real(kind=kind_phys), dimension( :, : ), intent(inout ) :: qci_conv - real(kind=kind_phys), dimension( im ) :: rand_mom,rand_vmas -- real(kind=kind_phys), dimension( im,4 ) :: rand_clos -+ real(kind=kind_phys), dimension( im,4 ) :: rand_clos - real(kind=kind_phys), dimension( im , km, 11 ) :: gdc,gdc2 -- real(kind=kind_phys), dimension( im , km ), intent(out ) :: cnvw_moist,cnvc -- real(kind=kind_phys), dimension( im , km ), intent(inout ) :: cliw, clcw -+ real(kind=kind_phys), dimension( :, :), intent(out ) :: cnvw_moist,cnvc -+ real(kind=kind_phys), dimension( :, : ), intent(inout ) :: cliw, clcw - - real(kind=kind_phys), dimension( : , : ), intent(inout ) :: & - du3dt_SCNV,dv3dt_SCNV,dt3dt_SCNV,dq3dt_SCNV, & - du3dt_DCNV,dv3dt_DCNV,dt3dt_DCNV,dq3dt_DCNV - -- integer, dimension (im), intent(inout) :: hbot,htop,kcnv -- integer, dimension (im), intent(in) :: xland -- real(kind=kind_phys), dimension (im), intent(in) :: pbl -+ integer, dimension (:), intent(inout) :: hbot,htop,kcnv -+ integer, dimension (:), intent(in) :: xland -+ real(kind=kind_phys), dimension (:), intent(in) :: pbl - integer, dimension (im) :: tropics - ! ruc variable -- real(kind=kind_phys), dimension (im) :: hfx2,qfx2,psuri -- real(kind=kind_phys), dimension (im,km) :: ud_mf,dd_mf,dt_mf -- real(kind=kind_phys), dimension (im), intent(inout) :: raincv,cld1d -- real(kind=kind_phys), dimension (im,km) :: t2di,p2di -+ real(kind=kind_phys), dimension (:) :: hfx2,qfx2,psuri -+ real(kind=kind_phys), dimension (:,:) :: ud_mf,dd_mf,dt_mf -+ real(kind=kind_phys), dimension (:), intent(inout) :: raincv,cld1d -+ real(kind=kind_phys), dimension (:,:) :: t2di,p2di - ! Specific humidity from FV3 -- real(kind=kind_phys), dimension (im,km), intent(in) :: qv2di_spechum -- real(kind=kind_phys), dimension (im,km), intent(inout) :: qv_spechum -+ real(kind=kind_phys), dimension (:,:), intent(in) :: qv2di_spechum -+ real(kind=kind_phys), dimension (:,:), intent(inout) :: qv_spechum - ! Local water vapor mixing ratios and cloud water mixing ratios - real(kind=kind_phys), dimension (im,km) :: qv2di, qv, forceqv, cnvw - ! -- real(kind=kind_phys), dimension( im ),intent(in) :: garea -+ real(kind=kind_phys), dimension( : ),intent(in) :: garea - real(kind=kind_phys), intent(in ) :: dt - - integer, intent(in ) :: imfshalcnv - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - ! define locally for now. -- integer, dimension(im),intent(inout) :: cactiv -+ integer, dimension(:),intent(inout) :: cactiv - integer, dimension(im) :: k22_shallow,kbcon_shallow,ktop_shallow - real(kind=kind_phys), dimension(im) :: ht - real(kind=kind_phys), dimension(im) :: dx -diff --git a/physics/cu_ntiedtke.F90 b/physics/cu_ntiedtke.F90 -index a824c6a..66ae9d0 100644 ---- a/physics/cu_ntiedtke.F90 -+++ b/physics/cu_ntiedtke.F90 -@@ -159,16 +159,16 @@ contains - ! in&out variables - integer, intent(in) :: lq, km, ktrac - real(kind=kind_phys), intent(in ) :: dt -- integer, dimension( lq ), intent(in) :: lmask -- real(kind=kind_phys), dimension( lq ), intent(in ) :: evap, hfx, dx -- real(kind=kind_phys), dimension( lq , km ), intent(inout) :: pu, pv, pt, pqv -- real(kind=kind_phys), dimension( lq , km ), intent(in ) :: tdi, qvdi, poz, prsl, pomg, pqvf, ptf -- real(kind=kind_phys), dimension( lq , km+1 ), intent(in ) :: pzz, prsi -- real(kind=kind_phys), dimension( lq , km, ktrac ), intent(inout ) :: clw -- -- integer, dimension( lq ), intent(out) :: kbot, ktop, kcnv -- real(kind=kind_phys), dimension( lq ), intent(out) :: zprecc -- real(kind=kind_phys), dimension (lq,km), intent(out) :: ud_mf, dd_mf, dt_mf, cnvw, cnvc -+ integer, dimension( : ), intent(in) :: lmask -+ real(kind=kind_phys), dimension( : ), intent(in ) :: evap, hfx, dx -+ real(kind=kind_phys), dimension( :, : ), intent(inout) :: pu, pv, pt, pqv -+ real(kind=kind_phys), dimension( :, :), intent(in ) :: tdi, qvdi, poz, prsl, pomg, pqvf, ptf -+ real(kind=kind_phys), dimension( :, : ), intent(in ) :: pzz, prsi -+ real(kind=kind_phys), dimension( :, :, : ), intent(inout ) :: clw -+ -+ integer, dimension( : ), intent(out) :: kbot, ktop, kcnv -+ real(kind=kind_phys), dimension( : ), intent(out) :: zprecc -+ real(kind=kind_phys), dimension (:, :), intent(out) :: ud_mf, dd_mf, dt_mf, cnvw, cnvc - - ! error messages - character(len=*), intent(out) :: errmsg -diff --git a/physics/dcyc2.f b/physics/dcyc2.f -index 6dca65c..347639d 100644 ---- a/physics/dcyc2.f -+++ b/physics/dcyc2.f -@@ -216,36 +216,36 @@ - - ! integer, intent(in) :: ipr - ! logical lprnt -- logical, dimension(im), intent(in) :: dry, icy, wet -+ logical, dimension(:), intent(in) :: dry, icy, wet - real(kind=kind_phys), intent(in) :: solhr, slag, cdec, sdec, & - & deltim, fhswr - -- real(kind=kind_phys), dimension(im), intent(in) :: & -+ real(kind=kind_phys), dimension(:), intent(in) :: & - & sinlat, coslat, xlon, coszen, tf, tsflw, sfcdlw, & - & sfcdsw, sfcnsw - -- real(kind=kind_phys), dimension(im), intent(in) :: & -+ real(kind=kind_phys), dimension(:), intent(in) :: & - & tsfc_lnd, tsfc_ice, tsfc_wat, & - & sfcemis_lnd, sfcemis_ice, sfcemis_wat - -- real(kind=kind_phys), dimension(im), intent(in) :: & -+ real(kind=kind_phys), dimension(:), intent(in) :: & - & sfcnirbmu, sfcnirdfu, sfcvisbmu, sfcvisdfu, & - & sfcnirbmd, sfcnirdfd, sfcvisbmd, sfcvisdfd - -- real(kind=kind_phys), dimension(im,levs), intent(in) :: swh, hlw & -+ real(kind=kind_phys), dimension(:,:), intent(in) :: swh, hlw & - &, swhc, hlwc - - ! --- input/output: -- real(kind=kind_phys), dimension(im,levs), intent(inout) :: dtdt & -+ real(kind=kind_phys), dimension(:,:), intent(inout) :: dtdt & - &, dtdtc - - ! --- outputs: -- real(kind=kind_phys), dimension(im), intent(out) :: & -+ real(kind=kind_phys), dimension(:), intent(out) :: & - & adjsfcdsw, adjsfcnsw, adjsfcdlw, xmu, xcosz, & - & adjnirbmu, adjnirdfu, adjvisbmu, adjvisdfu, & - & adjnirbmd, adjnirdfd, adjvisbmd, adjvisdfd - -- real(kind=kind_phys), dimension(im), intent(out) :: & -+ real(kind=kind_phys), dimension(:), intent(out) :: & - & adjsfculw_lnd, adjsfculw_ice, adjsfculw_wat - - character(len=*), intent(out) :: errmsg -diff --git a/physics/drag_suite.F90 b/physics/drag_suite.F90 -index 55ef9c2..050d635 100644 ---- a/physics/drag_suite.F90 -+++ b/physics/drag_suite.F90 -@@ -298,8 +298,8 @@ - integer, intent(in) :: im, km, imx, kdt, ipr, me, master - integer, intent(in) :: gwd_opt - logical, intent(in) :: lprnt -- integer, intent(in) :: KPBL(im) -- real(kind=kind_phys), intent(in) :: deltim, G, CP, RD, RV, cdmbgwd(2) -+ integer, intent(in) :: KPBL(:) -+ real(kind=kind_phys), intent(in) :: deltim, G, CP, RD, RV, cdmbgwd(:) - - integer :: kpblmax - integer, parameter :: ims=1, kms=1, its=1, kts=1 -@@ -308,29 +308,29 @@ - real(kind=kind_phys) :: g_inv - - real(kind=kind_phys), intent(inout) :: & -- & dudt(im,km),dvdt(im,km), & -- & dtdt(im,km) -- real(kind=kind_phys), intent(out) :: rdxzb(im) -+ & dudt(:,:),dvdt(:,:), & -+ & dtdt(:,:) -+ real(kind=kind_phys), intent(out) :: rdxzb(:) - real(kind=kind_phys), intent(in) :: & -- & u1(im,km),v1(im,km), & -- & t1(im,km),q1(im,km), & -- & PHII(im,km+1),prsl(im,km), & -- & prslk(im,km),PHIL(im,km) -- real(kind=kind_phys), intent(in) :: prsi(im,km+1), & -- & del(im,km) -- real(kind=kind_phys), intent(in) :: var(im),oc1(im), & -- & oa4(im,4),ol4(im,4), & -- & dx(im) -- real(kind=kind_phys), intent(in) :: varss(im),oc1ss(im), & -- & oa4ss(im,4),ol4ss(im,4) -- real(kind=kind_phys), intent(in) :: THETA(im),SIGMA(im), & -- & GAMMA(im),ELVMAX(im) -+ & u1(:,:),v1(:,:), & -+ & t1(:,:),q1(:,:), & -+ & PHII(:,:),prsl(:,:), & -+ & prslk(:,:),PHIL(:,:) -+ real(kind=kind_phys), intent(in) :: prsi(:,:), & -+ & del(:,:) -+ real(kind=kind_phys), intent(in) :: var(:),oc1(:), & -+ & oa4(:,:),ol4(:,:), & -+ & dx(:) -+ real(kind=kind_phys), intent(in) :: varss(:),oc1ss(:), & -+ & oa4ss(:,:),ol4ss(:,:) -+ real(kind=kind_phys), intent(in) :: THETA(:),SIGMA(:), & -+ & GAMMA(:),ELVMAX(:) - - ! added for small-scale orographic wave drag - real(kind=kind_phys), dimension(im,km) :: utendwave,vtendwave,thx,thvx -- real(kind=kind_phys), intent(in) :: br1(im), & -- & hpbl(im), & -- & slmsk(im) -+ real(kind=kind_phys), intent(in) :: br1(:), & -+ & hpbl(:), & -+ & slmsk(:) - real(kind=kind_phys), dimension(im) :: govrth,xland - !real(kind=kind_phys), dimension(im,km) :: dz2 - real(kind=kind_phys) :: tauwavex0,tauwavey0, & -@@ -344,7 +344,7 @@ - - !Output: - real(kind=kind_phys), intent(out) :: & -- & dusfc(im), dvsfc(im) -+ & dusfc(:), dvsfc(:) - !Output (optional): - real(kind=kind_phys), intent(out) :: & - & dusfc_ls(:),dvsfc_ls(:), & -diff --git a/physics/flake_driver.F90 b/physics/flake_driver.F90 -index b882c74..a1edf69 100644 ---- a/physics/flake_driver.F90 -+++ b/physics/flake_driver.F90 -@@ -81,21 +81,21 @@ IMPLICIT NONE - integer, intent(in) :: im, imon,yearlen - ! integer, dimension(im), intent(in) :: islmsk - -- real (kind=kind_phys), dimension(im), intent(in) :: ps, wind, & -+ real (kind=kind_phys), dimension(:), intent(in) :: ps, wind, & - & t1, q1, dlwflx, dswsfc, zlvl, elev - - real (kind=kind_phys), intent(in) :: delt - -- real (kind=kind_phys), dimension(im), intent(in) :: & -+ real (kind=kind_phys), dimension(:), intent(in) :: & - & xlat, weasd, lakedepth - -- real (kind=kind_phys),dimension(im),intent(inout) :: & -+ real (kind=kind_phys),dimension(:),intent(inout) :: & - & snwdph, hice, tsurf, t_sfc, hflx, evap, fice, ustar, qsfc, & - & ch, cm, chh, cmm - - real (kind=kind_phys), intent(in) :: julian - -- logical, dimension(im), intent(in) :: flag_iter, wet, lake -+ logical, dimension(:), intent(in) :: flag_iter, wet, lake - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg -diff --git a/physics/gcm_shoc.F90 b/physics/gcm_shoc.F90 -index dd7791e..3d98a5d 100644 ---- a/physics/gcm_shoc.F90 -+++ b/physics/gcm_shoc.F90 -@@ -35,12 +35,12 @@ subroutine shoc_run (nx, nzm, tcr, tcrf, con_cp, con_g, con_hvap, con_hfus, con_ - real(kind=kind_phys), intent(in) :: tcr, tcrf, con_cp, con_g, con_hvap, con_hfus, con_rv, con_rd, con_pi, con_fvirt, & - dtp, supice, pcrit, cefac, cesfac, tkef1, dis_opt - ! -- real(kind=kind_phys), intent(in), dimension(nx) :: hflx, evap -- real(kind=kind_phys), intent(in), dimension(nx,nzm) :: prsl, delp, phil, u, v, omega, rhc, prnum -- real(kind=kind_phys), intent(in), dimension(nx,nzm+1) :: phii -+ real(kind=kind_phys), intent(in), dimension(:) :: hflx, evap -+ real(kind=kind_phys), intent(in), dimension(:,:) :: prsl, delp, phil, u, v, omega, rhc, prnum -+ real(kind=kind_phys), intent(in), dimension(:,:) :: phii - ! -- real(kind=kind_phys), intent(inout), dimension(nx,nzm) :: gt0, cld_sgs, tke, tkh, wthv_sec -- real(kind=kind_phys), intent(inout), dimension(nx,nzm,ntrac) :: gq0 -+ real(kind=kind_phys), intent(inout), dimension(:,:) :: gt0, cld_sgs, tke, tkh, wthv_sec -+ real(kind=kind_phys), intent(inout), dimension(:,:,:) :: gq0 - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg -@@ -1724,7 +1724,7 @@ contains - - - real function esatw(t) -- real t ! temperature (K) -+ real t ! temperature (K) - real a0,a1,a2,a3,a4,a5,a6,a7,a8 - data a0,a1,a2,a3,a4,a5,a6,a7,a8 / & - 6.11239921, 0.443987641, 0.142986287e-1, & -@@ -1737,8 +1737,8 @@ contains - - real function qsatw(t,p) - ! implicit none -- real t ! temperature (K) -- real p ! pressure (Pa) -+ real t ! temperature (K) -+ real p ! pressure (Pa) - real esat - ! esat = fpvs(t) - esat = fpvsl(t) -@@ -1749,7 +1749,7 @@ contains - - - real function esati(t) -- real t ! temperature (K) -+ real t ! temperature (K) - real a0,a1,a2,a3,a4,a5,a6,a7,a8 - data a0,a1,a2,a3,a4,a5,a6,a7,a8 / & - 6.11147274, 0.503160820, 0.188439774e-1, & -@@ -1769,8 +1769,8 @@ contains - end function esati - - real function qsati(t,p) -- real t ! temperature (K) -- real p ! pressure (Pa) -+ real t ! temperature (K) -+ real p ! pressure (Pa) - real esat !,esati - ! esat = fpvs(t) - esat = fpvsi(t) -@@ -1780,7 +1780,7 @@ contains - end function qsati - - real function dtesatw(t) -- real t ! temperature (K) -+ real t ! temperature (K) - real a0,a1,a2,a3,a4,a5,a6,a7,a8 - data a0,a1,a2,a3,a4,a5,a6,a7,a8 / & - 0.443956472, 0.285976452e-1, 0.794747212e-3, & -@@ -1792,14 +1792,14 @@ contains - end function dtesatw - - real function dtqsatw(t,p) -- real t ! temperature (K) -- real p ! pressure (Pa) -+ real t ! temperature (K) -+ real p ! pressure (Pa) - ! real dtesatw - dtqsatw = 100.0*0.622*dtesatw(t)/p - end function dtqsatw - - real function dtesati(t) -- real t ! temperature (K) -+ real t ! temperature (K) - real a0,a1,a2,a3,a4,a5,a6,a7,a8 - data a0,a1,a2,a3,a4,a5,a6,a7,a8 / & - 0.503223089, 0.377174432e-1, 0.126710138e-2, & -@@ -1820,8 +1820,8 @@ contains - - - real function dtqsati(t,p) -- real t ! temperature (K) -- real p ! pressure (Pa) -+ real t ! temperature (K) -+ real p ! pressure (Pa) - ! real dtesati - dtqsati = 100.0*0.622*dtesati(t)/p - end function dtqsati -diff --git a/physics/get_prs_fv3.F90 b/physics/get_prs_fv3.F90 -index 352a618..e520c3e 100644 ---- a/physics/get_prs_fv3.F90 -+++ b/physics/get_prs_fv3.F90 -@@ -28,12 +28,12 @@ contains - - ! Interface variables - integer, intent(in) :: ix, levs -- real(kind=kind_phys), dimension(ix,levs+1), intent(in) :: phii -- real(kind=kind_phys), dimension(ix,levs+1), intent(in) :: prsi -- real(kind=kind_phys), dimension(ix,levs), intent(in) :: tgrs -- real(kind=kind_phys), dimension(ix,levs), intent(in) :: qgrs1 -- real(kind=kind_phys), dimension(ix,levs), intent(out) :: del -- real(kind=kind_phys), dimension(ix,levs+1), intent(out) :: del_gz -+ real(kind=kind_phys), dimension(:,:), intent(in) :: phii -+ real(kind=kind_phys), dimension(:,:), intent(in) :: prsi -+ real(kind=kind_phys), dimension(:,:), intent(in) :: tgrs -+ real(kind=kind_phys), dimension(:,:), intent(in) :: qgrs1 -+ real(kind=kind_phys), dimension(:,:), intent(out) :: del -+ real(kind=kind_phys), dimension(:,:), intent(out) :: del_gz - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - -@@ -97,11 +97,11 @@ contains - - ! Interface variables - integer, intent(in) :: ix, levs -- real(kind=kind_phys), dimension(ix,levs), intent(in) :: gt0 -- real(kind=kind_phys), dimension(ix,levs), intent(in) :: gq01 -- real(kind=kind_phys), dimension(ix,levs+1), intent(inout) :: del_gz -- real(kind=kind_phys), dimension(ix,levs+1), intent(out) :: phii -- real(kind=kind_phys), dimension(ix,levs), intent(out) :: phil -+ real(kind=kind_phys), dimension(:,:), intent(in) :: gt0 -+ real(kind=kind_phys), dimension(:,:), intent(in) :: gq01 -+ real(kind=kind_phys), dimension(:,:), intent(inout) :: del_gz -+ real(kind=kind_phys), dimension(:,:), intent(out) :: phii -+ real(kind=kind_phys), dimension(:,:), intent(out) :: phil - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - -diff --git a/physics/gfdl_cloud_microphys.F90 b/physics/gfdl_cloud_microphys.F90 -index 1ccedb9..de1e0ef 100644 ---- a/physics/gfdl_cloud_microphys.F90 -+++ b/physics/gfdl_cloud_microphys.F90 -@@ -135,29 +135,29 @@ contains - ! interface variables - integer, intent(in ) :: levs, im - real(kind=kind_phys), intent(in ) :: con_g, con_fvirt, con_rd -- real(kind=kind_phys), intent(in ), dimension(1:im) :: frland, garea -- integer, intent(in ), dimension(1:im) :: islmsk -- real(kind=kind_phys), intent(inout), dimension(1:im,1:levs) :: gq0, gq0_ntcw, gq0_ntrw, gq0_ntiw, & -+ real(kind=kind_phys), intent(in ), dimension(:) :: frland, garea -+ integer, intent(in ), dimension(:) :: islmsk -+ real(kind=kind_phys), intent(inout), dimension(:,:) :: gq0, gq0_ntcw, gq0_ntrw, gq0_ntiw, & - gq0_ntsw, gq0_ntgl, gq0_ntclamt -- real(kind=kind_phys), intent(inout), dimension(1:im,1:levs) :: gt0, gu0, gv0 -- real(kind=kind_phys), intent(in ), dimension(1:im,1:levs) :: vvl, prsl, del -- real(kind=kind_phys), intent(in ), dimension(1:im,1:levs+1) :: phii -+ real(kind=kind_phys), intent(inout), dimension(:,:) :: gt0, gu0, gv0 -+ real(kind=kind_phys), intent(in ), dimension(:,:) :: vvl, prsl, del -+ real(kind=kind_phys), intent(in ), dimension(:,:) :: phii - - ! rain/snow/ice/graupel/precip amounts, fraction of frozen precip -- real(kind_phys), intent(out ), dimension(1:im) :: rain0 -- real(kind_phys), intent(out ), dimension(1:im) :: snow0 -- real(kind_phys), intent(out ), dimension(1:im) :: ice0 -- real(kind_phys), intent(out ), dimension(1:im) :: graupel0 -- real(kind_phys), intent(out ), dimension(1:im) :: prcp0 -- real(kind_phys), intent(out ), dimension(1:im) :: sr -+ real(kind_phys), intent(out ), dimension(:) :: rain0 -+ real(kind_phys), intent(out ), dimension(:) :: snow0 -+ real(kind_phys), intent(out ), dimension(:) :: ice0 -+ real(kind_phys), intent(out ), dimension(:) :: graupel0 -+ real(kind_phys), intent(out ), dimension(:) :: prcp0 -+ real(kind_phys), intent(out ), dimension(:) :: sr - - real(kind_phys), intent(in) :: dtp ! physics time step - logical, intent (in) :: hydrostatic, phys_hydrostatic - - logical, intent (in) :: lradar -- real(kind=kind_phys), intent(inout), dimension(1:im,1:levs) :: refl_10cm -+ real(kind=kind_phys), intent(inout), dimension(:,:) :: refl_10cm - logical, intent (in) :: reset, effr_in -- real(kind=kind_phys), intent(inout), dimension(1:im,1:levs) :: rew, rei, rer, res, reg -+ real(kind=kind_phys), intent(inout), dimension(:,:) :: rew, rei, rer, res, reg - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg -diff --git a/physics/gfdl_fv_sat_adj.F90 b/physics/gfdl_fv_sat_adj.F90 -index 816488f..5cc3c91 100644 ---- a/physics/gfdl_fv_sat_adj.F90 -+++ b/physics/gfdl_fv_sat_adj.F90 -@@ -128,8 +128,8 @@ subroutine fv_sat_adj_init(do_sat_adj, kmp, nwat, ngas, rilist, cpilist, & - integer, intent(in ) :: kmp - integer, intent(in ) :: nwat - integer, intent(in ) :: ngas -- real(kind_dyn), intent(in ) :: rilist(0:ngas) -- real(kind_dyn), intent(in ) :: cpilist(0:ngas) -+ real(kind_dyn), intent(in ) :: rilist(:) -+ real(kind_dyn), intent(in ) :: cpilist(:) - integer, intent(in ) :: mpirank - integer, intent(in ) :: mpiroot - character(len=*), intent( out) :: errmsg -diff --git a/physics/gscond.f b/physics/gscond.f -index 28f2476..7144ba2 100644 ---- a/physics/gscond.f -+++ b/physics/gscond.f -@@ -73,14 +73,14 @@ - ! Interface variables - integer, intent(in) :: im, km, ipr - real(kind=kind_phys), intent(in) :: dt, dtf -- real(kind=kind_phys), intent(in) :: prsl(im,km), ps(im) -- real(kind=kind_phys), intent(inout) :: q(im,km) -- real(kind=kind_phys), intent(in) :: clw1(im,km), clw2(im,km) -- real(kind=kind_phys), intent(out) :: cwm(im,km) -- real(kind=kind_phys), intent(inout) :: t(im,km) & -- &, tp(im,km), qp(im,km), psp(im) & -- &, tp1(im,km), qp1(im,km), psp1(im) -- real(kind=kind_phys), intent(in) :: u(im,km) -+ real(kind=kind_phys), intent(in) :: prsl(:,:), ps(:) -+ real(kind=kind_phys), intent(inout) :: q(:,:) -+ real(kind=kind_phys), intent(in) :: clw1(:,:), clw2(:,:) -+ real(kind=kind_phys), intent(out) :: cwm(:,:) -+ real(kind=kind_phys), intent(inout) :: t(:,:) & -+ &, tp(:,:), qp(:,:), psp(:) & -+ &, tp1(:,:), qp1(:,:), psp1(:) -+ real(kind=kind_phys), intent(in) :: u(:,:) - logical, intent(in) :: lprnt - ! - character(len=*), intent(out) :: errmsg -diff --git a/physics/gwdc.f b/physics/gwdc.f -index 5c6f8ec..0978a95 100644 ---- a/physics/gwdc.f -+++ b/physics/gwdc.f -@@ -187,15 +187,15 @@ - !----------------------------------------------------------------------- - - integer, intent(in) :: im, km, lat, ipr -- integer, intent(in) :: ktop(im),kbot(im),kcnv(im) -+ integer, intent(in) :: ktop(:),kbot(:),kcnv(:) - real(kind=kind_phys), intent(in) :: grav,cp,rd,fv,fhour,deltim,pi -- real(kind=kind_phys), dimension(im), intent(in) :: qmax -- real(kind=kind_phys), dimension(im), intent(out) :: tauctx,taucty -- real(kind=kind_phys), dimension(im), intent(in) :: cldf,dlength -- real(kind=kind_phys), dimension(im,km), intent(in) :: u1,v1,t1, & -+ real(kind=kind_phys), dimension(:), intent(in) :: qmax -+ real(kind=kind_phys), dimension(:), intent(out) :: tauctx,taucty -+ real(kind=kind_phys), dimension(:), intent(in) :: cldf,dlength -+ real(kind=kind_phys), dimension(:,:), intent(in) :: u1,v1,t1, & - & q1,pmid1,dpmid1 -- real(kind=kind_phys), dimension(im,km), intent(out) :: utgwc,vtgwc -- real(kind=kind_phys), dimension(im,km+1), intent(in) :: pint1 -+ real(kind=kind_phys), dimension(:,:), intent(out) :: utgwc,vtgwc -+ real(kind=kind_phys), dimension(:,:), intent(in) :: pint1 - ! - logical, intent(in) :: lprnt - ! -diff --git a/physics/gwdps.f b/physics/gwdps.f -index b09413f..486aa66 100644 ---- a/physics/gwdps.f -+++ b/physics/gwdps.f -@@ -1315,4 +1315,4 @@ - subroutine gwdps_finalize() - end subroutine gwdps_finalize - -- end module gwdps -+ end module gwdps -\ No newline at end of file -diff --git a/physics/h2ophys.f b/physics/h2ophys.f -index b3bdd27..ccbce7c 100644 ---- a/physics/h2ophys.f -+++ b/physics/h2ophys.f -@@ -41,10 +41,10 @@ - ! interface variables - integer, intent(in) :: im, levs, kh2o, h2o_coeff, me - real(kind=kind_phys), intent(in) :: dt -- real(kind=kind_phys), intent(inout) :: h2o(im,levs) -- real(kind=kind_phys), intent(in) :: ph2o(kh2o) -- real(kind=kind_phys), intent(in) :: prsl(im,levs) -- real(kind=kind_phys), intent(in) :: h2opltc(im,kh2o,h2o_coeff) -+ real(kind=kind_phys), intent(inout) :: h2o(:,:) -+ real(kind=kind_phys), intent(in) :: ph2o(:) -+ real(kind=kind_phys), intent(in) :: prsl(:,:) -+ real(kind=kind_phys), intent(in) :: h2opltc(:,:,:) - logical , intent(in) :: ldiag3d - !real(kind=kind_phys), intent(inout) :: h2op(im,levs,h2o_coeff) - character(len=*), intent(out) :: errmsg -diff --git a/physics/lsm_ruc_sfc_sice_interstitial.F90 b/physics/lsm_ruc_sfc_sice_interstitial.F90 -index 27033fc..54c514a 100644 ---- a/physics/lsm_ruc_sfc_sice_interstitial.F90 -+++ b/physics/lsm_ruc_sfc_sice_interstitial.F90 -@@ -27,12 +27,12 @@ contains - - ! Interface variables - integer, intent(in) :: im, lsoil_ruc, lsoil, kice -- logical, dimension(im), intent(in) :: land, icy -+ logical, dimension(:), intent(in) :: land, icy - ! --- on Noah levels -- real (kind=kind_phys), dimension(im,lsoil), intent(inout) :: stc -+ real (kind=kind_phys), dimension(:,:), intent(inout) :: stc - ! --- on RUC levels -- real (kind=kind_phys), dimension(im,lsoil_ruc), intent(in) :: tslb -- real (kind=kind_phys), dimension(im,kice), intent(inout) :: tiice -+ real (kind=kind_phys), dimension(:,:), intent(in) :: tslb -+ real (kind=kind_phys), dimension(:,:), intent(inout) :: tiice - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg -@@ -89,12 +89,12 @@ contains - - ! Interface variables - integer, intent(in) :: im, lsoil_ruc, lsoil, kice -- logical, dimension(im), intent(in) :: land, icy -+ logical, dimension(:), intent(in) :: land, icy - ! --- on Noah levels -- real (kind=kind_phys), dimension(im,lsoil), intent(in) :: stc -- real (kind=kind_phys), dimension(im,kice), intent(in) :: tiice -+ real (kind=kind_phys), dimension(:,:), intent(in) :: stc -+ real (kind=kind_phys), dimension(:,:), intent(in) :: tiice - ! --- on RUC levels -- real (kind=kind_phys), dimension(im,lsoil_ruc), intent(inout) :: tslb -+ real (kind=kind_phys), dimension(:,:), intent(inout) :: tslb - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg -diff --git a/physics/m_micro.F90 b/physics/m_micro.F90 -index 69690d5..67706ca 100644 ---- a/physics/m_micro.F90 -+++ b/physics/m_micro.F90 -@@ -181,10 +181,10 @@ end subroutine m_micro_init - logical,intent(in) :: flipv, skip_macro - real (kind=kind_phys), intent(in):: dt_i, alf_fac, qc_min(2) - -- real (kind=kind_phys), dimension(im,lm),intent(in) :: & -+ real (kind=kind_phys), dimension(:,:),intent(in) :: & - & prsl_i,u_i,v_i,phil, omega_i, QLLS_i,QILS_i, & - & lwheat_i,swheat_i -- real (kind=kind_phys), dimension(im,0:lm),intent(in):: prsi_i, & -+ real (kind=kind_phys), dimension(:,:),intent(in):: prsi_i, & - & phii - ! GJF* These variables are conditionally allocated depending on whether the - ! Morrison-Gettelman microphysics is used, so they must be declared -@@ -194,26 +194,26 @@ end subroutine m_micro_init - & CNV_MFD_i, cf_upi, CNV_FICE_i, CNV_NDROP_i, & - & CNV_NICE_i, w_upi - ! *GJF -- real (kind=kind_phys), dimension(im,lm),intent(in) :: & -+ real (kind=kind_phys), dimension(:,:),intent(in) :: & - & rhc_i, naai_i, npccn_i -- real (kind=kind_phys), dimension(im,lm,ntrcaer),intent(in) :: & -+ real (kind=kind_phys), dimension(:,:,:),intent(in) :: & - & aerfld_i -- real (kind=kind_phys),dimension(im),intent(in):: TAUGWX, & -+ real (kind=kind_phys),dimension(:),intent(in):: TAUGWX, & - & TAUGWY, TAUOROX, TAUOROY, FRLAND,ZPBL,xlat,xlon - ! & TAUGWY, TAUX, TAUY, TAUOROX, TAUOROY,ps_i,FRLAND,ZPBL - ! & CNVPRCP - - ! output -- real (kind=kind_phys),dimension(im,lm), intent(out) :: lwm_o, qi_o, & -+ real (kind=kind_phys),dimension(:,:), intent(out) :: lwm_o, qi_o, & - cldreffl, cldreffi, cldreffr, cldreffs, cldreffg -- real (kind=kind_phys),dimension(im), intent(out) :: rn_o, sr_o -+ real (kind=kind_phys),dimension(:), intent(out) :: rn_o, sr_o - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - - ! input and output - ! Anning Cheng 10/24/2016 twat for total water, diagnostic purpose -- integer, dimension(IM), intent(inout):: KCBL -- real (kind=kind_phys),dimension(im,lm),intent(inout):: q_io, t_io, & -+ integer, dimension(:), intent(inout):: KCBL -+ real (kind=kind_phys),dimension(:,:),intent(inout):: q_io, t_io, & - & ncpl_io,ncpi_io,CLLS_io - ! GJF* These variables are conditionally allocated depending on whether the - ! Morrison-Gettelman microphysics is used, so they must be declared -diff --git a/physics/m_micro_interstitial.F90 b/physics/m_micro_interstitial.F90 -index 930b32b..00e6f8e 100644 ---- a/physics/m_micro_interstitial.F90 -+++ b/physics/m_micro_interstitial.F90 -@@ -183,22 +183,22 @@ - integer, intent(in) :: im, levs, fprcp - logical, intent(in) :: mg3_as_mg2 - -- real(kind=kind_phys), intent(in ) :: ncpr(1:im,1:levs) -- real(kind=kind_phys), intent(in ) :: ncps(1:im,1:levs) -- real(kind=kind_phys), intent(in ) :: ncgl(1:im,1:levs) -- real(kind=kind_phys), intent(inout) :: qrn(1:im,1:levs) -- real(kind=kind_phys), intent(inout) :: qsnw(1:im,1:levs) -- real(kind=kind_phys), intent(inout) :: qgl(1:im,1:levs) -- real(kind=kind_phys), intent(inout) :: gq0_ice(1:im,1:levs) -- real(kind=kind_phys), intent(inout) :: gq0_rain(1:im,1:levs) -- real(kind=kind_phys), intent(inout) :: gq0_snow(1:im,1:levs) -- real(kind=kind_phys), intent(inout) :: gq0_graupel(1:im,1:levs) -- real(kind=kind_phys), intent(inout) :: gq0_rain_nc(1:im,1:levs) -- real(kind=kind_phys), intent(inout) :: gq0_snow_nc(1:im,1:levs) -- real(kind=kind_phys), intent(inout) :: gq0_graupel_nc(1:im,1:levs) -- real(kind=kind_phys), intent( out) :: ice(1:im) -- real(kind=kind_phys), intent( out) :: snow(1:im) -- real(kind=kind_phys), intent( out) :: graupel(1:im) -+ real(kind=kind_phys), intent(in ) :: ncpr(:,:) -+ real(kind=kind_phys), intent(in ) :: ncps(:,:) -+ real(kind=kind_phys), intent(in ) :: ncgl(:,:) -+ real(kind=kind_phys), intent(inout) :: qrn(:,:) -+ real(kind=kind_phys), intent(inout) :: qsnw(:,:) -+ real(kind=kind_phys), intent(inout) :: qgl(:,:) -+ real(kind=kind_phys), intent(inout) :: gq0_ice(:,:) -+ real(kind=kind_phys), intent(inout) :: gq0_rain(:,:) -+ real(kind=kind_phys), intent(inout) :: gq0_snow(:,:) -+ real(kind=kind_phys), intent(inout) :: gq0_graupel(:,:) -+ real(kind=kind_phys), intent(inout) :: gq0_rain_nc(:,:) -+ real(kind=kind_phys), intent(inout) :: gq0_snow_nc(:,:) -+ real(kind=kind_phys), intent(inout) :: gq0_graupel_nc(:,:) -+ real(kind=kind_phys), intent( out) :: ice(:) -+ real(kind=kind_phys), intent( out) :: snow(:) -+ real(kind=kind_phys), intent( out) :: graupel(:) - real(kind=kind_phys), intent(in ) :: dtp - - character(len=*), intent(out) :: errmsg -diff --git a/physics/maximum_hourly_diagnostics.F90 b/physics/maximum_hourly_diagnostics.F90 -index 174e0c9..615c49b 100644 ---- a/physics/maximum_hourly_diagnostics.F90 -+++ b/physics/maximum_hourly_diagnostics.F90 -@@ -37,23 +37,23 @@ contains - logical, intent(in) :: reset, lradar - integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_fer_hires - real(kind_phys), intent(in ) :: con_g -- real(kind_phys), intent(in ) :: phil(im,levs) -- real(kind_phys), intent(in ) :: gt0(im,levs) -- real(kind_phys), intent(in ) :: refl_10cm(im,levs) -- real(kind_phys), intent(inout) :: refdmax(im) -- real(kind_phys), intent(inout) :: refdmax263k(im) -- real(kind_phys), intent(in ) :: u10m(im) -- real(kind_phys), intent(in ) :: v10m(im) -- real(kind_phys), intent(inout) :: u10max(im) -- real(kind_phys), intent(inout) :: v10max(im) -- real(kind_phys), intent(inout) :: spd10max(im) -- real(kind_phys), intent(in ) :: pgr(im) -- real(kind_phys), intent(in ) :: t2m(im) -- real(kind_phys), intent(in ) :: q2m(im) -- real(kind_phys), intent(inout) :: t02max(im) -- real(kind_phys), intent(inout) :: t02min(im) -- real(kind_phys), intent(inout) :: rh02max(im) -- real(kind_phys), intent(inout) :: rh02min(im) -+ real(kind_phys), intent(in ) :: phil(:,:) -+ real(kind_phys), intent(in ) :: gt0(:,:) -+ real(kind_phys), intent(in ) :: refl_10cm(:,:) -+ real(kind_phys), intent(inout) :: refdmax(:) -+ real(kind_phys), intent(inout) :: refdmax263k(:) -+ real(kind_phys), intent(in ) :: u10m(:) -+ real(kind_phys), intent(in ) :: v10m(:) -+ real(kind_phys), intent(inout) :: u10max(:) -+ real(kind_phys), intent(inout) :: v10max(:) -+ real(kind_phys), intent(inout) :: spd10max(:) -+ real(kind_phys), intent(in ) :: pgr(:) -+ real(kind_phys), intent(in ) :: t2m(:) -+ real(kind_phys), intent(in ) :: q2m(:) -+ real(kind_phys), intent(inout) :: t02max(:) -+ real(kind_phys), intent(inout) :: t02min(:) -+ real(kind_phys), intent(inout) :: rh02max(:) -+ real(kind_phys), intent(inout) :: rh02min(:) - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - -@@ -126,12 +126,12 @@ contains - subroutine max_fields(phil,ref3D,grav,im,levs,refd,tk,refd263k) - integer, intent(in) :: im,levs - real (kind=kind_phys), intent(in) :: grav -- real (kind=kind_phys), intent(in),dimension(im,levs) :: phil,ref3D,tk -+ real (kind=kind_phys), intent(in),dimension(:,:) :: phil,ref3D,tk - integer :: i,k,ll,ipt,kpt - real :: dbz1avg,zmidp1,zmidloc,refl,fact - real, dimension(im,levs) :: z - real, dimension(im) :: zintsfc -- real, dimension(im), intent(inout) :: refd,refd263k -+ real, dimension(:), intent(inout) :: refd,refd263k - REAL :: dbz1(2),dbzk,dbzk1 - logical :: counter - do i=1,im -diff --git a/physics/module_MYJSFC_wrapper.F90 b/physics/module_MYJSFC_wrapper.F90 -index e3dcf41..90c50ce 100644 ---- a/physics/module_MYJSFC_wrapper.F90 -+++ b/physics/module_MYJSFC_wrapper.F90 -@@ -91,22 +91,22 @@ - real(kind=kind_phys),intent(in) :: con_cp, con_g, con_rd - - !MYJ-2D -- logical,dimension(im),intent(in) :: flag_iter -- real(kind=kind_phys),dimension(im),intent(in) :: & -+ logical,dimension(:),intent(in) :: flag_iter -+ real(kind=kind_phys),dimension(:),intent(in) :: & - & prsik_1, prslk_1, tsfc, qsfc, slmsk -- real(kind=kind_phys),dimension(im),intent(inout) :: & -+ real(kind=kind_phys),dimension(:),intent(inout) :: & - & phy_myj_qsfc, phy_myj_thz0, phy_myj_qz0, & - & phy_myj_uz0, phy_myj_vz0, phy_myj_z0base, & - & phy_myj_akhs, phy_myj_akms, & - & phy_myj_chkqlm, phy_myj_elflx, & - & phy_myj_a1u, phy_myj_a1t, phy_myj_a1q -- real(kind=kind_phys),dimension(im),intent(inout) :: & -+ real(kind=kind_phys),dimension(:),intent(inout) :: & - & pblh, zorl, ustar, rib -- real(kind=kind_phys),dimension(im),intent(out) :: & -+ real(kind=kind_phys),dimension(:),intent(out) :: & - & cm, ch, stress, ffm, ffh, fm10, fh2 -- real(kind=kind_phys), dimension(im), intent(inout) :: & -+ real(kind=kind_phys), dimension(:), intent(inout) :: & - & landfrac, lakefrac, oceanfrac, fice -- real(kind=kind_phys), dimension(im), intent(inout) :: & -+ real(kind=kind_phys), dimension(:), intent(inout) :: & - & z0rl_wat, z0rl_lnd, z0rl_ice, & - & ustar_wat, ustar_lnd, ustar_ice, & - & cm_wat, cm_lnd, cm_ice, & -@@ -121,12 +121,12 @@ - - - !MYJ-3D -- real(kind=kind_phys),dimension(im,levs+1),intent(in) :: & -+ real(kind=kind_phys),dimension(:,:),intent(in) :: & - phii, prsi -- real(kind=kind_phys),dimension(im,levs),intent(in) :: & -+ real(kind=kind_phys),dimension(:,:),intent(in) :: & - & ugrs, vgrs, tgrs, prsl - !MYJ-4D -- real(kind=kind_phys),dimension(im,levs,ntrac),intent(in) :: & -+ real(kind=kind_phys),dimension(:,:,:),intent(in) :: & - & qgrs - - !LOCAL -diff --git a/physics/module_MYNNPBL_wrapper.F90 b/physics/module_MYNNPBL_wrapper.F90 -index 8fd7271..2d673e4 100644 ---- a/physics/module_MYNNPBL_wrapper.F90 -+++ b/physics/module_MYNNPBL_wrapper.F90 -@@ -234,13 +234,13 @@ SUBROUTINE mynnedmf_wrapper_run( & - REAL(kind=kind_phys) :: tem - - !MYNN-3D -- real(kind=kind_phys), dimension(im,levs+1), intent(in) :: phii -- real(kind=kind_phys), dimension(im,levs ), intent(inout) :: & -+ real(kind=kind_phys), dimension(:,:), intent(in) :: phii -+ real(kind=kind_phys), dimension(:,:), intent(inout) :: & - & dtdt, dudt, dvdt, & - & dqdt_water_vapor, dqdt_liquid_cloud, dqdt_ice_cloud, & - & dqdt_cloud_droplet_num_conc, dqdt_ice_num_conc, & - & dqdt_ozone, dqdt_water_aer_num_conc, dqdt_ice_aer_num_conc -- real(kind=kind_phys), dimension(im,levs), intent(inout) :: & -+ real(kind=kind_phys), dimension(:,:), intent(inout) :: & - & qke, qke_adv, EL_PBL, Sh3D, & - & qc_bl, qi_bl, cldfra_bl - !These 10 arrays are only allocated when bl_mynn_output > 0 -@@ -248,7 +248,7 @@ SUBROUTINE mynnedmf_wrapper_run( & - & edmf_a,edmf_w,edmf_qt, & - & edmf_thl,edmf_ent,edmf_qc, & - & sub_thl,sub_sqv,det_thl,det_sqv -- real(kind=kind_phys), dimension(im,levs), intent(in) :: & -+ real(kind=kind_phys), dimension(:,:), intent(in) :: & - & u,v,omega,t3d, & - & exner,prsl, & - & qgrs_water_vapor, & -@@ -259,13 +259,13 @@ SUBROUTINE mynnedmf_wrapper_run( & - & qgrs_ozone, & - & qgrs_water_aer_num_conc, & - & qgrs_ice_aer_num_conc -- real(kind=kind_phys), dimension(im,levs), intent(out) :: & -+ real(kind=kind_phys), dimension(:,:), intent(out) :: & - & Tsq, Qsq, Cov, exch_h, exch_m - real(kind=kind_phys), dimension(:,:), intent(inout) :: & - & du3dt_PBL, du3dt_OGWD, dv3dt_PBL, dv3dt_OGWD, & - & do3dt_PBL, dq3dt_PBL, dt3dt_PBL -- real(kind=kind_phys), dimension(im), intent(in) :: xmu -- real(kind=kind_phys), dimension(im, levs), intent(in) :: htrsw, htrlw -+ real(kind=kind_phys), dimension(:), intent(in) :: xmu -+ real(kind=kind_phys), dimension(:,:), intent(in) :: htrsw, htrlw - !LOCAL - real(kind=kind_phys), dimension(im,levs) :: & - & sqv,sqc,sqi,qnc,qni,ozone,qnwfa,qnifa, & -@@ -284,26 +284,26 @@ SUBROUTINE mynnedmf_wrapper_run( & - REAL(kind=kind_phys), DIMENSION( ndvel ) :: vd1 - - !MYNN-2D -- real(kind=kind_phys), dimension(im), intent(in) :: & -+ real(kind=kind_phys), dimension(:), intent(in) :: & - & dx,zorl,slmsk,tsurf,qsfc,ps, & - & hflx,qflx,ust,wspd,rb,recmol - -- real(kind=kind_phys), dimension(im), intent(in) :: & -+ real(kind=kind_phys), dimension(:), intent(in) :: & - & dusfc_cice,dvsfc_cice,dtsfc_cice,dqsfc_cice, & - & stress_ocn,hflx_ocn,qflx_ocn, & - & oceanfrac,fice - -- logical, dimension(im), intent(in) :: & -+ logical, dimension(:), intent(in) :: & - & wet, dry, icy - -- real(kind=kind_phys), dimension(im), intent(inout) :: & -+ real(kind=kind_phys), dimension(:), intent(inout) :: & - & pblh -- real(kind=kind_phys), dimension(im), intent(out) :: & -+ real(kind=kind_phys), dimension(:), intent(out) :: & - & ch,dtsfc1,dqsfc1,dusfc1,dvsfc1, & - & dtsfci_diag,dqsfci_diag,dtsfc_diag,dqsfc_diag, & - & dusfci_diag,dvsfci_diag,dusfc_diag,dvsfc_diag, & - & maxMF -- integer, dimension(im), intent(inout) :: & -+ integer, dimension(:), intent(inout) :: & - & kpbl,nupdraft,ktop_plume - - real(kind=kind_phys), dimension(:), intent(inout) :: & -diff --git a/physics/module_MYNNSFC_wrapper.F90 b/physics/module_MYNNSFC_wrapper.F90 -index 496db75..4bfb91c 100644 ---- a/physics/module_MYNNSFC_wrapper.F90 -+++ b/physics/module_MYNNSFC_wrapper.F90 -@@ -111,8 +111,8 @@ SUBROUTINE mynnsfc_wrapper_run( & - logical, intent(in) :: redrag ! reduced drag coeff. flag for high wind over sea (j.han) - - !Input data -- integer, dimension(im), intent(in) :: vegtype -- real(kind=kind_phys), dimension(im), intent(in) :: & -+ integer, dimension(:), intent(in) :: vegtype -+ real(kind=kind_phys), dimension(:), intent(in) :: & - & sigmaf,shdmax,z0pert,ztpert - - !MYNN-1D -@@ -124,23 +124,23 @@ SUBROUTINE mynnsfc_wrapper_run( & - & IMS,IME,JMS,JME,KMS,KME, & - & ITS,ITE,JTS,JTE,KTS,KTE - -- real(kind=kind_phys), dimension(im,levs+1), & -+ real(kind=kind_phys), dimension(:,:), & - & intent(in) :: phii -- real(kind=kind_phys), dimension(im,levs), & -+ real(kind=kind_phys), dimension(:,:), & - & intent(in) :: exner, PRSL, & - & u, v, t3d, qvsh, qc - - real(kind=kind_phys), dimension(im,levs) :: & - & pattern_spp_pbl, dz, th, qv - -- logical, dimension(im), intent(in) :: wet, dry, icy -+ logical, dimension(:), intent(in) :: wet, dry, icy - -- real(kind=kind_phys), dimension(im), intent(in) :: & -+ real(kind=kind_phys), dimension(:), intent(in) :: & - & tskin_ocn, tskin_lnd, tskin_ice, & - & tsurf_ocn, tsurf_lnd, tsurf_ice, & - & snowh_ocn, snowh_lnd, snowh_ice - -- real(kind=kind_phys), dimension(im), intent(inout) :: & -+ real(kind=kind_phys), dimension(:), intent(inout) :: & - & znt_ocn, znt_lnd, znt_ice, & - & ust_ocn, ust_lnd, ust_ice, & - & cm_ocn, cm_lnd, cm_ice, & -@@ -156,10 +156,10 @@ SUBROUTINE mynnsfc_wrapper_run( & - & qsfc_ocn, qsfc_lnd, qsfc_ice - - !MYNN-2D -- real(kind=kind_phys), dimension(im), intent(in) :: & -+ real(kind=kind_phys), dimension(:), intent(in) :: & - & dx, pblh, slmsk, ps - -- real(kind=kind_phys), dimension(im), intent(inout) :: & -+ real(kind=kind_phys), dimension(:), intent(inout) :: & - & ustm, hflx, qflx, wspd, qsfc, qsfc_ruc, & - & FLHC, FLQC, U10, V10, TH2, T2, Q2, & - & CHS2, CQS2, rmol, zol, mol, ch, & -diff --git a/physics/module_SGSCloud_RadPost.F90 b/physics/module_SGSCloud_RadPost.F90 -index bedb660..ea26259 100644 ---- a/physics/module_SGSCloud_RadPost.F90 -+++ b/physics/module_SGSCloud_RadPost.F90 -@@ -34,8 +34,8 @@ - - integer, intent(in) :: im, levs - logical, intent(in) :: flag_init, flag_restart -- real(kind=kind_phys), dimension(im,levs), intent(inout) :: qc, qi -- real(kind=kind_phys), dimension(im,levs), intent(in) :: qc_save, qi_save -+ real(kind=kind_phys), dimension(:,:), intent(inout) :: qc, qi -+ real(kind=kind_phys), dimension(:,:), intent(in) :: qc_save, qi_save - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - ! Local variable -diff --git a/physics/module_SGSCloud_RadPre.F90 b/physics/module_SGSCloud_RadPre.F90 -index 5a1a274..3380f8f 100644 ---- a/physics/module_SGSCloud_RadPre.F90 -+++ b/physics/module_SGSCloud_RadPre.F90 -@@ -67,20 +67,20 @@ - integer, intent(in) :: im, levs, imfdeepcnv, imfdeepcnv_gf, & - & nlay, imp_physics, imp_physics_gfdl - logical, intent(in) :: flag_init, flag_restart, do_mynnedmf -- real(kind=kind_phys), dimension(im,levs), intent(inout) :: qc, qi -- real(kind=kind_phys), dimension(im,levs), intent(inout) :: qr, qs, qg -+ real(kind=kind_phys), dimension(:,:), intent(inout) :: qc, qi -+ real(kind=kind_phys), dimension(:,:), intent(inout) :: qr, qs, qg - ! qci_conv only allocated if GF is used - real(kind=kind_phys), dimension(:,:), intent(inout) :: qci_conv -- real(kind=kind_phys), dimension(im,levs), intent(in) :: T3D,delp, & -+ real(kind=kind_phys), dimension(:,:), intent(in) :: T3D,delp, & - & qv,P3D -- real(kind=kind_phys), dimension(im,levs), intent(inout) :: & -+ real(kind=kind_phys), dimension(:,:), intent(inout) :: & - & clouds1,clouds2,clouds3,clouds4,clouds5 -- real(kind=kind_phys), dimension(im,levs), intent(inout) :: qc_save, qi_save -- real(kind=kind_phys), dimension(im,levs), intent(in) :: qc_bl, qi_bl, cldfra_bl -- real(kind=kind_phys), dimension(im), intent(in) :: slmsk, xlat, de_lgth -- real(kind=kind_phys), dimension(im,nlay), intent(in) :: plyr, dz -- real(kind=kind_phys), dimension(im,5), intent(inout) :: cldsa -- integer, dimension(im,3), intent(inout) :: mbota, mtopa -+ real(kind=kind_phys), dimension(:,:), intent(inout) :: qc_save, qi_save -+ real(kind=kind_phys), dimension(:,:), intent(in) :: qc_bl, qi_bl, cldfra_bl -+ real(kind=kind_phys), dimension(:), intent(in) :: slmsk, xlat, de_lgth -+ real(kind=kind_phys), dimension(:,:), intent(in) :: plyr, dz -+ real(kind=kind_phys), dimension(:,:), intent(inout) :: cldsa -+ integer, dimension(:,:), intent(inout) :: mbota, mtopa - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - ! Local variables -diff --git a/physics/moninedmf.f b/physics/moninedmf.f -index 63edc34..9a6e4a6 100644 ---- a/physics/moninedmf.f -+++ b/physics/moninedmf.f -@@ -79,38 +79,38 @@ - logical, intent(in) :: lprnt,lssav,ldiag3d,qdiag3d,lsidea - logical, intent(in) :: flag_for_pbl_generic_tend - integer, intent(in) :: ipr -- integer, intent(in) :: im, km, ntrac, ntcw, kinver(im), ntoz -- integer, intent(out) :: kpbl(im) -+ integer, intent(in) :: im, km, ntrac, ntcw, kinver(:), ntoz -+ integer, intent(out) :: kpbl(:) - - ! - real(kind=kind_phys), intent(in) :: delt, xkzm_m, xkzm_h, xkzm_s - real(kind=kind_phys), intent(in) :: xkzminv, moninq_fac -- real(kind=kind_phys), intent(inout) :: dv(im,km), du(im,km), & -- & tau(im,km), rtg(im,km,ntrac) -+ real(kind=kind_phys), intent(inout) :: dv(:,:), du(:,:), & -+ & tau(:,:), rtg(:,:,:) - ! Only allocated if ldiag3d or qdiag3d are true - real(kind=kind_phys), intent(inout), dimension(:,:) :: & - & du3dt_PBL,dv3dt_PBL,dt3dt_PBL,dq3dt_PBL,do3dt_PBL - real(kind=kind_phys), intent(in) :: & -- & u1(im,km), v1(im,km), & -- & t1(im,km), q1(im,km,ntrac), & -- & swh(im,km), hlw(im,km), & -- & xmu(im), psk(im), & -- & rbsoil(im), zorl(im), & -- & u10m(im), v10m(im), & -- & fm(im), fh(im), & -- & tsea(im), & -- & heat(im), evap(im), & -- & stress(im), spd1(im) -+ & u1(:,:), v1(:,:), & -+ & t1(:,:), q1(:,:,:), & -+ & swh(:,:), hlw(:,:), & -+ & xmu(:), psk(:), & -+ & rbsoil(:), zorl(:), & -+ & u10m(:), v10m(:), & -+ & fm(:), fh(:), & -+ & tsea(:), & -+ & heat(:), evap(:), & -+ & stress(:), spd1(:) - real(kind=kind_phys), intent(in) :: & -- & prsi(im,km+1), del(im,km), & -- & prsl(im,km), prslk(im,km), & -- & phii(im,km+1), phil(im,km) -+ & prsi(:,:), del(:,:), & -+ & prsl(:,:), prslk(:,:), & -+ & phii(:,:), phil(:,:) - real(kind=kind_phys), intent(out) :: & -- & dusfc(im), dvsfc(im), & -- & dtsfc(im), dqsfc(im), & -- & hpbl(im), dkt(im,km-1) -+ & dusfc(:), dvsfc(:), & -+ & dtsfc(:), dqsfc(:), & -+ & hpbl(:), dkt(:,:) - real(kind=kind_phys), intent(inout) :: & -- & hgamt(im), hgamq(im) -+ & hgamt(:), hgamq(:) - ! - logical, intent(in) :: dspheat - ! flag for tke dissipative heating -diff --git a/physics/moninedmf_hafs.f b/physics/moninedmf_hafs.f -index 00a8dbd..5b16a63 100644 ---- a/physics/moninedmf_hafs.f -+++ b/physics/moninedmf_hafs.f -@@ -76,37 +76,37 @@ - ! - logical, intent(in) :: lprnt - integer, intent(in) :: ipr -- integer, intent(in) :: im, km, ntrac, ntcw, kinver(im) -- integer, intent(in) :: islimsk(1:im) -- integer, intent(out) :: kpbl(im) -+ integer, intent(in) :: im, km, ntrac, ntcw, kinver(:) -+ integer, intent(in) :: islimsk(:) -+ integer, intent(out) :: kpbl(:) - - ! - real(kind=kind_phys), intent(in) :: delt, xkzm_m, xkzm_h, xkzm_s - real(kind=kind_phys), intent(in) :: xkzminv, moninq_fac -- real(kind=kind_phys), intent(inout) :: dv(im,km), du(im,km), & -- & tau(im,km), rtg(im,km,ntrac) -+ real(kind=kind_phys), intent(inout) :: dv(:,:), du(:,:), & -+ & tau(:,:), rtg(:,:,:) - real(kind=kind_phys), intent(in) :: & -- & u1(im,km), v1(im,km), & -- & t1(im,km), q1(im,km,ntrac), & -- & swh(im,km), hlw(im,km), & -- & xmu(im), psk(im), & -- & rbsoil(im), zorl(im), & -- & u10m(im), v10m(im), & -- & fm(im), fh(im), & -- & tsea(im), & -- & heat(im), evap(im), & -- & stress(im), spd1(im) -+ & u1(:,:), v1(:,:), & -+ & t1(:,:), q1(:,:,:), & -+ & swh(:,:), hlw(:,:), & -+ & xmu(:), psk(:), & -+ & rbsoil(:), zorl(:), & -+ & u10m(:), v10m(:), & -+ & fm(:), fh(:), & -+ & tsea(:), & -+ & heat(:), evap(:), & -+ & stress(:), spd1(:) - real(kind=kind_phys), intent(in) :: & -- & prsi(im,km+1), del(im,km), & -- & prsl(im,km), prslk(im,km), & -- & phii(im,km+1), phil(im,km) -+ & prsi(:,:), del(:,:), & -+ & prsl(:,:), prslk(:,:), & -+ & phii(:,:), phil(:,:) - real(kind=kind_phys), intent(out) :: & -- & dusfc(im), dvsfc(im), & -- & dtsfc(im), dqsfc(im), & -- & hpbl(im), dkt(im,km-1) -+ & dusfc(:), dvsfc(:), & -+ & dtsfc(:), dqsfc(:), & -+ & hpbl(:), dkt(:,:) - - real(kind=kind_phys), intent(inout) :: & -- & hgamt(im), hgamq(im) -+ & hgamt(:), hgamq(:) - ! - logical, intent(in) :: dspheat - ! flag for tke dissipative heating -diff --git a/physics/moninshoc.f b/physics/moninshoc.f -index 275d979..da5c102 100644 ---- a/physics/moninshoc.f -+++ b/physics/moninshoc.f -@@ -43,28 +43,28 @@ - ! - integer, intent(in) :: im, - & km, ntrac, ntcw, ncnd, ntke -- integer, dimension(im), intent(in) :: kinver -+ integer, dimension(:), intent(in) :: kinver - - real(kind=kind_phys), intent(in) :: delt, - & xkzm_m, xkzm_h, xkzm_s, xkzminv - real(kind=kind_phys), intent(in) :: grav, - & rd, cp, hvap, fv -- real(kind=kind_phys), dimension(im), intent(in) :: psk, -+ real(kind=kind_phys), dimension(:), intent(in) :: psk, - & rbsoil, zorl, u10m, v10m, fm, fh, tsea, heat, evap, stress, spd1 -- real(kind=kind_phys), dimension(im,km), intent(in) :: u1, v1, -+ real(kind=kind_phys), dimension(:,:), intent(in) :: u1, v1, - & t1, tkh, del, prsl, phil, prslk -- real(kind=kind_phys), dimension(im,km+1), intent(in) :: prsi, phii -- real(kind=kind_phys), dimension(im,km,ntrac), intent(in) :: q1 -+ real(kind=kind_phys), dimension(:,:), intent(in) :: prsi, phii -+ real(kind=kind_phys), dimension(:,:,:), intent(in) :: q1 - -- real(kind=kind_phys), dimension(im,km), intent(inout) :: du, dv, -+ real(kind=kind_phys), dimension(:,:), intent(inout) :: du, dv, - & tau -- real(kind=kind_phys), dimension(im,km,ntrac), intent(inout) :: rtg -+ real(kind=kind_phys), dimension(:,:,:), intent(inout) :: rtg - -- integer, dimension(im), intent(out) :: kpbl -- real(kind=kind_phys), dimension(im), intent(out) :: dusfc, -+ integer, dimension(:), intent(out) :: kpbl -+ real(kind=kind_phys), dimension(:), intent(out) :: dusfc, - & dvsfc, dtsfc, dqsfc, hpbl -- real(kind=kind_phys), dimension(im,km), intent(out) :: prnum -- real(kind=kind_phys), dimension(im,km-1), intent(out) :: dkt -+ real(kind=kind_phys), dimension(:,:), intent(out) :: prnum -+ real(kind=kind_phys), dimension(:,:), intent(out) :: dkt - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg -diff --git a/physics/mp_fer_hires.F90 b/physics/mp_fer_hires.F90 -index 95e5211..a6907be 100644 ---- a/physics/mp_fer_hires.F90 -+++ b/physics/mp_fer_hires.F90 -@@ -53,9 +53,9 @@ module mp_fer_hires - logical, intent(in) :: restart - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg -- real(kind_phys), intent(out), optional :: f_ice(1:ncol,1:nlev) -- real(kind_phys), intent(out), optional :: f_rain(1:ncol,1:nlev) -- real(kind_phys), intent(out), optional :: f_rimef(1:ncol,1:nlev) -+ real(kind_phys), intent(out), optional :: f_ice(:,:) -+ real(kind_phys), intent(out), optional :: f_rain(:,:) -+ real(kind_phys), intent(out), optional :: f_rimef(:,:) - - - ! Local variables -@@ -153,28 +153,28 @@ module mp_fer_hires - logical, intent(in ) :: spec_adv - integer, intent(in ) :: mpirank - integer, intent(in ) :: mpiroot -- real(kind_phys), intent(in ) :: slmsk(1:ncol) -- real(kind_phys), intent(in ) :: prsi(1:ncol,1:nlev+1) -- real(kind_phys), intent(in ) :: p_phy(1:ncol,1:nlev) -+ real(kind_phys), intent(in ) :: slmsk(:) -+ real(kind_phys), intent(in ) :: prsi(:,:) -+ real(kind_phys), intent(in ) :: p_phy(:,:) - real(kind_phys), intent(in ) :: epsq,r_d,p608,cp,g -- real(kind_phys), intent(inout) :: t(1:ncol,1:nlev) -- real(kind_phys), intent(inout) :: q(1:ncol,1:nlev) -- real(kind_phys), intent(inout) :: cwm(1:ncol,1:nlev) -- real(kind_phys), intent(inout) :: train(1:ncol,1:nlev) -- real(kind_phys), intent(out ) :: sr(1:ncol) -- real(kind_phys), intent(inout) :: f_ice(1:ncol,1:nlev) -- real(kind_phys), intent(inout) :: f_rain(1:ncol,1:nlev) -- real(kind_phys), intent(inout) :: f_rimef(1:ncol,1:nlev) -- real(kind_phys), intent(inout) :: qc(1:ncol,1:nlev) -- real(kind_phys), intent(inout) :: qr(1:ncol,1:nlev) -- real(kind_phys), intent(inout) :: qi(1:ncol,1:nlev) -- real(kind_phys), intent(inout) :: qg(1:ncol,1:nlev) ! QRIMEF -- -- real(kind_phys), intent(inout) :: prec(1:ncol) -+ real(kind_phys), intent(inout) :: t(:,:) -+ real(kind_phys), intent(inout) :: q(:,:) -+ real(kind_phys), intent(inout) :: cwm(:,:) -+ real(kind_phys), intent(inout) :: train(:,:) -+ real(kind_phys), intent(out ) :: sr(:) -+ real(kind_phys), intent(inout) :: f_ice(:,:) -+ real(kind_phys), intent(inout) :: f_rain(:,:) -+ real(kind_phys), intent(inout) :: f_rimef(:,:) -+ real(kind_phys), intent(inout) :: qc(:,:) -+ real(kind_phys), intent(inout) :: qr(:,:) -+ real(kind_phys), intent(inout) :: qi(:,:) -+ real(kind_phys), intent(inout) :: qg(:,:) ! QRIMEF -+ -+ real(kind_phys), intent(inout) :: prec(:) - ! real(kind_phys) :: acprec(1:ncol) !MZ: change to local -- real(kind_phys), intent(inout) :: refl_10cm(1:ncol,1:nlev) -+ real(kind_phys), intent(inout) :: refl_10cm(:,:) - real(kind_phys), intent(in ) :: rhgrd -- real(kind_phys), intent(in ) :: dx(1:ncol) -+ real(kind_phys), intent(in ) :: dx(:) - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - ! -diff --git a/physics/mp_thompson.F90 b/physics/mp_thompson.F90 -index ec19945..ef4748c 100644 ---- a/physics/mp_thompson.F90 -+++ b/physics/mp_thompson.F90 -@@ -380,14 +380,14 @@ module mp_thompson - real(kind_phys), intent(in ) :: con_g - real(kind_phys), intent(in ) :: con_rd - ! Hydrometeors -- real(kind_phys), intent(inout) :: spechum(1:ncol,1:nlev) -- real(kind_phys), intent(inout) :: qc(1:ncol,1:nlev) -- real(kind_phys), intent(inout) :: qr(1:ncol,1:nlev) -- real(kind_phys), intent(inout) :: qi(1:ncol,1:nlev) -- real(kind_phys), intent(inout) :: qs(1:ncol,1:nlev) -- real(kind_phys), intent(inout) :: qg(1:ncol,1:nlev) -- real(kind_phys), intent(inout) :: ni(1:ncol,1:nlev) -- real(kind_phys), intent(inout) :: nr(1:ncol,1:nlev) -+ real(kind_phys), intent(inout) :: spechum(:,:) -+ real(kind_phys), intent(inout) :: qc(:,:) -+ real(kind_phys), intent(inout) :: qr(:,:) -+ real(kind_phys), intent(inout) :: qi(:,:) -+ real(kind_phys), intent(inout) :: qs(:,:) -+ real(kind_phys), intent(inout) :: qg(:,:) -+ real(kind_phys), intent(inout) :: ni(:,:) -+ real(kind_phys), intent(inout) :: nr(:,:) - ! Aerosols - logical, intent(in) :: is_aerosol_aware, reset - ! The following arrays are not allocated if is_aerosol_aware is false -@@ -397,25 +397,25 @@ module mp_thompson - real(kind_phys), optional, intent(in ) :: nwfa2d(:) - real(kind_phys), optional, intent(in ) :: nifa2d(:) - ! State variables and timestep information -- real(kind_phys), intent(inout) :: tgrs(1:ncol,1:nlev) -- real(kind_phys), intent(in ) :: prsl(1:ncol,1:nlev) -- real(kind_phys), intent(in ) :: phii(1:ncol,1:nlev+1) -- real(kind_phys), intent(in ) :: omega(1:ncol,1:nlev) -+ real(kind_phys), intent(inout) :: tgrs(:,:) -+ real(kind_phys), intent(in ) :: prsl(:,:) -+ real(kind_phys), intent(in ) :: phii(:,:) -+ real(kind_phys), intent(in ) :: omega(:,:) - real(kind_phys), intent(in ) :: dtp - ! Precip/rain/snow/graupel fall amounts and fraction of frozen precip -- real(kind_phys), intent( out) :: prcp(1:ncol) -- real(kind_phys), intent( out) :: rain(1:ncol) -- real(kind_phys), intent( out) :: graupel(1:ncol) -- real(kind_phys), intent( out) :: ice(1:ncol) -- real(kind_phys), intent( out) :: snow(1:ncol) -- real(kind_phys), intent( out) :: sr(1:ncol) -+ real(kind_phys), intent( out) :: prcp(:) -+ real(kind_phys), intent( out) :: rain(:) -+ real(kind_phys), intent( out) :: graupel(:) -+ real(kind_phys), intent( out) :: ice(:) -+ real(kind_phys), intent( out) :: snow(:) -+ real(kind_phys), intent( out) :: sr(:) - ! Radar reflectivity -- real(kind_phys), intent( out) :: refl_10cm(1:ncol,1:nlev) -+ real(kind_phys), intent( out) :: refl_10cm(:,:) - logical, optional, intent(in ) :: do_radar_ref - ! Cloud effective radii -- real(kind_phys), optional, intent( out) :: re_cloud(1:ncol,1:nlev) -- real(kind_phys), optional, intent( out) :: re_ice(1:ncol,1:nlev) -- real(kind_phys), optional, intent( out) :: re_snow(1:ncol,1:nlev) -+ real(kind_phys), optional, intent( out) :: re_cloud(:,:) -+ real(kind_phys), optional, intent( out) :: re_ice(:,:) -+ real(kind_phys), optional, intent( out) :: re_snow(:,:) - ! MPI information - integer, intent(in) :: mpicomm - integer, intent(in) :: mpirank -diff --git a/physics/mp_thompson_post.F90 b/physics/mp_thompson_post.F90 -index cca7495..36e3093 100644 ---- a/physics/mp_thompson_post.F90 -+++ b/physics/mp_thompson_post.F90 -@@ -59,9 +59,9 @@ contains - ! Interface variables - integer, intent(in) :: ncol - integer, intent(in) :: nlev -- real(kind_phys), dimension(1:ncol,1:nlev), intent(in) :: tgrs_save -- real(kind_phys), dimension(1:ncol,1:nlev), intent(inout) :: tgrs -- real(kind_phys), dimension(1:ncol,1:nlev), intent(in) :: prslk -+ real(kind_phys), dimension(:,:), intent(in) :: tgrs_save -+ real(kind_phys), dimension(:,:), intent(inout) :: tgrs -+ real(kind_phys), dimension(:,:), intent(in) :: prslk - real(kind_phys), intent(in) :: dtp - real(kind_phys), intent(in) :: ttendlim - integer, intent(in) :: kdt -diff --git a/physics/mp_thompson_pre.F90 b/physics/mp_thompson_pre.F90 -index 4087ac8..957c1f1 100644 ---- a/physics/mp_thompson_pre.F90 -+++ b/physics/mp_thompson_pre.F90 -@@ -28,8 +28,8 @@ module mp_thompson_pre - ! Interface variables - integer, intent(in ) :: ncol - integer, intent(in ) :: nlev -- real(kind_phys), intent(in ) :: tgrs(1:ncol,1:nlev) -- real(kind_phys), intent( out) :: tgrs_save(1:ncol,1:nlev) -+ real(kind_phys), intent(in ) :: tgrs(:,:) -+ real(kind_phys), intent( out) :: tgrs_save(:,:) - - ! CCPP error handling - character(len=*), intent( out) :: errmsg -diff --git a/physics/ozphys.f b/physics/ozphys.f -index f8da587..ba6cb45 100644 ---- a/physics/ozphys.f -+++ b/physics/ozphys.f -@@ -68,8 +68,8 @@ - real(kind=kind_phys), intent(inout) :: & - & ozp1(:,:), ozp2(:,:), ozp3(:,:), ozp4(:,:) - real(kind=kind_phys), intent(in) :: & -- & dt, po3(ko3), prdout(im,ko3,oz_coeff), & -- & prsl(im,levs), tin(im,levs), delp(im,levs), & -+ & dt, po3(:), prdout(:,:,:), & -+ & prsl(:,:), tin(:,:), delp(:,:), & - & con_g - real :: gravi - logical, intent(in) :: ldiag3d, qdiag3d -diff --git a/physics/ozphys_2015.f b/physics/ozphys_2015.f -index 238a8fb..113dc03 100644 ---- a/physics/ozphys_2015.f -+++ b/physics/ozphys_2015.f -@@ -67,14 +67,14 @@ - real(kind=kind_phys),intent(in) :: con_g - real :: gravi - integer, intent(in) :: im, levs, ko3, pl_coeff,me -- real(kind=kind_phys), intent(in) :: po3(ko3), & -- & prsl(im,levs), tin(im,levs), & -- & delp(im,levs), & -- & prdout(im,ko3,pl_coeff), dt -+ real(kind=kind_phys), intent(in) :: po3(:), & -+ & prsl(:,:), tin(:,:), & -+ & delp(:,:), & -+ & prdout(:,:,:), dt - ! These arrays may not be allocated and need assumed array sizes - real(kind=kind_phys), intent(inout) :: & - & ozp1(:,:), ozp2(:,:), ozp3(:,:),ozp4(:,:) -- real(kind=kind_phys), intent(inout) :: oz(im,levs) -+ real(kind=kind_phys), intent(inout) :: oz(:,:) - - - character(len=*), intent(out) :: errmsg -diff --git a/physics/precpd.f b/physics/precpd.f -index 0e33055..8d58a38 100644 ---- a/physics/precpd.f -+++ b/physics/precpd.f -@@ -102,13 +102,13 @@ - ! Interface variables - integer, intent(in) :: im, km, jpr - real (kind=kind_phys), intent(in) :: dt -- real (kind=kind_phys), intent(in) :: del(im,km), prsl(im,km) -- real (kind=kind_phys), intent(inout) :: q(im,km), t(im,km), & -- & cwm(im,km) -- real (kind=kind_phys), intent(out) :: rn(im), sr(im), rainp(im,km) -- real (kind=kind_phys), intent(in) :: u00k(im,km) -- real (kind=kind_phys), intent(in) :: psautco(2), prautco(2), & -- & evpco, wminco(2), wk1(im) -+ real (kind=kind_phys), intent(in) :: del(:,:), prsl(:,:) -+ real (kind=kind_phys), intent(inout) :: q(:,:), t(:,:), & -+ & cwm(:,:) -+ real (kind=kind_phys), intent(out) :: rn(:), sr(:), rainp(:,:) -+ real (kind=kind_phys), intent(in) :: u00k(:,:) -+ real (kind=kind_phys), intent(in) :: psautco(:), prautco(:), & -+ & evpco, wminco(:), wk1(:) - logical, intent(in) :: lprnt - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg -diff --git a/physics/radlw_main.f b/physics/radlw_main.f -index 7b029f8..e45e556 100644 ---- a/physics/radlw_main.f -+++ b/physics/radlw_main.f -@@ -572,44 +572,44 @@ - - logical, intent(in) :: lprnt - -- real (kind=kind_phys), dimension(npts,nlp1), intent(in) :: plvl, & -+ real (kind=kind_phys), dimension(:,:), intent(in) :: plvl, & - & tlvl -- real (kind=kind_phys), dimension(npts,nlay), intent(in) :: plyr, & -+ real (kind=kind_phys), dimension(:,:), intent(in) :: plyr, & - & tlyr, qlyr, olyr, dzlyr, delpin - -- real (kind=kind_phys),dimension(npts,nlay),intent(in)::gasvmr_co2,& -+ real (kind=kind_phys),dimension(:,:),intent(in)::gasvmr_co2, & - & gasvmr_n2o, gasvmr_ch4, gasvmr_o2, gasvmr_co, gasvmr_cfc11, & - & gasvmr_cfc12, gasvmr_cfc22, gasvmr_ccl4 - -- real (kind=kind_phys), dimension(npts,nlay),intent(in):: cld_cf -- real (kind=kind_phys), dimension(npts,nlay),intent(in),optional:: & -+ real (kind=kind_phys), dimension(:,:),intent(in):: cld_cf -+ real (kind=kind_phys), dimension(:,:),intent(in),optional:: & - & cld_lwp, cld_ref_liq, cld_iwp, cld_ref_ice, & - & cld_rwp, cld_ref_rain, cld_swp, cld_ref_snow, & - & cld_od - -- real (kind=kind_phys), dimension(npts), intent(in) :: sfemis, & -+ real (kind=kind_phys), dimension(:), intent(in) :: sfemis, & - & sfgtmp, de_lgth - -- real (kind=kind_phys), dimension(npts,nlay,nbands),intent(in):: & -+ real (kind=kind_phys), dimension(:,:,:),intent(in):: & - & aeraod, aerssa - - ! --- outputs: -- real (kind=kind_phys), dimension(npts,nlay), intent(inout) :: hlwc -- real (kind=kind_phys), dimension(npts,nlay), intent(inout) :: & -+ real (kind=kind_phys), dimension(:,:), intent(inout) :: hlwc -+ real (kind=kind_phys), dimension(:,:), intent(inout) :: & - & cldtau - -- type (topflw_type), dimension(npts), intent(inout) :: topflx -- type (sfcflw_type), dimension(npts), intent(inout) :: sfcflx -+ type (topflw_type), dimension(:), intent(inout) :: topflx -+ type (sfcflw_type), dimension(:), intent(inout) :: sfcflx - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - - !! --- optional outputs: -- real (kind=kind_phys), dimension(npts,nlay,nbands),optional, & -+ real (kind=kind_phys), dimension(:,:,:),optional, & - & intent(inout) :: hlwb -- real (kind=kind_phys), dimension(npts,nlay), optional, & -+ real (kind=kind_phys), dimension(:,:), optional, & - & intent(inout) :: hlw0 -- type (proflw_type), dimension(npts,nlp1), optional, & -+ type (proflw_type), dimension(:,:), optional, & - & intent(inout) :: flxprf - logical, intent(in) :: lslwr - -diff --git a/physics/radsw_main.f b/physics/radsw_main.f -index b10541f..7f41cca 100644 ---- a/physics/radsw_main.f -+++ b/physics/radsw_main.f -@@ -659,59 +659,59 @@ - - logical, intent(in) :: lprnt, lsswr - -- real (kind=kind_phys), dimension(npts,nlp1), intent(in) :: & -+ real (kind=kind_phys), dimension(:,:), intent(in) :: & - & plvl, tlvl -- real (kind=kind_phys), dimension(npts,nlay), intent(in) :: & -+ real (kind=kind_phys), dimension(:,:), intent(in) :: & - & plyr, tlyr, qlyr, olyr, dzlyr, delpin - -- real (kind=kind_phys),dimension(npts),intent(in):: sfcalb_nir_dir -- real (kind=kind_phys),dimension(npts),intent(in):: sfcalb_nir_dif -- real (kind=kind_phys),dimension(npts),intent(in):: sfcalb_uvis_dir -- real (kind=kind_phys),dimension(npts),intent(in):: sfcalb_uvis_dif -- -- real(kind=kind_phys),dimension(npts,nlay),intent(in)::gasvmr_co2 -- real(kind=kind_phys),dimension(npts,nlay),intent(in)::gasvmr_n2o -- real(kind=kind_phys),dimension(npts,nlay),intent(in)::gasvmr_ch4 -- real(kind=kind_phys),dimension(npts,nlay),intent(in)::gasvmr_o2 -- real(kind=kind_phys),dimension(npts,nlay),intent(in)::gasvmr_co -- real(kind=kind_phys),dimension(npts,nlay),intent(in)::gasvmr_cfc11 -- real(kind=kind_phys),dimension(npts,nlay),intent(in)::gasvmr_cfc12 -- real(kind=kind_phys),dimension(npts,nlay),intent(in)::gasvmr_cfc22 -- real(kind=kind_phys),dimension(npts,nlay),intent(in)::gasvmr_ccl4 -- -- real (kind=kind_phys), dimension(npts,nlay),intent(in):: cld_cf -- real (kind=kind_phys), dimension(npts,nlay),intent(in),optional:: & -+ real (kind=kind_phys),dimension(:),intent(in):: sfcalb_nir_dir -+ real (kind=kind_phys),dimension(:),intent(in):: sfcalb_nir_dif -+ real (kind=kind_phys),dimension(:),intent(in):: sfcalb_uvis_dir -+ real (kind=kind_phys),dimension(:),intent(in):: sfcalb_uvis_dif -+ -+ real(kind=kind_phys),dimension(:,:),intent(in)::gasvmr_co2 -+ real(kind=kind_phys),dimension(:,:),intent(in)::gasvmr_n2o -+ real(kind=kind_phys),dimension(:,:),intent(in)::gasvmr_ch4 -+ real(kind=kind_phys),dimension(:,:),intent(in)::gasvmr_o2 -+ real(kind=kind_phys),dimension(:,:),intent(in)::gasvmr_co -+ real(kind=kind_phys),dimension(:,:),intent(in)::gasvmr_cfc11 -+ real(kind=kind_phys),dimension(:,:),intent(in)::gasvmr_cfc12 -+ real(kind=kind_phys),dimension(:,:),intent(in)::gasvmr_cfc22 -+ real(kind=kind_phys),dimension(:,:),intent(in)::gasvmr_ccl4 -+ -+ real (kind=kind_phys), dimension(:,:),intent(in):: cld_cf -+ real (kind=kind_phys), dimension(:,:),intent(in),optional:: & - & cld_lwp, cld_ref_liq, cld_iwp, cld_ref_ice, & - & cld_rwp, cld_ref_rain, cld_swp, cld_ref_snow, & - & cld_od, cld_ssa, cld_asy - -- real(kind=kind_phys),dimension(npts,nlay,nbdsw),intent(in)::aeraod -- real(kind=kind_phys),dimension(npts,nlay,nbdsw),intent(in)::aerssa -- real(kind=kind_phys),dimension(npts,nlay,nbdsw),intent(in)::aerasy -+ real(kind=kind_phys),dimension(:,:,:),intent(in)::aeraod -+ real(kind=kind_phys),dimension(:,:,:),intent(in)::aerssa -+ real(kind=kind_phys),dimension(:,:,:),intent(in)::aerasy - - real (kind=kind_phys), intent(in) :: cosz(npts), solcon, & - & de_lgth(npts) - - ! --- outputs: -- real (kind=kind_phys), dimension(npts,nlay), intent(inout) :: hswc -- real (kind=kind_phys), dimension(npts,nlay), intent(inout) :: & -+ real (kind=kind_phys), dimension(:,:), intent(inout) :: hswc -+ real (kind=kind_phys), dimension(:,:), intent(inout) :: & - & cldtau - -- type (topfsw_type), dimension(npts), intent(inout) :: topflx -- type (sfcfsw_type), dimension(npts), intent(inout) :: sfcflx -+ type (topfsw_type), dimension(:), intent(inout) :: topflx -+ type (sfcfsw_type), dimension(:), intent(inout) :: sfcflx - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - - !! --- optional outputs: -- real (kind=kind_phys), dimension(npts,nlay,nbdsw), optional, & -+ real (kind=kind_phys), dimension(:,:,:), optional, & - & intent(inout) :: hswb - -- real (kind=kind_phys), dimension(npts,nlay), optional, & -+ real (kind=kind_phys), dimension(:,:), optional, & - & intent(inout) :: hsw0 -- type (profsw_type), dimension(npts,nlp1), optional, & -+ type (profsw_type), dimension(:,:), optional, & - & intent(inout) :: flxprf -- type (cmpfsw_type), dimension(npts), optional, & -+ type (cmpfsw_type), dimension(:), optional, & - & intent(inout) :: fdncmp - - ! --- locals: -diff --git a/physics/rayleigh_damp.f b/physics/rayleigh_damp.f -index a56a85e..579370c 100644 ---- a/physics/rayleigh_damp.f -+++ b/physics/rayleigh_damp.f -@@ -71,9 +71,9 @@ - logical,intent(in) :: lsidea,ldiag3d - integer,intent(in) :: im, km,levr - real(kind=kind_phys),intent(in) :: DT, CP, PRSLRD0, ral_ts -- real(kind=kind_phys),intent(in) :: pgr(im), PRSL(IM,KM) -- real(kind=kind_phys),intent(in) :: U1(IM,KM), V1(IM,KM) -- real(kind=kind_phys),intent(inout) :: A(IM,KM), B(IM,KM), C(IM,KM) -+ real(kind=kind_phys),intent(in) :: pgr(:), PRSL(:,:) -+ real(kind=kind_phys),intent(in) :: U1(:,:), V1(:,:) -+ real(kind=kind_phys),intent(inout) :: A(:,:), B(:,:), C(:,:) - real(kind=kind_phys),intent(inout) :: du3dt(:,:) - real(kind=kind_phys),intent(inout) :: dv3dt(:,:) - real(kind=kind_phys),intent(inout) :: dt3dt(:,:) -diff --git a/physics/rrtmg_lw_post.F90 b/physics/rrtmg_lw_post.F90 -index af83c5c..7715ed7 100644 ---- a/physics/rrtmg_lw_post.F90 -+++ b/physics/rrtmg_lw_post.F90 -@@ -30,8 +30,8 @@ - type(GFS_grid_type), intent(in) :: Grid - type(GFS_radtend_type), intent(inout) :: Radtend - integer, intent(in) :: im, ltp, LM, kd -- real(kind=kind_phys), dimension(size(Grid%xlon,1), lm+LTP), intent(in) :: htlwc, htlw0 -- real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(in) :: tsfa -+ real(kind=kind_phys), dimension(:,:), intent(in) :: htlwc, htlw0 -+ real(kind=kind_phys), dimension(:), intent(in) :: tsfa - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - ! local variables -diff --git a/physics/rrtmg_lw_pre.F90 b/physics/rrtmg_lw_pre.F90 -index 7de02ee..1e46717 100644 ---- a/physics/rrtmg_lw_pre.F90 -+++ b/physics/rrtmg_lw_pre.F90 -@@ -30,7 +30,7 @@ - type(GFS_sfcprop_type), intent(in) :: Sfcprop - type(GFS_grid_type), intent(in) :: Grid - integer, intent(in) :: im -- real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(in) :: tsfa, tsfg -+ real(kind=kind_phys), dimension(:), intent(in) :: tsfa, tsfg - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - -diff --git a/physics/rrtmg_sw_post.F90 b/physics/rrtmg_sw_post.F90 -index b0ab311..b9534e0 100644 ---- a/physics/rrtmg_sw_post.F90 -+++ b/physics/rrtmg_sw_post.F90 -@@ -35,9 +35,9 @@ - type(GFS_grid_type), intent(in) :: Grid - type(GFS_diag_type), intent(inout) :: Diag - integer, intent(in) :: im, lm, kd, nday, ltp -- type(cmpfsw_type), dimension(size(Grid%xlon,1)), intent(inout) :: scmpsw -- real(kind=kind_phys), dimension(Size(Grid%xlon,1), lm+LTP), intent(in) :: htswc, htsw0 -- real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(in) :: sfcalb1, sfcalb2, sfcalb3, sfcalb4 -+ type(cmpfsw_type), dimension(:), intent(inout) :: scmpsw -+ real(kind=kind_phys), dimension(:,:), intent(in) :: htswc, htsw0 -+ real(kind=kind_phys), dimension(:), intent(in) :: sfcalb1, sfcalb2, sfcalb3, sfcalb4 - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - ! Local variables -diff --git a/physics/rrtmg_sw_pre.F90 b/physics/rrtmg_sw_pre.F90 -index 05e8d4c..3ef89c8 100644 ---- a/physics/rrtmg_sw_pre.F90 -+++ b/physics/rrtmg_sw_pre.F90 -@@ -34,10 +34,10 @@ - type(GFS_grid_type), intent(in) :: Grid - integer, intent(in) :: im - integer, intent(out) :: nday -- integer, dimension(size(Grid%xlon,1)), intent(out) :: idxday -- real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(in) :: tsfa, tsfg -- real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(out) :: sfcalb1, sfcalb2, sfcalb3, sfcalb4 -- real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(in) :: alb1d -+ integer, dimension(:), intent(out) :: idxday -+ real(kind=kind_phys), dimension(:), intent(in) :: tsfa, tsfg -+ real(kind=kind_phys), dimension(:), intent(out) :: sfcalb1, sfcalb2, sfcalb3, sfcalb4 -+ real(kind=kind_phys), dimension(:), intent(in) :: alb1d - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - ! Local variables -diff --git a/physics/rrtmgp_lw_aerosol_optics.F90 b/physics/rrtmgp_lw_aerosol_optics.F90 -index 2047dea..0b4339b 100644 ---- a/physics/rrtmgp_lw_aerosol_optics.F90 -+++ b/physics/rrtmgp_lw_aerosol_optics.F90 -@@ -40,20 +40,20 @@ contains - nLev, & ! Number of vertical layers - nTracer, & ! Number of tracers - nTracerAer ! Number of aerosol tracers -- real(kind_phys), dimension(nCol), intent(in) :: & -+ real(kind_phys), dimension(:), intent(in) :: & - lon, & ! Longitude - lat, & ! Latitude - lsmask ! Land/sea/sea-ice mask -- real(kind_phys), dimension(nCol,Nlev),intent(in) :: & -+ real(kind_phys), dimension(:,:),intent(in) :: & - p_lay, & ! Pressure @ layer-centers (Pa) - tv_lay, & ! Virtual-temperature @ layer-centers (K) - relhum, & ! Relative-humidity @ layer-centers - p_lk ! Exner function @ layer-centers (1) -- real(kind_phys), dimension(nCol, nLev, nTracer),intent(in) :: & -+ real(kind_phys), dimension(:,:, :),intent(in) :: & - tracer ! trace gas concentrations -- real(kind_phys), dimension(nCol, nLev, nTracerAer),intent(in) :: & -+ real(kind_phys), dimension(:,:, :),intent(in) :: & - aerfld ! aerosol input concentrations -- real(kind_phys), dimension(nCol,nLev+1),intent(in) :: & -+ real(kind_phys), dimension(:,:),intent(in) :: & - p_lev ! Pressure @ layer-interfaces (Pa) - type(ty_gas_optics_rrtmgp),intent(in) :: & - sw_gas_props ! RRTMGP DDT: spectral information for SW calculation -@@ -61,7 +61,7 @@ contains - lw_gas_props ! RRTMGP DDT: spectral information for LW calculation - - ! Outputs -- real(kind_phys), dimension(nCol,NSPC1), intent(inout) :: & -+ real(kind_phys), dimension(:,:), intent(inout) :: & - aerodp ! Vertical integrated optical depth for various aerosol species - type(ty_optical_props_1scl),intent(out) :: & - lw_optical_props_aerosol ! RRTMGP DDT: Longwave aerosol optical properties (tau) -diff --git a/physics/rrtmgp_lw_cloud_optics.F90 b/physics/rrtmgp_lw_cloud_optics.F90 -index 93e3899..f679154 100644 ---- a/physics/rrtmgp_lw_cloud_optics.F90 -+++ b/physics/rrtmgp_lw_cloud_optics.F90 -@@ -286,10 +286,10 @@ contains - nCol, & ! Number of horizontal gridpoints - nLev, & ! Number of vertical levels - nrghice ! Number of ice-roughness categories -- real(kind_phys), dimension(nCol), intent(in) :: & -+ real(kind_phys), dimension(:), intent(in) :: & - lon, & ! Longitude - lat ! Latitude -- real(kind_phys), dimension(ncol,nLev),intent(in) :: & -+ real(kind_phys), dimension(:,:),intent(in) :: & - p_lay, & ! Layer pressure (Pa) - cld_frac, & ! Total cloud fraction by layer - cld_lwp, & ! Cloud liquid water path -@@ -314,7 +314,7 @@ contains - type(ty_optical_props_1scl),intent(out) :: & - lw_optical_props_cloudsByBand, & ! RRTMGP DDT: Longwave optical properties in each band (clouds) - lw_optical_props_precipByBand ! RRTMGP DDT: Longwave optical properties in each band (precipitation) -- real(kind_phys), dimension(ncol,nLev), intent(out) :: & -+ real(kind_phys), dimension(:,:), intent(out) :: & - cldtaulw ! Approx 10.mu band layer cloud optical depth - - ! Local variables -diff --git a/physics/rrtmgp_lw_cloud_sampling.F90 b/physics/rrtmgp_lw_cloud_sampling.F90 -index 1d6cc06..c5de7b5 100644 ---- a/physics/rrtmgp_lw_cloud_sampling.F90 -+++ b/physics/rrtmgp_lw_cloud_sampling.F90 -@@ -57,15 +57,15 @@ contains - nCol, & ! Number of horizontal gridpoints - nLev, & ! Number of vertical layers - ipsdlw0 ! Initial permutation seed for McICA -- integer,intent(in),dimension(ncol) :: & -+ integer,intent(in),dimension(:) :: & - icseed_lw ! auxiliary special cloud related array when module - ! variable isubclw=2, it provides permutation seed - ! for each column profile that are used for generating - ! random numbers. when isubclw /=2, it will not be used. -- real(kind_phys), dimension(ncol,nLev),intent(in) :: & -+ real(kind_phys), dimension(:,:),intent(in) :: & - cld_frac, & ! Total cloud fraction by layer - precip_frac ! Precipitation fraction by layer -- real(kind_phys), dimension(ncol,nLev), intent(in) :: & -+ real(kind_phys), dimension(:,:), intent(in) :: & - cloud_overlap_param, & ! Cloud overlap parameter - precip_overlap_param ! Precipitation overlap parameter - type(ty_gas_optics_rrtmgp),intent(in) :: & -diff --git a/physics/rrtmgp_lw_gas_optics.F90 b/physics/rrtmgp_lw_gas_optics.F90 -index 787db6b..deea465 100644 ---- a/physics/rrtmgp_lw_gas_optics.F90 -+++ b/physics/rrtmgp_lw_gas_optics.F90 -@@ -28,7 +28,7 @@ contains - rrtmgp_lw_file_gas ! RRTMGP file containing coefficients used to compute gaseous optical properties - integer, intent(in) :: & - rrtmgp_nGases ! Number of trace gases active in RRTMGP -- character(len=*),dimension(rrtmgp_nGases), intent(in) :: & -+ character(len=*),dimension(:), intent(in) :: & - active_gases_array ! Character array containing trace gases to include in RRTMGP - integer,intent(in) :: & - mpicomm, & ! MPI communicator -@@ -292,13 +292,13 @@ contains - nLev ! Number of vertical levels - type(ty_gas_optics_rrtmgp),intent(in) :: & - lw_gas_props ! RRTMGP DDT: -- real(kind_phys), dimension(ncol,nLev), intent(in) :: & -+ real(kind_phys), dimension(:,:), intent(in) :: & - p_lay, & ! Pressure @ model layer-centers (hPa) - t_lay ! Temperature (K) -- real(kind_phys), dimension(ncol,nLev+1), intent(in) :: & -+ real(kind_phys), dimension(:,:), intent(in) :: & - p_lev, & ! Pressure @ model layer-interfaces (hPa) - t_lev ! Temperature @ model levels -- real(kind_phys), dimension(ncol), intent(in) :: & -+ real(kind_phys), dimension(:), intent(in) :: & - skt ! Surface(skin) temperature (K) - type(ty_gas_concs),intent(in) :: & - gas_concentrations ! RRTMGP DDT: trace gas concentrations (vmr) -diff --git a/physics/rrtmgp_lw_pre.F90 b/physics/rrtmgp_lw_pre.F90 -index 1148c67..8bede8c 100644 ---- a/physics/rrtmgp_lw_pre.F90 -+++ b/physics/rrtmgp_lw_pre.F90 -@@ -39,7 +39,7 @@ contains - doLWrad ! Logical flag for longwave radiation call - integer, intent(in) :: & - nCol ! Number of horizontal grid points -- real(kind_phys), dimension(nCol), intent(in) :: & -+ real(kind_phys), dimension(:), intent(in) :: & - xlon, & ! Longitude - xlat, & ! Latitude - slmsk, & ! Land/sea/sea-ice mask -@@ -52,13 +52,13 @@ contains - lw_gas_props ! RRTMGP DDT: spectral information for LW calculation - - ! Outputs -- real(kind_phys), dimension(lw_gas_props%get_nband(),ncol), intent(out) :: & -+ real(kind_phys), dimension(:,:), intent(out) :: & - sfc_emiss_byband ! Surface emissivity in each band - character(len=*), intent(out) :: & - errmsg ! Error message - integer, intent(out) :: & - errflg ! Error flag -- real(kind_phys), dimension(nCol), intent(out) :: & -+ real(kind_phys), dimension(:), intent(out) :: & - semis - - ! Local variables -diff --git a/physics/rrtmgp_lw_rte.F90 b/physics/rrtmgp_lw_rte.F90 -index dc49260..137512c 100644 ---- a/physics/rrtmgp_lw_rte.F90 -+++ b/physics/rrtmgp_lw_rte.F90 -@@ -43,16 +43,16 @@ contains - nCol, & ! Number of horizontal gridpoints - nLev, & ! Number of vertical levels - nGauss_angles ! Number of angles used in Gaussian quadrature -- real(kind_phys), dimension(ncol,nLev), intent(in) :: & -+ real(kind_phys), dimension(:,:), intent(in) :: & - p_lay, & ! Pressure @ model layer-centers (hPa) - t_lay ! Temperature (K) -- real(kind_phys), dimension(ncol,nLev+1), intent(in) :: & -+ real(kind_phys), dimension(:,:), intent(in) :: & - p_lev ! Pressure @ model layer-interfaces (hPa) -- real(kind_phys), dimension(ncol), intent(in) :: & -+ real(kind_phys), dimension(:), intent(in) :: & - skt ! Surface(skin) temperature (K) - type(ty_gas_optics_rrtmgp),intent(in) :: & - lw_gas_props ! RRTMGP DDT: longwave spectral information -- real(kind_phys), dimension(lw_gas_props%get_nband(),ncol), intent(in) :: & -+ real(kind_phys), dimension(:,:), intent(in) :: & - sfc_emiss_byband ! Surface emissivity in each band - type(ty_source_func_lw),intent(in) :: & - sources ! RRTMGP DDT: longwave source functions -@@ -62,7 +62,7 @@ contains - lw_optical_props_clouds, & ! RRTMGP DDT: longwave cloud radiative properties - lw_optical_props_aerosol ! RRTMGP DDT: longwave aerosol radiative properties - ! Outputs -- real(kind_phys), dimension(ncol,nLev+1), intent(out) :: & -+ real(kind_phys), dimension(:,:), intent(out) :: & - fluxlwUP_allsky, & ! All-sky flux (W/m2) - fluxlwDOWN_allsky, & ! All-sky flux (W/m2) - fluxlwUP_clrsky, & ! Clear-sky flux (W/m2) -@@ -72,7 +72,7 @@ contains - integer, intent(out) :: & - errflg ! CCPP error flag - ! Outputs (optional) -- real(kind_phys), dimension(ncol,nLev+1), intent(out), optional :: & -+ real(kind_phys), dimension(:,:), intent(out), optional :: & - fluxlwUP_jac, & ! Jacobian of upward LW flux (W/m2/K) - fluxlwDOWN_jac ! Jacobian of downward LW flux (W/m2/K) - -diff --git a/physics/rrtmgp_sw_aerosol_optics.F90 b/physics/rrtmgp_sw_aerosol_optics.F90 -index 4bb0342..b689550 100644 ---- a/physics/rrtmgp_sw_aerosol_optics.F90 -+++ b/physics/rrtmgp_sw_aerosol_optics.F90 -@@ -41,22 +41,22 @@ contains - nLev, & ! Number of vertical layers - nTracer, & ! Number of tracers - nTracerAer ! Number of aerosol tracers -- integer,intent(in),dimension(nCol) :: & -+ integer,intent(in),dimension(:) :: & - idxday ! Indices for daylit points. -- real(kind_phys), dimension(nCol), intent(in) :: & -+ real(kind_phys), dimension(:), intent(in) :: & - lon, & ! Longitude - lat, & ! Latitude - lsmask ! Land/sea/sea-ice mask -- real(kind_phys), dimension(nCol,Nlev),intent(in) :: & -+ real(kind_phys), dimension(:,:),intent(in) :: & - p_lay, & ! Pressure @ layer-centers (Pa) - tv_lay, & ! Virtual-temperature @ layer-centers (K) - relhum, & ! Relative-humidity @ layer-centers - p_lk ! Exner function @ layer-centers (1) -- real(kind_phys), dimension(nCol, nLev, nTracer),intent(in) :: & -+ real(kind_phys), dimension(:, :,:),intent(in) :: & - tracer ! trace gas concentrations -- real(kind_phys), dimension(nCol, nLev, nTracerAer),intent(in) :: & -+ real(kind_phys), dimension(:, :,:),intent(in) :: & - aerfld ! aerosol input concentrations -- real(kind_phys), dimension(nCol,nLev+1),intent(in) :: & -+ real(kind_phys), dimension(:,:),intent(in) :: & - p_lev ! Pressure @ layer-interfaces (Pa) - type(ty_gas_optics_rrtmgp),intent(in) :: & - sw_gas_props ! RRTMGP DDT: spectral information for SW calculation -@@ -64,7 +64,7 @@ contains - lw_gas_props ! RRTMGP DDT: spectral information for LW calculation - - ! Outputs -- real(kind_phys), dimension(nCol,NSPC1), intent(inout) :: & -+ real(kind_phys), dimension(:,:), intent(inout) :: & - aerodp ! Vertical integrated optical depth for various aerosol species - type(ty_optical_props_2str),intent(out) :: & - sw_optical_props_aerosol ! RRTMGP DDT: Longwave aerosol optical properties (tau) -diff --git a/physics/rrtmgp_sw_cloud_optics.F90 b/physics/rrtmgp_sw_cloud_optics.F90 -index 7ab3c27..7907751 100644 ---- a/physics/rrtmgp_sw_cloud_optics.F90 -+++ b/physics/rrtmgp_sw_cloud_optics.F90 -@@ -304,9 +304,9 @@ contains - nLev, & ! Number of vertical levels - nday, & ! Number of daylit points. - nrghice ! Number of ice-roughness categories -- integer,intent(in),dimension(ncol) :: & -+ integer,intent(in),dimension(:) :: & - idxday ! Indices for daylit points. -- real(kind_phys), dimension(ncol,nLev),intent(in) :: & -+ real(kind_phys), dimension(:,:),intent(in) :: & - cld_frac, & ! Total cloud fraction by layer - cld_lwp, & ! Cloud liquid water path - cld_reliq, & ! Cloud liquid effective radius -@@ -330,7 +330,7 @@ contains - type(ty_optical_props_2str),intent(out) :: & - sw_optical_props_cloudsByBand, & ! RRTMGP DDT: Shortwave optical properties in each band (clouds) - sw_optical_props_precipByBand ! RRTMGP DDT: Shortwave optical properties in each band (cloud precipitation) -- real(kind_phys), dimension(ncol,NLev), intent(out) :: & -+ real(kind_phys), dimension(:,:), intent(out) :: & - cldtausw ! Approx 10.mu band layer cloud optical depth - - ! Local variables -diff --git a/physics/rrtmgp_sw_cloud_sampling.F90 b/physics/rrtmgp_sw_cloud_sampling.F90 -index 0a0511b..617bbfc 100644 ---- a/physics/rrtmgp_sw_cloud_sampling.F90 -+++ b/physics/rrtmgp_sw_cloud_sampling.F90 -@@ -58,17 +58,17 @@ contains - nDay, & ! Number of daylit points. - nLev, & ! Number of vertical layers - ipsdsw0 ! Initial permutation seed for McICA -- integer,intent(in),dimension(ncol) :: & -+ integer,intent(in),dimension(:) :: & - idxday ! Indices for daylit points. -- integer,intent(in),dimension(ncol) :: & -+ integer,intent(in),dimension(:) :: & - icseed_sw ! auxiliary special cloud related array when module - ! variable isubcsw=2, it provides permutation seed - ! for each column profile that are used for generating - ! random numbers. when isubcsw /=2, it will not be used. -- real(kind_phys), dimension(ncol,nLev),intent(in) :: & -+ real(kind_phys), dimension(:,:),intent(in) :: & - cld_frac, & ! Total cloud fraction by layer - precip_frac ! Precipitation fraction by layer -- real(kind_phys), dimension(ncol,nLev), intent(in) :: & -+ real(kind_phys), dimension(:,:), intent(in) :: & - cloud_overlap_param, & ! Cloud overlap parameter - precip_overlap_param ! Precipitation overlap parameter - type(ty_gas_optics_rrtmgp),intent(in) :: & -diff --git a/physics/rrtmgp_sw_gas_optics.F90 b/physics/rrtmgp_sw_gas_optics.F90 -index efe611e..fb14a57 100644 ---- a/physics/rrtmgp_sw_gas_optics.F90 -+++ b/physics/rrtmgp_sw_gas_optics.F90 -@@ -28,7 +28,7 @@ contains - rrtmgp_sw_file_gas ! RRTMGP file containing coefficients used to compute gaseous optical properties - integer, intent(in) :: & - rrtmgp_nGases ! Number of trace gases active in RRTMGP -- character(len=*),dimension(rrtmgp_nGases), intent(in) :: & -+ character(len=*),dimension(:), intent(in) :: & - active_gases_array ! Character array containing trace gases to include in RRTMGP - integer,intent(in) :: & - mpicomm, & ! MPI communicator -@@ -302,14 +302,14 @@ contains - nDay, & ! Number of daylit points. - nCol, & ! Number of horizontal points - nLev ! Number of vertical levels -- integer,intent(in),dimension(ncol) :: & -+ integer,intent(in),dimension(:) :: & - idxday ! Indices for daylit points. - type(ty_gas_optics_rrtmgp),intent(in) :: & - sw_gas_props ! RRTMGP DDT: spectral information for RRTMGP SW radiation scheme -- real(kind_phys), dimension(ncol,nLev), intent(in) :: & -+ real(kind_phys), dimension(:,:), intent(in) :: & - p_lay, & ! Pressure @ model layer-centers (hPa) - t_lay ! Temperature (K) -- real(kind_phys), dimension(ncol,nLev+1), intent(in) :: & -+ real(kind_phys), dimension(:,:), intent(in) :: & - p_lev, & ! Pressure @ model layer-interfaces (hPa) - t_lev ! Temperature @ model levels - type(ty_gas_concs),intent(in) :: & -@@ -318,7 +318,7 @@ contains - solcon ! Solar constant - integer, intent(in) :: & - rrtmgp_nGases ! Number of trace gases active in RRTMGP -- character(len=*),dimension(rrtmgp_nGases), intent(in) :: & -+ character(len=*),dimension(:), intent(in) :: & - active_gases_array ! Character array containing trace gases to include in RRTMGP - - ! Output -@@ -328,7 +328,7 @@ contains - errflg ! CCPP error code - type(ty_optical_props_2str),intent(out) :: & - sw_optical_props_clrsky ! RRTMGP DDT: clear-sky shortwave optical properties, spectral (tau,ssa,g) -- real(kind_phys), dimension(ncol,sw_gas_props%get_ngpt()), intent(out) :: & -+ real(kind_phys), dimension(:,:), intent(out) :: & - toa_src_sw ! TOA incident spectral flux (W/m2) - - ! Local variables -diff --git a/physics/rrtmgp_sw_rte.F90 b/physics/rrtmgp_sw_rte.F90 -index 9719c6e..2bcfe4f 100644 ---- a/physics/rrtmgp_sw_rte.F90 -+++ b/physics/rrtmgp_sw_rte.F90 -@@ -42,14 +42,14 @@ contains - nCol, & ! Number of horizontal gridpoints - nday, & ! Number of daytime points - nLev ! Number of vertical levels -- integer, intent(in), dimension(ncol) :: & -+ integer, intent(in), dimension(:) :: & - idxday ! Index array for daytime points -- real(kind_phys),intent(in), dimension(ncol) :: & -+ real(kind_phys),intent(in), dimension(:) :: & - coszen ! Cosize of SZA -- real(kind_phys), dimension(ncol,NLev), intent(in) :: & -+ real(kind_phys), dimension(:,:), intent(in) :: & - p_lay, & ! Pressure @ model layer-centers (Pa) - t_lay ! Temperature (K) -- real(kind_phys), dimension(ncol,NLev+1), intent(in) :: & -+ real(kind_phys), dimension(:,:), intent(in) :: & - p_lev ! Pressure @ model layer-interfaces (Pa) - type(ty_gas_optics_rrtmgp),intent(in) :: & - sw_gas_props ! RRTMGP DDT: SW spectral information -@@ -58,16 +58,16 @@ contains - type(ty_optical_props_2str),intent(in) :: & - sw_optical_props_clouds, & ! RRTMGP DDT: shortwave cloud radiative properties - sw_optical_props_aerosol ! RRTMGP DDT: shortwave aerosol radiative properties -- real(kind_phys), dimension(sw_gas_props%get_nband(),ncol), intent(in) :: & -+ real(kind_phys), dimension(:,:), intent(in) :: & - sfc_alb_nir_dir, & ! Surface albedo (direct) - sfc_alb_nir_dif, & ! Surface albedo (diffuse) - sfc_alb_uvvis_dir, & ! Surface albedo (direct) - sfc_alb_uvvis_dif ! Surface albedo (diffuse) -- real(kind_phys), dimension(ncol,sw_gas_props%get_ngpt()), intent(in) :: & -+ real(kind_phys), dimension(:,:), intent(in) :: & - toa_src_sw ! TOA incident spectral flux (W/m2) - integer, intent(in) :: & - rrtmgp_nGases ! Number of trace gases active in RRTMGP -- character(len=*),dimension(rrtmgp_nGases), intent(in) :: & -+ character(len=*),dimension(:), intent(in) :: & - active_gases_array ! Character array containing trace gases to include in RRTMGP - - ! Outputs -@@ -75,14 +75,14 @@ contains - errmsg ! CCPP error message - integer, intent(out) :: & - errflg ! CCPP error flag -- real(kind_phys), dimension(ncol,NLev+1), intent(inout) :: & -+ real(kind_phys), dimension(:,:), intent(inout) :: & - fluxswUP_allsky, & ! RRTMGP upward all-sky flux profiles (W/m2) - fluxswDOWN_allsky, & ! RRTMGP downward all-sky flux profiles (W/m2) - fluxswUP_clrsky, & ! RRTMGP upward clear-sky flux profiles (W/m2) - fluxswDOWN_clrsky ! RRTMGP downward clear-sky flux profiles (W/m2) - - ! Outputs (optional) -- type(cmpfsw_type), dimension(ncol), intent(inout),optional :: & -+ type(cmpfsw_type), dimension(:), intent(inout),optional :: & - scmpsw ! 2D surface fluxes, components: - ! uvbfc - total sky downward uv-b flux (W/m2) - ! uvbf0 - clear sky downward uv-b flux (W/m2) -diff --git a/physics/samfdeepcnv.f b/physics/samfdeepcnv.f -index 67576af..d67ebb7 100644 ---- a/physics/samfdeepcnv.f -+++ b/physics/samfdeepcnv.f -@@ -87,29 +87,29 @@ - implicit none - ! - integer, intent(in) :: im, km, itc, ntc, ntk, ntr, ncloud -- integer, intent(in) :: islimsk(im) -+ integer, intent(in) :: islimsk(:) - real(kind=kind_phys), intent(in) :: cliq, cp, cvap, eps, epsm1, & - & fv, grav, hvap, rd, rv, t0c - real(kind=kind_phys), intent(in) :: delt -- real(kind=kind_phys), intent(in) :: psp(im), delp(im,km), & -- & prslp(im,km), garea(im), dot(im,km), phil(im,km) -+ real(kind=kind_phys), intent(in) :: psp(:), delp(:,:), & -+ & prslp(:,:), garea(:), dot(:,:), phil(:,:) - real(kind=kind_phys), dimension(:), intent(in) :: fscav - logical, intent(in) :: hwrf_samfdeep - real(kind=kind_phys), intent(in) :: nthresh -- real(kind=kind_phys), intent(in) :: ca_deep(im) -- real(kind=kind_phys), intent(out) :: rainevap(im) -+ real(kind=kind_phys), intent(in) :: ca_deep(:) -+ real(kind=kind_phys), intent(out) :: rainevap(:) - logical, intent(in) :: do_ca,ca_closure,ca_entr,ca_trigger - -- integer, intent(inout) :: kcnv(im) -+ integer, intent(inout) :: kcnv(:) - ! DH* TODO - check dimensions of qtr, ntr+2 correct? *DH -- real(kind=kind_phys), intent(inout) :: qtr(im,km,ntr+2), & -- & q1(im,km), t1(im,km), u1(im,km), v1(im,km), & -- & cnvw(im,km), cnvc(im,km) -+ real(kind=kind_phys), intent(inout) :: qtr(:,:,:), & -+ & q1(:,:), t1(:,:), u1(:,:), v1(:,:), & -+ & cnvw(:,:), cnvc(:,:) - -- integer, intent(out) :: kbot(im), ktop(im) -- real(kind=kind_phys), intent(out) :: cldwrk(im), & -- & rn(im), & -- & ud_mf(im,km),dd_mf(im,km), dt_mf(im,km) -+ integer, intent(out) :: kbot(:), ktop(:) -+ real(kind=kind_phys), intent(out) :: cldwrk(:), & -+ & rn(:), & -+ & ud_mf(:,:),dd_mf(:,:), dt_mf(:,:) - - ! GJF* These variables are conditionally allocated depending on whether the - ! Morrison-Gettelman microphysics is used, so they must be declared -diff --git a/physics/samfshalcnv.f b/physics/samfshalcnv.f -index e489628..9571b55 100644 ---- a/physics/samfshalcnv.f -+++ b/physics/samfshalcnv.f -@@ -63,22 +63,22 @@ - implicit none - ! - integer, intent(in) :: im, km, itc, ntc, ntk, ntr, ncloud -- integer, intent(in) :: islimsk(im) -+ integer, intent(in) :: islimsk(:) - real(kind=kind_phys), intent(in) :: cliq, cp, cvap, & - & eps, epsm1, fv, grav, hvap, rd, rv, t0c - real(kind=kind_phys), intent(in) :: delt -- real(kind=kind_phys), intent(in) :: psp(im), delp(im,km), & -- & prslp(im,km), garea(im), hpbl(im), dot(im,km), phil(im,km) -+ real(kind=kind_phys), intent(in) :: psp(:), delp(:,:), & -+ & prslp(:,:), garea(:), hpbl(:), dot(:,:), phil(:,:) - ! - real(kind=kind_phys), dimension(:), intent(in) :: fscav -- integer, intent(inout) :: kcnv(im) -+ integer, intent(inout) :: kcnv(:) - ! DH* TODO - check dimensions of qtr, ntr+2 correct? *DH -- real(kind=kind_phys), intent(inout) :: qtr(im,km,ntr+2), & -- & q1(im,km), t1(im,km), u1(im,km), v1(im,km) -+ real(kind=kind_phys), intent(inout) :: qtr(:,:,:), & -+ & q1(:,:), t1(:,:), u1(:,:), v1(:,:) - ! -- integer, intent(out) :: kbot(im), ktop(im) -- real(kind=kind_phys), intent(out) :: rn(im), & -- & cnvw(im,km), cnvc(im,km), ud_mf(im,km), dt_mf(im,km) -+ integer, intent(out) :: kbot(:), ktop(:) -+ real(kind=kind_phys), intent(out) :: rn(:), & -+ & cnvw(:,:), cnvc(:,:), ud_mf(:,:), dt_mf(:,:) - ! - real(kind=kind_phys), intent(in) :: clam, c0s, c1, & - & asolfac, pgcon -diff --git a/physics/satmedmfvdif.F b/physics/satmedmfvdif.F -index f00fb37..69c0bb5 100644 ---- a/physics/satmedmfvdif.F -+++ b/physics/satmedmfvdif.F -@@ -71,8 +71,8 @@ - ! - !---------------------------------------------------------------------- - integer, intent(in) :: im, km, ntrac, ntcw, ntiw, ntke -- integer, intent(in) :: kinver(im) -- integer, intent(out) :: kpbl(im) -+ integer, intent(in) :: kinver(:) -+ integer, intent(out) :: kpbl(:) - ! - logical, intent(in) :: ldiag3d, qdiag3d - real(kind=kind_phys), intent(inout), dimension(:,:) :: & -@@ -81,26 +81,26 @@ - real(kind=kind_phys), intent(in) :: grav,rd,cp,rv,hvap,hfus,fv, & - & eps,epsm1 - real(kind=kind_phys), intent(in) :: delt, xkzm_m, xkzm_h, xkzm_s -- real(kind=kind_phys), intent(inout) :: dv(im,km), du(im,km), & -- & tdt(im,km), rtg(im,km,ntrac) -+ real(kind=kind_phys), intent(inout) :: dv(:,:), du(:,:), & -+ & tdt(:,:), rtg(:,:,:) - real(kind=kind_phys), intent(in) :: & -- & u1(im,km), v1(im,km), & -- & t1(im,km), q1(im,km,ntrac), & -- & swh(im,km), hlw(im,km), & -- & xmu(im), garea(im), & -- & psk(im), rbsoil(im), & -- & zorl(im), tsea(im), & -- & u10m(im), v10m(im), & -- & fm(im), fh(im), & -- & evap(im), heat(im), & -- & stress(im), spd1(im), & -- & prsi(im,km+1), del(im,km), & -- & prsl(im,km), prslk(im,km), & -- & phii(im,km+1), phil(im,km) -+ & u1(:,:), v1(:,:), & -+ & t1(:,:), q1(:,:,:), & -+ & swh(:,:), hlw(:,:), & -+ & xmu(:), garea(:), & -+ & psk(:), rbsoil(:), & -+ & zorl(:), tsea(:), & -+ & u10m(:), v10m(:), & -+ & fm(:), fh(:), & -+ & evap(:), heat(:), & -+ & stress(:), spd1(:), & -+ & prsi(:,:), del(:,:), & -+ & prsl(:,:), prslk(:,:), & -+ & phii(:,:), phil(:,:) - real(kind=kind_phys), intent(out) :: & -- & dusfc(im), dvsfc(im), & -- & dtsfc(im), dqsfc(im), & -- & hpbl(im) -+ & dusfc(:), dvsfc(:), & -+ & dtsfc(:), dqsfc(:), & -+ & hpbl(:) - ! - logical, intent(in) :: dspheat - character(len=*), intent(out) :: errmsg -diff --git a/physics/satmedmfvdifq.F b/physics/satmedmfvdifq.F -index f192788..0773137 100644 ---- a/physics/satmedmfvdifq.F -+++ b/physics/satmedmfvdifq.F -@@ -75,40 +75,40 @@ - ! - !---------------------------------------------------------------------- - integer, intent(in) :: im, km, ntrac, ntcw, ntiw, ntke, ntoz -- integer, intent(in) :: kinver(im) -- integer, intent(in) :: islimsk(im) -- integer, intent(out) :: kpbl(im) -+ integer, intent(in) :: kinver(:) -+ integer, intent(in) :: islimsk(:) -+ integer, intent(out) :: kpbl(:) - logical, intent(in) :: ldiag3d,qdiag3d - ! - real(kind=kind_phys), intent(in) :: grav,rd,cp,rv,hvap,hfus,fv, & - & eps,epsm1 - real(kind=kind_phys), intent(in) :: delt, xkzm_m, xkzm_h, xkzm_s - real(kind=kind_phys), intent(in) :: dspfac, bl_upfr, bl_dnfr -- real(kind=kind_phys), intent(inout) :: dv(im,km), du(im,km), & -- & tdt(im,km), rtg(im,km,ntrac) -+ real(kind=kind_phys), intent(inout) :: dv(:,:), du(:,:), & -+ & tdt(:,:), rtg(:,:,:) - real(kind=kind_phys), intent(in) :: & -- & u1(im,km), v1(im,km), & -- & t1(im,km), q1(im,km,ntrac), & -- & swh(im,km), hlw(im,km), & -- & xmu(im), garea(im), & -- & snwdph_lnd(im), & -- & psk(im), rbsoil(im), & -- & zorl(im), tsea(im), & -- & u10m(im), v10m(im), & -- & fm(im), fh(im), & -- & evap(im), heat(im), & -- & stress(im), spd1(im), & -- & prsi(im,km+1), del(im,km), & -- & prsl(im,km), prslk(im,km), & -- & phii(im,km+1), phil(im,km) -+ & u1(:,:), v1(:,:), & -+ & t1(:,:), q1(:,:,:), & -+ & swh(:,:), hlw(:,:), & -+ & xmu(:), garea(:), & -+ & snwdph_lnd(:), & -+ & psk(:), rbsoil(:), & -+ & zorl(:), tsea(:), & -+ & u10m(:), v10m(:), & -+ & fm(:), fh(:), & -+ & evap(:), heat(:), & -+ & stress(:), spd1(:), & -+ & prsi(:,:), del(:,:), & -+ & prsl(:,:), prslk(:,:), & -+ & phii(:,:), phil(:,:) - real(kind=kind_phys), intent(inout), dimension(:,:) :: & - & du3dt(:,:), dv3dt(:,:), & - & dt3dt(:,:), dq3dt(:,:), & - & do3dt(:,:) - real(kind=kind_phys), intent(out) :: & -- & dusfc(im), dvsfc(im), & -- & dtsfc(im), dqsfc(im), & -- & hpbl(im) -+ & dusfc(:), dvsfc(:), & -+ & dtsfc(:), dqsfc(:), & -+ & hpbl(:) - ! - logical, intent(in) :: dspheat - character(len=*), intent(out) :: errmsg -diff --git a/physics/sfc_cice.f b/physics/sfc_cice.f -index f845f60..44b3ee2 100644 ---- a/physics/sfc_cice.f -+++ b/physics/sfc_cice.f -@@ -107,14 +107,14 @@ - logical, intent(in) :: cplflx - - ! real (kind=kind_phys), dimension(im), intent(in) :: u1, v1, & -- real (kind=kind_phys), dimension(im), intent(in) :: & -+ real (kind=kind_phys), dimension(:), intent(in) :: & - & t1, q1, cm, ch, prsl1, wind, dqsfc, dtsfc, dusfc, dvsfc - &, snowd - - logical, intent(in) :: flag_cice(im), flag_iter(im) - - ! --- outputs: -- real (kind=kind_phys), dimension(im), intent(inout) :: qsurf, & -+ real (kind=kind_phys), dimension(:), intent(inout) :: qsurf, & - & cmm, chh, evap, hflx, stress - &, weasd, snwdph, ep - ! -diff --git a/physics/sfc_diag.f b/physics/sfc_diag.f -index b78c9b2..e91bd0e 100644 ---- a/physics/sfc_diag.f -+++ b/physics/sfc_diag.f -@@ -33,10 +33,10 @@ - ! - integer, intent(in) :: im - real(kind=kind_phys), intent(in) :: grav,cp,eps,epsm1 -- real(kind=kind_phys), dimension(im), intent(in) :: & -+ real(kind=kind_phys), dimension(:), intent(in) :: & - & ps, u1, v1, t1, q1, tskin, & - & qsurf, prslki, evap, fm, fh, fm10, fh2 -- real(kind=kind_phys), dimension(im), intent(out) :: & -+ real(kind=kind_phys), dimension(:), intent(out) :: & - & f10m, u10m, v10m, t2m, q2m - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg -diff --git a/physics/sfc_diag_post.F90 b/physics/sfc_diag_post.F90 -index 767e98d..1bf3e7e 100644 ---- a/physics/sfc_diag_post.F90 -+++ b/physics/sfc_diag_post.F90 -@@ -26,11 +26,11 @@ - integer, intent(in) :: im, lsm, lsm_noahmp - logical, intent(in) :: lssav - real(kind=kind_phys), intent(in) :: dtf, con_eps, con_epsm1 -- logical , dimension(im), intent(in) :: dry -- real(kind=kind_phys), dimension(im), intent(in) :: pgr, u10m, v10m -+ logical , dimension(:), intent(in) :: dry -+ real(kind=kind_phys), dimension(:), intent(in) :: pgr, u10m, v10m - real(kind=kind_phys), dimension(:) , intent(in) :: t2mmp, q2mp -- real(kind=kind_phys), dimension(im), intent(inout) :: t2m, q2m, tmpmin, tmpmax, spfhmin, spfhmax -- real(kind=kind_phys), dimension(im), intent(inout) :: wind10mmax, u10mmax, v10mmax, dpt2m -+ real(kind=kind_phys), dimension(:), intent(inout) :: t2m, q2m, tmpmin, tmpmax, spfhmin, spfhmax -+ real(kind=kind_phys), dimension(:), intent(inout) :: wind10mmax, u10mmax, v10mmax, dpt2m - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg -diff --git a/physics/sfc_diff.f b/physics/sfc_diff.f -index b7ef1ea..93102e4 100644 ---- a/physics/sfc_diff.f -+++ b/physics/sfc_diff.f -@@ -90,24 +90,24 @@ - integer, intent(in) :: im, ivegsrc - integer, intent(in) :: sfc_z0_type ! option for calculating surface roughness length over ocean - -- integer, dimension(im), intent(in) :: vegtype -+ integer, dimension(:), intent(in) :: vegtype - - logical, intent(in) :: redrag ! reduced drag coeff. flag for high wind over sea (j.han) -- logical, dimension(im), intent(in) :: flag_iter, wet, dry, icy -+ logical, dimension(:), intent(in) :: flag_iter, wet, dry, icy - -- real(kind=kind_phys), dimension(im), intent(in) :: u10m,v10m -+ real(kind=kind_phys), dimension(:), intent(in) :: u10m,v10m - real(kind=kind_phys), intent(in) :: rvrdm1, eps, epsm1, grav -- real(kind=kind_phys), dimension(im), intent(in) :: & -+ real(kind=kind_phys), dimension(:), intent(in) :: & - & ps,t1,q1,z1,prsl1,prslki,prsik1,prslk1, & - & wind,sigmaf,shdmax, & - & z0pert,ztpert ! mg, sfc-perts -- real(kind=kind_phys), dimension(im), intent(in) :: & -+ real(kind=kind_phys), dimension(:), intent(in) :: & - & tskin_wat, tskin_lnd, tskin_ice, & - & tsurf_wat, tsurf_lnd, tsurf_ice, & - & snwdph_wat,snwdph_lnd,snwdph_ice - -- real(kind=kind_phys), dimension(im), intent(in) :: z0rl_wav -- real(kind=kind_phys), dimension(im), intent(inout) :: & -+ real(kind=kind_phys), dimension(:), intent(in) :: z0rl_wav -+ real(kind=kind_phys), dimension(:), intent(inout) :: & - & z0rl_wat, z0rl_lnd, z0rl_ice, & - & ustar_wat, ustar_lnd, ustar_ice, & - & cm_wat, cm_lnd, cm_ice, & -diff --git a/physics/sfc_drv.f b/physics/sfc_drv.f -index 5d8e196..878f08a 100644 ---- a/physics/sfc_drv.f -+++ b/physics/sfc_drv.f -@@ -211,11 +211,11 @@ - integer, intent(in) :: im, km, isot, ivegsrc - real (kind=kind_phys), intent(in) :: grav, cp, hvap, rd, eps, & - & epsm1, rvrdm1 -- real (kind=kind_phys), dimension(5), intent(in) :: pertvegf -+ real (kind=kind_phys), dimension(:), intent(in) :: pertvegf - -- integer, dimension(im), intent(in) :: soiltyp, vegtype, slopetyp -+ integer, dimension(:), intent(in) :: soiltyp, vegtype, slopetyp - -- real (kind=kind_phys), dimension(im), intent(in) :: ps, & -+ real (kind=kind_phys), dimension(:), intent(in) :: ps, & - & t1, q1, sigmaf, sfcemis, dlwflx, dswsfc, snet, tg3, cm, & - & ch, prsl1, prslki, wind, shdmin, shdmax, & - & snoalb, sfalb, zf, & -@@ -223,19 +223,19 @@ - - real (kind=kind_phys), intent(in) :: delt - -- logical, dimension(im), intent(in) :: flag_iter, flag_guess, land -+ logical, dimension(:), intent(in) :: flag_iter, flag_guess, land - - logical, intent(in) :: lheatstrg - - ! --- in/out: -- real (kind=kind_phys), dimension(im), intent(inout) :: weasd, & -+ real (kind=kind_phys), dimension(:), intent(inout) :: weasd, & - & snwdph, tskin, tprcp, srflag, canopy, trans, tsurf, zorl - -- real (kind=kind_phys), dimension(im,km), intent(inout) :: & -+ real (kind=kind_phys), dimension(:,:), intent(inout) :: & - & smc, stc, slc - - ! --- output: -- real (kind=kind_phys), dimension(im), intent(inout) :: sncovr1, & -+ real (kind=kind_phys), dimension(:), intent(inout) :: sncovr1, & - & qsurf, gflux, drain, evap, hflx, ep, runoff, cmm, chh, & - & evbs, evcw, sbsno, snowc, stm, snohf, smcwlt2, smcref2, & - & wet1 -diff --git a/physics/sfc_drv_ruc.F90 b/physics/sfc_drv_ruc.F90 -index 65935ef..ff72777 100644 ---- a/physics/sfc_drv_ruc.F90 -+++ b/physics/sfc_drv_ruc.F90 -@@ -168,9 +168,9 @@ module lsm_ruc - integer, intent(in) :: lsm_ruc, lsm - integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson - -- real (kind=kind_phys), dimension(im,lsoil), intent(inout) :: smc,stc,slc -+ real (kind=kind_phys), dimension(:,:), intent(inout) :: smc,stc,slc - -- real (kind=kind_phys), dimension(im), intent(in) :: & -+ real (kind=kind_phys), dimension(:), intent(in) :: & - & t1, sigmaf, sfcemis, dlwflx, dswsfc, snet, tg3, cm, & - & ch, prsl1, wind, shdmin, shdmax, & - & snoalb, alvwf, alnwf, zf, qc, q1 -@@ -182,30 +182,30 @@ module lsm_ruc - con_pi, con_rd, & - con_hvap, con_fvirt - -- logical, dimension(im), intent(in) :: flag_iter, flag_guess, land -- integer, dimension(im), intent(in) :: islimsk ! sea/land/ice mask (=0/1/2) -+ logical, dimension(:), intent(in) :: flag_iter, flag_guess, land -+ integer, dimension(:), intent(in) :: islimsk ! sea/land/ice mask (=0/1/2) - logical, intent(in) :: do_mynnsfclay - - logical, intent(in) :: rdlai - - ! --- in/out: -- integer, dimension(im), intent(inout) :: soiltyp, vegtype -+ integer, dimension(:), intent(inout) :: soiltyp, vegtype - real (kind=kind_phys), dimension(lsoil_ruc) :: dzs -- real (kind=kind_phys), dimension(lsoil_ruc), intent(inout ) :: zs -- real (kind=kind_phys), dimension(im), intent(inout) :: weasd, & -+ real (kind=kind_phys), dimension(:), intent(inout ) :: zs -+ real (kind=kind_phys), dimension(:), intent(inout) :: weasd, & - & snwdph, tskin, tskin_wat, & - & srflag, canopy, trans, tsurf, zorl, tsnow, & - & sfcqc, sfcqv, sfcdew, fice, tice, sfalb, smcwlt2, smcref2 - ! --- in -- real (kind=kind_phys), dimension(im), intent(in) :: & -+ real (kind=kind_phys), dimension(:), intent(in) :: & - & rainnc, rainc, ice, snow, graupel - ! --- in/out: - ! --- on RUC levels -- real (kind=kind_phys), dimension(im,lsoil_ruc), intent(inout) :: & -+ real (kind=kind_phys), dimension(:,:), intent(inout) :: & - & smois, tslb, sh2o, keepfr, smfrkeep - - ! --- output: -- real (kind=kind_phys), dimension(im), intent(inout) :: sncovr1, & -+ real (kind=kind_phys), dimension(:), intent(inout) :: sncovr1, & - & qsurf , gflux , evap , runof , drain , & - & runoff, srunoff, hflx, cmm, chh, & - & rhosnf, evbs, evcw, sbsno, stm, wetness, & -@@ -1053,25 +1053,25 @@ module lsm_ruc - integer, intent(in ) :: im, nlev - integer, intent(in ) :: lsoil_ruc - integer, intent(in ) :: lsoil -- logical, dimension(im), intent(in ) :: land -- real (kind=kind_phys), dimension(im), intent(in ) :: tsurf, tsurf_wat -- real (kind=kind_phys), dimension(im), intent(inout) :: smcref2 -- real (kind=kind_phys), dimension(im), intent(inout) :: smcwlt2 -- real (kind=kind_phys), dimension(im), intent(in ) :: tg3 -- real (kind=kind_phys), dimension(im,lsoil), intent(in ) :: smc ! Noah -- real (kind=kind_phys), dimension(im,lsoil), intent(in ) :: stc ! Noah -- real (kind=kind_phys), dimension(im,lsoil), intent(in ) :: slc ! Noah -- -- integer, dimension(im), intent(inout) :: soiltyp -- integer, dimension(im), intent(inout) :: vegtype -- real (kind=kind_phys), dimension(im), intent(inout) :: wetness -- real (kind=kind_phys), dimension(im), intent(inout) :: fice -- real (kind=kind_phys), dimension(im,lsoil_ruc), intent(inout) :: smois! ruc -- real (kind=kind_phys), dimension(im,lsoil_ruc), intent(inout) :: tslb ! ruc -- real (kind=kind_phys), dimension(im,lsoil_ruc), intent(inout) :: sh2o ! ruc -- real (kind=kind_phys), dimension(im,lsoil_ruc), intent(inout) :: smfrkeep ! ruc -- -- real (kind=kind_phys), dimension(1:lsoil_ruc), intent (out) :: zs -+ logical, dimension(:), intent(in ) :: land -+ real (kind=kind_phys), dimension(:), intent(in ) :: tsurf, tsurf_wat -+ real (kind=kind_phys), dimension(:), intent(inout) :: smcref2 -+ real (kind=kind_phys), dimension(:), intent(inout) :: smcwlt2 -+ real (kind=kind_phys), dimension(:), intent(in ) :: tg3 -+ real (kind=kind_phys), dimension(:,:), intent(in ) :: smc ! Noah -+ real (kind=kind_phys), dimension(:,:), intent(in ) :: stc ! Noah -+ real (kind=kind_phys), dimension(:,:), intent(in ) :: slc ! Noah -+ -+ integer, dimension(:), intent(inout) :: soiltyp -+ integer, dimension(:), intent(inout) :: vegtype -+ real (kind=kind_phys), dimension(:), intent(inout) :: wetness -+ real (kind=kind_phys), dimension(:), intent(inout) :: fice -+ real (kind=kind_phys), dimension(:,:), intent(inout) :: smois! ruc -+ real (kind=kind_phys), dimension(:,:), intent(inout) :: tslb ! ruc -+ real (kind=kind_phys), dimension(:,:), intent(inout) :: sh2o ! ruc -+ real (kind=kind_phys), dimension(:,:), intent(inout) :: smfrkeep ! ruc -+ -+ real (kind=kind_phys), dimension(:), intent (out) :: zs - - integer, intent(in ) :: me - integer, intent(in ) :: master -diff --git a/physics/sfc_noahmp_drv.f b/physics/sfc_noahmp_drv.f -index bdba632..f2c5809 100644 ---- a/physics/sfc_noahmp_drv.f -+++ b/physics/sfc_noahmp_drv.f -@@ -142,17 +142,17 @@ - - integer, intent(in) :: im, km, itime - -- integer, dimension(im), intent(in) :: soiltyp, vegtype, slopetyp -+ integer, dimension(:), intent(in) :: soiltyp, vegtype, slopetyp - -- real (kind=kind_phys), dimension(im), intent(in) :: ps, u1, v1, & -+ real (kind=kind_phys), dimension(:), intent(in) :: ps, u1, v1, & - & t1, q1, sigmaf, sfcemis, dlwflx, dswsfc, snet, tg3, cm, & - & ch, prsl1, prslki, wind, shdmin, shdmax, & - & snoalb, sfalb, zf, & - & rainn_mp,rainc_mp,snow_mp,graupel_mp,ice_mp - -- logical, dimension(im), intent(in) :: dry -+ logical, dimension(:), intent(in) :: dry - -- real (kind=kind_phys),dimension(im),intent(in) :: xlatin,xcoszin -+ real (kind=kind_phys),dimension(:),intent(in) :: xlatin,xcoszin - - integer, intent(in) :: idveg, iopt_crs,iopt_btr,iopt_run, & - & iopt_sfc,iopt_frz,iopt_inf,iopt_rad, & -@@ -170,24 +170,24 @@ - & con_rd, con_hfus - - ! --- in/out: -- real (kind=kind_phys), dimension(im), intent(inout) :: weasd, & -+ real (kind=kind_phys), dimension(:), intent(inout) :: weasd, & - & snwdph, tskin, tprcp, srflag, canopy, trans, tsurf, zorl - -- real (kind=kind_phys), dimension(im,km), intent(inout) :: & -+ real (kind=kind_phys), dimension(:,:), intent(inout) :: & - & smc, stc, slc - -- real (kind=kind_phys), dimension(im), intent(inout) :: snowxy, & -+ real (kind=kind_phys), dimension(:), intent(inout) :: snowxy, & - & tvxy,tgxy,canicexy,canliqxy,eahxy,tahxy, & - & cmxy,chxy,fwetxy,sneqvoxy,alboldxy,qsnowxy, & - & wslakexy,zwtxy,waxy,wtxy,lfmassxy,rtmassxy, & - & stmassxy,woodxy,stblcpxy,fastcpxy,xlaixy, & - & xsaixy,taussxy,smcwtdxy,deeprechxy,rechxy - -- real (kind=kind_phys),dimension(im,-2:0),intent(inout) :: tsnoxy -- real (kind=kind_phys),dimension(im,-2:0),intent(inout) :: snicexy -- real (kind=kind_phys),dimension(im,-2:0),intent(inout) :: snliqxy -- real (kind=kind_phys),dimension(im,1:4), intent(inout) :: smoiseq -- real (kind=kind_phys),dimension(im,-2:4),intent(inout) :: zsnsoxy -+ real (kind=kind_phys),dimension(:,:),intent(inout) :: tsnoxy -+ real (kind=kind_phys),dimension(:,:),intent(inout) :: snicexy -+ real (kind=kind_phys),dimension(:,:),intent(inout) :: snliqxy -+ real (kind=kind_phys),dimension(:,:), intent(inout) :: smoiseq -+ real (kind=kind_phys),dimension(:,:),intent(inout) :: zsnsoxy - - integer, dimension(im) :: jsnowxy - real (kind=kind_phys),dimension(im) :: snodep -@@ -195,7 +195,7 @@ - - ! --- output: - -- real (kind=kind_phys), dimension(im), intent(out) :: sncovr1, & -+ real (kind=kind_phys), dimension(:), intent(out) :: sncovr1, & - & qsurf, gflux, drain, evap, hflx, ep, runoff, cmm, chh, & - & evbs, evcw, sbsno, snowc, stm, snohf, smcwlt2, smcref2, wet1 - real (kind=kind_phys), dimension(:), intent(out) :: t2mmp, q2mp -diff --git a/physics/sfc_nst.f b/physics/sfc_nst.f -index 5920f37..0e6872c 100644 ---- a/physics/sfc_nst.f -+++ b/physics/sfc_nst.f -@@ -190,25 +190,25 @@ - & nstf_name5 - real (kind=kind_phys), intent(in) :: hvap, cp, hfus, jcal, eps, & - & epsm1, rvrdm1, rd, rhw0, sbc, pi -- real (kind=kind_phys), dimension(im), intent(in) :: ps, u1, v1, & -+ real (kind=kind_phys), dimension(:), intent(in) :: ps, u1, v1, & - & t1, q1, tref, cm, ch, prsl1, prslki, prsik1, prslk1, & - & xlon,xcosz, & - & sinlat, stress, sfcemis, dlwflx, sfcnsw, rain, wind - real (kind=kind_phys), intent(in) :: timestep - real (kind=kind_phys), intent(in) :: solhr - -- logical, dimension(im), intent(in) :: flag_iter, flag_guess, wet -+ logical, dimension(:), intent(in) :: flag_iter, flag_guess, wet - ! &, icy - logical, intent(in) :: lprnt - - ! --- input/outputs: - ! control variables of dtl system (5+2) and sl (2) and coefficients for d(tz)/d(ts) calculation -- real (kind=kind_phys), dimension(im), intent(inout) :: tskin, & -+ real (kind=kind_phys), dimension(:), intent(inout) :: tskin, & - & tsurf, xt, xs, xu, xv, xz, zm, xtts, xzts, dt_cool, & - & z_c, c_0, c_d, w_0, w_d, d_conv, ifd, qrain - - ! --- outputs: -- real (kind=kind_phys), dimension(im), intent(inout) :: & -+ real (kind=kind_phys), dimension(:), intent(inout) :: & - & qsurf, gflux, cmm, chh, evap, hflx, ep - - character(len=*), intent(out) :: errmsg -@@ -687,13 +687,13 @@ cc - - ! --- inputs: - integer, intent(in) :: im, nthreads -- logical, dimension(im), intent(in) :: wet -- real (kind=kind_phys), dimension(im), intent(in) :: -+ logical, dimension(:), intent(in) :: wet -+ real (kind=kind_phys), dimension(:), intent(in) :: - & tsfc_wat, xt, xz, dt_cool, z_c, oceanfrac - logical, intent(in) :: cplflx - - ! --- input/outputs: -- real (kind=kind_phys), dimension(im), intent(inout) :: -+ real (kind=kind_phys), dimension(:), intent(inout) :: - & tsurf_wat, tseal, tref - - ! --- outputs: -diff --git a/physics/sfc_ocean.F b/physics/sfc_ocean.F -index 20c8cdf..f6e511a 100644 ---- a/physics/sfc_ocean.F -+++ b/physics/sfc_ocean.F -@@ -103,13 +103,13 @@ - integer, intent(in) :: im - real (kind=kind_phys), intent(in) :: rd, eps, epsm1, rvrdm1 - -- real (kind=kind_phys), dimension(im), intent(in) :: ps, & -+ real (kind=kind_phys), dimension(:), intent(in) :: ps, & - & t1, q1, tskin, cm, ch, prsl1, prslki, wind - -- logical, dimension(im), intent(in) :: flag_iter, wet, lake -+ logical, dimension(:), intent(in) :: flag_iter, wet, lake - - ! --- outputs: -- real (kind=kind_phys), dimension(im), intent(inout) :: qsurf, & -+ real (kind=kind_phys), dimension(:), intent(inout) :: qsurf, & - & cmm, chh, gflux, evap, hflx, ep - - character(len=*), intent(out) :: errmsg -diff --git a/physics/sfc_sice.f b/physics/sfc_sice.f -index ab67f84..c18fd9d 100644 ---- a/physics/sfc_sice.f -+++ b/physics/sfc_sice.f -@@ -157,25 +157,25 @@ - real (kind=kind_phys), intent(in) :: sbc, hvap, tgice, cp, eps, & - & epsm1, grav, rvrdm1, t0c, rd - -- real (kind=kind_phys), dimension(im), intent(in) :: ps, & -+ real (kind=kind_phys), dimension(:), intent(in) :: ps, & - & t1, q1, sfcemis, dlwflx, sfcnsw, sfcdsw, srflag, cm, ch, & - & prsl1, prslki, prsik1, prslk1, wind, oceanfrac - - ! integer, dimension(im), intent(in) :: islimsk -- integer, dimension(im), intent(in) :: islmsk_cice -+ integer, dimension(:), intent(in) :: islmsk_cice - real (kind=kind_phys), intent(in) :: delt, min_seaice, & - & min_lakeice - -- logical, dimension(im), intent(in) :: flag_iter, icy -+ logical, dimension(:), intent(in) :: flag_iter, icy - - ! --- input/outputs: -- real (kind=kind_phys), dimension(im), intent(inout) :: hice, & -+ real (kind=kind_phys), dimension(:), intent(inout) :: hice, & - & fice, tice, weasd, tskin, tprcp, ep - -- real (kind=kind_phys), dimension(im,kice), intent(inout) :: tiice -+ real (kind=kind_phys), dimension(:,:), intent(inout) :: tiice - - ! --- outputs: -- real (kind=kind_phys), dimension(im), intent(inout) :: snwdph, & -+ real (kind=kind_phys), dimension(:), intent(inout) :: snwdph, & - & qsurf, snowmt, gflux, cmm, chh, evap, hflx - - character(len=*), intent(out) :: errmsg -diff --git a/physics/shinhongvdif.F90 b/physics/shinhongvdif.F90 -index 83270a0..da9c089 100644 ---- a/physics/shinhongvdif.F90 -+++ b/physics/shinhongvdif.F90 -@@ -107,7 +107,7 @@ - integer, intent(in ) :: im,km,ntrac,ndiff,ntcw,ntiw - real(kind=kind_phys), intent(in ) :: g,cp,rd,rv,ep1,ep2,xlv,dt - ! 3D in -- real(kind=kind_phys), dimension(im, km) , & -+ real(kind=kind_phys), dimension(:,:) , & - intent(in ) :: phil, & - pi2d, & - p2d, & -@@ -117,21 +117,21 @@ - real(kind=kind_phys), dimension( im, km, ntrac ) , & - intent(in ) :: qx - -- real(kind=kind_phys), dimension( im, km+1 ) , & -+ real(kind=kind_phys), dimension( :,: ) , & - intent(in ) :: p2di, & - phii - ! 3D in&out -- real(kind=kind_phys), dimension(im, km) , & -+ real(kind=kind_phys), dimension(:,:) , & - intent(inout) :: utnp, & - vtnp, & - ttnp -- real(kind=kind_phys), dimension(im, km, ntrac ) , & -+ real(kind=kind_phys), dimension(:,:, : ) , & - intent(inout) :: qtnp - ! 2D in -- integer, dimension(im) , & -+ integer, dimension(:) , & - intent(in ) :: landmask - -- real(kind=kind_phys), dimension(im) , & -+ real(kind=kind_phys), dimension(:) , & - intent(in ) :: heat, & - evap, & - br, & -@@ -145,10 +145,10 @@ - v10, & - dx - ! 2D: out -- integer, dimension(im) , & -+ integer, dimension(:) , & - intent(out ) :: kpbl1d - -- real(kind=kind_phys), dimension(im) , & -+ real(kind=kind_phys), dimension(:) , & - intent(out ) :: hpbl, & - dusfc, & - dvsfc, & -@@ -1435,13 +1435,13 @@ - ! - real(kind=kind_phys), dimension( its:ite, kts:kte ) , & - intent(in ) :: cm -- real(kind=kind_phys), dimension( its:ite, kts:kte,nt ) , & -+ real(kind=kind_phys), dimension( its:ite, kts:kte,nt) , & - intent(in ) :: r2 - ! - real(kind=kind_phys), dimension( its:ite, kts:kte ) , & - intent(inout) :: au, & - cu -- real(kind=kind_phys), dimension( its:ite, kts:kte,nt ) , & -+ real(kind=kind_phys), dimension( its:ite, kts:kte,nt) , & - intent(inout) :: f2 - ! - real(kind=kind_phys) :: fk -@@ -1582,7 +1582,7 @@ - qol2st,qol2un,qdzl,rdz,sq,srel,szq,tem,thm,vkrmz,rlambda, & - rlb,rln,f - real(kind=kind_phys) :: ckp -- real(kind=kind_phys), dimension( kts:kte ) :: q1, & -+ real(kind=kind_phys), dimension( kts:kte ) :: q1, & - en2 - real(kind=kind_phys), dimension( kts+1:kte ) :: dth, & - elm, & -@@ -1748,12 +1748,12 @@ - ! - logical, intent(in ) :: pblflg - ! -- real(kind=kind_phys), dimension( kts:kte ) , & -+ real(kind=kind_phys), dimension( : ) , & - intent(in ) :: uxk, & - vxk, & - thxk, & - thvxk -- real(kind=kind_phys), dimension( kts+1:kte ) , & -+ real(kind=kind_phys), dimension( : ) , & - intent(in ) :: s2, & - ri, & - akm, & -@@ -1764,10 +1764,10 @@ - vfxpbl, & - qfxpbl - ! -- real(kind=kind_phys), dimension( kts:kte+1 ) , & -+ real(kind=kind_phys), dimension( : ) , & - intent(in ) :: z - ! -- real(kind=kind_phys), dimension( kts:kte ) , & -+ real(kind=kind_phys), dimension( : ) , & - intent(inout) :: q2 - ! - ! local vars -@@ -1855,16 +1855,16 @@ - ! - logical, intent(in ) :: pblflg - ! -- real(kind=kind_phys), dimension( kts:kte ) , & -+ real(kind=kind_phys), dimension( : ) , & - intent(in ) :: hgame, & - ptke1 -- real(kind=kind_phys), dimension( kts+1:kte ) , & -+ real(kind=kind_phys), dimension( : ) , & - intent(in ) :: el, & - akhk -- real(kind=kind_phys), dimension( kts:kte+1 ) , & -+ real(kind=kind_phys), dimension( : ) , & - intent(in ) :: z - ! -- real(kind=kind_phys), dimension( kts:kte ) , & -+ real(kind=kind_phys), dimension( : ) , & - intent(inout) :: q2 - ! - ! local vars -diff --git a/physics/ysuvdif.F90 b/physics/ysuvdif.F90 -index 51ed599..420dfb7 100644 ---- a/physics/ysuvdif.F90 -+++ b/physics/ysuvdif.F90 -@@ -62,33 +62,33 @@ - integer, intent(in ) :: im,km,ntrac,ndiff,ntcw,ntiw - real(kind=kind_phys), intent(in ) :: g,cp,rd,rv,ep1,ep2,xlv,dt - -- real(kind=kind_phys), dimension( im,km ), & -+ real(kind=kind_phys), dimension( :,: ), & - intent(in) :: pi2d,p2d,phil,ux,vx,swh,hlw,tx - -- real(kind=kind_phys), dimension( im,km,ntrac ) , & -+ real(kind=kind_phys), dimension( :,:,: ) , & - intent(in ) :: qx - -- real(kind=kind_phys), dimension( im, km+1 ) , & -+ real(kind=kind_phys), dimension( :,: ) , & - intent(in ) :: p2di,phii - -- real(kind=kind_phys), dimension( im ) , & -+ real(kind=kind_phys), dimension( : ) , & - intent(in) :: stress,zorl,heat,evap,wspd,br,psim,psih,psfcpa, & - u10,v10,xmu -- integer, dimension(im) ,& -+ integer, dimension(:) ,& - intent(in ) :: landmask - ! - !---------------------------------------------------------------------------------- - ! input/output variables - ! -- real(kind=kind_phys), dimension( im,km ) , & -+ real(kind=kind_phys), dimension( :,: ) , & - intent(inout) :: utnp,vtnp,ttnp -- real(kind=kind_phys), dimension( im,km,ntrac ) , & -+ real(kind=kind_phys), dimension( :,:,: ) , & - intent(inout) :: qtnp - ! - !--------------------------------------------------------------------------------- - ! output variables -- integer, dimension( im ), intent(out ) :: kpbl1d -- real(kind=kind_phys), dimension( im ), & -+ integer, dimension( : ), intent(out ) :: kpbl1d -+ real(kind=kind_phys), dimension( : ), & - intent(out) :: hpbl - - ! error messages From feb39733b0debf606ea6a05ed5d0f89203777bfe Mon Sep 17 00:00:00 2001 From: Julie Schramm Date: Mon, 31 Aug 2020 10:18:09 -0600 Subject: [PATCH 03/25] Changes to fortran and metadata tables to pass capgen consistency check. --- physics/GFS_SCNV_generic.F90 | 2 +- physics/GFS_SCNV_generic.meta | 12 ++++++------ physics/GFS_surface_composites.meta | 6 +++--- physics/dcyc2.meta | 12 ++++++------ physics/flake_driver.meta | 6 +++--- physics/lsm_ruc_sfc_sice_interstitial.meta | 6 +++--- physics/m_micro_interstitial.F90 | 12 ++++++------ physics/sfc_drv_ruc.F90 | 16 +++++++++------- physics/sfc_drv_ruc.meta | 2 +- 9 files changed, 38 insertions(+), 36 deletions(-) diff --git a/physics/GFS_SCNV_generic.F90 b/physics/GFS_SCNV_generic.F90 index ae8fac5f9f..1b95585db9 100644 --- a/physics/GFS_SCNV_generic.F90 +++ b/physics/GFS_SCNV_generic.F90 @@ -25,7 +25,7 @@ subroutine GFS_SCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, gu0, gv0, gt0, logical, intent(in) :: ldiag3d, qdiag3d, flag_for_scnv_generic_tend real(kind=kind_phys), dimension(im,levs), intent(in) :: gu0, gv0, gt0, gq0_water_vapor - real(kind=kind_phys), dimension(im,levs), intent(inout) :: save_u, save_v, save_t, save_qv + real(kind=kind_phys), dimension(im,levs), intent(out) :: save_u, save_v, save_t, save_qv character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/GFS_SCNV_generic.meta b/physics/GFS_SCNV_generic.meta index e11e3fbc34..62472f3018 100644 --- a/physics/GFS_SCNV_generic.meta +++ b/physics/GFS_SCNV_generic.meta @@ -167,17 +167,17 @@ type = logical intent = in optional = F -[qdiag3d] - standard_name = flag_tracer_diagnostics_3D - long_name = flag for 3d tracer diagnostic fields +[ldiag3d] + standard_name = flag_diagnostics_3D + long_name = flag for 3d diagnostic fields units = flag dimensions = () type = logical intent = in optional = F -[ldiag3d] - standard_name = flag_diagnostics_3D - long_name = flag for 3d diagnostic fields +[qdiag3d] + standard_name = flag_tracer_diagnostics_3D + long_name = flag for 3d tracer diagnostic fields units = flag dimensions = () type = logical diff --git a/physics/GFS_surface_composites.meta b/physics/GFS_surface_composites.meta index 5b9b644e0f..0be41b99f8 100644 --- a/physics/GFS_surface_composites.meta +++ b/physics/GFS_surface_composites.meta @@ -31,7 +31,7 @@ units = flag dimensions = (horizontal_dimension) type = logical - intent = in + intent = inout optional = F [cplflx] standard_name = flag_for_flux_coupling @@ -500,7 +500,7 @@ units = flag dimensions = (horizontal_dimension) type = integer - intent = in + intent = inout optional = F [semis_rad] standard_name = surface_longwave_emissivity @@ -1797,7 +1797,7 @@ dimensions = (horizontal_dimension,ice_vertical_dimension) type = real kind = kind_phys - intent = inout + intent = in optional = F [stc] standard_name = soil_temperature diff --git a/physics/dcyc2.meta b/physics/dcyc2.meta index e946e3c900..def7b5ae49 100644 --- a/physics/dcyc2.meta +++ b/physics/dcyc2.meta @@ -92,18 +92,18 @@ kind = kind_phys intent = in optional = F -[tsfc_wat] - standard_name = surface_skin_temperature_over_ocean_interstitial - long_name = surface skin temperature over ocean (temporary use as interstitial) +[tsfc_ice] + standard_name = surface_skin_temperature_over_ice_interstitial + long_name = surface skin temperature over ice (temporary use as interstitial) units = K dimensions = (horizontal_dimension) type = real kind = kind_phys intent = in optional = F -[tsfc_ice] - standard_name = surface_skin_temperature_over_ice_interstitial - long_name = surface skin temperature over ice (temporary use as interstitial) +[tsfc_wat] + standard_name = surface_skin_temperature_over_ocean_interstitial + long_name = surface skin temperature over ocean (temporary use as interstitial) units = K dimensions = (horizontal_dimension) type = real diff --git a/physics/flake_driver.meta b/physics/flake_driver.meta index a40016010a..f85490cb7a 100644 --- a/physics/flake_driver.meta +++ b/physics/flake_driver.meta @@ -114,7 +114,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - intent = inout + intent = in optional = F [lakedepth] standard_name = lake_depth @@ -217,7 +217,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - intent = in + intent = inout optional = F [hice] standard_name = sea_ice_thickness @@ -235,7 +235,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - intent = in + intent = inout optional = F [fice] standard_name = sea_ice_concentration diff --git a/physics/lsm_ruc_sfc_sice_interstitial.meta b/physics/lsm_ruc_sfc_sice_interstitial.meta index bc3618703a..6236b138bd 100644 --- a/physics/lsm_ruc_sfc_sice_interstitial.meta +++ b/physics/lsm_ruc_sfc_sice_interstitial.meta @@ -47,7 +47,7 @@ units = flag dimensions = (horizontal_dimension) type = logical - intent = inout + intent = in optional = F [stc] standard_name = soil_temperature @@ -144,7 +144,7 @@ units = flag dimensions = (horizontal_dimension) type = logical - intent = inout + intent = in optional = F [stc] standard_name = soil_temperature @@ -171,7 +171,7 @@ dimensions = (horizontal_dimension,ice_vertical_dimension) type = real kind = kind_phys - intent = inout + intent = in optional = F [errmsg] standard_name = ccpp_error_message diff --git a/physics/m_micro_interstitial.F90 b/physics/m_micro_interstitial.F90 index 930b32b3d6..79c249c107 100644 --- a/physics/m_micro_interstitial.F90 +++ b/physics/m_micro_interstitial.F90 @@ -190,12 +190,12 @@ subroutine m_micro_post_run( & real(kind=kind_phys), intent(inout) :: qsnw(1:im,1:levs) real(kind=kind_phys), intent(inout) :: qgl(1:im,1:levs) real(kind=kind_phys), intent(inout) :: gq0_ice(1:im,1:levs) - real(kind=kind_phys), intent(inout) :: gq0_rain(1:im,1:levs) - real(kind=kind_phys), intent(inout) :: gq0_snow(1:im,1:levs) - real(kind=kind_phys), intent(inout) :: gq0_graupel(1:im,1:levs) - real(kind=kind_phys), intent(inout) :: gq0_rain_nc(1:im,1:levs) - real(kind=kind_phys), intent(inout) :: gq0_snow_nc(1:im,1:levs) - real(kind=kind_phys), intent(inout) :: gq0_graupel_nc(1:im,1:levs) + real(kind=kind_phys), intent(out ) :: gq0_rain(1:im,1:levs) + real(kind=kind_phys), intent(out ) :: gq0_snow(1:im,1:levs) + real(kind=kind_phys), intent(out ) :: gq0_graupel(1:im,1:levs) + real(kind=kind_phys), intent(out ) :: gq0_rain_nc(1:im,1:levs) + real(kind=kind_phys), intent(out ) :: gq0_snow_nc(1:im,1:levs) + real(kind=kind_phys), intent(out ) :: gq0_graupel_nc(1:im,1:levs) real(kind=kind_phys), intent( out) :: ice(1:im) real(kind=kind_phys), intent( out) :: snow(1:im) real(kind=kind_phys), intent( out) :: graupel(1:im) diff --git a/physics/sfc_drv_ruc.F90 b/physics/sfc_drv_ruc.F90 index 65935ef1c9..d768f93014 100644 --- a/physics/sfc_drv_ruc.F90 +++ b/physics/sfc_drv_ruc.F90 @@ -108,7 +108,6 @@ end subroutine lsm_ruc_finalize ! tslb - real, soil temp (k) im,km ! ! sh2o - real, liquid soil moisture im,km ! ! canopy - real, canopy moisture content (mm) im ! -! trans - real, total plant transpiration (m/s) im ! ! tsurf - real, surface skin temperature (after iteration) im ! ! ! ! outputs: ! @@ -122,6 +121,7 @@ end subroutine lsm_ruc_finalize ! evcw - real, canopy water evaporation (m/s) im ! ! sbsno - real, sublimation/deposit from snopack (m/s) im ! ! stm - real, total soil column moisture content (m) im ! +! trans - real, total plant transpiration (m/s) im ! ! zorl - real, surface roughness im ! ! wetness - real, normalized soil wetness im ! ! ! @@ -194,7 +194,7 @@ subroutine lsm_ruc_run & ! inputs real (kind=kind_phys), dimension(lsoil_ruc), intent(inout ) :: zs real (kind=kind_phys), dimension(im), intent(inout) :: weasd, & & snwdph, tskin, tskin_wat, & - & srflag, canopy, trans, tsurf, zorl, tsnow, & + & srflag, canopy, tsurf, zorl, tsnow, & & sfcqc, sfcqv, sfcdew, fice, tice, sfalb, smcwlt2, smcref2 ! --- in real (kind=kind_phys), dimension(im), intent(in) :: & @@ -204,12 +204,14 @@ subroutine lsm_ruc_run & ! inputs real (kind=kind_phys), dimension(im,lsoil_ruc), intent(inout) :: & & smois, tslb, sh2o, keepfr, smfrkeep -! --- output: real (kind=kind_phys), dimension(im), intent(inout) :: sncovr1, & - & qsurf , gflux , evap , runof , drain , & - & runoff, srunoff, hflx, cmm, chh, & - & rhosnf, evbs, evcw, sbsno, stm, wetness, & - & acsnow, snowfallac + & qsurf , runoff, srunoff, cmm, chh, stm, wetness, acsnow, & + & snowfallac + +! --- output: + real (kind=kind_phys), dimension(im), intent(out) :: trans, & + & gflux, drain, evap, hflx, rhosnf, runof, evbs, evcw, & + & sbsno logical, intent(in) :: flag_init, flag_restart character(len=*), intent(out) :: errmsg diff --git a/physics/sfc_drv_ruc.meta b/physics/sfc_drv_ruc.meta index 4721418d3c..a1f8d2e257 100644 --- a/physics/sfc_drv_ruc.meta +++ b/physics/sfc_drv_ruc.meta @@ -218,7 +218,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - intent = inout + intent = in optional = F [dlwflx] standard_name = surface_downwelling_longwave_flux From ee38a142650fe9d764f6005bacc41e2d512c73fa Mon Sep 17 00:00:00 2001 From: Julie Schramm Date: Tue, 1 Sep 2020 13:46:27 -0600 Subject: [PATCH 04/25] Fixes for intent mismatch, out of order arguments and subroutines not found errors found by capgen. --- physics/GFS_MP_generic.F90 | 4 +- physics/GFS_MP_generic.meta | 6 +- physics/GFS_PBL_generic.meta | 12 +-- physics/GFS_cloud_diagnostics.meta | 52 +++++----- physics/GFS_rrtmgp_gfdlmp_pre.meta | 140 +++++++++++++-------------- physics/GFS_rrtmgp_setup.meta | 2 + physics/GFS_rrtmgp_zhaocarr_pre.meta | 106 ++++++++++---------- physics/GFS_surface_generic.meta | 30 +++--- physics/cires_ugwp.meta | 6 +- physics/cs_conv.F90 | 6 +- physics/drag_suite.meta | 2 +- physics/gscond.f | 4 +- physics/gscond.meta | 10 ++ 13 files changed, 196 insertions(+), 184 deletions(-) diff --git a/physics/GFS_MP_generic.F90 b/physics/GFS_MP_generic.F90 index 8810cc7cf7..a9d3c56485 100644 --- a/physics/GFS_MP_generic.F90 +++ b/physics/GFS_MP_generic.F90 @@ -26,8 +26,8 @@ subroutine GFS_MP_generic_pre_run(im, levs, ldiag3d, qdiag3d, do_aw, ntcw, nncl, real(kind=kind_phys), dimension(im, levs), intent(in) :: gt0 real(kind=kind_phys), dimension(im, levs, ntrac), intent(in) :: gq0 - real(kind=kind_phys), dimension(im, levs), intent(inout) :: save_t, save_qv - real(kind=kind_phys), dimension(im, levs, ntrac), intent(inout) :: save_q + real(kind=kind_phys), dimension(im, levs), intent(out) :: save_t, save_qv + real(kind=kind_phys), dimension(im, levs, ntrac), intent(out) :: save_q character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/GFS_MP_generic.meta b/physics/GFS_MP_generic.meta index 8a912544ab..6b98245f0f 100644 --- a/physics/GFS_MP_generic.meta +++ b/physics/GFS_MP_generic.meta @@ -95,7 +95,7 @@ dimensions = (horizontal_dimension,vertical_dimension) type = real kind = kind_phys - intent = inout + intent = out optional = F [save_qv] standard_name = water_vapor_specific_humidity_save @@ -113,7 +113,7 @@ dimensions = (horizontal_dimension,vertical_dimension,number_of_tracers) type = real kind = kind_phys - intent = inout + intent = out optional = F [errmsg] standard_name = ccpp_error_message @@ -333,7 +333,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - intent = in + intent = inout optional = F [rain1] standard_name = lwe_thickness_of_explicit_precipitation_amount diff --git a/physics/GFS_PBL_generic.meta b/physics/GFS_PBL_generic.meta index 51962c37b5..b0f5ef7c3d 100644 --- a/physics/GFS_PBL_generic.meta +++ b/physics/GFS_PBL_generic.meta @@ -1322,18 +1322,18 @@ kind = kind_phys intent = in optional = F -[hefac] - standard_name = surface_upward_latent_heat_flux_reduction_factor - long_name = surface upward latent heat flux reduction factor from canopy heat storage +[hffac] + standard_name = surface_upward_sensible_heat_flux_reduction_factor + long_name = surface upward sensible heat flux reduction factor from canopy heat storage units = none dimensions = (horizontal_dimension) type = real kind = kind_phys intent = in optional = F -[hffac] - standard_name = surface_upward_sensible_heat_flux_reduction_factor - long_name = surface upward sensible heat flux reduction factor from canopy heat storage +[hefac] + standard_name = surface_upward_latent_heat_flux_reduction_factor + long_name = surface upward latent heat flux reduction factor from canopy heat storage units = none dimensions = (horizontal_dimension) type = real diff --git a/physics/GFS_cloud_diagnostics.meta b/physics/GFS_cloud_diagnostics.meta index f78a76490c..cc10000fe9 100644 --- a/physics/GFS_cloud_diagnostics.meta +++ b/physics/GFS_cloud_diagnostics.meta @@ -43,6 +43,15 @@ intent = in kind = kind_phys optional = F +[de_lgth] + standard_name = cloud_decorrelation_length + long_name = cloud decorrelation length + units = km + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F [p_lay] standard_name = air_pressure_at_layer_for_RRTMGP_in_hPa long_name = air pressure at vertical layer for radiation calculation @@ -70,31 +79,6 @@ kind = kind_phys intent = in optional = F -[mtopa] - standard_name = model_layer_number_at_cloud_top - long_name = vertical indices for low, middle and high cloud tops - units = index - dimensions = (horizontal_dimension,3) - type = integer - intent = out - optional = F -[mbota] - standard_name = model_layer_number_at_cloud_base - long_name = vertical indices for low, middle and high cloud bases - units = index - dimensions = (horizontal_dimension,3) - type = integer - intent = out - optional = F -[de_lgth] - standard_name = cloud_decorrelation_length - long_name = cloud decorrelation length - units = km - dimensions = (horizontal_dimension) - type = real - kind = kind_phys - intent = in - optional = F [deltaZ] standard_name = layer_thickness long_name = layer_thickness @@ -131,6 +115,22 @@ kind = kind_phys intent = in optional = F +[mbota] + standard_name = model_layer_number_at_cloud_base + long_name = vertical indices for low, middle and high cloud bases + units = index + dimensions = (horizontal_dimension,3) + type = integer + intent = out + optional = F +[mtopa] + standard_name = model_layer_number_at_cloud_top + long_name = vertical indices for low, middle and high cloud tops + units = index + dimensions = (horizontal_dimension,3) + type = integer + intent = out + optional = F [cldsa] standard_name = cloud_area_fraction_for_radiation long_name = fraction of clouds for low, middle, high, total and BL @@ -156,4 +156,4 @@ dimensions = () type = integer intent = out - optional = F \ No newline at end of file + optional = F diff --git a/physics/GFS_rrtmgp_gfdlmp_pre.meta b/physics/GFS_rrtmgp_gfdlmp_pre.meta index 932ffeb8fc..aa60d3ca9d 100644 --- a/physics/GFS_rrtmgp_gfdlmp_pre.meta +++ b/physics/GFS_rrtmgp_gfdlmp_pre.meta @@ -34,30 +34,6 @@ type = integer intent = in optional = F -[lsswr] - standard_name = flag_to_calc_sw - long_name = logical flags for sw radiation calls - units = flag - dimensions = () - type = logical - intent = in - optional = F -[lslwr] - standard_name = flag_to_calc_lw - long_name = logical flags for lw radiation calls - units = flag - dimensions = () - type = logical - intent = in - optional = F -[effr_in] - standard_name = flag_for_cloud_effective_radii - long_name = flag for cloud effective radii calculations in GFDL microphysics - units = - dimensions = () - type = logical - intent = in - optional = F [i_cldliq] standard_name = index_for_liquid_cloud_condensate long_name = tracer index for cloud condensate (or liquid water) @@ -106,42 +82,6 @@ type = integer intent = in optional = F -[effrin_cldliq] - standard_name = effective_radius_of_stratiform_cloud_liquid_water_particle_in_um - long_name = eff. radius of cloud liquid water particle in micrometer - units = um - dimensions = (horizontal_dimension,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F -[effrin_cldice] - standard_name = effective_radius_of_stratiform_cloud_ice_particle_in_um - long_name = eff. radius of cloud ice water particle in micrometer - units = um - dimensions = (horizontal_dimension,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F -[effrin_cldrain] - standard_name = effective_radius_of_stratiform_cloud_rain_particle_in_um - long_name = effective radius of cloud rain particle in micrometers - units = um - dimensions = (horizontal_dimension,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F -[effrin_cldsnow] - standard_name = effective_radius_of_stratiform_cloud_snow_particle_in_um - long_name = effective radius of cloud snow particle in micrometers - units = um - dimensions = (horizontal_dimension,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F [yearlen] standard_name = number_of_days_in_year long_name = number of days in a year @@ -150,6 +90,30 @@ type = integer intent = in optional = F +[lsswr] + standard_name = flag_to_calc_sw + long_name = logical flags for sw radiation calls + units = flag + dimensions = () + type = logical + intent = in + optional = F +[lslwr] + standard_name = flag_to_calc_lw + long_name = logical flags for lw radiation calls + units = flag + dimensions = () + type = logical + intent = in + optional = F +[effr_in] + standard_name = flag_for_cloud_effective_radii + long_name = flag for cloud effective radii calculations in GFDL microphysics + units = + dimensions = () + type = logical + intent = in + optional = F [julian] standard_name = julian_day long_name = julian day @@ -195,6 +159,42 @@ kind = kind_phys intent = in optional = F +[effrin_cldliq] + standard_name = effective_radius_of_stratiform_cloud_liquid_water_particle_in_um + long_name = eff. radius of cloud liquid water particle in micrometer + units = um + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[effrin_cldice] + standard_name = effective_radius_of_stratiform_cloud_ice_particle_in_um + long_name = eff. radius of cloud ice water particle in micrometer + units = um + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[effrin_cldrain] + standard_name = effective_radius_of_stratiform_cloud_rain_particle_in_um + long_name = effective radius of cloud rain particle in micrometers + units = um + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[effrin_cldsnow] + standard_name = effective_radius_of_stratiform_cloud_snow_particle_in_um + long_name = effective radius of cloud snow particle in micrometers + units = um + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F [tracer] standard_name = chemical_tracers long_name = chemical tracers @@ -240,15 +240,6 @@ kind = kind_phys intent = in optional = F -[de_lgth] - standard_name = cloud_decorrelation_length - long_name = cloud decorrelation length - units = km - dimensions = (horizontal_dimension) - type = real - kind = kind_phys - intent = out - optional = F [cld_frac] standard_name = total_cloud_fraction long_name = layer total cloud fraction @@ -357,6 +348,15 @@ kind = kind_phys intent = out optional = F +[de_lgth] + standard_name = cloud_decorrelation_length + long_name = cloud decorrelation length + units = km + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = out + optional = F [deltaZ] standard_name = layer_thickness long_name = layer_thickness @@ -382,4 +382,4 @@ dimensions = () type = integer intent = out - optional = F \ No newline at end of file + optional = F diff --git a/physics/GFS_rrtmgp_setup.meta b/physics/GFS_rrtmgp_setup.meta index aec1b43741..9f7ba9c34f 100644 --- a/physics/GFS_rrtmgp_setup.meta +++ b/physics/GFS_rrtmgp_setup.meta @@ -31,6 +31,8 @@ units = flag dimensions = () type = integer + intent = in + optional = F [imp_physics_wsm6] intent = in optional = F diff --git a/physics/GFS_rrtmgp_zhaocarr_pre.meta b/physics/GFS_rrtmgp_zhaocarr_pre.meta index 052da5798e..b0e94c8922 100644 --- a/physics/GFS_rrtmgp_zhaocarr_pre.meta +++ b/physics/GFS_rrtmgp_zhaocarr_pre.meta @@ -18,6 +18,14 @@ type = integer intent = in optional = F +[ncnd] + standard_name = number_of_cloud_condensate_types + long_name = number of cloud condensate types + units = count + dimensions = () + type = integer + intent = in + optional = F [nTracers] standard_name = number_of_tracers long_name = number of tracers @@ -26,14 +34,14 @@ type = integer intent = in optional = F -[ncnd] - standard_name = number_of_cloud_condensate_types - long_name = number of cloud condensate types - units = count +[i_cldliq] + standard_name = index_for_liquid_cloud_condensate + long_name = tracer index for cloud condensate (or liquid water) + units = index dimensions = () - type = integer + type = integer intent = in - optional = F + optional = F [lsswr] standard_name = flag_to_calc_sw long_name = logical flags for sw radiation calls @@ -74,14 +82,6 @@ type = logical intent = in optional = F -[i_cldliq] - standard_name = index_for_liquid_cloud_condensate - long_name = tracer index for cloud condensate (or liquid water) - units = index - dimensions = () - type = integer - intent = in - optional = F [lat] standard_name = latitude long_name = latitude @@ -90,6 +90,15 @@ type = real intent = in kind = kind_phys +[lsmask] + standard_name = sea_land_ice_mask_real + long_name = landmask: sea/land/ice=0/1/2 + units = flag + dimensions = (horizontal_dimension) + type = real + kind = kind_phys + intent = in + optional = F [p_lev] standard_name = air_pressure_at_interface_for_RRTMGP_in_hPa long_name = air pressure at vertical interface for radiation calculation @@ -108,15 +117,15 @@ kind = kind_phys intent = in optional = F -[tv_lay] - standard_name = virtual_temperature - long_name = layer virtual temperature +[t_lay] + standard_name = air_temperature_at_layer_for_RRTMGP + long_name = air temperature at vertical layer for radiation calculation units = K dimensions = (horizontal_dimension,vertical_dimension) type = real kind = kind_phys intent = in - optional = F + optional = F [relhum] standard_name = relative_humidity long_name = layer relative humidity @@ -126,15 +135,15 @@ kind = kind_phys intent = in optional = F -[t_lay] - standard_name = air_temperature_at_layer_for_RRTMGP - long_name = air temperature at vertical layer for radiation calculation +[tv_lay] + standard_name = virtual_temperature + long_name = layer virtual temperature units = K dimensions = (horizontal_dimension,vertical_dimension) type = real kind = kind_phys intent = in - optional = F + optional = F [effrin_cldliq] standard_name = effective_radius_of_stratiform_cloud_liquid_water_particle_in_um long_name = eff. radius of cloud liquid water particle in micrometer @@ -198,19 +207,10 @@ kind = kind_phys intent = in optional = F -[lsmask] - standard_name = sea_land_ice_mask_real - long_name = landmask: sea/land/ice=0/1/2 - units = flag - dimensions = (horizontal_dimension) - type = real - kind = kind_phys - intent = in - optional = F -[con_ttp] - standard_name = triple_point_temperature_of_water - long_name = triple point temperature of water - units = K +[con_eps] + standard_name = ratio_of_dry_air_to_water_vapor_gas_constants + long_name = rd/rv + units = none dimensions = () type = real kind = kind_phys @@ -234,15 +234,6 @@ kind = kind_phys intent = in optional = F -[con_eps] - standard_name = ratio_of_dry_air_to_water_vapor_gas_constants - long_name = rd/rv - units = none - dimensions = () - type = real - kind = kind_phys - intent = in - optional = F [con_epsm1] standard_name = ratio_of_dry_air_to_water_vapor_gas_constants_minus_one long_name = (rd/rv) - 1 @@ -261,6 +252,15 @@ kind = kind_phys intent = in optional = F +[con_ttp] + standard_name = triple_point_temperature_of_water + long_name = triple point temperature of water + units = K + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F [con_rd] standard_name = gas_constant_dry_air long_name = ideal gas constant for dry air @@ -360,11 +360,11 @@ kind = kind_phys intent = out optional = F -[cloud_overlap_param] - standard_name = cloud_overlap_param - long_name = cloud overlap parameter +[de_lgth] + standard_name = cloud_decorrelation_length + long_name = cloud decorrelation length units = km - dimensions = (horizontal_dimension,vertical_dimension) + dimensions = (horizontal_dimension) type = real kind = kind_phys intent = out @@ -378,11 +378,11 @@ kind = kind_phys intent = out optional = F -[de_lgth] - standard_name = cloud_decorrelation_length - long_name = cloud decorrelation length +[cloud_overlap_param] + standard_name = cloud_overlap_param + long_name = cloud overlap parameter units = km - dimensions = (horizontal_dimension) + dimensions = (horizontal_dimension,vertical_dimension) type = real kind = kind_phys intent = out @@ -403,4 +403,4 @@ dimensions = () type = integer intent = out - optional = F \ No newline at end of file + optional = F diff --git a/physics/GFS_surface_generic.meta b/physics/GFS_surface_generic.meta index 86b52b87c2..4d1467fd98 100644 --- a/physics/GFS_surface_generic.meta +++ b/physics/GFS_surface_generic.meta @@ -268,15 +268,6 @@ kind = kind_phys intent = in optional = F -[lndp_prt_list] - standard_name =magnitude_of_perturbations_for_landperts - long_name = magnitude of perturbations for landperts - units = variable - dimensions = (number_of_land_surface_variables_perturbed) - type = real - kind = kind_phys - intent = in - optional = F [lndp_var_list] standard_name = variables_to_be_perturbed_for_landperts long_name = variables to be perturbed for landperts @@ -286,6 +277,15 @@ kind = len=3 intent = in optional = F +[lndp_prt_list] + standard_name =magnitude_of_perturbations_for_landperts + long_name = magnitude of perturbations for landperts + units = variable + dimensions = (number_of_land_surface_variables_perturbed) + type = real + kind = kind_phys + intent = in + optional = F [z01d] standard_name = perturbation_of_momentum_roughness_length long_name = perturbation of momentum roughness length @@ -1333,18 +1333,18 @@ kind = kind_phys intent = out optional = F -[hefac] - standard_name = surface_upward_latent_heat_flux_reduction_factor - long_name = surface upward latent heat flux reduction factor from canopy heat storage +[hffac] + standard_name = surface_upward_sensible_heat_flux_reduction_factor + long_name = surface upward sensible heat flux reduction factor from canopy heat storage units = none dimensions = (horizontal_dimension) type = real kind = kind_phys intent = out optional = F -[hffac] - standard_name = surface_upward_sensible_heat_flux_reduction_factor - long_name = surface upward sensible heat flux reduction factor from canopy heat storage +[hefac] + standard_name = surface_upward_latent_heat_flux_reduction_factor + long_name = surface upward latent heat flux reduction factor from canopy heat storage units = none dimensions = (horizontal_dimension) type = real diff --git a/physics/cires_ugwp.meta b/physics/cires_ugwp.meta index d323324d26..1ce2e5a93d 100644 --- a/physics/cires_ugwp.meta +++ b/physics/cires_ugwp.meta @@ -689,7 +689,7 @@ dimensions = (horizontal_dimension,vertical_dimension) type = real kind = kind_phys - intent = inout + intent = out optional = F [du3dt_ogw] standard_name = time_integral_of_change_in_x_wind_due_to_orographic_gravity_wave_drag @@ -698,7 +698,7 @@ dimensions = (horizontal_dimension,vertical_dimension) type = real kind = kind_phys - intent = inout + intent = out optional = F [du3dt_tms] standard_name = time_integral_of_change_in_x_wind_due_to_turbulent_orographic_form_drag @@ -707,7 +707,7 @@ dimensions = (horizontal_dimension,vertical_dimension) type = real kind = kind_phys - intent = inout + intent = out optional = F [dudt] standard_name = tendency_of_x_wind_due_to_model_physics diff --git a/physics/cs_conv.F90 b/physics/cs_conv.F90 index 386349422f..13b3a36806 100644 --- a/physics/cs_conv.F90 +++ b/physics/cs_conv.F90 @@ -1,4 +1,4 @@ -!> \file cs_conv.F90 +u> \file cs_conv.F90 !! This file contains the Chikira-Sugiyama Convection scheme. module cs_conv_pre @@ -348,6 +348,7 @@ subroutine cs_conv_run( IJSDIM , KMAX , ntracp1 , NN, & cnv_dqldt, clcn, cnv_fice, & cnv_ndrop, cnv_nice, cf_upi ! *GJF + integer, intent(in) :: lprnt, ipr integer, intent(inout) :: kcnv(ijsdim) ! zero if no deep convection and 1 otherwise character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -397,14 +398,13 @@ subroutine cs_conv_run( IJSDIM , KMAX , ntracp1 , NN, & integer KTMAX(IJSDIM) !< max of KT real(r8) :: ftintm, wrk, wrk1, tem - integer i, k, n, ISTS, IENS, kp1, ipr + integer i, k, n, ISTS, IENS, kp1 !DD borrowed from RAS to go form total condensate to ice/water separately ! parameter (tf=130.16, tcr=160.16, tcrf=1.0/(tcr-tf),tcl=2.0) ! parameter (tf=230.16, tcr=260.16, tcrf=1.0/(tcr-tf)) real(r8), parameter :: tf=233.16, tcr=263.16, tcrf=1.0/(tcr-tf), tcl=2.0 logical, save :: first=.true. - logical lprnt ! Initialize CCPP error handling variables errmsg = '' diff --git a/physics/drag_suite.meta b/physics/drag_suite.meta index dfcac85822..a8c9587b13 100644 --- a/physics/drag_suite.meta +++ b/physics/drag_suite.meta @@ -270,7 +270,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - intent = inout + intent = in optional = F [dtaux2d_ls] standard_name = x_momentum_tendency_from_large_scale_gwd diff --git a/physics/gscond.f b/physics/gscond.f index 28f24763c9..1f41cc2b74 100644 --- a/physics/gscond.f +++ b/physics/gscond.f @@ -10,14 +10,14 @@ module zhaocarr_gscond ! \brief Brief description of the subroutine ! -!> \section arg_table_gscond_init Argument Table +!> \section arg_table_zhaocarr_gscond_init Argument Table !! subroutine zhaocarr_gscond_init end subroutine zhaocarr_gscond_init ! \brief Brief description of the subroutine ! -!> \section arg_table_gscond_finalize Argument Table +!> \section arg_table_zhaocarr_gscond_finalize Argument Table !! subroutine zhaocarr_gscond_finalize end subroutine zhaocarr_gscond_finalize diff --git a/physics/gscond.meta b/physics/gscond.meta index 57156358f4..5782806060 100644 --- a/physics/gscond.meta +++ b/physics/gscond.meta @@ -1,3 +1,13 @@ +[ccpp-arg-table] + name = zhaocarr_gscond_init + type = scheme + +######################################################################## +[ccpp-arg-table] + name = zhaocarr_gscond_finalize + type = scheme + +######################################################################## [ccpp-arg-table] name = zhaocarr_gscond_run type = scheme From c52a094aa0794a67f534ac50a8ec3add7d604bff Mon Sep 17 00:00:00 2001 From: Julie Schramm Date: Wed, 2 Sep 2020 10:29:19 -0600 Subject: [PATCH 05/25] More fixes to intent mismatches, no matching Fortran routine found, and out of order arguments for transition to capgen. --- physics/GFS_GWD_generic.F90 | 9 +++++++++ physics/GFS_GWD_generic.meta | 4 ++-- physics/cu_gf_driver.F90 | 12 ++++++------ physics/module_MYJPBL_wrapper.meta | 26 +++++++++++++------------- physics/module_MYJSFC_wrapper.meta | 16 ++++++++-------- physics/module_MYNNPBL_wrapper.F90 | 8 +++++--- physics/module_MYNNSFC_wrapper.F90 | 11 ++++++----- physics/module_SGSCloud_RadPre.F90 | 6 ++++++ physics/module_SGSCloud_RadPre.meta | 16 ++++++++-------- physics/mp_fer_hires.F90 | 6 +++--- physics/mp_fer_hires.meta | 12 ++++++------ 11 files changed, 72 insertions(+), 54 deletions(-) diff --git a/physics/GFS_GWD_generic.F90 b/physics/GFS_GWD_generic.F90 index 09c9691627..f4934aed9b 100644 --- a/physics/GFS_GWD_generic.F90 +++ b/physics/GFS_GWD_generic.F90 @@ -6,6 +6,9 @@ module GFS_GWD_generic_pre contains +!! \section arg_table_GFS_GWD_generic_pre_init Argument Table +!! \htmlinclude GFS_GWD_generic_pre_init.html +!! subroutine GFS_GWD_generic_pre_init() end subroutine GFS_GWD_generic_pre_init @@ -128,6 +131,9 @@ subroutine GFS_GWD_generic_pre_run( & end subroutine GFS_GWD_generic_pre_run !> @} +!! \section arg_table_GFS_GWD_generic_pre_finalize Argument Table +!! \htmlinclude GFS_GWD_generic_pre_finalize.html +!! subroutine GFS_GWD_generic_pre_finalize() end subroutine GFS_GWD_generic_pre_finalize @@ -185,6 +191,9 @@ subroutine GFS_GWD_generic_post_run(lssav, ldiag3d, dtf, dusfcg, dvsfcg, dudt, d end subroutine GFS_GWD_generic_post_run !> @} +!! \section arg_table_GFS_GWD_generic_post_finalize Argument Table +!! \htmlinclude GFS_GWD_generic_post_finalize.html +!! subroutine GFS_GWD_generic_post_finalize() end subroutine GFS_GWD_generic_post_finalize diff --git a/physics/GFS_GWD_generic.meta b/physics/GFS_GWD_generic.meta index 614184975d..7611d5fc9f 100644 --- a/physics/GFS_GWD_generic.meta +++ b/physics/GFS_GWD_generic.meta @@ -161,7 +161,7 @@ dimensions = (horizontal_dimension,vertical_dimension) type = real kind = kind_phys - intent = inout + intent = in optional = F [dvdt] standard_name = tendency_of_y_wind_due_to_model_physics @@ -170,7 +170,7 @@ dimensions = (horizontal_dimension,vertical_dimension) type = real kind = kind_phys - intent = inout + intent = in optional = F [dtdt] standard_name = tendency_of_air_temperature_due_to_model_physics diff --git a/physics/cu_gf_driver.F90 b/physics/cu_gf_driver.F90 index 5c43709d15..91214cdeb3 100644 --- a/physics/cu_gf_driver.F90 +++ b/physics/cu_gf_driver.F90 @@ -114,15 +114,15 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,cactiv, & du3dt_SCNV,dv3dt_SCNV,dt3dt_SCNV,dq3dt_SCNV, & du3dt_DCNV,dv3dt_DCNV,dt3dt_DCNV,dq3dt_DCNV - integer, dimension (im), intent(inout) :: hbot,htop,kcnv - integer, dimension (im), intent(in) :: xland + integer, dimension (im), intent(out) :: hbot,htop,kcnv + integer, dimension (im), intent(in) :: xland real(kind=kind_phys), dimension (im), intent(in) :: pbl integer, dimension (im) :: tropics ! ruc variable - real(kind=kind_phys), dimension (im) :: hfx2,qfx2,psuri - real(kind=kind_phys), dimension (im,km) :: ud_mf,dd_mf,dt_mf - real(kind=kind_phys), dimension (im), intent(inout) :: raincv,cld1d - real(kind=kind_phys), dimension (im,km) :: t2di,p2di + real(kind=kind_phys), dimension (im), intent(in) :: hfx2,qfx2,psuri + real(kind=kind_phys), dimension (im,km), intent(out) :: ud_mf,dd_mf,dt_mf + real(kind=kind_phys), dimension (im), intent(out) :: raincv,cld1d + real(kind=kind_phys), dimension (im,km), intent(in) :: t2di,p2di ! Specific humidity from FV3 real(kind=kind_phys), dimension (im,km), intent(in) :: qv2di_spechum real(kind=kind_phys), dimension (im,km), intent(inout) :: qv_spechum diff --git a/physics/module_MYJPBL_wrapper.meta b/physics/module_MYJPBL_wrapper.meta index fa1fe17c42..e445c3afe6 100644 --- a/physics/module_MYJPBL_wrapper.meta +++ b/physics/module_MYJPBL_wrapper.meta @@ -347,7 +347,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - intent = out + intent = inout optional = F [kpbl] standard_name = vertical_index_at_top_of_atmosphere_boundary_layer @@ -399,7 +399,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - intent = inout + intent = in optional = F [ch] standard_name = surface_drag_coefficient_for_heat_and_moisture_in_air @@ -408,7 +408,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - intent = inout + intent = in optional = F [wind] standard_name = wind_speed_at_lowest_model_layer @@ -437,19 +437,19 @@ kind = kind_phys intent = inout optional = F -[hflx] - standard_name = kinematic_surface_upward_sensible_heat_flux_reduced_by_surface_roughness - long_name = kinematic surface upward sensible heat flux - units = K m s-1 +[evap] + standard_name = kinematic_surface_upward_latent_heat_flux_reduced_by_surface_roughness + long_name = kinematic surface upward latent heat flux + units = kg kg-1 m s-1 dimensions = (horizontal_dimension) type = real kind = kind_phys intent = in optional = F -[evap] - standard_name = kinematic_surface_upward_latent_heat_flux_reduced_by_surface_roughness - long_name = kinematic surface upward latent heat flux - units = kg kg-1 m s-1 +[hflx] + standard_name = kinematic_surface_upward_sensible_heat_flux_reduced_by_surface_roughness + long_name = kinematic surface upward sensible heat flux + units = K m s-1 dimensions = (horizontal_dimension) type = real kind = kind_phys @@ -570,7 +570,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - intent = inout + intent = out optional = F [gamq] standard_name = countergradient_mixing_term_for_water_vapor @@ -579,7 +579,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - intent = inout + intent = out optional = F [con_cp] standard_name = specific_heat_of_dry_air_at_constant_pressure diff --git a/physics/module_MYJSFC_wrapper.meta b/physics/module_MYJSFC_wrapper.meta index c26728f0f0..ce963b6e80 100644 --- a/physics/module_MYJSFC_wrapper.meta +++ b/physics/module_MYJSFC_wrapper.meta @@ -202,7 +202,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - intent = inout + intent = in optional = F [phy_myj_qsfc] standard_name = surface_specific_humidity_for_MYJ_schemes @@ -373,7 +373,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - intent = inout + intent = out optional = F [ch] standard_name = surface_drag_coefficient_for_heat_and_moisture_in_air @@ -382,7 +382,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - intent = inout + intent = out optional = F [stress] standard_name = surface_wind_stress @@ -400,7 +400,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - intent = inout + intent = out optional = F [ffh] standard_name = Monin_Obukhov_similarity_function_for_heat @@ -409,7 +409,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - intent = inout + intent = out optional = F [fm10] standard_name = Monin_Obukhov_similarity_function_for_momentum_at_10m @@ -418,7 +418,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - intent = inout + intent = out optional = F [fh2] standard_name = Monin_Obukhov_similarity_function_for_heat_at_2m @@ -427,7 +427,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - intent = inout + intent = out optional = F [landfrac] standard_name = land_area_fraction @@ -742,7 +742,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - intent = out + intent = inout optional = F [con_cp] standard_name = specific_heat_of_dry_air_at_constant_pressure diff --git a/physics/module_MYNNPBL_wrapper.F90 b/physics/module_MYNNPBL_wrapper.F90 index 8fd727148a..91c023bc48 100644 --- a/physics/module_MYNNPBL_wrapper.F90 +++ b/physics/module_MYNNPBL_wrapper.F90 @@ -10,6 +10,9 @@ MODULE mynnedmf_wrapper contains +!> \section arg_table_mynnedmf_wrapper_init Argument Table +!! \htmlinclude mynnedmf_wrapper_init.html +!! subroutine mynnedmf_wrapper_init (lheatstrg, errmsg, errflg) implicit none @@ -297,11 +300,10 @@ SUBROUTINE mynnedmf_wrapper_run( & & wet, dry, icy real(kind=kind_phys), dimension(im), intent(inout) :: & - & pblh + & pblh,dusfc_diag,dvsfc_diag,dtsfc_diag,dqsfc_diag real(kind=kind_phys), dimension(im), intent(out) :: & & ch,dtsfc1,dqsfc1,dusfc1,dvsfc1, & - & dtsfci_diag,dqsfci_diag,dtsfc_diag,dqsfc_diag, & - & dusfci_diag,dvsfci_diag,dusfc_diag,dvsfc_diag, & + & dtsfci_diag,dqsfci_diag,dusfci_diag,dvsfci_diag, & & maxMF integer, dimension(im), intent(inout) :: & & kpbl,nupdraft,ktop_plume diff --git a/physics/module_MYNNSFC_wrapper.F90 b/physics/module_MYNNSFC_wrapper.F90 index 496db75808..c945a27617 100644 --- a/physics/module_MYNNSFC_wrapper.F90 +++ b/physics/module_MYNNSFC_wrapper.F90 @@ -116,11 +116,12 @@ SUBROUTINE mynnsfc_wrapper_run( & & sigmaf,shdmax,z0pert,ztpert !MYNN-1D - REAL :: delt - INTEGER :: im, levs - INTEGER :: iter, k, i, itimestep, lsm - LOGICAL :: flag_init,flag_restart,lprnt - INTEGER :: IDS,IDE,JDS,JDE,KDS,KDE, & + REAL, intent(in) :: delt + INTEGER, intent(in) :: im, levs + INTEGER, intent(in) :: iter, itimestep, lsm + LOGICAL, intent(in) :: flag_init,flag_restart,lprnt + INTEGER :: k, i + INTEGER :: IDS,IDE,JDS,JDE,KDS,KDE, & & IMS,IME,JMS,JME,KMS,KME, & & ITS,ITE,JTS,JTE,KTS,KTE diff --git a/physics/module_SGSCloud_RadPre.F90 b/physics/module_SGSCloud_RadPre.F90 index 5a1a2744f9..248d9d23dc 100644 --- a/physics/module_SGSCloud_RadPre.F90 +++ b/physics/module_SGSCloud_RadPre.F90 @@ -10,9 +10,15 @@ module sgscloud_radpre contains +!> \section arg_table_sgscloud_radpre_init Argument Table +!! \htmlinclude sgscloud_radpre_init.html +!! subroutine sgscloud_radpre_init () end subroutine sgscloud_radpre_init +!> \section arg_table_sgscloud_radpre_finalize Argument Table +!! \htmlinclude sgscloud_radpre_finalize.html +!! subroutine sgscloud_radpre_finalize () end subroutine sgscloud_radpre_finalize diff --git a/physics/module_SGSCloud_RadPre.meta b/physics/module_SGSCloud_RadPre.meta index 2658e86387..d9d21a3ee6 100644 --- a/physics/module_SGSCloud_RadPre.meta +++ b/physics/module_SGSCloud_RadPre.meta @@ -43,6 +43,14 @@ type = logical intent = in optional = F +[do_mynnedmf] + standard_name = do_mynnedmf + long_name = flag to activate MYNN-EDMF + units = flag + dimensions = () + type = logical + intent = in + optional = F [qc] standard_name = cloud_condensed_water_mixing_ratio long_name = ratio of mass of cloud water to mass of dry air plus vapor (without condensates) @@ -317,14 +325,6 @@ type = integer intent = inout optional = F -[do_mynnedmf] - standard_name = do_mynnedmf - long_name = flag to activate MYNN-EDMF - units = flag - dimensions = () - type = logical - intent = in - optional = F [imp_physics] standard_name = flag_for_microphysics_scheme long_name = choice of microphysics scheme diff --git a/physics/mp_fer_hires.F90 b/physics/mp_fer_hires.F90 index 95e5211411..f599c78f20 100644 --- a/physics/mp_fer_hires.F90 +++ b/physics/mp_fer_hires.F90 @@ -162,9 +162,9 @@ SUBROUTINE mp_fer_hires_run(NCOL, NLEV, DT ,SPEC_ADV & real(kind_phys), intent(inout) :: cwm(1:ncol,1:nlev) real(kind_phys), intent(inout) :: train(1:ncol,1:nlev) real(kind_phys), intent(out ) :: sr(1:ncol) - real(kind_phys), intent(inout) :: f_ice(1:ncol,1:nlev) - real(kind_phys), intent(inout) :: f_rain(1:ncol,1:nlev) - real(kind_phys), intent(inout) :: f_rimef(1:ncol,1:nlev) + real(kind_phys), intent(out ) :: f_ice(1:ncol,1:nlev) + real(kind_phys), intent(out ) :: f_rain(1:ncol,1:nlev) + real(kind_phys), intent(out ) :: f_rimef(1:ncol,1:nlev) real(kind_phys), intent(inout) :: qc(1:ncol,1:nlev) real(kind_phys), intent(inout) :: qr(1:ncol,1:nlev) real(kind_phys), intent(inout) :: qi(1:ncol,1:nlev) diff --git a/physics/mp_fer_hires.meta b/physics/mp_fer_hires.meta index a7a33378aa..385406533c 100644 --- a/physics/mp_fer_hires.meta +++ b/physics/mp_fer_hires.meta @@ -275,18 +275,18 @@ kind = kind_phys intent = inout optional = F -[qi] - standard_name = ice_water_mixing_ratio_updated_by_physics - long_name = ratio of mass of ice water to mass of dry air plus vapor (without condensates) updated by physics +[qr] + standard_name = rain_water_mixing_ratio_updated_by_physics + long_name = ratio of mass of rain water to mass of dry air plus vapor (without condensates) updated by physics units = kg kg-1 dimensions = (horizontal_dimension,vertical_dimension) type = real kind = kind_phys intent = inout optional = F -[qr] - standard_name = rain_water_mixing_ratio_updated_by_physics - long_name = ratio of mass of rain water to mass of dry air plus vapor (without condensates) updated by physics +[qi] + standard_name = ice_water_mixing_ratio_updated_by_physics + long_name = ratio of mass of ice water to mass of dry air plus vapor (without condensates) updated by physics units = kg kg-1 dimensions = (horizontal_dimension,vertical_dimension) type = real From 85fa5577d03d19dc6f71e2591c49f14c03977253 Mon Sep 17 00:00:00 2001 From: Julie Schramm Date: Tue, 5 Jan 2021 11:18:31 -0700 Subject: [PATCH 06/25] Rearrange metadata table entries and add intent to keep capgen happy. --- physics/GFS_cloud_diagnostics.meta | 52 ++++++------ physics/GFS_rrtmgp_gfdlmp_pre.meta | 120 +++++++++++++-------------- physics/GFS_rrtmgp_zhaocarr_pre.meta | 46 +++++----- physics/gfdl_sfc_layer.meta | 6 ++ 4 files changed, 115 insertions(+), 109 deletions(-) diff --git a/physics/GFS_cloud_diagnostics.meta b/physics/GFS_cloud_diagnostics.meta index 840b3b21a9..1e68928f02 100644 --- a/physics/GFS_cloud_diagnostics.meta +++ b/physics/GFS_cloud_diagnostics.meta @@ -47,6 +47,15 @@ intent = in kind = kind_phys optional = F +[de_lgth] + standard_name = cloud_decorrelation_length + long_name = cloud decorrelation length + units = km + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in + optional = F [p_lay] standard_name = air_pressure_at_layer_for_RRTMGP_in_hPa long_name = air pressure at vertical layer for radiation calculation @@ -74,31 +83,6 @@ kind = kind_phys intent = in optional = F -[mtopa] - standard_name = model_layer_number_at_cloud_top - long_name = vertical indices for low, middle and high cloud tops - units = index - dimensions = (horizontal_loop_extent,3) - type = integer - intent = out - optional = F -[mbota] - standard_name = model_layer_number_at_cloud_base - long_name = vertical indices for low, middle and high cloud bases - units = index - dimensions = (horizontal_loop_extent,3) - type = integer - intent = out - optional = F -[de_lgth] - standard_name = cloud_decorrelation_length - long_name = cloud decorrelation length - units = km - dimensions = (horizontal_loop_extent) - type = real - kind = kind_phys - intent = in - optional = F [deltaZ] standard_name = layer_thickness long_name = layer_thickness @@ -135,6 +119,22 @@ kind = kind_phys intent = in optional = F +[mtopa] + standard_name = model_layer_number_at_cloud_top + long_name = vertical indices for low, middle and high cloud tops + units = index + dimensions = (horizontal_loop_extent,3) + type = integer + intent = out + optional = F +[mbota] + standard_name = model_layer_number_at_cloud_base + long_name = vertical indices for low, middle and high cloud bases + units = index + dimensions = (horizontal_loop_extent,3) + type = integer + intent = out + optional = F [cldsa] standard_name = cloud_area_fraction_for_radiation long_name = fraction of clouds for low, middle, high, total and BL @@ -160,4 +160,4 @@ dimensions = () type = integer intent = out - optional = F \ No newline at end of file + optional = F diff --git a/physics/GFS_rrtmgp_gfdlmp_pre.meta b/physics/GFS_rrtmgp_gfdlmp_pre.meta index 3841afc9b6..020ccece9b 100644 --- a/physics/GFS_rrtmgp_gfdlmp_pre.meta +++ b/physics/GFS_rrtmgp_gfdlmp_pre.meta @@ -39,30 +39,6 @@ type = integer intent = in optional = F -[doSWrad] - standard_name = flag_to_calc_sw - long_name = logical flags for sw radiation calls - units = flag - dimensions = () - type = logical - intent = in - optional = F -[doLWrad] - standard_name = flag_to_calc_lw - long_name = logical flags for lw radiation calls - units = flag - dimensions = () - type = logical - intent = in - optional = F -[effr_in] - standard_name = flag_for_cloud_effective_radii - long_name = flag for cloud effective radii calculations in GFDL microphysics - units = flag - dimensions = () - type = logical - intent = in - optional = F [i_cldliq] standard_name = index_for_liquid_cloud_condensate long_name = tracer index for cloud condensate (or liquid water) @@ -111,42 +87,6 @@ type = integer intent = in optional = F -[effrin_cldliq] - standard_name = effective_radius_of_stratiform_cloud_liquid_water_particle_in_um - long_name = eff. radius of cloud liquid water particle in micrometer - units = um - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F -[effrin_cldice] - standard_name = effective_radius_of_stratiform_cloud_ice_particle_in_um - long_name = eff. radius of cloud ice water particle in micrometer - units = um - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F -[effrin_cldrain] - standard_name = effective_radius_of_stratiform_cloud_rain_particle_in_um - long_name = effective radius of cloud rain particle in micrometers - units = um - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F -[effrin_cldsnow] - standard_name = effective_radius_of_stratiform_cloud_snow_particle_in_um - long_name = effective radius of cloud snow particle in micrometers - units = um - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F [yearlen] standard_name = number_of_days_in_year long_name = number of days in a year @@ -155,6 +95,30 @@ type = integer intent = in optional = F +[doSWrad] + standard_name = flag_to_calc_sw + long_name = logical flags for sw radiation calls + units = flag + dimensions = () + type = logical + intent = in + optional = F +[doLWrad] + standard_name = flag_to_calc_lw + long_name = logical flags for lw radiation calls + units = flag + dimensions = () + type = logical + intent = in + optional = F +[effr_in] + standard_name = flag_for_cloud_effective_radii + long_name = flag for cloud effective radii calculations in GFDL microphysics + units = flag + dimensions = () + type = logical + intent = in + optional = F [julian] standard_name = julian_day long_name = julian day @@ -200,6 +164,42 @@ kind = kind_phys intent = in optional = F +[effrin_cldliq] + standard_name = effective_radius_of_stratiform_cloud_liquid_water_particle_in_um + long_name = eff. radius of cloud liquid water particle in micrometer + units = um + dimensions = (horizontal_loop_extent,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[effrin_cldice] + standard_name = effective_radius_of_stratiform_cloud_ice_particle_in_um + long_name = eff. radius of cloud ice water particle in micrometer + units = um + dimensions = (horizontal_loop_extent,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[effrin_cldrain] + standard_name = effective_radius_of_stratiform_cloud_rain_particle_in_um + long_name = effective radius of cloud rain particle in micrometers + units = um + dimensions = (horizontal_loop_extent,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[effrin_cldsnow] + standard_name = effective_radius_of_stratiform_cloud_snow_particle_in_um + long_name = effective radius of cloud snow particle in micrometers + units = um + dimensions = (horizontal_loop_extent,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F [tracer] standard_name = chemical_tracers long_name = chemical tracers diff --git a/physics/GFS_rrtmgp_zhaocarr_pre.meta b/physics/GFS_rrtmgp_zhaocarr_pre.meta index 0cc454d2ee..e3812bb74f 100644 --- a/physics/GFS_rrtmgp_zhaocarr_pre.meta +++ b/physics/GFS_rrtmgp_zhaocarr_pre.meta @@ -23,6 +23,14 @@ type = integer intent = in optional = F +[ncnd] + standard_name = number_of_cloud_condensate_types + long_name = number of cloud condensate types + units = count + dimensions = () + type = integer + intent = in + optional = F [nTracers] standard_name = number_of_tracers long_name = number of tracers @@ -31,14 +39,14 @@ type = integer intent = in optional = F -[ncnd] - standard_name = number_of_cloud_condensate_types - long_name = number of cloud condensate types - units = count +[i_cldliq] + standard_name = index_for_liquid_cloud_condensate + long_name = tracer index for cloud condensate (or liquid water) + units = index dimensions = () - type = integer + type = integer intent = in - optional = F + optional = F [lsswr] standard_name = flag_to_calc_sw long_name = logical flags for sw radiation calls @@ -79,14 +87,6 @@ type = logical intent = in optional = F -[i_cldliq] - standard_name = index_for_liquid_cloud_condensate - long_name = tracer index for cloud condensate (or liquid water) - units = index - dimensions = () - type = integer - intent = in - optional = F [lat] standard_name = latitude long_name = latitude @@ -95,6 +95,15 @@ type = real intent = in kind = kind_phys +[lsmask] + standard_name = sea_land_ice_mask_real + long_name = landmask: sea/land/ice=0/1/2 + units = flag + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in + optional = F [p_lev] standard_name = air_pressure_at_interface_for_RRTMGP_in_hPa long_name = air pressure at vertical interface for radiation calculation @@ -203,15 +212,6 @@ kind = kind_phys intent = in optional = F -[lsmask] - standard_name = sea_land_ice_mask_real - long_name = landmask: sea/land/ice=0/1/2 - units = flag - dimensions = (horizontal_loop_extent) - type = real - kind = kind_phys - intent = in - optional = F [con_ttp] standard_name = triple_point_temperature_of_water long_name = triple point temperature of water diff --git a/physics/gfdl_sfc_layer.meta b/physics/gfdl_sfc_layer.meta index 77024c8135..a9829fec3e 100644 --- a/physics/gfdl_sfc_layer.meta +++ b/physics/gfdl_sfc_layer.meta @@ -783,6 +783,8 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys + intent = inout + optional = F [qss_lnd] standard_name = surface_specific_humidity_over_land long_name = surface air saturation specific humidity over land @@ -790,6 +792,8 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys + intent = inout + optional = F [qss_ice] standard_name = surface_specific_humidity_over_ice long_name = surface air saturation specific humidity over ice @@ -797,6 +801,8 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys + intent = inout + optional = F [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP From 8e7e1b78ad58cbdb66746340a52792356cf194ea Mon Sep 17 00:00:00 2001 From: Julie Schramm Date: Wed, 6 Jan 2021 14:22:16 -0700 Subject: [PATCH 07/25] Fix order of variables and differing intents. --- physics/GFS_rrtmgp_thompsonmp_pre.meta | 154 ++++++++++++------------- physics/dcyc2.meta | 70 +++++------ physics/sfc_drv_ruc.meta | 6 +- 3 files changed, 115 insertions(+), 115 deletions(-) diff --git a/physics/GFS_rrtmgp_thompsonmp_pre.meta b/physics/GFS_rrtmgp_thompsonmp_pre.meta index 90ec59760d..482e6a5572 100644 --- a/physics/GFS_rrtmgp_thompsonmp_pre.meta +++ b/physics/GFS_rrtmgp_thompsonmp_pre.meta @@ -55,46 +55,6 @@ type = logical intent = in optional = F -[effr_in] - standard_name = flag_for_cloud_effective_radii - long_name = flag for cloud effective radii calculations in GFDL microphysics - units = flag - dimensions = () - type = logical - intent = in - optional = F -[uni_cld] - standard_name = flag_for_uni_cld - long_name = flag for uni_cld - units = flag - dimensions = () - type = logical - intent = in - optional = F -[lmfshal] - standard_name = flag_for_lmfshal - long_name = flag for lmfshal - units = flag - dimensions = () - type = logical - intent = in - optional = F -[lmfdeep2] - standard_name = flag_for_scale_aware_mass_flux_convection - long_name = flag for some scale-aware mass-flux convection scheme active - units = flag - dimensions = () - type = logical - intent = in - optional = F -[ltaerosol] - standard_name = flag_for_aerosol_physics - long_name = flag for aerosol physics - units = flag - dimensions = () - type = logical - intent = in - optional = F [i_cldliq] standard_name = index_for_liquid_cloud_condensate long_name = tracer index for cloud condensate (or liquid water) @@ -167,6 +127,50 @@ type = integer intent = in optional = F +[effr_in] + standard_name = flag_for_cloud_effective_radii + long_name = flag for cloud effective radii calculations in GFDL microphysics + units = flag + dimensions = () + type = logical + intent = in + optional = F +[p_lev] + standard_name = air_pressure_at_interface_for_RRTMGP_in_hPa + long_name = air pressure at vertical interface for radiation calculation + units = hPa + dimensions = (horizontal_dimension,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[p_lay] + standard_name = air_pressure_at_layer_for_RRTMGP_in_hPa + long_name = air pressure at vertical layer for radiation calculation + units = hPa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[tv_lay] + standard_name = virtual_temperature + long_name = layer virtual temperature + units = K + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[t_lay] + standard_name = air_temperature_at_layer_for_RRTMGP + long_name = air temperature at vertical layer for radiation calculation + units = K + dimensions = (horizontal_loop_extent,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F [effrin_cldliq] standard_name = effective_radius_of_stratiform_cloud_liquid_water_particle_in_um long_name = eff. radius of cloud liquid water particle in micrometer @@ -243,42 +247,6 @@ type = logical intent = in optional = F -[p_lev] - standard_name = air_pressure_at_interface_for_RRTMGP_in_hPa - long_name = air pressure at vertical interface for radiation calculation - units = hPa - dimensions = (horizontal_dimension,vertical_dimension_plus_one) - type = real - kind = kind_phys - intent = in - optional = F -[p_lay] - standard_name = air_pressure_at_layer_for_RRTMGP_in_hPa - long_name = air pressure at vertical layer for radiation calculation - units = hPa - dimensions = (horizontal_dimension,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F -[tv_lay] - standard_name = virtual_temperature - long_name = layer virtual temperature - units = K - dimensions = (horizontal_dimension,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F -[t_lay] - standard_name = air_temperature_at_layer_for_RRTMGP - long_name = air temperature at vertical layer for radiation calculation - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F [qs_lay] standard_name = saturation_vapor_pressure long_name = saturation vapor pressure @@ -333,6 +301,38 @@ kind = kind_phys intent = in optional = F +[uni_cld] + standard_name = flag_for_uni_cld + long_name = flag for uni_cld + units = flag + dimensions = () + type = logical + intent = in + optional = F +[lmfshal] + standard_name = flag_for_lmfshal + long_name = flag for lmfshal + units = flag + dimensions = () + type = logical + intent = in + optional = F +[lmfdeep2] + standard_name = flag_for_scale_aware_mass_flux_convection + long_name = flag for some scale-aware mass-flux convection scheme active + units = flag + dimensions = () + type = logical + intent = in + optional = F +[ltaerosol] + standard_name = flag_for_aerosol_physics + long_name = flag for aerosol physics + units = flag + dimensions = () + type = logical + intent = in + optional = F [cld_frac] standard_name = total_cloud_fraction long_name = layer total cloud fraction @@ -439,4 +439,4 @@ dimensions = () type = integer intent = out - optional = F \ No newline at end of file + optional = F diff --git a/physics/dcyc2.meta b/physics/dcyc2.meta index 3422272069..02611d224a 100644 --- a/physics/dcyc2.meta +++ b/physics/dcyc2.meta @@ -178,15 +178,6 @@ kind = kind_phys intent = in optional = F -[sfculw] - standard_name = surface_upwelling_longwave_flux_on_radiation_time_step - long_name = total sky sfc upward lw flux - units = W m-2 - dimensions = (horizontal_loop_extent) - type = real - kind = kind_phys - intent = in - optional = F [swh] standard_name = tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_time_step long_name = total sky shortwave heating rate on radiation time step @@ -353,6 +344,32 @@ type = logical intent = in optional = F +[use_LW_jacobian] + standard_name = flag_to_calc_RRTMGP_LW_jacobian + long_name = logical flag to control RRTMGP LW calculation + units = flag + dimensions = () + type = logical + intent = in + optional = F +[sfculw] + standard_name = surface_upwelling_longwave_flux_on_radiation_time_step + long_name = total sky sfc upward lw flux + units = W m-2 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in + optional = F +[sfculw_jac] + standard_name = RRTMGP_jacobian_of_lw_flux_upward_at_surface + long_name = RRTMGP Jacobian upward longwave flux at surface + units = W m-2 K-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in + optional = F [dtdt] standard_name = tendency_of_air_temperature_due_to_model_physics long_name = total radiative heating rate at current time @@ -398,6 +415,15 @@ kind = kind_phys intent = out optional = F +[adjsfculw] + standard_name = surface_upwelling_longwave_flux + long_name = surface upwelling longwave flux at current time + units = W m-2 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = out + optional = F [adjsfculw_lnd] standard_name = surface_upwelling_longwave_flux_over_land_interstitial long_name = surface upwelling longwave flux at current time over land (temporary use as interstitial) @@ -425,15 +451,6 @@ kind = kind_phys intent = out optional = F -[adjsfculw] - standard_name = surface_upwelling_longwave_flux - long_name = surface upwelling longwave flux at current time - units = W m-2 - dimensions = (horizontal_loop_extent) - type = real - kind = kind_phys - intent = out - optional = F [xmu] standard_name = zenith_angle_temporal_adjustment_factor_for_shortwave_fluxes long_name = zenith angle temporal adjustment factor for shortwave fluxes @@ -524,23 +541,6 @@ kind = kind_phys intent = out optional = F -[use_LW_jacobian] - standard_name = flag_to_calc_RRTMGP_LW_jacobian - long_name = logical flag to control RRTMGP LW calculation - units = flag - dimensions = () - type = logical - intent = in - optional = F -[sfculw_jac] - standard_name = RRTMGP_jacobian_of_lw_flux_upward_at_surface - long_name = RRTMGP Jacobian upward longwave flux at surface - units = W m-2 K-1 - dimensions = (horizontal_loop_extent) - type = real - kind = kind_phys - intent = in - optional = F [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/sfc_drv_ruc.meta b/physics/sfc_drv_ruc.meta index 25cb82c0b3..b49c35df09 100644 --- a/physics/sfc_drv_ruc.meta +++ b/physics/sfc_drv_ruc.meta @@ -144,7 +144,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - intent = inout + intent = in optional = F [tsfc_lnd] standard_name = surface_skin_temperature @@ -153,7 +153,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - intent = inout + intent = in optional = F [tsfc_wat] standard_name = sea_surface_temperature @@ -162,7 +162,7 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - intent = inout + intent = in optional = F [tg3] standard_name = deep_soil_temperature From 72b01adb0308e74f266b91d954feec3147ea3f97 Mon Sep 17 00:00:00 2001 From: Julie Schramm Date: Wed, 6 Jan 2021 16:44:36 -0700 Subject: [PATCH 08/25] Fix CCPPError: No matching Fortran routine found for sfc_sice_run --- physics/sfc_sice.f | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/physics/sfc_sice.f b/physics/sfc_sice.f index ab67f849e6..daf42fd892 100644 --- a/physics/sfc_sice.f +++ b/physics/sfc_sice.f @@ -14,9 +14,6 @@ end subroutine sfc_sice_finalize !>\defgroup gfs_sice_main GFS Three-layer Thermodynomics Sea-Ice Scheme Module !! \brief This is three-layer thermodynomics sea-ice model based on Winton (2000) \cite winton_2000. -!! \section arg_table_sfc_sice_run Argument Table -!! \htmlinclude sfc_sice_run.html -!! !> \section general_sice_run GFS Sea Ice Driver General Algorithm !!The model has four prognostic variables: the snow layer thickness \f$h_s\f$, the ice layer thickness !! \f$h_i\f$, the upper and lower ice layer temperatures located at the midpoints of the layers @@ -38,19 +35,22 @@ end subroutine sfc_sice_finalize !! the water line to ice, and 3) to equalize the thickness of the two !! ice layers. !> \section detailed_sice_run GFS Sea Ice Driver Detailed Algorithm +!! +!! \section arg_table_sfc_sice_run Argument Table +!! \htmlinclude sfc_sice_run.html +!! !> @{ subroutine sfc_sice_run & - & ( im, kice, sbc, hvap, tgice, cp, eps, epsm1, rvrdm1, grav, & ! --- inputs: - & t0c, rd, ps, t1, q1, delt, & - & sfcemis, dlwflx, sfcnsw, sfcdsw, srflag, & - & cm, ch, prsl1, prslki, prsik1, prslk1, wind, & - & flag_iter, lprnt, ipr, & - & hice, fice, tice, weasd, tskin, tprcp, tiice, ep, & ! --- input/outputs: - & snwdph, qsurf, snowmt, gflux, cmm, chh, evap, hflx, & ! - & frac_grid, icy, islmsk_cice, & - & min_lakeice, min_seaice, oceanfrac, & - & errmsg, errflg - & ) + ( im, kice, sbc, hvap, tgice, cp, eps, epsm1, rvrdm1, grav, & ! --- inputs: + t0c, rd, ps, t1, q1, delt, & + sfcemis, dlwflx, sfcnsw, sfcdsw, srflag, & + cm, ch, prsl1, prslki, prsik1, prslk1, wind, & + flag_iter, lprnt, ipr, & + hice, fice, tice, weasd, tskin, tprcp, tiice, ep, & ! --- input/outputs: + snwdph, qsurf, snowmt, gflux, cmm, chh, evap, hflx, & ! + frac_grid, icy, islmsk_cice, & + min_lakeice, min_seaice, oceanfrac, & + errmsg, errflg ) ! ===================================================================== ! ! description: ! From dc0f118a4a73b5763c0454a1e817ad5fea186124 Mon Sep 17 00:00:00 2001 From: Julie Schramm Date: Thu, 7 Jan 2021 10:45:31 -0700 Subject: [PATCH 09/25] Add missing intent statements --- physics/sfc_noah_wrfv4.meta | 2 +- physics/unified_ugwp.meta | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/physics/sfc_noah_wrfv4.meta b/physics/sfc_noah_wrfv4.meta index 1895c56bf1..23d49ecc8a 100644 --- a/physics/sfc_noah_wrfv4.meta +++ b/physics/sfc_noah_wrfv4.meta @@ -749,7 +749,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = in + intent = inout optional = F [errmsg] standard_name = ccpp_error_message diff --git a/physics/unified_ugwp.meta b/physics/unified_ugwp.meta index 675a68edd3..d7846890fd 100644 --- a/physics/unified_ugwp.meta +++ b/physics/unified_ugwp.meta @@ -69,6 +69,8 @@ units = none dimensions = (8) type = integer + intent = in + optional = F [lonr] standard_name = number_of_equatorial_longitude_points long_name = number of global points in x-dir (i) along the equator @@ -363,6 +365,8 @@ dimensions = () type = real kind = kind_phys + intent = in + optional = F [kdt] standard_name = index_of_time_step long_name = current forecast iteration @@ -724,6 +728,8 @@ units = none dimensions = (8) type = integer + intent = in + optional = F [xlat] standard_name = latitude long_name = grid latitude From 7cbb6ae3c29edce0a9772f30b38e21f856f410da Mon Sep 17 00:00:00 2001 From: Julie Schramm Date: Thu, 4 Feb 2021 11:11:15 -0700 Subject: [PATCH 10/25] Change intent from out to inout to match fortran. --- physics/sfc_drv_ruc.meta | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/physics/sfc_drv_ruc.meta b/physics/sfc_drv_ruc.meta index 141b8fc6ff..8b38b202f2 100644 --- a/physics/sfc_drv_ruc.meta +++ b/physics/sfc_drv_ruc.meta @@ -697,7 +697,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = in + intent = inout optional = F [snoalb] standard_name = upper_bound_on_max_albedo_over_deep_snow @@ -731,7 +731,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = in + intent = inout optional = F [smcwlt2] standard_name = volume_fraction_of_condensed_water_in_soil_at_wilting_point @@ -893,7 +893,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = in + intent = inout optional = F [weasd_ice] standard_name = water_equivalent_accumulated_snow_depth_over_ice @@ -992,7 +992,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout optional = F [tsurf_lnd] standard_name = surface_skin_temperature_after_iteration_over_land @@ -1055,7 +1055,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout optional = F [evap_lnd] standard_name = kinematic_surface_upward_latent_heat_flux_over_land @@ -1064,7 +1064,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout optional = F [hflx_lnd] standard_name = kinematic_surface_upward_sensible_heat_flux_over_land @@ -1073,7 +1073,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout optional = F [runof] standard_name = surface_runoff_flux @@ -1082,7 +1082,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout optional = F [runoff] standard_name = total_runoff @@ -1109,7 +1109,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout optional = F [cm_lnd] standard_name = surface_drag_coefficient_for_momentum_in_air_over_land @@ -1136,7 +1136,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout optional = F [evcw] standard_name = canopy_upward_latent_heat_flux @@ -1145,7 +1145,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout optional = F [stm] standard_name = soil_moisture_content @@ -1244,7 +1244,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout optional = F [evap_ice] standard_name = kinematic_surface_upward_latent_heat_flux_over_ice @@ -1253,7 +1253,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout optional = F [ep1d_ice] standard_name = surface_upward_potential_latent_heat_flux_over_ice @@ -1271,7 +1271,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout optional = F [cm_ice] standard_name = surface_drag_coefficient_for_momentum_in_air_over_ice @@ -1307,7 +1307,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout optional = F [sbsno] standard_name = snow_deposition_sublimation_upward_latent_heat_flux @@ -1316,7 +1316,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout optional = F [cmm_lnd] standard_name = surface_drag_wind_speed_for_momentum_in_air_over_land @@ -1325,7 +1325,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout optional = F [chh_lnd] standard_name = surface_drag_mass_flux_for_heat_and_moisture_in_air_over_land @@ -1334,7 +1334,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout optional = F [cmm_ice] standard_name = surface_drag_wind_speed_for_momentum_in_air_over_ice @@ -1343,7 +1343,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout optional = F [chh_ice] standard_name = surface_drag_mass_flux_for_heat_and_moisture_in_air_over_ice @@ -1352,7 +1352,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout optional = F [flag_iter] standard_name = flag_for_iteration From 1223d7af8ec61a755573da6645b3c17269ce8e01 Mon Sep 17 00:00:00 2001 From: Julie Schramm Date: Wed, 3 Mar 2021 13:39:35 -0700 Subject: [PATCH 11/25] Fix intent statements as requested by Dom. --- physics/GFS_MP_generic.F90 | 4 ++-- physics/GFS_MP_generic.meta | 6 +++--- physics/GFS_SCNV_generic.F90 | 2 +- physics/GFS_SCNV_generic.meta | 8 ++++---- physics/cires_ugwp.F90 | 2 +- physics/cires_ugwp.meta | 6 +++--- physics/cs_conv.F90 | 2 +- physics/gfdl_sfc_layer.F90 | 5 +++-- physics/gfdl_sfc_layer.meta | 6 +++--- physics/m_micro_interstitial.F90 | 2 +- physics/m_micro_interstitial.meta | 2 +- physics/module_MYJSFC_wrapper.F90 | 2 +- physics/module_MYJSFC_wrapper.meta | 14 +++++++------- physics/mp_fer_hires.F90 | 6 +++--- physics/mp_fer_hires.meta | 6 +++--- physics/sfc_drv_ruc.F90 | 3 ++- physics/sfc_drv_ruc.meta | 2 +- 17 files changed, 40 insertions(+), 38 deletions(-) diff --git a/physics/GFS_MP_generic.F90 b/physics/GFS_MP_generic.F90 index ce8291ee25..435a80509b 100644 --- a/physics/GFS_MP_generic.F90 +++ b/physics/GFS_MP_generic.F90 @@ -22,8 +22,8 @@ subroutine GFS_MP_generic_pre_run(im, levs, ldiag3d, qdiag3d, do_aw, ntcw, nncl, real(kind=kind_phys), dimension(im, levs), intent(in) :: gt0 real(kind=kind_phys), dimension(im, levs, ntrac), intent(in) :: gq0 - real(kind=kind_phys), dimension(im, levs), intent(out) :: save_t, save_qv - real(kind=kind_phys), dimension(im, levs, ntrac), intent(out) :: save_q + real(kind=kind_phys), dimension(im, levs), intent(inout) :: save_t, save_qv + real(kind=kind_phys), dimension(im, levs, ntrac), intent(inout) :: save_q character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/GFS_MP_generic.meta b/physics/GFS_MP_generic.meta index b9c9b87ad8..f833c08b1f 100644 --- a/physics/GFS_MP_generic.meta +++ b/physics/GFS_MP_generic.meta @@ -96,7 +96,7 @@ dimensions = (horizontal_loop_extent,vertical_dimension) type = real kind = kind_phys - intent = out + intent = inout optional = F [save_qv] standard_name = water_vapor_specific_humidity_save @@ -105,7 +105,7 @@ dimensions = (horizontal_loop_extent,vertical_dimension) type = real kind = kind_phys - intent = out + intent = inout optional = F [save_q] standard_name = tracer_concentration_save @@ -114,7 +114,7 @@ dimensions = (horizontal_loop_extent,vertical_dimension,number_of_tracers) type = real kind = kind_phys - intent = out + intent = inout optional = F [errmsg] standard_name = ccpp_error_message diff --git a/physics/GFS_SCNV_generic.F90 b/physics/GFS_SCNV_generic.F90 index 1b95585db9..ae8fac5f9f 100644 --- a/physics/GFS_SCNV_generic.F90 +++ b/physics/GFS_SCNV_generic.F90 @@ -25,7 +25,7 @@ subroutine GFS_SCNV_generic_pre_run (im, levs, ldiag3d, qdiag3d, gu0, gv0, gt0, logical, intent(in) :: ldiag3d, qdiag3d, flag_for_scnv_generic_tend real(kind=kind_phys), dimension(im,levs), intent(in) :: gu0, gv0, gt0, gq0_water_vapor - real(kind=kind_phys), dimension(im,levs), intent(out) :: save_u, save_v, save_t, save_qv + real(kind=kind_phys), dimension(im,levs), intent(inout) :: save_u, save_v, save_t, save_qv character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/GFS_SCNV_generic.meta b/physics/GFS_SCNV_generic.meta index 3c0e2db0c2..dea2f039c0 100644 --- a/physics/GFS_SCNV_generic.meta +++ b/physics/GFS_SCNV_generic.meta @@ -82,7 +82,7 @@ dimensions = (horizontal_loop_extent,vertical_dimension) type = real kind = kind_phys - intent = out + intent = inout optional = F [save_v] standard_name = y_wind_save @@ -91,7 +91,7 @@ dimensions = (horizontal_loop_extent,vertical_dimension) type = real kind = kind_phys - intent = out + intent = inout optional = F [save_t] standard_name = air_temperature_save @@ -100,7 +100,7 @@ dimensions = (horizontal_loop_extent,vertical_dimension) type = real kind = kind_phys - intent = out + intent = inout optional = F [save_qv] standard_name = water_vapor_specific_humidity_save @@ -109,7 +109,7 @@ dimensions = (horizontal_loop_extent,vertical_dimension) type = real kind = kind_phys - intent = out + intent = inout optional = F [flag_for_scnv_generic_tend] standard_name = flag_for_generic_shallow_convection_tendency diff --git a/physics/cires_ugwp.F90 b/physics/cires_ugwp.F90 index 672a2ac812..6aab7ed160 100644 --- a/physics/cires_ugwp.F90 +++ b/physics/cires_ugwp.F90 @@ -188,7 +188,7 @@ subroutine cires_ugwp_run(do_ugwp, me, master, im, levs, ntrac, dtp, kdt, lonr logical, intent(in) :: ldiag3d, lssav ! These arrays only allocated if ldiag_ugwp = .true. - real(kind=kind_phys), intent(out), dimension(:,:) :: du3dt_mtb, du3dt_ogw, du3dt_tms + real(kind=kind_phys), intent(inout), dimension(:,:) :: du3dt_mtb, du3dt_ogw, du3dt_tms real(kind=kind_phys), intent(inout), dimension(im, levs):: dudt, dvdt, dtdt diff --git a/physics/cires_ugwp.meta b/physics/cires_ugwp.meta index d809e38306..e2afbf70f6 100644 --- a/physics/cires_ugwp.meta +++ b/physics/cires_ugwp.meta @@ -697,7 +697,7 @@ dimensions = (horizontal_loop_extent,vertical_dimension) type = real kind = kind_phys - intent = out + intent = inout optional = F [du3dt_ogw] standard_name = time_integral_of_change_in_x_wind_due_to_orographic_gravity_wave_drag @@ -706,7 +706,7 @@ dimensions = (horizontal_loop_extent,vertical_dimension) type = real kind = kind_phys - intent = out + intent = inout optional = F [du3dt_tms] standard_name = time_integral_of_change_in_x_wind_due_to_turbulent_orographic_form_drag @@ -715,7 +715,7 @@ dimensions = (horizontal_loop_extent,vertical_dimension) type = real kind = kind_phys - intent = out + intent = inout optional = F [dudt] standard_name = tendency_of_x_wind_due_to_model_physics diff --git a/physics/cs_conv.F90 b/physics/cs_conv.F90 index d56ff020fe..36e9c454c5 100644 --- a/physics/cs_conv.F90 +++ b/physics/cs_conv.F90 @@ -1,4 +1,4 @@ -u> \file cs_conv.F90 +!> \file cs_conv.F90 !! This file contains the Chikira-Sugiyama Convection scheme. module cs_conv_pre diff --git a/physics/gfdl_sfc_layer.F90 b/physics/gfdl_sfc_layer.F90 index 93e38c982b..35f81501f7 100644 --- a/physics/gfdl_sfc_layer.F90 +++ b/physics/gfdl_sfc_layer.F90 @@ -144,8 +144,9 @@ subroutine gfdl_sfc_layer_run (im, nsoil, km, xlat, xlon, flag_iter, lsm, & znt_ocn, znt_lnd, znt_ice, cdm_ocn, cdm_lnd, cdm_ice, & stress_ocn, stress_lnd, stress_ice, rib_ocn, rib_lnd, rib_ice, & fm_ocn, fm_lnd, fm_ice, fh_ocn, fh_lnd, fh_ice, fh2_ocn, fh2_lnd, & - fh2_ice, ch_ocn, ch_lnd, ch_ice, fm10_ocn, fm10_lnd, fm10_ice, & - qss_ocn, qss_lnd, qss_ice + fh2_ice, ch_ocn, ch_lnd, ch_ice, fm10_ocn, fm10_lnd, fm10_ice + + real(kind=kind_phys), intent(out), dimension(im) :: qss_ocn, qss_lnd, qss_ice character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/gfdl_sfc_layer.meta b/physics/gfdl_sfc_layer.meta index a9829fec3e..c70040745e 100644 --- a/physics/gfdl_sfc_layer.meta +++ b/physics/gfdl_sfc_layer.meta @@ -783,7 +783,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = inout + intent = out optional = F [qss_lnd] standard_name = surface_specific_humidity_over_land @@ -792,7 +792,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = inout + intent = out optional = F [qss_ice] standard_name = surface_specific_humidity_over_ice @@ -801,7 +801,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = inout + intent = out optional = F [errmsg] standard_name = ccpp_error_message diff --git a/physics/m_micro_interstitial.F90 b/physics/m_micro_interstitial.F90 index 61f92db60c..9cfb6f56e8 100644 --- a/physics/m_micro_interstitial.F90 +++ b/physics/m_micro_interstitial.F90 @@ -175,7 +175,7 @@ subroutine m_micro_post_run( & real(kind=kind_phys), intent(inout) :: qrn(1:im,1:levs) real(kind=kind_phys), intent(inout) :: qsnw(1:im,1:levs) real(kind=kind_phys), intent(inout) :: qgl(1:im,1:levs) - real(kind=kind_phys), intent(inout) :: gq0_ice(1:im,1:levs) + real(kind=kind_phys), intent(in ) :: gq0_ice(1:im,1:levs) real(kind=kind_phys), intent(out ) :: gq0_rain(1:im,1:levs) real(kind=kind_phys), intent(out ) :: gq0_snow(1:im,1:levs) real(kind=kind_phys), intent(out ) :: gq0_graupel(1:im,1:levs) diff --git a/physics/m_micro_interstitial.meta b/physics/m_micro_interstitial.meta index 7961cb2db7..2cc3d3a9a7 100644 --- a/physics/m_micro_interstitial.meta +++ b/physics/m_micro_interstitial.meta @@ -392,7 +392,7 @@ dimensions = (horizontal_loop_extent,vertical_dimension) type = real kind = kind_phys - intent = inout + intent = in optional = F [gq0_rain] standard_name = rain_water_mixing_ratio_updated_by_physics diff --git a/physics/module_MYJSFC_wrapper.F90 b/physics/module_MYJSFC_wrapper.F90 index e3dcf41112..f46291a461 100644 --- a/physics/module_MYJSFC_wrapper.F90 +++ b/physics/module_MYJSFC_wrapper.F90 @@ -102,7 +102,7 @@ SUBROUTINE myjsfc_wrapper_run( & & phy_myj_a1u, phy_myj_a1t, phy_myj_a1q real(kind=kind_phys),dimension(im),intent(inout) :: & & pblh, zorl, ustar, rib - real(kind=kind_phys),dimension(im),intent(out) :: & + real(kind=kind_phys),dimension(im),intent(inout) :: & & cm, ch, stress, ffm, ffh, fm10, fh2 real(kind=kind_phys), dimension(im), intent(inout) :: & & landfrac, lakefrac, oceanfrac, fice diff --git a/physics/module_MYJSFC_wrapper.meta b/physics/module_MYJSFC_wrapper.meta index 7c1afed2f4..d2623fdacf 100644 --- a/physics/module_MYJSFC_wrapper.meta +++ b/physics/module_MYJSFC_wrapper.meta @@ -379,7 +379,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout optional = F [ch] standard_name = surface_drag_coefficient_for_heat_and_moisture_in_air @@ -388,7 +388,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout optional = F [stress] standard_name = surface_wind_stress @@ -397,7 +397,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout optional = F [ffm] standard_name = Monin_Obukhov_similarity_function_for_momentum @@ -406,7 +406,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout optional = F [ffh] standard_name = Monin_Obukhov_similarity_function_for_heat @@ -415,7 +415,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout optional = F [fm10] standard_name = Monin_Obukhov_similarity_function_for_momentum_at_10m @@ -424,7 +424,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout optional = F [fh2] standard_name = Monin_Obukhov_similarity_function_for_heat_at_2m @@ -433,7 +433,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout optional = F [landfrac] standard_name = land_area_fraction diff --git a/physics/mp_fer_hires.F90 b/physics/mp_fer_hires.F90 index 606b18df44..fd6f76a4d3 100644 --- a/physics/mp_fer_hires.F90 +++ b/physics/mp_fer_hires.F90 @@ -54,9 +54,9 @@ subroutine mp_fer_hires_init(ncol, nlev, dtp, imp_physics, & logical, intent(in) :: restart character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg - real(kind_phys), intent(out), optional :: f_ice(1:ncol,1:nlev) - real(kind_phys), intent(out), optional :: f_rain(1:ncol,1:nlev) - real(kind_phys), intent(out), optional :: f_rimef(1:ncol,1:nlev) + real(kind_phys), intent(out) :: f_ice(1:ncol,1:nlev) + real(kind_phys), intent(out) :: f_rain(1:ncol,1:nlev) + real(kind_phys), intent(out) :: f_rimef(1:ncol,1:nlev) ! Local variables diff --git a/physics/mp_fer_hires.meta b/physics/mp_fer_hires.meta index 6db03801a0..20412d8a61 100644 --- a/physics/mp_fer_hires.meta +++ b/physics/mp_fer_hires.meta @@ -64,7 +64,7 @@ type = real kind = kind_phys intent = out - optional = T + optional = F [f_rain] standard_name = fraction_of_rain_water_cloud long_name = fraction of rain water cloud @@ -73,7 +73,7 @@ type = real kind = kind_phys intent = out - optional = T + optional = F [f_rimef] standard_name = rime_factor long_name = rime factor @@ -82,7 +82,7 @@ type = real kind = kind_phys intent = out - optional = T + optional = F [mpicomm] standard_name = mpi_comm long_name = MPI communicator diff --git a/physics/sfc_drv_ruc.F90 b/physics/sfc_drv_ruc.F90 index 240393221c..606019b61b 100644 --- a/physics/sfc_drv_ruc.F90 +++ b/physics/sfc_drv_ruc.F90 @@ -344,7 +344,8 @@ subroutine lsm_ruc_run & ! inputs ! --- in/out: integer, dimension(im), intent(inout) :: soiltyp, vegtype real (kind=kind_phys), dimension(lsoil_ruc), intent(in) :: zs - real (kind=kind_phys), dimension(im), intent(inout) :: srflag, & + real (kind=kind_phys), dimension(im), intent(in) :: srflag + real (kind=kind_phys), dimension(im), intent(inout) :: & & canopy, trans, smcwlt2, smcref2, & ! for land & weasd_lnd, snwdph_lnd, tskin_lnd, & diff --git a/physics/sfc_drv_ruc.meta b/physics/sfc_drv_ruc.meta index 8b38b202f2..ed7e7676ca 100644 --- a/physics/sfc_drv_ruc.meta +++ b/physics/sfc_drv_ruc.meta @@ -697,7 +697,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = inout + intent = in optional = F [snoalb] standard_name = upper_bound_on_max_albedo_over_deep_snow From bfa9a65a5e6b7430c40a7d1dc84a3efe57da140f Mon Sep 17 00:00:00 2001 From: Julie Schramm Date: Tue, 6 Apr 2021 11:37:40 -0600 Subject: [PATCH 12/25] Fix more out of order variables and mismatched intents. --- physics/GFS_stochastics.meta | 122 +++++++++++++++++------------------ physics/dcyc2.meta | 18 +++--- physics/rrtmgp_lw_pre.meta | 18 +++--- physics/sfc_noahmp_drv.meta | 2 +- 4 files changed, 80 insertions(+), 80 deletions(-) diff --git a/physics/GFS_stochastics.meta b/physics/GFS_stochastics.meta index 26dcfd47e1..9ca532e72d 100644 --- a/physics/GFS_stochastics.meta +++ b/physics/GFS_stochastics.meta @@ -40,46 +40,6 @@ kind = kind_phys intent = in optional = F -[ntcw] - standard_name = index_for_liquid_cloud_condensate - long_name = tracer index for cloud condensate (or liquid water) - units = index - dimensions = () - type = integer - intent = in - optional = F -[ntiw] - standard_name = index_for_ice_cloud_condensate - long_name = tracer index for ice water - units = index - dimensions = () - intent = in - optional = F - type = integer -[ntrw] - standard_name = index_for_rain_water - long_name = tracer index for rain water - units = index - dimensions = () - type = integer - intent = in - optional = F -[ntsw] - standard_name = index_for_snow_water - long_name = tracer index for snow water - units = index - dimensions = () - type = integer - intent = in - optional = F -[ntgl] - standard_name = index_for_graupel - long_name = tracer index for graupel - units = index - dimensions = () - type = integer - intent = in - optional = F [do_sppt] standard_name = flag_for_stochastic_physics_perturbations long_name = flag for stochastic physics perturbations @@ -307,18 +267,18 @@ kind = kind_phys intent = in optional = F -[qgrs_iw] - standard_name = ice_water_mixing_ratio - long_name = moist mixing ratio of cloud ice +[qgrs_sw] + standard_name = snow_water_mixing_ratio + long_name = moist mixing ratio of snow units = kg kg-1 dimensions = (horizontal_loop_extent,vertical_dimension) type = real kind = kind_phys intent = in optional = F -[qgrs_sw] - standard_name = snow_water_mixing_ratio - long_name = moist mixing ratio of snow +[qgrs_iw] + standard_name = ice_water_mixing_ratio + long_name = moist mixing ratio of cloud ice units = kg kg-1 dimensions = (horizontal_loop_extent,vertical_dimension) type = real @@ -370,6 +330,15 @@ kind = kind_phys intent = inout optional = F +[dtdtnp] + standard_name = tendency_of_air_temperature_to_withold_from_sppt + long_name = temp. change from physics that should not be perturbed by sppt + units = K s-1 + dimensions = (horizontal_loop_extent,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F [gq0_cw] standard_name = cloud_condensed_water_mixing_ratio_updated_by_physics long_name = cloud condensed water mixing ratio updated by physics @@ -388,18 +357,18 @@ kind = kind_phys intent = inout optional = F -[gq0_iw] - standard_name = ice_water_mixing_ratio_updated_by_physics - long_name = moist mixing ratio of cloud ice updated by physics +[gq0_sw] + standard_name = snow_water_mixing_ratio_updated_by_physics + long_name = moist mixing ratio of snow updated by physics units = kg kg-1 dimensions = (horizontal_loop_extent,vertical_dimension) type = real kind = kind_phys intent = inout optional = F -[gq0_sw] - standard_name = snow_water_mixing_ratio_updated_by_physics - long_name = moist mixing ratio of snow updated by physics +[gq0_iw] + standard_name = ice_water_mixing_ratio_updated_by_physics + long_name = moist mixing ratio of cloud ice updated by physics units = kg kg-1 dimensions = (horizontal_loop_extent,vertical_dimension) type = real @@ -415,15 +384,6 @@ kind = kind_phys intent = inout optional = F -[dtdtnp] - standard_name = tendency_of_air_temperature_to_withold_from_sppt - long_name = temp. change from physics that should not be perturbed by sppt - units = K s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F [rain] standard_name = lwe_thickness_of_precipitation_amount_on_dynamics_timestep long_name = total rain at this time step @@ -531,6 +491,46 @@ kind = kind_phys intent = in optional = F +[ntcw] + standard_name = index_for_liquid_cloud_condensate + long_name = tracer index for cloud condensate (or liquid water) + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntrw] + standard_name = index_for_rain_water + long_name = tracer index for rain water + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntsw] + standard_name = index_for_snow_water + long_name = tracer index for snow water + units = index + dimensions = () + type = integer + intent = in + optional = F +[ntiw] + standard_name = index_for_ice_cloud_condensate + long_name = tracer index for ice water + units = index + dimensions = () + intent = in + optional = F + type = integer +[ntgl] + standard_name = index_for_graupel + long_name = tracer index for graupel + units = index + dimensions = () + type = integer + intent = in + optional = F [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/dcyc2.meta b/physics/dcyc2.meta index d291da91d2..656183d949 100644 --- a/physics/dcyc2.meta +++ b/physics/dcyc2.meta @@ -370,15 +370,6 @@ kind = kind_phys intent = in optional = F -[dtdt] - standard_name = tendency_of_air_temperature_due_to_model_physics - long_name = total radiative heating rate at current time - units = K s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout - optional = F [pert_radtend] standard_name = flag_for_stochastic_radiative_heating_perturbations long_name = flag for stochastic radiative heating perturbations @@ -403,6 +394,15 @@ type = logical intent = in optional = F +[dtdt] + standard_name = tendency_of_air_temperature_due_to_model_physics + long_name = total radiative heating rate at current time + units = K s-1 + dimensions = (horizontal_loop_extent,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F [dtdtnp] standard_name = tendency_of_air_temperature_to_withold_from_sppt long_name = temp. change from physics that should not be perturbed by sppt diff --git a/physics/rrtmgp_lw_pre.meta b/physics/rrtmgp_lw_pre.meta index 5446580df4..f2773fddad 100644 --- a/physics/rrtmgp_lw_pre.meta +++ b/physics/rrtmgp_lw_pre.meta @@ -104,6 +104,15 @@ kind = kind_phys intent = in optional = F +[sfc_emiss_byband] + standard_name = surface_emissivity_in_each_RRTMGP_LW_band + long_name = surface emissivity in each RRTMGP LW band + units = none + dimensions = (number_of_lw_bands_rrtmgp,horizontal_loop_extent) + type = real + kind = kind_phys + intent = out + optional = F [emiss] standard_name = surface_emissivity_lsm long_name = surface emissivity from lsm @@ -122,15 +131,6 @@ kind = kind_phys intent = out optional = F -[sfc_emiss_byband] - standard_name = surface_emissivity_in_each_RRTMGP_LW_band - long_name = surface emissivity in each RRTMGP LW band - units = none - dimensions = (number_of_lw_bands_rrtmgp,horizontal_loop_extent) - type = real - kind = kind_phys - intent = out - optional = F [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/sfc_noahmp_drv.meta b/physics/sfc_noahmp_drv.meta index c0a6393fa0..f1dbbf1ad4 100644 --- a/physics/sfc_noahmp_drv.meta +++ b/physics/sfc_noahmp_drv.meta @@ -320,7 +320,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = in + intent = inout optional = F [flag_iter] standard_name = flag_for_iteration From a8e6ec947220fccfc3b86072405f58b73194774d Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Wed, 7 Apr 2021 08:55:29 -0600 Subject: [PATCH 13/25] Convert explicit dimensions of intent(in) variables to assumed-size dimensions --- physics/GFS_GWD_generic.F90 | 4 +- physics/GFS_MP_generic.F90 | 69 +++--- physics/GFS_cloud_diagnostics.F90 | 8 +- physics/GFS_phys_time_vary.fv3.meta | 1 - physics/GFS_rrtmg_pre.F90 | 70 +++--- physics/GFS_rrtmg_setup.F90 | 2 +- physics/GFS_rrtmgp_cloud_overlap_pre.F90 | 14 +- physics/GFS_rrtmgp_setup.F90 | 4 +- physics/GFS_rrtmgp_sw_pre.F90 | 18 +- physics/GFS_stochastics.F90 | 48 ++-- physics/GFS_surface_composites.F90 | 62 ++--- physics/GFS_surface_generic.F90 | 80 +++---- physics/GFS_surface_loop_control.F90 | 20 +- physics/GFS_time_vary_pre.fv3.F90 | 2 +- physics/GFS_time_vary_pre.scm.F90 | 2 +- physics/cs_conv.F90 | 58 ++--- physics/cu_gf_driver.F90 | 54 ++--- physics/dcyc2.f | 20 +- physics/gfdl_cloud_microphys.F90 | 28 +-- physics/gfdl_fv_sat_adj.F90 | 44 ++-- physics/gfdl_sfc_layer.F90 | 16 +- physics/gwdc.f | 13 +- physics/gwdps.f | 22 +- physics/m_micro.F90 | 15 +- physics/m_micro_interstitial.F90 | 32 +-- physics/module_MYJPBL_wrapper.F90 | 36 +-- physics/module_MYJSFC_wrapper.F90 | 20 +- physics/module_MYNNPBL_wrapper.F90 | 20 +- physics/mp_fer_hires.F90 | 44 ++-- physics/mp_thompson.F90 | 44 ++-- physics/ozphys.f | 2 +- physics/rrtmg_lw_pre.F90 | 4 +- physics/rrtmg_sw_post.F90 | 14 +- physics/rrtmg_sw_pre.F90 | 14 +- physics/sfc_cice.f | 8 +- physics/sfc_drv_ruc.F90 | 48 ++-- physics/sfc_noah_wrfv4.F90 | 17 +- physics/sfc_noah_wrfv4_interstitial.F90 | 44 ++-- physics/sfc_noahmp_drv.F90 | 279 ++++++++++++----------- physics/sfc_noahmp_drv.meta | 8 + physics/sfc_nst.f | 11 +- physics/shinhongvdif.F90 | 20 +- physics/ugwpv1_gsldrag.F90 | 65 +++--- physics/unified_ugwp.F90 | 48 ++-- 44 files changed, 729 insertions(+), 723 deletions(-) diff --git a/physics/GFS_GWD_generic.F90 b/physics/GFS_GWD_generic.F90 index 65b207311f..7f1cf63031 100644 --- a/physics/GFS_GWD_generic.F90 +++ b/physics/GFS_GWD_generic.F90 @@ -30,10 +30,10 @@ subroutine GFS_GWD_generic_pre_run( & implicit none integer, intent(in) :: im, levs, nmtvr - real(kind=kind_phys), intent(in) :: mntvar(im,nmtvr) + real(kind=kind_phys), intent(in) :: mntvar(:,:) real(kind=kind_phys), intent(out) :: & - & oc(:), oa4(:,:), clx(:,:), & + & oc(:), oa4(:,:), clx(:,:), & & varss(:), ocss(:), oa4ss(:,:), clxss(:,:), & & theta(:), sigma(:), gamma(:), elvmax(:) diff --git a/physics/GFS_MP_generic.F90 b/physics/GFS_MP_generic.F90 index 672be5ba6b..776d6b286d 100644 --- a/physics/GFS_MP_generic.F90 +++ b/physics/GFS_MP_generic.F90 @@ -12,18 +12,19 @@ end subroutine GFS_MP_generic_pre_init !> \section arg_table_GFS_MP_generic_pre_run Argument Table !! \htmlinclude GFS_MP_generic_pre_run.html !! - subroutine GFS_MP_generic_pre_run(im, levs, ldiag3d, qdiag3d, do_aw, ntcw, nncl, ntrac, gt0, gq0, save_t, save_qv, save_q, errmsg, errflg) + subroutine GFS_MP_generic_pre_run(im, levs, ldiag3d, qdiag3d, do_aw, ntcw, nncl, & + ntrac, gt0, gq0, save_t, save_qv, save_q, errmsg, errflg) ! use machine, only: kind_phys implicit none - integer, intent(in) :: im, levs, ntcw, nncl, ntrac - logical, intent(in) :: ldiag3d, qdiag3d, do_aw - real(kind=kind_phys), dimension(im, levs), intent(in) :: gt0 - real(kind=kind_phys), dimension(im, levs, ntrac), intent(in) :: gq0 + integer, intent(in) :: im, levs, ntcw, nncl, ntrac + logical, intent(in) :: ldiag3d, qdiag3d, do_aw + real(kind=kind_phys), dimension(:,:), intent(in) :: gt0 + real(kind=kind_phys), dimension(:,:,:), intent(in) :: gq0 - real(kind=kind_phys), dimension(im, levs), intent(inout) :: save_t, save_qv - real(kind=kind_phys), dimension(im, levs, ntrac), intent(inout) :: save_q + real(kind=kind_phys), dimension(:,:), intent(inout) :: save_t, save_qv + real(kind=kind_phys), dimension(:,:,:), intent(inout) :: save_q character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -100,42 +101,42 @@ subroutine GFS_MP_generic_post_run(im, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac, integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_mg, imp_physics_fer_hires logical, intent(in) :: cal_pre, lssav, ldiag3d, qdiag3d, cplflx, cplchm - real(kind=kind_phys), intent(in) :: dtf, frain, con_g - real(kind=kind_phys), dimension(im), intent(in) :: rain1, xlat, xlon, tsfc - real(kind=kind_phys), dimension(im), intent(inout) :: ice, snow, graupel, rainc - real(kind=kind_phys), dimension(im), intent(in) :: rain0, ice0, snow0, graupel0 - real(kind=kind_phys), dimension(im,nrcm), intent(in) :: rann - real(kind=kind_phys), dimension(im,levs), intent(in) :: gt0, prsl, save_t, save_qv, del - real(kind=kind_phys), dimension(im,levs+1), intent(in) :: prsi, phii - real(kind=kind_phys), dimension(im,levs,ntrac), intent(in) :: gq0 - - real(kind=kind_phys), dimension(im), intent(in ) :: sr - real(kind=kind_phys), dimension(im), intent(inout) :: rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, & + real(kind=kind_phys), intent(in) :: dtf, frain, con_g + real(kind=kind_phys), dimension(:), intent(in) :: rain1, xlat, xlon, tsfc + real(kind=kind_phys), dimension(:), intent(inout) :: ice, snow, graupel, rainc + real(kind=kind_phys), dimension(:), intent(in) :: rain0, ice0, snow0, graupel0 + real(kind=kind_phys), dimension(:,:), intent(in) :: rann + real(kind=kind_phys), dimension(:,:), intent(in) :: gt0, prsl, save_t, save_qv, del + real(kind=kind_phys), dimension(:,:), intent(in) :: prsi, phii + real(kind=kind_phys), dimension(:,:,:), intent(in) :: gq0 + + real(kind=kind_phys), dimension(:), intent(in ) :: sr + real(kind=kind_phys), dimension(:), intent(inout) :: rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, & srflag, cnvprcp, totprcp, totice, totsnw, totgrp, cnvprcpb, & totprcpb, toticeb, totsnwb, totgrpb, rain_cpl, rainc_cpl, & snow_cpl, pwat - real(kind=kind_phys), dimension(:,:), intent(inout) :: dt3dt ! only if ldiag3d - real(kind=kind_phys), dimension(:,:), intent(inout) :: dq3dt ! only if ldiag3d and qdiag3d + real(kind=kind_phys), dimension(:,:), intent(inout) :: dt3dt ! only if ldiag3d + real(kind=kind_phys), dimension(:,:), intent(inout) :: dq3dt ! only if ldiag3d and qdiag3d ! Stochastic physics / surface perturbations - real(kind=kind_phys), dimension(im), intent(inout) :: drain_cpl - real(kind=kind_phys), dimension(im), intent(inout) :: dsnow_cpl + real(kind=kind_phys), dimension(:), intent(inout) :: drain_cpl + real(kind=kind_phys), dimension(:), intent(inout) :: dsnow_cpl ! Rainfall variables previous time step integer, intent(in) :: lsm, lsm_ruc, lsm_noahmp - real(kind=kind_phys), dimension(im), intent(inout) :: raincprv - real(kind=kind_phys), dimension(im), intent(inout) :: rainncprv - real(kind=kind_phys), dimension(im), intent(inout) :: iceprv - real(kind=kind_phys), dimension(im), intent(inout) :: snowprv - real(kind=kind_phys), dimension(im), intent(inout) :: graupelprv - real(kind=kind_phys), dimension(im), intent(inout) :: draincprv - real(kind=kind_phys), dimension(im), intent(inout) :: drainncprv - real(kind=kind_phys), dimension(im), intent(inout) :: diceprv - real(kind=kind_phys), dimension(im), intent(inout) :: dsnowprv - real(kind=kind_phys), dimension(im), intent(inout) :: dgraupelprv - - real(kind=kind_phys), intent(in) :: dtp + real(kind=kind_phys), dimension(:), intent(inout) :: raincprv + real(kind=kind_phys), dimension(:), intent(inout) :: rainncprv + real(kind=kind_phys), dimension(:), intent(inout) :: iceprv + real(kind=kind_phys), dimension(:), intent(inout) :: snowprv + real(kind=kind_phys), dimension(:), intent(inout) :: graupelprv + real(kind=kind_phys), dimension(:), intent(inout) :: draincprv + real(kind=kind_phys), dimension(:), intent(inout) :: drainncprv + real(kind=kind_phys), dimension(:), intent(inout) :: diceprv + real(kind=kind_phys), dimension(:), intent(inout) :: dsnowprv + real(kind=kind_phys), dimension(:), intent(inout) :: dgraupelprv + + real(kind=kind_phys), intent(in) :: dtp ! CCPP error handling character(len=*), intent(out) :: errmsg diff --git a/physics/GFS_cloud_diagnostics.F90 b/physics/GFS_cloud_diagnostics.F90 index c7b92c4ba5..5aa5dbfa60 100644 --- a/physics/GFS_cloud_diagnostics.F90 +++ b/physics/GFS_cloud_diagnostics.F90 @@ -41,7 +41,7 @@ end subroutine GFS_cloud_diagnostics_init !! subroutine GFS_cloud_diagnostics_run(nCol, nLev, lsswr, lslwr, lat, de_lgth, p_lay, & cld_frac, p_lev, deltaZ, cloud_overlap_param, precip_overlap_param, con_pi, & - mbota, mtopa, cldsa, errmsg, errflg) + mtopa, mbota, cldsa, errmsg, errflg) implicit none ! Inputs @@ -59,7 +59,7 @@ subroutine GFS_cloud_diagnostics_run(nCol, nLev, lsswr, lslwr, lat, de_lgth, p_l real(kind_phys), dimension(:,:), intent(in) :: & p_lay, & ! Pressure at model-layer cld_frac ! Total cloud fraction - real(kind_phys), dimension(nCol,nLev+1), intent(in) :: & + real(kind_phys), dimension(:,:), intent(in) :: & p_lev ! Pressure at model interfaces real(kind_phys), dimension(:,:), intent(in) :: & deltaZ, & ! Layer thickness (km) @@ -80,7 +80,7 @@ subroutine GFS_cloud_diagnostics_run(nCol, nLev, lsswr, lslwr, lat, de_lgth, p_l ! Local variables integer i,id,iCol,iLay,icld real(kind_phys) :: tem1 - real(kind_phys),dimension(nCol,NK_CLDS+1) :: ptop1 + real(kind_phys),dimension(:,:) :: ptop1 real(kind_phys),dimension(:) :: rlat real(kind_phys),dimension(:,:) :: cldcnv @@ -136,7 +136,7 @@ subroutine hml_cloud_diagnostics_initialize(imp_physics, imp_physics_fer_hires, integer, intent(in) :: & nLev, & ! Number of vertical-layers mpi_rank - real(kind_phys), dimension(nLev+1), intent(in) :: & + real(kind_phys), dimension(:), intent(in) :: & sigmainit ! Outputs integer, intent(out) :: & diff --git a/physics/GFS_phys_time_vary.fv3.meta b/physics/GFS_phys_time_vary.fv3.meta index 06192eb6af..1f9bf08ed3 100644 --- a/physics/GFS_phys_time_vary.fv3.meta +++ b/physics/GFS_phys_time_vary.fv3.meta @@ -1672,7 +1672,6 @@ dimensions = (horizontal_dimension) type = real kind = kind_phys - active = (flag_for_nsstm_run > 0) intent = inout optional = F [tsfc] diff --git a/physics/GFS_rrtmg_pre.F90 b/physics/GFS_rrtmg_pre.F90 index 0c9eaf3f0d..6ec6497a8f 100644 --- a/physics/GFS_rrtmg_pre.F90 +++ b/physics/GFS_rrtmg_pre.F90 @@ -122,54 +122,54 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, & real(kind=kind_phys), dimension(:,:), intent(inout) :: effrl_inout, & effri_inout, & effrs_inout - real(kind=kind_phys), dimension(im,lm+LTP), intent(inout) :: clouds1, & + real(kind=kind_phys), dimension(:,:), intent(inout) :: clouds1, & clouds2, clouds3, & clouds4, clouds5 - integer, intent(out) :: kd, kt, kb + integer, intent(out) :: kd, kt, kb - integer, dimension(im,3), intent(out) :: mbota, mtopa + integer, dimension(im,3), intent(out) :: mbota, mtopa - real(kind=kind_phys), intent(out) :: raddt + real(kind=kind_phys), intent(out) :: raddt - real(kind=kind_phys), dimension(im), intent(out) :: tsfg, tsfa - real(kind=kind_phys), dimension(im), intent(out) :: de_lgth, & - alb1d + real(kind=kind_phys), dimension(:), intent(out) :: tsfg, tsfa + real(kind=kind_phys), dimension(:), intent(out) :: de_lgth, & + alb1d - real(kind=kind_phys), dimension(im,lm+LTP), intent(out) :: delp, dz, & - plyr, tlyr, & - qlyr, olyr + real(kind=kind_phys), dimension(:,:), intent(out) :: delp, dz, & + plyr, tlyr, & + qlyr, olyr - real(kind=kind_phys), dimension(im,lm+1+LTP), intent(out) :: plvl, tlvl + real(kind=kind_phys), dimension(:,;), intent(out) :: plvl, tlvl - real(kind=kind_phys), dimension(im,lm+LTP), intent(out) :: gasvmr_co2, & - gasvmr_n2o, & - gasvmr_ch4, & - gasvmr_o2, & - gasvmr_co, & - gasvmr_cfc11,& - gasvmr_cfc12,& - gasvmr_cfc22,& - gasvmr_ccl4,& - gasvmr_cfc113 - real(kind=kind_phys), dimension(im,NSPC1), intent(out) :: aerodp - real(kind=kind_phys), dimension(im,lm+LTP), intent(out) :: clouds6, & - clouds7, & - clouds8, & - clouds9, & - cldfra - real(kind=kind_phys), dimension(im,5), intent(out) :: cldsa + real(kind=kind_phys), dimension(:,:), intent(out) :: gasvmr_co2, & + gasvmr_n2o, & + gasvmr_ch4, & + gasvmr_o2, & + gasvmr_co, & + gasvmr_cfc11,& + gasvmr_cfc12,& + gasvmr_cfc22,& + gasvmr_ccl4,& + gasvmr_cfc113 + real(kind=kind_phys), dimension(:,:), intent(out) :: aerodp + real(kind=kind_phys), dimension(:,:), intent(out) :: clouds6, & + clouds7, & + clouds8, & + clouds9, & + cldfra + real(kind=kind_phys), dimension(:,:), intent(out) :: cldsa - real(kind=kind_phys), dimension(im,lm+LTP,NBDSW), intent(out) :: faersw1,& - faersw2,& - faersw3 + real(kind=kind_phys), dimension(:,:,:), intent(out) :: faersw1,& + faersw2,& + faersw3 - real(kind=kind_phys), dimension(im,lm+LTP,NBDLW), intent(out) :: faerlw1,& - faerlw2,& - faerlw3 - real(kind=kind_phys), dimension(im,lm+LTP), intent(out) :: alpha + real(kind=kind_phys), dimension(:,:,:), intent(out) :: faerlw1,& + faerlw2,& + faerlw3 + real(kind=kind_phys), dimension(:,:), intent(out) :: alpha character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/GFS_rrtmg_setup.F90 b/physics/GFS_rrtmg_setup.F90 index 85ffe7d670..368a5ed4dd 100644 --- a/physics/GFS_rrtmg_setup.F90 +++ b/physics/GFS_rrtmg_setup.F90 @@ -165,7 +165,7 @@ subroutine GFS_rrtmg_setup_init ( & implicit none ! interface variables - real (kind=kind_phys), intent(in) :: si(levr+1) + real (kind=kind_phys), intent(in) :: si(:) integer, intent(in) :: levr integer, intent(in) :: ictm integer, intent(in) :: isol diff --git a/physics/GFS_rrtmgp_cloud_overlap_pre.F90 b/physics/GFS_rrtmgp_cloud_overlap_pre.F90 index 05b8ee79e0..a2a575ac64 100644 --- a/physics/GFS_rrtmgp_cloud_overlap_pre.F90 +++ b/physics/GFS_rrtmgp_cloud_overlap_pre.F90 @@ -27,7 +27,7 @@ subroutine GFS_rrtmgp_cloud_overlap_pre_run(nCol, nLev, yearlen, doSWrad, doLWra implicit none ! Inputs - integer, intent(in) :: & + integer, intent(in) :: & nCol, & ! Number of horizontal grid points nLev, & ! Number of vertical layers yearlen, & ! Length of current year (365/366) WTF? @@ -39,7 +39,7 @@ subroutine GFS_rrtmgp_cloud_overlap_pre_run(nCol, nLev, yearlen, doSWrad, doLWra idcor_con, & ! Flag for decorrelation-length. Use constant value idcor_hogan, & ! Flag for decorrelation-length. (https://rmets.onlinelibrary.wiley.com/doi/full/10.1002/qj.647) idcor_oreopoulos ! Flag for decorrelation-length. (10.5194/acp-12-9097-2012) - logical, intent(in) :: & + logical, intent(in) :: & doSWrad, & ! Call SW radiation? doLWrad ! Call LW radiation real(kind_phys), intent(in) :: & @@ -49,19 +49,19 @@ subroutine GFS_rrtmgp_cloud_overlap_pre_run(nCol, nLev, yearlen, doSWrad, doLWra con_rd, & ! Physical constant: gas-constant for dry air con_epsq, & ! Physical constant: Minimum value for specific humidity dcorr_con ! Decorrelation-length (used if idcor = idcor_con) - real(kind_phys), dimension(nCol), intent(in) :: & + real(kind_phys), dimension(:), intent(in) :: & lat ! Latitude - real(kind_phys), dimension(nCol,nLev), intent(in) :: & + real(kind_phys), dimension(:,:), intent(in) :: & tv_lay, & ! Virtual temperature (K) p_lay, & ! Pressure at model-layers (Pa) cld_frac ! Total cloud fraction - real(kind_phys), dimension(nCol,nLev+1), intent(in) :: & + real(kind_phys), dimension(:,:), intent(in) :: & p_lev ! Pressure at model-level interfaces (Pa) ! Outputs - real(kind_phys), dimension(nCol),intent(out) :: & + real(kind_phys), dimension(:),intent(out) :: & de_lgth ! Decorrelation length - real(kind_phys), dimension(nCol,nLev),intent(out) :: & + real(kind_phys), dimension(:,:),intent(out) :: & cloud_overlap_param, & ! Cloud-overlap parameter precip_overlap_param, & ! Precipitation overlap parameter deltaZc ! Layer thickness (from layer-centers)(km) diff --git a/physics/GFS_rrtmgp_setup.F90 b/physics/GFS_rrtmgp_setup.F90 index 308456e06d..a55c84ae7c 100644 --- a/physics/GFS_rrtmgp_setup.F90 +++ b/physics/GFS_rrtmgp_setup.F90 @@ -56,14 +56,14 @@ subroutine GFS_rrtmgp_setup_init(imp_physics, imp_physics_fer_hires, imp_physics imp_physics_zhao_carr, & ! Flag for zhao-carr scheme imp_physics_zhao_carr_pdf, & ! Flag for zhao-carr+PDF scheme imp_physics_mg ! Flag for MG scheme - real(kind_phys), dimension(levr+1), intent(in) :: & + real(kind_phys), dimension(:), intent(in) :: & si integer, intent(in) :: levr, ictm, isol, ico2, iaer, ialb, iems, & ntcw, num_p3d, ntoz, iovr, isubc_sw, isubc_lw, & icliq_sw, iflip, me logical, intent(in) :: & crick_proof, ccnorm, norad_precip - integer, intent(in), dimension(4) :: & + integer, intent(in), dimension(:) :: & idate ! Outputs diff --git a/physics/GFS_rrtmgp_sw_pre.F90 b/physics/GFS_rrtmgp_sw_pre.F90 index 4570805365..7a4e08d553 100644 --- a/physics/GFS_rrtmgp_sw_pre.F90 +++ b/physics/GFS_rrtmgp_sw_pre.F90 @@ -41,15 +41,15 @@ subroutine GFS_rrtmgp_sw_pre_run(me, nCol, nLev, lndp_type, n_var_lndp,lndp_var_ nLev, & ! Number of vertical layers n_var_lndp, & ! Number of surface variables perturbed lndp_type ! Type of land perturbations scheme used - character(len=3), dimension(n_var_lndp), intent(in) :: & + character(len=3), dimension(:), intent(in) :: & lndp_var_list - real(kind_phys), dimension(n_var_lndp), intent(in) :: & + real(kind_phys), dimension(:), intent(in) :: & lndp_prt_list logical,intent(in) :: & doSWrad ! Call RRTMGP SW radiation? real(kind_phys), intent(in) :: & solhr ! Time in hours after 00z at the current timestep - real(kind_phys), dimension(nCol), intent(in) :: & + real(kind_phys), dimension(:), intent(in) :: & lsmask, & ! Landmask: sea/land/ice=0/1/2 lon, & ! Longitude coslat, & ! Cosine(latitude) @@ -75,25 +75,25 @@ subroutine GFS_rrtmgp_sw_pre_run(me, nCol, nLev, lndp_type, n_var_lndp,lndp_var_ albivis, & ! surface albedo from lsm (diffuse,vis) (frac) albinir ! surface albedo from lsm (diffuse,nir) (frac) - real(kind_phys), dimension(nCol,n_var_lndp), intent(in) :: & + real(kind_phys), dimension(:,:), intent(in) :: & sfc_wts ! Weights for stochastic surface physics perturbation () - real(kind_phys), dimension(nCol,nLev),intent(in) :: & + real(kind_phys), dimension(:,:),intent(in) :: & p_lay, & ! Layer pressure tv_lay, & ! Layer virtual-temperature relhum ! Layer relative-humidity - real(kind_phys), dimension(nCol,nLev+1),intent(in) :: & + real(kind_phys), dimension(:,:),intent(in) :: & p_lev ! Pressure @ layer interfaces (Pa) ! Outputs integer, intent(out) :: & nday ! Number of daylit points - integer, dimension(ncol), intent(out) :: & + integer, dimension(:), intent(out) :: & idxday ! Indices for daylit points - real(kind_phys), dimension(ncol), intent(inout) :: & + real(kind_phys), dimension(:), intent(inout) :: & coszen, & ! Cosine of SZA coszdg, & ! Cosine of SZA, daytime sfc_alb_dif ! Mean surface diffused (nIR+uvvis) sw albedo - real(kind_phys), dimension(sw_gas_props%get_nband(),ncol), intent(out) :: & + real(kind_phys), dimension(:,:), intent(out) :: & sfc_alb_nir_dir, & ! Surface albedo (direct) sfc_alb_nir_dif, & ! Surface albedo (diffuse) sfc_alb_uvvis_dir, & ! Surface albedo (direct) diff --git a/physics/GFS_stochastics.F90 b/physics/GFS_stochastics.F90 index b3dda08dad..671d33271d 100644 --- a/physics/GFS_stochastics.F90 +++ b/physics/GFS_stochastics.F90 @@ -55,7 +55,7 @@ subroutine GFS_stochastics_run (im, km, kdt, delt, do_sppt, pert_mp, use_zmtnblc logical, intent(in) :: use_zmtnblck logical, intent(in) :: do_shum logical, intent(in) :: do_skeb - real(kind_phys), dimension(1:im), intent(in) :: zmtnblck + real(kind_phys), dimension(:), intent(in) :: zmtnblck ! sppt_wts only allocated if do_sppt == .true. real(kind_phys), dimension(:,:), intent(inout) :: sppt_wts ! skebu_wts, skebv_wts only allocated if do_skeb == .true. @@ -64,24 +64,24 @@ subroutine GFS_stochastics_run (im, km, kdt, delt, do_sppt, pert_mp, use_zmtnblc ! shum_wts only allocated if do_shum == .true. real(kind_phys), dimension(:,:), intent(in) :: shum_wts ! inverse/flipped weights are always allocated - real(kind_phys), dimension(1:im,1:km), intent(inout) :: sppt_wts_inv - real(kind_phys), dimension(1:im,1:km), intent(inout) :: skebu_wts_inv - real(kind_phys), dimension(1:im,1:km), intent(inout) :: skebv_wts_inv - real(kind_phys), dimension(1:im,1:km), intent(inout) :: shum_wts_inv - real(kind_phys), dimension(1:im,1:km), intent(in) :: diss_est - real(kind_phys), dimension(1:im,1:km), intent(in) :: ugrs - real(kind_phys), dimension(1:im,1:km), intent(in) :: vgrs - real(kind_phys), dimension(1:im,1:km), intent(in) :: tgrs - real(kind_phys), dimension(1:im,1:km), intent(in) :: qgrs_wv + real(kind_phys), dimension(:,:), intent(inout) :: sppt_wts_inv + real(kind_phys), dimension(:,:), intent(inout) :: skebu_wts_inv + real(kind_phys), dimension(:,:), intent(inout) :: skebv_wts_inv + real(kind_phys), dimension(:,:), intent(inout) :: shum_wts_inv + real(kind_phys), dimension(:,:), intent(in) :: diss_est + real(kind_phys), dimension(:,:), intent(in) :: ugrs + real(kind_phys), dimension(:,:), intent(in) :: vgrs + real(kind_phys), dimension(:,:), intent(in) :: tgrs + real(kind_phys), dimension(:,:), intent(in) :: qgrs_wv real(kind_phys), dimension(:,:), intent(in) :: qgrs_cw real(kind_phys), dimension(:,:), intent(in) :: qgrs_rw real(kind_phys), dimension(:,:), intent(in) :: qgrs_sw real(kind_phys), dimension(:,:), intent(in) :: qgrs_iw real(kind_phys), dimension(:,:), intent(in) :: qgrs_gl - real(kind_phys), dimension(1:im,1:km), intent(inout) :: gu0 - real(kind_phys), dimension(1:im,1:km), intent(inout) :: gv0 - real(kind_phys), dimension(1:im,1:km), intent(inout) :: gt0 - real(kind_phys), dimension(1:im,1:km), intent(inout) :: gq0_wv + real(kind_phys), dimension(:,:), intent(inout) :: gu0 + real(kind_phys), dimension(:,:), intent(inout) :: gv0 + real(kind_phys), dimension(:,:), intent(inout) :: gt0 + real(kind_phys), dimension(:,:), intent(inout) :: gq0_wv real(kind_phys), dimension(:,:), intent(inout) :: gq0_cw real(kind_phys), dimension(:,:), intent(inout) :: gq0_rw real(kind_phys), dimension(:,:), intent(inout) :: gq0_sw @@ -93,13 +93,13 @@ subroutine GFS_stochastics_run (im, km, kdt, delt, do_sppt, pert_mp, use_zmtnblc integer, intent(in) :: ntiw integer, intent(in) :: ntgl real(kind_phys), dimension(:,:), intent(inout) :: dtdtnp - real(kind_phys), dimension(1:im), intent(in) :: rain - real(kind_phys), dimension(1:im), intent(in) :: rainc - real(kind_phys), dimension(1:im), intent(inout) :: tprcp - real(kind_phys), dimension(1:im), intent(inout) :: totprcp - real(kind_phys), dimension(1:im), intent(inout) :: cnvprcp - real(kind_phys), dimension(1:im), intent(inout) :: totprcpb - real(kind_phys), dimension(1:im), intent(inout) :: cnvprcpb + real(kind_phys), dimension(:), intent(in) :: rain + real(kind_phys), dimension(:), intent(in) :: rainc + real(kind_phys), dimension(:), intent(inout) :: tprcp + real(kind_phys), dimension(:), intent(inout) :: totprcp + real(kind_phys), dimension(:), intent(inout) :: cnvprcp + real(kind_phys), dimension(:), intent(inout) :: totprcpb + real(kind_phys), dimension(:), intent(inout) :: cnvprcpb logical, intent(in) :: cplflx ! rain_cpl, snow_cpl only allocated if cplflx == .true. or cplchm == .true. real(kind_phys), dimension(:), intent(inout) :: rain_cpl @@ -107,9 +107,9 @@ subroutine GFS_stochastics_run (im, km, kdt, delt, do_sppt, pert_mp, use_zmtnblc ! drain_cpl, dsnow_cpl only allocated if cplflx == .true. or cplchm == .true. real(kind_phys), dimension(:), intent(in) :: drain_cpl real(kind_phys), dimension(:), intent(in) :: dsnow_cpl - real(kind_phys), dimension(1:km), intent(in) :: si - real(kind_phys), dimension(1:km), intent(inout) :: vfact_ca - real(kind_phys), dimension(1:im), intent(in) :: ca1 + real(kind_phys), dimension(:), intent(in) :: si + real(kind_phys), dimension(:), intent(inout) :: vfact_ca + real(kind_phys), dimension(:), intent(in) :: ca1 character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/GFS_surface_composites.F90 b/physics/GFS_surface_composites.F90 index d0f1829dfa..ac9bdfe5f6 100644 --- a/physics/GFS_surface_composites.F90 +++ b/physics/GFS_surface_composites.F90 @@ -38,26 +38,26 @@ subroutine GFS_surface_composites_pre_run (im, lkm, frac_grid, flag_cice, cplflx implicit none ! Interface variables - integer, intent(in ) :: im, lkm - logical, intent(in ) :: frac_grid, cplflx, cplwav2atm - logical, dimension(im), intent(inout) :: flag_cice - logical, dimension(im), intent(inout) :: dry, icy, lake, ocean, wet - real(kind=kind_phys), dimension(im), intent(in ) :: landfrac, lakefrac, lakedepth, oceanfrac - real(kind=kind_phys), dimension(im), intent(inout) :: cice, hice - real(kind=kind_phys), dimension(im), intent( out) :: frland - real(kind=kind_phys), dimension(im), intent(in ) :: zorl, snowd, tprcp, uustar, weasd, qss, hflx - - real(kind=kind_phys), dimension(im), intent(inout) :: zorlo, zorll, zorli, tsfc, tsfco, tsfcl, tisfc, tsurf - real(kind=kind_phys), dimension(im), intent(inout) :: snowd_wat, snowd_lnd, snowd_ice, tprcp_wat, & + integer, intent(in ) :: im, lkm + logical, intent(in ) :: frac_grid, cplflx, cplwav2atm + logical, dimension(:), intent(inout) :: flag_cice + logical, dimension(:), intent(inout) :: dry, icy, lake, ocean, wet + real(kind=kind_phys), dimension(:), intent(in ) :: landfrac, lakefrac, lakedepth, oceanfrac + real(kind=kind_phys), dimension(:), intent(inout) :: cice, hice + real(kind=kind_phys), dimension(:), intent( out) :: frland + real(kind=kind_phys), dimension(:), intent(in ) :: zorl, snowd, tprcp, uustar, weasd, qss, hflx + + real(kind=kind_phys), dimension(:), intent(inout) :: zorlo, zorll, zorli, tsfc, tsfco, tsfcl, tisfc, tsurf + real(kind=kind_phys), dimension(:), intent(inout) :: snowd_wat, snowd_lnd, snowd_ice, tprcp_wat, & tprcp_lnd, tprcp_ice, zorl_wat, zorl_lnd, zorl_ice, tsfc_wat, tsfc_lnd, tsfc_ice, tsurf_wat, & tsurf_lnd, tsurf_ice, uustar_wat, uustar_lnd, uustar_ice, weasd_wat, weasd_lnd, weasd_ice, & qss_wat, qss_lnd, qss_ice, hflx_wat, hflx_lnd, hflx_ice, ep1d_ice, gflx_ice - real(kind=kind_phys), dimension(im), intent( out) :: tice - real(kind=kind_phys), intent(in ) :: tgice - integer, dimension(im), intent(inout) :: islmsk, islmsk_cice - real(kind=kind_phys), dimension(im), intent(in ) :: semis_rad - real(kind=kind_phys), dimension(im), intent(inout) :: semis_wat, semis_lnd, semis_ice, slmsk - real(kind=kind_phys), intent(in ) :: min_lakeice, min_seaice + real(kind=kind_phys), dimension(:), intent( out) :: tice + real(kind=kind_phys), intent(in ) :: tgice + integer, dimension(:), intent(inout) :: islmsk, islmsk_cice + real(kind=kind_phys), dimension(:), intent(in ) :: semis_rad + real(kind=kind_phys), dimension(:), intent(inout) :: semis_wat, semis_lnd, semis_ice, slmsk + real(kind=kind_phys), intent(in ) :: min_lakeice, min_seaice real(kind=kind_phys), parameter :: timin = 173.0_kind_phys ! minimum temperature allowed for snow/ice @@ -277,12 +277,12 @@ subroutine GFS_surface_composites_inter_run (im, dry, icy, wet, semis_wat, semis implicit none ! Interface variables - integer, intent(in ) :: im - logical, dimension(im), intent(in ) :: dry, icy, wet - real(kind=kind_phys), dimension(im), intent(in ) :: semis_wat, semis_lnd, semis_ice, adjsfcdlw, & - adjsfcdsw, adjsfcnsw - real(kind=kind_phys), dimension(im), intent(inout) :: gabsbdlw_lnd, gabsbdlw_ice, gabsbdlw_wat - real(kind=kind_phys), dimension(im), intent(out) :: adjsfcusw + integer, intent(in ) :: im + logical, dimension(:), intent(in ) :: dry, icy, wet + real(kind=kind_phys), dimension(:), intent(in ) :: semis_wat, semis_lnd, semis_ice, adjsfcdlw, & + adjsfcdsw, adjsfcnsw + real(kind=kind_phys), dimension(:), intent(inout) :: gabsbdlw_lnd, gabsbdlw_ice, gabsbdlw_wat + real(kind=kind_phys), dimension(:), intent(out) :: adjsfcusw ! CCPP error handling character(len=*), intent(out) :: errmsg @@ -365,9 +365,9 @@ subroutine GFS_surface_composites_post_run ( integer, intent(in) :: im, kice, km logical, intent(in) :: cplflx, frac_grid, cplwav2atm - logical, dimension(im), intent(in) :: flag_cice, dry, wet, icy - integer, dimension(im), intent(in) :: islmsk - real(kind=kind_phys), dimension(im), intent(in) :: landfrac, lakefrac, oceanfrac, & + logical, dimension(:), intent(in) :: flag_cice, dry, wet, icy + integer, dimension(:), intent(in) :: islmsk + real(kind=kind_phys), dimension(:), intent(in) :: landfrac, lakefrac, oceanfrac, & zorl_wat, zorl_lnd, zorl_ice, cd_wat, cd_lnd, cd_ice, cdq_wat, cdq_lnd, cdq_ice, rb_wat, rb_lnd, rb_ice, stress_wat, & stress_lnd, stress_ice, ffmm_wat, ffmm_lnd, ffmm_ice, ffhh_wat, ffhh_lnd, ffhh_ice, uustar_wat, uustar_lnd, uustar_ice, & fm10_wat, fm10_lnd, fm10_ice, fh2_wat, fh2_lnd, fh2_ice, tsurf_wat, tsurf_lnd, tsurf_ice, cmm_wat, cmm_lnd, cmm_ice, & @@ -375,15 +375,15 @@ subroutine GFS_surface_composites_post_run ( snowd_wat, snowd_lnd, snowd_ice,tprcp_wat, tprcp_lnd, tprcp_ice, evap_wat, evap_lnd, evap_ice, hflx_wat, hflx_lnd, & hflx_ice, qss_wat, qss_lnd, qss_ice, tsfc_wat, tsfc_lnd, tsfc_ice - real(kind=kind_phys), dimension(im), intent(inout) :: zorl, zorlo, zorll, zorli, cd, cdq, rb, stress, ffmm, ffhh, uustar, fm10, & + real(kind=kind_phys), dimension(:), intent(inout) :: zorl, zorlo, zorll, zorli, cd, cdq, rb, stress, ffmm, ffhh, uustar, fm10, & fh2, tsurf, cmm, chh, gflx, ep1d, weasd, snowd, tprcp, evap, hflx, qss, tsfc, tsfco, tsfcl, tisfc - real(kind=kind_phys), dimension(im), intent(in ) :: tice ! interstitial sea ice temperature - real(kind=kind_phys), dimension(im), intent(inout) :: hice, cice + real(kind=kind_phys), dimension(:), intent(in ) :: tice ! interstitial sea ice temperature + real(kind=kind_phys), dimension(:), intent(inout) :: hice, cice real(kind=kind_phys), intent(in ) :: min_seaice - real(kind=kind_phys), dimension(im, kice), intent(in ) :: tiice - real(kind=kind_phys), dimension(im, km), intent(inout) :: stc + real(kind=kind_phys), dimension(:,:), intent(in ) :: tiice + real(kind=kind_phys), dimension(:,:), intent(inout) :: stc character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/GFS_surface_generic.F90 b/physics/GFS_surface_generic.F90 index 483eccdf8f..5896b83e25 100644 --- a/physics/GFS_surface_generic.F90 +++ b/physics/GFS_surface_generic.F90 @@ -39,48 +39,48 @@ subroutine GFS_surface_generic_pre_run (im, levs, vfrac, islmsk, isot, ivegsrc, ! Interface variables integer, intent(in) :: im, levs, isot, ivegsrc - integer, dimension(im), intent(in) :: islmsk - integer, dimension(im), intent(inout) :: soiltyp, vegtype, slopetyp + integer, dimension(:), intent(in) :: islmsk + integer, dimension(:), intent(inout) :: soiltyp, vegtype, slopetyp real(kind=kind_phys), intent(in) :: con_g - real(kind=kind_phys), dimension(im), intent(in) :: vfrac, stype, vtype, slope, prsik_1, prslk_1 + real(kind=kind_phys), dimension(:), intent(in) :: vfrac, stype, vtype, slope, prsik_1, prslk_1 - real(kind=kind_phys), dimension(im), intent(inout) :: tsfc - real(kind=kind_phys), dimension(im,levs), intent(in) :: phil + real(kind=kind_phys), dimension(:), intent(inout) :: tsfc + real(kind=kind_phys), dimension(:,:), intent(in) :: phil - real(kind=kind_phys), dimension(im), intent(inout) :: sigmaf, work3, tsurf, zlvl + real(kind=kind_phys), dimension(:), intent(inout) :: sigmaf, work3, tsurf, zlvl ! Stochastic physics / surface perturbations - real(kind=kind_phys), dimension(im), intent(out) :: drain_cpl - real(kind=kind_phys), dimension(im), intent(out) :: dsnow_cpl - real(kind=kind_phys), dimension(im), intent(in) :: rain_cpl - real(kind=kind_phys), dimension(im), intent(in) :: snow_cpl + real(kind=kind_phys), dimension(:), intent(out) :: drain_cpl + real(kind=kind_phys), dimension(:), intent(out) :: dsnow_cpl + real(kind=kind_phys), dimension(:), intent(in) :: rain_cpl + real(kind=kind_phys), dimension(:), intent(in) :: snow_cpl integer, intent(in) :: lndp_type integer, intent(in) :: n_var_lndp - character(len=3), dimension(n_var_lndp), intent(in) :: lndp_var_list - real(kind=kind_phys), dimension(n_var_lndp), intent(in) :: lndp_prt_list - real(kind=kind_phys), dimension(im,n_var_lndp), intent(in) :: sfc_wts - real(kind=kind_phys), dimension(im), intent(out) :: z01d - real(kind=kind_phys), dimension(im), intent(out) :: zt1d - real(kind=kind_phys), dimension(im), intent(out) :: bexp1d - real(kind=kind_phys), dimension(im), intent(out) :: xlai1d - real(kind=kind_phys), dimension(im), intent(out) :: vegf1d - real(kind=kind_phys), intent(out) :: lndp_vgf - real(kind=kind_phys), dimension(im,n_var_lndp), intent(inout) :: sfc_wts_inv + character(len=3), dimension(:), intent(in) :: lndp_var_list + real(kind=kind_phys), dimension(:), intent(in) :: lndp_prt_list + real(kind=kind_phys), dimension(:,:), intent(in) :: sfc_wts + real(kind=kind_phys), dimension(:), intent(out) :: z01d + real(kind=kind_phys), dimension(:), intent(out) :: zt1d + real(kind=kind_phys), dimension(:), intent(out) :: bexp1d + real(kind=kind_phys), dimension(:), intent(out) :: xlai1d + real(kind=kind_phys), dimension(:), intent(out) :: vegf1d + real(kind=kind_phys), intent(out) :: lndp_vgf + real(kind=kind_phys), dimension(:,:), intent(inout) :: sfc_wts_inv logical, intent(in) :: cplflx - real(kind=kind_phys), dimension(im), intent(in) :: slimskin_cpl - logical, dimension(im), intent(inout) :: flag_cice - integer, dimension(im), intent(out) :: islmsk_cice - real(kind=kind_phys), dimension(im), intent(in) :: & + real(kind=kind_phys), dimension(:), intent(in) :: slimskin_cpl + logical, dimension(:), intent(inout) :: flag_cice + integer, dimension(:), intent(out) :: islmsk_cice + real(kind=kind_phys), dimension(:), intent(in) :: & tisfc, tsfco, fice, hice - real(kind=kind_phys), dimension(im), intent(out) :: wind - real(kind=kind_phys), dimension(im), intent(in ) :: u1, v1 + real(kind=kind_phys), dimension(:), intent(out) :: wind + real(kind=kind_phys), dimension(:), intent(in ) :: u1, v1 ! surface wind enhancement due to convection - real(kind=kind_phys), dimension(im), intent(inout ) :: cnvwind + real(kind=kind_phys), dimension(:), intent(inout ) :: cnvwind ! - real(kind=kind_phys), dimension(im), intent(out) :: smcwlt2, smcref2 + real(kind=kind_phys), dimension(:), intent(out) :: smcwlt2, smcref2 ! CCPP error handling character(len=*), intent(out) :: errmsg @@ -222,29 +222,29 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplwav, lssav, icy, wet, dt integer, intent(in) :: im logical, intent(in) :: cplflx, cplwav, lssav - logical, dimension(im), intent(in) :: icy, wet + logical, dimension(:), intent(in) :: icy, wet real(kind=kind_phys), intent(in) :: dtf - real(kind=kind_phys), dimension(im), intent(in) :: ep1d, gflx, tgrs_1, qgrs_1, ugrs_1, vgrs_1, adjsfcdlw, adjsfcdsw, & + real(kind=kind_phys), dimension(:), intent(in) :: ep1d, gflx, tgrs_1, qgrs_1, ugrs_1, vgrs_1, adjsfcdlw, adjsfcdsw, & adjnirbmd, adjnirdfd, adjvisbmd, adjvisdfd, adjsfculw, adjsfculw_wat, adjnirbmu, adjnirdfu, adjvisbmu, adjvisdfu, & t2m, q2m, u10m, v10m, tsfc, tsfc_wat, pgr, xcosz, evbs, evcw, trans, sbsno, snowc, snohf - real(kind=kind_phys), dimension(im), intent(inout) :: epi, gfluxi, t1, q1, u1, v1, dlwsfci_cpl, dswsfci_cpl, dlwsfc_cpl, & - dswsfc_cpl, dnirbmi_cpl, dnirdfi_cpl, dvisbmi_cpl, dvisdfi_cpl, dnirbm_cpl, dnirdf_cpl, dvisbm_cpl, dvisdf_cpl, & - nlwsfci_cpl, nlwsfc_cpl, t2mi_cpl, q2mi_cpl, u10mi_cpl, v10mi_cpl, tsfci_cpl, psurfi_cpl, nnirbmi_cpl, nnirdfi_cpl, & - nvisbmi_cpl, nvisdfi_cpl, nswsfci_cpl, nswsfc_cpl, nnirbm_cpl, nnirdf_cpl, nvisbm_cpl, nvisdf_cpl, gflux, evbsa, & + real(kind=kind_phys), dimension(:), intent(inout) :: epi, gfluxi, t1, q1, u1, v1, dlwsfci_cpl, dswsfci_cpl, dlwsfc_cpl, & + dswsfc_cpl, dnirbmi_cpl, dnirdfi_cpl, dvisbmi_cpl, dvisdfi_cpl, dnirbm_cpl, dnirdf_cpl, dvisbm_cpl, dvisdf_cpl, & + nlwsfci_cpl, nlwsfc_cpl, t2mi_cpl, q2mi_cpl, u10mi_cpl, v10mi_cpl, tsfci_cpl, psurfi_cpl, nnirbmi_cpl, nnirdfi_cpl, & + nvisbmi_cpl, nvisdfi_cpl, nswsfci_cpl, nswsfc_cpl, nnirbm_cpl, nnirdf_cpl, nvisbm_cpl, nvisdf_cpl, gflux, evbsa, & evcwa, transa, sbsnoa, snowca, snohfa, ep - real(kind=kind_phys), dimension(im), intent(inout) :: runoff, srunoff - real(kind=kind_phys), dimension(im), intent(in) :: drain, runof + real(kind=kind_phys), dimension(:), intent(inout) :: runoff, srunoff + real(kind=kind_phys), dimension(:), intent(in) :: drain, runof ! For canopy heat storage logical, intent(in) :: lheatstrg real(kind=kind_phys), intent(in) :: z0fac, e0fac - real(kind=kind_phys), dimension(im), intent(in) :: zorl - real(kind=kind_phys), dimension(im), intent(in) :: hflx, evap - real(kind=kind_phys), dimension(im), intent(out) :: hflxq, evapq - real(kind=kind_phys), dimension(im), intent(out) :: hffac, hefac + real(kind=kind_phys), dimension(:), intent(in) :: zorl + real(kind=kind_phys), dimension(:), intent(in) :: hflx, evap + real(kind=kind_phys), dimension(:), intent(out) :: hflxq, evapq + real(kind=kind_phys), dimension(:), intent(out) :: hffac, hefac ! CCPP error handling variables character(len=*), intent(out) :: errmsg diff --git a/physics/GFS_surface_loop_control.F90 b/physics/GFS_surface_loop_control.F90 index afa34130d0..82c55c4ad8 100644 --- a/physics/GFS_surface_loop_control.F90 +++ b/physics/GFS_surface_loop_control.F90 @@ -15,11 +15,9 @@ end subroutine GFS_surface_loop_control_part1_finalize !> \brief Brief description of the subroutine !! -#if 0 !! \section arg_table_GFS_surface_loop_control_part1_run Arguments !! \htmlinclude GFS_surface_loop_control_part1_run.html !! -#endif !! \section general General Algorithm !! \section detailed Detailed Algorithm !! @{ @@ -31,10 +29,10 @@ subroutine GFS_surface_loop_control_part1_run (im, iter, wind, flag_guess, errms implicit none ! Interface variables - integer, intent(in) :: im - integer, intent(in) :: iter - real(kind=kind_phys), dimension(im), intent(in) :: wind - logical, dimension(im), intent(inout) :: flag_guess + integer, intent(in) :: im + integer, intent(in) :: iter + real(kind=kind_phys), dimension(:), intent(in) :: wind + logical, dimension(:), intent(inout) :: flag_guess character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -80,7 +78,7 @@ end subroutine GFS_surface_loop_control_part2_finalize !! \section detailed Detailed Algorithm !! @{ - subroutine GFS_surface_loop_control_part2_run (im, iter, wind, & + subroutine GFS_surface_loop_control_part2_run (im, iter, wind, & flag_guess, flag_iter, dry, wet, icy, nstf_name1, errmsg, errflg) use machine, only: kind_phys @@ -90,10 +88,10 @@ subroutine GFS_surface_loop_control_part2_run (im, iter, wind, & ! Interface variables integer, intent(in) :: im integer, intent(in) :: iter - real(kind=kind_phys), dimension(:), intent(in) :: wind - logical, dimension(:), intent(inout) :: flag_guess - logical, dimension(:), intent(inout) :: flag_iter - logical, dimension(:), intent(in) :: dry, wet, icy + real(kind=kind_phys), dimension(:), intent(in) :: wind + logical, dimension(:), intent(inout) :: flag_guess + logical, dimension(:), intent(inout) :: flag_iter + logical, dimension(:), intent(in) :: dry, wet, icy integer, intent(in) :: nstf_name1 character(len=*), intent(out) :: errmsg diff --git a/physics/GFS_time_vary_pre.fv3.F90 b/physics/GFS_time_vary_pre.fv3.F90 index 4d6617e361..8702c174f4 100644 --- a/physics/GFS_time_vary_pre.fv3.F90 +++ b/physics/GFS_time_vary_pre.fv3.F90 @@ -73,7 +73,7 @@ subroutine GFS_time_vary_pre_timestep_init (jdat, idat, dtp, lkm, lsm, lsm_noahm implicit none - integer, intent(in) :: idate(4) + integer, intent(in) :: idate(:) integer, intent(in) :: jdat(:), idat(:) integer, intent(in) :: lkm, lsm, lsm_noahmp, & nsswr, nslwr, me, & diff --git a/physics/GFS_time_vary_pre.scm.F90 b/physics/GFS_time_vary_pre.scm.F90 index 87b5f4bf61..fd1317dbcf 100644 --- a/physics/GFS_time_vary_pre.scm.F90 +++ b/physics/GFS_time_vary_pre.scm.F90 @@ -73,7 +73,7 @@ subroutine GFS_time_vary_pre_timestep_init (jdat, idat, dtp, lsm, lsm_noahmp, ns implicit none - integer, intent(in) :: idate(4) + integer, intent(in) :: idate(:) integer, intent(in) :: jdat(:), idat(:) integer, intent(in) :: lsm, lsm_noahmp, & nsswr, nslwr, me, & diff --git a/physics/cs_conv.F90 b/physics/cs_conv.F90 index 36e9c454c5..ff0770ad94 100644 --- a/physics/cs_conv.F90 +++ b/physics/cs_conv.F90 @@ -25,15 +25,15 @@ subroutine cs_conv_pre_run(im, levs, ntrac, ncld, q, clw1, clw2, & ! --- inputs integer, intent(in) :: im, levs, ntrac, ncld - real(r8), dimension(im,levs), intent(in) :: q - real(r8), dimension(im,levs), intent(in) :: clw1,clw2 - real(r8), dimension(im), intent(in) :: work1, work2 + real(r8), dimension(:,:), intent(in) :: q + real(r8), dimension(:,:), intent(in) :: clw1,clw2 + real(r8), dimension(:), intent(in) :: work1, work2 real(r8), intent(in) :: cs_parm1, cs_parm2 ! --- input/output - real(r8), dimension(ntrac-ncld+2), intent(out) :: fswtr, fscav - real(r8), dimension(im), intent(out) :: wcbmax - real(r8), dimension(im,levs), intent(out) :: save_q1,save_q2 + real(r8), dimension(:), intent(out) :: fswtr, fscav + real(r8), dimension(:), intent(out) :: wcbmax + real(r8), dimension(:,:), intent(out) :: save_q1,save_q2 ! save_q3 is not allocated for Zhao-Carr MP real(r8), dimension(:,:), intent(out) :: save_q3 @@ -91,10 +91,10 @@ subroutine cs_conv_post_run(im, kmax, do_aw, sigmatot, sigmafrac, errmsg, errflg ! --- inputs integer, intent(in) :: im, kmax logical, intent(in) :: do_aw - real(r8), dimension(im,kmax), intent(in) :: sigmatot + real(r8), dimension(:,:), intent(in) :: sigmatot ! --- input/output - real(r8), dimension(im,kmax), intent(out) :: sigmafrac + real(r8), dimension(:,:), intent(out) :: sigmafrac character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -295,44 +295,44 @@ subroutine cs_conv_run( IJSDIM , KMAX , ntracp1 , NN, & ! input arguments ! INTEGER, INTENT(IN) :: IJSDIM, KMAX, ntracp1, nn, NTR, mype, nctp, mp_phys, kdt, lat !! DD, for GFS, pass in - logical, intent(in) :: otspt(1:ntracp1,1:2)! otspt(:,1) - on/off switch for tracer transport by updraft and + logical, intent(in) :: otspt(:,:) ! otspt(:,1) - on/off switch for tracer transport by updraft and ! downdraft. should not include subgrid PDF and turbulence ! otspt(:,2) - on/off switch for tracer transport by subsidence ! should include subgrid PDF and turbulence - real(r8), intent(inout) :: t(IJSDIM,KMAX) ! temperature at mid-layer (K) - real(r8), intent(inout) :: q(IJSDIM,KMAX) ! water vapor array including moisture (kg/kg) - real(r8), intent(inout) :: clw(IJSDIM,KMAX,nn) ! tracer array including cloud condensate (kg/kg) - real(r8), intent(in) :: pap(IJSDIM,KMAX) ! pressure at mid-layer (Pa) - real(r8), intent(in) :: paph(IJSDIM,KMAX+1) ! pressure at boundaries (Pa) - real(r8), intent(in) :: zm(IJSDIM,KMAX) ! geopotential at mid-layer (m) - real(r8), intent(in) :: zi(IJSDIM,KMAX+1) ! geopotential at boundaries (m) - real(r8), intent(in) :: fscav(ntr), fswtr(ntr), wcbmaxm(ijsdim) + real(r8), intent(inout) :: t(:,:) ! temperature at mid-layer (K) + real(r8), intent(inout) :: q(:,:) ! water vapor array including moisture (kg/kg) + real(r8), intent(inout) :: clw(:,:,:) ! tracer array including cloud condensate (kg/kg) + real(r8), intent(in) :: pap(:,:) ! pressure at mid-layer (Pa) + real(r8), intent(in) :: paph(:,:) ! pressure at boundaries (Pa) + real(r8), intent(in) :: zm(:,:) ! geopotential at mid-layer (m) + real(r8), intent(in) :: zi(:,;) ! geopotential at boundaries (m) + real(r8), intent(in) :: fscav(:), fswtr(;), wcbmaxm(:) real(r8), intent(in) :: precz0in, preczhin, clmdin ! added for cs_convr - real(r8), intent(inout) :: u(IJSDIM,KMAX) ! zonal wind at mid-layer (m/s) - real(r8), intent(inout) :: v(IJSDIM,KMAX) ! meridional wind at mid-layer (m/s) + real(r8), intent(inout) :: u(:,:) ! zonal wind at mid-layer (m/s) + real(r8), intent(inout) :: v(:,:) ! meridional wind at mid-layer (m/s) - real(r8), intent(in) :: DELTA ! physics time step - real(r8), intent(in) :: DELTI ! dynamics time step (model time increment in seconds) + real(r8), intent(in) :: DELTA ! physics time step + real(r8), intent(in) :: DELTI ! dynamics time step (model time increment in seconds) logical, intent(in) :: do_aw, do_awdd, flx_form ! ! modified arguments ! - real(r8), intent(inout) :: CBMFX(IJSDIM,nctp) ! cloud base mass flux (kg/m2/s) + real(r8), intent(inout) :: CBMFX(:,:) ! cloud base mass flux (kg/m2/s) ! ! output arguments ! ! updraft, downdraft, and detrainment mass flux (kg/m2/s) - real(r8), intent(inout), dimension(IJSDIM,KMAX) :: ud_mf, dd_mf, dt_mf + real(r8), intent(inout), dimension(:,:) :: ud_mf, dd_mf, dt_mf - real(r8), intent(out) :: rain1(IJSDIM) ! lwe thickness of deep convective precipitation amount (m) + real(r8), intent(out) :: rain1(:) ! lwe thickness of deep convective precipitation amount (m) ! GJF* These variables are conditionally allocated depending on whether the ! Morrison-Gettelman microphysics is used, so they must be declared ! using assumed shape. - real(r8), intent(out), dimension(:,:) :: qlcn, qicn, w_upi,cnv_mfd, & - cnv_dqldt, clcn, cnv_fice, & - cnv_ndrop, cnv_nice, cf_upi + real(r8), intent(out), dimension(:,:) :: qlcn, qicn, w_upi,cnv_mfd, & + cnv_dqldt, clcn, cnv_fice, & + cnv_ndrop, cnv_nice, cf_upi ! *GJF integer, intent(in) :: lprnt, ipr integer, intent(inout) :: kcnv(ijsdim) ! zero if no deep convection and 1 otherwise @@ -341,8 +341,8 @@ subroutine cs_conv_run( IJSDIM , KMAX , ntracp1 , NN, & !DDsigma - output added for AW sigma diagnostics ! interface sigma and vertical velocity by cloud type (1=sfc) -! real(r8), intent(out), dimension(IJSDIM,KMAX,nctp) :: sigmai, vverti - real(r8), intent(out), dimension(IJSDIM,KMAX) :: sigma ! sigma sigma totaled over cloud type - on interfaces (1=sfc) +! real(r8), intent(out), dimension(:,:,:) :: sigmai, vverti + real(r8), intent(out), dimension(:,:) :: sigma ! sigma sigma totaled over cloud type - on interfaces (1=sfc) ! sigma terms in eq 91 and 92 ! real(r8), dimension(IJSDIM,KMAX) :: sfluxterm, qvfluxterm, condterm !DDsigma diff --git a/physics/cu_gf_driver.F90 b/physics/cu_gf_driver.F90 index 4445419126..48b40dfd8d 100644 --- a/physics/cu_gf_driver.F90 +++ b/physics/cu_gf_driver.F90 @@ -96,45 +96,47 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,cactiv, & logical, intent(in ) :: flag_for_scnv_generic_tend,flag_for_dcnv_generic_tend logical, intent(in ) :: ldiag3d,qdiag3d - real(kind=kind_phys), dimension( im , km ), intent(in ) :: forcet,forceqv_spechum,w,phil - real(kind=kind_phys), dimension( im , km ), intent(inout ) :: t,us,vs - real(kind=kind_phys), dimension( im , km ), intent(inout ) :: qci_conv - real(kind=kind_phys), dimension( im ) :: rand_mom,rand_vmas - real(kind=kind_phys), dimension( im,4 ) :: rand_clos - real(kind=kind_phys), dimension( im , km, 11 ) :: gdc,gdc2 - real(kind=kind_phys), dimension( im , km ), intent(out ) :: cnvw_moist,cnvc - real(kind=kind_phys), dimension( im , km ), intent(inout ) :: cliw, clcw - - real(kind=kind_phys), dimension( : , : ), intent(inout ) :: & + real(kind=kind_phys), dimension( : , : ), intent(in ) :: forcet,forceqv_spechum,w,phil + real(kind=kind_phys), dimension( : , : ), intent(inout ) :: t,us,vs + real(kind=kind_phys), dimension( : , : ), intent(inout ) :: qci_conv + real(kind=kind_phys), dimension( : , : ), intent(out ) :: cnvw_moist,cnvc + real(kind=kind_phys), dimension( : , : ), intent(inout ) :: cliw, clcw + + real(kind=kind_phys), dimension( : , : ), intent(inout ) :: & du3dt_SCNV,dv3dt_SCNV,dt3dt_SCNV,dq3dt_SCNV, & du3dt_DCNV,dv3dt_DCNV,dt3dt_DCNV,dq3dt_DCNV - integer, dimension (im), intent(out) :: hbot,htop,kcnv - integer, dimension (im), intent(in) :: xland - real(kind=kind_phys), dimension (im), intent(in) :: pbl - integer, dimension (im) :: tropics + integer, dimension (:), intent(out) :: hbot,htop,kcnv + integer, dimension (:), intent(in) :: xland + real(kind=kind_phys), dimension (:), intent(in) :: pbl + integer, dimension (:) :: tropics ! ruc variable - real(kind=kind_phys), dimension (im), intent(in) :: hfx2,qfx2,psuri - real(kind=kind_phys), dimension (im,km), intent(out) :: ud_mf,dd_mf,dt_mf - real(kind=kind_phys), dimension (im), intent(out) :: raincv,cld1d - real(kind=kind_phys), dimension (im,km), intent(in) :: t2di,p2di + real(kind=kind_phys), dimension (:), intent(in) :: hfx2,qfx2,psuri + real(kind=kind_phys), dimension (:,:), intent(out) :: ud_mf,dd_mf,dt_mf + real(kind=kind_phys), dimension (:), intent(out) :: raincv,cld1d + real(kind=kind_phys), dimension (:,:), intent(in) :: t2di,p2di ! Specific humidity from FV3 - real(kind=kind_phys), dimension (im,km), intent(in) :: qv2di_spechum - real(kind=kind_phys), dimension (im,km), intent(inout) :: qv_spechum + real(kind=kind_phys), dimension (:,:), intent(in) :: qv2di_spechum + real(kind=kind_phys), dimension (:,:), intent(inout) :: qv_spechum ! Local water vapor mixing ratios and cloud water mixing ratios - real(kind=kind_phys), dimension (im,km) :: qv2di, qv, forceqv, cnvw + real(kind=kind_phys), dimension (:,:) :: qv2di, qv, forceqv, cnvw ! - real(kind=kind_phys), dimension( im ),intent(in) :: garea + real(kind=kind_phys), dimension(:),intent(in) :: garea real(kind=kind_phys), intent(in ) :: dt integer, intent(in ) :: imfshalcnv + integer, dimension(:), intent(inout) :: cactiv + character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg -! define locally for now. - integer, dimension(im),intent(inout) :: cactiv + +! local variables integer, dimension(im) :: k22_shallow,kbcon_shallow,ktop_shallow - real(kind=kind_phys), dimension(im) :: ht - real(kind=kind_phys), dimension(im) :: dx + real(kind=kind_phys), dimension (im) :: rand_mom,rand_vmas + real(kind=kind_phys), dimension (im,4) :: rand_clos + real(kind=kind_phys), dimension (im,km,11) :: gdc,gdc2 + real(kind=kind_phys), dimension (im) :: ht + real(kind=kind_phys), dimension (im) :: dx real(kind=kind_phys), dimension (im,km) :: outt,outq,outqc,phh,subm,cupclw,cupclws real(kind=kind_phys), dimension (im,km) :: dhdt,zu,zus,zd,phf,zum,zdm,outum,outvm real(kind=kind_phys), dimension (im,km) :: outts,outqs,outqcs,outu,outv,outus,outvs diff --git a/physics/dcyc2.f b/physics/dcyc2.f index f29d593a3b..c8c8071afe 100644 --- a/physics/dcyc2.f +++ b/physics/dcyc2.f @@ -211,38 +211,38 @@ subroutine dcyc2t3_run & ! integer, intent(in) :: ipr ! logical lprnt - logical, dimension(im), intent(in) :: dry, icy, wet + logical, dimension(:), intent(in) :: dry, icy, wet logical, intent(in) :: use_LW_jacobian, pert_radtend logical, intent(in) :: do_sppt,ca_global real(kind=kind_phys), intent(in) :: solhr, slag, cdec, sdec, & & deltim, fhswr - real(kind=kind_phys), dimension(im), intent(in) :: & + real(kind=kind_phys), dimension(:), intent(in) :: & & sinlat, coslat, xlon, coszen, tf, tsflw, sfcdlw, & & sfcdsw, sfcnsw, sfculw, sfculw_jac - real(kind=kind_phys), dimension(im), intent(in) :: & + real(kind=kind_phys), dimension(:), intent(in) :: & & tsfc_lnd, tsfc_ice, tsfc_wat, & & sfcemis_lnd, sfcemis_ice, sfcemis_wat - real(kind=kind_phys), dimension(im), intent(in) :: & + real(kind=kind_phys), dimension(:), intent(in) :: & & sfcnirbmu, sfcnirdfu, sfcvisbmu, sfcvisdfu, & & sfcnirbmd, sfcnirdfd, sfcvisbmd, sfcvisdfd - real(kind=kind_phys), dimension(im,levs), intent(in) :: swh, hlw & - &, swhc, hlwc + real(kind=kind_phys), dimension(:,:), intent(in) :: swh, hlw & + &, swhc, hlwc ! --- input/output: - real(kind=kind_phys), dimension(im,levs), intent(inout) :: dtdt - real(kind=kind_phys), dimension(:,:), intent(inout) :: dtdtnp + real(kind=kind_phys), dimension(:,:), intent(inout) :: dtdt + real(kind=kind_phys), dimension(:,:), intent(inout) :: dtdtnp ! --- outputs: - real(kind=kind_phys), dimension(im), intent(out) :: & + real(kind=kind_phys), dimension(:), intent(out) :: & & adjsfcdsw, adjsfcnsw, adjsfcdlw, adjsfculw, xmu, xcosz, & & adjnirbmu, adjnirdfu, adjvisbmu, adjvisdfu, & & adjnirbmd, adjnirdfd, adjvisbmd, adjvisdfd - real(kind=kind_phys), dimension(im), intent(out) :: & + real(kind=kind_phys), dimension(:), intent(out) :: & & adjsfculw_lnd, adjsfculw_ice, adjsfculw_wat character(len=*), intent(out) :: errmsg diff --git a/physics/gfdl_cloud_microphys.F90 b/physics/gfdl_cloud_microphys.F90 index c41323ad53..9574fe59ea 100644 --- a/physics/gfdl_cloud_microphys.F90 +++ b/physics/gfdl_cloud_microphys.F90 @@ -135,29 +135,29 @@ subroutine gfdl_cloud_microphys_run( & ! interface variables integer, intent(in ) :: levs, im real(kind=kind_phys), intent(in ) :: con_g, con_fvirt, con_rd, con_eps - real(kind=kind_phys), intent(in ), dimension(1:im) :: frland, garea - integer, intent(in ), dimension(1:im) :: islmsk - real(kind=kind_phys), intent(inout), dimension(1:im,1:levs) :: gq0, gq0_ntcw, gq0_ntrw, gq0_ntiw, & + real(kind=kind_phys), intent(in ), dimension(:) :: frland, garea + integer, intent(in ), dimension(:) :: islmsk + real(kind=kind_phys), intent(inout), dimension(:,:) :: gq0, gq0_ntcw, gq0_ntrw, gq0_ntiw, & gq0_ntsw, gq0_ntgl, gq0_ntclamt - real(kind=kind_phys), intent(inout), dimension(1:im,1:levs) :: gt0, gu0, gv0 - real(kind=kind_phys), intent(in ), dimension(1:im,1:levs) :: vvl, prsl, del - real(kind=kind_phys), intent(in ), dimension(1:im,1:levs+1) :: phii + real(kind=kind_phys), intent(inout), dimension(:,:) :: gt0, gu0, gv0 + real(kind=kind_phys), intent(in ), dimension(:,:) :: vvl, prsl, del + real(kind=kind_phys), intent(in ), dimension(:,:) :: phii ! rain/snow/ice/graupel/precip amounts, fraction of frozen precip - real(kind_phys), intent(out ), dimension(1:im) :: rain0 - real(kind_phys), intent(out ), dimension(1:im) :: snow0 - real(kind_phys), intent(out ), dimension(1:im) :: ice0 - real(kind_phys), intent(out ), dimension(1:im) :: graupel0 - real(kind_phys), intent(out ), dimension(1:im) :: prcp0 - real(kind_phys), intent(out ), dimension(1:im) :: sr + real(kind_phys), intent(out ), dimension(:) :: rain0 + real(kind_phys), intent(out ), dimension(:) :: snow0 + real(kind_phys), intent(out ), dimension(:) :: ice0 + real(kind_phys), intent(out ), dimension(:) :: graupel0 + real(kind_phys), intent(out ), dimension(:) :: prcp0 + real(kind_phys), intent(out ), dimension(:) :: sr real(kind_phys), intent(in) :: dtp ! physics time step logical, intent (in) :: hydrostatic, phys_hydrostatic logical, intent (in) :: lradar - real(kind=kind_phys), intent(inout), dimension(1:im,1:levs) :: refl_10cm + real(kind=kind_phys), intent(inout), dimension(:,:) :: refl_10cm logical, intent (in) :: reset, effr_in - real(kind=kind_phys), intent(inout), dimension(1:im,1:levs) :: rew, rei, rer, res, reg + real(kind=kind_phys), intent(inout), dimension(:,:) :: rew, rei, rer, res, reg character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/gfdl_fv_sat_adj.F90 b/physics/gfdl_fv_sat_adj.F90 index 5cc3c91364..d10e9fe0f8 100644 --- a/physics/gfdl_fv_sat_adj.F90 +++ b/physics/gfdl_fv_sat_adj.F90 @@ -255,46 +255,46 @@ subroutine fv_sat_adj_run(mdt, zvir, is, ie, isd, ied, kmp, km, kmdelz, js, je, integer, intent(in) :: ng logical, intent(in) :: hydrostatic logical, intent(in) :: fast_mp_consv - real(kind=kind_dyn), intent(inout) :: te0_2d(is:ie, js:je) - real(kind=kind_dyn), intent( out) :: te0(isd:ied, jsd:jed, 1:km) + real(kind=kind_dyn), intent(inout) :: te0_2d(:,:) + real(kind=kind_dyn), intent( out) :: te0(:,:,;) ! If multi-gases physics are not used, ngas is one and qvi identical to qv integer, intent(in) :: ngas - real(kind=kind_dyn), intent(inout) :: qvi(isd:ied, jsd:jed, 1:km, 1:ngas) - real(kind=kind_dyn), intent(inout) :: qv(isd:ied, jsd:jed, 1:km) - real(kind=kind_dyn), intent(inout) :: ql(isd:ied, jsd:jed, 1:km) - real(kind=kind_dyn), intent(inout) :: qi(isd:ied, jsd:jed, 1:km) - real(kind=kind_dyn), intent(inout) :: qr(isd:ied, jsd:jed, 1:km) - real(kind=kind_dyn), intent(inout) :: qs(isd:ied, jsd:jed, 1:km) - real(kind=kind_dyn), intent(inout) :: qg(isd:ied, jsd:jed, 1:km) - real(kind=kind_dyn), intent(in) :: hs(isd:ied, jsd:jed) - real(kind=kind_dyn), intent(in) :: peln(is:ie, 1:km+1, js:je) + real(kind=kind_dyn), intent(inout) :: qvi(:,:,:,:) + real(kind=kind_dyn), intent(inout) :: qv(:,:,:) + real(kind=kind_dyn), intent(inout) :: ql(:,:,:) + real(kind=kind_dyn), intent(inout) :: qi(:,:,:) + real(kind=kind_dyn), intent(inout) :: qr(:,:,:) + real(kind=kind_dyn), intent(inout) :: qs(:,:,:) + real(kind=kind_dyn), intent(inout) :: qg(:,:,:) + real(kind=kind_dyn), intent(in) :: hs(:,:) + real(kind=kind_dyn), intent(in) :: peln(:,:,:) ! For hydrostatic build, kmdelz=1, otherwise kmdelz=km (see fv_arrays.F90) - real(kind=kind_dyn), intent(in) :: delz(is:ie, js:je, 1:kmdelz) - real(kind=kind_dyn), intent(in) :: delp(isd:ied, jsd:jed, 1:km) - real(kind=kind_dyn), intent(inout) :: pt(isd:ied, jsd:jed, 1:km) - real(kind=kind_dyn), intent(inout) :: pkz(is:ie, js:je, 1:km) + real(kind=kind_dyn), intent(in) :: delz(:,:) + real(kind=kind_dyn), intent(in) :: delp(:,:,:) + real(kind=kind_dyn), intent(inout) :: pt(:,:,:) + real(kind=kind_dyn), intent(inout) :: pkz(:,:,:) #ifdef USE_COND - real(kind=kind_dyn), intent(inout) :: q_con(isd:ied, jsd:jed, 1:km) + real(kind=kind_dyn), intent(inout) :: q_con(:,:,:) #else - real(kind=kind_dyn), intent(inout) :: q_con(isd:isd, jsd:jsd, 1) + real(kind=kind_dyn), intent(inout) :: q_con(:,:,:) #endif real(kind=kind_dyn), intent(in) :: akap #ifdef MOIST_CAPPA - real(kind=kind_dyn), intent(inout) :: cappa(isd:ied, jsd:jed, 1:km) + real(kind=kind_dyn), intent(inout) :: cappa(:,:,:) #else - real(kind=kind_dyn), intent(inout) :: cappa(isd:ied, jsd:jed, 1) + real(kind=kind_dyn), intent(inout) :: cappa(:,:,:) #endif ! DH* WARNING, allocation in fv_arrays.F90 is area(isd_2d:ied_2d, jsd_2d:jed_2d), ! where normally isd_2d = isd etc, but for memory optimization, these can be set ! to isd_2d=0, ied_2d=-1 etc. I don't believe this optimization is actually used, ! as it would break a whole lot of code (including the one below)! ! Assume thus that isd_2d = isd etc. - real(kind_grid), intent(in) :: area(isd:ied, jsd:jed) - real(kind=kind_dyn), intent(inout) :: dtdt(is:ie, js:je, 1:km) + real(kind_grid), intent(in) :: area(:,:) + real(kind=kind_dyn), intent(inout) :: dtdt(:,:,:) logical, intent(in) :: out_dt logical, intent(in) :: last_step logical, intent(in) :: do_qa - real(kind=kind_dyn), intent( out) :: qa(isd:ied, jsd:jed, 1:km) + real(kind=kind_dyn), intent( out) :: qa(:,:,:) integer, intent(in) :: nthreads character(len=*), intent( out) :: errmsg integer, intent( out) :: errflg diff --git a/physics/gfdl_sfc_layer.F90 b/physics/gfdl_sfc_layer.F90 index 2604e7defb..341f84fb3a 100644 --- a/physics/gfdl_sfc_layer.F90 +++ b/physics/gfdl_sfc_layer.F90 @@ -130,23 +130,23 @@ subroutine gfdl_sfc_layer_run (im, nsoil, km, xlat, xlon, flag_iter, lsm, & logical, intent(in) :: cplwav, cplwav2atm !GJF: this scheme has not been tested with these on logical, intent(in) :: lcurr_sf !GJF: this scheme has not been tested with this option turned on; the variables scurx and scury need to be input in order to use this logical, intent(in) :: pert_Cd !GJF: this scheme has not been tested with this option turned on; the variables ens_random_seed and ens_Cdamp need to be input in order to use this - logical, dimension(im), intent(in) :: flag_iter, wet, dry, icy - integer, dimension(im), intent(in) :: isltyp, vegtype - real(kind=kind_phys), intent(in) :: dt, sfenth - real(kind=kind_phys), intent(in) :: rd,grav,ep1,ep2 - real(kind=kind_phys), dimension(im,nsoil), intent(in) :: smois - real(kind=kind_phys), dimension(im), intent(in) :: psfc, prsl1, & + logical, dimension(:), intent(in) :: flag_iter, wet, dry, icy + integer, dimension(:), intent(in) :: isltyp, vegtype + real(kind=kind_phys), intent(in) :: dt, sfenth + real(kind=kind_phys), intent(in) :: rd,grav,ep1,ep2 + real(kind=kind_phys), dimension(:,:), intent(in) :: smois + real(kind=kind_phys), dimension(:), intent(in) :: psfc, prsl1, & q1, t1, u1, v1, wspd, u10, v10, gsw, glw, z1, shdmax, sigmaf, xlat, & xlon, tsurf_ocn, tsurf_lnd, tsurf_ice - real(kind=kind_phys), intent(inout), dimension(im) :: tskin_ocn, & + real(kind=kind_phys), intent(inout), dimension(:) :: tskin_ocn, & tskin_lnd, tskin_ice, ustar_ocn, ustar_lnd, ustar_ice, & znt_ocn, znt_lnd, znt_ice, cdm_ocn, cdm_lnd, cdm_ice, & stress_ocn, stress_lnd, stress_ice, rib_ocn, rib_lnd, rib_ice, & fm_ocn, fm_lnd, fm_ice, fh_ocn, fh_lnd, fh_ice, fh2_ocn, fh2_lnd, & fh2_ice, ch_ocn, ch_lnd, ch_ice, fm10_ocn, fm10_lnd, fm10_ice - real(kind=kind_phys), intent(out), dimension(im) :: qss_ocn, qss_lnd, qss_ice + real(kind=kind_phys), intent(out), dimension(:) :: qss_ocn, qss_lnd, qss_ice character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/gwdc.f b/physics/gwdc.f index dd02204205..acb43b519f 100644 --- a/physics/gwdc.f +++ b/physics/gwdc.f @@ -26,7 +26,7 @@ subroutine gwdc_pre_run ( & integer, intent(in) :: im, levs integer, intent(in) :: kbot(:), ktop(:) real(kind=kind_phys), intent(in) :: dtp - real(kind=kind_phys), intent(in) :: cgwf(2) + real(kind=kind_phys), intent(in) :: cgwf(:) real(kind=kind_phys), intent(in) :: dx(:), work1(:), work2(:) real(kind=kind_phys), intent(in) :: & & gt0(:,:), gt0_init(:,:), del(:,:) @@ -163,7 +163,6 @@ subroutine gwdc_run (im,km,lat,u1,v1,t1,q1,deltim, & USE MACHINE , ONLY : kind_phys implicit none -! DH* TODO - add intent information for all variables !---------------------------- Arguments -------------------------------- ! ! Input variables @@ -190,13 +189,13 @@ subroutine gwdc_run (im,km,lat,u1,v1,t1,q1,deltim, & integer, intent(in) :: im, km, lat, ipr integer, intent(in) :: ktop(:),kbot(:),kcnv(:) real(kind=kind_phys), intent(in) :: grav,cp,rd,fv,fhour,deltim,pi - real(kind=kind_phys), dimension(:), intent(in) :: qmax - real(kind=kind_phys), dimension(:), intent(out) :: tauctx,taucty - real(kind=kind_phys), dimension(:), intent(in) :: cldf,dlength - real(kind=kind_phys), dimension(:,:), intent(in) :: u1,v1,t1, & + real(kind=kind_phys), dimension(:), intent(in) :: qmax + real(kind=kind_phys), dimension(:), intent(out) :: tauctx,taucty + real(kind=kind_phys), dimension(:), intent(in) :: cldf,dlength + real(kind=kind_phys), dimension(:,:), intent(in) :: u1,v1,t1, & & q1,pmid1,dpmid1 real(kind=kind_phys), dimension(:,:), intent(out) :: utgwc,vtgwc - real(kind=kind_phys), dimension(:,:), intent(in) :: pint1 + real(kind=kind_phys), dimension(:,:), intent(in) :: pint1 ! logical, intent(in) :: lprnt ! diff --git a/physics/gwdps.f b/physics/gwdps.f index 4b527ef00e..66cff45e77 100644 --- a/physics/gwdps.f +++ b/physics/gwdps.f @@ -296,23 +296,23 @@ subroutine gwdps_run( & ! ! Interface variables integer, intent(in) :: im, km, imx, kdt, ipr, me - integer, intent(in) :: KPBL(IM) ! Index for the PBL top layer! + integer, intent(in) :: KPBL(:) ! Index for the PBL top layer! real(kind=kind_phys), intent(in) :: & & deltim, G, CP, RD, RV, cdmbgwd(4) real(kind=kind_phys), intent(inout) :: & - & A(IM,KM), B(IM,KM), C(IM,KM) + & A(:,:), B(:,:), C(:,:) real(kind=kind_phys), intent(in) :: & - & U1(IM,KM), V1(IM,KM), T1(IM,KM), & - & Q1(IM,KM), PRSI(IM,KM+1), DEL(IM,KM), & - & PRSL(IM,KM), PRSLK(IM,KM), PHIL(IM,KM), & - & PHII(IM,KM+1) + & U1(:,:), V1(:,:), T1(:,:), & + & Q1(:,:), PRSI(:,:), DEL(:,:), & + & PRSL(:,:), PRSLK(:,:), PHIL(:,:), & + & PHII(:,:) real(kind=kind_phys), intent(in) :: & - & OC(IM), OA4(IM,4), CLX4(IM,4), HPRIME(IM) - real(kind=kind_phys), intent(inout) :: ELVMAX(IM) + & OC(:), OA4(:,:), CLX4(:,;), HPRIME(:) + real(kind=kind_phys), intent(inout) :: ELVMAX(:) real(kind=kind_phys), intent(in) :: & - & THETA(IM), SIGMA(IM), GAMMA(IM) - real(kind=kind_phys), intent(out) :: DUSFC(IM), DVSFC(IM), & - & RDXZB(IM) + & THETA(:), SIGMA(:), GAMMA(:) + real(kind=kind_phys), intent(out) :: DUSFC(:), DVSFC(:), & + & RDXZB(:) integer, intent(in) :: nmtvr logical, intent(in) :: lprnt character(len=*), intent(out) :: errmsg diff --git a/physics/m_micro.F90 b/physics/m_micro.F90 index a2c4e7ddeb..4a6baf2871 100644 --- a/physics/m_micro.F90 +++ b/physics/m_micro.F90 @@ -38,7 +38,7 @@ subroutine m_micro_init(imp_physics, imp_physics_mg, fprcp, gravit, rair, rh2o, mg_do_graupel, mg_nccons, mg_nicons, mg_ngcons, & mg_do_ice_gmao, mg_do_liq_liu real(kind=kind_phys), intent(in) :: gravit, rair, rh2o, cpair, eps, tmelt, latvap, latice - real(kind=kind_phys), intent(in) :: mg_dcs, mg_qcvar, mg_ts_auto_ice(2), mg_rhmini, & + real(kind=kind_phys), intent(in) :: mg_dcs, mg_qcvar, mg_ts_auto_ice(:), mg_rhmini, & mg_berg_eff_factor, mg_ncnst, mg_ninst, mg_ngnst character(len=16), intent(in) :: mg_precip_frac_method character(len=*), intent(out) :: errmsg @@ -175,13 +175,12 @@ subroutine m_micro_run( im, lm, flipv, dt_i & integer, parameter :: ncolmicro = 1 integer,intent(in) :: im, lm, kdt, fprcp, pdfflag, iccn logical,intent(in) :: flipv, skip_macro - real (kind=kind_phys), intent(in):: dt_i, alf_fac, qc_min(2) + real (kind=kind_phys), intent(in):: dt_i, alf_fac, qc_min(:) - real (kind=kind_phys), dimension(:,:),intent(in) :: & + real (kind=kind_phys), dimension(:,:),intent(in) :: & & prsl_i,u_i,v_i,phil, omega_i, QLLS_i,QILS_i, & & lwheat_i,swheat_i - real (kind=kind_phys), dimension(:,:),intent(in):: prsi_i, & - & phii + real (kind=kind_phys), dimension(:,:),intent(in):: prsi_i, phii ! GJF* These variables are conditionally allocated depending on whether the ! Morrison-Gettelman microphysics is used, so they must be declared ! using assumed shape. @@ -190,11 +189,11 @@ subroutine m_micro_run( im, lm, flipv, dt_i & & CNV_MFD_i, cf_upi, CNV_FICE_i, CNV_NDROP_i, & & CNV_NICE_i, w_upi ! *GJF - real (kind=kind_phys), dimension(:,:),intent(in) :: & + real (kind=kind_phys), dimension(:,:),intent(in) :: & & rhc_i, naai_i, npccn_i - real (kind=kind_phys), dimension(:,:,:),intent(in) :: & + real (kind=kind_phys), dimension(:,:,:),intent(in) :: & & aerfld_i - real (kind=kind_phys),dimension(:),intent(in):: TAUGWX, & + real (kind=kind_phys),dimension(:),intent(in):: TAUGWX, & & TAUGWY, TAUOROX, TAUOROY, FRLAND,ZPBL,xlat,xlon ! & TAUGWY, TAUX, TAUY, TAUOROX, TAUOROY,ps_i,FRLAND,ZPBL ! & CNVPRCP diff --git a/physics/m_micro_interstitial.F90 b/physics/m_micro_interstitial.F90 index 9cfb6f56e8..8d0132cf1c 100644 --- a/physics/m_micro_interstitial.F90 +++ b/physics/m_micro_interstitial.F90 @@ -169,22 +169,22 @@ subroutine m_micro_post_run( & integer, intent(in) :: im, levs, fprcp logical, intent(in) :: mg3_as_mg2 - real(kind=kind_phys), intent(in ) :: ncpr(1:im,1:levs) - real(kind=kind_phys), intent(in ) :: ncps(1:im,1:levs) - real(kind=kind_phys), intent(in ) :: ncgl(1:im,1:levs) - real(kind=kind_phys), intent(inout) :: qrn(1:im,1:levs) - real(kind=kind_phys), intent(inout) :: qsnw(1:im,1:levs) - real(kind=kind_phys), intent(inout) :: qgl(1:im,1:levs) - real(kind=kind_phys), intent(in ) :: gq0_ice(1:im,1:levs) - real(kind=kind_phys), intent(out ) :: gq0_rain(1:im,1:levs) - real(kind=kind_phys), intent(out ) :: gq0_snow(1:im,1:levs) - real(kind=kind_phys), intent(out ) :: gq0_graupel(1:im,1:levs) - real(kind=kind_phys), intent(out ) :: gq0_rain_nc(1:im,1:levs) - real(kind=kind_phys), intent(out ) :: gq0_snow_nc(1:im,1:levs) - real(kind=kind_phys), intent(out ) :: gq0_graupel_nc(1:im,1:levs) - real(kind=kind_phys), intent( out) :: ice(1:im) - real(kind=kind_phys), intent( out) :: snow(1:im) - real(kind=kind_phys), intent( out) :: graupel(1:im) + real(kind=kind_phys), intent(in ) :: ncpr(:,:) + real(kind=kind_phys), intent(in ) :: ncps(:,:) + real(kind=kind_phys), intent(in ) :: ncgl(:,:) + real(kind=kind_phys), intent(inout) :: qrn(:,:) + real(kind=kind_phys), intent(inout) :: qsnw(:,:) + real(kind=kind_phys), intent(inout) :: qgl(:,:) + real(kind=kind_phys), intent(in ) :: gq0_ice(:,:) + real(kind=kind_phys), intent(out ) :: gq0_rain(:,:) + real(kind=kind_phys), intent(out ) :: gq0_snow(:,:) + real(kind=kind_phys), intent(out ) :: gq0_graupel(:,:) + real(kind=kind_phys), intent(out ) :: gq0_rain_nc(:,:) + real(kind=kind_phys), intent(out ) :: gq0_snow_nc(:,:) + real(kind=kind_phys), intent(out ) :: gq0_graupel_nc(:,:) + real(kind=kind_phys), intent( out) :: ice(:) + real(kind=kind_phys), intent( out) :: snow(:) + real(kind=kind_phys), intent( out) :: graupel(:) real(kind=kind_phys), intent(in ) :: dtp character(len=*), intent(out) :: errmsg diff --git a/physics/module_MYJPBL_wrapper.F90 b/physics/module_MYJPBL_wrapper.F90 index 5924de96f0..9179c3068c 100644 --- a/physics/module_MYJPBL_wrapper.F90 +++ b/physics/module_MYJPBL_wrapper.F90 @@ -86,38 +86,38 @@ SUBROUTINE myjpbl_wrapper_run( & real(kind=kind_phys),intent(in) :: dt_phs, xkzm_m, xkzm_h, xkzm_s !MYJ-2D - real(kind=kind_phys),dimension(im),intent(in) :: & - & prsik_1, prslk_1, prslki, slmsk, garea, & + real(kind=kind_phys),dimension(:),intent(in) :: & + & prsik_1, prslk_1, prslki, slmsk, garea, & snowd, evap, hflx, cm, ch, wind, hprime1 - real(kind=kind_phys),dimension(im),intent(inout) :: & + real(kind=kind_phys),dimension(:),intent(inout) :: & & pblh, zorl, ustar, tsfc, qsfc - real(kind=kind_phys),dimension(im),intent(inout) :: & - & phy_myj_qsfc, phy_myj_thz0, phy_myj_qz0, & - & phy_myj_uz0, phy_myj_vz0, phy_myj_z0base, & - & phy_myj_akhs, phy_myj_akms, & - & phy_myj_chkqlm, phy_myj_elflx, & + real(kind=kind_phys),dimension(:),intent(inout) :: & + & phy_myj_qsfc, phy_myj_thz0, phy_myj_qz0, & + & phy_myj_uz0, phy_myj_vz0, phy_myj_z0base, & + & phy_myj_akhs, phy_myj_akms, & + & phy_myj_chkqlm, phy_myj_elflx, & & phy_myj_a1u, phy_myj_a1t, phy_myj_a1q - real(kind=kind_phys),dimension(im),intent(out) :: & + real(kind=kind_phys),dimension(:),intent(out) :: & & dusfc,dvsfc,dtsfc,dqsfc,gamt,gamq - integer,dimension(im),intent(out) :: kpbl - integer,dimension(im),intent(in) :: kinver + integer,dimension(:),intent(out) :: kpbl + integer,dimension(:),intent(in) :: kinver !MYJ-3D - real(kind=kind_phys),dimension(im,levs+1),intent(in) :: & + real(kind=kind_phys),dimension(:,:),intent(in) :: & phii, prsi - real(kind=kind_phys),dimension(im,levs),intent(in) :: & + real(kind=kind_phys),dimension(:,:),intent(in) :: & & ugrs, vgrs, tgrs, prsl -! real(kind=kind_phys),dimension(im,levs),intent(inout) :: & +! real(kind=kind_phys),dimension(:,:),intent(inout) :: & ! dudt, dvdt, dtdt, dkt - real(kind=kind_phys),dimension(im,levs),intent(inout) :: & + real(kind=kind_phys),dimension(:,:),intent(inout) :: & dudt, dvdt, dtdt - real(kind=kind_phys),dimension(im,levs-1),intent(out) :: & + real(kind=kind_phys),dimension(:,:),intent(out) :: & dkt - real(kind=kind_phys),dimension(:,:),intent(inout) :: & + real(kind=kind_phys),dimension(:,:),intent(inout) :: & du3dt_PBL, dv3dt_PBL, dt3dt_PBL, dq3dt_PBL !MYJ-4D - real(kind=kind_phys),dimension(im,levs,ntrac),intent(inout) :: & + real(kind=kind_phys),dimension(:,:,:),intent(inout) :: & & qgrs,dqdt !LOCAL diff --git a/physics/module_MYJSFC_wrapper.F90 b/physics/module_MYJSFC_wrapper.F90 index f46291a461..ee683b97c2 100644 --- a/physics/module_MYJSFC_wrapper.F90 +++ b/physics/module_MYJSFC_wrapper.F90 @@ -91,22 +91,22 @@ SUBROUTINE myjsfc_wrapper_run( & real(kind=kind_phys),intent(in) :: con_cp, con_g, con_rd !MYJ-2D - logical,dimension(im),intent(in) :: flag_iter - real(kind=kind_phys),dimension(im),intent(in) :: & + logical,dimension(:),intent(in) :: flag_iter + real(kind=kind_phys),dimension(:),intent(in) :: & & prsik_1, prslk_1, tsfc, qsfc, slmsk - real(kind=kind_phys),dimension(im),intent(inout) :: & + real(kind=kind_phys),dimension(:),intent(inout) :: & & phy_myj_qsfc, phy_myj_thz0, phy_myj_qz0, & & phy_myj_uz0, phy_myj_vz0, phy_myj_z0base, & & phy_myj_akhs, phy_myj_akms, & & phy_myj_chkqlm, phy_myj_elflx, & & phy_myj_a1u, phy_myj_a1t, phy_myj_a1q - real(kind=kind_phys),dimension(im),intent(inout) :: & + real(kind=kind_phys),dimension(:),intent(inout) :: & & pblh, zorl, ustar, rib - real(kind=kind_phys),dimension(im),intent(inout) :: & + real(kind=kind_phys),dimension(:),intent(inout) :: & & cm, ch, stress, ffm, ffh, fm10, fh2 - real(kind=kind_phys), dimension(im), intent(inout) :: & + real(kind=kind_phys), dimension(:), intent(inout) :: & & landfrac, lakefrac, oceanfrac, fice - real(kind=kind_phys), dimension(im), intent(inout) :: & + real(kind=kind_phys), dimension(:), intent(inout) :: & & z0rl_wat, z0rl_lnd, z0rl_ice, & & ustar_wat, ustar_lnd, ustar_ice, & & cm_wat, cm_lnd, cm_ice, & @@ -121,12 +121,12 @@ SUBROUTINE myjsfc_wrapper_run( & !MYJ-3D - real(kind=kind_phys),dimension(im,levs+1),intent(in) :: & + real(kind=kind_phys),dimension(::),intent(in) :: & phii, prsi - real(kind=kind_phys),dimension(im,levs),intent(in) :: & + real(kind=kind_phys),dimension(:,:),intent(in) :: & & ugrs, vgrs, tgrs, prsl !MYJ-4D - real(kind=kind_phys),dimension(im,levs,ntrac),intent(in) :: & + real(kind=kind_phys),dimension(:,:,:),intent(in) :: & & qgrs !LOCAL diff --git a/physics/module_MYNNPBL_wrapper.F90 b/physics/module_MYNNPBL_wrapper.F90 index c95c70ace0..778e6993ef 100644 --- a/physics/module_MYNNPBL_wrapper.F90 +++ b/physics/module_MYNNPBL_wrapper.F90 @@ -289,38 +289,38 @@ SUBROUTINE mynnedmf_wrapper_run( & REAL(kind=kind_phys), DIMENSION( ndvel ) :: vd1 !MYNN-2D - real(kind=kind_phys), dimension(im), intent(in) :: & + real(kind=kind_phys), dimension(:), intent(in) :: & & dx,zorl,slmsk,tsurf,qsfc,ps, & & hflx,qflx,ust,wspd,rb,recmol - real(kind=kind_phys), dimension(im), intent(in) :: & + real(kind=kind_phys), dimension(:), intent(in) :: & & dusfc_cice,dvsfc_cice,dtsfc_cice,dqsfc_cice, & & stress_ocn,hflx_ocn,qflx_ocn, & & oceanfrac,fice - logical, dimension(im), intent(in) :: & + logical, dimension(:), intent(in) :: & & wet, dry, icy - real(kind=kind_phys), dimension(im), intent(inout) :: & + real(kind=kind_phys), dimension(:), intent(inout) :: & & pblh,dusfc_diag,dvsfc_diag,dtsfc_diag,dqsfc_diag - real(kind=kind_phys), dimension(im), intent(out) :: & + real(kind=kind_phys), dimension(:), intent(out) :: & & ch,dtsfc1,dqsfc1,dusfc1,dvsfc1, & & dtsfci_diag,dqsfci_diag,dusfci_diag,dvsfci_diag, & & maxMF - integer, dimension(im), intent(inout) :: & + integer, dimension(:), intent(inout) :: & & kpbl,nupdraft,ktop_plume - real(kind=kind_phys), dimension(:), intent(inout) :: & + real(kind=kind_phys), dimension(:), intent(inout) :: & & dusfc_cpl,dvsfc_cpl,dtsfc_cpl,dqsfc_cpl - real(kind=kind_phys), dimension(:), intent(inout) :: & + real(kind=kind_phys), dimension(:), intent(inout) :: & & dusfci_cpl,dvsfci_cpl,dtsfci_cpl,dqsfci_cpl !LOCAL - real, dimension(im) :: & + real, dimension(:) :: & & WSTAR,DELTA,qcg,hfx,qfx,rmol,xland, & & uoce,voce,vdfg,znt,ts - real, dimension(im) :: dusfci1,dvsfci1,dtsfci1,dqsfci1 + real, dimension(:) :: dusfci1,dvsfci1,dtsfci1,dqsfci1 ! Initialize CCPP error handling variables errmsg = '' diff --git a/physics/mp_fer_hires.F90 b/physics/mp_fer_hires.F90 index fd6f76a4d3..9bbda5ad0b 100644 --- a/physics/mp_fer_hires.F90 +++ b/physics/mp_fer_hires.F90 @@ -54,9 +54,9 @@ subroutine mp_fer_hires_init(ncol, nlev, dtp, imp_physics, & logical, intent(in) :: restart character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg - real(kind_phys), intent(out) :: f_ice(1:ncol,1:nlev) - real(kind_phys), intent(out) :: f_rain(1:ncol,1:nlev) - real(kind_phys), intent(out) :: f_rimef(1:ncol,1:nlev) + real(kind_phys), intent(out) :: f_ice(:,:) + real(kind_phys), intent(out) :: f_rain(:,:) + real(kind_phys), intent(out) :: f_rimef(:,:) ! Local variables @@ -152,27 +152,27 @@ SUBROUTINE mp_fer_hires_run(NCOL, NLEV, DT ,SPEC_ADV & logical, intent(in ) :: spec_adv integer, intent(in ) :: mpirank integer, intent(in ) :: mpiroot - real(kind_phys), intent(in ) :: slmsk(1:ncol) - real(kind_phys), intent(in ) :: prsi(1:ncol,1:nlev+1) - real(kind_phys), intent(in ) :: p_phy(1:ncol,1:nlev) + real(kind_phys), intent(in ) :: slmsk(:) + real(kind_phys), intent(in ) :: prsi(:,:) + real(kind_phys), intent(in ) :: p_phy(:,:) real(kind_phys), intent(in ) :: epsq,r_d,p608,cp,g - real(kind_phys), intent(inout) :: t(1:ncol,1:nlev) - real(kind_phys), intent(inout) :: q(1:ncol,1:nlev) - real(kind_phys), intent(inout) :: cwm(1:ncol,1:nlev) - real(kind_phys), intent(inout) :: train(1:ncol,1:nlev) - real(kind_phys), intent(out ) :: sr(1:ncol) - real(kind_phys), intent(out ) :: f_ice(1:ncol,1:nlev) - real(kind_phys), intent(out ) :: f_rain(1:ncol,1:nlev) - real(kind_phys), intent(out ) :: f_rimef(1:ncol,1:nlev) - real(kind_phys), intent(inout) :: qc(1:ncol,1:nlev) - real(kind_phys), intent(inout) :: qr(1:ncol,1:nlev) - real(kind_phys), intent(inout) :: qi(1:ncol,1:nlev) - real(kind_phys), intent(inout) :: qg(1:ncol,1:nlev) ! QRIMEF - - real(kind_phys), intent(inout) :: prec(1:ncol) - real(kind_phys), intent(inout) :: refl_10cm(1:ncol,1:nlev) + real(kind_phys), intent(inout) :: t(:,:) + real(kind_phys), intent(inout) :: q(:,:) + real(kind_phys), intent(inout) :: cwm(:,:) + real(kind_phys), intent(inout) :: train(:,:) + real(kind_phys), intent(out ) :: sr(:) + real(kind_phys), intent(out ) :: f_ice(:,:) + real(kind_phys), intent(out ) :: f_rain(:,:) + real(kind_phys), intent(out ) :: f_rimef(:,:) + real(kind_phys), intent(inout) :: qc(:,:) + real(kind_phys), intent(inout) :: qr(:,:) + real(kind_phys), intent(inout) :: qi(:,:) + real(kind_phys), intent(inout) :: qg(:,:) ! QRIMEF + + real(kind_phys), intent(inout) :: prec(:) + real(kind_phys), intent(inout) :: refl_10cm(:,:) real(kind_phys), intent(in ) :: rhgrd - real(kind_phys), intent(in ) :: dx(1:ncol) + real(kind_phys), intent(in ) :: dx(:) character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg ! diff --git a/physics/mp_thompson.F90 b/physics/mp_thompson.F90 index 6031af94ad..cb4fbfffd4 100644 --- a/physics/mp_thompson.F90 +++ b/physics/mp_thompson.F90 @@ -347,14 +347,14 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, & real(kind_phys), intent(in ) :: con_eps ! Hydrometeors logical, intent(in ) :: convert_dry_rho - real(kind_phys), intent(inout) :: spechum(1:ncol,1:nlev) - real(kind_phys), intent(inout) :: qc(1:ncol,1:nlev) - real(kind_phys), intent(inout) :: qr(1:ncol,1:nlev) - real(kind_phys), intent(inout) :: qi(1:ncol,1:nlev) - real(kind_phys), intent(inout) :: qs(1:ncol,1:nlev) - real(kind_phys), intent(inout) :: qg(1:ncol,1:nlev) - real(kind_phys), intent(inout) :: ni(1:ncol,1:nlev) - real(kind_phys), intent(inout) :: nr(1:ncol,1:nlev) + real(kind_phys), intent(inout) :: spechum(:,:) + real(kind_phys), intent(inout) :: qc(:,:) + real(kind_phys), intent(inout) :: qr(:,:) + real(kind_phys), intent(inout) :: qi(:,:) + real(kind_phys), intent(inout) :: qs(:,:) + real(kind_phys), intent(inout) :: qg(:,:) + real(kind_phys), intent(inout) :: ni(:,:) + real(kind_phys), intent(inout) :: nr(:,:) ! Aerosols logical, intent(in) :: is_aerosol_aware, reset ! The following arrays are not allocated if is_aerosol_aware is false @@ -364,25 +364,25 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, & real(kind_phys), optional, intent(in ) :: nwfa2d(:) real(kind_phys), optional, intent(in ) :: nifa2d(:) ! State variables and timestep information - real(kind_phys), intent(inout) :: tgrs(1:ncol,1:nlev) - real(kind_phys), intent(in ) :: prsl(1:ncol,1:nlev) - real(kind_phys), intent(in ) :: phii(1:ncol,1:nlev+1) - real(kind_phys), intent(in ) :: omega(1:ncol,1:nlev) + real(kind_phys), intent(inout) :: tgrs(:,:) + real(kind_phys), intent(in ) :: prsl(:,:) + real(kind_phys), intent(in ) :: phii(:,:) + real(kind_phys), intent(in ) :: omega(:,:) real(kind_phys), intent(in ) :: dtp ! Precip/rain/snow/graupel fall amounts and fraction of frozen precip - real(kind_phys), intent( out) :: prcp(1:ncol) - real(kind_phys), intent( out) :: rain(1:ncol) - real(kind_phys), intent( out) :: graupel(1:ncol) - real(kind_phys), intent( out) :: ice(1:ncol) - real(kind_phys), intent( out) :: snow(1:ncol) - real(kind_phys), intent( out) :: sr(1:ncol) + real(kind_phys), intent( out) :: prcp(:) + real(kind_phys), intent( out) :: rain(:) + real(kind_phys), intent( out) :: graupel(:) + real(kind_phys), intent( out) :: ice(:) + real(kind_phys), intent( out) :: snow(:) + real(kind_phys), intent( out) :: sr(:) ! Radar reflectivity - real(kind_phys), intent( out) :: refl_10cm(1:ncol,1:nlev) + real(kind_phys), intent( out) :: refl_10cm(:,:) logical, optional, intent(in ) :: do_radar_ref ! Cloud effective radii - real(kind_phys), optional, intent( out) :: re_cloud(1:ncol,1:nlev) - real(kind_phys), optional, intent( out) :: re_ice(1:ncol,1:nlev) - real(kind_phys), optional, intent( out) :: re_snow(1:ncol,1:nlev) + real(kind_phys), optional, intent( out) :: re_cloud(:,:) + real(kind_phys), optional, intent( out) :: re_ice(:,:) + real(kind_phys), optional, intent( out) :: re_snow(:,:) ! MPI information integer, intent(in) :: mpicomm integer, intent(in) :: mpirank diff --git a/physics/ozphys.f b/physics/ozphys.f index e71d3de860..c1f464cb4b 100644 --- a/physics/ozphys.f +++ b/physics/ozphys.f @@ -58,7 +58,7 @@ subroutine ozphys_run ( & ! Interface variables integer, intent(in) :: im, levs, ko3, oz_coeff, me real(kind=kind_phys), intent(inout) :: & - & oz(im,levs) + & oz(:,:) ! These arrays may not be allocated and need assumed array sizes real(kind=kind_phys), intent(inout) :: & & ozp1(:,:), ozp2(:,:), ozp3(:,:), ozp4(:,:) diff --git a/physics/rrtmg_lw_pre.F90 b/physics/rrtmg_lw_pre.F90 index 276a0a5bd3..0494e283f6 100644 --- a/physics/rrtmg_lw_pre.F90 +++ b/physics/rrtmg_lw_pre.F90 @@ -22,10 +22,10 @@ subroutine rrtmg_lw_pre_run (im, lslwr, xlat, xlon, slmsk, snowd, sncovr,& integer, intent(in) :: im logical, intent(in) :: lslwr - real(kind=kind_phys), dimension(im), intent(in) :: xlat, xlon, slmsk, & + real(kind=kind_phys), dimension(:), intent(in) :: xlat, xlon, slmsk, & snowd, sncovr, zorl, hprime, tsfg, tsfa real(kind=kind_phys), dimension(:), intent(in) :: emiss - real(kind=kind_phys), dimension(im), intent(out) :: semis + real(kind=kind_phys), dimension(:), intent(out) :: semis character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/rrtmg_sw_post.F90 b/physics/rrtmg_sw_post.F90 index d9946f695e..0c716077af 100644 --- a/physics/rrtmg_sw_post.F90 +++ b/physics/rrtmg_sw_post.F90 @@ -26,20 +26,20 @@ subroutine rrtmg_sw_post_run (im, levr, levs, ltp, nday, lm, kd, lsswr, & integer, intent(in) :: im, levr, levs, & ltp, nday, lm, kd logical, intent(in) :: lsswr, swhtr - real(kind=kind_phys), dimension(im), intent(in) :: sfcalb1, sfcalb2, & + real(kind=kind_phys), dimension(:), intent(in) :: sfcalb1, sfcalb2, & sfcalb3, sfcalb4 - real(kind=kind_phys), dimension(im, levr+LTP), intent(in) :: htswc, htsw0 + real(kind=kind_phys), dimension(:,:), intent(in) :: htswc, htsw0 - real(kind=kind_phys), dimension(im), intent(inout) :: nirbmdi, nirdfdi, & + real(kind=kind_phys), dimension(:), intent(inout) :: nirbmdi, nirdfdi, & visbmdi, visdfdi, & nirbmui, nirdfui, & visbmui, visdfui, & sfcdsw, sfcnsw - real(kind=kind_phys), dimension(im,levs), intent(inout) :: htrsw, swhc + real(kind=kind_phys), dimension(:,:), intent(inout) :: htrsw, swhc - type(cmpfsw_type), dimension(im), intent(inout) :: scmpsw - type(sfcfsw_type), dimension(im), intent(inout) :: sfcfsw - type(topfsw_type), dimension(im), intent(inout) :: topfsw + type(cmpfsw_type), dimension(:), intent(inout) :: scmpsw + type(sfcfsw_type), dimension(:), intent(inout) :: sfcfsw + type(topfsw_type), dimension(:), intent(inout) :: topfsw character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/rrtmg_sw_pre.F90 b/physics/rrtmg_sw_pre.F90 index b281d42a7b..bb49a9884c 100644 --- a/physics/rrtmg_sw_pre.F90 +++ b/physics/rrtmg_sw_pre.F90 @@ -27,9 +27,9 @@ subroutine rrtmg_sw_pre_run (im, lndp_type, n_var_lndp, lsswr, lndp_var_list, ln character(len=3) , dimension(:), intent(in) :: lndp_var_list logical, intent(in) :: lsswr real(kind=kind_phys), dimension(:), intent(in) :: lndp_prt_list - real(kind=kind_phys), dimension(im), intent(in) :: tsfg, tsfa, coszen - real(kind=kind_phys), dimension(im), intent(in) :: alb1d - real(kind=kind_phys), dimension(im), intent(in) :: slmsk, snowd, & + real(kind=kind_phys), dimension(:), intent(in) :: tsfg, tsfa, coszen + real(kind=kind_phys), dimension(:), intent(in) :: alb1d + real(kind=kind_phys), dimension(:), intent(in) :: slmsk, snowd, & sncovr, snoalb, & zorl, hprime, & alvsf, alnsf, & @@ -38,16 +38,16 @@ subroutine rrtmg_sw_pre_run (im, lndp_type, n_var_lndp, lsswr, lndp_var_list, ln fice, tisfc real(kind=kind_phys), dimension(:), intent(in) :: albdvis, albdnir, & albivis, albinir - real(kind=kind_phys), dimension(im), intent(inout) :: sfalb + real(kind=kind_phys), dimension(:), intent(inout) :: sfalb integer, intent(out) :: nday - integer, dimension(im), intent(out) :: idxday - real(kind=kind_phys), dimension(im), intent(out) :: sfcalb1, sfcalb2, & + integer, dimension(:), intent(out) :: idxday + real(kind=kind_phys), dimension(:), intent(out) :: sfcalb1, sfcalb2, & sfcalb3, sfcalb4 character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg ! Local variables integer :: i - real(kind=kind_phys), dimension(im,NF_ALBD) :: sfcalb + real(kind=kind_phys), dimension(:,:) :: sfcalb real(kind=kind_phys) :: lndp_alb diff --git a/physics/sfc_cice.f b/physics/sfc_cice.f index 44b3ee2e8d..a07759f71e 100644 --- a/physics/sfc_cice.f +++ b/physics/sfc_cice.f @@ -98,9 +98,9 @@ subroutine sfc_cice_run & use machine , only : kind_phys implicit none - real(kind=kind_phys), parameter :: one = 1.0_kind_phys - real(kind=kind_phys), parameter :: dsi = one/0.33_kind_phys - real (kind=kind_phys), intent(in) :: hvap, cp, rvrdm1, rd + real(kind=kind_phys), parameter :: one = 1.0_kind_phys + real(kind=kind_phys), parameter :: dsi = one/0.33_kind_phys + real(kind=kind_phys), intent(in) :: hvap, cp, rvrdm1, rd ! --- inputs: integer, intent(in) :: im @@ -111,7 +111,7 @@ subroutine sfc_cice_run & & t1, q1, cm, ch, prsl1, wind, dqsfc, dtsfc, dusfc, dvsfc &, snowd - logical, intent(in) :: flag_cice(im), flag_iter(im) + logical, dimension(:), intent(in) :: flag_cice, flag_iter ! --- outputs: real (kind=kind_phys), dimension(:), intent(inout) :: qsurf, & diff --git a/physics/sfc_drv_ruc.F90 b/physics/sfc_drv_ruc.F90 index 606019b61b..916144cf54 100644 --- a/physics/sfc_drv_ruc.F90 +++ b/physics/sfc_drv_ruc.F90 @@ -47,25 +47,25 @@ subroutine lsm_ruc_init (me, master, isot, ivegsrc, nlunit, & integer, intent(in) :: lsm_ruc, lsm - real (kind=kind_phys), dimension(im), intent(in) :: slmsk - real (kind=kind_phys), dimension(im), intent(in) :: stype - real (kind=kind_phys), dimension(im), intent(in) :: vtype - real (kind=kind_phys), dimension(im), intent(in) :: tsfc_lnd - real (kind=kind_phys), dimension(im), intent(in) :: tsfc_wat - real (kind=kind_phys), dimension(im), intent(in) :: tg3 + real (kind=kind_phys), dimension(:), intent(in) :: slmsk + real (kind=kind_phys), dimension(:), intent(in) :: stype + real (kind=kind_phys), dimension(:), intent(in) :: vtype + real (kind=kind_phys), dimension(:), intent(in) :: tsfc_lnd + real (kind=kind_phys), dimension(:), intent(in) :: tsfc_wat + real (kind=kind_phys), dimension(:), intent(in) :: tg3 - real (kind=kind_phys), dimension(im,lsoil), intent(in) :: smc,slc,stc + real (kind=kind_phys), dimension(:,:), intent(in) :: smc,slc,stc ! --- in/out: - real (kind=kind_phys), dimension(im), intent(inout) :: wetness + real (kind=kind_phys), dimension(:), intent(inout) :: wetness ! --- out - real (kind=kind_phys), dimension(:), intent(out) :: zs - real (kind=kind_phys), dimension(im,lsoil_ruc), intent(inout) :: sh2o, smfrkeep - real (kind=kind_phys), dimension(im,lsoil_ruc), intent(inout) :: tslb, smois - real (kind=kind_phys), dimension(im,kice), intent(out) :: tsice + real (kind=kind_phys), dimension(:), intent(out) :: zs + real (kind=kind_phys), dimension(:,:), intent(inout) :: sh2o, smfrkeep + real (kind=kind_phys), dimension(:,:), intent(inout) :: tslb, smois + real (kind=kind_phys), dimension(:,:), intent(out) :: tsice - real (kind=kind_phys), dimension(:), intent(out) :: pores, resid + real (kind=kind_phys), dimension(:), intent(out) :: pores, resid character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -317,7 +317,7 @@ subroutine lsm_ruc_run & ! inputs integer, intent(in) :: lsm_ruc, lsm integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson - real (kind=kind_phys), dimension(im), intent(in) :: & + real (kind=kind_phys), dimension(:), intent(in) :: & & t1, sigmaf, laixy, dlwflx, dswsfc, snet, tg3, & & prsl1, wind, shdmin, shdmax, & & snoalb, alvwf, alnwf, zf, qc, q1, & @@ -333,19 +333,19 @@ subroutine lsm_ruc_run & ! inputs con_pi, con_rd, & con_hvap, con_fvirt - logical, dimension(im), intent(in) :: flag_iter, flag_guess - logical, dimension(im), intent(in) :: land, icy, lake - logical, dimension(im), intent(in) :: flag_cice + logical, dimension(:), intent(in) :: flag_iter, flag_guess + logical, dimension(:), intent(in) :: land, icy, lake + logical, dimension(:), intent(in) :: flag_cice logical, intent(in) :: frac_grid logical, intent(in) :: do_mynnsfclay logical, intent(in) :: rdlai ! --- in/out: - integer, dimension(im), intent(inout) :: soiltyp, vegtype - real (kind=kind_phys), dimension(lsoil_ruc), intent(in) :: zs - real (kind=kind_phys), dimension(im), intent(in) :: srflag - real (kind=kind_phys), dimension(im), intent(inout) :: & + integer, dimension(:), intent(inout) :: soiltyp, vegtype + real (kind=kind_phys), dimension(:), intent(in) :: zs + real (kind=kind_phys), dimension(:), intent(in) :: srflag + real (kind=kind_phys), dimension(:), intent(inout) :: & & canopy, trans, smcwlt2, smcref2, & ! for land & weasd_lnd, snwdph_lnd, tskin_lnd, & @@ -357,15 +357,15 @@ subroutine lsm_ruc_run & ! inputs & sfcqc_ice, sfcqv_ice, fice, tice ! --- in - real (kind=kind_phys), dimension(im), intent(in) :: & + real (kind=kind_phys), dimension(:), intent(in) :: & & rainnc, rainc, ice, snow, graupel ! --- in/out: ! --- on RUC levels - real (kind=kind_phys), dimension(im,lsoil_ruc), intent(inout) :: & + real (kind=kind_phys), dimension(:,:), intent(inout) :: & & smois, tsice, tslb, sh2o, keepfr, smfrkeep ! --- output: - real (kind=kind_phys), dimension(im), intent(inout) :: & + real (kind=kind_phys), dimension(:), intent(inout) :: & & rhosnf, runof, drain, runoff, srunoff, evbs, evcw, & & stm, wetness, semis_lnd, semis_ice, & ! for land diff --git a/physics/sfc_noah_wrfv4.F90 b/physics/sfc_noah_wrfv4.F90 index c435b2d386..038adf1c6b 100644 --- a/physics/sfc_noah_wrfv4.F90 +++ b/physics/sfc_noah_wrfv4.F90 @@ -94,7 +94,8 @@ end subroutine sfc_noah_wrfv4_finalize !! !> \section general_noah_wrfv4_drv NOAH LSM WRFv4 General Algorithm !> @{ - subroutine sfc_noah_wrfv4_run (im, isice, flag_lsm, flag_lsm_glacier, srflag, isurban, rdlai, & + subroutine sfc_noah_wrfv4_run ( & + im, isice, flag_lsm, flag_lsm_glacier, srflag, isurban, rdlai, & ua_phys, usemonalb, aoasis, fasdas, dt, zlvl, & nsoil, sthick, lwdn, soldn, solnet, sfcprs, prcp, sfctmp, q1k, & th1, qs1, dqsdt2, vegtyp, soiltyp, slopetyp, shdfac, shmin, & @@ -118,20 +119,20 @@ subroutine sfc_noah_wrfv4_run (im, isice, flag_lsm, flag_lsm_glacier, srflag, is real(kind=kind_phys), intent(in) :: dt, cp, rd, sigma, cph2o, cpice, lsubf - integer, dimension(im), intent(in) :: vegtyp, soiltyp, slopetyp - logical, dimension(im), intent(in) :: flag_lsm, flag_lsm_glacier - real(kind=kind_phys), dimension(im), intent(in) :: srflag, zlvl, lwdn, soldn, solnet, & + integer, dimension(:), intent(in) :: vegtyp, soiltyp, slopetyp + logical, dimension(:), intent(in) :: flag_lsm, flag_lsm_glacier + real(kind=kind_phys), dimension(:), intent(in) :: srflag, zlvl, lwdn, soldn, solnet, & sfcprs, prcp, sfctmp, q1k, th1, qs1, & dqsdt2, shmin, shmax, snoalb, tbot - real(kind=kind_phys), dimension(nsoil), intent(in) :: sthick + real(kind=kind_phys), dimension(:), intent(in) :: sthick - real(kind=kind_phys), dimension(im), intent(inout) :: shdfac, albbrd, z0brd, z0k, emissi, & + real(kind=kind_phys), dimension(:), intent(inout) :: shdfac, albbrd, z0brd, z0k, emissi, & cmc, t1, snowhk, sneqv, chk, flx1, & flx2, flx3, ribb, snotime - real(kind=kind_phys), dimension(im,nsoil), intent(inout) :: stc, smc, swc + real(kind=kind_phys), dimension(:,:), intent(inout) :: stc, smc, swc !variables that are intent(out) in module_sf_noahlsm, but are inout here due to being set within an IF statement - real(kind=kind_phys), dimension(im), intent(inout) :: embrd, sheat, eta, ec, & + real(kind=kind_phys), dimension(:), intent(inout) :: embrd, sheat, eta, ec, & edir, ett, esnow, etp, ssoil, sncovr, & runoff1, runoff2, soilm, qsurf, smcwlt, & smcref, smcmax diff --git a/physics/sfc_noah_wrfv4_interstitial.F90 b/physics/sfc_noah_wrfv4_interstitial.F90 index b30f8a1311..7b37de5688 100644 --- a/physics/sfc_noah_wrfv4_interstitial.F90 +++ b/physics/sfc_noah_wrfv4_interstitial.F90 @@ -144,21 +144,21 @@ subroutine sfc_noah_wrfv4_pre_run (im, nsoil, ialb, isice, land, & ! Note that the version of NOAH LSM expected here is "generic" - there are no urban, fasdas, or ! or University of Arizona(?) additions. - integer, intent(in) :: im, nsoil, ialb, isice - logical, intent(in) :: restart, first_time_step - real(kind=kind_phys), intent(in) :: dt, rhowater, rd, rvrdm1, eps, epsm1 - - logical, dimension(im), intent(in) :: flag_guess, flag_iter, land - real(kind=kind_phys), dimension(im), intent(in) :: sfcprs, tprcp, sfctmp, q1, prslki, wind, cm, ch, snwdph - real(kind=kind_phys), dimension(im), intent(in) :: weasd, tsfc, vtype - real(kind=kind_phys), dimension(im,nsoil), intent(in) :: smc, stc, slc - - logical, dimension(im), intent(inout) :: flag_lsm, flag_lsm_glacier - real(kind=kind_phys), dimension(im), intent(inout) :: snoalb, prcp, q2k, rho1, qs1, th1, dqsdt2, canopy, cmc, snowhk, chk, cmm, chh - real(kind=kind_phys), dimension(im), intent(inout) :: weasd_save, snwdph_save, tsfc_save, canopy_save - real(kind=kind_phys), dimension(im,nsoil), intent(inout) :: smc_save, stc_save, slc_save - real(kind=kind_phys), dimension(im), intent(inout) :: ep, evap, hflx, gflux, drain, evbs, evcw, trans, sbsno, snowc, snohf - real(kind=kind_phys), dimension(nsoil), intent(inout) :: sthick + integer, intent(in) :: im, nsoil, ialb, isice + logical, intent(in) :: restart, first_time_step + real(kind=kind_phys), intent(in) :: dt, rhowater, rd, rvrdm1, eps, epsm1 + + logical, dimension(:), intent(in) :: flag_guess, flag_iter, land + real(kind=kind_phys), dimension(:), intent(in) :: sfcprs, tprcp, sfctmp, q1, prslki, wind, cm, ch, snwdph + real(kind=kind_phys), dimension(:), intent(in) :: weasd, tsfc, vtype + real(kind=kind_phys), dimension(:,:), intent(in) :: smc, stc, slc + + logical, dimension(:), intent(inout) :: flag_lsm, flag_lsm_glacier + real(kind=kind_phys), dimension(:), intent(inout) :: snoalb, prcp, q2k, rho1, qs1, th1, dqsdt2, canopy, cmc, snowhk, chk, cmm, chh + real(kind=kind_phys), dimension(:), intent(inout) :: weasd_save, snwdph_save, tsfc_save, canopy_save + real(kind=kind_phys), dimension(:,:), intent(inout) :: smc_save, stc_save, slc_save + real(kind=kind_phys), dimension(:), intent(inout) :: ep, evap, hflx, gflux, drain, evbs, evcw, trans, sbsno, snowc, snohf + real(kind=kind_phys), dimension(:), intent(inout) :: sthick character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -688,17 +688,17 @@ subroutine sfc_noah_wrfv4_post_run (im, nsoil, land, flag_guess, flag_lsm, & implicit none integer, intent(in) :: im, nsoil - logical, dimension(im), intent(in) :: land, flag_guess, flag_lsm + logical, dimension(:), intent(in) :: land, flag_guess, flag_lsm real(kind=kind_phys), intent(in) :: rhowater, cp, hvap - real(kind=kind_phys), dimension(im), intent(in) :: cmc, rho1, sheat, eta, & + real(kind=kind_phys), dimension(:), intent(in) :: cmc, rho1, sheat, eta, & flx1, flx2, flx3, sncovr, runoff1, runoff2, soilm, snowhk - real(kind=kind_phys), dimension(im), intent(in) :: weasd_save, snwdph_save, tsfc_save, tsurf, canopy_save, smcmax - real(kind=kind_phys), dimension(im,nsoil), intent(in) :: smc_save, stc_save, slc_save + real(kind=kind_phys), dimension(:), intent(in) :: weasd_save, snwdph_save, tsfc_save, tsurf, canopy_save, smcmax + real(kind=kind_phys), dimension(:,:), intent(in) :: smc_save, stc_save, slc_save - real(kind=kind_phys), dimension(im), intent(inout) :: canopy, shflx, lhflx, & + real(kind=kind_phys), dimension(:), intent(inout) :: canopy, shflx, lhflx, & snohf, snowc, runoff, drain, stm, wet1 - real(kind=kind_phys), dimension(im), intent(inout) :: weasd, snwdph, tsfc - real(kind=kind_phys), dimension(im, nsoil), intent(inout) :: smc, stc, slc + real(kind=kind_phys), dimension(:), intent(inout) :: weasd, snwdph, tsfc + real(kind=kind_phys), dimension(:,:), intent(inout) :: smc, stc, slc character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/sfc_noahmp_drv.F90 b/physics/sfc_noahmp_drv.F90 index 392e290712..e7ee1940a4 100644 --- a/physics/sfc_noahmp_drv.F90 +++ b/physics/sfc_noahmp_drv.F90 @@ -153,140 +153,141 @@ subroutine noahmpdrv_run & ! --- CCPP interface fields (in call order) ! - integer , intent(in) :: im ! horiz dimension and num of used pts - integer , intent(in) :: km ! vertical soil layer dimension - integer , intent(in) :: itime ! NOT USED - real(kind=kind_phys), dimension(im) , intent(in) :: ps ! surface pressure [Pa] - real(kind=kind_phys), dimension(im) , intent(in) :: u1 ! u-component of wind [m/s] - real(kind=kind_phys), dimension(im) , intent(in) :: v1 ! u-component of wind [m/s] - real(kind=kind_phys), dimension(im) , intent(in) :: t1 ! layer 1 temperature [K] - real(kind=kind_phys), dimension(im) , intent(in) :: q1 ! layer 1 specific humidity [kg/kg] - integer , dimension(im) , intent(in) :: soiltyp ! soil type (integer index) - integer , dimension(im) , intent(in) :: vegtype ! vegetation type (integer index) - real(kind=kind_phys), dimension(im) , intent(in) :: sigmaf ! areal fractional cover of green vegetation - real(kind=kind_phys), dimension(im) , intent(in) :: dlwflx ! downward longwave radiation [W/m2] - real(kind=kind_phys), dimension(im) , intent(in) :: dswsfc ! downward shortwave radiation [W/m2] - real(kind=kind_phys), dimension(im) , intent(in) :: snet ! total sky sfc netsw flx into ground[W/m2] - real(kind=kind_phys) , intent(in) :: delt ! time interval [s] - real(kind=kind_phys), dimension(im) , intent(in) :: tg3 ! deep soil temperature [K] - real(kind=kind_phys), dimension(im) , intent(in) :: cm ! surface exchange coeff for momentum [-] - real(kind=kind_phys), dimension(im) , intent(in) :: ch ! surface exchange coeff heat & moisture[-] - real(kind=kind_phys), dimension(im) , intent(in) :: prsl1 ! sfc layer 1 mean pressure [Pa] - real(kind=kind_phys), dimension(im) , intent(in) :: prslki ! to calculate potential temperature - real(kind=kind_phys), dimension(im) , intent(in) :: zf ! height of bottom layer [m] - logical , dimension(im) , intent(in) :: dry ! = T if a point with any land - real(kind=kind_phys), dimension(im) , intent(in) :: wind ! wind speed [m/s] - integer , dimension(im) , intent(in) :: slopetyp ! surface slope classification - real(kind=kind_phys), dimension(im) , intent(in) :: shdmin ! min green vegetation coverage [fraction] - real(kind=kind_phys), dimension(im) , intent(in) :: shdmax ! max green vegetation coverage [fraction] - real(kind=kind_phys), dimension(im) , intent(in) :: snoalb ! upper bound on max albedo over deep snow - real(kind=kind_phys), dimension(im) , intent(inout) :: sfalb ! mean surface albedo [fraction] - logical , dimension(im) , intent(in) :: flag_iter ! - logical , dimension(im) , intent(in) :: flag_guess ! - integer , intent(in) :: idveg ! option for dynamic vegetation - integer , intent(in) :: iopt_crs ! option for canopy stomatal resistance - integer , intent(in) :: iopt_btr ! option for soil moisture factor for stomatal resistance - integer , intent(in) :: iopt_run ! option for runoff and groundwater - integer , intent(in) :: iopt_sfc ! option for surface layer drag coeff (ch & cm) - integer , intent(in) :: iopt_frz ! option for supercooled liquid water (or ice fraction) - integer , intent(in) :: iopt_inf ! option for frozen soil permeability - integer , intent(in) :: iopt_rad ! option for radiation transfer - integer , intent(in) :: iopt_alb ! option for ground snow surface albedo - integer , intent(in) :: iopt_snf ! option for partitioning precipitation into rainfall & snowfall - integer , intent(in) :: iopt_tbot ! option for lower boundary condition of soil temperature - integer , intent(in) :: iopt_stc ! option for snow/soil temperature time scheme (only layer 1) - real(kind=kind_phys), dimension(im) , intent(in) :: xlatin ! latitude - real(kind=kind_phys), dimension(im) , intent(in) :: xcoszin ! cosine of zenith angle - integer , intent(in) :: iyrlen ! year length [days] - real(kind=kind_phys) , intent(in) :: julian ! julian day of year - real(kind=kind_phys), dimension(im) , intent(in) :: rainn_mp ! microphysics non-convective precipitation [mm] - real(kind=kind_phys), dimension(im) , intent(in) :: rainc_mp ! microphysics convective precipitation [mm] - real(kind=kind_phys), dimension(im) , intent(in) :: snow_mp ! microphysics snow [mm] - real(kind=kind_phys), dimension(im) , intent(in) :: graupel_mp ! microphysics graupel [mm] - real(kind=kind_phys), dimension(im) , intent(in) :: ice_mp ! microphysics ice/hail [mm] - real(kind=kind_phys) , intent(in) :: con_hvap ! latent heat condensation [J/kg] - real(kind=kind_phys) , intent(in) :: con_cp ! specific heat air [J/kg/K] - real(kind=kind_phys) , intent(in) :: con_jcal ! joules per calorie (not used) - real(kind=kind_phys) , intent(in) :: rhoh2o ! density of water [kg/m^3] - real(kind=kind_phys) , intent(in) :: con_eps ! Rd/Rv - real(kind=kind_phys) , intent(in) :: con_epsm1 ! Rd/Rv - 1 - real(kind=kind_phys) , intent(in) :: con_fvirt ! Rv/Rd - 1 - real(kind=kind_phys) , intent(in) :: con_rd ! gas constant air [J/kg/K] - real(kind=kind_phys) , intent(in) :: con_hfus ! lat heat H2O fusion [J/kg] - real(kind=kind_phys), dimension(im) , intent(inout) :: weasd ! water equivalent accumulated snow depth [mm] - real(kind=kind_phys), dimension(im) , intent(inout) :: snwdph ! snow depth [mm] - real(kind=kind_phys), dimension(im) , intent(inout) :: tskin ! ground surface skin temperature [K] - real(kind=kind_phys), dimension(im) , intent(inout) :: tprcp ! total precipitation [m] - real(kind=kind_phys), dimension(im) , intent(inout) :: srflag ! snow/rain flag for precipitation - real(kind=kind_phys), dimension(im,km) , intent(inout) :: smc ! total soil moisture content [m3/m3] - real(kind=kind_phys), dimension(im,km) , intent(inout) :: stc ! soil temp [K] - real(kind=kind_phys), dimension(im,km) , intent(inout) :: slc ! liquid soil moisture [m3/m3] - real(kind=kind_phys), dimension(im) , intent(inout) :: canopy ! canopy moisture content [mm] - real(kind=kind_phys), dimension(im) , intent(inout) :: trans ! total plant transpiration [m/s] - real(kind=kind_phys), dimension(im) , intent(inout) :: tsurf ! surface skin temperature [after iteration] - real(kind=kind_phys), dimension(im) , intent(inout) :: zorl ! surface roughness [cm] - real(kind=kind_phys), dimension(im) , intent(inout) :: snowxy ! actual no. of snow layers - real(kind=kind_phys), dimension(im) , intent(inout) :: tvxy ! vegetation leaf temperature [K] - real(kind=kind_phys), dimension(im) , intent(inout) :: tgxy ! bulk ground surface temperature [K] - real(kind=kind_phys), dimension(im) , intent(inout) :: canicexy ! canopy-intercepted ice [mm] - real(kind=kind_phys), dimension(im) , intent(inout) :: canliqxy ! canopy-intercepted liquid water [mm] - real(kind=kind_phys), dimension(im) , intent(inout) :: eahxy ! canopy air vapor pressure [Pa] - real(kind=kind_phys), dimension(im) , intent(inout) :: tahxy ! canopy air temperature [K] - real(kind=kind_phys), dimension(im) , intent(inout) :: cmxy ! bulk momentum drag coefficient [m/s] - real(kind=kind_phys), dimension(im) , intent(inout) :: chxy ! bulk sensible heat exchange coefficient [m/s] - real(kind=kind_phys), dimension(im) , intent(inout) :: fwetxy ! wetted or snowed fraction of the canopy [-] - real(kind=kind_phys), dimension(im) , intent(inout) :: sneqvoxy ! snow mass at last time step[mm h2o] - real(kind=kind_phys), dimension(im) , intent(inout) :: alboldxy ! snow albedo at last time step [-] - real(kind=kind_phys), dimension(im) , intent(inout) :: qsnowxy ! snowfall on the ground [mm/s] - real(kind=kind_phys), dimension(im) , intent(inout) :: wslakexy ! lake water storage [mm] - real(kind=kind_phys), dimension(im) , intent(inout) :: zwtxy ! water table depth [m] - real(kind=kind_phys), dimension(im) , intent(inout) :: waxy ! water in the "aquifer" [mm] - real(kind=kind_phys), dimension(im) , intent(inout) :: wtxy ! groundwater storage [mm] - real(kind=kind_phys), dimension(im,-2:0), intent(inout) :: tsnoxy ! snow temperature [K] - real(kind=kind_phys), dimension(im,-2:4), intent(inout) :: zsnsoxy ! snow/soil layer depth [m] - real(kind=kind_phys), dimension(im,-2:0), intent(inout) :: snicexy ! snow layer ice [mm] - real(kind=kind_phys), dimension(im,-2:0), intent(inout) :: snliqxy ! snow layer liquid water [mm] - real(kind=kind_phys), dimension(im) , intent(inout) :: lfmassxy ! leaf mass [g/m2] - real(kind=kind_phys), dimension(im) , intent(inout) :: rtmassxy ! mass of fine roots [g/m2] - real(kind=kind_phys), dimension(im) , intent(inout) :: stmassxy ! stem mass [g/m2] - real(kind=kind_phys), dimension(im) , intent(inout) :: woodxy ! mass of wood (incl. woody roots) [g/m2] - real(kind=kind_phys), dimension(im) , intent(inout) :: stblcpxy ! stable carbon in deep soil [g/m2] - real(kind=kind_phys), dimension(im) , intent(inout) :: fastcpxy ! short-lived carbon, shallow soil [g/m2] - real(kind=kind_phys), dimension(im) , intent(inout) :: xlaixy ! leaf area index [m2/m2] - real(kind=kind_phys), dimension(im) , intent(inout) :: xsaixy ! stem area index [m2/m2] - real(kind=kind_phys), dimension(im) , intent(inout) :: taussxy ! snow age factor [-] - real(kind=kind_phys), dimension(im,1:4) , intent(inout) :: smoiseq ! eq volumetric soil moisture [m3/m3] - real(kind=kind_phys), dimension(im) , intent(inout) :: smcwtdxy ! soil moisture content in the layer to the water table when deep - real(kind=kind_phys), dimension(im) , intent(inout) :: deeprechxy ! recharge to the water table when deep - real(kind=kind_phys), dimension(im) , intent(inout) :: rechxy ! recharge to the water table - real(kind=kind_phys), dimension(im) , intent(out) :: albdvis ! albedo - direct visible [fraction] - real(kind=kind_phys), dimension(im) , intent(out) :: albdnir ! albedo - direct NIR [fraction] - real(kind=kind_phys), dimension(im) , intent(out) :: albivis ! albedo - diffuse visible [fraction] - real(kind=kind_phys), dimension(im) , intent(out) :: albinir ! albedo - diffuse NIR [fraction] - real(kind=kind_phys), dimension(im) , intent(out) :: emiss ! sfc lw emissivity [fraction] - real(kind=kind_phys), dimension(im) , intent(out) :: sncovr1 ! snow cover over land [fraction] - real(kind=kind_phys), dimension(im) , intent(out) :: qsurf ! specific humidity at sfc [kg/kg] - real(kind=kind_phys), dimension(im) , intent(out) :: gflux ! soil heat flux [W/m2] - real(kind=kind_phys), dimension(im) , intent(out) :: drain ! subsurface runoff [mm/s] - real(kind=kind_phys), dimension(im) , intent(out) :: evap ! total latent heat flux [W/m2] - real(kind=kind_phys), dimension(im) , intent(out) :: hflx ! sensible heat flux [W/m2] - real(kind=kind_phys), dimension(im) , intent(out) :: ep ! potential evaporation [mm/s?] - real(kind=kind_phys), dimension(im) , intent(out) :: runoff ! surface runoff [mm/s] - real(kind=kind_phys), dimension(im) , intent(out) :: cmm ! cm*U [m/s] - real(kind=kind_phys), dimension(im) , intent(out) :: chh ! ch*U*rho [kg/m2/s] - real(kind=kind_phys), dimension(im) , intent(out) :: evbs ! direct soil evaporation [m/s] - real(kind=kind_phys), dimension(im) , intent(out) :: evcw ! canopy water evaporation [m/s] - real(kind=kind_phys), dimension(im) , intent(out) :: sbsno ! sublimation/deposit from snopack [W/m2] - real(kind=kind_phys), dimension(im) , intent(out) :: snowc ! fractional snow cover [-] - real(kind=kind_phys), dimension(im) , intent(out) :: stm ! total soil column moisture content [mm] - real(kind=kind_phys), dimension(im) , intent(out) :: snohf ! snow/freezing-rain latent heat flux [W/m2] - real(kind=kind_phys), dimension(im) , intent(out) :: smcwlt2 ! dry soil moisture threshold [m3/m3] - real(kind=kind_phys), dimension(im) , intent(out) :: smcref2 ! soil moisture threshold [m3/m3] - real(kind=kind_phys), dimension(im) , intent(out) :: wet1 ! normalized surface soil saturated fraction - real(kind=kind_phys), dimension(im) , intent(out) :: t2mmp ! combined T2m from tiles - real(kind=kind_phys), dimension(im) , intent(out) :: q2mp ! combined q2m from tiles - character(len=*) , intent(out) :: errmsg - integer , intent(out) :: errflg + integer , intent(in) :: im ! horiz dimension and num of used pts + integer , intent(in) :: km ! vertical soil layer dimension + integer, , intent(in) :: lsnowl ! lower bound for snow level arrays + integer , intent(in) :: itime ! NOT USED + real(kind=kind_phys), dimension(:) , intent(in) :: ps ! surface pressure [Pa] + real(kind=kind_phys), dimension(:) , intent(in) :: u1 ! u-component of wind [m/s] + real(kind=kind_phys), dimension(:) , intent(in) :: v1 ! u-component of wind [m/s] + real(kind=kind_phys), dimension(:) , intent(in) :: t1 ! layer 1 temperature [K] + real(kind=kind_phys), dimension(:) , intent(in) :: q1 ! layer 1 specific humidity [kg/kg] + integer , dimension(:) , intent(in) :: soiltyp ! soil type (integer index) + integer , dimension(:) , intent(in) :: vegtype ! vegetation type (integer index) + real(kind=kind_phys), dimension(:) , intent(in) :: sigmaf ! areal fractional cover of green vegetation + real(kind=kind_phys), dimension(:) , intent(in) :: dlwflx ! downward longwave radiation [W/m2] + real(kind=kind_phys), dimension(:) , intent(in) :: dswsfc ! downward shortwave radiation [W/m2] + real(kind=kind_phys), dimension(:) , intent(in) :: snet ! total sky sfc netsw flx into ground[W/m2] + real(kind=kind_phys) , intent(in) :: delt ! time interval [s] + real(kind=kind_phys), dimension(:) , intent(in) :: tg3 ! deep soil temperature [K] + real(kind=kind_phys), dimension(:) , intent(in) :: cm ! surface exchange coeff for momentum [-] + real(kind=kind_phys), dimension(:) , intent(in) :: ch ! surface exchange coeff heat & moisture[-] + real(kind=kind_phys), dimension(:) , intent(in) :: prsl1 ! sfc layer 1 mean pressure [Pa] + real(kind=kind_phys), dimension(:) , intent(in) :: prslki ! to calculate potential temperature + real(kind=kind_phys), dimension(:) , intent(in) :: zf ! height of bottom layer [m] + logical , dimension(:) , intent(in) :: dry ! = T if a point with any land + real(kind=kind_phys), dimension(:) , intent(in) :: wind ! wind speed [m/s] + integer , dimension(:) , intent(in) :: slopetyp ! surface slope classification + real(kind=kind_phys), dimension(:) , intent(in) :: shdmin ! min green vegetation coverage [fraction] + real(kind=kind_phys), dimension(:) , intent(in) :: shdmax ! max green vegetation coverage [fraction] + real(kind=kind_phys), dimension(:) , intent(in) :: snoalb ! upper bound on max albedo over deep snow + real(kind=kind_phys), dimension(:) , intent(inout) :: sfalb ! mean surface albedo [fraction] + logical , dimension(:) , intent(in) :: flag_iter ! + logical , dimension(:) , intent(in) :: flag_guess ! + integer , intent(in) :: idveg ! option for dynamic vegetation + integer , intent(in) :: iopt_crs ! option for canopy stomatal resistance + integer , intent(in) :: iopt_btr ! option for soil moisture factor for stomatal resistance + integer , intent(in) :: iopt_run ! option for runoff and groundwater + integer , intent(in) :: iopt_sfc ! option for surface layer drag coeff (ch & cm) + integer , intent(in) :: iopt_frz ! option for supercooled liquid water (or ice fraction) + integer , intent(in) :: iopt_inf ! option for frozen soil permeability + integer , intent(in) :: iopt_rad ! option for radiation transfer + integer , intent(in) :: iopt_alb ! option for ground snow surface albedo + integer , intent(in) :: iopt_snf ! option for partitioning precipitation into rainfall & snowfall + integer , intent(in) :: iopt_tbot ! option for lower boundary condition of soil temperature + integer , intent(in) :: iopt_stc ! option for snow/soil temperature time scheme (only layer 1) + real(kind=kind_phys), dimension(;) , intent(in) :: xlatin ! latitude + real(kind=kind_phys), dimension(;) , intent(in) :: xcoszin ! cosine of zenith angle + integer , intent(in) :: iyrlen ! year length [days] + real(kind=kind_phys) , intent(in) :: julian ! julian day of year + real(kind=kind_phys), dimension(:) , intent(in) :: rainn_mp ! microphysics non-convective precipitation [mm] + real(kind=kind_phys), dimension(:) , intent(in) :: rainc_mp ! microphysics convective precipitation [mm] + real(kind=kind_phys), dimension(:) , intent(in) :: snow_mp ! microphysics snow [mm] + real(kind=kind_phys), dimension(:) , intent(in) :: graupel_mp ! microphysics graupel [mm] + real(kind=kind_phys), dimension(:) , intent(in) :: ice_mp ! microphysics ice/hail [mm] + real(kind=kind_phys) , intent(in) :: con_hvap ! latent heat condensation [J/kg] + real(kind=kind_phys) , intent(in) :: con_cp ! specific heat air [J/kg/K] + real(kind=kind_phys) , intent(in) :: con_jcal ! joules per calorie (not used) + real(kind=kind_phys) , intent(in) :: rhoh2o ! density of water [kg/m^3] + real(kind=kind_phys) , intent(in) :: con_eps ! Rd/Rv + real(kind=kind_phys) , intent(in) :: con_epsm1 ! Rd/Rv - 1 + real(kind=kind_phys) , intent(in) :: con_fvirt ! Rv/Rd - 1 + real(kind=kind_phys) , intent(in) :: con_rd ! gas constant air [J/kg/K] + real(kind=kind_phys) , intent(in) :: con_hfus ! lat heat H2O fusion [J/kg] + real(kind=kind_phys), dimension(:) , intent(inout) :: weasd ! water equivalent accumulated snow depth [mm] + real(kind=kind_phys), dimension(:) , intent(inout) :: snwdph ! snow depth [mm] + real(kind=kind_phys), dimension(:) , intent(inout) :: tskin ! ground surface skin temperature [K] + real(kind=kind_phys), dimension(:) , intent(inout) :: tprcp ! total precipitation [m] + real(kind=kind_phys), dimension(:) , intent(inout) :: srflag ! snow/rain flag for precipitation + real(kind=kind_phys), dimension(:,:) , intent(inout) :: smc ! total soil moisture content [m3/m3] + real(kind=kind_phys), dimension(:,:) , intent(inout) :: stc ! soil temp [K] + real(kind=kind_phys), dimension(:,:) , intent(inout) :: slc ! liquid soil moisture [m3/m3] + real(kind=kind_phys), dimension(:) , intent(inout) :: canopy ! canopy moisture content [mm] + real(kind=kind_phys), dimension(:) , intent(inout) :: trans ! total plant transpiration [m/s] + real(kind=kind_phys), dimension(:) , intent(inout) :: tsurf ! surface skin temperature [after iteration] + real(kind=kind_phys), dimension(:) , intent(inout) :: zorl ! surface roughness [cm] + real(kind=kind_phys), dimension(:) , intent(inout) :: snowxy ! actual no. of snow layers + real(kind=kind_phys), dimension(:) , intent(inout) :: tvxy ! vegetation leaf temperature [K] + real(kind=kind_phys), dimension(:) , intent(inout) :: tgxy ! bulk ground surface temperature [K] + real(kind=kind_phys), dimension(:) , intent(inout) :: canicexy ! canopy-intercepted ice [mm] + real(kind=kind_phys), dimension(:) , intent(inout) :: canliqxy ! canopy-intercepted liquid water [mm] + real(kind=kind_phys), dimension(:) , intent(inout) :: eahxy ! canopy air vapor pressure [Pa] + real(kind=kind_phys), dimension(:) , intent(inout) :: tahxy ! canopy air temperature [K] + real(kind=kind_phys), dimension(:) , intent(inout) :: cmxy ! bulk momentum drag coefficient [m/s] + real(kind=kind_phys), dimension(:) , intent(inout) :: chxy ! bulk sensible heat exchange coefficient [m/s] + real(kind=kind_phys), dimension(:) , intent(inout) :: fwetxy ! wetted or snowed fraction of the canopy [-] + real(kind=kind_phys), dimension(:) , intent(inout) :: sneqvoxy ! snow mass at last time step[mm h2o] + real(kind=kind_phys), dimension(:) , intent(inout) :: alboldxy ! snow albedo at last time step [-] + real(kind=kind_phys), dimension(:) , intent(inout) :: qsnowxy ! snowfall on the ground [mm/s] + real(kind=kind_phys), dimension(:) , intent(inout) :: wslakexy ! lake water storage [mm] + real(kind=kind_phys), dimension(:) , intent(inout) :: zwtxy ! water table depth [m] + real(kind=kind_phys), dimension(:) , intent(inout) :: waxy ! water in the "aquifer" [mm] + real(kind=kind_phys), dimension(:) , intent(inout) :: wtxy ! groundwater storage [mm] + real(kind=kind_phys), dimension(:,lsnowl:), intent(inout) :: tsnoxy ! snow temperature [K] + real(kind=kind_phys), dimension(:,lsnowl:), intent(inout) :: zsnsoxy ! snow/soil layer depth [m] + real(kind=kind_phys), dimension(:,lsnowl:), intent(inout) :: snicexy ! snow layer ice [mm] + real(kind=kind_phys), dimension(:,lsnowl:), intent(inout) :: snliqxy ! snow layer liquid water [mm] + real(kind=kind_phys), dimension(:) , intent(inout) :: lfmassxy ! leaf mass [g/m2] + real(kind=kind_phys), dimension(:) , intent(inout) :: rtmassxy ! mass of fine roots [g/m2] + real(kind=kind_phys), dimension(:) , intent(inout) :: stmassxy ! stem mass [g/m2] + real(kind=kind_phys), dimension(:) , intent(inout) :: woodxy ! mass of wood (incl. woody roots) [g/m2] + real(kind=kind_phys), dimension(:) , intent(inout) :: stblcpxy ! stable carbon in deep soil [g/m2] + real(kind=kind_phys), dimension(:) , intent(inout) :: fastcpxy ! short-lived carbon, shallow soil [g/m2] + real(kind=kind_phys), dimension(:) , intent(inout) :: xlaixy ! leaf area index [m2/m2] + real(kind=kind_phys), dimension(:) , intent(inout) :: xsaixy ! stem area index [m2/m2] + real(kind=kind_phys), dimension(:) , intent(inout) :: taussxy ! snow age factor [-] + real(kind=kind_phys), dimension(:,:) , intent(inout) :: smoiseq ! eq volumetric soil moisture [m3/m3] + real(kind=kind_phys), dimension(:) , intent(inout) :: smcwtdxy ! soil moisture content in the layer to the water table when deep + real(kind=kind_phys), dimension(:) , intent(inout) :: deeprechxy ! recharge to the water table when deep + real(kind=kind_phys), dimension(:) , intent(inout) :: rechxy ! recharge to the water table + real(kind=kind_phys), dimension(:) , intent(out) :: albdvis ! albedo - direct visible [fraction] + real(kind=kind_phys), dimension(:) , intent(out) :: albdnir ! albedo - direct NIR [fraction] + real(kind=kind_phys), dimension(:) , intent(out) :: albivis ! albedo - diffuse visible [fraction] + real(kind=kind_phys), dimension(:) , intent(out) :: albinir ! albedo - diffuse NIR [fraction] + real(kind=kind_phys), dimension(:) , intent(out) :: emiss ! sfc lw emissivity [fraction] + real(kind=kind_phys), dimension(:) , intent(out) :: sncovr1 ! snow cover over land [fraction] + real(kind=kind_phys), dimension(:) , intent(out) :: qsurf ! specific humidity at sfc [kg/kg] + real(kind=kind_phys), dimension(:) , intent(out) :: gflux ! soil heat flux [W/m2] + real(kind=kind_phys), dimension(:) , intent(out) :: drain ! subsurface runoff [mm/s] + real(kind=kind_phys), dimension(:) , intent(out) :: evap ! total latent heat flux [W/m2] + real(kind=kind_phys), dimension(:) , intent(out) :: hflx ! sensible heat flux [W/m2] + real(kind=kind_phys), dimension(:) , intent(out) :: ep ! potential evaporation [mm/s?] + real(kind=kind_phys), dimension(:) , intent(out) :: runoff ! surface runoff [mm/s] + real(kind=kind_phys), dimension(:) , intent(out) :: cmm ! cm*U [m/s] + real(kind=kind_phys), dimension(:) , intent(out) :: chh ! ch*U*rho [kg/m2/s] + real(kind=kind_phys), dimension(:) , intent(out) :: evbs ! direct soil evaporation [m/s] + real(kind=kind_phys), dimension(:) , intent(out) :: evcw ! canopy water evaporation [m/s] + real(kind=kind_phys), dimension(:) , intent(out) :: sbsno ! sublimation/deposit from snopack [W/m2] + real(kind=kind_phys), dimension(:) , intent(out) :: snowc ! fractional snow cover [-] + real(kind=kind_phys), dimension(:) , intent(out) :: stm ! total soil column moisture content [mm] + real(kind=kind_phys), dimension(:) , intent(out) :: snohf ! snow/freezing-rain latent heat flux [W/m2] + real(kind=kind_phys), dimension(:) , intent(out) :: smcwlt2 ! dry soil moisture threshold [m3/m3] + real(kind=kind_phys), dimension(:) , intent(out) :: smcref2 ! soil moisture threshold [m3/m3] + real(kind=kind_phys), dimension(:) , intent(out) :: wet1 ! normalized surface soil saturated fraction + real(kind=kind_phys), dimension(:) , intent(out) :: t2mmp ! combined T2m from tiles + real(kind=kind_phys), dimension(:) , intent(out) :: q2mp ! combined q2m from tiles + character(len=*) , intent(out) :: errmsg + integer , intent(out) :: errflg ! ! --- some new options, hard code for now @@ -339,11 +340,11 @@ subroutine noahmpdrv_run & real(kind=kind_phys), dimension(im, km) :: stc_old real(kind=kind_phys), dimension(im, km) :: slc_old real(kind=kind_phys), dimension(im, km) :: smoiseq_old - real(kind=kind_phys), dimension(im,-2: 0) :: tsno_old - real(kind=kind_phys), dimension(im,-2: 0) :: snice_old - real(kind=kind_phys), dimension(im,-2: 0) :: snliq_old - real(kind=kind_phys), dimension(im,-2:km) :: zsnso_old - real(kind=kind_phys), dimension(im,-2:km) :: tsnso_old + real(kind=kind_phys), dimension(im,lsnowl: 0) :: tsno_old + real(kind=kind_phys), dimension(im,lsnowl: 0) :: snice_old + real(kind=kind_phys), dimension(im,lsnowl: 0) :: snliq_old + real(kind=kind_phys), dimension(im,lsnowl:km) :: zsnso_old + real(kind=kind_phys), dimension(im,lsnowl:km) :: tsnso_old ! ! --- local inputs to noah-mp and glacier subroutines; listed in order in noah-mp call diff --git a/physics/sfc_noahmp_drv.meta b/physics/sfc_noahmp_drv.meta index f1dbbf1ad4..0674e9cc3f 100644 --- a/physics/sfc_noahmp_drv.meta +++ b/physics/sfc_noahmp_drv.meta @@ -93,6 +93,14 @@ type = integer intent = in optional = F +[lsnowl] + standard_name = lower_bound_of_snow_vertical_dimension_for_land_surface_model + long_name = lower bound of of snow-related arrays for land surface model + units = count + dimensions = () + type = integer + intent = in + optional = F [itime] standard_name = index_of_time_step long_name = current forecast iteration diff --git a/physics/sfc_nst.f b/physics/sfc_nst.f index bb28c62756..7a2dd9e097 100644 --- a/physics/sfc_nst.f +++ b/physics/sfc_nst.f @@ -787,20 +787,19 @@ subroutine sfc_nst_post_run & ! --- inputs: integer, intent(in) :: im, nthreads - logical, dimension(im), intent(in) :: wet, icy + logical, dimension(:), intent(in) :: wet, icy real (kind=kind_phys), intent(in) :: rlapse, tgice - real (kind=kind_phys), dimension(im), intent(in) :: oro, oro_uf + real (kind=kind_phys), dimension(:), intent(in) :: oro, oro_uf integer, intent(in) :: nstf_name1, nstf_name4, nstf_name5 - real (kind=kind_phys), dimension(im), intent(in) :: xt, xz, & + real (kind=kind_phys), dimension(:), intent(in) :: xt, xz, & & dt_cool, z_c, tref, xlon ! --- input/outputs: - real (kind=kind_phys), dimension(im), intent(inout) :: tsurf_wat, & + real (kind=kind_phys), dimension(:), intent(inout) :: tsurf_wat, & & tsfc_wat ! --- outputs: - real (kind=kind_phys), dimension(size(xlon,1)), intent(out) :: & - & dtzm + real (kind=kind_phys), dimension(:), intent(out) :: dtzm character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/shinhongvdif.F90 b/physics/shinhongvdif.F90 index f186c7bece..14fc6b49d2 100644 --- a/physics/shinhongvdif.F90 +++ b/physics/shinhongvdif.F90 @@ -111,33 +111,33 @@ subroutine shinhongvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & logical, intent(in ) :: lssav, ldiag3d, qdiag3d, & flag_for_pbl_generic_tend ! 3D in - real(kind=kind_phys), dimension(:,:) , & + real(kind=kind_phys), dimension(:,:) , & intent(in ) :: phil, & pi2d, & p2d, & ux, & vx, & tx - real(kind=kind_phys), dimension( im, km, ntrac ) , & + real(kind=kind_phys), dimension(:,:,:) , & intent(in ) :: qx - real(kind=kind_phys), dimension( :,: ) , & + real(kind=kind_phys), dimension(:,:) , & intent(in ) :: p2di, & phii ! 3D in&out - real(kind=kind_phys), dimension(:,:) , & + real(kind=kind_phys), dimension(:,:) , & intent(inout) :: utnp, & vtnp, & ttnp - real(kind=kind_phys), dimension(:,:, : ) , & + real(kind=kind_phys), dimension(:,:,:) , & intent(inout) :: qtnp - real(kind=kind_phys), dimension(:,:) , & + real(kind=kind_phys), dimension(:,:) , & intent(inout) :: du3dt_PBL, dv3dt_PBL, dt3dt_PBL, dq3dt_PBL, do3dt_PBL ! 2D in - integer, dimension(:) , & + integer, dimension(:) , & intent(in ) :: landmask - real(kind=kind_phys), dimension(:) , & + real(kind=kind_phys), dimension(:) , & intent(in ) :: heat, & evap, & br, & @@ -151,10 +151,10 @@ subroutine shinhongvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & v10, & dx ! 2D: out - integer, dimension(:) , & + integer, dimension(:) , & intent(out ) :: kpbl1d - real(kind=kind_phys), dimension(:) , & + real(kind=kind_phys), dimension(:) , & intent(out ) :: hpbl, & dusfc, & dvsfc, & diff --git a/physics/ugwpv1_gsldrag.F90 b/physics/ugwpv1_gsldrag.F90 index 649d994a89..c06fb067ff 100644 --- a/physics/ugwpv1_gsldrag.F90 +++ b/physics/ugwpv1_gsldrag.F90 @@ -84,15 +84,15 @@ subroutine ugwpv1_gsldrag_init ( & integer, intent (in) :: nlunit character(len=*), intent (in) :: input_nml_file(:) integer, intent (in) :: logunit - integer, intent(in) :: jdat(8) + integer, intent (in) :: jdat(:) integer, intent (in) :: lonr integer, intent (in) :: levs integer, intent (in) :: latr - real(kind=kind_phys), intent (in) :: ak(levs+1), bk(levs+1) + real(kind=kind_phys), intent (in) :: ak(:), bk(:) real(kind=kind_phys), intent (in) :: dtp real(kind=kind_phys), intent (in) :: con_p0, con_pi, con_rerth - real(kind=kind_phys), intent(in) :: con_g, con_cp, con_rd, con_rv, con_omega, con_fvirt + real(kind=kind_phys), intent (in) :: con_g, con_cp, con_rd, con_rv, con_omega, con_fvirt logical, intent (in) :: do_ugwp logical, intent (in) :: do_ugwp_v0, do_ugwp_v0_orog_only, & @@ -308,7 +308,6 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ntrac, lonr, dtp, fhzero,kd ldiag3d, lssav, flag_for_gwd_generic_tend, do_gsl_drag_ls_bl, do_gsl_drag_ss, & do_gsl_drag_tofd, do_ugwp_v1, do_ugwp_v1_orog_only, do_ugwp_v1_w_gsldrag, & gwd_opt, do_tofd, ldiag_ugwp, cdmbgwd, jdat, & -! con_g, con_omega, con_pi, con_cp, con_rd, con_rv, con_rerth, con_fvirt, & nmtvr, hprime, oc, theta, sigma, gamma, elvmax, clx, oa4, & varss,oc1ss,oa4ss,ol4ss, dx, xlat, xlat_d, sinlat, coslat, area, & rain, br1, hpbl, kpbl, slmsk, & @@ -318,10 +317,10 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ntrac, lonr, dtp, fhzero,kd dudt_oss, dvdt_oss, du_osscol, dv_osscol, & dudt_ofd, dvdt_ofd, du_ofdcol, dv_ofdcol, & dudt_ngw, dvdt_ngw, dtdt_ngw, kdis_ngw, dudt_gw, dvdt_gw, dtdt_gw, kdis_gw, & - tau_ogw, tau_ngw, tau_oss, & + tau_ogw, tau_ngw, tau_oss, & zogw, zlwb, zobl, zngw, dusfcg, dvsfcg, dudt, dvdt, dtdt, rdxzb, & ldu3dt_ogw, ldv3dt_ogw, ldt3dt_ogw, ldu3dt_ngw, ldv3dt_ngw, ldt3dt_ngw, & - lprnt, ipr, errmsg, errflg) + lprnt, ipr, errmsg, errflg) ! !######################################################################## ! Attention New Arrays and Names must be ADDED inside @@ -364,20 +363,20 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ntrac, lonr, dtp, fhzero,kd integer, intent(in) :: me, master, im, levs, ntrac,lonr real(kind=kind_phys), intent(in) :: dtp, fhzero - integer, intent(in) :: kdt, jdat(8) + integer, intent(in) :: kdt, jdat(:) ! SSO parameters and variables integer, intent(in) :: gwd_opt !gwd_opt and nmtvr are "redundant" controls integer, intent(in) :: nmtvr - real(kind=kind_phys), intent(in) :: cdmbgwd(4) ! for gsl_drag + real(kind=kind_phys), intent(in) :: cdmbgwd(:) ! for gsl_drag - real(kind=kind_phys), intent(in), dimension(im) :: hprime, oc, theta, sigma, gamma + real(kind=kind_phys), intent(in), dimension(:) :: hprime, oc, theta, sigma, gamma - real(kind=kind_phys), intent(in), dimension(im) :: elvmax - real(kind=kind_phys), intent(in), dimension(im, 4) :: clx, oa4 + real(kind=kind_phys), intent(in), dimension(:) :: elvmax + real(kind=kind_phys), intent(in), dimension(:,:) :: clx, oa4 - real(kind=kind_phys), intent(in), dimension(im) :: varss,oc1ss,dx - real(kind=kind_phys), intent(in), dimension(im, 4) :: oa4ss,ol4ss + real(kind=kind_phys), intent(in), dimension(:) :: varss,oc1ss,dx + real(kind=kind_phys), intent(in), dimension(:,:) :: oa4ss,ol4ss !===== !ccpp-style passing constants, I prefer to take them out from the "call-subr" list @@ -386,48 +385,48 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ntrac, lonr, dtp, fhzero,kd ! con_rv, con_rerth, con_fvirt ! grids - real(kind=kind_phys), intent(in), dimension(im) :: xlat, xlat_d, sinlat, coslat, area + real(kind=kind_phys), intent(in), dimension(:) :: xlat, xlat_d, sinlat, coslat, area ! State vars + PBL/slmsk +rain - real(kind=kind_phys), intent(in), dimension(im, levs) :: del, ugrs, vgrs, tgrs, prsl, prslk, phil - real(kind=kind_phys), intent(in), dimension(im, levs+1) :: prsi, phii - real(kind=kind_phys), intent(in), dimension(im, levs) :: q1 - integer, intent(in), dimension(im) :: kpbl + real(kind=kind_phys), intent(in), dimension(:,:) :: del, ugrs, vgrs, tgrs, prsl, prslk, phil + real(kind=kind_phys), intent(in), dimension(:,:) :: prsi, phii + real(kind=kind_phys), intent(in), dimension(:,:) :: q1 + integer, intent(in), dimension(:) :: kpbl - real(kind=kind_phys), intent(in), dimension(im) :: rain - real(kind=kind_phys), intent(in), dimension(im) :: br1, hpbl, slmsk + real(kind=kind_phys), intent(in), dimension(:) :: rain + real(kind=kind_phys), intent(in), dimension(:) :: br1, hpbl, slmsk ! ! moved to GFS_phys_time_vary -! real(kind=kind_phys), intent(in), dimension(im) :: ddy_j1tau, ddy_j2tau -! integer, intent(in), dimension(im) :: jindx1_tau, jindx2_tau - real(kind=kind_phys), intent(in), dimension(im) :: tau_amf +! real(kind=kind_phys), intent(in), dimension(:) :: ddy_j1tau, ddy_j2tau +! integer, intent(in), dimension(:) :: jindx1_tau, jindx2_tau + real(kind=kind_phys), intent(in), dimension(:) :: tau_amf !Output (optional): - real(kind=kind_phys), intent(out), dimension(im) :: & + real(kind=kind_phys), intent(out), dimension(:) :: & du_ogwcol, dv_ogwcol, du_oblcol, dv_oblcol, & du_osscol, dv_osscol, du_ofdcol, dv_ofdcol ! ! we may add later but due to launch in the upper layes ~ mPa comparing to ORO Pa*(0.1) ! du_ngwcol, dv_ngwcol - real(kind=kind_phys), intent(out), dimension(im) :: dusfcg, dvsfcg - real(kind=kind_phys), intent(out), dimension(im) :: tau_ogw, tau_ngw, tau_oss + real(kind=kind_phys), intent(out), dimension(:) :: dusfcg, dvsfcg + real(kind=kind_phys), intent(out), dimension(:) :: tau_ogw, tau_ngw, tau_oss - real(kind=kind_phys), intent(out) , dimension(im, levs) :: & + real(kind=kind_phys), intent(out) , dimension(:,:) :: & dudt_ogw, dvdt_ogw, dudt_obl, dvdt_obl, & dudt_oss, dvdt_oss, dudt_ofd, dvdt_ofd - real(kind=kind_phys), intent(out) , dimension(im, levs) :: dudt_ngw, dvdt_ngw, kdis_ngw - real(kind=kind_phys), intent(out) , dimension(im, levs) :: dudt_gw, dvdt_gw, kdis_gw + real(kind=kind_phys), intent(out) , dimension(:,:) :: dudt_ngw, dvdt_ngw, kdis_ngw + real(kind=kind_phys), intent(out) , dimension(:,:) :: dudt_gw, dvdt_gw, kdis_gw - real(kind=kind_phys), intent(out) , dimension(im, levs) :: dtdt_ngw, dtdt_gw + real(kind=kind_phys), intent(out) , dimension(:,:) :: dtdt_ngw, dtdt_gw - real(kind=kind_phys), intent(out) , dimension(im) :: zogw, zlwb, zobl, zngw + real(kind=kind_phys), intent(out) , dimension(:) :: zogw, zlwb, zobl, zngw ! ! - real(kind=kind_phys), intent(inout), dimension(im, levs) :: dudt, dvdt, dtdt + real(kind=kind_phys), intent(inout), dimension(:,:) :: dudt, dvdt, dtdt ! ! These arrays are only allocated if ldiag=.true. @@ -439,7 +438,7 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ntrac, lonr, dtp, fhzero,kd - real(kind=kind_phys), intent(out), dimension(im) :: rdxzb ! for stoch phys. mtb-level + real(kind=kind_phys), intent(out), dimension(:) :: rdxzb ! for stoch phys. mtb-level character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/unified_ugwp.F90 b/physics/unified_ugwp.F90 index 7fdc43b2b9..64b9230212 100644 --- a/physics/unified_ugwp.F90 +++ b/physics/unified_ugwp.F90 @@ -74,13 +74,13 @@ subroutine unified_ugwp_init (me, master, nlunit, input_nml_file, logunit, & integer, intent (in) :: nlunit character(len=*), intent (in) :: input_nml_file(:) integer, intent (in) :: logunit - integer, intent(in) :: jdat(8) + integer, intent (in) :: jdat(:) integer, intent (in) :: lonr integer, intent (in) :: levs integer, intent (in) :: latr real(kind=kind_phys), intent (in) :: ak(:), bk(:) real(kind=kind_phys), intent (in) :: dtp - real(kind=kind_phys), intent (in) :: cdmbgwd(4), cgwf(2) ! "scaling" controls for "old" GFS-GW schemes + real(kind=kind_phys), intent (in) :: cdmbgwd(:), cgwf(:) ! "scaling" controls for "old" GFS-GW schemes real(kind=kind_phys), intent (in) :: pa_rf_in, tau_rf_in real(kind=kind_phys), intent (in) :: con_p0, con_pi, con_rerth logical, intent (in) :: do_ugwp @@ -216,25 +216,25 @@ subroutine unified_ugwp_run(me, master, im, levs, ntrac, dtp, fhzero, kdt, ! interface variables integer, intent(in) :: me, master, im, levs, ntrac, kdt, lonr, nmtvr integer, intent(in) :: gwd_opt - integer, intent(in), dimension(im) :: kpbl - real(kind=kind_phys), intent(in), dimension(im) :: oro, oro_uf, hprime, oc, theta, sigma, gamma - real(kind=kind_phys), intent(in), dimension(im) :: varss,oc1ss, dx + integer, intent(in), dimension(:) :: kpbl + real(kind=kind_phys), intent(in), dimension(:) :: oro, oro_uf, hprime, oc, theta, sigma, gamma + real(kind=kind_phys), intent(in), dimension(:) :: varss,oc1ss, dx !vay-nov 2020 - real(kind=kind_phys), intent(in), dimension(im,4) :: oa4ss,ol4ss + real(kind=kind_phys), intent(in), dimension(:,:) :: oa4ss,ol4ss - logical, intent(in) :: flag_for_gwd_generic_tend + logical, intent(in) :: flag_for_gwd_generic_tend ! elvmax is intent(in) for CIRES UGWPv1, but intent(inout) for GFS GWDPS - real(kind=kind_phys), intent(inout), dimension(im) :: elvmax - real(kind=kind_phys), intent(in), dimension(im, 4) :: clx, oa4 - real(kind=kind_phys), intent(in), dimension(im) :: xlat, xlat_d, sinlat, coslat, area - real(kind=kind_phys), intent(in), dimension(im, levs) :: del, ugrs, vgrs, tgrs, prsl, prslk, phil - real(kind=kind_phys), intent(in), dimension(im, levs+1) :: prsi, phii - real(kind=kind_phys), intent(in), dimension(im, levs) :: q1 - real(kind=kind_phys), intent(in) :: dtp, fhzero, cdmbgwd(4) - integer, intent(in) :: jdat(8) + real(kind=kind_phys), intent(inout), dimension(:) :: elvmax + real(kind=kind_phys), intent(in), dimension(:,:) :: clx, oa4 + real(kind=kind_phys), intent(in), dimension(:) :: xlat, xlat_d, sinlat, coslat, area + real(kind=kind_phys), intent(in), dimension(:,:) :: del, ugrs, vgrs, tgrs, prsl, prslk, phil + real(kind=kind_phys), intent(in), dimension(:,:) :: prsi, phii + real(kind=kind_phys), intent(in), dimension(:,:) :: q1 + real(kind=kind_phys), intent(in) :: dtp, fhzero, cdmbgwd(:) + integer, intent(in) :: jdat(:) logical, intent(in) :: do_tofd, ldiag_ugwp !Output (optional): @@ -248,14 +248,14 @@ subroutine unified_ugwp_run(me, master, im, levs, ntrac, dtp, fhzero, kdt, & dtaux2d_ss(:,:),dtauy2d_ss(:,:), & & dtaux2d_fd(:,:),dtauy2d_fd(:,:) - real(kind=kind_phys), intent(in) :: br1(im), & - & hpbl(im), & - & slmsk(im) + real(kind=kind_phys), intent(in) :: br1(:), & + & hpbl(:), & + & slmsk(:) - real(kind=kind_phys), intent(out), dimension(im) :: dusfcg, dvsfcg - real(kind=kind_phys), intent(out), dimension(im) :: zmtb, zlwb, zogw, rdxzb - real(kind=kind_phys), intent(out), dimension(im) :: tau_mtb, tau_ogw, tau_tofd, tau_ngw - real(kind=kind_phys), intent(out), dimension(im, levs) :: gw_dudt, gw_dvdt, gw_dtdt, gw_kdis + real(kind=kind_phys), intent(out), dimension(:) :: dusfcg, dvsfcg + real(kind=kind_phys), intent(out), dimension(:) :: zmtb, zlwb, zogw, rdxzb + real(kind=kind_phys), intent(out), dimension(:) :: tau_mtb, tau_ogw, tau_tofd, tau_ngw + real(kind=kind_phys), intent(out), dimension(:,:) :: gw_dudt, gw_dvdt, gw_dtdt, gw_kdis real(kind=kind_phys), intent(out), dimension(:,:) :: dudt_mtb, dudt_tms real(kind=kind_phys), intent(out), dimension(:,:) :: dtaux2d_ls, dtauy2d_ls @@ -267,12 +267,12 @@ subroutine unified_ugwp_run(me, master, im, levs, ntrac, dtp, fhzero, kdt, ! These arrays only allocated if ldiag_ugwp = .true. real(kind=kind_phys), intent(out), dimension(:,:) :: du3dt_mtb, du3dt_ogw, du3dt_tms - real(kind=kind_phys), intent(inout), dimension(im, levs):: dudt, dvdt, dtdt + real(kind=kind_phys), intent(inout), dimension(:,:):: dudt, dvdt, dtdt real(kind=kind_phys), intent(in) :: con_g, con_omega, con_pi, con_cp, con_rd, & con_rv, con_rerth, con_fvirt - real(kind=kind_phys), intent(in), dimension(im) :: rain + real(kind=kind_phys), intent(in), dimension(:) :: rain integer, intent(in) :: ntke real(kind=kind_phys), intent(in), dimension(:,:) :: q_tke, dqdt_tke From 52bf572a7ed80fc9bf94026882282ed15492e941 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Wed, 7 Apr 2021 14:24:35 -0600 Subject: [PATCH 14/25] Bugfix for precipitation quantities, fix Fortran/metadata inconsistencies, use assumed-size arrays --- physics/mp_thompson.F90 | 20 ++++++++++---------- physics/mp_thompson.meta | 6 +++--- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/physics/mp_thompson.F90 b/physics/mp_thompson.F90 index cb4fbfffd4..23533fbd69 100644 --- a/physics/mp_thompson.F90 +++ b/physics/mp_thompson.F90 @@ -370,11 +370,11 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, & real(kind_phys), intent(in ) :: omega(:,:) real(kind_phys), intent(in ) :: dtp ! Precip/rain/snow/graupel fall amounts and fraction of frozen precip - real(kind_phys), intent( out) :: prcp(:) - real(kind_phys), intent( out) :: rain(:) - real(kind_phys), intent( out) :: graupel(:) - real(kind_phys), intent( out) :: ice(:) - real(kind_phys), intent( out) :: snow(:) + real(kind_phys), intent(inout) :: prcp(:) + real(kind_phys), intent(inout) :: rain(:) + real(kind_phys), intent(inout) :: graupel(:) + real(kind_phys), intent(inout) :: ice(:) + real(kind_phys), intent(inout) :: snow(:) real(kind_phys), intent( out) :: sr(:) ! Radar reflectivity real(kind_phys), intent( out) :: refl_10cm(:,:) @@ -610,11 +610,11 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, & !> - Convert rainfall deltas from mm to m (on physics timestep); add to inout variables ! "rain" in Thompson MP refers to precipitation (total of liquid rainfall+snow+graupel+ice) - prcp = max(0.0, delta_rain_mp/1000.0_kind_phys) - graupel = max(0.0, delta_graupel_mp/1000.0_kind_phys) - ice = max(0.0, delta_ice_mp/1000.0_kind_phys) - snow = max(0.0, delta_snow_mp/1000.0_kind_phys) - rain = max(0.0, (delta_rain_mp - (delta_graupel_mp + delta_ice_mp + delta_snow_mp))/1000.0_kind_phys) + prcp = max(0.0, prcp + delta_rain_mp/1000.0_kind_phys) + graupel = max(0.0, graupel + delta_graupel_mp/1000.0_kind_phys) + ice = max(0.0, ice + delta_ice_mp/1000.0_kind_phys) + snow = max(0.0, snow + delta_snow_mp/1000.0_kind_phys) + rain = max(0.0, rain + (delta_rain_mp - (delta_graupel_mp + delta_ice_mp + delta_snow_mp))/1000.0_kind_phys) end subroutine mp_thompson_run !>@} diff --git a/physics/mp_thompson.meta b/physics/mp_thompson.meta index 7f1e9197e6..2378900240 100644 --- a/physics/mp_thompson.meta +++ b/physics/mp_thompson.meta @@ -250,7 +250,7 @@ dimensions = (horizontal_dimension,vertical_dimension) type = real kind = kind_phys - intent = inout + intent = out optional = T [re_ice] standard_name = effective_radius_of_stratiform_cloud_ice_particle_in_um @@ -259,7 +259,7 @@ dimensions = (horizontal_dimension,vertical_dimension) type = real kind = kind_phys - intent = inout + intent = out optional = T [re_snow] standard_name = effective_radius_of_stratiform_cloud_snow_particle_in_um @@ -268,7 +268,7 @@ dimensions = (horizontal_dimension,vertical_dimension) type = real kind = kind_phys - intent = inout + intent = out optional = T [mpicomm] standard_name = mpi_comm From b39b3134cfedaeacdf9f6ef7ead518b09af426f8 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Wed, 7 Apr 2021 14:42:59 -0600 Subject: [PATCH 15/25] Convert more explicit dimensions of argument variables to assumed-size dimensions, fix Fortran/metadata inconsistencies --- physics/GFS_cloud_diagnostics.F90 | 6 +- physics/GFS_rrtmg_pre.F90 | 10 +- physics/GFS_rrtmg_pre.meta | 52 +- physics/GFS_rrtmg_setup.F90 | 2 +- physics/GFS_rrtmgp_cloud_overlap_pre.F90 | 4 +- physics/GFS_rrtmgp_cloud_overlap_pre.meta | 50 +- physics/GFS_rrtmgp_gfdlmp_pre.F90 | 8 +- physics/GFS_rrtmgp_sw_pre.F90 | 2 +- physics/GFS_rrtmgp_sw_pre.meta | 128 +-- physics/GFS_rrtmgp_thompsonmp_pre.F90 | 8 +- physics/GFS_rrtmgp_thompsonmp_pre.meta | 108 +- physics/GFS_rrtmgp_zhaocarr_pre.F90 | 4 +- physics/GFS_rrtmgp_zhaocarr_pre.meta | 34 +- physics/cs_conv.F90 | 1209 +++++++++++---------- physics/cu_gf_driver.F90 | 4 +- physics/gfdl_fv_sat_adj.F90 | 25 +- physics/gfdl_sfc_layer.F90 | 14 +- physics/gmtb_scm_sfc_flux_spec.F90 | 4 + physics/gwdps.f | 4 +- physics/h2o_def.meta | 1 - physics/module_MYJPBL_wrapper.F90 | 4 +- physics/module_MYJPBL_wrapper.meta | 24 +- physics/module_MYJSFC_wrapper.F90 | 2 +- physics/module_MYNNPBL_wrapper.F90 | 18 +- physics/module_MYNNSFC_wrapper.F90 | 41 +- physics/moninedmf.f | 44 +- physics/moninedmf.meta | 2 + physics/mp_fer_hires.meta | 1 + physics/ozne_def.meta | 1 - physics/ozphys_2015.f | 3 +- physics/rascnv.F90 | 55 +- physics/rrtmg_sw_pre.F90 | 2 +- physics/samfdeepcnv.f | 2 +- physics/satmedmfvdifq.meta | 4 +- physics/sfc_noahmp_drv.F90 | 12 +- physics/sfc_nst.meta | 16 +- physics/sfc_sice.f | 20 +- physics/shinhongvdif.F90 | 2 +- physics/shinhongvdif.meta | 12 +- physics/ugwpv1_gsldrag_post.F90 | 21 +- physics/ugwpv1_gsldrag_post.meta | 27 +- physics/unified_ugwp.F90 | 6 +- physics/ysuvdif.F90 | 14 +- physics/ysuvdif.meta | 12 +- 44 files changed, 1007 insertions(+), 1015 deletions(-) diff --git a/physics/GFS_cloud_diagnostics.F90 b/physics/GFS_cloud_diagnostics.F90 index 5aa5dbfa60..215143bb27 100644 --- a/physics/GFS_cloud_diagnostics.F90 +++ b/physics/GFS_cloud_diagnostics.F90 @@ -80,9 +80,9 @@ subroutine GFS_cloud_diagnostics_run(nCol, nLev, lsswr, lslwr, lat, de_lgth, p_l ! Local variables integer i,id,iCol,iLay,icld real(kind_phys) :: tem1 - real(kind_phys),dimension(:,:) :: ptop1 - real(kind_phys),dimension(:) :: rlat - real(kind_phys),dimension(:,:) :: cldcnv + real(kind_phys),dimension(nCol,NK_CLDS+1) :: ptop1 + real(kind_phys),dimension(nCol) :: rlat + real(kind_phys),dimension(nCol,nLev) :: cldcnv if (.not. (lsswr .or. lslwr)) return diff --git a/physics/GFS_rrtmg_pre.F90 b/physics/GFS_rrtmg_pre.F90 index 6ec6497a8f..b2219bc8c8 100644 --- a/physics/GFS_rrtmg_pre.F90 +++ b/physics/GFS_rrtmg_pre.F90 @@ -26,8 +26,8 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, & ltaerosol, lgfdlmprad, uni_cld, effr_in, do_mynnedmf, lmfshal, & lmfdeep2, fhswr, fhlwr, solhr, sup, con_eps, epsm1, fvirt, & rog, rocp, con_rd, xlat_d, xlat, xlon, coslat, sinlat, tsfc, slmsk, & - prsi, prsl, prslk, tgrs, sfc_wts, mg_cld, effrr_in, pert_clds,sppt_wts,& - sppt_amp, cnvw_in, cnvc_in, qgrs, aer_nm, dx, icloud, & !inputs from here and above + prsi, prsl, prslk, tgrs, sfc_wts, mg_cld, effrr_in, pert_clds, & + sppt_wts, sppt_amp, cnvw_in, cnvc_in, qgrs, aer_nm, dx, icloud, & !inputs from here and above coszen, coszdg, effrl_inout, effri_inout, effrs_inout, & clouds1, clouds2, clouds3, clouds4, clouds5, & !in/out from here and above kd, kt, kb, mtopa, mbota, raddt, tsfg, tsfa, de_lgth, alb1d, delp, dz, & !output from here and below @@ -128,7 +128,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, & integer, intent(out) :: kd, kt, kb - integer, dimension(im,3), intent(out) :: mbota, mtopa + integer, dimension(:,:), intent(out) :: mbota, mtopa real(kind=kind_phys), intent(out) :: raddt @@ -140,9 +140,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, & plyr, tlyr, & qlyr, olyr - real(kind=kind_phys), dimension(:,;), intent(out) :: plvl, tlvl - - + real(kind=kind_phys), dimension(:,:), intent(out) :: plvl, tlvl real(kind=kind_phys), dimension(:,:), intent(out) :: gasvmr_co2, & gasvmr_n2o, & diff --git a/physics/GFS_rrtmg_pre.meta b/physics/GFS_rrtmg_pre.meta index b6e2138ce0..344befa97b 100644 --- a/physics/GFS_rrtmg_pre.meta +++ b/physics/GFS_rrtmg_pre.meta @@ -395,32 +395,6 @@ type = logical intent = in optional = F -[sppt_wts] - standard_name = weights_for_stochastic_sppt_perturbation - long_name = weights for stochastic sppt perturbation - units = none - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = inout - optional = F -[sppt_amp] - standard_name = total_ampltiude_of_sppt_perturbation - long_name = toal ampltidue of stochastic sppt perturbation - units = none - dimensions = () - type = real - kind = kind_phys - intent = in - optional = F -[pert_clds] - standard_name = flag_for_stochastic_cloud_fraction_perturbations - long_name = flag for stochastic cloud fraction physics perturbations - units = flag - dimensions = () - type = logical - intent = in - optional = F [do_mynnedmf] standard_name = do_mynnedmf long_name = flag to activate MYNN-EDMF @@ -661,6 +635,32 @@ kind = kind_phys intent = in optional = F +[pert_clds] + standard_name = flag_for_stochastic_cloud_fraction_perturbations + long_name = flag for stochastic cloud fraction physics perturbations + units = flag + dimensions = () + type = logical + intent = in + optional = F +[sppt_wts] + standard_name = weights_for_stochastic_sppt_perturbation + long_name = weights for stochastic sppt perturbation + units = none + dimensions = (horizontal_loop_extent,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[sppt_amp] + standard_name = total_ampltiude_of_sppt_perturbation + long_name = toal ampltidue of stochastic sppt perturbation + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F [cnvw_in] standard_name = convective_cloud_water_mixing_ratio_in_phy_f3d long_name = convective cloud water mixing ratio in the phy_f3d array diff --git a/physics/GFS_rrtmg_setup.F90 b/physics/GFS_rrtmg_setup.F90 index 368a5ed4dd..f90ca983b0 100644 --- a/physics/GFS_rrtmg_setup.F90 +++ b/physics/GFS_rrtmg_setup.F90 @@ -185,7 +185,7 @@ subroutine GFS_rrtmg_setup_init ( & logical, intent(in) :: ccnorm integer, intent(in) :: imp_physics logical, intent(in) :: norad_precip - integer, intent(in) :: idate(4) + integer, intent(in) :: idate(:) integer, intent(in) :: iflip ! For consistency checks integer, intent(in) :: im diff --git a/physics/GFS_rrtmgp_cloud_overlap_pre.F90 b/physics/GFS_rrtmgp_cloud_overlap_pre.F90 index a2a575ac64..0abfc0e2c3 100644 --- a/physics/GFS_rrtmgp_cloud_overlap_pre.F90 +++ b/physics/GFS_rrtmgp_cloud_overlap_pre.F90 @@ -21,9 +21,9 @@ end subroutine GFS_rrtmgp_cloud_overlap_pre_init !! subroutine GFS_rrtmgp_cloud_overlap_pre_run(nCol, nLev, yearlen, doSWrad, doLWrad, & julian, lat, p_lev, p_lay, tv_lay, con_pi, con_g, con_rd, con_epsq, dcorr_con, & - idcor, iovr, iovr_dcorr, iovr_exprand, iovr_exp, idcor_con, idcor_hogan, & + idcor, iovr, iovr_dcorr, iovr_exp, iovr_exprand, idcor_con, idcor_hogan, & idcor_oreopoulos, cld_frac, & - cloud_overlap_param, precip_overlap_param, de_lgth, deltaZc, errmsg, errflg) + de_lgth, cloud_overlap_param, precip_overlap_param, deltaZc, errmsg, errflg) implicit none ! Inputs diff --git a/physics/GFS_rrtmgp_cloud_overlap_pre.meta b/physics/GFS_rrtmgp_cloud_overlap_pre.meta index 273832362c..3f7174f90d 100644 --- a/physics/GFS_rrtmgp_cloud_overlap_pre.meta +++ b/physics/GFS_rrtmgp_cloud_overlap_pre.meta @@ -23,6 +23,14 @@ type = integer intent = in optional = F +[yearlen] + standard_name = number_of_days_in_year + long_name = number of days in a year + units = days + dimensions = () + type = integer + intent = in + optional = F [doSWrad] standard_name = flag_to_calc_sw long_name = logical flags for sw radiation calls @@ -39,14 +47,6 @@ type = logical intent = in optional = F -[yearlen] - standard_name = number_of_days_in_year - long_name = number of days in a year - units = days - dimensions = () - type = integer - intent = in - optional = F [julian] standard_name = julian_day long_name = julian day @@ -128,6 +128,23 @@ kind = kind_phys intent = in optional = F +[dcorr_con] + standard_name = decorreltion_length_used_by_overlap_method + long_name = decorrelation length (default) used by cloud overlap method (iovr) + units = km + dimensions = () + type = real + intent = in + kind = kind_phys + optional = F +[idcor] + standard_name = flag_for_decorrelation_length_method + long_name = flag for decorrelation length method used in cloud overlap method (iovr) + units = flag + dimensions = () + type = integer + intent = in + optional = F [iovr] standard_name = flag_for_cloud_overlap_method_for_radiation long_name = flag for cloud overlap method @@ -160,14 +177,6 @@ type = integer intent = in optional = F -[idcor] - standard_name = flag_for_decorrelation_length_method - long_name = flag for decorrelation length method used in cloud overlap method (iovr) - units = flag - dimensions = () - type = integer - intent = in - optional = F [idcor_con] standard_name = flag_for_constant_decorrelation_length_method long_name = choice of decorrelation length computation (costant) @@ -192,15 +201,6 @@ type = integer intent = in optional = F -[dcorr_con] - standard_name = decorreltion_length_used_by_overlap_method - long_name = decorrelation length (default) used by cloud overlap method (iovr) - units = km - dimensions = () - type = real - intent = in - kind = kind_phys - optional = F [cld_frac] standard_name = total_cloud_fraction long_name = layer total cloud fraction diff --git a/physics/GFS_rrtmgp_gfdlmp_pre.F90 b/physics/GFS_rrtmgp_gfdlmp_pre.F90 index 1f3d349730..fbaf8af688 100644 --- a/physics/GFS_rrtmgp_gfdlmp_pre.F90 +++ b/physics/GFS_rrtmgp_gfdlmp_pre.F90 @@ -64,20 +64,20 @@ subroutine GFS_rrtmgp_gfdlmp_pre_run(nCol, nLev, nTracers, ncnd, i_cldliq, i_cld real(kind_phys), intent(in) :: & con_g, & ! Physical constant: gravitational constant con_rd ! Physical constant: gas-constant for dry air - real(kind_phys), dimension(nCol,nLev), intent(in) :: & + real(kind_phys), dimension(:,:), intent(in) :: & tv_lay, & ! Virtual temperature (K) p_lay, & ! Pressure at model-layers (Pa) effrin_cldliq, & ! Effective radius for liquid cloud-particles (microns) effrin_cldice, & ! Effective radius for ice cloud-particles (microns) effrin_cldrain, & ! Effective radius for rain cloud-particles (microns) effrin_cldsnow ! Effective radius for snow cloud-particles (microns) - real(kind_phys), dimension(nCol,nLev+1), intent(in) :: & + real(kind_phys), dimension(:,:), intent(in) :: & p_lev ! Pressure at model-level interfaces (Pa) - real(kind_phys), dimension(nCol, nLev, nTracers),intent(in) :: & + real(kind_phys), dimension(:,:,:),intent(in) :: & tracer ! Cloud condensate amount in layer by type () ! Outputs - real(kind_phys), dimension(nCol,nLev),intent(inout) :: & + real(kind_phys), dimension(:,:),intent(inout) :: & cld_frac, & ! Total cloud fraction cld_lwp, & ! Cloud liquid water path cld_reliq, & ! Cloud liquid effective radius diff --git a/physics/GFS_rrtmgp_sw_pre.F90 b/physics/GFS_rrtmgp_sw_pre.F90 index 7a4e08d553..68f2a07c1c 100644 --- a/physics/GFS_rrtmgp_sw_pre.F90 +++ b/physics/GFS_rrtmgp_sw_pre.F90 @@ -27,7 +27,7 @@ end subroutine GFS_rrtmgp_sw_pre_init !> \section arg_table_GFS_rrtmgp_sw_pre_run !! \htmlinclude GFS_rrtmgp_sw_pre.html !! - subroutine GFS_rrtmgp_sw_pre_run(me, nCol, nLev, lndp_type, n_var_lndp,lndp_var_list, & + subroutine GFS_rrtmgp_sw_pre_run(me, nCol, nLev, n_var_lndp, lndp_type, lndp_var_list, & lndp_prt_list, doSWrad, solhr, lon, coslat, sinlat, snowd, sncovr, snoalb, zorl, & tsfg, tsfa, hprime, alvsf, alnsf, alvwf, alnwf, facsf, facwf, fice, tisfc, albdvis, & albdnir, albivis, albinir, lsmask, sfc_wts, p_lay, tv_lay, relhum, p_lev, & diff --git a/physics/GFS_rrtmgp_sw_pre.meta b/physics/GFS_rrtmgp_sw_pre.meta index 5a165f9ad5..349750879f 100644 --- a/physics/GFS_rrtmgp_sw_pre.meta +++ b/physics/GFS_rrtmgp_sw_pre.meta @@ -30,7 +30,7 @@ dimensions = () type = integer intent = in - optional = F + optional = F [n_var_lndp] standard_name = number_of_land_surface_variables_perturbed long_name = number of land surface variables perturbed @@ -38,7 +38,7 @@ dimensions = () type = integer intent = in - optional = F + optional = F [lndp_type] standard_name = index_for_stochastic_land_surface_perturbation_type long_name = index for stochastic land surface perturbations type @@ -47,15 +47,6 @@ type = integer intent = in optional = F -[lndp_prt_list] - standard_name =magnitude_of_perturbations_for_landperts - long_name = magnitude of perturbations for landperts - units = variable - dimensions = (number_of_land_surface_variables_perturbed) - type = real - kind = kind_phys - intent = in - optional = F [lndp_var_list] standard_name = variables_to_be_perturbed_for_landperts long_name = variables to be perturbed for landperts @@ -65,6 +56,15 @@ kind = len=3 intent = in optional = F +[lndp_prt_list] + standard_name =magnitude_of_perturbations_for_landperts + long_name = magnitude of perturbations for landperts + units = variable + dimensions = (number_of_land_surface_variables_perturbed) + type = real + kind = kind_phys + intent = in + optional = F [doSWrad] standard_name = flag_to_calc_sw long_name = logical flags for sw radiation calls @@ -109,15 +109,6 @@ kind = kind_phys intent = in optional = F -[lsmask] - standard_name = sea_land_ice_mask_real - long_name = landmask: sea/land/ice=0/1/2 - units = flag - dimensions = (horizontal_loop_extent) - type = real - kind = kind_phys - intent = in - optional = F [snowd] standard_name = surface_snow_thickness_water_equivalent long_name = water equivalent snow depth @@ -243,7 +234,7 @@ type = real kind = kind_phys intent = in - optional = F + optional = F [tisfc] standard_name = sea_ice_temperature long_name = sea ice surface skin temperature @@ -289,6 +280,15 @@ kind = kind_phys intent = in optional = F +[lsmask] + standard_name = sea_land_ice_mask_real + long_name = landmask: sea/land/ice=0/1/2 + units = flag + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in + optional = F [sfc_wts] standard_name = weights_for_stochastic_surface_physics_perturbation long_name = weights for stochastic surface physics perturbation @@ -298,6 +298,15 @@ kind = kind_phys intent = in optional = F +[p_lay] + standard_name = air_pressure_at_layer_for_RRTMGP_in_hPa + long_name = air pressure at vertical layer for radiation calculation + units = hPa + dimensions = (horizontal_loop_extent,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F [tv_lay] standard_name = virtual_temperature long_name = layer virtual temperature @@ -316,15 +325,6 @@ kind = kind_phys intent = in optional = F -[p_lay] - standard_name = air_pressure_at_layer_for_RRTMGP_in_hPa - long_name = air pressure at vertical layer for radiation calculation - units = hPa - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F [p_lev] standard_name = air_pressure_at_interface_for_RRTMGP_in_hPa long_name = air pressure at vertical interface for radiation calculation @@ -334,6 +334,40 @@ kind = kind_phys intent = in optional = F +[nday] + standard_name = daytime_points_dimension + long_name = daytime points dimension + units = count + dimensions = () + type = integer + intent = out + optional = F +[idxday] + standard_name = daytime_points + long_name = daytime points + units = index + dimensions = (horizontal_loop_extent) + type = integer + intent = out + optional = F +[coszen] + standard_name = cosine_of_zenith_angle + long_name = mean cos of zenith angle over rad call period + units = none + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = inout + optional = F +[coszdg] + standard_name = daytime_mean_cosz_over_rad_call_period + long_name = daytime mean cosz over rad call period + units = none + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = inout + optional = F [sfc_alb_nir_dir] standard_name = surface_albedo_nearIR_direct long_name = near-IR (direct) surface albedo (sfc_alb_nir_dir) @@ -370,40 +404,6 @@ kind = kind_phys intent = out optional = F -[nday] - standard_name = daytime_points_dimension - long_name = daytime points dimension - units = count - dimensions = () - type = integer - intent = out - optional = F -[idxday] - standard_name = daytime_points - long_name = daytime points - units = index - dimensions = (horizontal_loop_extent) - type = integer - intent = out - optional = F -[coszen] - standard_name = cosine_of_zenith_angle - long_name = mean cos of zenith angle over rad call period - units = none - dimensions = (horizontal_loop_extent) - type = real - kind = kind_phys - intent = inout - optional = F -[coszdg] - standard_name = daytime_mean_cosz_over_rad_call_period - long_name = daytime mean cosz over rad call period - units = none - dimensions = (horizontal_loop_extent) - type = real - kind = kind_phys - intent = inout - optional = F [sfc_alb_dif] standard_name = surface_diffused_shortwave_albedo long_name = mean surface diffused sw albedo diff --git a/physics/GFS_rrtmgp_thompsonmp_pre.F90 b/physics/GFS_rrtmgp_thompsonmp_pre.F90 index b54f27d652..8b26a69362 100644 --- a/physics/GFS_rrtmgp_thompsonmp_pre.F90 +++ b/physics/GFS_rrtmgp_thompsonmp_pre.F90 @@ -79,7 +79,7 @@ subroutine GFS_rrtmgp_thompsonmp_pre_run(nCol, nLev, nTracers, ncnd, doSWrad, do con_rd, & ! Physical constant: gas-constant for dry air con_eps ! Physical constant: gas constant air / gas constant H2O - real(kind_phys), dimension(nCol,nLev), intent(in) :: & + real(kind_phys), dimension(:,:), intent(in) :: & tv_lay, & ! Virtual temperature (K) t_lay, & ! Temperature (K) qs_lay, & ! Saturation vapor pressure (Pa) @@ -87,13 +87,13 @@ subroutine GFS_rrtmgp_thompsonmp_pre_run(nCol, nLev, nTracers, ncnd, doSWrad, do relhum, & ! Relative humidity p_lay, & ! Pressure at model-layers (Pa) cld_frac_mg ! Cloud-fraction from MG scheme. WTF????? - real(kind_phys), dimension(nCol,nLev+1), intent(in) :: & + real(kind_phys), dimension(:,:), intent(in) :: & p_lev ! Pressure at model-level interfaces (Pa) - real(kind_phys), dimension(nCol, nLev, nTracers),intent(in) :: & + real(kind_phys), dimension(:,:,:),intent(in) :: & tracer ! Cloud condensate amount in layer by type () ! In/Outs - real(kind_phys), dimension(nCol,nLev), intent(inout) :: & + real(kind_phys), dimension(:,:), intent(inout) :: & cld_frac, & ! Total cloud fraction cld_lwp, & ! Cloud liquid water path cld_reliq, & ! Cloud liquid effective radius diff --git a/physics/GFS_rrtmgp_thompsonmp_pre.meta b/physics/GFS_rrtmgp_thompsonmp_pre.meta index b3edb2f187..7ddecc4050 100644 --- a/physics/GFS_rrtmgp_thompsonmp_pre.meta +++ b/physics/GFS_rrtmgp_thompsonmp_pre.meta @@ -197,56 +197,16 @@ type = real kind = kind_phys intent = inout - optional = F -[cld_frac_mg] - standard_name = cloud_fraction_for_MG - long_name = cloud fraction used by Morrison-Gettelman MP - units = frac - dimensions = (horizontal_loop_extent,vertical_dimension) + optional = F +[tracer] + standard_name = chemical_tracers + long_name = chemical tracers + units = g g-1 + dimensions = (horizontal_loop_extent,vertical_dimension,number_of_tracers) type = real kind = kind_phys intent = in - optional = F -[do_mynnedmf] - standard_name = do_mynnedmf - long_name = flag to activate MYNN-EDMF - units = flag - dimensions = () - type = logical - intent = in - optional = F -[imfdeepcnv] - standard_name = flag_for_mass_flux_deep_convection_scheme - long_name = flag for mass-flux deep convection scheme - units = flag - dimensions = () - type = integer - intent = in - optional = F -[imfdeepcnv_gf] - standard_name = flag_for_gf_deep_convection_scheme - long_name = flag for Grell-Freitas deep convection scheme - units = flag - dimensions = () - type = integer - intent = in - optional = F -[doGP_cldoptics_PADE] - standard_name = flag_to_calc_lw_cld_optics_using_RRTMGP_PADE - long_name = logical flag to control cloud optics scheme. - units = flag - dimensions = () - type = logical - intent = in - optional = F -[doGP_cldoptics_LUT] - standard_name = flag_to_calc_lw_cld_optics_using_RRTMGP_LUT - long_name = logical flag to control cloud optics scheme. - units = flag - dimensions = () - type = logical - intent = in - optional = F + optional = F [qs_lay] standard_name = saturation_vapor_pressure long_name = saturation vapor pressure @@ -264,7 +224,7 @@ type = real kind = kind_phys intent = in - optional = F + optional = F [relhum] standard_name = relative_humidity long_name = layer relative humidity @@ -274,15 +234,15 @@ kind = kind_phys intent = in optional = F -[tracer] - standard_name = chemical_tracers - long_name = chemical tracers - units = g g-1 - dimensions = (horizontal_loop_extent,vertical_dimension,number_of_tracers) +[cld_frac_mg] + standard_name = cloud_fraction_for_MG + long_name = cloud fraction used by Morrison-Gettelman MP + units = frac + dimensions = (horizontal_loop_extent,vertical_dimension) type = real kind = kind_phys intent = in - optional = F + optional = F [con_g] standard_name = gravitational_acceleration long_name = gravitational acceleration @@ -342,6 +302,46 @@ type = logical intent = in optional = F +[do_mynnedmf] + standard_name = do_mynnedmf + long_name = flag to activate MYNN-EDMF + units = flag + dimensions = () + type = logical + intent = in + optional = F +[imfdeepcnv] + standard_name = flag_for_mass_flux_deep_convection_scheme + long_name = flag for mass-flux deep convection scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[imfdeepcnv_gf] + standard_name = flag_for_gf_deep_convection_scheme + long_name = flag for Grell-Freitas deep convection scheme + units = flag + dimensions = () + type = integer + intent = in + optional = F +[doGP_cldoptics_PADE] + standard_name = flag_to_calc_lw_cld_optics_using_RRTMGP_PADE + long_name = logical flag to control cloud optics scheme. + units = flag + dimensions = () + type = logical + intent = in + optional = F +[doGP_cldoptics_LUT] + standard_name = flag_to_calc_lw_cld_optics_using_RRTMGP_LUT + long_name = logical flag to control cloud optics scheme. + units = flag + dimensions = () + type = logical + intent = in + optional = F [cld_frac] standard_name = total_cloud_fraction long_name = layer total cloud fraction diff --git a/physics/GFS_rrtmgp_zhaocarr_pre.F90 b/physics/GFS_rrtmgp_zhaocarr_pre.F90 index 206280362f..4379bf4a52 100644 --- a/physics/GFS_rrtmgp_zhaocarr_pre.F90 +++ b/physics/GFS_rrtmgp_zhaocarr_pre.F90 @@ -32,9 +32,9 @@ subroutine GFS_rrtmgp_zhaocarr_pre_run(nCol, nLev, nCnd, nTracers, i_cldliq, lss lslwr, effr_in, uni_cld, lmfshal, lat, lsmask, p_lev, p_lay, t_lay, relhum, & tv_lay, effrin_cldliq, effrin_cldice, effrin_cldrain, effrin_cldsnow, & shoc_sgs_cldfrac, cncvw, tracer, & - con_eps, con_epsq, con_epsqs, con_epsm1, con_g, con_ttp, con_rd, con_pi, & + con_ttp, con_epsq, con_epsqs, con_eps, con_epsm1, con_g, con_rd, con_pi, & cld_frac, cld_lwp, cld_reliq, cld_iwp, cld_reice, cld_swp, cld_resnow, cld_rwp, & - cld_rerain, de_lgth, deltaZ, cloud_overlap_param, errmsg, errflg) + cld_rerain, deltaZ, de_lgth, cloud_overlap_param, errmsg, errflg) implicit none ! Inputs diff --git a/physics/GFS_rrtmgp_zhaocarr_pre.meta b/physics/GFS_rrtmgp_zhaocarr_pre.meta index e3812bb74f..1c25d19fdf 100644 --- a/physics/GFS_rrtmgp_zhaocarr_pre.meta +++ b/physics/GFS_rrtmgp_zhaocarr_pre.meta @@ -122,15 +122,15 @@ kind = kind_phys intent = in optional = F -[tv_lay] - standard_name = virtual_temperature - long_name = layer virtual temperature +[t_lay] + standard_name = air_temperature_at_layer_for_RRTMGP + long_name = air temperature at vertical layer for radiation calculation units = K dimensions = (horizontal_loop_extent,vertical_dimension) type = real kind = kind_phys intent = in - optional = F + optional = F [relhum] standard_name = relative_humidity long_name = layer relative humidity @@ -140,15 +140,15 @@ kind = kind_phys intent = in optional = F -[t_lay] - standard_name = air_temperature_at_layer_for_RRTMGP - long_name = air temperature at vertical layer for radiation calculation +[tv_lay] + standard_name = virtual_temperature + long_name = layer virtual temperature units = K dimensions = (horizontal_loop_extent,vertical_dimension) type = real kind = kind_phys intent = in - optional = F + optional = F [effrin_cldliq] standard_name = effective_radius_of_stratiform_cloud_liquid_water_particle_in_um long_name = eff. radius of cloud liquid water particle in micrometer @@ -365,15 +365,6 @@ kind = kind_phys intent = out optional = F -[cloud_overlap_param] - standard_name = cloud_overlap_param - long_name = cloud overlap parameter - units = km - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = out - optional = F [deltaZ] standard_name = layer_thickness long_name = layer_thickness @@ -392,6 +383,15 @@ kind = kind_phys intent = out optional = F +[cloud_overlap_param] + standard_name = cloud_overlap_param + long_name = cloud overlap parameter + units = km + dimensions = (horizontal_loop_extent,vertical_dimension) + type = real + kind = kind_phys + intent = out + optional = F [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/cs_conv.F90 b/physics/cs_conv.F90 index ff0770ad94..36926108ef 100644 --- a/physics/cs_conv.F90 +++ b/physics/cs_conv.F90 @@ -19,23 +19,23 @@ subroutine cs_conv_pre_run(im, levs, ntrac, ncld, q, clw1, clw2, & & errmsg, errflg) - use machine , only : r8 => kind_phys + use machine , only : kind_phys - implicit none + implicit none ! --- inputs integer, intent(in) :: im, levs, ntrac, ncld - real(r8), dimension(:,:), intent(in) :: q - real(r8), dimension(:,:), intent(in) :: clw1,clw2 - real(r8), dimension(:), intent(in) :: work1, work2 - real(r8), intent(in) :: cs_parm1, cs_parm2 + real(kind_phys), dimension(:,:), intent(in) :: q + real(kind_phys), dimension(:,:), intent(in) :: clw1,clw2 + real(kind_phys), dimension(:), intent(in) :: work1, work2 + real(kind_phys), intent(in) :: cs_parm1, cs_parm2 ! --- input/output - real(r8), dimension(:), intent(out) :: fswtr, fscav - real(r8), dimension(:), intent(out) :: wcbmax - real(r8), dimension(:,:), intent(out) :: save_q1,save_q2 + real(kind_phys), dimension(:), intent(out) :: fswtr, fscav + real(kind_phys), dimension(:), intent(out) :: wcbmax + real(kind_phys), dimension(:,:), intent(out) :: save_q1,save_q2 ! save_q3 is not allocated for Zhao-Carr MP - real(r8), dimension(:,:), intent(out) :: save_q3 + real(kind_phys), dimension(:,:), intent(out) :: save_q3 character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -84,17 +84,17 @@ end subroutine cs_conv_post_finalize !! subroutine cs_conv_post_run(im, kmax, do_aw, sigmatot, sigmafrac, errmsg, errflg) - use machine , only : r8 => kind_phys + use machine , only : kind_phys implicit none ! --- inputs integer, intent(in) :: im, kmax logical, intent(in) :: do_aw - real(r8), dimension(:,:), intent(in) :: sigmatot + real(kind_phys), dimension(:,:), intent(in) :: sigmatot ! --- input/output - real(r8), dimension(:,:), intent(out) :: sigmafrac + real(kind_phys), dimension(:,:), intent(out) :: sigmafrac character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -132,7 +132,7 @@ module cs_conv !! Author: Minoru Chikira !--------------------------------------------------------------------------------- ! - use machine , only : r8 => kind_phys + use machine , only : kind_phys use physcons, only : cp => con_cp, grav => con_g, & & rair => con_rd, rvap => con_rv, & & cliq => con_cliq, cvap => con_cvap, & @@ -146,20 +146,20 @@ module cs_conv private ! Make default type private to the module - real(r8), parameter :: zero=0.0d0, one=1.0d0, half=0.5d0 - real(r8), parameter :: cpoel=cp/el, cpoesub=cp/(el+emelt), esubocp=1.0/cpoesub, & + real(kind_phys), parameter :: zero=0.0d0, one=1.0d0, half=0.5d0 + real(kind_phys), parameter :: cpoel=cp/el, cpoesub=cp/(el+emelt), esubocp=1.0/cpoesub, & elocp=el/cp, oneocp=one/cp, gocp=grav/cp, gravi=one/grav,& - emeltocp=emelt/cp, cpoemelt=cp/emelt, epsln=1.e-10_r8 + emeltocp=emelt/cp, cpoemelt=cp/emelt, epsln=1.e-10_kind_phys - real(r8), parameter :: fact1=(cvap-cliq)/rvap, fact2=el/rvap-fact1*t0c !< to calculate d(qs)/dT + real(kind_phys), parameter :: fact1=(cvap-cliq)/rvap, fact2=el/rvap-fact1*t0c !< to calculate d(qs)/dT logical, parameter :: adjustp=.true. ! logical, parameter :: adjustp=.false. ! Tuning parameters set from namelist ! -! real(r8), parameter, public :: CLMD = 0.60, & !< entrainment efficiency (now thru argument) - real(r8), parameter, public :: & +! real(kind_phys), parameter, public :: CLMD = 0.60, & !< entrainment efficiency (now thru argument) + real(kind_phys), parameter, public :: & PA=0.15, & !< factor for buoyancy to affect updraft velocity CPRES = 0.55, & !< pressure factor for momentum transport ALP0 = 5.0e7, & !< alpha parameter in prognostic closure @@ -178,11 +178,11 @@ module cs_conv !DD precz0 and preczh control partitioning of water between detrainment !DD and precipitation. Decrease for more precip - real(r8), public :: precz0, preczh, clmd, clmp, clmdpa + real(kind_phys), public :: precz0, preczh, clmd, clmp, clmdpa ! ! Private data ! - real(r8), parameter :: unset_r8 = -999._r8 ! missing value + real(kind_phys), parameter :: unset_kind_phys = -999._kind_phys ! missing value ! integer :: iulog !< unit to write debugging and diagnostic output !DD Note - see if I can find corresponding variable in a GFS module @@ -300,96 +300,97 @@ subroutine cs_conv_run( IJSDIM , KMAX , ntracp1 , NN, & ! otspt(:,2) - on/off switch for tracer transport by subsidence ! should include subgrid PDF and turbulence - real(r8), intent(inout) :: t(:,:) ! temperature at mid-layer (K) - real(r8), intent(inout) :: q(:,:) ! water vapor array including moisture (kg/kg) - real(r8), intent(inout) :: clw(:,:,:) ! tracer array including cloud condensate (kg/kg) - real(r8), intent(in) :: pap(:,:) ! pressure at mid-layer (Pa) - real(r8), intent(in) :: paph(:,:) ! pressure at boundaries (Pa) - real(r8), intent(in) :: zm(:,:) ! geopotential at mid-layer (m) - real(r8), intent(in) :: zi(:,;) ! geopotential at boundaries (m) - real(r8), intent(in) :: fscav(:), fswtr(;), wcbmaxm(:) - real(r8), intent(in) :: precz0in, preczhin, clmdin + real(kind_phys), intent(inout) :: t(:,:) ! temperature at mid-layer (K) + real(kind_phys), intent(inout) :: q(:,:) ! water vapor array including moisture (kg/kg) + real(kind_phys), intent(inout) :: clw(:,:,:) ! tracer array including cloud condensate (kg/kg) + real(kind_phys), intent(in) :: pap(:,:) ! pressure at mid-layer (Pa) + real(kind_phys), intent(in) :: paph(:,:) ! pressure at boundaries (Pa) + real(kind_phys), intent(in) :: zm(:,:) ! geopotential at mid-layer (m) + real(kind_phys), intent(in) :: zi(:,:) ! geopotential at boundaries (m) + real(kind_phys), intent(in) :: fscav(:), fswtr(:), wcbmaxm(:) + real(kind_phys), intent(in) :: precz0in, preczhin, clmdin ! added for cs_convr - real(r8), intent(inout) :: u(:,:) ! zonal wind at mid-layer (m/s) - real(r8), intent(inout) :: v(:,:) ! meridional wind at mid-layer (m/s) + real(kind_phys), intent(inout) :: u(:,:) ! zonal wind at mid-layer (m/s) + real(kind_phys), intent(inout) :: v(:,:) ! meridional wind at mid-layer (m/s) - real(r8), intent(in) :: DELTA ! physics time step - real(r8), intent(in) :: DELTI ! dynamics time step (model time increment in seconds) + real(kind_phys), intent(in) :: DELTA ! physics time step + real(kind_phys), intent(in) :: DELTI ! dynamics time step (model time increment in seconds) logical, intent(in) :: do_aw, do_awdd, flx_form ! ! modified arguments ! - real(r8), intent(inout) :: CBMFX(:,:) ! cloud base mass flux (kg/m2/s) + real(kind_phys), intent(inout) :: CBMFX(:,:) ! cloud base mass flux (kg/m2/s) ! ! output arguments ! ! updraft, downdraft, and detrainment mass flux (kg/m2/s) - real(r8), intent(inout), dimension(:,:) :: ud_mf, dd_mf, dt_mf + real(kind_phys), intent(inout), dimension(:,:) :: ud_mf, dd_mf, dt_mf - real(r8), intent(out) :: rain1(:) ! lwe thickness of deep convective precipitation amount (m) + real(kind_phys), intent(out) :: rain1(:) ! lwe thickness of deep convective precipitation amount (m) ! GJF* These variables are conditionally allocated depending on whether the ! Morrison-Gettelman microphysics is used, so they must be declared ! using assumed shape. - real(r8), intent(out), dimension(:,:) :: qlcn, qicn, w_upi,cnv_mfd, & + real(kind_phys), intent(out), dimension(:,:) :: qlcn, qicn, w_upi,cnv_mfd, & cnv_dqldt, clcn, cnv_fice, & cnv_ndrop, cnv_nice, cf_upi ! *GJF - integer, intent(in) :: lprnt, ipr - integer, intent(inout) :: kcnv(ijsdim) ! zero if no deep convection and 1 otherwise + logical, intent(in) :: lprnt + integer, intent(in) :: ipr + integer, intent(inout) :: kcnv(:) ! zero if no deep convection and 1 otherwise character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg !DDsigma - output added for AW sigma diagnostics ! interface sigma and vertical velocity by cloud type (1=sfc) -! real(r8), intent(out), dimension(:,:,:) :: sigmai, vverti - real(r8), intent(out), dimension(:,:) :: sigma ! sigma sigma totaled over cloud type - on interfaces (1=sfc) +! real(kind_phys), intent(out), dimension(:,:,:) :: sigmai, vverti + real(kind_phys), intent(out), dimension(:,:) :: sigma ! sigma sigma totaled over cloud type - on interfaces (1=sfc) ! sigma terms in eq 91 and 92 -! real(r8), dimension(IJSDIM,KMAX) :: sfluxterm, qvfluxterm, condterm +! real(kind_phys), dimension(IJSDIM,KMAX) :: sfluxterm, qvfluxterm, condterm !DDsigma ! ! output arguments of CS_CUMLUS ! - real(r8), dimension(IJSDIM,KMAX,nctp) :: vverti + real(kind_phys), dimension(IJSDIM,KMAX,nctp) :: vverti - real(r8) GTT(IJSDIM,KMAX) !< temperature tendency [K/s] - real(r8) GTQ(IJSDIM,KMAX,NTR) !< tracer tendency [kg/kg/s] - real(r8) GTU(IJSDIM,KMAX) !< zonal velocity tendency [m/s2] - real(r8) GTV(IJSDIM,KMAX) !< meridional velocity tendency [m/s2] - real(r8) GTPRP(IJSDIM,KMAX) !< precipitation (including snowfall) flux at interfaces [kg/m2/s] - real(r8) GSNWP(IJSDIM,KMAX) !< snowfall flux at interfaces [kg/m2/s] + real(kind_phys) GTT(IJSDIM,KMAX) !< temperature tendency [K/s] + real(kind_phys) GTQ(IJSDIM,KMAX,NTR) !< tracer tendency [kg/kg/s] + real(kind_phys) GTU(IJSDIM,KMAX) !< zonal velocity tendency [m/s2] + real(kind_phys) GTV(IJSDIM,KMAX) !< meridional velocity tendency [m/s2] + real(kind_phys) GTPRP(IJSDIM,KMAX) !< precipitation (including snowfall) flux at interfaces [kg/m2/s] + real(kind_phys) GSNWP(IJSDIM,KMAX) !< snowfall flux at interfaces [kg/m2/s] integer KT(IJSDIM,nctp) !< cloud top index for each cloud type - real(r8) :: cape(IJSDIM) !< convective available potential energy (J/kg) - real(r8) :: prec(IJSDIM) !< precipitation at surface (including snowfall) (kg/m2/s) - real(r8) :: snow(IJSDIM) !< snowfall at surface (kg/m2/s) + real(kind_phys) :: cape(IJSDIM) !< convective available potential energy (J/kg) + real(kind_phys) :: prec(IJSDIM) !< precipitation at surface (including snowfall) (kg/m2/s) + real(kind_phys) :: snow(IJSDIM) !< snowfall at surface (kg/m2/s) ! ! input arguments of CS_CUMLUS ! - real(r8) GDT(IJSDIM,KMAX) !< temperature [K] - real(r8) GDQ(IJSDIM,KMAX,NTR) !< tracers including moisture [kg/kg] !DDsigmadiag - real(r8) GDU(IJSDIM,KMAX) !< zonal wind [m/s] - real(r8) GDV(IJSDIM,KMAX) !< meridional wind [m/s] - real(r8) GDTM(IJSDIM,KMAX+1) !< temperature at boundaries of layers [K] - real(r8) GDP(IJSDIM,KMAX) !< pressure [Pa] - real(r8) GDPM(IJSDIM,KMAX+1) !< pressure at boundaries of layers [Pa] - real(r8) GDZ(IJSDIM,KMAX) !< altitude [m] - real(r8) GDZM(IJSDIM,KMAX+1) !< altitude at boundaries of layers [m] - real(r8) delp(IJSDIM,KMAX) !< pressure difference between layers [Pa] - real(r8) delpi(IJSDIM,KMAX) !< grav/delp + real(kind_phys) GDT(IJSDIM,KMAX) !< temperature [K] + real(kind_phys) GDQ(IJSDIM,KMAX,NTR) !< tracers including moisture [kg/kg] !DDsigmadiag + real(kind_phys) GDU(IJSDIM,KMAX) !< zonal wind [m/s] + real(kind_phys) GDV(IJSDIM,KMAX) !< meridional wind [m/s] + real(kind_phys) GDTM(IJSDIM,KMAX+1) !< temperature at boundaries of layers [K] + real(kind_phys) GDP(IJSDIM,KMAX) !< pressure [Pa] + real(kind_phys) GDPM(IJSDIM,KMAX+1) !< pressure at boundaries of layers [Pa] + real(kind_phys) GDZ(IJSDIM,KMAX) !< altitude [m] + real(kind_phys) GDZM(IJSDIM,KMAX+1) !< altitude at boundaries of layers [m] + real(kind_phys) delp(IJSDIM,KMAX) !< pressure difference between layers [Pa] + real(kind_phys) delpi(IJSDIM,KMAX) !< grav/delp ! ! local variables ! -!DD real(r8) :: zs(IJSDIM) !< surface height [m] +!DD real(kind_phys) :: zs(IJSDIM) !< surface height [m] integer KTMAX(IJSDIM) !< max of KT - real(r8) :: ftintm, wrk, wrk1, tem + real(kind_phys) :: ftintm, wrk, wrk1, tem integer i, k, n, ISTS, IENS, kp1 !DD borrowed from RAS to go form total condensate to ice/water separately ! parameter (tf=130.16, tcr=160.16, tcrf=1.0/(tcr-tf),tcl=2.0) ! parameter (tf=230.16, tcr=260.16, tcrf=1.0/(tcr-tf)) - real(r8), parameter :: tf=233.16, tcr=263.16, tcrf=1.0/(tcr-tf), tcl=2.0 + real(kind_phys), parameter :: tf=233.16, tcr=263.16, tcrf=1.0/(tcr-tf), tcl=2.0 logical, save :: first=.true. ! Initialize CCPP error handling variables @@ -724,208 +725,208 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions logical, intent(in) :: otspt1(ntr), otspt2(ntr), lprnt ! ! [OUTPUT] - REAL(r8), INTENT(OUT) :: GTT (IJSDIM, KMAX ) ! heating rate - REAL(r8), INTENT(OUT) :: GTQ (IJSDIM, KMAX, NTR) ! change in q - REAL(r8), INTENT(OUT) :: GTU (IJSDIM, KMAX ) ! tendency of u - REAL(r8), INTENT(OUT) :: GTV (IJSDIM, KMAX ) ! tendency of v - REAL(r8), INTENT(OUT) :: CMDET (IJSDIM, KMAX ) ! detrainment mass flux + REAL(kind_phys), INTENT(OUT) :: GTT (IJSDIM, KMAX ) ! heating rate + REAL(kind_phys), INTENT(OUT) :: GTQ (IJSDIM, KMAX, NTR) ! change in q + REAL(kind_phys), INTENT(OUT) :: GTU (IJSDIM, KMAX ) ! tendency of u + REAL(kind_phys), INTENT(OUT) :: GTV (IJSDIM, KMAX ) ! tendency of v + REAL(kind_phys), INTENT(OUT) :: CMDET (IJSDIM, KMAX ) ! detrainment mass flux ! assuming there is no flux at the top of the atmospherea - Moorthi - REAL(r8), INTENT(OUT) :: GTPRP (IJSDIM, KMAX ) ! rain+snow flux - REAL(r8), INTENT(OUT) :: GSNWP (IJSDIM, KMAX ) ! snowfall flux - REAL(r8), INTENT(OUT) :: GMFX0 (IJSDIM, KMAX ) ! updraft mass flux - REAL(r8), INTENT(OUT) :: GMFX1 (IJSDIM, KMAX ) ! downdraft mass flux + REAL(kind_phys), INTENT(OUT) :: GTPRP (IJSDIM, KMAX ) ! rain+snow flux + REAL(kind_phys), INTENT(OUT) :: GSNWP (IJSDIM, KMAX ) ! snowfall flux + REAL(kind_phys), INTENT(OUT) :: GMFX0 (IJSDIM, KMAX ) ! updraft mass flux + REAL(kind_phys), INTENT(OUT) :: GMFX1 (IJSDIM, KMAX ) ! downdraft mass flux - REAL(r8), INTENT(OUT) :: CAPE (IJSDIM ) + REAL(kind_phys), INTENT(OUT) :: CAPE (IJSDIM ) INTEGER , INTENT(OUT) :: KT (IJSDIM, NCTP ) ! cloud top ! ! [MODIFIED] - REAL(r8), INTENT(INOUT) :: CBMFX (IM, NCTP) ! cloud base mass flux + REAL(kind_phys), INTENT(INOUT) :: CBMFX (IM, NCTP) ! cloud base mass flux !DDsigma - output added for AW sigma diagnostics ! sigma and vert. velocity as a function of cloud type (1==sfc) - real(r8), intent(out), dimension(IM,KMAX) :: sigma !sigma totaled over cloud type - on interfaces (1=sfc) - real(r8), intent(out), dimension(IM,KMAX,nctp) :: vverti + real(kind_phys), intent(out), dimension(IM,KMAX) :: sigma !sigma totaled over cloud type - on interfaces (1=sfc) + real(kind_phys), intent(out), dimension(IM,KMAX,nctp) :: vverti ! for computing AW flux form of tendencies ! The tendencies are summed over all cloud types -! real(r8), intent(out), dimension(IM,KMAX) :: & !DDsigmadiag - real(r8), allocatable, dimension(:,:) :: sfluxterm, qvfluxterm,& ! tendencies of DSE and water vapor due to eddy mass flux +! real(kind_phys), intent(out), dimension(IM,KMAX) :: & !DDsigmadiag + real(kind_phys), allocatable, dimension(:,:) :: sfluxterm, qvfluxterm,& ! tendencies of DSE and water vapor due to eddy mass flux qlfluxterm, qifluxterm,& ! tendencies of cloud water and cloud ice due to eddy mass flux ! The fluxes are for an individual cloud type and reused. ! condtermt, condtermq are eddy flux of temperature and water vapor condtermt, condtermq, frzterm, & prectermq, prectermfrz - real(r8), allocatable, dimension(:,:,:) :: trfluxterm ! tendencies of tracers due to eddy mass flux + real(kind_phys), allocatable, dimension(:,:,:) :: trfluxterm ! tendencies of tracers due to eddy mass flux ! ! [INPUT] - REAL(r8), INTENT(IN) :: GDT (IJSDIM, KMAX ) ! temperature T - REAL(r8), INTENT(IN) :: GDQ (IJSDIM, KMAX, NTR) ! humidity, tracer !DDsigmadiag - REAL(r8), INTENT(IN) :: GDU (IJSDIM, KMAX ) ! westerly u - REAL(r8), INTENT(IN) :: GDV (IJSDIM, KMAX ) ! southern wind v - REAL(r8), INTENT(IN) :: GDTM (IJSDIM, KMAX+1 ) ! temperature T - REAL(r8), INTENT(IN) :: GDP (IJSDIM, KMAX ) ! pressure P - REAL(r8), INTENT(IN) :: GDPM (IJSDIM, KMAX+1 ) ! pressure (half lev) - REAL(r8), INTENT(IN) :: GDZ (IJSDIM, KMAX ) ! altitude - REAL(r8), INTENT(IN) :: GDZM (IJSDIM, KMAX+1 ) ! altitude - REAL(r8), INTENT(IN) :: DELTA ! delta(t) (dynamics) - REAL(r8), INTENT(IN) :: DELTI ! delta(t) (internal variable) + REAL(kind_phys), INTENT(IN) :: GDT (IJSDIM, KMAX ) ! temperature T + REAL(kind_phys), INTENT(IN) :: GDQ (IJSDIM, KMAX, NTR) ! humidity, tracer !DDsigmadiag + REAL(kind_phys), INTENT(IN) :: GDU (IJSDIM, KMAX ) ! westerly u + REAL(kind_phys), INTENT(IN) :: GDV (IJSDIM, KMAX ) ! southern wind v + REAL(kind_phys), INTENT(IN) :: GDTM (IJSDIM, KMAX+1 ) ! temperature T + REAL(kind_phys), INTENT(IN) :: GDP (IJSDIM, KMAX ) ! pressure P + REAL(kind_phys), INTENT(IN) :: GDPM (IJSDIM, KMAX+1 ) ! pressure (half lev) + REAL(kind_phys), INTENT(IN) :: GDZ (IJSDIM, KMAX ) ! altitude + REAL(kind_phys), INTENT(IN) :: GDZM (IJSDIM, KMAX+1 ) ! altitude + REAL(kind_phys), INTENT(IN) :: DELTA ! delta(t) (dynamics) + REAL(kind_phys), INTENT(IN) :: DELTI ! delta(t) (internal variable) INTEGER, INTENT(IN) :: ISTS, IENS ! array range - real(r8), intent(in) :: fscav(ntr), fswtr(ntr), wcbmaxm(ijsdim) + real(kind_phys), intent(in) :: fscav(ntr), fswtr(ntr), wcbmaxm(ijsdim) ! ! [INTERNAL WORK] - REAL(r8), allocatable :: GPRCC (:, :) ! rainfall -! REAL(r8) GPRCC (IJSDIM, NTR) ! rainfall -! REAL(r8) GSNWC (IJSDIM) ! snowfall -! REAL(r8) CUMCLW(IJSDIM, KMAX) ! cloud water in cumulus -! REAL(r8) CUMFRC(IJSDIM) ! cumulus cloud fraction -! -! REAL(r8) GTCFRC(IJSDIM, KMAX) ! change in cloud fraction -! REAL(r8) FLIQC (IJSDIM, KMAX) ! liquid ratio in cumulus -! -! REAL(r8) GDCFRC(IJSDIM, KMAX) ! cloud fraction -! - REAL(r8) GDW (IJSDIM, KMAX) ! total water - REAL(r8) DELP (IJSDIM, KMAX) - REAL(r8) DELPI (IJSDIM, KMAX) - REAL(r8) GDQS (IJSDIM, KMAX) ! saturate moisture - REAL(r8) FDQS (IJSDIM, KMAX) - REAL(r8) GAM (IJSDIM, KMAX) - REAL(r8) GDS (IJSDIM, KMAX) ! dry static energy - REAL(r8) GDH (IJSDIM, KMAX) ! moist static energy - REAL(r8) GDHS (IJSDIM, KMAX) ! saturate MSE -! - REAL(r8) GCYM (IJSDIM, KMAX, NCTP)! norm. mass flux (half lev) - REAL(r8) GCHB (IJSDIM) ! cloud base MSE-Li*Qi - REAL(r8) GCWB (IJSDIM) ! cloud base total water - REAL(r8) GCUB (IJSDIM) ! cloud base U - REAL(r8) GCVB (IJSDIM) ! cloud base V - REAL(r8) GCIB (IJSDIM) ! cloud base ice - REAL(r8) GCtrB (IJSDIM,ntrq:ntr) ! cloud base tracer - REAL(r8) GCYT (IJSDIM, NCTP) ! norm. mass flux @top - REAL(r8) GCHT (IJSDIM, NCTP) ! cloud top MSE - REAL(r8) GCQT (IJSDIM, NCTP) ! cloud top q - REAL(r8) GCwT (IJSDIM) ! cloud top total water - REAL(r8) GCUT (IJSDIM, NCTP) ! cloud top U - REAL(r8) GCVT (IJSDIM, NCTP) ! cloud top V - REAL(r8) GCLT (IJSDIM, NCTP) ! cloud top cloud water - REAL(r8) GCIT (IJSDIM, NCTP) ! cloud top cloud ice - REAL(r8) GCtrT (IJSDIM, ntrq:ntr, NCTP) ! cloud top tracer - REAL(r8) GTPRT (IJSDIM, NCTP) ! precipitation/M - REAL(r8) GCLZ (IJSDIM, KMAX) ! cloud liquid for each CTP - REAL(r8) GCIZ (IJSDIM, KMAX) ! cloud ice for each CTP - -! REAL(r8) ACWF (IJSDIM, NCTP) ! cloud work function - REAL(r8) ACWF (IJSDIM ) ! cloud work function - REAL(r8) GPRCIZ(IJSDIM, KMAX) ! precipitation - REAL(r8) GSNWIZ(IJSDIM, KMAX) ! snowfall - REAL(r8) GTPRC0(IJSDIM) ! precip. before evap. - - REAL(r8) GMFLX (IJSDIM, KMAX) ! mass flux (updraft+downdraft) - REAL(r8) QLIQ (IJSDIM, KMAX) ! total cloud liquid - REAL(r8) QICE (IJSDIM, KMAX) ! total cloud ice - REAL(r8) GPRCI (IJSDIM, KMAX) ! rainfall generation - REAL(r8) GSNWI (IJSDIM, KMAX) ! snowfall generation - - REAL(r8) GPRCP (IJSDIM, KMAX) ! rainfall flux -! - REAL(r8) GTEVP (IJSDIM, KMAX) ! evaporation+sublimation - REAL(r8) GMDD (IJSDIM, KMAX) ! downdraft mass flux - -! REAL(r8) CUMHGT(IJSDIM, NCTP) ! cloud top height -! REAL(r8) CTOPP (IJSDIM) ! cloud top pressure - - REAL(r8) GDZTR (IJSDIM) ! tropopause height -! REAL(r8) FLIQOU(IJSDIM, KMAX) ! liquid ratio in cumulus + REAL(kind_phys), allocatable :: GPRCC (:, :) ! rainfall +! REAL(kind_phys) GPRCC (IJSDIM, NTR) ! rainfall +! REAL(kind_phys) GSNWC (IJSDIM) ! snowfall +! REAL(kind_phys) CUMCLW(IJSDIM, KMAX) ! cloud water in cumulus +! REAL(kind_phys) CUMFRC(IJSDIM) ! cumulus cloud fraction +! +! REAL(kind_phys) GTCFRC(IJSDIM, KMAX) ! change in cloud fraction +! REAL(kind_phys) FLIQC (IJSDIM, KMAX) ! liquid ratio in cumulus +! +! REAL(kind_phys) GDCFRC(IJSDIM, KMAX) ! cloud fraction +! + REAL(kind_phys) GDW (IJSDIM, KMAX) ! total water + REAL(kind_phys) DELP (IJSDIM, KMAX) + REAL(kind_phys) DELPI (IJSDIM, KMAX) + REAL(kind_phys) GDQS (IJSDIM, KMAX) ! saturate moisture + REAL(kind_phys) FDQS (IJSDIM, KMAX) + REAL(kind_phys) GAM (IJSDIM, KMAX) + REAL(kind_phys) GDS (IJSDIM, KMAX) ! dry static energy + REAL(kind_phys) GDH (IJSDIM, KMAX) ! moist static energy + REAL(kind_phys) GDHS (IJSDIM, KMAX) ! saturate MSE +! + REAL(kind_phys) GCYM (IJSDIM, KMAX, NCTP)! norm. mass flux (half lev) + REAL(kind_phys) GCHB (IJSDIM) ! cloud base MSE-Li*Qi + REAL(kind_phys) GCWB (IJSDIM) ! cloud base total water + REAL(kind_phys) GCUB (IJSDIM) ! cloud base U + REAL(kind_phys) GCVB (IJSDIM) ! cloud base V + REAL(kind_phys) GCIB (IJSDIM) ! cloud base ice + REAL(kind_phys) GCtrB (IJSDIM,ntrq:ntr) ! cloud base tracer + REAL(kind_phys) GCYT (IJSDIM, NCTP) ! norm. mass flux @top + REAL(kind_phys) GCHT (IJSDIM, NCTP) ! cloud top MSE + REAL(kind_phys) GCQT (IJSDIM, NCTP) ! cloud top q + REAL(kind_phys) GCwT (IJSDIM) ! cloud top total water + REAL(kind_phys) GCUT (IJSDIM, NCTP) ! cloud top U + REAL(kind_phys) GCVT (IJSDIM, NCTP) ! cloud top V + REAL(kind_phys) GCLT (IJSDIM, NCTP) ! cloud top cloud water + REAL(kind_phys) GCIT (IJSDIM, NCTP) ! cloud top cloud ice + REAL(kind_phys) GCtrT (IJSDIM, ntrq:ntr, NCTP) ! cloud top tracer + REAL(kind_phys) GTPRT (IJSDIM, NCTP) ! precipitation/M + REAL(kind_phys) GCLZ (IJSDIM, KMAX) ! cloud liquid for each CTP + REAL(kind_phys) GCIZ (IJSDIM, KMAX) ! cloud ice for each CTP + +! REAL(kind_phys) ACWF (IJSDIM, NCTP) ! cloud work function + REAL(kind_phys) ACWF (IJSDIM ) ! cloud work function + REAL(kind_phys) GPRCIZ(IJSDIM, KMAX) ! precipitation + REAL(kind_phys) GSNWIZ(IJSDIM, KMAX) ! snowfall + REAL(kind_phys) GTPRC0(IJSDIM) ! precip. before evap. + + REAL(kind_phys) GMFLX (IJSDIM, KMAX) ! mass flux (updraft+downdraft) + REAL(kind_phys) QLIQ (IJSDIM, KMAX) ! total cloud liquid + REAL(kind_phys) QICE (IJSDIM, KMAX) ! total cloud ice + REAL(kind_phys) GPRCI (IJSDIM, KMAX) ! rainfall generation + REAL(kind_phys) GSNWI (IJSDIM, KMAX) ! snowfall generation + + REAL(kind_phys) GPRCP (IJSDIM, KMAX) ! rainfall flux +! + REAL(kind_phys) GTEVP (IJSDIM, KMAX) ! evaporation+sublimation + REAL(kind_phys) GMDD (IJSDIM, KMAX) ! downdraft mass flux + +! REAL(kind_phys) CUMHGT(IJSDIM, NCTP) ! cloud top height +! REAL(kind_phys) CTOPP (IJSDIM) ! cloud top pressure + + REAL(kind_phys) GDZTR (IJSDIM) ! tropopause height +! REAL(kind_phys) FLIQOU(IJSDIM, KMAX) ! liquid ratio in cumulus INTEGER KB (IJSDIM) INTEGER KSTRT (IJSDIM) ! tropopause level - REAL(r8) GAMX - REAL(r8) CIN (IJSDIM) + REAL(kind_phys) GAMX + REAL(kind_phys) CIN (IJSDIM) INTEGER JBUOY (IJSDIM) - REAL(r8) DELZ, BUOY, DELWC, DELER - REAL(r8) WCBX (IJSDIM) -! REAL(r8) ERMR (NCTP) ! entrainment rate (ASMODE) + REAL(kind_phys) DELZ, BUOY, DELWC, DELER + REAL(kind_phys) WCBX (IJSDIM) +! REAL(kind_phys) ERMR (NCTP) ! entrainment rate (ASMODE) ! SAVE ERMR INTEGER KTMX (NCTP) ! max of cloud top INTEGER KTMXT ! max of cloud top -! REAL(r8) TIMED - REAL(r8) GDCLDX, GDMU2X, GDMU3X +! REAL(kind_phys) TIMED + REAL(kind_phys) GDCLDX, GDMU2X, GDMU3X ! -! REAL(r8) HBGT (IJSDIM) ! imbalance in column heat -! REAL(r8) WBGT (IJSDIM) ! imbalance in column water +! REAL(kind_phys) HBGT (IJSDIM) ! imbalance in column heat +! REAL(kind_phys) WBGT (IJSDIM) ! imbalance in column water !DDsigma begin local work variables - all on model interfaces (sfc=1) - REAL(r8) lamdai ! lamda for cloud type ctp - REAL(r8) gdqm, gdlm, gdim ! water vapor - REAL(r8) gdtrm(ntrq:ntr) ! tracer + REAL(kind_phys) lamdai ! lamda for cloud type ctp + REAL(kind_phys) gdqm, gdlm, gdim ! water vapor + REAL(kind_phys) gdtrm(ntrq:ntr) ! tracer ! the following are new arguments to cumup to get them out for AW - REAL(r8) wcv (IJSDIM, KMAX) ! in-cloud vertical velocity - REAL(r8) GCTM (IJSDIM, KMAX) ! cloud T (half lev) !DDsigmadiag make output - REAL(r8) GCQM (IJSDIM, KMAX) ! cloud q (half lev) !DDsigmadiag make output - REAL(r8) GCwM (IJSDIM, KMAX) ! cloud q (half lev) !DDsigmadiag make output - REAL(r8) GCiM (IJSDIM, KMAX) ! cloud q (half lev) !DDsigmadiag make output - REAL(r8) GClM (IJSDIM, KMAX) ! cloud q (half lev) !DDsigmadiag make output - REAL(r8) GChM (IJSDIM, KMAX) ! cloud q (half lev) !DDsigmadiag make output - REAL(r8) GCtrM (IJSDIM, KMAX, ntrq:ntr) ! cloud tracer (half lev) !DDsigmadiag make output + REAL(kind_phys) wcv (IJSDIM, KMAX) ! in-cloud vertical velocity + REAL(kind_phys) GCTM (IJSDIM, KMAX) ! cloud T (half lev) !DDsigmadiag make output + REAL(kind_phys) GCQM (IJSDIM, KMAX) ! cloud q (half lev) !DDsigmadiag make output + REAL(kind_phys) GCwM (IJSDIM, KMAX) ! cloud q (half lev) !DDsigmadiag make output + REAL(kind_phys) GCiM (IJSDIM, KMAX) ! cloud q (half lev) !DDsigmadiag make output + REAL(kind_phys) GClM (IJSDIM, KMAX) ! cloud q (half lev) !DDsigmadiag make output + REAL(kind_phys) GChM (IJSDIM, KMAX) ! cloud q (half lev) !DDsigmadiag make output + REAL(kind_phys) GCtrM (IJSDIM, KMAX, ntrq:ntr) ! cloud tracer (half lev) !DDsigmadiag make output ! eddy flux profiles for dse, water vapor, cloud water, cloud ice - REAL(r8), dimension(Kmax+1) :: sfluxtem, qvfluxtem, qlfluxtem, qifluxtem - REAL(r8), dimension(Kmax+1,ntrq:ntr) :: trfluxtem ! tracer + REAL(kind_phys), dimension(Kmax+1) :: sfluxtem, qvfluxtem, qlfluxtem, qifluxtem + REAL(kind_phys), dimension(Kmax+1,ntrq:ntr) :: trfluxtem ! tracer ! tendency profiles - condensation heating, condensation moistening, heating due to ! freezing, total precip production, frozen precip production - REAL(r8), dimension(ijsdim,Kmax) :: dtcondtem, dqcondtem, dtfrztem, dqprectem,& ! Moorthi + REAL(kind_phys), dimension(ijsdim,Kmax) :: dtcondtem, dqcondtem, dtfrztem, dqprectem,& ! Moorthi dfrzprectem, lamdaprod !< product of (1+lamda) through cloud type ctp - REAL(r8), dimension(ijsdim,Kmax) :: dtevap, dqevap, dtmelt, dtsubl + REAL(kind_phys), dimension(ijsdim,Kmax) :: dtevap, dqevap, dtmelt, dtsubl ! factor to modify precip rate to force conservation of water. With bug fixes it's ! not doing anything now. - REAL(r8), dimension(ijsdim) :: moistening_aw - real(r8), dimension(ijsdim,kmax) :: gctbl, gcqbl,gcwbl, gcqlbl, gcqibl, & !DDsigmadiag updraft profiles below cloud Base + REAL(kind_phys), dimension(ijsdim) :: moistening_aw + real(kind_phys), dimension(ijsdim,kmax) :: gctbl, gcqbl,gcwbl, gcqlbl, gcqibl, & !DDsigmadiag updraft profiles below cloud Base sigmad ! downdraft area fraction - real(r8), dimension(ijsdim,kmax,ntrq:ntr) :: gctrbl !DDsigmadiag tracer updraft profiles below cloud Base + real(kind_phys), dimension(ijsdim,kmax,ntrq:ntr) :: gctrbl !DDsigmadiag tracer updraft profiles below cloud Base ! rhs_q, rhs_h are residuals of condensed water, MSE budgets to compute condensation, ! and heating due to freezing - real(r8) :: rhs_q, rhs_h, fsigma, sigmai, delpinv -! real(r8) :: rhs_q, rhs_h, sftem, qftem, qlftem, qiftem, & + real(kind_phys) :: rhs_q, rhs_h, fsigma, sigmai, delpinv +! real(kind_phys) :: rhs_q, rhs_h, sftem, qftem, qlftem, qiftem, & ! fsigma ! factor to reduce mass flux terms (1-sigma**2) for AW !DDsigma end local work variables ! ! profiles of heating due to precip evaporation, melting and sublimation, and the ! evap, melting and sublimation rates. - REAL(r8), allocatable, dimension(:,:) :: dtdwn, & ! t tendency downdraft detrainment + REAL(kind_phys), allocatable, dimension(:,:) :: dtdwn, & ! t tendency downdraft detrainment dqvdwn, & ! qv tendency downdraft detrainment dqldwn, & ! ql tendency downdraft detrainment dqidwn ! qi tendency downdraft detrainment - REAL(r8), allocatable, dimension(:,:,:) :: dtrdwn ! tracer tendency downdraft detrainment + REAL(kind_phys), allocatable, dimension(:,:,:) :: dtrdwn ! tracer tendency downdraft detrainment !DDsigma end local work variables ! ! [INTERNAL PARM] - REAL(r8), parameter :: WCBMIN = zero ! min. of updraft velocity at cloud base + REAL(kind_phys), parameter :: WCBMIN = zero ! min. of updraft velocity at cloud base -!M REAL(r8) :: WCBMAX = 1.4_r8 ! max. of updraft velocity at cloud base +!M REAL(kind_phys) :: WCBMAX = 1.4_kind_phys ! max. of updraft velocity at cloud base !M wcbas commented by Moorthi since it is not used -!M REAL(r8) :: WCBAS = 2._r8 ! updraft velocity**2 at cloud base (ASMODE) -!M REAL(r8) :: ERAMIN = 1.e-5_r8 ! min. of entrainment rate +!M REAL(kind_phys) :: WCBAS = 2._kind_phys ! updraft velocity**2 at cloud base (ASMODE) +!M REAL(kind_phys) :: ERAMIN = 1.e-5_kind_phys ! min. of entrainment rate ! used only in OPT_ASMODE -!M REAL(r8) :: ERAMAX = 2.e-3_r8 ! max. of entrainment rate +!M REAL(kind_phys) :: ERAMAX = 2.e-3_kind_phys ! max. of entrainment rate ! used only in OPT_ASMODE LOGICAL :: OINICB = .false. ! set 0.d0 to CBMFX when .true. -! REAL(r8) :: VARMIN = 1.e-13_r8 ! minimum of PDF variance -! REAL(r8) :: VARMAX = 5.e-7_r8 ! maximum of PDF variance -! REAL(r8) :: SKWMAX = 0.566_r8 ! maximum of PDF skewness +! REAL(kind_phys) :: VARMIN = 1.e-13_kind_phys ! minimum of PDF variance +! REAL(kind_phys) :: VARMAX = 5.e-7_kind_phys ! maximum of PDF variance +! REAL(kind_phys) :: SKWMAX = 0.566_kind_phys ! maximum of PDF skewness - REAL(r8) :: PSTRMX = 400.e2_r8 ! max P of tropopause - REAL(r8) :: PSTRMN = 50.e2_r8 ! min P of tropopause - REAL(r8) :: GCRSTR = 1.e-4_r8 ! crit. dT/dz tropopause + REAL(kind_phys) :: PSTRMX = 400.e2_kind_phys ! max P of tropopause + REAL(kind_phys) :: PSTRMN = 50.e2_kind_phys ! min P of tropopause + REAL(kind_phys) :: GCRSTR = 1.e-4_kind_phys ! crit. dT/dz tropopause - real(kind=r8) :: tem, esat, mflx_e, cbmfl, tem1, tem2, tem3 + real(kind=kind_phys) :: tem, esat, mflx_e, cbmfl, tem1, tem2, tem3 INTEGER :: KBMX, I, K, CTP, ierr, n, kp1, km1, kk, kbi, l, l1 ! LOGICAL, SAVE :: OFIRST = .TRUE. ! called first time? @@ -1723,7 +1724,7 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions ! is occuring now which is a good sign! DD if(flx_form .and. adjustp) then DO I = ISTS, IENS - if(gprcp(i,1)+gsnwp(i,1) > 1.e-12_r8) then + if(gprcp(i,1)+gsnwp(i,1) > 1.e-12_kind_phys) then moistening_aw(i) = - moistening_aw(i) / (gprcp(i,1)+gsnwp(i,1)) else moistening_aw(i) = 1.0 @@ -1792,42 +1793,42 @@ SUBROUTINE CUMBAS & ! cloud base ! ! [OUTPUT] INTEGER KB (IJSDIM) ! cloud base - REAL(r8) GCYM (IJSDIM, KMAX) ! norm. mass flux (half lev) + REAL(kind_phys) GCYM (IJSDIM, KMAX) ! norm. mass flux (half lev) INTEGER KBMX - REAL(r8) GCHB (IJSDIM) ! cloud base MSE - REAL(r8) GCWB (IJSDIM) ! cloud base total water - REAL(r8) GCUB (IJSDIM) ! cloud base U - REAL(r8) GCVB (IJSDIM) ! cloud base V - REAL(r8) GCIB (IJSDIM) ! cloud base ice - REAL(r8) GCtrB (IJSDIM,ntrq:ntr) ! cloud base tracer + REAL(kind_phys) GCHB (IJSDIM) ! cloud base MSE + REAL(kind_phys) GCWB (IJSDIM) ! cloud base total water + REAL(kind_phys) GCUB (IJSDIM) ! cloud base U + REAL(kind_phys) GCVB (IJSDIM) ! cloud base V + REAL(kind_phys) GCIB (IJSDIM) ! cloud base ice + REAL(kind_phys) GCtrB (IJSDIM,ntrq:ntr) ! cloud base tracer !DDsigma added to arglist for AW, subcloud updraft profiles: temperature, water vapor ! total water, cloud water, and cloud ice respectively - REAL(r8), dimension(ijsdim,kmax) :: gctbl, gcqbl, gcwbl, gcqlbl, gcqibl !>DDsigmadiag - REAL(r8), dimension(ijsdim,kmax,ntrq:ntr) :: gctrbl !DDsigmadiag + REAL(kind_phys), dimension(ijsdim,kmax) :: gctbl, gcqbl, gcwbl, gcqlbl, gcqibl !>DDsigmadiag + REAL(kind_phys), dimension(ijsdim,kmax,ntrq:ntr) :: gctrbl !DDsigmadiag ! ! [INPUT] - REAL(r8) GDH (IJSDIM, KMAX) ! moist static energy - REAL(r8) GDW (IJSDIM, KMAX) ! total water - REAL(r8) GDq (IJSDIM, KMAX, ntr) ! water vapor and tracer - REAL(r8) GDHS (IJSDIM, KMAX) ! saturate MSE - REAL(r8) GDQS (IJSDIM, KMAX) ! saturate humidity - REAL(r8) GDQI (IJSDIM, KMAX) ! cloud ice - REAL(r8) GDU (IJSDIM, KMAX) ! u-velocity - REAL(r8) GDV (IJSDIM, KMAX) ! v-velocity - REAL(r8) GDZM (IJSDIM, KMAX+1) ! Altitude (half lev) - REAL(r8) GDPM (IJSDIM, KMAX+1) ! pressure (half lev) - REAL(r8) FDQS (IJSDIM, KMAX) - REAL(r8) GAM (IJSDIM, KMAX) + REAL(kind_phys) GDH (IJSDIM, KMAX) ! moist static energy + REAL(kind_phys) GDW (IJSDIM, KMAX) ! total water + REAL(kind_phys) GDq (IJSDIM, KMAX, ntr) ! water vapor and tracer + REAL(kind_phys) GDHS (IJSDIM, KMAX) ! saturate MSE + REAL(kind_phys) GDQS (IJSDIM, KMAX) ! saturate humidity + REAL(kind_phys) GDQI (IJSDIM, KMAX) ! cloud ice + REAL(kind_phys) GDU (IJSDIM, KMAX) ! u-velocity + REAL(kind_phys) GDV (IJSDIM, KMAX) ! v-velocity + REAL(kind_phys) GDZM (IJSDIM, KMAX+1) ! Altitude (half lev) + REAL(kind_phys) GDPM (IJSDIM, KMAX+1) ! pressure (half lev) + REAL(kind_phys) FDQS (IJSDIM, KMAX) + REAL(kind_phys) GAM (IJSDIM, KMAX) INTEGER ISTS, IENS ! ! [INTERNAL WORK] - REAL(r8) CBASE (IJSDIM) ! one over cloud base height -! REAL(r8) CBASEP(IJSDIM) ! cloud base pressure - REAL(r8) DELZ, GAMX, wrk -! REAL(r8) DELZ, QSL, GAMX, wrk -! REAL(r8), dimension(ijsdim,kmax) :: gchbl !DDsigmadiag - real(r8), dimension(ijsdim) :: gcqb, tx1, spbl, qsl + REAL(kind_phys) CBASE (IJSDIM) ! one over cloud base height +! REAL(kind_phys) CBASEP(IJSDIM) ! cloud base pressure + REAL(kind_phys) DELZ, GAMX, wrk +! REAL(kind_phys) DELZ, QSL, GAMX, wrk +! REAL(kind_phys), dimension(ijsdim,kmax) :: gchbl !DDsigmadiag + real(kind_phys), dimension(ijsdim) :: gcqb, tx1, spbl, qsl INTEGER I, K, kp1, n ! ! [INTERNAL PARM] @@ -2031,91 +2032,91 @@ SUBROUTINE CUMUP & !! in-cloud properties logical :: lprnt ! ! [OUTPUT] - REAL(r8) ACWF (IJSDIM) ! cloud work function - REAL(r8) GCLZ (IJSDIM, KMAX) ! cloud liquid water*eta - REAL(r8) GCIZ (IJSDIM, KMAX) ! cloud ice*eta - REAL(r8) GPRCIZ(IJSDIM, KMAX) ! rain generation*eta - REAL(r8) GSNWIZ(IJSDIM, KMAX) ! snow generation*eta - REAL(r8) GCYT (IJSDIM) ! norm. mass flux @top - REAL(r8) GCHT (IJSDIM) ! cloud top MSE*eta - REAL(r8) GCQT (IJSDIM) ! cloud top moisture*eta - REAL(r8) GCLT (IJSDIM) ! cloud top liquid water*eta - REAL(r8) GCIT (IJSDIM) ! cloud top ice*eta - REAL(r8) GCtrT (IJSDIM, ntrq:ntr) ! cloud top tracer*eta - REAL(r8) GTPRT (IJSDIM) ! cloud top (rain+snow)*eta - REAL(r8) GCUT (IJSDIM) ! cloud top u*eta - REAL(r8) GCVT (IJSDIM) ! cloud top v*eta - REAL(r8) GCwT (IJSDIM) ! cloud top v*eta + REAL(kind_phys) ACWF (IJSDIM) ! cloud work function + REAL(kind_phys) GCLZ (IJSDIM, KMAX) ! cloud liquid water*eta + REAL(kind_phys) GCIZ (IJSDIM, KMAX) ! cloud ice*eta + REAL(kind_phys) GPRCIZ(IJSDIM, KMAX) ! rain generation*eta + REAL(kind_phys) GSNWIZ(IJSDIM, KMAX) ! snow generation*eta + REAL(kind_phys) GCYT (IJSDIM) ! norm. mass flux @top + REAL(kind_phys) GCHT (IJSDIM) ! cloud top MSE*eta + REAL(kind_phys) GCQT (IJSDIM) ! cloud top moisture*eta + REAL(kind_phys) GCLT (IJSDIM) ! cloud top liquid water*eta + REAL(kind_phys) GCIT (IJSDIM) ! cloud top ice*eta + REAL(kind_phys) GCtrT (IJSDIM, ntrq:ntr) ! cloud top tracer*eta + REAL(kind_phys) GTPRT (IJSDIM) ! cloud top (rain+snow)*eta + REAL(kind_phys) GCUT (IJSDIM) ! cloud top u*eta + REAL(kind_phys) GCVT (IJSDIM) ! cloud top v*eta + REAL(kind_phys) GCwT (IJSDIM) ! cloud top v*eta INTEGER KT (IJSDIM) ! cloud top INTEGER KTMX ! max of cloud top - REAL(r8) WCV (IJSDIM, KMAX) ! updraft velocity (half lev) !DD sigma make output + REAL(kind_phys) WCV (IJSDIM, KMAX) ! updraft velocity (half lev) !DD sigma make output ! ! [MODIFIED] - REAL(r8) GCYM (IJSDIM, KMAX) ! norm. mass flux + REAL(kind_phys) GCYM (IJSDIM, KMAX) ! norm. mass flux ! ! [INPUT] - REAL(r8) GCHB (IJSDIM) ! cloud base Moist Static Energy - REAL(r8) GCWB (IJSDIM) ! cloud base total water - REAL(r8) GCUB (IJSDIM) ! cloud base U - REAL(r8) GCVB (IJSDIM) ! cloud base V - REAL(r8) GCIB (IJSDIM) ! cloud base ice - REAL(r8) GCtrB (IJSDIM,ntrq:ntr) ! cloud base tracers - REAL(r8) GDU (IJSDIM, KMAX) ! U - REAL(r8) GDV (IJSDIM, KMAX) ! V - REAL(r8) GDH (IJSDIM, KMAX) ! moist static energy - REAL(r8) GDW (IJSDIM, KMAX) ! total water - REAL(r8) GDHS (IJSDIM, KMAX) ! saturation MSE - REAL(r8) GDQS (IJSDIM, KMAX) ! saturation q - REAL(r8) GDT (IJSDIM, KMAX) ! T - REAL(r8) GDTM (IJSDIM, KMAX+1) ! T (half lev) - REAL(r8) GDQ (IJSDIM, KMAX, NTR) ! q !!DDsigmadiag - REAL(r8) GDQI (IJSDIM, KMAX) ! cloud ice - REAL(r8) GDZ (IJSDIM, KMAX) ! z - REAL(r8) GDZM (IJSDIM, KMAX+1) ! z (half lev) - REAL(r8) GDPM (IJSDIM, KMAX+1) ! p (half lev) - REAL(r8) FDQS (IJSDIM, KMAX) - REAL(r8) GAM (IJSDIM, KMAX) - REAL(r8) GDZTR (IJSDIM) ! tropopause height - REAL(r8) CPRES ! pres. fac. for cum. fric. - REAL(r8) WCB(ijsdim) ! cloud base updraft velocity**2 -! REAL(r8) ERMR ! entrainment rate (ASMODE) + REAL(kind_phys) GCHB (IJSDIM) ! cloud base Moist Static Energy + REAL(kind_phys) GCWB (IJSDIM) ! cloud base total water + REAL(kind_phys) GCUB (IJSDIM) ! cloud base U + REAL(kind_phys) GCVB (IJSDIM) ! cloud base V + REAL(kind_phys) GCIB (IJSDIM) ! cloud base ice + REAL(kind_phys) GCtrB (IJSDIM,ntrq:ntr) ! cloud base tracers + REAL(kind_phys) GDU (IJSDIM, KMAX) ! U + REAL(kind_phys) GDV (IJSDIM, KMAX) ! V + REAL(kind_phys) GDH (IJSDIM, KMAX) ! moist static energy + REAL(kind_phys) GDW (IJSDIM, KMAX) ! total water + REAL(kind_phys) GDHS (IJSDIM, KMAX) ! saturation MSE + REAL(kind_phys) GDQS (IJSDIM, KMAX) ! saturation q + REAL(kind_phys) GDT (IJSDIM, KMAX) ! T + REAL(kind_phys) GDTM (IJSDIM, KMAX+1) ! T (half lev) + REAL(kind_phys) GDQ (IJSDIM, KMAX, NTR) ! q !!DDsigmadiag + REAL(kind_phys) GDQI (IJSDIM, KMAX) ! cloud ice + REAL(kind_phys) GDZ (IJSDIM, KMAX) ! z + REAL(kind_phys) GDZM (IJSDIM, KMAX+1) ! z (half lev) + REAL(kind_phys) GDPM (IJSDIM, KMAX+1) ! p (half lev) + REAL(kind_phys) FDQS (IJSDIM, KMAX) + REAL(kind_phys) GAM (IJSDIM, KMAX) + REAL(kind_phys) GDZTR (IJSDIM) ! tropopause height + REAL(kind_phys) CPRES ! pres. fac. for cum. fric. + REAL(kind_phys) WCB(ijsdim) ! cloud base updraft velocity**2 +! REAL(kind_phys) ERMR ! entrainment rate (ASMODE) INTEGER KB (IJSDIM) INTEGER CTP, ISTS, IENS ! ! [INTERNAL WORK] - REAL(r8) ACWFK (IJSDIM,KMAX) ! cloud work function - REAL(r8) ACWFN (IJSDIM,KMAX) ! negative part of cloud work function - REAL(r8) myGCHt ! cloud top h *eta (half lev) - REAL(r8) GCHMZ (IJSDIM, KMAX) ! cloud h *eta (half lev) - REAL(r8) GCWMZ (IJSDIM, KMAX) ! cloud Qt*eta (half lev) - REAL(r8) GCUMZ (IJSDIM, KMAX) ! cloud U *eta (half lev) - REAL(r8) GCVMZ (IJSDIM, KMAX) ! cloud V *eta (half lev) - REAL(r8) GCqMZ (IJSDIM ) ! cloud qv*eta (half lev) - REAL(r8) GCIMZ (IJSDIM, KMAX) ! cloud Qi*eta (half lev) - REAL(r8) GCtrMZ(IJSDIM, KMAX,ntrq:ntr)! cloud tracer*eta (half lev) - REAL(r8) GTPRMZ(IJSDIM, KMAX) ! rain+snow *eta (half lev) -! - REAL(r8) BUOY (IJSDIM, KMAX) ! buoyancy - REAL(r8) BUOYM (IJSDIM, KMAX) ! buoyancy (half lev) - REAL(r8) WCM (IJSDIM ) ! updraft velocity**2 (half lev) -! REAL(r8) WCM (IJSDIM, KMAX) ! updraft velocity**2 (half lev) -!DD sigma make output REAL(r8) WCV ( IJSDIM, KMAX+1 ) !! updraft velocity (half lev) - REAL(r8) GCY (IJSDIM, KMAX) ! norm. mass flux -! REAL(r8) ELAR (IJSDIM, KMAX) ! entrainment rate - REAL(r8) ELAR ! entrainment rate at mid layer -! - REAL(r8) GCHM (IJSDIM, KMAX) ! cloud MSE (half lev) - REAL(r8) GCWM (IJSDIM, KMAX) ! cloud Qt (half lev) !DDsigmadiag - REAL(r8) GCTM (IJSDIM, KMAX) ! cloud T (half lev) !DDsigmadiag make output - REAL(r8) GCQM (IJSDIM, KMAX) ! cloud q (half lev) !DDsigmadiag make output - REAL(r8) GCLM (IJSDIM, KMAX) ! cloud liquid ( half lev) - REAL(r8) GCIM (IJSDIM, KMAX) ! cloud ice (half lev) - REAL(r8) GCUM (IJSDIM, KMAX) ! cloud U (half lev) - REAL(r8) GCVM (IJSDIM, KMAX) ! cloud V (half lev) - REAL(r8) GCtrM (IJSDIM, KMAX,ntrq:ntr) ! cloud tracer (half lev) -! - REAL(r8), dimension(IJSDIM) :: WCM_, ELARM1, GDZMKB - REAL(r8) GDQSM, GDHSM, GDQM, GDSM, GDCM, FDQSM, GCCM, & + REAL(kind_phys) ACWFK (IJSDIM,KMAX) ! cloud work function + REAL(kind_phys) ACWFN (IJSDIM,KMAX) ! negative part of cloud work function + REAL(kind_phys) myGCHt ! cloud top h *eta (half lev) + REAL(kind_phys) GCHMZ (IJSDIM, KMAX) ! cloud h *eta (half lev) + REAL(kind_phys) GCWMZ (IJSDIM, KMAX) ! cloud Qt*eta (half lev) + REAL(kind_phys) GCUMZ (IJSDIM, KMAX) ! cloud U *eta (half lev) + REAL(kind_phys) GCVMZ (IJSDIM, KMAX) ! cloud V *eta (half lev) + REAL(kind_phys) GCqMZ (IJSDIM ) ! cloud qv*eta (half lev) + REAL(kind_phys) GCIMZ (IJSDIM, KMAX) ! cloud Qi*eta (half lev) + REAL(kind_phys) GCtrMZ(IJSDIM, KMAX,ntrq:ntr)! cloud tracer*eta (half lev) + REAL(kind_phys) GTPRMZ(IJSDIM, KMAX) ! rain+snow *eta (half lev) +! + REAL(kind_phys) BUOY (IJSDIM, KMAX) ! buoyancy + REAL(kind_phys) BUOYM (IJSDIM, KMAX) ! buoyancy (half lev) + REAL(kind_phys) WCM (IJSDIM ) ! updraft velocity**2 (half lev) +! REAL(kind_phys) WCM (IJSDIM, KMAX) ! updraft velocity**2 (half lev) +!DD sigma make output REAL(kind_phys) WCV ( IJSDIM, KMAX+1 ) !! updraft velocity (half lev) + REAL(kind_phys) GCY (IJSDIM, KMAX) ! norm. mass flux +! REAL(kind_phys) ELAR (IJSDIM, KMAX) ! entrainment rate + REAL(kind_phys) ELAR ! entrainment rate at mid layer +! + REAL(kind_phys) GCHM (IJSDIM, KMAX) ! cloud MSE (half lev) + REAL(kind_phys) GCWM (IJSDIM, KMAX) ! cloud Qt (half lev) !DDsigmadiag + REAL(kind_phys) GCTM (IJSDIM, KMAX) ! cloud T (half lev) !DDsigmadiag make output + REAL(kind_phys) GCQM (IJSDIM, KMAX) ! cloud q (half lev) !DDsigmadiag make output + REAL(kind_phys) GCLM (IJSDIM, KMAX) ! cloud liquid ( half lev) + REAL(kind_phys) GCIM (IJSDIM, KMAX) ! cloud ice (half lev) + REAL(kind_phys) GCUM (IJSDIM, KMAX) ! cloud U (half lev) + REAL(kind_phys) GCVM (IJSDIM, KMAX) ! cloud V (half lev) + REAL(kind_phys) GCtrM (IJSDIM, KMAX,ntrq:ntr) ! cloud tracer (half lev) +! + REAL(kind_phys), dimension(IJSDIM) :: WCM_, ELARM1, GDZMKB + REAL(kind_phys) GDQSM, GDHSM, GDQM, GDSM, GDCM, FDQSM, GCCM, & DELZ, ELADZ, DCTM , CPGMI, DELC, FICE, ELARM2,GCCMZ, & PRECR, GTPRIZ, DELZL, GCCT, DCT, WCVX, PRCZH, wrk INTEGER K, I, kk, km1, kp1, n @@ -2123,43 +2124,43 @@ SUBROUTINE CUMUP & !! in-cloud properties ! CHARACTER CTNUM*2 ! !DD#ifdef OPT_CUMBGT -!DD REAL(r8) HBGT (IJSDIM) ! heat budget -!DD REAL(r8) WBGT (IJSDIM) ! water budget -!DD REAL(r8) PBGT (IJSDIM) ! precipitation budget -!DD REAL(r8) MBGT (IJSDIM) ! mass budget -!DD REAL(r8) GTPRX (IJSDIM) ! (rain+snow)*eta at top -!DD REAL(r8) GSNWT (IJSDIM) ! cloud top snow*eta -!DD REAL(r8) HBMX, WBMX, PBMX, MBMX +!DD REAL(kind_phys) HBGT (IJSDIM) ! heat budget +!DD REAL(kind_phys) WBGT (IJSDIM) ! water budget +!DD REAL(kind_phys) PBGT (IJSDIM) ! precipitation budget +!DD REAL(kind_phys) MBGT (IJSDIM) ! mass budget +!DD REAL(kind_phys) GTPRX (IJSDIM) ! (rain+snow)*eta at top +!DD REAL(kind_phys) GSNWT (IJSDIM) ! cloud top snow*eta +!DD REAL(kind_phys) HBMX, WBMX, PBMX, MBMX !DD SAVE HBMX, WBMX, PBMX, MBMX !DD#endif ! ! [INTERNAL PARAM] - REAL(r8), parameter :: ZTREF = 1._r8, ztrefi = one/ztref, & + REAL(kind_phys), parameter :: ZTREF = 1._kind_phys, ztrefi = one/ztref, & ELAMIN = zero, ELAMAX = 4.e-3 ! min and max entrainment rate - REAL(r8) :: PB = 1.0_r8 -!m REAL(r8) :: TAUZ = 5.0e3_r8 - REAL(r8) :: TAUZ = 1.0e4_r8 -!m REAL(r8) :: ELMD = 2.4e-3 ! for Neggers and Siebesma (2002) -!m REAL(r8) :: ELAMAX = 5.e-3 ! max. of entrainment rate -! REAL(r8) :: WCCRT = zero -!m REAL(r8) :: WCCRT = 0.01 - REAL(r8) :: WCCRT = 1.0e-6_r8, wvcrt=1.0e-3_r8 - REAL(r8) :: TSICE = 268.15_r8 ! compatible with macrop_driver - REAL(r8) :: TWICE = 238.15_r8 ! compatible with macrop_driver - -! REAL(r8) :: wfn_neg = 0.1 - REAL(r8) :: wfn_neg = 0.15 -! REAL(r8) :: wfn_neg = 0.25 -! REAL(r8) :: wfn_neg = 0.30 -! REAL(r8) :: wfn_neg = 0.35 + REAL(kind_phys) :: PB = 1.0_kind_phys +!m REAL(kind_phys) :: TAUZ = 5.0e3_kind_phys + REAL(kind_phys) :: TAUZ = 1.0e4_kind_phys +!m REAL(kind_phys) :: ELMD = 2.4e-3 ! for Neggers and Siebesma (2002) +!m REAL(kind_phys) :: ELAMAX = 5.e-3 ! max. of entrainment rate +! REAL(kind_phys) :: WCCRT = zero +!m REAL(kind_phys) :: WCCRT = 0.01 + REAL(kind_phys) :: WCCRT = 1.0e-6_kind_phys, wvcrt=1.0e-3_kind_phys + REAL(kind_phys) :: TSICE = 268.15_kind_phys ! compatible with macrop_driver + REAL(kind_phys) :: TWICE = 238.15_kind_phys ! compatible with macrop_driver + +! REAL(kind_phys) :: wfn_neg = 0.1 + REAL(kind_phys) :: wfn_neg = 0.15 +! REAL(kind_phys) :: wfn_neg = 0.25 +! REAL(kind_phys) :: wfn_neg = 0.30 +! REAL(kind_phys) :: wfn_neg = 0.35 - REAL(r8) :: esat, tem -! REAL(r8) :: esat, tem, rhs_h, rhs_q + REAL(kind_phys) :: esat, tem +! REAL(kind_phys) :: esat, tem, rhs_h, rhs_q ! - REAL(r8) Z ! altitude - REAL(r8) ZH ! scale height - REAL(r8) T ! temperature + REAL(kind_phys) Z ! altitude + REAL(kind_phys) ZH ! scale height + REAL(kind_phys) T ! temperature ! ! ! Note: iteration is not made to diagnose cloud ice for simplicity @@ -2178,8 +2179,8 @@ SUBROUTINE CUMUP & !! in-cloud properties enddo do k=1,kmax do i=ists,iens - ACWFK (I,k) = unset_r8 - ACWFN (I,k) = unset_r8 + ACWFK (I,k) = unset_kind_phys + ACWFN (I,k) = unset_kind_phys GCLZ (I,k) = zero GCIZ (I,k) = zero GPRCIZ(I,k) = zero @@ -2192,24 +2193,24 @@ SUBROUTINE CUMUP & !! in-cloud properties GCVMZ (I,k) = zero GTPRMZ(I,k) = zero ! - BUOY (I,k) = unset_r8 - BUOYM (I,k) = unset_r8 - WCV (I,k) = unset_r8 - GCY (I,k) = unset_r8 -! - GCHM (I,k) = unset_r8 - GCWM (I,k) = unset_r8 - GCTM (I,k) = unset_r8 - GCQM (I,k) = unset_r8 - GCLM (I,k) = unset_r8 - GCIM (I,k) = unset_r8 - GCUM (I,k) = unset_r8 - GCVM (I,k) = unset_r8 + BUOY (I,k) = unset_kind_phys + BUOYM (I,k) = unset_kind_phys + WCV (I,k) = unset_kind_phys + GCY (I,k) = unset_kind_phys +! + GCHM (I,k) = unset_kind_phys + GCWM (I,k) = unset_kind_phys + GCTM (I,k) = unset_kind_phys + GCQM (I,k) = unset_kind_phys + GCLM (I,k) = unset_kind_phys + GCIM (I,k) = unset_kind_phys + GCUM (I,k) = unset_kind_phys + GCVM (I,k) = unset_kind_phys enddo enddo do i=ists,iens GCqMZ(I) = zero - WCM(I) = unset_r8 + WCM(I) = unset_kind_phys WCM_(I) = zero enddo ! tracers @@ -2219,7 +2220,7 @@ SUBROUTINE CUMUP & !! in-cloud properties enddo do k=1,kmax do i=ists,iens - GCTRM(I,k,n) = unset_r8 + GCTRM(I,k,n) = unset_kind_phys enddo enddo enddo @@ -2632,16 +2633,16 @@ SUBROUTINE CUMUP & !! in-cloud properties pure function FPREC(Z,ZH) implicit none - real(r8), intent(in) :: Z - real(r8), intent(in) :: ZH - real(r8) :: FPREC + real(kind_phys), intent(in) :: Z + real(kind_phys), intent(in) :: ZH + real(kind_phys) :: FPREC FPREC = MIN(MAX(one-EXP(-(Z-PRECZ0)/ZH), zero), one) end function FPREC pure function FRICE(T) implicit none - real(r8), intent(in) :: T - real(r8) :: FRICE + real(kind_phys), intent(in) :: T + real(kind_phys) :: FRICE FRICE = MIN(MAX((TSICE-T)/(TSICE-TWICE), zero), one) end function FRICE @@ -2663,37 +2664,37 @@ SUBROUTINE CUMBMX & !! cloud base mass flux INTEGER, INTENT(IN) :: IJSDIM, KMAX ! DD, for GFS, pass in ! ! [MODIFY] - REAL(r8) CBMFX (IJSDIM) ! cloud base mass flux + REAL(kind_phys) CBMFX (IJSDIM) ! cloud base mass flux ! ! [INPUT] - REAL(r8) ACWF (IJSDIM) ! cloud work function - REAL(r8) GCYT (IJSDIM) ! norm mass flux @top - REAL(r8) GDZM (IJSDIM, KMAX+1) ! height - REAL(r8) GDW (IJSDIM, KMAX) ! total water - REAL(r8) GDQS (IJSDIM, KMAX) ! saturate humidity - REAL(r8) DELP (IJSDIM, KMAX) ! delt pressure + REAL(kind_phys) ACWF (IJSDIM) ! cloud work function + REAL(kind_phys) GCYT (IJSDIM) ! norm mass flux @top + REAL(kind_phys) GDZM (IJSDIM, KMAX+1) ! height + REAL(kind_phys) GDW (IJSDIM, KMAX) ! total water + REAL(kind_phys) GDQS (IJSDIM, KMAX) ! saturate humidity + REAL(kind_phys) DELP (IJSDIM, KMAX) ! delt pressure INTEGER KT (IJSDIM) ! cloud top INTEGER KTMX ! max. of cloud top INTEGER KB (IJSDIM) ! cloud base - REAL(r8) DELT ! time step + REAL(kind_phys) DELT ! time step INTEGER ISTS, IENS ! ! [INTERNAL WORK] - REAL(r8), dimension(ijsdim) :: QX, QSX, RHM + REAL(kind_phys), dimension(ijsdim) :: QX, QSX, RHM INTEGER I, K - REAL(r8) ALP, FMAX1, wrk + REAL(kind_phys) ALP, FMAX1, wrk ! ! [INTERNAL PARAM] - REAL(r8) :: FMAX = 1.5e-2_r8 ! maximum flux -! REAL(r8) :: RHMCRT = zero ! critical val. of cloud mean RH -! REAL(r8) :: RHMCRT = 0.25_r8 ! critical val. of cloud mean RH - REAL(r8) :: RHMCRT = 0.50_r8 ! critical val. of cloud mean RH - REAL(r8) :: ALP1 = zero - REAL(r8) :: TAUD = 1.e3_r8 -! REAL(r8) :: TAUD = 6.e2_r8 - REAL(r8) :: ZFMAX = 3.5e3_r8 - REAL(r8) :: ZDFMAX = 5.e2_r8 -! REAL(r8) :: FMAXP = 2._r8 + REAL(kind_phys) :: FMAX = 1.5e-2_kind_phys ! maximum flux +! REAL(kind_phys) :: RHMCRT = zero ! critical val. of cloud mean RH +! REAL(kind_phys) :: RHMCRT = 0.25_kind_phys ! critical val. of cloud mean RH + REAL(kind_phys) :: RHMCRT = 0.50_kind_phys ! critical val. of cloud mean RH + REAL(kind_phys) :: ALP1 = zero + REAL(kind_phys) :: TAUD = 1.e3_kind_phys +! REAL(kind_phys) :: TAUD = 6.e2_kind_phys + REAL(kind_phys) :: ZFMAX = 3.5e3_kind_phys + REAL(kind_phys) :: ZDFMAX = 5.e2_kind_phys +! REAL(kind_phys) :: FMAXP = 2._kind_phys ! do i=ists,iens qx(i) = zero @@ -2748,23 +2749,23 @@ SUBROUTINE CUMFLX & !! cloud mass flux INTEGER, INTENT(IN) :: IJSDIM, KMAX, IM !! DD, for GFS, pass in ! ! [OUTPUT] - REAL(r8) GMFLX (IJSDIM, KMAX) !! mass flux - REAL(r8) CMDET (IJSDIM, KMAX) !! detrainment mass flux - REAL(r8) GPRCI (IJSDIM, KMAX) !! rainfall generation - REAL(r8) GSNWI (IJSDIM, KMAX) !! snowfall generation - REAL(r8) QLIQ (IJSDIM, KMAX) !! cloud liquid - REAL(r8) QICE (IJSDIM, KMAX) !! cloud ice - REAL(r8) GTPRC0(IJSDIM) !! precip. before evap. + REAL(kind_phys) GMFLX (IJSDIM, KMAX) !! mass flux + REAL(kind_phys) CMDET (IJSDIM, KMAX) !! detrainment mass flux + REAL(kind_phys) GPRCI (IJSDIM, KMAX) !! rainfall generation + REAL(kind_phys) GSNWI (IJSDIM, KMAX) !! snowfall generation + REAL(kind_phys) QLIQ (IJSDIM, KMAX) !! cloud liquid + REAL(kind_phys) QICE (IJSDIM, KMAX) !! cloud ice + REAL(kind_phys) GTPRC0(IJSDIM) !! precip. before evap. ! ! [INPUT] - REAL(r8) CBMFX (IJSDIM) !! cloud base mass flux - REAL(r8) GCYM (IJSDIM, KMAX) !! normalized mass flux - REAL(r8) GCYT (IJSDIM) !! detraining mass flux - REAL(r8) GPRCIZ(IJSDIM, KMAX) !! precipitation/M - REAL(r8) GSNWIZ(IJSDIM, KMAX) !! snowfall/M - REAL(r8) GTPRT (IJSDIM) !! rain+snow @top - REAL(r8) GCLZ (IJSDIM, KMAX) !! cloud liquid/M - REAL(r8) GCIZ (IJSDIM, KMAX) !! cloud ice/M + REAL(kind_phys) CBMFX (IJSDIM) !! cloud base mass flux + REAL(kind_phys) GCYM (IJSDIM, KMAX) !! normalized mass flux + REAL(kind_phys) GCYT (IJSDIM) !! detraining mass flux + REAL(kind_phys) GPRCIZ(IJSDIM, KMAX) !! precipitation/M + REAL(kind_phys) GSNWIZ(IJSDIM, KMAX) !! snowfall/M + REAL(kind_phys) GTPRT (IJSDIM) !! rain+snow @top + REAL(kind_phys) GCLZ (IJSDIM, KMAX) !! cloud liquid/M + REAL(kind_phys) GCIZ (IJSDIM, KMAX) !! cloud ice/M INTEGER KB (IJSDIM) !! cloud base INTEGER KT (IJSDIM) !! cloud top INTEGER KTMX !! max of cloud top @@ -2810,34 +2811,34 @@ SUBROUTINE CUMDET & !! detrainment INTEGER, INTENT(IN) :: im, IJSDIM, KMAX, NTR, nctp, ntrq !! DD, for GFS, pass in ! ! [MODIFY] - REAL(r8) GTT (IJSDIM, KMAX) !! temperature tendency - REAL(r8) GTQ (IJSDIM, KMAX, NTR) !! moisture tendency -! REAL(r8) GTCFRC(IJSDIM, KMAX) !! cloud fraction tendency - REAL(r8) GTU (IJSDIM, KMAX) !! u tendency - REAL(r8) GTV (IJSDIM, KMAX) !! v tendency + REAL(kind_phys) GTT (IJSDIM, KMAX) !! temperature tendency + REAL(kind_phys) GTQ (IJSDIM, KMAX, NTR) !! moisture tendency +! REAL(kind_phys) GTCFRC(IJSDIM, KMAX) !! cloud fraction tendency + REAL(kind_phys) GTU (IJSDIM, KMAX) !! u tendency + REAL(kind_phys) GTV (IJSDIM, KMAX) !! v tendency ! ! [INPUT] - REAL(r8) GDH (IJSDIM, KMAX) !! moist static energy - REAL(r8) GDQ (IJSDIM, KMAX, NTR) !! humidity qv -! REAL(r8) GDCFRC(IJSDIM, KMAX) !! cloud fraction - REAL(r8) GDU (IJSDIM, KMAX) - REAL(r8) GDV (IJSDIM, KMAX) - REAL(r8) DELPI (IJSDIM, KMAX) - REAL(r8) CBMFX (IM, NCTP) !! cloud base mass flux - REAL(r8) GCYT (IJSDIM, NCTP) !! detraining mass flux - REAL(r8) GCHT (IJSDIM, NCTP) !! detraining MSE - REAL(r8) GCQT (IJSDIM, NCTP) !! detraining qv - REAL(r8) GCLT (IJSDIM, NCTP) !! detraining ql - REAL(r8) GCIT (IJSDIM, NCTP) !! detraining qi - REAL(r8) GCtrT (IJSDIM, ntrq:ntr, NCTP)!! detraining tracer - REAL(r8) GCUT (IJSDIM, NCTP) !! detraining u - REAL(r8) GCVT (IJSDIM, NCTP) !! detraining v - REAL(r8) GDQI (IJSDIM, KMAX) !! cloud ice + REAL(kind_phys) GDH (IJSDIM, KMAX) !! moist static energy + REAL(kind_phys) GDQ (IJSDIM, KMAX, NTR) !! humidity qv +! REAL(kind_phys) GDCFRC(IJSDIM, KMAX) !! cloud fraction + REAL(kind_phys) GDU (IJSDIM, KMAX) + REAL(kind_phys) GDV (IJSDIM, KMAX) + REAL(kind_phys) DELPI (IJSDIM, KMAX) + REAL(kind_phys) CBMFX (IM, NCTP) !! cloud base mass flux + REAL(kind_phys) GCYT (IJSDIM, NCTP) !! detraining mass flux + REAL(kind_phys) GCHT (IJSDIM, NCTP) !! detraining MSE + REAL(kind_phys) GCQT (IJSDIM, NCTP) !! detraining qv + REAL(kind_phys) GCLT (IJSDIM, NCTP) !! detraining ql + REAL(kind_phys) GCIT (IJSDIM, NCTP) !! detraining qi + REAL(kind_phys) GCtrT (IJSDIM, ntrq:ntr, NCTP)!! detraining tracer + REAL(kind_phys) GCUT (IJSDIM, NCTP) !! detraining u + REAL(kind_phys) GCVT (IJSDIM, NCTP) !! detraining v + REAL(kind_phys) GDQI (IJSDIM, KMAX) !! cloud ice INTEGER KT (IJSDIM, NCTP) !! cloud top INTEGER ISTS, IENS ! ! [INTERNAL WORK] - REAL(r8) GTHCI, GTQVCI, GTXCI + REAL(kind_phys) GTHCI, GTQVCI, GTXCI integer I, K, CTP, kk,n ! @@ -2885,33 +2886,33 @@ SUBROUTINE CUMSBH & !! adiabat. descent INTEGER, INTENT(IN) :: IJSDIM, IM, KMAX, NTR, ntrq !! DD, for GFS, pass in ! ! [MODIFY] - REAL(r8) GTT (IJSDIM, KMAX) !! Temperature tendency - REAL(r8) GTQ (IJSDIM, KMAX, NTR) !! Moisture etc tendency - REAL(r8) GTU (IJSDIM, KMAX) !! u tendency - REAL(r8) GTV (IJSDIM, KMAX) !! v tendency + REAL(kind_phys) GTT (IJSDIM, KMAX) !! Temperature tendency + REAL(kind_phys) GTQ (IJSDIM, KMAX, NTR) !! Moisture etc tendency + REAL(kind_phys) GTU (IJSDIM, KMAX) !! u tendency + REAL(kind_phys) GTV (IJSDIM, KMAX) !! v tendency ! ! [INPUT] - REAL(r8) GDH (IJSDIM, KMAX) - REAL(r8) GDQ (IJSDIM, KMAX, NTR) !! humidity etc - REAL(r8) GDQI (IJSDIM, KMAX) - REAL(r8) GDU (IJSDIM, KMAX) - REAL(r8) GDV (IJSDIM, KMAX) - REAL(r8) DELPI (IJSDIM, KMAX) - REAL(r8) GMFLX (IJSDIM, KMAX) !! mass flux (updraft+downdraft) - REAL(r8) GMFX0 (IJSDIM, KMAX) !! mass flux (updraft only) + REAL(kind_phys) GDH (IJSDIM, KMAX) + REAL(kind_phys) GDQ (IJSDIM, KMAX, NTR) !! humidity etc + REAL(kind_phys) GDQI (IJSDIM, KMAX) + REAL(kind_phys) GDU (IJSDIM, KMAX) + REAL(kind_phys) GDV (IJSDIM, KMAX) + REAL(kind_phys) DELPI (IJSDIM, KMAX) + REAL(kind_phys) GMFLX (IJSDIM, KMAX) !! mass flux (updraft+downdraft) + REAL(kind_phys) GMFX0 (IJSDIM, KMAX) !! mass flux (updraft only) INTEGER KB(IJSDIM) !! cloud base index - negative means no convection INTEGER KTMX - REAL(r8) CPRES !! pressure factor for cumulus friction + REAL(kind_phys) CPRES !! pressure factor for cumulus friction INTEGER ISTS, IENS ! ! [INTERNAL WORK] - REAL(r8) SBH0, SBQ0, SBL0, SBI0, SBC0, SBS0, & + REAL(kind_phys) SBH0, SBQ0, SBL0, SBI0, SBC0, SBS0, & SBH1, SBQ1, SBL1, SBI1, SBC1, SBS1, FX1, & SBU0, SBV0, SBU1, SBV1, GTHCI, GTQVCI, & GTQLCI, GTQICI, GTM2CI, GTM3CI, wrk, wrk1 - REAL(r8) FX(ISTS:IENS) + REAL(kind_phys) FX(ISTS:IENS) - REAL(r8), dimension(IJSDIM, KMAX) :: GTLSBH, GTISBH + REAL(kind_phys), dimension(IJSDIM, KMAX) :: GTLSBH, GTISBH integer :: I, K, KM, KP, n ! ! @@ -3007,22 +3008,22 @@ SUBROUTINE CUMSBW & !! adiabat. descent INTEGER, INTENT(IN) :: IJSDIM, IM, KMAX!! DD, for GFS, pass in ! ! [MODIFY] - REAL(r8) GTU (IJSDIM, KMAX) !! u tendency - REAL(r8) GTV (IJSDIM, KMAX) !! v tendency + REAL(kind_phys) GTU (IJSDIM, KMAX) !! u tendency + REAL(kind_phys) GTV (IJSDIM, KMAX) !! v tendency ! ! [INPUT] - REAL(r8) GDU (IJSDIM, KMAX) - REAL(r8) GDV (IJSDIM, KMAX) - REAL(r8) DELPI (IJSDIM, KMAX) - REAL(r8) GMFLX (IJSDIM, KMAX) !! mass flux (updraft+downdraft) - REAL(r8) GMFX0 (IJSDIM, KMAX) !! mass flux (updraft only) + REAL(kind_phys) GDU (IJSDIM, KMAX) + REAL(kind_phys) GDV (IJSDIM, KMAX) + REAL(kind_phys) DELPI (IJSDIM, KMAX) + REAL(kind_phys) GMFLX (IJSDIM, KMAX) !! mass flux (updraft+downdraft) + REAL(kind_phys) GMFX0 (IJSDIM, KMAX) !! mass flux (updraft only) INTEGER KB(IJSDIM) !! cloud base index - negative means no convection INTEGER KTMX, ISTS, IENS - REAL(r8) CPRES !! pressure factor for cumulus friction + REAL(kind_phys) CPRES !! pressure factor for cumulus friction ! ! [INTERNAL WORK] - REAL(r8) FX1, SBU0, SBV0, SBU1, SBV1, wrk, wrk1 - REAL(r8) FX(ISTS:IENS) + REAL(kind_phys) FX1, SBU0, SBV0, SBU1, SBV1, wrk, wrk1 + REAL(kind_phys) FX(ISTS:IENS) integer :: I, K, KM, KP ! @@ -3090,114 +3091,114 @@ SUBROUTINE CUMDWN & ! Freeze & Melt & Evaporation logical, intent(in) :: do_aw, do_awdd, flx_form ! ! [MODIFY] - REAL(r8) GTT (IJSDIM, KMAX) ! Temperature tendency - REAL(r8) GTQ (IJSDIM, KMAX, NTR) ! Moisture etc tendency - REAL(r8) GTU (IJSDIM, KMAX) ! u tendency - REAL(r8) GTV (IJSDIM, KMAX) ! v tendency - REAL(r8) GMFLX (IJSDIM, KMAX) ! mass flux + REAL(kind_phys) GTT (IJSDIM, KMAX) ! Temperature tendency + REAL(kind_phys) GTQ (IJSDIM, KMAX, NTR) ! Moisture etc tendency + REAL(kind_phys) GTU (IJSDIM, KMAX) ! u tendency + REAL(kind_phys) GTV (IJSDIM, KMAX) ! v tendency + REAL(kind_phys) GMFLX (IJSDIM, KMAX) ! mass flux ! ! [OUTPUT] - REAL(r8) GPRCP (IJSDIM, KMAX) ! rainfall flux - REAL(r8) GSNWP (IJSDIM, KMAX) ! snowfall flux - REAL(r8) GTEVP (IJSDIM, KMAX) ! evaporation+sublimation - REAL(r8) GMDD (IJSDIM, KMAX) ! downdraft mass flux + REAL(kind_phys) GPRCP (IJSDIM, KMAX) ! rainfall flux + REAL(kind_phys) GSNWP (IJSDIM, KMAX) ! snowfall flux + REAL(kind_phys) GTEVP (IJSDIM, KMAX) ! evaporation+sublimation + REAL(kind_phys) GMDD (IJSDIM, KMAX) ! downdraft mass flux !AW microphysical tendencies - REAL(r8) gtmelt (IJSDIM, KMAX) ! t tendency ice-liq - REAL(r8) gtevap (IJSDIM, KMAX) ! t tendency liq-vapor - REAL(r8) gtsubl (IJSDIM, KMAX) ! t tendency ice-vapor + REAL(kind_phys) gtmelt (IJSDIM, KMAX) ! t tendency ice-liq + REAL(kind_phys) gtevap (IJSDIM, KMAX) ! t tendency liq-vapor + REAL(kind_phys) gtsubl (IJSDIM, KMAX) ! t tendency ice-vapor !AW eddy flux tendencies - REAL(r8) dtdwn (IJSDIM, KMAX) ! t tendency downdraft detrainment - REAL(r8) dqvdwn (IJSDIM, KMAX) ! qv tendency downdraft detrainment - REAL(r8) dqldwn (IJSDIM, KMAX) ! ql tendency downdraft detrainment - REAL(r8) dqidwn (IJSDIM, KMAX) ! qi tendency downdraft detrainment - REAL(r8) dtrdwn (IJSDIM, KMAX, ntrq:ntr) ! tracer tendency downdraft detrainment + REAL(kind_phys) dtdwn (IJSDIM, KMAX) ! t tendency downdraft detrainment + REAL(kind_phys) dqvdwn (IJSDIM, KMAX) ! qv tendency downdraft detrainment + REAL(kind_phys) dqldwn (IJSDIM, KMAX) ! ql tendency downdraft detrainment + REAL(kind_phys) dqidwn (IJSDIM, KMAX) ! qi tendency downdraft detrainment + REAL(kind_phys) dtrdwn (IJSDIM, KMAX, ntrq:ntr) ! tracer tendency downdraft detrainment ! AW downdraft area fraction (assumed zero for now) - REAL(r8) sigmad (IJSDIM,KMAX) !DDsigma cloud downdraft area fraction + REAL(kind_phys) sigmad (IJSDIM,KMAX) !DDsigma cloud downdraft area fraction ! [INPUT] - REAL(r8) GPRCI (IJSDIM, KMAX) ! rainfall generation - REAL(r8) GSNWI (IJSDIM, KMAX) ! snowfall generation - REAL(r8) GDH (IJSDIM, KMAX) ! moist static energy - REAL(r8) GDW (IJSDIM, KMAX) ! total water - REAL(r8) GDQ (IJSDIM, KMAX, NTR) ! humidity etc - REAL(r8) GDQI (IJSDIM, KMAX) ! cloud ice - REAL(r8) GDQS (IJSDIM, KMAX) ! saturate humidity - REAL(r8) GDS (IJSDIM, KMAX) ! dry static energy - REAL(r8) GDHS (IJSDIM, KMAX) ! saturate moist static energy - REAL(r8) GDT (IJSDIM, KMAX) ! air temperature T - REAL(r8) GDU (IJSDIM, KMAX) ! u-velocity - REAL(r8) GDV (IJSDIM, KMAX) ! v-velocity - REAL(r8) GDZ (IJSDIM, KMAX) ! altitude - REAL(r8) GDZM (IJSDIM, KMAX+1) ! altitude (half lev) - REAL(r8) FDQS (IJSDIM, KMAX) - REAL(r8) DELP (IJSDIM, KMAX) - REAL(r8) DELPI (IJSDIM, KMAX) + REAL(kind_phys) GPRCI (IJSDIM, KMAX) ! rainfall generation + REAL(kind_phys) GSNWI (IJSDIM, KMAX) ! snowfall generation + REAL(kind_phys) GDH (IJSDIM, KMAX) ! moist static energy + REAL(kind_phys) GDW (IJSDIM, KMAX) ! total water + REAL(kind_phys) GDQ (IJSDIM, KMAX, NTR) ! humidity etc + REAL(kind_phys) GDQI (IJSDIM, KMAX) ! cloud ice + REAL(kind_phys) GDQS (IJSDIM, KMAX) ! saturate humidity + REAL(kind_phys) GDS (IJSDIM, KMAX) ! dry static energy + REAL(kind_phys) GDHS (IJSDIM, KMAX) ! saturate moist static energy + REAL(kind_phys) GDT (IJSDIM, KMAX) ! air temperature T + REAL(kind_phys) GDU (IJSDIM, KMAX) ! u-velocity + REAL(kind_phys) GDV (IJSDIM, KMAX) ! v-velocity + REAL(kind_phys) GDZ (IJSDIM, KMAX) ! altitude + REAL(kind_phys) GDZM (IJSDIM, KMAX+1) ! altitude (half lev) + REAL(kind_phys) FDQS (IJSDIM, KMAX) + REAL(kind_phys) DELP (IJSDIM, KMAX) + REAL(kind_phys) DELPI (IJSDIM, KMAX) INTEGER KB (IJSDIM) INTEGER KTMX, ISTS, IENS ! ! [INTERNAL WORK] ! Note: Some variables have 3-dimensions for the purpose of budget check. - REAL(r8) EVAPD (IJSDIM, KMAX) ! evap. in downdraft - REAL(r8) SUBLD (IJSDIM, KMAX) ! subl. in downdraft - REAL(r8) EVAPE (IJSDIM, KMAX) ! evap. in environment - REAL(r8) SUBLE (IJSDIM, KMAX) ! subl. in environment - REAL(r8) EVAPX (IJSDIM, KMAX) ! evap. env. to DD - REAL(r8) SUBLX (IJSDIM, KMAX) ! subl. env. to DD - REAL(r8) GMDDE (IJSDIM, KMAX) ! downdraft entrainment - REAL(r8) SNMLT (IJSDIM, KMAX) ! melt - freeze - REAL(r8) GCHDD (IJSDIM, KMAX) ! MSE detrainment - REAL(r8) GCWDD (IJSDIM, KMAX) ! water detrainment - REAL(r8) GTTEV (IJSDIM, KMAX) ! T tendency by evaporation - REAL(r8) GTQEV (IJSDIM, KMAX) ! q tendency by evaporation - REAL(r8) GCHD (ISTS:IENS) ! downdraft MSE - REAL(r8) GCWD (ISTS:IENS) ! downdraft q + REAL(kind_phys) EVAPD (IJSDIM, KMAX) ! evap. in downdraft + REAL(kind_phys) SUBLD (IJSDIM, KMAX) ! subl. in downdraft + REAL(kind_phys) EVAPE (IJSDIM, KMAX) ! evap. in environment + REAL(kind_phys) SUBLE (IJSDIM, KMAX) ! subl. in environment + REAL(kind_phys) EVAPX (IJSDIM, KMAX) ! evap. env. to DD + REAL(kind_phys) SUBLX (IJSDIM, KMAX) ! subl. env. to DD + REAL(kind_phys) GMDDE (IJSDIM, KMAX) ! downdraft entrainment + REAL(kind_phys) SNMLT (IJSDIM, KMAX) ! melt - freeze + REAL(kind_phys) GCHDD (IJSDIM, KMAX) ! MSE detrainment + REAL(kind_phys) GCWDD (IJSDIM, KMAX) ! water detrainment + REAL(kind_phys) GTTEV (IJSDIM, KMAX) ! T tendency by evaporation + REAL(kind_phys) GTQEV (IJSDIM, KMAX) ! q tendency by evaporation + REAL(kind_phys) GCHD (ISTS:IENS) ! downdraft MSE + REAL(kind_phys) GCWD (ISTS:IENS) ! downdraft q ! profiles of downdraft variables for AW flux tendencies - REAL(r8) GCdseD(ISTS:IENS, KMAX) ! downdraft dse - REAL(r8) GCqvD (ISTS:IENS, KMAX) ! downdraft qv -! REAL(r8) GCqlD (ISTS:IENS, KMAX) ! downdraft ql -! REAL(r8) GCqiD (ISTS:IENS, KMAX) ! downdraft qi - REAL(r8) GCtrD (ISTS:IENS, ntrq:ntr) ! downdraft tracer - - REAL(r8) GCUD (ISTS:IENS) ! downdraft u - REAL(r8) GCVD (ISTS:IENS) ! downdraft v - REAL(r8) FSNOW (ISTS:IENS) - REAL(r8) GMDDD (ISTS:IENS) - - REAL(r8) GDTW, GCHX, GCTX, GCQSX, GTPRP, EVSU, GTEVE, LVIC, & + REAL(kind_phys) GCdseD(ISTS:IENS, KMAX) ! downdraft dse + REAL(kind_phys) GCqvD (ISTS:IENS, KMAX) ! downdraft qv +! REAL(kind_phys) GCqlD (ISTS:IENS, KMAX) ! downdraft ql +! REAL(kind_phys) GCqiD (ISTS:IENS, KMAX) ! downdraft qi + REAL(kind_phys) GCtrD (ISTS:IENS, ntrq:ntr) ! downdraft tracer + + REAL(kind_phys) GCUD (ISTS:IENS) ! downdraft u + REAL(kind_phys) GCVD (ISTS:IENS) ! downdraft v + REAL(kind_phys) FSNOW (ISTS:IENS) + REAL(kind_phys) GMDDD (ISTS:IENS) + + REAL(kind_phys) GDTW, GCHX, GCTX, GCQSX, GTPRP, EVSU, GTEVE, LVIC, & DQW, DTW, GDQW, DZ, GCSD, FDET, GDHI, GMDDX, & GMDDMX, GCHDX, GCWDX, GCUDD, GCVDD, GTHCI, GTQVCI, & wrk, wrk1, wrk2, wrk3, wrk4, tx1, & WMX, HMX, DDWMX, DDHMX, dp_above, dp_below, fsigma, & fmelt, fevp, wrkn, gctrdd(ntrq:ntr) -!M REAL(r8) GTHCI, GTQVCI, GTQLCI, GTQICI, GTUCI, GTVCI +!M REAL(kind_phys) GTHCI, GTQVCI, GTQLCI, GTQICI, GTUCI, GTVCI !DD#ifdef OPT_CUMBGT ! Water, energy, downdraft water and downdraft energy budgets -! REAL(r8), dimension(ISTS:IENS) :: WBGT, HBGT, DDWBGT, DDHBGT +! REAL(kind_phys), dimension(ISTS:IENS) :: WBGT, HBGT, DDWBGT, DDHBGT integer ij, i, k, kp1, n !DD#endif ! ! [INTERNAL PARM] - REAL(r8), parameter :: TWSNOW = 273.15_r8 ! wet-bulb temp. rain/snow - REAL(r8), parameter :: FTMLT = 4._r8 ! temp. factor for melt - REAL(r8), parameter :: GMFLXC = 5.e-2_r8 ! critical mass flux - REAL(r8), parameter :: VTERMS = 2._r8 ! terminal velocity of snowflake -! REAL(r8), parameter :: MELTAU = 10._r8 ! melting timescale - REAL(r8), parameter :: MELTAU = 20._r8 ! melting timescale ! Moorthi june 30, 2017 -! -! REAL(r8), parameter :: EVAPR = 0.4_r8 ! evaporation factor ! Moorthi June 28, 2017 - REAL(r8), parameter :: EVAPR = 0.3_r8 ! evaporation factor -! REAL(r8), parameter :: EVAPR = 0._r8 ! evaporation factor - REAL(r8), parameter :: REVPDD = 1._r8 ! max rate of DD to evapolation - REAL(r8), parameter :: RDDR = 5.e-4_r8 ! DD rate (T0 R0 W0)^-1 -! REAL(r8), parameter :: RDDR = 0._r8 ! DD rate (T0 R0 W0)^-1 - REAL(r8), parameter :: RDDMX = 0.5_r8 ! norm. flux of downdraft - REAL(r8), parameter :: VTERM = 5._r8 ! term. vel. of precip. -! REAL(r8), parameter :: VTERM = 4._r8 ! term. vel. of precip. ! Moorthi June 28, 2017 - REAL(r8), parameter :: EVATAU = 2._r8 ! evaporation/sublimation timescale - REAL(r8), parameter :: ZDMIN = 5.e2_r8 ! min altitude of downdraft detrainment - real(r8), parameter :: evapovtrm=EVAPR/VTERM + REAL(kind_phys), parameter :: TWSNOW = 273.15_kind_phys ! wet-bulb temp. rain/snow + REAL(kind_phys), parameter :: FTMLT = 4._kind_phys ! temp. factor for melt + REAL(kind_phys), parameter :: GMFLXC = 5.e-2_kind_phys ! critical mass flux + REAL(kind_phys), parameter :: VTERMS = 2._kind_phys ! terminal velocity of snowflake +! REAL(kind_phys), parameter :: MELTAU = 10._kind_phys ! melting timescale + REAL(kind_phys), parameter :: MELTAU = 20._kind_phys ! melting timescale ! Moorthi june 30, 2017 +! +! REAL(kind_phys), parameter :: EVAPR = 0.4_kind_phys ! evaporation factor ! Moorthi June 28, 2017 + REAL(kind_phys), parameter :: EVAPR = 0.3_kind_phys ! evaporation factor +! REAL(kind_phys), parameter :: EVAPR = 0._kind_phys ! evaporation factor + REAL(kind_phys), parameter :: REVPDD = 1._kind_phys ! max rate of DD to evapolation + REAL(kind_phys), parameter :: RDDR = 5.e-4_kind_phys ! DD rate (T0 R0 W0)^-1 +! REAL(kind_phys), parameter :: RDDR = 0._kind_phys ! DD rate (T0 R0 W0)^-1 + REAL(kind_phys), parameter :: RDDMX = 0.5_kind_phys ! norm. flux of downdraft + REAL(kind_phys), parameter :: VTERM = 5._kind_phys ! term. vel. of precip. +! REAL(kind_phys), parameter :: VTERM = 4._kind_phys ! term. vel. of precip. ! Moorthi June 28, 2017 + REAL(kind_phys), parameter :: EVATAU = 2._kind_phys ! evaporation/sublimation timescale + REAL(kind_phys), parameter :: ZDMIN = 5.e2_kind_phys ! min altitude of downdraft detrainment + real(kind_phys), parameter :: evapovtrm=EVAPR/VTERM !NOTE ! downdraft area ffraction still needs to be computed for AW, assumed zero for now, @@ -3543,29 +3544,29 @@ SUBROUTINE CUMCLD & !! cloudiness INTEGER, INTENT(IN) :: IJSDIM, KMAX ! DD, for GFS, pass in ! ! [OUTPUT] - REAL(r8) CUMFRC(IJSDIM) ! cumulus cloud fraction + REAL(kind_phys) CUMFRC(IJSDIM) ! cumulus cloud fraction ! ! [MODIFY] - REAL(r8) CUMCLW(IJSDIM, KMAX) ! cloud water in cumulus - REAL(r8) QLIQ (IJSDIM, KMAX) ! cloud liquid - REAL(r8) QICE (IJSDIM, KMAX) ! cloud ice - REAL(r8) FLIQC (IJSDIM, KMAX) ! liquid ratio in cumulus + REAL(kind_phys) CUMCLW(IJSDIM, KMAX) ! cloud water in cumulus + REAL(kind_phys) QLIQ (IJSDIM, KMAX) ! cloud liquid + REAL(kind_phys) QICE (IJSDIM, KMAX) ! cloud ice + REAL(kind_phys) FLIQC (IJSDIM, KMAX) ! liquid ratio in cumulus ! ! [INPUT] - REAL(r8) GMFLX (IJSDIM, KMAX) ! cumulus mass flux + REAL(kind_phys) GMFLX (IJSDIM, KMAX) ! cumulus mass flux INTEGER KTMX INTEGER ISTS, IENS ! ! [WORK] INTEGER I, K - REAL(r8) CUMF, QC, wrk + REAL(kind_phys) CUMF, QC, wrk ! ! [INTERNAL PARAM] - REAL(r8), parameter :: CMFMIN = 2.e-3_r8, &! Mc->cloudiness - CMFMAX = 3.e-1_r8, &! Mc->cloudiness - CLMIN = 1.e-3_r8, &! cloudiness Min. - CLMAX = 0.1_r8, &! cloudiness Max. - FACLW = 0.1_r8, &! Mc->CLW + REAL(kind_phys), parameter :: CMFMIN = 2.e-3_kind_phys, &! Mc->cloudiness + CMFMAX = 3.e-1_kind_phys, &! Mc->cloudiness + CLMIN = 1.e-3_kind_phys, &! cloudiness Min. + CLMAX = 0.1_kind_phys, &! cloudiness Max. + FACLW = 0.1_kind_phys, &! Mc->CLW FACLF = (CLMAX-CLMIN)/LOG(CMFMAX/CMFMIN) ! CUMFRC(ISTS:IENS) = zero @@ -3615,37 +3616,37 @@ SUBROUTINE CUMUPR & !! Tracer Updraft INTEGER, INTENT(IN) :: im, IJSDIM, KMAX, NTR, nctp !! DD, for GFS, pass in ! ! [MODIFY] - REAL(r8) GTR (IJSDIM, KMAX, NTR) - REAL(r8) GPRCC (IJSDIM, NTR) + REAL(kind_phys) GTR (IJSDIM, KMAX, NTR) + REAL(kind_phys) GPRCC (IJSDIM, NTR) ! ! [INPUT] - REAL(r8) GDR (IJSDIM, KMAX, NTR) - REAL(r8) CBMFX (IM, NCTP) - REAL(r8) GCYM (IJSDIM, KMAX, nctp) - REAL(r8) GCYT (IJSDIM, NCTP) - REAL(r8) GCQT (IJSDIM, NCTP) - REAL(r8) GCLT (IJSDIM, NCTP) - REAL(r8) GCIT (IJSDIM, NCTP) - REAL(r8) GTPRT (IJSDIM, NCTP) - REAL(r8) GTEVP (IJSDIM, KMAX) - REAL(r8) GTPRC0(IJSDIM) !! precip. before evap. - real(r8) fscav(ntr), fswtr(ntr) + REAL(kind_phys) GDR (IJSDIM, KMAX, NTR) + REAL(kind_phys) CBMFX (IM, NCTP) + REAL(kind_phys) GCYM (IJSDIM, KMAX, nctp) + REAL(kind_phys) GCYT (IJSDIM, NCTP) + REAL(kind_phys) GCQT (IJSDIM, NCTP) + REAL(kind_phys) GCLT (IJSDIM, NCTP) + REAL(kind_phys) GCIT (IJSDIM, NCTP) + REAL(kind_phys) GTPRT (IJSDIM, NCTP) + REAL(kind_phys) GTEVP (IJSDIM, KMAX) + REAL(kind_phys) GTPRC0(IJSDIM) !! precip. before evap. + real(kind_phys) fscav(ntr), fswtr(ntr) INTEGER KB (IJSDIM ) INTEGER KBMX INTEGER KT (IJSDIM, NCTP) INTEGER KTMX (NCTP) INTEGER KTMXT - REAL(r8) DELPI (IJSDIM, KMAX) + REAL(kind_phys) DELPI (IJSDIM, KMAX) LOGICAL OTSPT (NTR) !! transport with this routine? INTEGER ISTS, IENS ! ! [INTERNAL WORK] INTEGER I, K, LT, TP, CTP - REAL(r8) :: GCRTD, SCAV, GCWT, GPRCR, evpf, cbmfxl - REAL(r8), dimension(ists:iens) :: GCRB, GCRT, DR, gtprc0i -! REAL(r8), dimension(ists:iens,kmax) :: DGCB, DZ, RDZM, EVPF -! REAL(r8), dimension(ists:iens,nctp) :: DZT, RGCWT, MASK1, MASK2 - REAL(r8), dimension(ists:iens,nctp) :: RGCWT, MASK1 + REAL(kind_phys) :: GCRTD, SCAV, GCWT, GPRCR, evpf, cbmfxl + REAL(kind_phys), dimension(ists:iens) :: GCRB, GCRT, DR, gtprc0i +! REAL(kind_phys), dimension(ists:iens,kmax) :: DGCB, DZ, RDZM, EVPF +! REAL(kind_phys), dimension(ists:iens,nctp) :: DZT, RGCWT, MASK1, MASK2 + REAL(kind_phys), dimension(ists:iens,nctp) :: RGCWT, MASK1 ! do i=ists,iens if (gtprc0(i) > zero) then @@ -3752,18 +3753,18 @@ SUBROUTINE CUMDNR & !! Tracer Downdraft INTEGER, INTENT(IN) :: IM, IJSDIM, KMAX, NTR !! DD, for GFS, pass in ! ! [MODIFY] - REAL(r8) GTR (IJSDIM, KMAX, NTR) ! Temperature tendency + REAL(kind_phys) GTR (IJSDIM, KMAX, NTR) ! Temperature tendency ! ! [INPUT] - REAL(r8) GDR (IJSDIM, KMAX, NTR) - REAL(r8) GMDD (IJSDIM, KMAX) ! downdraft mass flux - REAL(r8) DELPI (IJSDIM, KMAX ) + REAL(kind_phys) GDR (IJSDIM, KMAX, NTR) + REAL(kind_phys) GMDD (IJSDIM, KMAX) ! downdraft mass flux + REAL(kind_phys) DELPI (IJSDIM, KMAX ) LOGICAL OTSPT (NTR) INTEGER KTMX, ISTS, IENS ! ! [INTERNAL WORK] - REAL(r8) GCRD (ISTS:IENS) ! downdraft q - REAL(r8) GMDDE, GMDDD, GCRDD + REAL(kind_phys) GCRD (ISTS:IENS) ! downdraft q + REAL(kind_phys) GMDDE, GMDDD, GCRDD INTEGER I, K, LT, kp1 ! ! @@ -3803,20 +3804,20 @@ SUBROUTINE CUMSBR & !! Tracer Subsidence INTEGER, INTENT(IN) :: IM, IJSDIM, KMAX, NTR !! DD, for GFS, pass in ! ! [MODIFY] - REAL(r8) GTR (IJSDIM, KMAX, NTR) !! tracer tendency + REAL(kind_phys) GTR (IJSDIM, KMAX, NTR) !! tracer tendency ! ! [INPUT] - REAL(r8) GDR (IJSDIM, KMAX, NTR) !! tracer - REAL(r8) DELPI (IJSDIM, KMAX) - REAL(r8) GMFLX (IJSDIM, KMAX) !! mass flux + REAL(kind_phys) GDR (IJSDIM, KMAX, NTR) !! tracer + REAL(kind_phys) DELPI (IJSDIM, KMAX) + REAL(kind_phys) GMFLX (IJSDIM, KMAX) !! mass flux INTEGER KTMX LOGICAL OTSPT (NTR) !! tracer transport on/off INTEGER ISTS, IENS ! ! [INTERNAL WORK] INTEGER I, K, KM, KP, LT - REAL(r8) SBR0, SBR1, FX1 - REAL(r8) FX(ISTS:IENS) + REAL(kind_phys) SBR0, SBR1, FX1 + REAL(kind_phys) FX(ISTS:IENS) ! DO LT=1,NTR IF (OTSPT(LT)) THEN @@ -3857,12 +3858,12 @@ SUBROUTINE CUMFXR & ! Tracer mass fixe INTEGER, INTENT(IN) :: IM, IJSDIM, KMAX, NTR !! DD, for GFS, pass in ! ! [MODIFY] - REAL(r8) GTR (IJSDIM, KMAX, NTR) ! tracer tendency + REAL(kind_phys) GTR (IJSDIM, KMAX, NTR) ! tracer tendency ! ! [INPUT] - REAL(r8) GDR (IJSDIM, KMAX, NTR) ! tracer - REAL(r8) DELP (IJSDIM, KMAX) - REAL(r8) DELTA ! time step + REAL(kind_phys) GDR (IJSDIM, KMAX, NTR) ! tracer + REAL(kind_phys) DELP (IJSDIM, KMAX) + REAL(kind_phys) DELTA ! time step INTEGER KTMX INTEGER IMFXR (NTR) ! 0: mass fixer is not applied @@ -3877,10 +3878,10 @@ SUBROUTINE CUMFXR & ! Tracer mass fixe INTEGER ISTS, IENS ! ! [INTERNAL WORK] - REAL(r8) GDR1 - REAL(r8) GDR2 (ISTS:IENS, KMAX) - REAL(r8), dimension(ISTS:IENS) :: TOT0, TOT1, TRAT - REAL(r8) FWAT + REAL(kind_phys) GDR1 + REAL(kind_phys) GDR2 (ISTS:IENS, KMAX) + REAL(kind_phys), dimension(ISTS:IENS) :: TOT0, TOT1, TRAT + REAL(kind_phys) FWAT INTEGER I, K, LT ! ! Attention: tracers are forced to be positive unless IMFXR=0. @@ -3949,12 +3950,12 @@ SUBROUTINE CUMFXR1 & ! Tracer mass fixer INTEGER, INTENT(IN) :: IM, IJSDIM, KMAX ! DD, for GFS, pass in ! ! [MODIFY] - REAL(r8) GTR (IJSDIM, KMAX) ! tracer tendency + REAL(kind_phys) GTR (IJSDIM, KMAX) ! tracer tendency ! ! [INPUT] - REAL(r8) GDR (IJSDIM, KMAX) ! tracer - REAL(r8) DELP (IJSDIM, KMAX) - REAL(r8) DELTA ! time step + REAL(kind_phys) GDR (IJSDIM, KMAX) ! tracer + REAL(kind_phys) DELP (IJSDIM, KMAX) + REAL(kind_phys) DELTA ! time step INTEGER KTMX INTEGER IMFXR ! 0: mass fixer is not applied @@ -3967,10 +3968,10 @@ SUBROUTINE CUMFXR1 & ! Tracer mass fixer INTEGER ISTS, IENS ! ! [INTERNAL WORK] - REAL(r8) GDR1 - REAL(r8) GDR2 (ISTS:IENS, KMAX) - REAL(r8), dimension(ISTS:IENS) :: TOT0, TOT1, TRAT - REAL(r8) FWAT + REAL(kind_phys) GDR1 + REAL(kind_phys) GDR2 (ISTS:IENS, KMAX) + REAL(kind_phys), dimension(ISTS:IENS) :: TOT0, TOT1, TRAT + REAL(kind_phys) FWAT INTEGER I, K ! ! Attention: tracers are forced to be positive unless IMFXR=0. @@ -4035,17 +4036,17 @@ SUBROUTINE CUMCHK & ! check range of output va INTEGER, INTENT(IN) :: IJSDIM, KMAX, NTR ! DD, for GFS, pass in ! ! [INPUT] - REAL(r8) GTT (IJSDIM, KMAX) ! heating rate - REAL(r8) GTQ (IJSDIM, KMAX, NTR) ! change in q - REAL(r8) GTU (IJSDIM, KMAX) ! tendency of u - REAL(r8) GTV (IJSDIM, KMAX) ! tendency of v - REAL(r8) GPRCC (IJSDIM, NTR ) ! rainfall - REAL(r8) GSNWC (IJSDIM) ! snowfall - REAL(r8) CUMCLW(IJSDIM, KMAX) ! cloud water in cumulus - REAL(r8) CUMFRC(IJSDIM) ! cumulus cloud fraction - REAL(r8) GTCFRC(IJSDIM, KMAX) ! change in cloud fraction - REAL(r8) FLIQC (IJSDIM, KMAX) ! liquid ratio in cumulus - REAL(r8) GTPRP (IJSDIM, KMAX) ! rain+snow flux + REAL(kind_phys) GTT (IJSDIM, KMAX) ! heating rate + REAL(kind_phys) GTQ (IJSDIM, KMAX, NTR) ! change in q + REAL(kind_phys) GTU (IJSDIM, KMAX) ! tendency of u + REAL(kind_phys) GTV (IJSDIM, KMAX) ! tendency of v + REAL(kind_phys) GPRCC (IJSDIM, NTR ) ! rainfall + REAL(kind_phys) GSNWC (IJSDIM) ! snowfall + REAL(kind_phys) CUMCLW(IJSDIM, KMAX) ! cloud water in cumulus + REAL(kind_phys) CUMFRC(IJSDIM) ! cumulus cloud fraction + REAL(kind_phys) GTCFRC(IJSDIM, KMAX) ! change in cloud fraction + REAL(kind_phys) FLIQC (IJSDIM, KMAX) ! liquid ratio in cumulus + REAL(kind_phys) GTPRP (IJSDIM, KMAX) ! rain+snow flux ! INTEGER ISTS, IENS ! @@ -4053,19 +4054,19 @@ SUBROUTINE CUMCHK & ! check range of output va INTEGER I, K ! ! [INTERNAL PARM] - REAL(r8) :: GTTMAX = 1.e-2_r8 - REAL(r8) :: GTQVMAX = 1.e-4_r8 - REAL(r8) :: GTQLMAX = 1.e-5_r8 - REAL(r8) :: GTUMAX = 1.e-2_r8 - REAL(r8) :: GTVMAX = 1.e-2_r8 - REAL(r8) :: GTCFMAX = 1.e-3_r8 - REAL(r8) :: PRCCMAX = 1.e-2_r8 - REAL(r8) :: SNWCMAX = 1.e-2_r8 - REAL(r8) :: CLWMAX = 1.e-3_r8 - REAL(r8) :: TPRPMAX = 1.e-2_r8 - REAL(r8) :: GTQIMAX = 1.e-5_r8 - !REAL(r8) :: GTM2MAX = 1._r8 - !REAL(r8) :: GTM3MAX = 1._r8 + REAL(kind_phys) :: GTTMAX = 1.e-2_kind_phys + REAL(kind_phys) :: GTQVMAX = 1.e-4_kind_phys + REAL(kind_phys) :: GTQLMAX = 1.e-5_kind_phys + REAL(kind_phys) :: GTUMAX = 1.e-2_kind_phys + REAL(kind_phys) :: GTVMAX = 1.e-2_kind_phys + REAL(kind_phys) :: GTCFMAX = 1.e-3_kind_phys + REAL(kind_phys) :: PRCCMAX = 1.e-2_kind_phys + REAL(kind_phys) :: SNWCMAX = 1.e-2_kind_phys + REAL(kind_phys) :: CLWMAX = 1.e-3_kind_phys + REAL(kind_phys) :: TPRPMAX = 1.e-2_kind_phys + REAL(kind_phys) :: GTQIMAX = 1.e-5_kind_phys + !REAL(kind_phys) :: GTM2MAX = 1._kind_phys + !REAL(kind_phys) :: GTM3MAX = 1._kind_phys ! DO K=1,KMAX DO I=ISTS, IENS diff --git a/physics/cu_gf_driver.F90 b/physics/cu_gf_driver.F90 index 48b40dfd8d..27165e067d 100644 --- a/physics/cu_gf_driver.F90 +++ b/physics/cu_gf_driver.F90 @@ -109,7 +109,7 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,cactiv, & integer, dimension (:), intent(out) :: hbot,htop,kcnv integer, dimension (:), intent(in) :: xland real(kind=kind_phys), dimension (:), intent(in) :: pbl - integer, dimension (:) :: tropics + integer, dimension (im) :: tropics ! ruc variable real(kind=kind_phys), dimension (:), intent(in) :: hfx2,qfx2,psuri real(kind=kind_phys), dimension (:,:), intent(out) :: ud_mf,dd_mf,dt_mf @@ -119,7 +119,7 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,cactiv, & real(kind=kind_phys), dimension (:,:), intent(in) :: qv2di_spechum real(kind=kind_phys), dimension (:,:), intent(inout) :: qv_spechum ! Local water vapor mixing ratios and cloud water mixing ratios - real(kind=kind_phys), dimension (:,:) :: qv2di, qv, forceqv, cnvw + real(kind=kind_phys), dimension (im,km) :: qv2di, qv, forceqv, cnvw ! real(kind=kind_phys), dimension(:),intent(in) :: garea real(kind=kind_phys), intent(in ) :: dt diff --git a/physics/gfdl_fv_sat_adj.F90 b/physics/gfdl_fv_sat_adj.F90 index d10e9fe0f8..6140fa680c 100644 --- a/physics/gfdl_fv_sat_adj.F90 +++ b/physics/gfdl_fv_sat_adj.F90 @@ -256,7 +256,7 @@ subroutine fv_sat_adj_run(mdt, zvir, is, ie, isd, ied, kmp, km, kmdelz, js, je, logical, intent(in) :: hydrostatic logical, intent(in) :: fast_mp_consv real(kind=kind_dyn), intent(inout) :: te0_2d(:,:) - real(kind=kind_dyn), intent( out) :: te0(:,:,;) + real(kind=kind_dyn), intent( out) :: te0(:,:,:) ! If multi-gases physics are not used, ngas is one and qvi identical to qv integer, intent(in) :: ngas real(kind=kind_dyn), intent(inout) :: qvi(:,:,:,:) @@ -268,8 +268,8 @@ subroutine fv_sat_adj_run(mdt, zvir, is, ie, isd, ied, kmp, km, kmdelz, js, je, real(kind=kind_dyn), intent(inout) :: qg(:,:,:) real(kind=kind_dyn), intent(in) :: hs(:,:) real(kind=kind_dyn), intent(in) :: peln(:,:,:) - ! For hydrostatic build, kmdelz=1, otherwise kmdelz=km (see fv_arrays.F90) - real(kind=kind_dyn), intent(in) :: delz(:,:) + ! For hydrostatic build, delz's third dimension is 1:kmdelz=1:1, otherwise 1:km (see fv_arrays.F90) + real(kind=kind_dyn), intent(in) :: delz(:,:,:) real(kind=kind_dyn), intent(in) :: delp(:,:,:) real(kind=kind_dyn), intent(inout) :: pt(:,:,:) real(kind=kind_dyn), intent(inout) :: pkz(:,:,:) @@ -333,18 +333,19 @@ subroutine fv_sat_adj_run(mdt, zvir, is, ie, isd, ied, kmp, km, kmdelz, js, je, else kdelz = k end if - call fv_sat_adj_work(abs(mdt), zvir, is, ie, js, je, ng, hydrostatic, fast_mp_consv, & - te0(isd,jsd,k), & + call fv_sat_adj_work(abs(mdt), zvir, is, ie, js, je, ng, hydrostatic, fast_mp_consv, & + te0(isd:ied,jsd:jed,k), & #ifdef MULTI_GASES - qvi(isd,jsd,k,1:ngas), & + qvi(isd:ied,jsd:jed,k,1:ngas), & #else - qv(isd,jsd,k), & + qv(isd:ied,jsd:jed,k), & #endif - ql(isd,jsd,k), qi(isd,jsd,k), & - qr(isd,jsd,k), qs(isd,jsd,k), qg(isd,jsd,k), & - hs, dpln, delz(is:,js:,kdelz), pt(isd,jsd,k), delp(isd,jsd,k),& - q_con(isd:,jsd:,k), cappa(isd:,jsd:,k), area, dtdt(is,js,k), & - out_dt, last_step, do_qa, qa(isd,jsd,k)) + ql(isd:ied,jsd:jed,k), qi(isd:ied,jsd:jed,k), & + qr(isd:ied,jsd:jed,k), qs(isd:ied,jsd:jed,k), qg(isd:ied,jsd:jed,k), & + hs, dpln, delz(is:ie,js:je,kdelz), pt(isd:ied,jsd:jed,k), & + delp(isd:ied,jsd:jed,k), q_con(isd:ied,jsd:jed,k), & + cappa(isd:ied,jsd:jed,k), area, dtdt(is:ie,js:je,k), & + out_dt, last_step, do_qa, qa(isd:ied,jsd:jed,k)) if ( .not. hydrostatic ) then do j=js,je do i=is,ie diff --git a/physics/gfdl_sfc_layer.F90 b/physics/gfdl_sfc_layer.F90 index 341f84fb3a..68d38c56c8 100644 --- a/physics/gfdl_sfc_layer.F90 +++ b/physics/gfdl_sfc_layer.F90 @@ -374,10 +374,10 @@ subroutine gfdl_sfc_layer_run (im, nsoil, km, xlat, xlon, flag_iter, lsm, & ztmax(i) = ztmax(i)*100.0 !convert from m to cm z0max(i) = z0max(i)*100.0 !convert from m to cm - call mflux2 (fxh(i), fxe(i), fxmx(i), fxmy(i), cdm_lnd(i), rib_lnd(i), & + call mflux2 (fxh(i), fxe(i), fxmx(i), fxmy(i), cdm_lnd(i:i), rib_lnd(i:i), & xxfh(i), ztmax(i), z0max(i), tstrc(i), & pspc(i), pkmax(i), wetc(i), slwdc(i), z1_cm(i), icoef_sf, iwavecpl, lcurr_sf, charn(i), msang(i), & - scurx(i), scury(i), pert_Cd, ens_random_seed, ens_Cdamp, upc(i), vpc(i), t1(i), q1(i), & + scurx(i), scury(i), pert_Cd, ens_random_seed, ens_Cdamp, upc(i), vpc(i), t1(i:i), q1(i:i), & dt, wind10(i), xxfh2(i), ntsflg, sfenth, tzot(i), ep2, errmsg, & errflg) if (errflg /= 0) return @@ -523,10 +523,10 @@ subroutine gfdl_sfc_layer_run (im, nsoil, km, xlat, xlon, flag_iter, lsm, & ztmax(i) = ztmax(i)*100.0 !m to cm z0max(i) = z0max(i)*100.0 !m to cm - call mflux2 (fxh(i), fxe(i), fxmx(i), fxmy(i), cdm_ice(i), rib_ice(i), & + call mflux2 (fxh(i), fxe(i), fxmx(i), fxmy(i), cdm_ice(i:i), rib_ice(i:i), & xxfh(i), ztmax(i), z0max(i), tstrc(i), & pspc(i), pkmax(i), wetc(i), slwdc(i), z1_cm(i), icoef_sf, iwavecpl, lcurr_sf, charn(i), msang(i), & - scurx(i), scury(i), pert_Cd, ens_random_seed, ens_Cdamp, upc(i), vpc(i), t1(i), q1(i), & + scurx(i), scury(i), pert_Cd, ens_random_seed, ens_Cdamp, upc(i), vpc(i), t1(i:i), q1(i:i), & dt, wind10(i), xxfh2(i), ntsflg, sfenth, tzot(i), ep2, errmsg, & errflg) if (errflg /= 0) return @@ -630,10 +630,10 @@ subroutine gfdl_sfc_layer_run (im, nsoil, km, xlat, xlon, flag_iter, lsm, & !GJF: mflux2 expects negative roughness length for ocean points znt_ocn(i) = -znt_ocn(i) - call mflux2 (fxh(i), fxe(i), fxmx(i), fxmy(i), cdm_ocn(i), rib_ocn(i), & - xxfh(i), znt_ocn(i), mznt(i), tstrc(i), & + call mflux2 (fxh(i), fxe(i), fxmx(i), fxmy(i), cdm_ocn(i:i), rib_ocn(i:i), & + xxfh(i), znt_ocn(i:i), mznt(i), tstrc(i), & pspc(i), pkmax(i), wetc(i), slwdc(i), z1_cm(i), icoef_sf, iwavecpl, lcurr_sf, charn(i), msang(i), & - scurx(i), scury(i), pert_Cd, ens_random_seed, ens_Cdamp, upc(i), vpc(i), t1(i), q1(i), & + scurx(i), scury(i), pert_Cd, ens_random_seed, ens_Cdamp, upc(i), vpc(i), t1(i:i), q1(i:i), & dt, wind10(i), xxfh2(i), ntsflg, sfenth, tzot(i), ep2, errmsg, & errflg) if (errflg /= 0) return diff --git a/physics/gmtb_scm_sfc_flux_spec.F90 b/physics/gmtb_scm_sfc_flux_spec.F90 index 22730f9f26..1ec2131af1 100644 --- a/physics/gmtb_scm_sfc_flux_spec.F90 +++ b/physics/gmtb_scm_sfc_flux_spec.F90 @@ -15,6 +15,10 @@ module gmtb_scm_sfc_flux_spec CONTAINS !******************************************************************************************* +!! +!! \section arg_table_gmtb_scm_sfc_flux_spec_init Argument Table +!! \htmlinclude gmtb_scm_sfc_flux_spec_init.html +!! subroutine gmtb_scm_sfc_flux_spec_init(lheatstrg, errmsg, errflg) logical, intent(in) :: lheatstrg diff --git a/physics/gwdps.f b/physics/gwdps.f index 66cff45e77..285bdf67c4 100644 --- a/physics/gwdps.f +++ b/physics/gwdps.f @@ -298,7 +298,7 @@ subroutine gwdps_run( & integer, intent(in) :: im, km, imx, kdt, ipr, me integer, intent(in) :: KPBL(:) ! Index for the PBL top layer! real(kind=kind_phys), intent(in) :: & - & deltim, G, CP, RD, RV, cdmbgwd(4) + & deltim, G, CP, RD, RV, cdmbgwd(:) real(kind=kind_phys), intent(inout) :: & & A(:,:), B(:,:), C(:,:) real(kind=kind_phys), intent(in) :: & @@ -307,7 +307,7 @@ subroutine gwdps_run( & & PRSL(:,:), PRSLK(:,:), PHIL(:,:), & & PHII(:,:) real(kind=kind_phys), intent(in) :: & - & OC(:), OA4(:,:), CLX4(:,;), HPRIME(:) + & OC(:), OA4(:,:), CLX4(:,:), HPRIME(:) real(kind=kind_phys), intent(inout) :: ELVMAX(:) real(kind=kind_phys), intent(in) :: & & THETA(:), SIGMA(:), GAMMA(:) diff --git a/physics/h2o_def.meta b/physics/h2o_def.meta index 21f3b903f7..524828ba4b 100644 --- a/physics/h2o_def.meta +++ b/physics/h2o_def.meta @@ -26,4 +26,3 @@ dimensions = (vertical_dimension_of_h2o_forcing_data) type = real kind = kind_phys - active = (flag_for_stratospheric_water_vapor_physics) \ No newline at end of file diff --git a/physics/module_MYJPBL_wrapper.F90 b/physics/module_MYJPBL_wrapper.F90 index 9179c3068c..0863098973 100644 --- a/physics/module_MYJPBL_wrapper.F90 +++ b/physics/module_MYJPBL_wrapper.F90 @@ -90,7 +90,7 @@ SUBROUTINE myjpbl_wrapper_run( & & prsik_1, prslk_1, prslki, slmsk, garea, & snowd, evap, hflx, cm, ch, wind, hprime1 real(kind=kind_phys),dimension(:),intent(inout) :: & - & pblh, zorl, ustar, tsfc, qsfc + & zorl, ustar, tsfc, qsfc real(kind=kind_phys),dimension(:),intent(inout) :: & & phy_myj_qsfc, phy_myj_thz0, phy_myj_qz0, & & phy_myj_uz0, phy_myj_vz0, phy_myj_z0base, & @@ -98,7 +98,7 @@ SUBROUTINE myjpbl_wrapper_run( & & phy_myj_chkqlm, phy_myj_elflx, & & phy_myj_a1u, phy_myj_a1t, phy_myj_a1q real(kind=kind_phys),dimension(:),intent(out) :: & - & dusfc,dvsfc,dtsfc,dqsfc,gamt,gamq + & pblh,dusfc,dvsfc,dtsfc,dqsfc,gamt,gamq integer,dimension(:),intent(out) :: kpbl integer,dimension(:),intent(in) :: kinver diff --git a/physics/module_MYJPBL_wrapper.meta b/physics/module_MYJPBL_wrapper.meta index 758dfb77b7..17efdb1c36 100644 --- a/physics/module_MYJPBL_wrapper.meta +++ b/physics/module_MYJPBL_wrapper.meta @@ -405,7 +405,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = inout + intent = in optional = F [ch] standard_name = surface_drag_coefficient_for_heat_and_moisture_in_air @@ -414,7 +414,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = inout + intent = in optional = F [wind] standard_name = wind_speed_at_lowest_model_layer @@ -443,19 +443,19 @@ kind = kind_phys intent = inout optional = F -[hflx] - standard_name = kinematic_surface_upward_sensible_heat_flux_reduced_by_surface_roughness - long_name = kinematic surface upward sensible heat flux - units = K m s-1 +[evap] + standard_name = kinematic_surface_upward_latent_heat_flux_reduced_by_surface_roughness + long_name = kinematic surface upward latent heat flux + units = kg kg-1 m s-1 dimensions = (horizontal_loop_extent) type = real kind = kind_phys intent = in optional = F -[evap] - standard_name = kinematic_surface_upward_latent_heat_flux_reduced_by_surface_roughness - long_name = kinematic surface upward latent heat flux - units = kg kg-1 m s-1 +[hflx] + standard_name = kinematic_surface_upward_sensible_heat_flux_reduced_by_surface_roughness + long_name = kinematic surface upward sensible heat flux + units = K m s-1 dimensions = (horizontal_loop_extent) type = real kind = kind_phys @@ -576,7 +576,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = inout + intent = out optional = F [gamq] standard_name = countergradient_mixing_term_for_water_vapor @@ -585,7 +585,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = inout + intent = out optional = F [con_cp] standard_name = specific_heat_of_dry_air_at_constant_pressure diff --git a/physics/module_MYJSFC_wrapper.F90 b/physics/module_MYJSFC_wrapper.F90 index ee683b97c2..d908900c46 100644 --- a/physics/module_MYJSFC_wrapper.F90 +++ b/physics/module_MYJSFC_wrapper.F90 @@ -121,7 +121,7 @@ SUBROUTINE myjsfc_wrapper_run( & !MYJ-3D - real(kind=kind_phys),dimension(::),intent(in) :: & + real(kind=kind_phys),dimension(:,:),intent(in) :: & phii, prsi real(kind=kind_phys),dimension(:,:),intent(in) :: & & ugrs, vgrs, tgrs, prsl diff --git a/physics/module_MYNNPBL_wrapper.F90 b/physics/module_MYNNPBL_wrapper.F90 index 778e6993ef..36c78cab0f 100644 --- a/physics/module_MYNNPBL_wrapper.F90 +++ b/physics/module_MYNNPBL_wrapper.F90 @@ -239,13 +239,13 @@ SUBROUTINE mynnedmf_wrapper_run( & REAL(kind=kind_phys) :: tem !MYNN-3D - real(kind=kind_phys), dimension(im,levs+1), intent(in) :: phii - real(kind=kind_phys), dimension(im,levs ), intent(inout) :: & + real(kind=kind_phys), dimension(:,:), intent(in) :: phii + real(kind=kind_phys), dimension(:,:), intent(inout) :: & & dtdt, dudt, dvdt, & & dqdt_water_vapor, dqdt_liquid_cloud, dqdt_ice_cloud, & & dqdt_cloud_droplet_num_conc, dqdt_ice_num_conc, & & dqdt_ozone, dqdt_water_aer_num_conc, dqdt_ice_aer_num_conc - real(kind=kind_phys), dimension(im,levs), intent(inout) :: & + real(kind=kind_phys), dimension(:,:), intent(inout) :: & & qke, qke_adv, EL_PBL, Sh3D, & & qc_bl, qi_bl, cldfra_bl !These 10 arrays are only allocated when bl_mynn_output > 0 @@ -253,7 +253,7 @@ SUBROUTINE mynnedmf_wrapper_run( & & edmf_a,edmf_w,edmf_qt, & & edmf_thl,edmf_ent,edmf_qc, & & sub_thl,sub_sqv,det_thl,det_sqv - real(kind=kind_phys), dimension(im,levs), intent(in) :: & + real(kind=kind_phys), dimension(:,:), intent(in) :: & & u,v,omega,t3d, & & exner,prsl, & & qgrs_water_vapor, & @@ -264,13 +264,13 @@ SUBROUTINE mynnedmf_wrapper_run( & & qgrs_ozone, & & qgrs_water_aer_num_conc, & & qgrs_ice_aer_num_conc - real(kind=kind_phys), dimension(im,levs), intent(out) :: & + real(kind=kind_phys), dimension(:,:), intent(out) :: & & Tsq, Qsq, Cov, exch_h, exch_m real(kind=kind_phys), dimension(:,:), intent(inout) :: & & du3dt_PBL, du3dt_OGWD, dv3dt_PBL, dv3dt_OGWD, & & do3dt_PBL, dq3dt_PBL, dt3dt_PBL - real(kind=kind_phys), dimension(im), intent(in) :: xmu - real(kind=kind_phys), dimension(im, levs), intent(in) :: htrsw, htrlw + real(kind=kind_phys), dimension(:), intent(in) :: xmu + real(kind=kind_phys), dimension(:,:), intent(in) :: htrsw, htrlw !LOCAL real(kind=kind_phys), dimension(im,levs) :: & & sqv,sqc,sqi,qnc,qni,ozone,qnwfa,qnifa, & @@ -316,11 +316,11 @@ SUBROUTINE mynnedmf_wrapper_run( & & dusfci_cpl,dvsfci_cpl,dtsfci_cpl,dqsfci_cpl !LOCAL - real, dimension(:) :: & + real, dimension(im) :: & & WSTAR,DELTA,qcg,hfx,qfx,rmol,xland, & & uoce,voce,vdfg,znt,ts - real, dimension(:) :: dusfci1,dvsfci1,dtsfci1,dqsfci1 + real, dimension(im) :: dusfci1,dvsfci1,dtsfci1,dqsfci1 ! Initialize CCPP error handling variables errmsg = '' diff --git a/physics/module_MYNNSFC_wrapper.F90 b/physics/module_MYNNSFC_wrapper.F90 index e46a17d9a3..108bc6a233 100644 --- a/physics/module_MYNNSFC_wrapper.F90 +++ b/physics/module_MYNNSFC_wrapper.F90 @@ -130,41 +130,33 @@ SUBROUTINE mynnsfc_wrapper_run( & & iz0tlnd = 0, & !control: 0 & isfflx = 1 + integer, intent(in) :: im, levs + integer, intent(in) :: iter, itimestep, lsm, lsm_ruc + logical, intent(in) :: flag_init,flag_restart,lprnt integer, intent(in) :: ivegsrc integer, intent(in) :: sfc_z0_type ! option for calculating surface roughness length over ocean logical, intent(in) :: redrag ! reduced drag coeff. flag for high wind over sea (j.han) + real(kind=kind_phys), intent(in) :: delt !Input data - integer, dimension(im), intent(in) :: vegtype - real(kind=kind_phys), dimension(im), intent(in) :: & + integer, dimension(:), intent(in) :: vegtype + real(kind=kind_phys), dimension(:), intent(in) :: & & sigmaf,shdmax,z0pert,ztpert -!MYNN-1D - REAL :: delt - INTEGER :: im, levs - INTEGER :: iter, k, i, itimestep, lsm, lsm_ruc - LOGICAL :: flag_init,flag_restart,lprnt - INTEGER :: IDS,IDE,JDS,JDE,KDS,KDE, & - & IMS,IME,JMS,JME,KMS,KME, & - & ITS,ITE,JTS,JTE,KTS,KTE - - real(kind=kind_phys), dimension(im,levs+1), & + real(kind=kind_phys), dimension(:,:), & & intent(in) :: phii - real(kind=kind_phys), dimension(im,levs), & + real(kind=kind_phys), dimension(:,:), & & intent(in) :: exner, PRSL, & & u, v, t3d, qvsh, qc - real(kind=kind_phys), dimension(im,levs) :: & - & pattern_spp_pbl, dz, th, qv - - logical, dimension(im), intent(in) :: wet, dry, icy + logical, dimension(:), intent(in) :: wet, dry, icy - real(kind=kind_phys), dimension(im), intent(in) :: & + real(kind=kind_phys), dimension(:), intent(in) :: & & tskin_ocn, tskin_lnd, tskin_ice, & & tsurf_ocn, tsurf_lnd, tsurf_ice, & & snowh_ocn, snowh_lnd, snowh_ice - real(kind=kind_phys), dimension(im), intent(inout) :: & + real(kind=kind_phys), dimension(:), intent(inout) :: & & znt_ocn, znt_lnd, znt_ice, & & ust_ocn, ust_lnd, ust_ice, & & cm_ocn, cm_lnd, cm_ice, & @@ -184,7 +176,7 @@ SUBROUTINE mynnsfc_wrapper_run( & & dx, pblh, slmsk, ps, & & qsfc_lnd_ruc, qsfc_ice_ruc - real(kind=kind_phys), dimension(im), intent(inout) :: & + real(kind=kind_phys), dimension(:), intent(inout) :: & & ustm, hflx, qflx, wspd, qsfc, & & FLHC, FLQC, U10, V10, TH2, T2, Q2, & & CHS2, CQS2, rmol, zol, mol, ch, & @@ -195,6 +187,15 @@ SUBROUTINE mynnsfc_wrapper_run( & & chs, ck, cd, mavail, xland, GZ1OZ0, & & cpm, qgh, qfx, qsfc_ruc + real(kind=kind_phys), dimension(im,levs) :: & + & pattern_spp_pbl, dz, th, qv + +!MYNN-1D + INTEGER :: k, i + INTEGER :: IDS,IDE,JDS,JDE,KDS,KDE, & + & IMS,IME,JMS,JME,KMS,KME, & + & ITS,ITE,JTS,JTE,KTS,KTE + ! Initialize CCPP error handling variables errmsg = '' errflg = 0 diff --git a/physics/moninedmf.f b/physics/moninedmf.f index d5cb2ded35..d38841c44d 100644 --- a/physics/moninedmf.f +++ b/physics/moninedmf.f @@ -83,40 +83,40 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & ! logical, intent(in) :: lprnt, hurr_pbl, lssav, ldiag3d, qdiag3d logical, intent(in) :: flag_for_pbl_generic_tend - integer, intent(in) :: ipr, islimsk(im) - integer, intent(in) :: im, km, ntrac, ntcw, kinver(im), ntoz - integer, intent(out) :: kpbl(im) + integer, intent(in) :: ipr, islimsk(:) + integer, intent(in) :: im, km, ntrac, ntcw, kinver(:), ntoz + integer, intent(out) :: kpbl(:) ! real(kind=kind_phys), intent(in) :: delt, xkzm_m, xkzm_h, xkzm_s real(kind=kind_phys), intent(in) :: xkzminv, moninq_fac, var_ric, & & coef_ric_l, coef_ric_s - real(kind=kind_phys), intent(inout) :: dv(im,km), du(im,km), & - & tau(im,km), rtg(im,km,ntrac) + real(kind=kind_phys), intent(inout) :: dv(:,:), du(:,:), & + & tau(:,:), rtg(:,:,:) ! Only allocated if ldiag3d or qdiag3d are true real(kind=kind_phys), intent(inout), dimension(:,:) :: & & du3dt_PBL,dv3dt_PBL,dt3dt_PBL,dq3dt_PBL,do3dt_PBL real(kind=kind_phys), intent(in) :: & - & u1(im,km), v1(im,km), & - & t1(im,km), q1(im,km,ntrac), & - & swh(im,km), hlw(im,km), & - & xmu(im), psk(im), & - & rbsoil(im), zorl(im), & - & u10m(im), v10m(im), & - & fm(im), fh(im), & - & tsea(im), & - & heat(im), evap(im), & - & stress(im), spd1(im) + & u1(:,:), v1(:,:), & + & t1(:,:), q1(:,:,:), & + & swh(:,:), hlw(:,:), & + & xmu(:), psk(:), & + & rbsoil(:), zorl(:), & + & u10m(:), v10m(:), & + & fm(:), fh(:), & + & tsea(:), & + & heat(:), evap(:), & + & stress(:), spd1(:) real(kind=kind_phys), intent(in) :: & - & prsi(im,km+1), del(im,km), & - & prsl(im,km), prslk(im,km), & - & phii(im,km+1), phil(im,km) + & prsi(:,:), del(:,:), & + & prsl(:,:), prslk(:,:), & + & phii(:,:), phil(:,:) real(kind=kind_phys), intent(out) :: & - & dusfc(im), dvsfc(im), & - & dtsfc(im), dqsfc(im), & - & hpbl(im), dkt(im,km-1) + & dusfc(:), dvsfc(:), & + & dtsfc(:), dqsfc(:), & + & hpbl(:), dkt(:,:) real(kind=kind_phys), intent(inout) :: & - & hgamt(im), hgamq(im) + & hgamt(:), hgamq(:) ! logical, intent(in) :: dspheat ! flag for tke dissipative heating diff --git a/physics/moninedmf.meta b/physics/moninedmf.meta index b14dbd2fc8..9d365e1413 100644 --- a/physics/moninedmf.meta +++ b/physics/moninedmf.meta @@ -538,6 +538,8 @@ dimensions = () type = real kind = kind_phys + intent = in + optional = F [lssav] standard_name = flag_diagnostics long_name = logical flag for storing diagnostics diff --git a/physics/mp_fer_hires.meta b/physics/mp_fer_hires.meta index 20412d8a61..fa09f66db0 100644 --- a/physics/mp_fer_hires.meta +++ b/physics/mp_fer_hires.meta @@ -153,6 +153,7 @@ type = integer intent = out optional = F + ######################################################################## [ccpp-arg-table] name = mp_fer_hires_run diff --git a/physics/ozne_def.meta b/physics/ozne_def.meta index 27698eec62..0daf424103 100644 --- a/physics/ozne_def.meta +++ b/physics/ozne_def.meta @@ -26,4 +26,3 @@ dimensions = (vertical_dimension_of_ozone_forcing_data) type = real kind = kind_phys - active = (index_for_ozone>0) diff --git a/physics/ozphys_2015.f b/physics/ozphys_2015.f index 1791bca6e8..af8be0702e 100644 --- a/physics/ozphys_2015.f +++ b/physics/ozphys_2015.f @@ -62,6 +62,7 @@ subroutine ozphys_2015_run ( & real(kind=kind_phys),intent(in) :: con_g real :: gravi integer, intent(in) :: im, levs, ko3, pl_coeff,me + logical, intent(in) :: ldiag3d, qdiag3d real(kind=kind_phys), intent(in) :: po3(:), & & prsl(:,:), tin(:,:), & & delp(:,:), & @@ -76,7 +77,7 @@ subroutine ozphys_2015_run ( & integer, intent(out) :: errflg integer k,kmax,kmin,l,i,j - logical ldiag3d, flg(im), qdiag3d + logical flg(im) real(kind=kind_phys) pmax, pmin, tem, temp real(kind=kind_phys) wk1(im), wk2(im), wk3(im),prod(im,pl_coeff), & & ozib(im), colo3(im,levs+1), coloz(im,levs+1),& diff --git a/physics/rascnv.F90 b/physics/rascnv.F90 index e78570f34c..24553490f0 100644 --- a/physics/rascnv.F90 +++ b/physics/rascnv.F90 @@ -324,41 +324,41 @@ subroutine rascnv_run(IM, k, ntr, dt, dtf & ! ! Implicit none -! - LOGICAL FLIPV ! ! input +! + logical, intent(in) :: flipv ! integer, intent(in) :: im, k, ntr, me, nrcm, ntk, kdt & &, mp_phys, mp_phys_mg - integer, dimension(im) :: kbot, ktop, kcnv, kpbl -! - real(kind=kind_phys), intent(in) :: dxmin, dxinv, ccwf(2) & - &, psauras(2), prauras(2) & - &, wminras(2), dlqf(2) -! - real(kind=kind_phys), dimension(im,k+1) :: prsi, prsik, phii - - real(kind=kind_phys), dimension(im,k) :: tin, qin, uin, vin & - &, prsl, prslk, phil & - - &, ud_mf, dd_mf, dt_mf & - &, rhc, qlcn, qicn, w_upi & - &, cnv_mfd & - &, cnv_dqldt, clcn & - &, cnv_fice, cnv_ndrop & - &, cnv_nice, cf_upi - real(kind=kind_phys), dimension(im) :: area, cdrag & - &, rainc, ddvel - real(kind=kind_phys), dimension(im,nrcm):: rannum - real(kind=kind_phys) ccin(im,k,ntr+2) - real(kind=kind_phys) trcmin(ntr+2) - - real(kind=kind_phys) DT, dtf + integer, dimension(:), intent(out) :: kbot, ktop + integer, dimension(:), intent(inout) :: kcnv + integer, dimension(:), intent(in) :: kpbl +! + real(kind=kind_phys), intent(in) :: dxmin, dxinv, ccwf(:) & + &, psauras(:), prauras(:) & + &, wminras(:), dlqf(:) +! + real(kind=kind_phys), dimension(:,:), intent(in) :: prsi, prsik, phii + + real(kind=kind_phys), dimension(:,:), intent(inout) :: tin, qin, uin, vin + real(kind=kind_phys), dimension(:,:), intent(in) :: prsl, prslk, phil & + &, rhc + real(kind=kind_phys), dimension(:,:), intent(out) :: ud_mf, dd_mf, dt_mf + real(kind=kind_phys), dimension(:,:), intent(inout) :: qlcn, qicn, w_upi & + &, cnv_mfd & + &, cnv_dqldt, clcn & + &, cnv_fice, cnv_ndrop & + &, cnv_nice, cf_upi + real(kind=kind_phys), dimension(:) , intent(in) :: area, cdrag + real(kind=kind_phys), dimension(:) , intent(out) :: rainc, ddvel + real(kind=kind_phys), dimension(:,:), intent(in) :: rannum + real(kind=kind_phys), intent(inout) :: ccin(:,:,:) + real(kind=kind_phys), intent(in) :: dt, dtf ! ! Added for aerosol scavenging for GOCART ! - real(kind=kind_phys), intent(in) :: fscav(ntr) + real(kind=kind_phys), intent(in) :: fscav(:) ! &, ctei_r(im), ctei_rm character(len=*), intent(out) :: errmsg @@ -366,6 +366,7 @@ subroutine rascnv_run(IM, k, ntr, dt, dtf & ! ! locals ! + real(kind=kind_phys) :: trcmin(ntr+2) real(kind=kind_phys), dimension(k) :: toi, qoi, tcu, qcu & &, pcu, clw, cli, qii, qli& &, phi_l, prsm,psjm & diff --git a/physics/rrtmg_sw_pre.F90 b/physics/rrtmg_sw_pre.F90 index bb49a9884c..2ea7de3d6a 100644 --- a/physics/rrtmg_sw_pre.F90 +++ b/physics/rrtmg_sw_pre.F90 @@ -47,7 +47,7 @@ subroutine rrtmg_sw_pre_run (im, lndp_type, n_var_lndp, lsswr, lndp_var_list, ln integer, intent(out) :: errflg ! Local variables integer :: i - real(kind=kind_phys), dimension(:,:) :: sfcalb + real(kind=kind_phys), dimension(im,NF_ALBD) :: sfcalb real(kind=kind_phys) :: lndp_alb diff --git a/physics/samfdeepcnv.f b/physics/samfdeepcnv.f index c9dc5cee4c..f537da3c51 100644 --- a/physics/samfdeepcnv.f +++ b/physics/samfdeepcnv.f @@ -109,7 +109,7 @@ subroutine samfdeepcnv_run (im,km,itc,ntc,cliq,cp,cvap, & & qlcn, qicn, w_upi, cnv_mfd, cnv_dqldt, clcn & &, cnv_fice, cnv_ndrop, cnv_nice, cf_upi ! *GJF - integer :: mp_phys, mp_phys_mg + integer, intent(in) :: mp_phys, mp_phys_mg real(kind=kind_phys), intent(in) :: clam, c0s, c1, & & betal, betas, asolfac, & diff --git a/physics/satmedmfvdifq.meta b/physics/satmedmfvdifq.meta index a57ce3839c..82922da503 100644 --- a/physics/satmedmfvdifq.meta +++ b/physics/satmedmfvdifq.meta @@ -660,7 +660,7 @@ units = flag dimensions = () type = logical - intent = inout + intent = in optional = F [qdiag3d] standard_name = flag_tracer_diagnostics_3D @@ -668,7 +668,7 @@ units = flag dimensions = () type = logical - intent = inout + intent = in optional = F [errmsg] standard_name = ccpp_error_message diff --git a/physics/sfc_noahmp_drv.F90 b/physics/sfc_noahmp_drv.F90 index e7ee1940a4..a1f65f26a7 100644 --- a/physics/sfc_noahmp_drv.F90 +++ b/physics/sfc_noahmp_drv.F90 @@ -92,11 +92,11 @@ end subroutine noahmpdrv_finalize !! - If a "guess" run, restore the land-related prognostic fields. ! ! !----------------------------------- - subroutine noahmpdrv_run & + subroutine noahmpdrv_run & !................................... ! --- inputs: - ( im, km, itime, ps, u1, v1, t1, q1, soiltyp, vegtype, & - sigmaf, dlwflx, dswsfc, snet, delt, tg3, cm, ch, & + ( im, km, lsnowl, itime, ps, u1, v1, t1, q1, soiltyp, & + vegtype, sigmaf, dlwflx, dswsfc, snet, delt, tg3, cm, ch, & prsl1, prslki, zf, dry, wind, slopetyp, & shdmin, shdmax, snoalb, sfalb, flag_iter, flag_guess, & idveg, iopt_crs, iopt_btr, iopt_run, iopt_sfc, iopt_frz, & @@ -155,7 +155,7 @@ subroutine noahmpdrv_run & integer , intent(in) :: im ! horiz dimension and num of used pts integer , intent(in) :: km ! vertical soil layer dimension - integer, , intent(in) :: lsnowl ! lower bound for snow level arrays + integer , intent(in) :: lsnowl ! lower bound for snow level arrays integer , intent(in) :: itime ! NOT USED real(kind=kind_phys), dimension(:) , intent(in) :: ps ! surface pressure [Pa] real(kind=kind_phys), dimension(:) , intent(in) :: u1 ! u-component of wind [m/s] @@ -196,8 +196,8 @@ subroutine noahmpdrv_run & integer , intent(in) :: iopt_snf ! option for partitioning precipitation into rainfall & snowfall integer , intent(in) :: iopt_tbot ! option for lower boundary condition of soil temperature integer , intent(in) :: iopt_stc ! option for snow/soil temperature time scheme (only layer 1) - real(kind=kind_phys), dimension(;) , intent(in) :: xlatin ! latitude - real(kind=kind_phys), dimension(;) , intent(in) :: xcoszin ! cosine of zenith angle + real(kind=kind_phys), dimension(:) , intent(in) :: xlatin ! latitude + real(kind=kind_phys), dimension(:) , intent(in) :: xcoszin ! cosine of zenith angle integer , intent(in) :: iyrlen ! year length [days] real(kind=kind_phys) , intent(in) :: julian ! julian day of year real(kind=kind_phys), dimension(:) , intent(in) :: rainn_mp ! microphysics non-convective precipitation [mm] diff --git a/physics/sfc_nst.meta b/physics/sfc_nst.meta index 2c32ca106f..3f5c0a9c51 100644 --- a/physics/sfc_nst.meta +++ b/physics/sfc_nst.meta @@ -96,19 +96,19 @@ kind = kind_phys intent = in optional = F -[sbc] - standard_name = stefan_boltzmann_constant - long_name = Stefan-Boltzmann constant - units = W m-2 K-4 +[pi] + standard_name = pi + long_name = ratio of a circle's circumference to its diameter + units = none dimensions = () type = real kind = kind_phys intent = in optional = F -[pi] - standard_name = pi - long_name = ratio of a circle's circumference to its diameter - units = none +[sbc] + standard_name = stefan_boltzmann_constant + long_name = Stefan-Boltzmann constant + units = W m-2 K-4 dimensions = () type = real kind = kind_phys diff --git a/physics/sfc_sice.f b/physics/sfc_sice.f index a61f19d16b..e739e724cf 100644 --- a/physics/sfc_sice.f +++ b/physics/sfc_sice.f @@ -41,16 +41,16 @@ end subroutine sfc_sice_finalize !! !> @{ subroutine sfc_sice_run & - ( im, kice, sbc, hvap, tgice, cp, eps, epsm1, rvrdm1, grav, & ! --- inputs: - t0c, rd, ps, t1, q1, delt, & - sfcemis, dlwflx, sfcnsw, sfcdsw, srflag, & - cm, ch, prsl1, prslki, prsik1, prslk1, wind, & - flag_iter, lprnt, ipr, & - hice, fice, tice, weasd, tskin, tprcp, tiice, ep, & ! --- input/outputs: - snwdph, qsurf, snowmt, gflux, cmm, chh, evap, hflx, & ! - frac_grid, icy, islmsk_cice, & - min_lakeice, min_seaice, oceanfrac, & - errmsg, errflg ) + & ( im, kice, sbc, hvap, tgice, cp, eps, epsm1, rvrdm1, grav, & ! --- inputs: + & t0c, rd, ps, t1, q1, delt, & + & sfcemis, dlwflx, sfcnsw, sfcdsw, srflag, & + & cm, ch, prsl1, prslki, prsik1, prslk1, wind, & + & flag_iter, lprnt, ipr, & + & hice, fice, tice, weasd, tskin, tprcp, tiice, ep, & ! --- input/outputs: + & snwdph, qsurf, snowmt, gflux, cmm, chh, evap, hflx, & ! + & frac_grid, icy, islmsk_cice, & + & min_lakeice, min_seaice, oceanfrac, & + & errmsg, errflg ) ! ===================================================================== ! ! description: ! diff --git a/physics/shinhongvdif.F90 b/physics/shinhongvdif.F90 index 14fc6b49d2..e93ad32459 100644 --- a/physics/shinhongvdif.F90 +++ b/physics/shinhongvdif.F90 @@ -1326,7 +1326,7 @@ subroutine shinhongvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & ! !---- find the mixing length ! - call mixlen(lmh,uxk,vxk,txk,thxk,qx(i,kts,1),qx(i,kts,ntcw) & + call mixlen(lmh,uxk,vxk,txk,thxk,qx(i,kts:kte,1),qx(i,kts:kte,ntcw) & ,q2xk,zqk,ust(i),corf,epshol(i) & ,s2,gh,rig,el & ,hpbl(i),kpbl(i),lmxl,ct(i) & diff --git a/physics/shinhongvdif.meta b/physics/shinhongvdif.meta index 8c850ff37f..6783fd8002 100644 --- a/physics/shinhongvdif.meta +++ b/physics/shinhongvdif.meta @@ -86,18 +86,18 @@ kind = kind_phys intent = in optional = F -[vtnp] - standard_name = tendency_of_y_wind_due_to_model_physics - long_name = updated tendency of the y wind +[utnp] + standard_name = tendency_of_x_wind_due_to_model_physics + long_name = updated tendency of the x wind units = m s-2 dimensions = (horizontal_loop_extent,vertical_dimension) type = real kind = kind_phys intent = inout optional = F -[utnp] - standard_name = tendency_of_x_wind_due_to_model_physics - long_name = updated tendency of the x wind +[vtnp] + standard_name = tendency_of_y_wind_due_to_model_physics + long_name = updated tendency of the y wind units = m s-2 dimensions = (horizontal_loop_extent,vertical_dimension) type = real diff --git a/physics/ugwpv1_gsldrag_post.F90 b/physics/ugwpv1_gsldrag_post.F90 index 1d8813f65a..e9bdafa4e8 100644 --- a/physics/ugwpv1_gsldrag_post.F90 +++ b/physics/ugwpv1_gsldrag_post.F90 @@ -10,14 +10,9 @@ module ugwpv1_gsldrag_post subroutine ugwpv1_gsldrag_post_init () end subroutine ugwpv1_gsldrag_post_init -!>@brief The subroutine initializes the unified UGWP - !> \section arg_table_ugwpv1_gsldrag_post_run Argument Table !! \htmlinclude ugwpv1_gsldrag_post_run.html !! - - - subroutine ugwpv1_gsldrag_post_run ( im, levs, & ldiag_ugwp, dtf, & dudt_gw, dvdt_gw, dtdt_gw, du_ofdcol, du_oblcol, tau_ogw, & @@ -36,16 +31,16 @@ subroutine ugwpv1_gsldrag_post_run ( im, levs, & real(kind=kind_phys), intent(in) :: dtf logical, intent(in) :: ldiag_ugwp !< flag for CIRES UGWP Diagnostics - real(kind=kind_phys), intent(in), dimension(im) :: zobl, zlwb, zogw - real(kind=kind_phys), intent(in), dimension(im) :: du_ofdcol, tau_ogw, du_oblcol, tau_ngw - real(kind=kind_phys), intent(inout), dimension(im) :: tot_mtb, tot_ogw, tot_tofd, tot_ngw - real(kind=kind_phys), intent(inout), dimension(im) :: tot_zmtb, tot_zlwb, tot_zogw + real(kind=kind_phys), intent(in), dimension(:) :: zobl, zlwb, zogw + real(kind=kind_phys), intent(in), dimension(:) :: du_ofdcol, tau_ogw, du_oblcol, tau_ngw + real(kind=kind_phys), intent(inout), dimension(:) :: tot_mtb, tot_ogw, tot_tofd, tot_ngw + real(kind=kind_phys), intent(inout), dimension(:) :: tot_zmtb, tot_zlwb, tot_zogw - real(kind=kind_phys), intent(in), dimension(im,levs) :: dtdt_gw, dudt_gw, dvdt_gw - real(kind=kind_phys), intent(in), dimension(im,levs) :: dudt_obl, dudt_ogw, dudt_ofd - real(kind=kind_phys), intent(inout), dimension(im,levs) :: du3dt_mtb, du3dt_ogw, du3dt_tms, du3dt_ngw, dv3dt_ngw + real(kind=kind_phys), intent(in), dimension(:,:) :: dtdt_gw, dudt_gw, dvdt_gw + real(kind=kind_phys), intent(in), dimension(:,:) :: dudt_obl, dudt_ogw, dudt_ofd + real(kind=kind_phys), intent(inout), dimension(:,:) :: du3dt_mtb, du3dt_ogw, du3dt_tms, du3dt_ngw, dv3dt_ngw - real(kind=kind_phys), intent(inout), dimension(im,levs) :: dtdt, dudt, dvdt + real(kind=kind_phys), intent(inout), dimension(:,:) :: dtdt, dudt, dvdt character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/ugwpv1_gsldrag_post.meta b/physics/ugwpv1_gsldrag_post.meta index 45fa4ea991..fdf32cbf47 100644 --- a/physics/ugwpv1_gsldrag_post.meta +++ b/physics/ugwpv1_gsldrag_post.meta @@ -3,11 +3,6 @@ type = scheme dependencies = machine.F -######################################################################## -[ccpp-arg-table] - name = ugwpv1_gsldrag_post_init - type = scheme - ######################################################################## [ccpp-arg-table] name = ugwpv1_gsldrag_post_run @@ -72,24 +67,24 @@ kind = kind_phys intent = in optional = F -[du_oblcol] - standard_name = vertically_integrated_x_momentum_flux_due_to_blocking_drag - long_name = integrated x momentum flux from blocking drag +[du_ofdcol] + standard_name = vertically_integrated_x_momentum_flux_due_to_form_drag + long_name = integrated x momentum flux from form drag units = Pa dimensions = (horizontal_loop_extent) type = real kind = kind_phys intent = in - optional = F -[du_ofdcol] - standard_name = vertically_integrated_x_momentum_flux_due_to_form_drag - long_name = integrated x momentum flux from form drag + optional = F +[du_oblcol] + standard_name = vertically_integrated_x_momentum_flux_due_to_blocking_drag + long_name = integrated x momentum flux from blocking drag units = Pa dimensions = (horizontal_loop_extent) type = real kind = kind_phys intent = in - optional = F + optional = F [tau_ogw] standard_name = instantaneous_momentum_flux_due_to_orographic_gravity_wave_drag long_name = momentum flux or stress due to orographic gravity wave drag @@ -313,9 +308,3 @@ type = integer intent = out optional = F - -######################################################################## -[ccpp-arg-table] - name = ugwpv1_gsldrag_post_finalize - type = scheme - diff --git a/physics/unified_ugwp.F90 b/physics/unified_ugwp.F90 index 64b9230212..288227c8cc 100644 --- a/physics/unified_ugwp.F90 +++ b/physics/unified_ugwp.F90 @@ -203,7 +203,7 @@ subroutine unified_ugwp_run(me, master, im, levs, ntrac, dtp, fhzero, kdt, ugrs, vgrs, tgrs, q1, prsi, prsl, prslk, phii, phil, & del, kpbl, dusfcg, dvsfcg, gw_dudt, gw_dvdt, gw_dtdt, gw_kdis, & tau_tofd, tau_mtb, tau_ogw, tau_ngw, zmtb, zlwb, zogw, & - dudt_mtb, dudt_tms, du3dt_mtb, du3dt_ogw, du3dt_tms, & + dudt_mtb, dudt_tms, du3dt_mtb, du3dt_ogw, du3dt_tms, & dudt, dvdt, dtdt, rdxzb, con_g, con_omega, con_pi, con_cp, con_rd, con_rv, & con_rerth, con_fvirt, rain, ntke, q_tke, dqdt_tke, lprnt, ipr, & ldu3dt_ogw, ldv3dt_ogw, ldt3dt_ogw, ldu3dt_cgw, ldv3dt_cgw, ldt3dt_cgw, & @@ -265,9 +265,9 @@ subroutine unified_ugwp_run(me, master, im, levs, ntrac, dtp, fhzero, kdt, logical, intent(in) :: ldiag3d, lssav ! These arrays only allocated if ldiag_ugwp = .true. - real(kind=kind_phys), intent(out), dimension(:,:) :: du3dt_mtb, du3dt_ogw, du3dt_tms + real(kind=kind_phys), intent(inout), dimension(:,:) :: du3dt_mtb, du3dt_ogw, du3dt_tms - real(kind=kind_phys), intent(inout), dimension(:,:):: dudt, dvdt, dtdt + real(kind=kind_phys), intent(inout), dimension(:,:) :: dudt, dvdt, dtdt real(kind=kind_phys), intent(in) :: con_g, con_omega, con_pi, con_cp, con_rd, & con_rv, con_rerth, con_fvirt diff --git a/physics/ysuvdif.F90 b/physics/ysuvdif.F90 index 134cb72eaf..e427eb0eb1 100644 --- a/physics/ysuvdif.F90 +++ b/physics/ysuvdif.F90 @@ -86,16 +86,18 @@ subroutine ysuvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & ! real(kind=kind_phys), dimension( :,: ) , & intent(inout) :: utnp,vtnp,ttnp - real(kind=kind_phys), dimension( :,:,: ) , & + real(kind=kind_phys), dimension( :,:,: ) , & intent(inout) :: qtnp - real(kind=kind_phys), dimension(:,:) , & + real(kind=kind_phys), dimension(:,:) , & intent(inout) :: du3dt_PBL, dv3dt_PBL, dt3dt_PBL, dq3dt_PBL, do3dt_PBL ! !--------------------------------------------------------------------------------- ! output variables integer, dimension( : ), intent(out ) :: kpbl1d - real(kind=kind_phys), dimension( : ), & + real(kind=kind_phys), dimension( : ), & intent(out) :: hpbl + real(kind=kind_phys), dimension( : ), & + intent(out) :: dusfc,dvsfc, dtsfc,dqsfc ! error messages character(len=*), intent(out) :: errmsg @@ -108,7 +110,7 @@ subroutine ysuvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & real(kind=kind_phys), dimension( im ) :: hol real(kind=kind_phys), dimension( im, km+1 ) :: zq ! - real(kind=kind_phys), dimension( im, km ) :: & + real(kind=kind_phys), dimension( im, km ) :: & thx,thvx,thlix, & del, & dza, & @@ -117,7 +119,7 @@ subroutine ysuvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & xkzoh, & za ! - real(kind=kind_phys), dimension( im ) :: & + real(kind=kind_phys), dimension( im ) :: & rhox, & govrth, & zl1,thermal, & @@ -125,8 +127,6 @@ subroutine ysuvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & hgamt,hgamq, & brdn,brup, & phim,phih, & - dusfc,dvsfc, & - dtsfc,dqsfc, & prpbl, & wspd1,thermalli ! diff --git a/physics/ysuvdif.meta b/physics/ysuvdif.meta index 9ba31ed27f..bf684dcbe0 100644 --- a/physics/ysuvdif.meta +++ b/physics/ysuvdif.meta @@ -86,18 +86,18 @@ kind = kind_phys intent = in optional = F -[vtnp] - standard_name = tendency_of_y_wind_due_to_model_physics - long_name = updated tendency of the y wind +[utnp] + standard_name = tendency_of_x_wind_due_to_model_physics + long_name = updated tendency of the x wind units = m s-2 dimensions = (horizontal_loop_extent,vertical_dimension) type = real kind = kind_phys intent = inout optional = F -[utnp] - standard_name = tendency_of_x_wind_due_to_model_physics - long_name = updated tendency of the x wind +[vtnp] + standard_name = tendency_of_y_wind_due_to_model_physics + long_name = updated tendency of the y wind units = m s-2 dimensions = (horizontal_loop_extent,vertical_dimension) type = real From 7fa34d54be0b4ed0d185c259b21019cc65c3f575 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Mon, 19 Apr 2021 14:09:19 -0600 Subject: [PATCH 16/25] physics/mp_thompson.F90: move 'max' checks where they belong --- physics/mp_thompson.F90 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/physics/mp_thompson.F90 b/physics/mp_thompson.F90 index 23533fbd69..6349204080 100644 --- a/physics/mp_thompson.F90 +++ b/physics/mp_thompson.F90 @@ -610,11 +610,11 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, & !> - Convert rainfall deltas from mm to m (on physics timestep); add to inout variables ! "rain" in Thompson MP refers to precipitation (total of liquid rainfall+snow+graupel+ice) - prcp = max(0.0, prcp + delta_rain_mp/1000.0_kind_phys) - graupel = max(0.0, graupel + delta_graupel_mp/1000.0_kind_phys) - ice = max(0.0, ice + delta_ice_mp/1000.0_kind_phys) - snow = max(0.0, snow + delta_snow_mp/1000.0_kind_phys) - rain = max(0.0, rain + (delta_rain_mp - (delta_graupel_mp + delta_ice_mp + delta_snow_mp))/1000.0_kind_phys) + prcp = prcp + max(0.0, delta_rain_mp/1000.0_kind_phys) + graupel = graupel + max(0.0, delta_graupel_mp/1000.0_kind_phys) + ice = ice + max(0.0, delta_ice_mp/1000.0_kind_phys) + snow = snow + max(0.0, delta_snow_mp/1000.0_kind_phys) + rain = rain + max(0.0, (delta_rain_mp - (delta_graupel_mp + delta_ice_mp + delta_snow_mp))/1000.0_kind_phys) end subroutine mp_thompson_run !>@} From c9bdbb8d8481df8ebe9f47dd9135eb9b115817e1 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Mon, 19 Apr 2021 14:20:35 -0600 Subject: [PATCH 17/25] Revert assumed-size array changes in physics/gfdl_fv_sat_adj.F90, fix order of arguments in physics/sfc_nst.meta --- physics/gfdl_fv_sat_adj.F90 | 69 ++++++++++++++++++------------------- physics/gfdl_sfc_layer.meta | 6 ++-- physics/sfc_nst.meta | 16 ++++----- 3 files changed, 45 insertions(+), 46 deletions(-) diff --git a/physics/gfdl_fv_sat_adj.F90 b/physics/gfdl_fv_sat_adj.F90 index 6140fa680c..816488f7a0 100644 --- a/physics/gfdl_fv_sat_adj.F90 +++ b/physics/gfdl_fv_sat_adj.F90 @@ -128,8 +128,8 @@ subroutine fv_sat_adj_init(do_sat_adj, kmp, nwat, ngas, rilist, cpilist, & integer, intent(in ) :: kmp integer, intent(in ) :: nwat integer, intent(in ) :: ngas - real(kind_dyn), intent(in ) :: rilist(:) - real(kind_dyn), intent(in ) :: cpilist(:) + real(kind_dyn), intent(in ) :: rilist(0:ngas) + real(kind_dyn), intent(in ) :: cpilist(0:ngas) integer, intent(in ) :: mpirank integer, intent(in ) :: mpiroot character(len=*), intent( out) :: errmsg @@ -255,46 +255,46 @@ subroutine fv_sat_adj_run(mdt, zvir, is, ie, isd, ied, kmp, km, kmdelz, js, je, integer, intent(in) :: ng logical, intent(in) :: hydrostatic logical, intent(in) :: fast_mp_consv - real(kind=kind_dyn), intent(inout) :: te0_2d(:,:) - real(kind=kind_dyn), intent( out) :: te0(:,:,:) + real(kind=kind_dyn), intent(inout) :: te0_2d(is:ie, js:je) + real(kind=kind_dyn), intent( out) :: te0(isd:ied, jsd:jed, 1:km) ! If multi-gases physics are not used, ngas is one and qvi identical to qv integer, intent(in) :: ngas - real(kind=kind_dyn), intent(inout) :: qvi(:,:,:,:) - real(kind=kind_dyn), intent(inout) :: qv(:,:,:) - real(kind=kind_dyn), intent(inout) :: ql(:,:,:) - real(kind=kind_dyn), intent(inout) :: qi(:,:,:) - real(kind=kind_dyn), intent(inout) :: qr(:,:,:) - real(kind=kind_dyn), intent(inout) :: qs(:,:,:) - real(kind=kind_dyn), intent(inout) :: qg(:,:,:) - real(kind=kind_dyn), intent(in) :: hs(:,:) - real(kind=kind_dyn), intent(in) :: peln(:,:,:) - ! For hydrostatic build, delz's third dimension is 1:kmdelz=1:1, otherwise 1:km (see fv_arrays.F90) - real(kind=kind_dyn), intent(in) :: delz(:,:,:) - real(kind=kind_dyn), intent(in) :: delp(:,:,:) - real(kind=kind_dyn), intent(inout) :: pt(:,:,:) - real(kind=kind_dyn), intent(inout) :: pkz(:,:,:) + real(kind=kind_dyn), intent(inout) :: qvi(isd:ied, jsd:jed, 1:km, 1:ngas) + real(kind=kind_dyn), intent(inout) :: qv(isd:ied, jsd:jed, 1:km) + real(kind=kind_dyn), intent(inout) :: ql(isd:ied, jsd:jed, 1:km) + real(kind=kind_dyn), intent(inout) :: qi(isd:ied, jsd:jed, 1:km) + real(kind=kind_dyn), intent(inout) :: qr(isd:ied, jsd:jed, 1:km) + real(kind=kind_dyn), intent(inout) :: qs(isd:ied, jsd:jed, 1:km) + real(kind=kind_dyn), intent(inout) :: qg(isd:ied, jsd:jed, 1:km) + real(kind=kind_dyn), intent(in) :: hs(isd:ied, jsd:jed) + real(kind=kind_dyn), intent(in) :: peln(is:ie, 1:km+1, js:je) + ! For hydrostatic build, kmdelz=1, otherwise kmdelz=km (see fv_arrays.F90) + real(kind=kind_dyn), intent(in) :: delz(is:ie, js:je, 1:kmdelz) + real(kind=kind_dyn), intent(in) :: delp(isd:ied, jsd:jed, 1:km) + real(kind=kind_dyn), intent(inout) :: pt(isd:ied, jsd:jed, 1:km) + real(kind=kind_dyn), intent(inout) :: pkz(is:ie, js:je, 1:km) #ifdef USE_COND - real(kind=kind_dyn), intent(inout) :: q_con(:,:,:) + real(kind=kind_dyn), intent(inout) :: q_con(isd:ied, jsd:jed, 1:km) #else - real(kind=kind_dyn), intent(inout) :: q_con(:,:,:) + real(kind=kind_dyn), intent(inout) :: q_con(isd:isd, jsd:jsd, 1) #endif real(kind=kind_dyn), intent(in) :: akap #ifdef MOIST_CAPPA - real(kind=kind_dyn), intent(inout) :: cappa(:,:,:) + real(kind=kind_dyn), intent(inout) :: cappa(isd:ied, jsd:jed, 1:km) #else - real(kind=kind_dyn), intent(inout) :: cappa(:,:,:) + real(kind=kind_dyn), intent(inout) :: cappa(isd:ied, jsd:jed, 1) #endif ! DH* WARNING, allocation in fv_arrays.F90 is area(isd_2d:ied_2d, jsd_2d:jed_2d), ! where normally isd_2d = isd etc, but for memory optimization, these can be set ! to isd_2d=0, ied_2d=-1 etc. I don't believe this optimization is actually used, ! as it would break a whole lot of code (including the one below)! ! Assume thus that isd_2d = isd etc. - real(kind_grid), intent(in) :: area(:,:) - real(kind=kind_dyn), intent(inout) :: dtdt(:,:,:) + real(kind_grid), intent(in) :: area(isd:ied, jsd:jed) + real(kind=kind_dyn), intent(inout) :: dtdt(is:ie, js:je, 1:km) logical, intent(in) :: out_dt logical, intent(in) :: last_step logical, intent(in) :: do_qa - real(kind=kind_dyn), intent( out) :: qa(:,:,:) + real(kind=kind_dyn), intent( out) :: qa(isd:ied, jsd:jed, 1:km) integer, intent(in) :: nthreads character(len=*), intent( out) :: errmsg integer, intent( out) :: errflg @@ -333,19 +333,18 @@ subroutine fv_sat_adj_run(mdt, zvir, is, ie, isd, ied, kmp, km, kmdelz, js, je, else kdelz = k end if - call fv_sat_adj_work(abs(mdt), zvir, is, ie, js, je, ng, hydrostatic, fast_mp_consv, & - te0(isd:ied,jsd:jed,k), & + call fv_sat_adj_work(abs(mdt), zvir, is, ie, js, je, ng, hydrostatic, fast_mp_consv, & + te0(isd,jsd,k), & #ifdef MULTI_GASES - qvi(isd:ied,jsd:jed,k,1:ngas), & + qvi(isd,jsd,k,1:ngas), & #else - qv(isd:ied,jsd:jed,k), & + qv(isd,jsd,k), & #endif - ql(isd:ied,jsd:jed,k), qi(isd:ied,jsd:jed,k), & - qr(isd:ied,jsd:jed,k), qs(isd:ied,jsd:jed,k), qg(isd:ied,jsd:jed,k), & - hs, dpln, delz(is:ie,js:je,kdelz), pt(isd:ied,jsd:jed,k), & - delp(isd:ied,jsd:jed,k), q_con(isd:ied,jsd:jed,k), & - cappa(isd:ied,jsd:jed,k), area, dtdt(is:ie,js:je,k), & - out_dt, last_step, do_qa, qa(isd:ied,jsd:jed,k)) + ql(isd,jsd,k), qi(isd,jsd,k), & + qr(isd,jsd,k), qs(isd,jsd,k), qg(isd,jsd,k), & + hs, dpln, delz(is:,js:,kdelz), pt(isd,jsd,k), delp(isd,jsd,k),& + q_con(isd:,jsd:,k), cappa(isd:,jsd:,k), area, dtdt(is,js,k), & + out_dt, last_step, do_qa, qa(isd,jsd,k)) if ( .not. hydrostatic ) then do j=js,je do i=is,ie diff --git a/physics/gfdl_sfc_layer.meta b/physics/gfdl_sfc_layer.meta index a1978e820f..c8cbaf294b 100644 --- a/physics/gfdl_sfc_layer.meta +++ b/physics/gfdl_sfc_layer.meta @@ -783,7 +783,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout optional = F [qss_lnd] standard_name = surface_specific_humidity_over_land @@ -792,7 +792,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout optional = F [qss_ice] standard_name = surface_specific_humidity_over_ice @@ -801,7 +801,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout optional = F [errmsg] standard_name = ccpp_error_message diff --git a/physics/sfc_nst.meta b/physics/sfc_nst.meta index f4fc1cb4f7..c127ffb3d0 100644 --- a/physics/sfc_nst.meta +++ b/physics/sfc_nst.meta @@ -105,19 +105,19 @@ kind = kind_phys intent = in optional = F -[sbc] - standard_name = stefan_boltzmann_constant - long_name = Stefan-Boltzmann constant - units = W m-2 K-4 +[tgice] + standard_name = freezing_point_temperature_of_seawater + long_name = freezing point temperature of seawater + units = K dimensions = () type = real kind = kind_phys intent = in optional = F -[tgice] - standard_name = freezing_point_temperature_of_seawater - long_name = freezing point temperature of seawater - units = K +[sbc] + standard_name = stefan_boltzmann_constant + long_name = Stefan-Boltzmann constant + units = W m-2 K-4 dimensions = () type = real kind = kind_phys From d194af6472ac2be8d7007b73ce69c81412c406e6 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Thu, 22 Apr 2021 15:16:38 -0600 Subject: [PATCH 18/25] Bugfix in physics/mp_thompson.F90: need to call mp_gt_driver with or without effective radii --- physics/mp_thompson.F90 | 116 +++++++++++++++++++++++++++------------- 1 file changed, 78 insertions(+), 38 deletions(-) diff --git a/physics/mp_thompson.F90 b/physics/mp_thompson.F90 index 6349204080..1ad4b2d4ba 100644 --- a/physics/mp_thompson.F90 +++ b/physics/mp_thompson.F90 @@ -547,45 +547,85 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, & !> - Call mp_gt_driver() with or without aerosols if (is_aerosol_aware) then - call mp_gt_driver(qv=qv, qc=qc, qr=qr, qi=qi, qs=qs, qg=qg, ni=ni, nr=nr, & - nc=nc, nwfa=nwfa, nifa=nifa, nwfa2d=nwfa2d, nifa2d=nifa2d, & - tt=tgrs, p=prsl, w=w, dz=dz, dt_in=dtp, & - rainnc=rain_mp, rainncv=delta_rain_mp, & - snownc=snow_mp, snowncv=delta_snow_mp, & - icenc=ice_mp, icencv=delta_ice_mp, & - graupelnc=graupel_mp, graupelncv=delta_graupel_mp, sr=sr, & - refl_10cm=refl_10cm, & - diagflag=diagflag, do_radar_ref=do_radar_ref_mp, & - re_cloud=re_cloud, re_ice=re_ice, re_snow=re_snow, & - has_reqc=has_reqc, has_reqi=has_reqi, has_reqs=has_reqs, & - rand_perturb_on=rand_perturb_on, kme_stoch=kme_stoch, & - ! DH* 2020-06-05 not passing this optional argument, see - ! comment in module_mp_thompson.F90 / mp_gt_driver - !rand_pert=rand_pert, & - ids=ids, ide=ide, jds=jds, jde=jde, kds=kds, kde=kde, & - ims=ims, ime=ime, jms=jms, jme=jme, kms=kms, kme=kme, & - its=its, ite=ite, jts=jts, jte=jte, kts=kts, kte=kte, & - errmsg=errmsg, errflg=errflg, reset=reset) - + if (do_effective_radii) then + call mp_gt_driver(qv=qv, qc=qc, qr=qr, qi=qi, qs=qs, qg=qg, ni=ni, nr=nr, & + nc=nc, nwfa=nwfa, nifa=nifa, nwfa2d=nwfa2d, nifa2d=nifa2d, & + tt=tgrs, p=prsl, w=w, dz=dz, dt_in=dtp, & + rainnc=rain_mp, rainncv=delta_rain_mp, & + snownc=snow_mp, snowncv=delta_snow_mp, & + icenc=ice_mp, icencv=delta_ice_mp, & + graupelnc=graupel_mp, graupelncv=delta_graupel_mp, sr=sr, & + refl_10cm=refl_10cm, & + diagflag=diagflag, do_radar_ref=do_radar_ref_mp, & + re_cloud=re_cloud, re_ice=re_ice, re_snow=re_snow, & + has_reqc=has_reqc, has_reqi=has_reqi, has_reqs=has_reqs, & + rand_perturb_on=rand_perturb_on, kme_stoch=kme_stoch, & + ! DH* 2020-06-05 not passing this optional argument, see + ! comment in module_mp_thompson.F90 / mp_gt_driver + !rand_pert=rand_pert, & + ids=ids, ide=ide, jds=jds, jde=jde, kds=kds, kde=kde, & + ims=ims, ime=ime, jms=jms, jme=jme, kms=kms, kme=kme, & + its=its, ite=ite, jts=jts, jte=jte, kts=kts, kte=kte, & + errmsg=errmsg, errflg=errflg, reset=reset) + else + call mp_gt_driver(qv=qv, qc=qc, qr=qr, qi=qi, qs=qs, qg=qg, ni=ni, nr=nr, & + nc=nc, nwfa=nwfa, nifa=nifa, nwfa2d=nwfa2d, nifa2d=nifa2d, & + tt=tgrs, p=prsl, w=w, dz=dz, dt_in=dtp, & + rainnc=rain_mp, rainncv=delta_rain_mp, & + snownc=snow_mp, snowncv=delta_snow_mp, & + icenc=ice_mp, icencv=delta_ice_mp, & + graupelnc=graupel_mp, graupelncv=delta_graupel_mp, sr=sr, & + refl_10cm=refl_10cm, & + diagflag=diagflag, do_radar_ref=do_radar_ref_mp, & + has_reqc=has_reqc, has_reqi=has_reqi, has_reqs=has_reqs, & + rand_perturb_on=rand_perturb_on, kme_stoch=kme_stoch, & + ! DH* 2020-06-05 not passing this optional argument, see + ! comment in module_mp_thompson.F90 / mp_gt_driver + !rand_pert=rand_pert, & + ids=ids, ide=ide, jds=jds, jde=jde, kds=kds, kde=kde, & + ims=ims, ime=ime, jms=jms, jme=jme, kms=kms, kme=kme, & + its=its, ite=ite, jts=jts, jte=jte, kts=kts, kte=kte, & + errmsg=errmsg, errflg=errflg, reset=reset) + end if else - call mp_gt_driver(qv=qv, qc=qc, qr=qr, qi=qi, qs=qs, qg=qg, ni=ni, nr=nr, & - tt=tgrs, p=prsl, w=w, dz=dz, dt_in=dtp, & - rainnc=rain_mp, rainncv=delta_rain_mp, & - snownc=snow_mp, snowncv=delta_snow_mp, & - icenc=ice_mp, icencv=delta_ice_mp, & - graupelnc=graupel_mp, graupelncv=delta_graupel_mp, sr=sr, & - refl_10cm=refl_10cm, & - diagflag=diagflag, do_radar_ref=do_radar_ref_mp, & - re_cloud=re_cloud, re_ice=re_ice, re_snow=re_snow, & - has_reqc=has_reqc, has_reqi=has_reqi, has_reqs=has_reqs, & - rand_perturb_on=rand_perturb_on, kme_stoch=kme_stoch, & - ! DH* 2020-06-05 not passing this optional argument, see - ! comment in module_mp_thompson.F90 / mp_gt_driver - !rand_pert=rand_pert, & - ids=ids, ide=ide, jds=jds, jde=jde, kds=kds, kde=kde, & - ims=ims, ime=ime, jms=jms, jme=jme, kms=kms, kme=kme, & - its=its, ite=ite, jts=jts, jte=jte, kts=kts, kte=kte, & - errmsg=errmsg, errflg=errflg, reset=reset) + if (do_effective_radii) then + call mp_gt_driver(qv=qv, qc=qc, qr=qr, qi=qi, qs=qs, qg=qg, ni=ni, nr=nr, & + tt=tgrs, p=prsl, w=w, dz=dz, dt_in=dtp, & + rainnc=rain_mp, rainncv=delta_rain_mp, & + snownc=snow_mp, snowncv=delta_snow_mp, & + icenc=ice_mp, icencv=delta_ice_mp, & + graupelnc=graupel_mp, graupelncv=delta_graupel_mp, sr=sr, & + refl_10cm=refl_10cm, & + diagflag=diagflag, do_radar_ref=do_radar_ref_mp, & + re_cloud=re_cloud, re_ice=re_ice, re_snow=re_snow, & + has_reqc=has_reqc, has_reqi=has_reqi, has_reqs=has_reqs, & + rand_perturb_on=rand_perturb_on, kme_stoch=kme_stoch, & + ! DH* 2020-06-05 not passing this optional argument, see + ! comment in module_mp_thompson.F90 / mp_gt_driver + !rand_pert=rand_pert, & + ids=ids, ide=ide, jds=jds, jde=jde, kds=kds, kde=kde, & + ims=ims, ime=ime, jms=jms, jme=jme, kms=kms, kme=kme, & + its=its, ite=ite, jts=jts, jte=jte, kts=kts, kte=kte, & + errmsg=errmsg, errflg=errflg, reset=reset) + else + call mp_gt_driver(qv=qv, qc=qc, qr=qr, qi=qi, qs=qs, qg=qg, ni=ni, nr=nr, & + tt=tgrs, p=prsl, w=w, dz=dz, dt_in=dtp, & + rainnc=rain_mp, rainncv=delta_rain_mp, & + snownc=snow_mp, snowncv=delta_snow_mp, & + icenc=ice_mp, icencv=delta_ice_mp, & + graupelnc=graupel_mp, graupelncv=delta_graupel_mp, sr=sr, & + refl_10cm=refl_10cm, & + diagflag=diagflag, do_radar_ref=do_radar_ref_mp, & + has_reqc=has_reqc, has_reqi=has_reqi, has_reqs=has_reqs, & + rand_perturb_on=rand_perturb_on, kme_stoch=kme_stoch, & + ! DH* 2020-06-05 not passing this optional argument, see + ! comment in module_mp_thompson.F90 / mp_gt_driver + !rand_pert=rand_pert, & + ids=ids, ide=ide, jds=jds, jde=jde, kds=kds, kde=kde, & + ims=ims, ime=ime, jms=jms, jme=jme, kms=kms, kme=kme, & + its=its, ite=ite, jts=jts, jte=jte, kts=kts, kte=kte, & + errmsg=errmsg, errflg=errflg, reset=reset) + end if end if if (errflg/=0) return From b35cf894b4573f91afd85ba0c48c1a662b6f26f0 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Thu, 22 Apr 2021 16:57:12 -0600 Subject: [PATCH 19/25] Fix formattting in physics/mp_thompson_post.F90 --- physics/mp_thompson_post.F90 | 10 +++++----- physics/ozne_def.meta | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/physics/mp_thompson_post.F90 b/physics/mp_thompson_post.F90 index 36e309387d..c53f61b0cc 100644 --- a/physics/mp_thompson_post.F90 +++ b/physics/mp_thompson_post.F90 @@ -57,14 +57,14 @@ subroutine mp_thompson_post_run(ncol, nlev, tgrs_save, tgrs, prslk, dtp, ttendli implicit none ! Interface variables - integer, intent(in) :: ncol - integer, intent(in) :: nlev + integer, intent(in) :: ncol + integer, intent(in) :: nlev real(kind_phys), dimension(:,:), intent(in) :: tgrs_save real(kind_phys), dimension(:,:), intent(inout) :: tgrs real(kind_phys), dimension(:,:), intent(in) :: prslk - real(kind_phys), intent(in) :: dtp - real(kind_phys), intent(in) :: ttendlim - integer, intent(in) :: kdt + real(kind_phys), intent(in) :: dtp + real(kind_phys), intent(in) :: ttendlim + integer, intent(in) :: kdt ! MPI information integer, intent(in ) :: mpicomm integer, intent(in ) :: mpirank diff --git a/physics/ozne_def.meta b/physics/ozne_def.meta index 0daf424103..27698eec62 100644 --- a/physics/ozne_def.meta +++ b/physics/ozne_def.meta @@ -26,3 +26,4 @@ dimensions = (vertical_dimension_of_ozone_forcing_data) type = real kind = kind_phys + active = (index_for_ozone>0) From d2a16dc8226a5d86e3d257166d4562228624369b Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Wed, 28 Apr 2021 09:59:37 -0600 Subject: [PATCH 20/25] Initialize intent(out) atmosphere_heat_diffusivity / atmosphere_momentum_diffusivity --- physics/module_MYJPBL_wrapper.F90 | 12 ++++-------- physics/moninedmf.f | 6 +++++- physics/moninshoc.f | 5 ++++- physics/satmedmfvdifq.F | 6 +++++- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/physics/module_MYJPBL_wrapper.F90 b/physics/module_MYJPBL_wrapper.F90 index 0863098973..9e509a29dd 100644 --- a/physics/module_MYJPBL_wrapper.F90 +++ b/physics/module_MYJPBL_wrapper.F90 @@ -157,7 +157,6 @@ SUBROUTINE myjpbl_wrapper_run( & & ,rho,qfc1,gdx,xkzm_hx,xkzm_mx,tx1, tx2 ! real(kind=kind_phys), dimension(im,levs,ntrac) :: & ! & qgrs_myj - real(kind=kind_phys),dimension(im,levs) :: dkt2 ! Initialize CCPP error handling variables errmsg = '' @@ -553,12 +552,12 @@ SUBROUTINE myjpbl_wrapper_run( & ! end do end do - dkt2=0. + dkt=0. do k=1,levs k1=levs-k+1 do i=1,im -! dkt2(i,k)=max(xcofh(i,k1),xkzo(i,k)) - dkt2(i,k)=xcofh(i,k1) +! dkt(i,k)=max(xcofh(i,k1),xkzo(i,k)) + dkt(i,k)=xcofh(i,k1) end do end do if(ntke.gt.0)then @@ -662,7 +661,7 @@ SUBROUTINE myjpbl_wrapper_run( & q2(i,k) end do do k=1,levs - print*,'xcofh,el_myj,dkt2=',k,xcofh(i,k),el_myj(i,k),dkt2(i,k) + print*,'xcofh,el_myj,dkt=',k,xcofh(i,k),el_myj(i,k),dkt(i,k) end do end if @@ -805,9 +804,6 @@ SUBROUTINE myjpbl_wrapper_run( & ! print* ! endif - ! External dkt has dimensions (1:im,1:levs-1) - dkt(1:im,1:levs-1) = dkt2(1:im,1:levs-1) - END SUBROUTINE myjpbl_wrapper_run !###================================================================= diff --git a/physics/moninedmf.f b/physics/moninedmf.f index 09f25ef557..2abd2226cb 100644 --- a/physics/moninedmf.f +++ b/physics/moninedmf.f @@ -381,10 +381,14 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & enddo enddo !> - Initialize diffusion coefficients to 0 and calculate the total radiative heating rate (dku, dkt, radx) - do k = 1,km1 + do k = 1,km do i = 1,im dku(i,k) = 0. dkt(i,k) = 0. + enddo + enddo + do k = 1,km1 + do i = 1,im dktx(i,k) = 0. cku(i,k) = 0. ckt(i,k) = 0. diff --git a/physics/moninshoc.f b/physics/moninshoc.f index eb80c5b93a..66022f657a 100644 --- a/physics/moninshoc.f +++ b/physics/moninshoc.f @@ -70,7 +70,7 @@ subroutine moninshoc_run (im,km,ntrac,ntcw,ncnd,dv,du,tau,rtg, real(kind=kind_phys), dimension(:), intent(out) :: dusfc, & dvsfc, dtsfc, dqsfc, hpbl real(kind=kind_phys), dimension(:,:), intent(out) :: prnum - real(kind=kind_phys), dimension(:,:), intent(out) :: dkt + real(kind=kind_phys), dimension(:,:), intent(out) :: dkt character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -120,6 +120,9 @@ subroutine moninshoc_run (im,km,ntrac,ntcw,ncnd,dv,du,tau,rtg, errmsg = '' errflg = 0 ! +! Set intent(out) variables + dkt = zero +! !----------------------------------------------------------------------- ! ! compute preliminary variables diff --git a/physics/satmedmfvdifq.F b/physics/satmedmfvdifq.F index b575315cde..106c893771 100644 --- a/physics/satmedmfvdifq.F +++ b/physics/satmedmfvdifq.F @@ -497,10 +497,14 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntiw,ntke, & ! !> - Initialize diffusion coefficients to 0 and calculate the total !! radiative heating rate (dku, dkt, radx) - do k=1,km1 + do k=1,km do i=1,im dku(i,k) = 0. dkt(i,k) = 0. + enddo + enddo + do k=1,km1 + do i=1,im dkq(i,k) = 0. cku(i,k) = 0. ckt(i,k) = 0. From 033e6b1f7b3735df7686a511ccea43a1b7ef216a Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Wed, 28 Apr 2021 13:41:46 -0600 Subject: [PATCH 21/25] Fix bug in physics/GFS_MP_generic.F90 from recent merge --- physics/GFS_MP_generic.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/GFS_MP_generic.F90 b/physics/GFS_MP_generic.F90 index ce828254f9..04450b6126 100644 --- a/physics/GFS_MP_generic.F90 +++ b/physics/GFS_MP_generic.F90 @@ -135,7 +135,7 @@ subroutine GFS_MP_generic_post_run(im, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac, real(kind=kind_phys), dimension(:), intent(inout) :: dsnowprv real(kind=kind_phys), dimension(:), intent(inout) :: dgraupelprv - real(kind=kind_phys), intent(in) :: dt + real(kind=kind_phys), intent(in) :: dtp ! CCPP error handling character(len=*), intent(out) :: errmsg From 6a9de17151f695f1127d93a47e0b3d47db733000 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Wed, 28 Apr 2021 14:04:47 -0600 Subject: [PATCH 22/25] Fix bug in scm_sfc_flux_spec.F90 from recent merge --- physics/scm_sfc_flux_spec.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/physics/scm_sfc_flux_spec.F90 b/physics/scm_sfc_flux_spec.F90 index f5267e9c1b..398bff5d6d 100644 --- a/physics/scm_sfc_flux_spec.F90 +++ b/physics/scm_sfc_flux_spec.F90 @@ -16,10 +16,10 @@ module scm_sfc_flux_spec !******************************************************************************************* !! -!! \section arg_table_gmtb_scm_sfc_flux_spec_init Argument Table -!! \htmlinclude gmtb_scm_sfc_flux_spec_init.html +!! \section arg_table_scm_sfc_flux_spec_init Argument Table +!! \htmlinclude scm_sfc_flux_spec_init.html !! - subroutine gmtb_scm_sfc_flux_spec_init(lheatstrg, errmsg, errflg) + subroutine scm_sfc_flux_spec_init(lheatstrg, errmsg, errflg) logical, intent(in) :: lheatstrg From 1cc81113f75da05660ee2e23258233ad4f25d411 Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Thu, 29 Apr 2021 13:15:23 -0600 Subject: [PATCH 23/25] update GFS_phys_time_vary.scm.F90 to match FV3 changes --- physics/GFS_phys_time_vary.scm.F90 | 72 +++++++++++++++++++---------- physics/GFS_phys_time_vary.scm.meta | 8 ++++ 2 files changed, 55 insertions(+), 25 deletions(-) diff --git a/physics/GFS_phys_time_vary.scm.F90 b/physics/GFS_phys_time_vary.scm.F90 index fb46de2bd1..9fa4e2de33 100644 --- a/physics/GFS_phys_time_vary.scm.F90 +++ b/physics/GFS_phys_time_vary.scm.F90 @@ -18,7 +18,7 @@ module GFS_phys_time_vary use h2ointerp, only : read_h2odata, setindxh2o, h2ointerpol use aerclm_def, only : aerin, aer_pres, ntrcaer, ntrcaerm - use aerinterp, only : read_aerdata, setindxaer, aerinterpol + use aerinterp, only : read_aerdata, setindxaer, aerinterpol, read_aerdataf use iccn_def, only : ciplin, ccnin, ci_pres use iccninterp, only : read_cidata, setindxci, ciinterpol @@ -160,7 +160,7 @@ subroutine GFS_phys_time_vary_init ( integer, intent(out) :: errflg ! Local variables - integer :: i, j, ix, vegtyp + integer :: i, j, ix, vegtyp, iamin, iamax, jamin, jamax real(kind_phys) :: rsnow !--- Noah MP @@ -176,7 +176,11 @@ subroutine GFS_phys_time_vary_init ( errflg = 0 if (is_initialized) return - + iamin=999 + iamax=-999 + jamin=999 + jamax=-999 + !> - Call read_o3data() to read ozone data call read_o3data (ntoz, me, master) @@ -270,6 +274,10 @@ subroutine GFS_phys_time_vary_init ( jindx2_aer, ddy_aer, xlon_d, & iindx1_aer, iindx2_aer, ddx_aer, & me, master) + iamin=min(minval(iindx1_aer), iamin) + iamax=max(maxval(iindx2_aer), iamax) + jamin=min(minval(jindx1_aer), jamin) + jamax=max(maxval(jindx2_aer), jamax) endif !> - Call setindxci() to initialize IN and CCN data @@ -322,6 +330,14 @@ subroutine GFS_phys_time_vary_init ( sncovr_ice(:) = sncovr(:) endif endif + + if (errflg/=0) return + + if (iaerclm) then + call read_aerdataf (iamin, iamax, jamin, jamax, me, master, iflip, & + idate, errmsg, errflg) + if (errflg/=0) return + end if if (lsm == lsm_noahmp) then if (all(tvxy <= zero)) then @@ -371,16 +387,20 @@ subroutine GFS_phys_time_vary_init ( tsnoxy (:,:) = missing_value smoiseq(:,:) = missing_value zsnsoxy(:,:) = missing_value - + + imn = idate(2) + do ix=1,im if (landfrac(ix) >= drythresh) then tvxy(ix) = tsfcl(ix) tgxy(ix) = tsfcl(ix) tahxy(ix) = tsfcl(ix) - if (snowd(ix) > 0.01_kind_phys .and. tsfcl(ix) > con_t0c ) tvxy(ix) = con_t0c - if (snowd(ix) > 0.01_kind_phys .and. tsfcl(ix) > con_t0c ) tgxy(ix) = con_t0c - if (snowd(ix) > 0.01_kind_phys .and. tsfcl(ix) > con_t0c ) tahxy(ix) = con_t0c + if (snowd(ix) > 0.01_kind_phys .and. tsfcl(ix) > con_t0c ) then + tvxy(ix) = con_t0c + tgxy(ix) = con_t0c + tahxy(ix) = con_t0c + end if canicexy(ix) = 0.0_kind_phys canliqxy(ix) = canopy(ix) @@ -404,14 +424,12 @@ subroutine GFS_phys_time_vary_init ( albinir(ix) = 0.2_kind_phys emiss(ix) = 0.95_kind_phys - waxy(ix) = 4900.0_kind_phys wtxy(ix) = waxy(ix) zwtxy(ix) = (25.0_kind_phys + 2.0_kind_phys) - waxy(ix) / 1000.0_kind_phys / 0.2_kind_phys vegtyp = vtype(ix) if (vegtyp == 0) vegtyp = 7 - imn = idate(2) if ((vegtyp == isbarren_table) .or. (vegtyp == isice_table) .or. (vegtyp == isurban_table) .or. (vegtyp == iswater_table)) then @@ -491,9 +509,8 @@ subroutine GFS_phys_time_vary_init ( dzsno(-1) = 0.20_kind_phys dzsno(0) = snd - 0.05_kind_phys - 0.20_kind_phys else - errmsg = 'Error in GFS_phys_time_vary.fv3.F90: Problem with the logic assigning snow layers in Noah MP initialization' + errmsg = 'Error in GFS_phys_time_vary.scm.F90: Problem with the logic assigning snow layers in Noah MP initialization' errflg = 1 - return endif ! Now we have the snowxy field @@ -570,6 +587,8 @@ subroutine GFS_phys_time_vary_init ( enddo ! ix + if (errflg/=0) return + deallocate(dzsno) deallocate(dzsnso) @@ -619,7 +638,7 @@ subroutine GFS_phys_time_vary_timestep_init ( jindx1_aer, jindx2_aer, ddy_aer, iindx1_aer, iindx2_aer, ddx_aer, aer_nm, & jindx1_ci, jindx2_ci, ddy_ci, iindx1_ci, iindx2_ci, ddx_ci, in_nm, ccn_nm, & imap, jmap, prsl, seed0, rann, do_ugwp_v1, jindx1_tau, jindx2_tau, ddy_j1tau, ddy_j2tau,& - tau_amf, errmsg, errflg) + tau_amf, nthrds, errmsg, errflg) implicit none @@ -648,6 +667,7 @@ subroutine GFS_phys_time_vary_timestep_init ( integer, intent(in) :: jindx1_tau(:), jindx2_tau(:) real(kind_phys), intent(in) :: ddy_j1tau(:), ddy_j2tau(:) real(kind_phys), intent(inout) :: tau_amf(:) + integer, intent(in) :: nthrds character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -724,21 +744,12 @@ subroutine GFS_phys_time_vary_timestep_init ( h2opl, ddy_h) endif -!> - Call aerinterpol() to make aerosol interpolation - if (iaerclm) then - call aerinterpol (me, master, im, idate, fhour, & - jindx1_aer, jindx2_aer, & - ddy_aer, iindx1_aer, & - iindx2_aer, ddx_aer, & - levs, prsl, aer_nm) - endif - !> - Call ciinterpol() to make IN and CCN data interpolation if (iccn == 1) then - call ciinterpol (me, im, idate, fhour, & - jindx1_ci, jindx2_ci, & - ddy_ci, iindx1_ci, & - iindx2_ci, ddx_ci, & + call ciinterpol (me, im, idate, fhour, & + jindx1_ci, jindx2_ci, & + ddy_ci, iindx1_ci, & + iindx2_ci, ddx_ci, & levs, prsl, in_nm, ccn_nm) endif @@ -749,6 +760,17 @@ subroutine GFS_phys_time_vary_timestep_init ( ddy_j1tau, ddy_j2tau, tau_amf) endif +!> - Call aerinterpol() to make aerosol interpolation + if (iaerclm) then + ! aerinterpol is using threading inside, don't + ! move into OpenMP parallel section above + call aerinterpol (me, master, nthrds, im, idate, & + fhour, jindx1_aer, jindx2_aer,& + ddy_aer, iindx1_aer, & + iindx2_aer, ddx_aer, & + levs, prsl, aer_nm) + endif + ! Not needed for SCM: !> - Call gcycle() to repopulate specific time-varying surface properties for AMIP/forecast runs !if (nscyc > 0) then diff --git a/physics/GFS_phys_time_vary.scm.meta b/physics/GFS_phys_time_vary.scm.meta index 1edaa32c81..74408d533a 100644 --- a/physics/GFS_phys_time_vary.scm.meta +++ b/physics/GFS_phys_time_vary.scm.meta @@ -1462,6 +1462,14 @@ kind = kind_phys intent = inout optional = F +[nthrds] + standard_name = omp_threads + long_name = number of OpenMP threads available for physics schemes + units = count + dimensions = () + type = integer + intent = in + optional = F [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP From 41d34d07c0659e909ab6c177e39eeed325fc2ae0 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Thu, 29 Apr 2021 17:54:20 -0600 Subject: [PATCH 24/25] Bugfix in physics/m_micro.F90: correct calculation of flipped vertical index --- physics/m_micro.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/m_micro.F90 b/physics/m_micro.F90 index 4a6baf2871..7624d7e3e0 100644 --- a/physics/m_micro.F90 +++ b/physics/m_micro.F90 @@ -442,7 +442,7 @@ subroutine m_micro_run( im, lm, flipv, dt_i & END DO END DO DO K=0, LM - ll = lm-k + ll = lm-k+1 DO I = 1,IM PLE(i,k) = prsi_i(i,ll) * 0.01_kp ! interface pressure in hPa zet(i,k+1) = phii(i,ll) * onebg From 1ed27c125a5113fbf15095175701d6850101dba9 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Thu, 29 Apr 2021 18:17:49 -0600 Subject: [PATCH 25/25] Fix metadata --- physics/dcyc2.f | 4 +- physics/dcyc2.meta | 173 ++++++++++++++++++++------------------------- 2 files changed, 80 insertions(+), 97 deletions(-) diff --git a/physics/dcyc2.f b/physics/dcyc2.f index f2ea43e5ba..ad9365851c 100644 --- a/physics/dcyc2.f +++ b/physics/dcyc2.f @@ -172,14 +172,14 @@ end subroutine dcyc2t3_finalize subroutine dcyc2t3_run & ! --- inputs: & ( solhr,slag,sdec,cdec,sinlat,coslat, & - & xlon,coszen,tsfc_lnd,tsfc_ice,tsfc_wat,tf,tsflw, & + & xlon,coszen,tsfc_lnd,tsfc_ice,tsfc_wat,tf,tsflw,tsfc, & & sfcemis_lnd, sfcemis_ice, sfcemis_wat, & & sfcdsw,sfcnsw,sfcdlw,swh,swhc,hlw,hlwc, & & sfcnirbmu,sfcnirdfu,sfcvisbmu,sfcvisdfu, & & sfcnirbmd,sfcnirdfd,sfcvisbmd,sfcvisdfd, & & im, levs, deltim, fhswr, & & dry, icy, wet, & - & minGPpres, tsfc, use_LW_jacobian, sfculw, fluxlwUP_jac, & + & minGPpres, use_LW_jacobian, sfculw, fluxlwUP_jac, & & t_lay, t_lev, p_lay, p_lev, flux2D_lwUP, flux2D_lwDOWN, & & pert_radtend, do_sppt,ca_global, & ! & dry, icy, wet, lprnt, ipr, & diff --git a/physics/dcyc2.meta b/physics/dcyc2.meta index aad0a31276..a460db7abc 100644 --- a/physics/dcyc2.meta +++ b/physics/dcyc2.meta @@ -353,6 +353,15 @@ type = logical intent = in optional = F +[minGPpres] + standard_name = minimum_pressure_in_RRTMGP + long_name = minimum pressure allowed in RRTMGP + units = Pa + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F [use_LW_jacobian] standard_name = flag_to_calc_RRTMGP_LW_jacobian long_name = logical flag to control RRTMGP LW calculation @@ -360,7 +369,7 @@ dimensions = () type = logical intent = in - optional = F + optional = F [sfculw] standard_name = surface_upwelling_longwave_flux_on_radiation_time_step long_name = total sky sfc upward lw flux @@ -370,15 +379,69 @@ kind = kind_phys intent = in optional = F -[sfculw_jac] - standard_name = RRTMGP_jacobian_of_lw_flux_upward_at_surface - long_name = RRTMGP Jacobian upward longwave flux at surface +[fluxlwUP_jac] + standard_name = RRTMGP_jacobian_of_lw_flux_upward + long_name = RRTMGP Jacobian upward longwave flux profile units = W m-2 K-1 - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_loop_extent,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[t_lay] + standard_name = air_temperature_updated_by_physics + long_name = model layer mean temperature updated by physics + units = K + dimensions = (horizontal_loop_extent,vertical_dimension) + type = real + kind = kind_phys + intent = in + optional = F +[t_lev] + standard_name = air_temperature_at_interface_for_RRTMGP + long_name = air temperature at vertical interface for radiation calculation + units = K + dimensions = (horizontal_loop_extent,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[p_lay] + standard_name = air_pressure + long_name = mean layer pressure + units = Pa + dimensions = (horizontal_loop_extent,vertical_dimension) type = real kind = kind_phys intent = in - optional = F + optional = F +[p_lev] + standard_name = air_pressure_at_interface + long_name = air pressure at model layer interfaces + units = Pa + dimensions = (horizontal_loop_extent,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[flux2D_lwUP] + standard_name = RRTMGP_lw_flux_profile_upward_allsky + long_name = RRTMGP upward longwave all-sky flux profile + units = W m-2 + dimensions = (horizontal_loop_extent,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = in + optional = F +[flux2D_lwDOWN] + standard_name = RRTMGP_lw_flux_profile_downward_allsky + long_name = RRTMGP downward longwave all-sky flux profile + units = W m-2 + dimensions = (horizontal_loop_extent,vertical_dimension_plus_one) + type = real + kind = kind_phys + intent = in + optional = F [pert_radtend] standard_name = flag_for_stochastic_radiative_heating_perturbations long_name = flag for stochastic radiative heating perturbations @@ -421,6 +484,15 @@ kind = kind_phys intent = inout optional = F +[htrlw] + standard_name = updated_tendency_of_air_temperature_due_to_longwave_heating_on_physics_time_step + long_name = total sky longwave heating rate on physics time step + units = K s-1 + dimensions = (horizontal_loop_extent,vertical_dimension) + type = real + kind = kind_phys + intent = inout + optional = F [adjsfcdsw] standard_name = surface_downwelling_shortwave_flux long_name = surface downwelling shortwave flux at current time @@ -574,95 +646,6 @@ kind = kind_phys intent = out optional = F -[minGPpres] - standard_name = minimum_pressure_in_RRTMGP - long_name = minimum pressure allowed in RRTMGP - units = Pa - dimensions = () - type = real - kind = kind_phys - intent = in - optional = F -[use_LW_jacobian] - standard_name = flag_to_calc_RRTMGP_LW_jacobian - long_name = logical flag to control RRTMGP LW calculation - units = flag - dimensions = () - type = logical - intent = in - optional = F -[fluxlwUP_jac] - standard_name = RRTMGP_jacobian_of_lw_flux_upward - long_name = RRTMGP Jacobian upward longwave flux profile - units = W m-2 K-1 - dimensions = (horizontal_loop_extent,vertical_dimension_plus_one) - type = real - kind = kind_phys - intent = in - optional = F -[htrlw] - standard_name = updated_tendency_of_air_temperature_due_to_longwave_heating_on_physics_time_step - long_name = total sky longwave heating rate on physics time step - units = K s-1 - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = out - optional = F -[t_lev] - standard_name = air_temperature_at_interface_for_RRTMGP - long_name = air temperature at vertical interface for radiation calculation - units = K - dimensions = (horizontal_loop_extent,vertical_dimension_plus_one) - type = real - kind = kind_phys - intent = in - optional = F -[t_lay] - standard_name = air_temperature_updated_by_physics - long_name = model layer mean temperature updated by physics - units = K - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F -[p_lay] - standard_name = air_pressure - long_name = mean layer pressure - units = Pa - dimensions = (horizontal_loop_extent,vertical_dimension) - type = real - kind = kind_phys - intent = in - optional = F -[p_lev] - standard_name = air_pressure_at_interface - long_name = air pressure at model layer interfaces - units = Pa - dimensions = (horizontal_loop_extent,vertical_dimension_plus_one) - type = real - kind = kind_phys - intent = in - optional = F -[flux2D_lwUP] - standard_name = RRTMGP_lw_flux_profile_upward_allsky - long_name = RRTMGP upward longwave all-sky flux profile - units = W m-2 - dimensions = (horizontal_loop_extent,vertical_dimension_plus_one) - type = real - kind = kind_phys - intent = in - optional = F -[flux2D_lwDOWN] - standard_name = RRTMGP_lw_flux_profile_downward_allsky - long_name = RRTMGP downward longwave all-sky flux profile - units = W m-2 - dimensions = (horizontal_loop_extent,vertical_dimension_plus_one) - type = real - kind = kind_phys - intent = in - optional = F [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP