From f7915b9ff0d5ee993ccea474e7389ad5b7e86324 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Thu, 27 Jun 2019 18:16:17 +0000 Subject: [PATCH] Synced with NCAR repo. --- physics/GFS_DCNV_generic.F90 | 8 +- physics/GFS_MP_generic.F90 | 87 ++- physics/GFS_PBL_generic.F90 | 189 +++-- physics/GFS_debug.F90 | 8 +- physics/GFS_phys_time_vary.fv3.F90 | 30 +- physics/GFS_phys_time_vary.scm.F90 | 29 +- physics/GFS_rrtmg_pre.F90 | 19 +- physics/GFS_suite_interstitial.F90 | 73 +- physics/GFS_surface_composites.F90 | 675 ++++++++++-------- physics/GFS_surface_generic.F90 | 18 +- physics/cldmacro.F | 8 +- physics/cs_conv.F90 | 20 +- physics/cs_conv_aw_adj.F90 | 13 +- physics/dcyc2.f | 67 +- physics/docs/pdftxt/CPT_adv_suite.txt | 1 - physics/docs/pdftxt/GFSv14_suite.txt | 1 - physics/docs/pdftxt/GFSv15_suite.txt | 1 - physics/docs/pdftxt/GFSv15_suite_TKEEDMF.txt | 1 - physics/gcm_shoc.F90 | 32 +- physics/gfdl_cloud_microphys.F90 | 15 +- ...racer_config.f => gfs_phy_tracer_config.F} | 0 physics/m_micro.F90 | 105 ++- physics/m_micro_interstitial.F90 | 60 +- physics/maximum_hourly_diagnostics.F90 | 49 +- physics/micro_mg_utils.F90 | 21 +- physics/module_gfdl_cloud_microphys.F90 | 6 +- physics/module_nst_water_prop.f90 | 2 +- physics/moninshoc.f | 33 +- physics/mp_thompson.F90 | 6 +- physics/physcons.F90 | 117 +-- physics/radiation_astronomy.f | 13 +- physics/radiation_clouds.f | 214 +++--- physics/samfdeepcnv.f | 2 +- physics/samfshalcnv.f | 10 +- physics/sfc_diag.f | 20 +- physics/sfc_diff.f | 26 +- physics/sfc_drv.f | 5 +- physics/sfc_drv_ruc.F90 | 25 +- physics/sfc_nst.f | 33 +- physics/sfc_ocean.F | 10 +- physics/sfc_sice.f | 271 +++---- physics/sflx.f | 34 +- 42 files changed, 1273 insertions(+), 1084 deletions(-) rename physics/{gfs_phy_tracer_config.f => gfs_phy_tracer_config.F} (100%) diff --git a/physics/GFS_DCNV_generic.F90 b/physics/GFS_DCNV_generic.F90 index 8f52fb550..0784e921f 100644 --- a/physics/GFS_DCNV_generic.F90 +++ b/physics/GFS_DCNV_generic.F90 @@ -139,8 +139,6 @@ end subroutine GFS_DCNV_generic_post_finalize !! | ncnvcld3d | number_of_convective_3d_cloud_fields | number of convective 3d clouds fields | count | 0 | integer | | in | F | !! | rainc | lwe_thickness_of_convective_precipitation_amount_on_dynamics_timestep | convective rain at this time step | m | 1 | real | kind_phys | inout | F | !! | cldwrk | cumulative_cloud_work_function | cumulative cloud work function (valid only with sas) | m2 s-1 | 1 | real | kind_phys | inout | F | -!! | cnvprcp | cumulative_lwe_thickness_of_convective_precipitation_amount | cumulative convective precipitation | m | 1 | real | kind_phys | inout | F | -!! | cnvprcpb | cumulative_lwe_thickness_of_convective_precipitation_amount_in_bucket | cumulative convective precipitation in bucket | m | 1 | real | kind_phys | inout | F | !! | dt3dt | cumulative_change_in_temperature_due_to_deep_convection | cumulative change in temperature due to deep conv. | K | 2 | real | kind_phys | inout | F | !! | dq3dt | cumulative_change_in_water_vapor_specific_humidity_due_to_deep_convection | cumulative change in water vapor specific humidity due to deep conv. | kg kg-1 | 2 | real | kind_phys | inout | F | !! | du3dt | cumulative_change_in_x_wind_due_to_deep_convection | cumulative change in x wind due to deep convection | m s-1 | 2 | real | kind_phys | inout | F | @@ -169,7 +167,7 @@ end subroutine GFS_DCNV_generic_post_finalize subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, lgocart, ras, cscnv, do_ca, & isppt_deep, frain, rain1, dtf, cld1d, save_u, save_v, save_t, save_qv, gu0, gv0, gt0, & gq0_water_vapor, ud_mf, dd_mf, dt_mf, con_g, clw_ice, clw_liquid, npdf3d, num_p3d, ncnvcld3d, & - rainc, cldwrk, cnvprcp, cnvprcpb, dt3dt, dq3dt, du3dt, dv3dt, upd_mf, dwn_mf, det_mf, dqdti, & + rainc, cldwrk, dt3dt, dq3dt, du3dt, dv3dt, upd_mf, dwn_mf, det_mf, dqdti, & cnvqci, upd_mfi, dwn_mfi, det_mfi, cnvw, cnvc, cnvw_phy_f3d, cnvc_phy_f3d, & cape, tconvtend, qconvtend, uconvtend, vconvtend, errmsg, errflg) @@ -189,7 +187,7 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, lgocart, ras, cs real(kind=kind_phys), dimension(im,levs), intent(in) :: clw_ice, clw_liquid integer, intent(in) :: npdf3d, num_p3d, ncnvcld3d - real(kind=kind_phys), dimension(im), intent(inout) :: rainc, cldwrk, cnvprcp, cnvprcpb + real(kind=kind_phys), dimension(im), 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 @@ -246,8 +244,6 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, lgocart, ras, cs if (lssav) then do i=1,im cldwrk (i) = cldwrk (i) + cld1d(i) * dtf - cnvprcp(i) = cnvprcp(i) + rainc(i) - cnvprcpb(i) = cnvprcpb(i) + rainc(i) enddo if (ldiag3d) then diff --git a/physics/GFS_MP_generic.F90 b/physics/GFS_MP_generic.F90 index 0aeada850..8021f0801 100644 --- a/physics/GFS_MP_generic.F90 +++ b/physics/GFS_MP_generic.F90 @@ -104,6 +104,7 @@ end subroutine GFS_MP_generic_post_init !! | imp_physics | flag_for_microphysics_scheme | choice of microphysics scheme | flag | 0 | integer | | in | F | !! | imp_physics_gfdl | flag_for_gfdl_microphysics_scheme | choice of GFDL microphysics scheme | flag | 0 | integer | | in | F | !! | imp_physics_thompson | flag_for_thompson_microphysics_scheme | choice of Thompson microphysics scheme | flag | 0 | integer | | in | F | +!! | imp_physics_mg | flag_for_morrison_gettelman_microphysics_scheme | choice of Morrison-Gettelman microphysics scheme | flag | 0 | integer | | in | F | !! | cal_pre | flag_for_precipitation_type_algorithm | flag controls precip type algorithm | flag | 0 | logical | | in | F | !! | lssav | flag_diagnostics | logical flag for storing diagnostics | flag | 0 | logical | | in | F | !! | ldiag3d | flag_diagnostics_3D | flag for 3d diagnostic fields | flag | 0 | logical | | in | F | @@ -140,10 +141,13 @@ end subroutine GFS_MP_generic_post_init !! | doms_diag | dominant_snow_type | dominant snow type | none | 1 | real | kind_phys | inout | F | !! | tprcp | nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep | total precipitation amount in each time step | m | 1 | real | kind_phys | inout | F | !! | srflag | flag_for_precipitation_type | snow/rain flag for precipitation | flag | 1 | real | kind_phys | inout | F | +!! | sr | ratio_of_snowfall_to_rainfall | snow ratio: ratio of snow to total precipitation | frac | 1 | real | kind_phys | in | F | +!! | cnvprcp | cumulative_lwe_thickness_of_convective_precipitation_amount | cumulative convective precipitation | m | 1 | real | kind_phys | inout | F | !! | totprcp | accumulated_lwe_thickness_of_precipitation_amount | accumulated total precipitation | m | 1 | real | kind_phys | inout | F | !! | totice | accumulated_lwe_thickness_of_ice_amount | accumulated ice precipitation | kg m-2 | 1 | real | kind_phys | inout | F | !! | totsnw | accumulated_lwe_thickness_of_snow_amount | accumulated snow precipitation | kg m-2 | 1 | real | kind_phys | inout | F | !! | totgrp | accumulated_lwe_thickness_of_graupel_amount | accumulated graupel precipitation | kg m-2 | 1 | real | kind_phys | inout | F | +!! | cnvprcpb | cumulative_lwe_thickness_of_convective_precipitation_amount_in_bucket | cumulative convective precipitation in bucket | m | 1 | real | kind_phys | inout | F | !! | totprcpb | accumulated_lwe_thickness_of_precipitation_amount_in_bucket | accumulated total precipitation in bucket | m | 1 | real | kind_phys | inout | F | !! | toticeb | accumulated_lwe_thickness_of_ice_amount_in_bucket | accumulated ice precipitation in bucket | kg m-2 | 1 | real | kind_phys | inout | F | !! | totsnwb | accumulated_lwe_thickness_of_snow_amount_in_bucket | accumulated snow precipitation in bucket | kg m-2 | 1 | real | kind_phys | inout | F | @@ -173,10 +177,10 @@ end subroutine GFS_MP_generic_post_init !> \section gfs_mp_gen GFS MP Generic Post General Algorithm !> @{ subroutine GFS_MP_generic_post_run(im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac, imp_physics, imp_physics_gfdl, & - imp_physics_thompson, cal_pre, lssav, ldiag3d, cplflx, cplchm, con_g, dtf, frain, rainc, rain1, rann, xlat, xlon, & - gt0, gq0, prsl, prsi, phii, tsfc, ice, snow, graupel, save_t, save_qv, rain0, ice0, snow0, graupel0, del, & - rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, srflag, totprcp, totice, totsnw, & - totgrp, totprcpb, toticeb, totsnwb, totgrpb, dt3dt, dq3dt, rain_cpl, rainc_cpl, snow_cpl, pwat, & + imp_physics_thompson, imp_physics_mg, cal_pre, lssav, ldiag3d, cplflx, cplchm, con_g, dtf, frain, rainc, rain1, & + rann, xlat, xlon, gt0, gq0, prsl, prsi, phii, tsfc, ice, snow, graupel, save_t, save_qv, rain0, ice0, snow0, & + graupel0, del, rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, srflag, sr, cnvprcp, totprcp, totice, & + totsnw, totgrp, cnvprcpb, totprcpb, toticeb, totsnwb, totgrpb, dt3dt, dq3dt, rain_cpl, rainc_cpl, snow_cpl, pwat, & do_sppt, dtdtr, dtdtc, drain_cpl, dsnow_cpl, lsm, lsm_ruc, raincprv, rainncprv, iceprv, snowprv, graupelprv, & dtp, errmsg, errflg) ! @@ -184,7 +188,8 @@ subroutine GFS_MP_generic_post_run(im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, nt implicit none - integer, intent(in) :: im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac, imp_physics, imp_physics_gfdl, imp_physics_thompson + integer, intent(in) :: im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac + integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_mg logical, intent(in) :: cal_pre, lssav, ldiag3d, cplflx, cplchm real(kind=kind_phys), intent(in) :: dtf, frain, con_g @@ -196,8 +201,11 @@ subroutine GFS_MP_generic_post_run(im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, nt 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(inout) :: rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, & - srflag, totprcp, totice, totsnw, totgrp, totprcpb, toticeb, totsnwb, totgrpb, rain_cpl, rainc_cpl, snow_cpl, pwat + 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, & + srflag, cnvprcp, totprcp, totice, totsnw, totgrp, cnvprcpb, & + totprcpb, toticeb, totsnwb, totgrpb, rain_cpl, rainc_cpl, & + snow_cpl, pwat real(kind=kind_phys), dimension(im,levs), intent(inout) :: dt3dt, dq3dt ! Stochastic physics / surface perturbations @@ -223,16 +231,14 @@ subroutine GFS_MP_generic_post_run(im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, nt ! DH* TODO: CLEANUP, all of these should be coming in through the argument list real(kind=kind_phys), parameter :: con_p001= 0.001d0 - real(kind=kind_phys), parameter :: con_day = 86400.d0 -#ifdef TRANSITION + real(kind=kind_phys), parameter :: con_day = 86400.0d0 real(kind=kind_phys), parameter :: rainmin = 1.0d-13 -#else - real(kind=kind_phys), parameter :: rainmin = 1.0e-13 -#endif - real(kind=kind_phys), parameter :: p850 = 85000.0 + real(kind=kind_phys), parameter :: p850 = 85000.0d0 ! *DH integer :: i, k, ic + + real(kind=kind_phys), parameter :: zero = 0.0d0, one = 1.0d0 real(kind=kind_phys) :: crain, csnow, onebg, tem, total_precip real(kind=kind_phys), dimension(im) :: domr, domzr, domip, doms, t850, work1 @@ -240,7 +246,7 @@ subroutine GFS_MP_generic_post_run(im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, nt errmsg = '' errflg = 0 - onebg = 1.0d0/con_g + onebg = one/con_g do i = 1, im rain(i) = rainc(i) + frain * rain1(i) ! time-step convective plus explicit @@ -308,6 +314,14 @@ subroutine GFS_MP_generic_post_run(im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, nt end if enddo endif + if (lssav) then + do i=1,im + domr_diag(i) = domr_diag(i) + domr(i) * dtf + domzr_diag(i) = domzr_diag(i) + domzr(i) * dtf + domip_diag(i) = domip_diag(i) + domip(i) * dtf + doms_diag(i) = doms_diag(i) + doms(i) * dtf + enddo + endif endif @@ -316,21 +330,17 @@ subroutine GFS_MP_generic_post_run(im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, nt ! 'totprcpb=', Diag%totprcpb(1),'totprcp=',Diag%totprcp(1), & ! 'rain=',Diag%rain(1) do i=1,im + cnvprcp (i) = cnvprcp (i) + rainc(i) totprcp (i) = totprcp (i) + rain(i) totice (i) = totice (i) + ice(i) totsnw (i) = totsnw (i) + snow(i) totgrp (i) = totgrp (i) + graupel(i) + + cnvprcpb(i) = cnvprcpb(i) + rainc(i) totprcpb(i) = totprcpb(i) + rain(i) toticeb (i) = toticeb (i) + ice(i) totsnwb (i) = totsnwb (i) + snow(i) totgrpb (i) = totgrpb (i) + graupel(i) -! - if (cal_pre) then - domr_diag(i) = domr_diag(i) + domr(i) * dtf - domzr_diag(i) = domzr_diag(i) + domzr(i) * dtf - domip_diag(i) = domip_diag(i) + domip(i) * dtf - doms_diag(i) = doms_diag(i) + doms(i) * dtf - endif enddo if (ldiag3d) then @@ -355,6 +365,9 @@ subroutine GFS_MP_generic_post_run(im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, nt enddo enddo + ! Conversion factor mm per physics timestep to m per day + tem = dtp * con_p001 / con_day + !> - For GFDL and Thompson MP scheme, determine convective snow by surface temperature; !! and determine explicit rain/snow by snow/ice/graupel coming out directly from MP !! and convective rainfall from the cumulus scheme if the surface temperature is below @@ -362,7 +375,6 @@ subroutine GFS_MP_generic_post_run(im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, nt if (imp_physics == imp_physics_gfdl .or. imp_physics == imp_physics_thompson) then ! determine convective rain/snow by surface temperature ! determine large-scale rain/snow by rain/snow coming out directly from MP - tem = dtp * con_p001 / con_day do i = 1, im !tprcp(i) = max(0.0, rain(i) )! clu: rain -> tprcp ! DH now lines 245-250 srflag(i) = 0. ! clu: default srflag as 'rain' (i.e. 0) @@ -384,22 +396,29 @@ subroutine GFS_MP_generic_post_run(im, ix, levs, kdt, nrcm, ncld, nncl, ntcw, nt endif enddo elseif( .not. cal_pre) then - do i = 1, im - tprcp(i) = max(0.0, rain(i) )! clu: rain -> tprcp - srflag(i) = 0. ! clu: default srflag as 'rain' (i.e. 0) - if (t850(i) <= 273.16) then - srflag(i) = 1. ! clu: set srflag to 'snow' (i.e. 1) - endif - enddo + if (imp_physics == imp_physics_mg) then ! MG microphysics + do i=1,im + if (rain(i)*tem > rainmin) then + srflag(i) = max(zero, min(one, (rain(i)-rainc(i))*sr(i)/rain(i))) + else + srflag(i) = 0.0 + endif + enddo + else + do i = 1, im + tprcp(i) = max(0.0, rain(i) )! clu: rain -> tprcp + srflag(i) = 0.0 ! clu: default srflag as 'rain' (i.e. 0) + if (t850(i) <= 273.16) then + srflag(i) = 1.0 ! clu: set srflag to 'snow' (i.e. 1) + endif + enddo + endif endif if (cplflx .or. cplchm) then do i = 1, im - if (t850(i) > 273.16) then - rain_cpl(i) = rain_cpl(i) + rain(i) - else - snow_cpl(i) = snow_cpl(i) + rain(i) - endif + rain_cpl(i) = rain_cpl(i) + rain(i) * (one-srflag(i)) + snow_cpl(i) = snow_cpl(i) + rain(i) * srflag(i) enddo endif diff --git a/physics/GFS_PBL_generic.F90 b/physics/GFS_PBL_generic.F90 index 9731a6309..127de28e4 100644 --- a/physics/GFS_PBL_generic.F90 +++ b/physics/GFS_PBL_generic.F90 @@ -27,6 +27,9 @@ end subroutine GFS_PBL_generic_pre_finalize !! | ntsw | index_for_snow_water | tracer index for snow water | index | 0 | integer | | in | F | !! | ntlnc | index_for_liquid_cloud_number_concentration | tracer index for liquid number concentration | index | 0 | integer | | in | F | !! | ntinc | index_for_ice_cloud_number_concentration | tracer index for ice number concentration | index | 0 | integer | | in | F | +!! | ntrnc | index_for_rain_number_concentration | tracer index for rain number concentration | index | 0 | integer | | in | F | +!! | ntsnc | index_for_snow_number_concentration | tracer index for snow number concentration | index | 0 | integer | | in | F | +!! | ntgnc | index_for_graupel_number_concentration | tracer index for graupel number concentration | index | 0 | integer | | in | F | !! | ntwa | index_for_water_friendly_aerosols | tracer index for water friendly aerosol | index | 0 | integer | | in | F | !! | ntia | index_for_ice_friendly_aerosols | tracer index for ice friendly aerosol | index | 0 | integer | | in | F | !! | ntgl | index_for_graupel | tracer index for graupel | index | 0 | integer | | in | F | @@ -38,6 +41,7 @@ end subroutine GFS_PBL_generic_pre_finalize !! | imp_physics_thompson | flag_for_thompson_microphysics_scheme | choice of Thompson microphysics scheme | flag | 0 | integer | | in | F | !! | imp_physics_wsm6 | flag_for_wsm6_microphysics_scheme | choice of WSM6 microphysics scheme | flag | 0 | integer | | in | F | !! | imp_physics_zhao_carr | flag_for_zhao_carr_microphysics_scheme | choice of Zhao-Carr microphysics scheme | flag | 0 | integer | | in | F | +!! | imp_physics_mg | flag_for_morrison_gettelman_microphysics_scheme | choice of Morrison-Gettelman microphysics scheme | flag | 0 | integer | | in | F | !! | cplchm | flag_for_chemistry_coupling | flag controlling cplchm collection (default off) | flag | 0 | logical | | in | F | !! | ltaerosol | flag_for_aerosol_physics | flag for aerosol physics | flag | 0 | logical | | in | F | !! | hybedmf | flag_for_hedmf | flag for hybrid edmf pbl scheme (moninedmf) | flag | 0 | logical | | in | F | @@ -50,19 +54,21 @@ end subroutine GFS_PBL_generic_pre_finalize !! #endif subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac, & - ntqv, ntcw, ntiw, ntrw, ntsw, ntlnc, ntinc, ntwa, ntia, ntgl, ntoz, ntke, ntkev, & + ntqv, ntcw, ntiw, ntrw, ntsw, ntlnc, ntinc, ntrnc, ntsnc, ntgnc, & + ntwa, ntia, ntgl, ntoz, ntke, ntkev, & imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6, & - imp_physics_zhao_carr, cplchm, ltaerosol, hybedmf, do_shoc, satmedmf, & - qgrs, vdftra, errmsg, errflg) + imp_physics_zhao_carr, imp_physics_mg, cplchm, ltaerosol, hybedmf, do_shoc, & + satmedmf, qgrs, vdftra, errmsg, errflg) use machine, only : kind_phys implicit none integer, intent(in) :: im, levs, nvdiff, ntrac - integer, intent(in) :: ntqv, ntcw, ntiw, ntrw, ntsw, ntlnc, ntinc, ntwa, ntia, ntgl, ntoz, ntke, ntkev + integer, intent(in) :: ntqv, ntcw, ntiw, ntrw, ntsw, ntlnc, ntinc, ntrnc, ntsnc, ntgnc + integer, intent(in) :: ntwa, ntia, ntgl, ntoz, ntke, ntkev integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6 - integer, intent(in) :: imp_physics_zhao_carr + integer, intent(in) :: imp_physics_zhao_carr, imp_physics_mg logical, intent(in) :: cplchm, ltaerosol, hybedmf, do_shoc, satmedmf real(kind=kind_phys), dimension(im, levs, ntrac), intent(in) :: qgrs @@ -119,7 +125,41 @@ subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac, enddo enddo endif - ! + ! MG + elseif (imp_physics == imp_physics_mg) then ! MG3/2 + if (ntgl > 0) then ! MG3 + do k=1,levs + do i=1,im + vdftra(i,k,1) = qgrs(i,k,ntqv) + vdftra(i,k,2) = qgrs(i,k,ntcw) + vdftra(i,k,3) = qgrs(i,k,ntiw) + vdftra(i,k,4) = qgrs(i,k,ntrw) + vdftra(i,k,5) = qgrs(i,k,ntsw) + vdftra(i,k,6) = qgrs(i,k,ntgl) + vdftra(i,k,7) = qgrs(i,k,ntlnc) + vdftra(i,k,8) = qgrs(i,k,ntinc) + vdftra(i,k,9) = qgrs(i,k,ntrnc) + vdftra(i,k,10) = qgrs(i,k,ntsnc) + vdftra(i,k,11) = qgrs(i,k,ntgnc) + vdftra(i,k,12) = qgrs(i,k,ntoz) + enddo + enddo + else ! MG2 + do k=1,levs + do i=1,im + vdftra(i,k,1) = qgrs(i,k,ntqv) + vdftra(i,k,2) = qgrs(i,k,ntcw) + vdftra(i,k,3) = qgrs(i,k,ntiw) + vdftra(i,k,4) = qgrs(i,k,ntrw) + vdftra(i,k,5) = qgrs(i,k,ntsw) + vdftra(i,k,6) = qgrs(i,k,ntlnc) + vdftra(i,k,7) = qgrs(i,k,ntinc) + vdftra(i,k,8) = qgrs(i,k,ntrnc) + vdftra(i,k,9) = qgrs(i,k,ntsnc) + vdftra(i,k,10) = qgrs(i,k,ntoz) + enddo + enddo + endif elseif (imp_physics == imp_physics_gfdl) then ! GFDL MP do k=1,levs @@ -146,7 +186,7 @@ subroutine GFS_PBL_generic_pre_run (im, levs, nvdiff, ntrac, endif endif - if (satmedmf) then + if (ntke>0) then do k=1,levs do i=1,im vdftra(i,k,ntkev) = qgrs(i,k,ntke) @@ -186,6 +226,9 @@ end subroutine GFS_PBL_generic_post_finalize !! | ntsw | index_for_snow_water | tracer index for snow water | index | 0 | integer | | in | F | !! | ntlnc | index_for_liquid_cloud_number_concentration | tracer index for liquid number concentration | index | 0 | integer | | in | F | !! | ntinc | index_for_ice_cloud_number_concentration | tracer index for ice number concentration | index | 0 | integer | | in | F | +!! | ntrnc | index_for_rain_number_concentration | tracer index for rain number concentration | index | 0 | integer | | in | F | +!! | ntsnc | index_for_snow_number_concentration | tracer index for snow number concentration | index | 0 | integer | | in | F | +!! | ntgnc | index_for_graupel_number_concentration | tracer index for graupel number concentration | index | 0 | integer | | in | F | !! | ntwa | index_for_water_friendly_aerosols | tracer index for water friendly aerosol | index | 0 | integer | | in | F | !! | ntia | index_for_ice_friendly_aerosols | tracer index for ice friendly aerosol | index | 0 | integer | | in | F | !! | ntgl | index_for_graupel | tracer index for graupel | index | 0 | integer | | in | F | @@ -197,6 +240,7 @@ end subroutine GFS_PBL_generic_post_finalize !! | imp_physics_thompson | flag_for_thompson_microphysics_scheme | choice of Thompson microphysics scheme | flag | 0 | integer | | in | F | !! | imp_physics_wsm6 | flag_for_wsm6_microphysics_scheme | choice of WSM6 microphysics scheme | flag | 0 | integer | | in | F | !! | imp_physics_zhao_carr | flag_for_zhao_carr_microphysics_scheme | choice of Zhao-Carr microphysics scheme | flag | 0 | integer | | in | F | +!! | imp_physics_mg | flag_for_morrison_gettelman_microphysics_scheme | choice of Morrison-Gettelman microphysics scheme | flag | 0 | integer | | in | F | !! | ltaerosol | flag_for_aerosol_physics | flag for aerosol physics | flag | 0 | logical | | in | F | !! | cplflx | flag_for_flux_coupling | flag controlling cplflx collection (default off) | flag | 0 | logical | | in | F | !! | cplchm | flag_for_chemistry_coupling | flag controlling cplchm collection (default off) | flag | 0 | logical | | in | F | @@ -249,8 +293,8 @@ end subroutine GFS_PBL_generic_post_finalize !! #endif subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, & - ntqv, ntcw, ntiw, ntrw, ntsw, ntlnc, ntinc, ntwa, ntia, ntgl, ntoz, ntke, ntkev, & - imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6, imp_physics_zhao_carr, & + ntqv, ntcw, ntiw, ntrw, ntsw, ntlnc, ntinc, ntrnc, ntsnc, ntgnc, ntwa, ntia, ntgl, ntoz, ntke, ntkev, & + imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6, imp_physics_zhao_carr, imp_physics_mg, & ltaerosol, cplflx, cplchm, lssav, ldiag3d, lsidea, hybedmf, do_shoc, satmedmf, shinhong, do_ysu, & dvdftra, dusfc1, dvsfc1, dtsfc1, dqsfc1, dtf, dudt, dvdt, dtdt, htrsw, htrlw, xmu, & dqdt, dusfc_cpl, dvsfc_cpl, dtsfc_cpl, & @@ -263,9 +307,9 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, implicit none integer, intent(in) :: im, levs, nvdiff, ntrac - integer, intent(in) :: ntqv, ntcw, ntiw, ntrw, ntsw, ntlnc, ntinc, ntwa, ntia, ntgl, ntoz, ntke, ntkev + integer, intent(in) :: ntqv, ntcw, ntiw, ntrw, ntsw, ntlnc, ntinc, ntrnc, ntsnc, ntgnc, ntwa, ntia, ntgl, ntoz, ntke, ntkev integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6 - integer, intent(in) :: imp_physics_zhao_carr + integer, intent(in) :: imp_physics_zhao_carr, imp_physics_mg logical, intent(in) :: ltaerosol, cplflx, cplchm, lssav, ldiag3d, lsidea logical, intent(in) :: hybedmf, do_shoc, satmedmf, shinhong, do_ysu @@ -298,6 +342,15 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, if (nvdiff == ntrac .and. (hybedmf .or. do_shoc .or. satmedmf)) then dqdt = dvdftra elseif (nvdiff /= ntrac .and. .not. shinhong .and. .not. do_ysu) then + + if (ntke>0) then + do k=1,levs + do i=1,im + dqdt(i,k,ntke) = dvdftra(i,k,ntkev) + enddo + enddo + endif + if (imp_physics == imp_physics_wsm6) then ! WSM6 do k=1,levs @@ -335,6 +388,40 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, enddo enddo endif + elseif (imp_physics == imp_physics_mg) then ! MG3/2 + if (ntgl > 0) then ! MG + do k=1,levs + do i=1,im + dqdt(i,k,1) = dvdftra(i,k,1) + dqdt(i,k,ntcw) = dvdftra(i,k,2) + dqdt(i,k,ntiw) = dvdftra(i,k,3) + dqdt(i,k,ntrw) = dvdftra(i,k,4) + dqdt(i,k,ntsw) = dvdftra(i,k,5) + dqdt(i,k,ntgl) = dvdftra(i,k,6) + dqdt(i,k,ntlnc) = dvdftra(i,k,7) + dqdt(i,k,ntinc) = dvdftra(i,k,8) + dqdt(i,k,ntrnc) = dvdftra(i,k,9) + dqdt(i,k,ntsnc) = dvdftra(i,k,10) + dqdt(i,k,ntgnc) = dvdftra(i,k,11) + dqdt(i,k,ntoz) = dvdftra(i,k,12) + enddo + enddo + else ! MG2 + do k=1,levs + do i=1,im + dqdt(i,k,1) = dvdftra(i,k,1) + dqdt(i,k,ntcw) = dvdftra(i,k,2) + dqdt(i,k,ntiw) = dvdftra(i,k,3) + dqdt(i,k,ntrw) = dvdftra(i,k,4) + dqdt(i,k,ntsw) = dvdftra(i,k,5) + dqdt(i,k,ntlnc) = dvdftra(i,k,6) + dqdt(i,k,ntinc) = dvdftra(i,k,7) + dqdt(i,k,ntrnc) = dvdftra(i,k,8) + dqdt(i,k,ntsnc) = dvdftra(i,k,9) + dqdt(i,k,ntoz) = dvdftra(i,k,10) + enddo + enddo + endif elseif (imp_physics == imp_physics_gfdl) then ! GFDL MP do k=1,levs @@ -360,55 +447,47 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, endif endif - if (satmedmf) then - do k=1,levs - do i=1,im - dqdt(i,k,ntke) = dvdftra(i,k,ntkev) - enddo - enddo - endif - endif ! nvdiff == ntrac ! --- ... coupling insertion ! ### GJF ### the following section needs to be made CCPP-compliant when cplflx = T -! if (cplflx) then -! do i=1,im -! if (ocean(i)) then ! Ocean only, NO LAKES -! if (flag_cice(i)) cice(i) = fice_cice(i) -! if (cice(i) == 1.) then ! use results from CICE -! Coupling%dusfci_cpl(i) = dusfc_cice(i) -! Coupling%dvsfci_cpl(i) = dvsfc_cice(i) -! Coupling%dtsfci_cpl(i) = dtsfc_cice(i) -! Coupling%dqsfci_cpl(i) = dqsfc_cice(i) -! elseif (dry(i) .or. icy(i)) then ! use stress_ocean from sfc_diff for opw component at mixed point -! tem1 = max(Diag%q1(i), 1.e-8) -! rho = Statein%prsl(i,1) / (con_rd*Diag%t1(i)*(1.0+con_fvirt*tem1)) -! if (wind(i) > 0.) then -! Coupling%dusfci_cpl(i) = -rho * stress_ocean(i) * Statein%ugrs(i,1) / wind(i) ! U-momentum flux -! Coupling%dvsfci_cpl(i) = -rho * stress_ocean(i) * Statein%vgrs(i,1) / wind(i) ! V-momentum flux -! else -! Coupling%dusfci_cpl(i) = 0. -! Coupling%dvsfci_cpl(i) = 0. -! end if -! Coupling%dtsfci_cpl(i) = con_cp * rho * hflx_ocean(i) !sensible heat flux over open ocean -! Coupling%dqsfci_cpl(i) = con_hvap * rho * evap_ocean(i) ! latent heat flux over open ocean -! else ! use results from PBL scheme for 100% open ocean -! Coupling%dusfci_cpl(i) = dusfc1(i) -! Coupling%dvsfci_cpl(i) = dvsfc1(i) -! Coupling%dtsfci_cpl(i) = dtsfc1(i) -! Coupling%dqsfci_cpl(i) = dqsfc1(i) -! endif -! -! Coupling%dusfc_cpl (i) = Coupling%dusfc_cpl(i) + Coupling%dusfci_cpl(i) * dtf -! Coupling%dvsfc_cpl (i) = Coupling%dvsfc_cpl(i) + Coupling%dvsfci_cpl(i) * dtf -! Coupling%dtsfc_cpl (i) = Coupling%dtsfc_cpl(i) + Coupling%dtsfci_cpl(i) * dtf -! Coupling%dqsfc_cpl (i) = Coupling%dqsfc_cpl(i) + Coupling%dqsfci_cpl(i) * dtf -! ! -! endif ! Ocean only, NO LAKES -! enddo -! endif +! if (Model%cplflx) then +! do i=1,im +! if (Sfcprop%oceanfrac(i) > 0.0) then ! Ocean only, NO LAKES +! if (fice(i) == 1.0) then ! use results from CICE +! Coupling%dusfci_cpl(i) = dusfc_cice(i) +! Coupling%dvsfci_cpl(i) = dvsfc_cice(i) +! Coupling%dtsfci_cpl(i) = dtsfc_cice(i) +! Coupling%dqsfci_cpl(i) = dqsfc_cice(i) +! elseif (dry(i) .or. icy(i)) then ! use stress_ocean from sfc_diff for opw component at mixed point +! tem1 = max(Diag%q1(i), 1.e-8) +! rho = Statein%prsl(i,1) / (con_rd*Diag%t1(i)*(1.0+con_fvirt*tem1)) +! if (wind(i) > 0.0) then +! tem = - rho * stress_ocn(i) / wind(i) +! Coupling%dusfci_cpl(i) = tem * Statein%ugrs(i,1) ! U-momentum flux +! Coupling%dvsfci_cpl(i) = tem * Statein%vgrs(i,1) ! V-momentum flux +! else +! Coupling%dusfci_cpl(i) = 0.0 +! Coupling%dvsfci_cpl(i) = 0.0 +! endif +! Coupling%dtsfci_cpl(i) = con_cp * rho * hflx_ocn(i) ! sensible heat flux over open ocean +! Coupling%dqsfci_cpl(i) = con_hvap * rho * evap_ocn(i) ! latent heat flux over open ocean +! else ! use results from PBL scheme for 100% open ocean +! Coupling%dusfci_cpl(i) = dusfc1(i) +! Coupling%dvsfci_cpl(i) = dvsfc1(i) +! Coupling%dtsfci_cpl(i) = dtsfc1(i) +! Coupling%dqsfci_cpl(i) = dqsfc1(i) +! endif +! +! Coupling%dusfc_cpl (i) = Coupling%dusfc_cpl(i) + Coupling%dusfci_cpl(i) * dtf +! Coupling%dvsfc_cpl (i) = Coupling%dvsfc_cpl(i) + Coupling%dvsfci_cpl(i) * dtf +! Coupling%dtsfc_cpl (i) = Coupling%dtsfc_cpl(i) + Coupling%dtsfci_cpl(i) * dtf +! Coupling%dqsfc_cpl (i) = Coupling%dqsfc_cpl(i) + Coupling%dqsfci_cpl(i) * dtf +!! +! endif ! Ocean only, NO LAKES +! enddo +! endif !-------------------------------------------------------lssav if loop ---------- if (lssav) then do i=1,im diff --git a/physics/GFS_debug.F90 b/physics/GFS_debug.F90 index 9ed719d76..c4295871f 100644 --- a/physics/GFS_debug.F90 +++ b/physics/GFS_debug.F90 @@ -260,10 +260,10 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling, call print_var(mpirank,omprank, blkno, 'Tbd%ccn_nm' , Tbd%ccn_nm) call print_var(mpirank,omprank, blkno, 'Tbd%aer_nm' , Tbd%aer_nm) ! Diag - call print_var(mpirank,omprank, blkno, 'Diag%fluxr ', Diag%fluxr) - do n=1,size(Diag%fluxr(1,:)) - call print_var(mpirank,omprank, blkno, 'Diag%fluxr_n ', Diag%fluxr(:,n)) - end do + !call print_var(mpirank,omprank, blkno, 'Diag%fluxr ', Diag%fluxr) + !do n=1,size(Diag%fluxr(1,:)) + ! call print_var(mpirank,omprank, blkno, 'Diag%fluxr_n ', Diag%fluxr(:,n)) + !end do call print_var(mpirank,omprank, blkno, 'Diag%srunoff ', Diag%srunoff) call print_var(mpirank,omprank, blkno, 'Diag%evbsa ', Diag%evbsa) call print_var(mpirank,omprank, blkno, 'Diag%evcwa ', Diag%evcwa) diff --git a/physics/GFS_phys_time_vary.fv3.F90 b/physics/GFS_phys_time_vary.fv3.F90 index b8823fac6..76b4eead2 100644 --- a/physics/GFS_phys_time_vary.fv3.F90 +++ b/physics/GFS_phys_time_vary.fv3.F90 @@ -344,7 +344,8 @@ subroutine GFS_phys_time_vary_run (Data, Model, nthrds, errmsg, errflg) real(kind=kind_phys), parameter :: con_99 = 99.0_kind_phys real(kind=kind_phys), parameter :: con_100 = 100.0_kind_phys - integer :: i, j, k, iseed, iskip, ix, nb, nblks + integer :: i, j, k, iseed, iskip, ix, nb, nblks, kdt_rad + real(kind=kind_phys) :: sec_zero real(kind=kind_phys) :: wrk(1) real(kind=kind_phys) :: rannie(Model%cny) real(kind=kind_phys) :: rndval(Model%cnx*Model%cny*Model%nrcm) @@ -473,12 +474,29 @@ subroutine GFS_phys_time_vary_run (Data, Model, nthrds, errmsg, errflg) endif !--- determine if diagnostics buckets need to be cleared - if (mod(Model%kdt,Model%nszero) == 1) then - do nb = 1,nblks - call Data(nb)%Intdiag%rad_zero (Model) - call Data(nb)%Intdiag%phys_zero (Model) + sec_zero = nint(Model%fhzero*con_hr) + if (sec_zero >= nint(max(Model%fhswr,Model%fhlwr))) then + if (mod(Model%kdt,Model%nszero) == 1) then + do nb = 1,nblks + call Data(nb)%Intdiag%rad_zero (Model) + call Data(nb)%Intdiag%phys_zero (Model) !!!! THIS IS THE POINT AT WHICH DIAG%ZHOUR NEEDS TO BE UPDATED - enddo + enddo + endif + else + if (mod(Model%kdt,Model%nszero) == 1) then + do nb = 1,nblks + call Data(nb)%Intdiag%phys_zero (Model) + !!!! THIS IS THE POINT AT WHICH DIAG%ZHOUR NEEDS TO BE UPDATED + enddo + endif + kdt_rad = nint(min(Model%fhswr,Model%fhlwr)/Model%dtp) + if (mod(Model%kdt, kdt_rad) == 1) then + do nb = 1,nblks + call Data(nb)%Intdiag%rad_zero (Model) + !!!! THIS IS THE POINT AT WHICH DIAG%ZHOUR NEEDS TO BE UPDATED + enddo + endif endif end subroutine GFS_phys_time_vary_run diff --git a/physics/GFS_phys_time_vary.scm.F90 b/physics/GFS_phys_time_vary.scm.F90 index 714713f78..200881d2c 100644 --- a/physics/GFS_phys_time_vary.scm.F90 +++ b/physics/GFS_phys_time_vary.scm.F90 @@ -224,6 +224,7 @@ subroutine GFS_phys_time_vary_finalize(errmsg, errflg) if (allocated(ci_pres) ) deallocate(ci_pres) is_initialized = .false. + end subroutine GFS_phys_time_vary_finalize !> \section arg_table_GFS_phys_time_vary_run Argument Table @@ -264,7 +265,8 @@ subroutine GFS_phys_time_vary_run (Grid, Statein, Model, Tbd, Sfcprop, Cldprop, real(kind=kind_phys), parameter :: con_99 = 99.0_kind_phys real(kind=kind_phys), parameter :: con_100 = 100.0_kind_phys - integer :: i, j, k, iseed, iskip, ix, nb + integer :: i, j, k, iseed, iskip, ix, nb, kdt_rad + real(kind=kind_phys) :: sec_zero real(kind=kind_phys) :: wrk(1) real(kind=kind_phys) :: rannie(Model%cny) real(kind=kind_phys) :: rndval(Model%cnx*Model%cny*Model%nrcm) @@ -362,10 +364,29 @@ subroutine GFS_phys_time_vary_run (Grid, Statein, Model, Tbd, Sfcprop, Cldprop, !endif !--- determine if diagnostics buckets need to be cleared - if (mod(Model%kdt,Model%nszero) == 1) then - call Diag%rad_zero (Model) - call Diag%phys_zero (Model) + sec_zero = nint(Model%fhzero*con_hr) + if (sec_zero >= nint(max(Model%fhswr,Model%fhlwr))) then + if (mod(Model%kdt,Model%nszero) == 1) then + do nb = 1,nblks + call Diag%rad_zero (Model) + call Diag%phys_zero (Model) + !!!! THIS IS THE POINT AT WHICH DIAG%ZHOUR NEEDS TO BE UPDATED + enddo + endif + else + if (mod(Model%kdt,Model%nszero) == 1) then + do nb = 1,nblks + call Diag%phys_zero (Model) + !!!! THIS IS THE POINT AT WHICH DIAG%ZHOUR NEEDS TO BE UPDATED + enddo + endif + kdt_rad = nint(min(Model%fhswr,Model%fhlwr)/Model%dtp) + if (mod(Model%kdt, kdt_rad) == 1) then + do nb = 1,nblks + call Diag%rad_zero (Model) !!!! THIS IS THE POINT AT WHICH DIAG%ZHOUR NEEDS TO BE UPDATED + enddo + endif endif end subroutine GFS_phys_time_vary_run diff --git a/physics/GFS_rrtmg_pre.F90 b/physics/GFS_rrtmg_pre.F90 index 150247723..dde7d6f05 100644 --- a/physics/GFS_rrtmg_pre.F90 +++ b/physics/GFS_rrtmg_pre.F90 @@ -70,7 +70,7 @@ end subroutine GFS_rrtmg_pre_init !! | cldsa | cloud_area_fraction_for_radiation | fraction of clouds for low, middle,high, total and BL | frac | 2 | real | kind_phys | out | F | !! | mtopa | model_layer_number_at_cloud_top | vertical indices for low, middle and high cloud tops | index | 2 | integer | | out | F | !! | mbota | model_layer_number_at_cloud_base | vertical indices for low, middle and high cloud bases | index | 2 | integer | | out | F | -!! | de_lgth | cloud_decorrelation_length | cloud decorrelation length | km | 1 | real | kind_phys | out | F | +!! | de_lgth | cloud_decorrelation_length | cloud decorrelation length | km | 1 | real | kind_phys | out | F | !! | alb1d | surface_albedo_perturbation | surface albedo perturbation | frac | 1 | real | kind_phys | out | F | !! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | !! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | @@ -191,7 +191,7 @@ subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input integer, intent(out) :: errflg ! Local variables - integer :: me, nfxr, ntrac, ntcw, ntiw, ncld, ntrw, ntsw, ntgl + integer :: me, nfxr, ntrac, ntcw, ntiw, ncld, ntrw, ntsw, ntgl, ncndl integer :: i, j, k, k1, k2, lsk, lv, n, itop, ibtc, LP1, lla, llb, lya, lyb @@ -210,7 +210,7 @@ subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levr+LTP+1) :: tem2db ! real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levr+LTP+1) :: hz - real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levr+LTP,Model%ncnd) :: ccnd + real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levr+LTP,min(4,Model%ncnd)) :: ccnd real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levr+LTP,2:Model%ntrac) :: tracer1 real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levr+LTP,NF_CLDS) :: clouds real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levr+LTP,NF_VGAS) :: gasvmr @@ -235,6 +235,7 @@ subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input ntrw = Model%ntrw ntsw = Model%ntsw ntgl = Model%ntgl + ncndl = min(Model%ncnd,4) LP1 = LM + 1 ! num of in/out levels @@ -605,7 +606,7 @@ subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input enddo enddo endif - do n=1,Model%ncnd + do n=1,ncndl do k=1,LMK do i=1,IM if (ccnd(i,k,n) < epsq) ccnd(i,k,n) = 0.0 @@ -784,7 +785,7 @@ subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input ! or unified cloud and/or with MG microphysics if (Model%uni_cld .and. Model%ncld >= 2) then - call progclduni (plyr, plvl, tlyr, tvly, ccnd, Model%ncnd, & ! --- inputs + call progclduni (plyr, plvl, tlyr, tvly, ccnd, ncndl, & ! --- inputs Grid%xlat, Grid%xlon, Sfcprop%slmsk,dz,delp, & IM, LMK, LMP, cldcov, & effrl, effri, effrr, effrs, Model%effr_in, & @@ -818,7 +819,7 @@ subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input clouds, cldsa, mtopa, mbota, de_lgth) ! --- outputs else - call progclduni (plyr, plvl, tlyr, tvly, ccnd, Model%ncnd, & ! --- inputs + call progclduni (plyr, plvl, tlyr, tvly, ccnd, ncndl, & ! --- inputs Grid%xlat, Grid%xlon, Sfcprop%slmsk, dz,delp, & IM, LMK, LMP, cldcov, & effrl, effri, effrr, effrs, Model%effr_in, & @@ -835,9 +836,9 @@ subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input elseif(Model%imp_physics == 8 .or. Model%imp_physics == 6) then ! Thompson / WSM6 cloud micrphysics scheme if (Model%kdt == 1) then - Tbd%phy_f3d(:,:,1) = 10. - Tbd%phy_f3d(:,:,2) = 50. - Tbd%phy_f3d(:,:,3) = 250. + Tbd%phy_f3d(:,:,Model%nleffr) = 10. + Tbd%phy_f3d(:,:,Model%nieffr) = 50. + Tbd%phy_f3d(:,:,Model%nseffr) = 250. endif call progcld5 (plyr,plvl,tlyr,qlyr,qstl,rhly,tracer1, & ! --- inputs diff --git a/physics/GFS_suite_interstitial.F90 b/physics/GFS_suite_interstitial.F90 index eb1e2e2b4..262454f15 100644 --- a/physics/GFS_suite_interstitial.F90 +++ b/physics/GFS_suite_interstitial.F90 @@ -95,7 +95,6 @@ end subroutine GFS_suite_interstitial_1_finalize !! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | !! | levs | vertical_dimension | vertical layer dimension | count | 0 | integer | | in | F | !! | ntrac | number_of_tracers | number of tracers | count | 0 | integer | | in | F | -!! | crtrh | critical_relative_humidity_at_sfc_pbltop_toa | critical relative humidity at SFC, PBL top and TOA | frac | 1 | real | kind_phys | in | F | !! | dtf | time_step_for_dynamics | dynamics timestep | s | 0 | real | kind_phys | in | F | !! | dtp | time_step_for_physics | physics timestep | s | 0 | real | kind_phys | in | F | !! | slmsk | sea_land_ice_mask_real | landmask: sea/land/ice=0/1/2 | flag | 1 | real | kind_phys | in | F | @@ -103,12 +102,8 @@ end subroutine GFS_suite_interstitial_1_finalize !! | dxmin | minimum_scaling_factor_for_critical_relative_humidity | minimum scaling factor for critical relative humidity | m2 rad-2 | 0 | real | kind_phys | in | F | !! | dxinv | inverse_scaling_factor_for_critical_relative_humidity | inverse scaling factor for critical relative humidity | rad2 m-2 | 0 | real | kind_phys | in | F | !! | pgr | surface_air_pressure | surface pressure | Pa | 1 | real | kind_phys | in | F | -!! | rhbbot | critical_relative_humidity_at_surface | critical relative humidity at the surface | frac | 0 | real | kind_phys | out | F | -!! | rhpbl | critical_relative_humidity_at_PBL_top | critical relative humidity at the PBL top | frac | 0 | real | kind_phys | out | F | -!! | rhbtop | critical_relative_humidity_at_top_of_atmosphere | critical relative humidity at the top of atmosphere | frac | 0 | real | kind_phys | out | F | !! | frain | dynamics_to_physics_timestep_ratio | ratio of dynamics timestep to physics timestep | none | 0 | real | kind_phys | out | F | !! | islmsk | sea_land_ice_mask | landmask: sea/land/ice=0/1/2 | flag | 1 | integer | | out | F | -!! | frland | land_area_fraction_for_microphysics | land area fraction used in microphysics schemes | frac | 1 | real | kind_phys | out | F | !! | work1 | grid_size_related_coefficient_used_in_scale-sensitive_schemes | grid size related coefficient used in scale-sensitive schemes | none | 1 | real | kind_phys | out | F | !! | work2 | grid_size_related_coefficient_used_in_scale-sensitive_schemes_complement | complement to work1 | none | 1 | real | kind_phys | out | F | !! | psurf | surface_air_pressure_diag | surface air pressure diagnostic | Pa | 1 | real | kind_phys | out | F | @@ -117,14 +112,11 @@ end subroutine GFS_suite_interstitial_1_finalize !! | dtdt | tendency_of_air_temperature_due_to_model_physics | updated tendency of the temperature | K s-1 | 2 | real | kind_phys | out | F | !! | dtdtc | tendency_of_air_temperature_due_to_radiative_heating_assuming_clear_sky | clear sky radiative (shortwave + longwave) heating rate at current time | K s-1 | 2 | real | kind_phys | out | F | !! | dqdt | tendency_of_tracers_due_to_model_physics | updated tendency of the tracers | kg kg-1 s-1 | 3 | real | kind_phys | out | F | -!! | tisfc | sea_ice_temperature | sea ice surface skin temperature | K | 1 | real | kind_phys | in | F | -!! | tice | sea_ice_temperature_interstitial | sea ice surface skin temperature use as interstitial | K | 1 | real | kind_phys | out | F | !! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | !! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | !! - subroutine GFS_suite_interstitial_1_run (im, levs, ntrac, crtrh, dtf, dtp, slmsk, area, dxmin, dxinv, pgr, & - rhbbot, rhpbl, rhbtop, frain, islmsk, frland, work1, work2, psurf, dudt, dvdt, dtdt, dtdtc, dqdt, & - tisfc, tice, errmsg, errflg) + subroutine GFS_suite_interstitial_1_run (im, levs, ntrac, dtf, dtp, slmsk, area, dxmin, dxinv, pgr, & + frain, islmsk, work1, work2, psurf, dudt, dvdt, dtdt, dtdtc, dqdt, errmsg, errflg) use machine, only: kind_phys @@ -133,16 +125,13 @@ subroutine GFS_suite_interstitial_1_run (im, levs, ntrac, crtrh, dtf, dtp, slmsk ! 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(3) :: crtrh real(kind=kind_phys), intent(in), dimension(im) :: slmsk, area, pgr - real(kind=kind_phys), intent(out) :: rhbbot, rhpbl, rhbtop, frain + real(kind=kind_phys), intent(out) :: frain integer, intent(out), dimension(im) :: islmsk - real(kind=kind_phys), intent(out), dimension(im) :: frland, work1, work2, psurf + 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 - real(kind=kind_phys), intent(in), dimension(im) :: tisfc - real(kind=kind_phys), intent(out), dimension(im) :: tice character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -153,26 +142,15 @@ subroutine GFS_suite_interstitial_1_run (im, levs, ntrac, crtrh, dtf, dtp, slmsk errmsg = '' errflg = 0 - rhbbot = crtrh(1) - rhpbl = crtrh(2) - rhbtop = crtrh(3) - frain = dtf / dtp do i = 1, im islmsk(i) = nint(slmsk(i)) - if (islmsk(i) == 1) then - frland(i) = 1.0 - else - frland(i) = 0.0 - endif + work1(i) = (log(area(i)) - dxmin) * dxinv work1(i) = max(0.0, min(1.0,work1(i))) work2(i) = 1.0 - work1(i) psurf(i) = pgr(i) - ! DH* 20190507 - assign sea ice temperature to interstitial variable - tice(i) = tisfc(i) - ! *DH end do do k=1,levs @@ -296,7 +274,7 @@ subroutine GFS_suite_interstitial_2_run (im, levs, lssav, ldiag3d, lsidea, cplfl logical, dimension(im) :: invrsn real(kind=kind_phys), dimension(im) :: tx1, tx2 - real(kind=kind_phys), parameter :: qmin = 1.0e-10 + real(kind=kind_phys), parameter :: qmin = 1.0d-10 ! Initialize CCPP error handling variables errmsg = '' @@ -529,6 +507,7 @@ subroutine GFS_suite_stateout_update_run (im, levs, ntrac, dtp, & errmsg = '' errflg = 0 + ! DH* add gw_dXdt terms here gt0(:,:) = tgrs(:,:) + dtdt(:,:) * dtp gu0(:,:) = ugrs(:,:) + dudt(:,:) * dtp gv0(:,:) = vgrs(:,:) + dvdt(:,:) * dtp @@ -574,7 +553,7 @@ end subroutine GFS_suite_interstitial_3_finalize !! | xlat | latitude | latitude | radians | 1 | real | kind_phys | in | F | !! | gq0 | tracer_concentration_updated_by_physics | tracer concentration updated by physics | kg kg-1 | 3 | real | kind_phys | in | F | !! | imp_physics | flag_for_microphysics_scheme | choice of microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_mg | flag_for_morrison_gettelman_microphysics_scheme | choice of Morrison-Gettelman rmicrophysics scheme | flag | 0 | integer | | in | F | +!! | imp_physics_mg | flag_for_morrison_gettelman_microphysics_scheme | choice of Morrison-Gettelman microphysics scheme | flag | 0 | integer | | in | F | !! | imp_physics_zhao_carr | flag_for_zhao_carr_microphysics_scheme | choice of Zhao-Carr microphysics scheme | flag | 0 | integer | | in | F | !! | imp_physics_zhao_carr_pdf | flag_for_zhao_carr_pdf_microphysics_scheme | choice of Zhao-Carr microphysics scheme with PDF clouds | flag | 0 | integer | | in | F | !! | imp_physics_gfdl | flag_for_gfdl_microphysics_scheme | choice of GFDL microphysics scheme | flag | 0 | integer | | in | F | @@ -591,6 +570,7 @@ end subroutine GFS_suite_interstitial_3_finalize !! | work1 | grid_size_related_coefficient_used_in_scale-sensitive_schemes | grid size related coefficient used in scale-sensitive schemes | none | 1 | real | kind_phys | in | F | !! | work2 | grid_size_related_coefficient_used_in_scale-sensitive_schemes_complement | complement to work1 | none | 1 | real | kind_phys | in | F | !! | kpbl | vertical_index_at_top_of_atmosphere_boundary_layer | vertical index at top atmospheric boundary layer | index | 1 | integer | | in | F | +!! | kinver | index_of_highest_temperature_inversion | index of highest temperature inversion | index | 1 | integer | | in | F | !! | clw | convective_transportable_tracers | array to contain cloud water and other convective trans. tracers | kg kg-1 | 3 | real | kind_phys | inout | F | !! | rhc | critical_relative_humidity | critical relative humidity | frac | 2 | real | kind_phys | inout | F | !! | save_qc | cloud_condensed_water_mixing_ratio_save | moist (dry+vapor, no condensates) mixing ratio of cloud water (condensate) before entering a physics scheme | kg kg-1 | 2 | real | kind_phys | inout | F | @@ -602,7 +582,7 @@ end subroutine GFS_suite_interstitial_3_finalize subroutine GFS_suite_interstitial_3_run (im, levs, nn, cscnv, satmedmf, trans_trac, do_shoc, ltaerosol, ntrac, ntcw, & ntiw, ntclamt, ntrw, ntsw, ntrnc, ntsnc, ntgl, ntgnc, xlat, gq0, imp_physics, imp_physics_mg, imp_physics_zhao_carr,& imp_physics_zhao_carr_pdf, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6, prsi, prsl, prslk, rhcbot, & - rhcpbl, rhctop, rhcmax, islmsk, work1, work2, kpbl, & + rhcpbl, rhctop, rhcmax, islmsk, work1, work2, kpbl, kinver, & clw, rhc, save_qc, save_qi, errmsg, errflg) use machine, only: kind_phys @@ -613,7 +593,7 @@ subroutine GFS_suite_interstitial_3_run (im, levs, nn, cscnv, satmedmf, trans_tr 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 - integer, dimension(im), intent(in) :: islmsk, kpbl + integer, dimension(im), intent(in) :: islmsk, kpbl, kinver logical, intent(in) :: cscnv, satmedmf, trans_trac, do_shoc, ltaerosol real(kind=kind_phys), intent(in) :: rhcbot, rhcmax, rhcpbl, rhctop @@ -634,10 +614,13 @@ subroutine GFS_suite_interstitial_3_run (im, levs, nn, cscnv, satmedmf, trans_tr ! local variables integer :: i,k,n,tracers,kk real(kind=kind_phys) :: tem, tem1, tem2 - real(kind=kind_phys), dimension(im) :: tx1, tx2 + real(kind=kind_phys), dimension(im) :: tx1, tx2, tx3, tx4 - real(kind=kind_phys),parameter :: slope_mg = 0.02, slope_upmg = 0.04, & - turnrhcrit = 0.900, turnrhcrit_upper = 0.150 + !real(kind=kind_phys),parameter :: slope_mg = 0.02, slope_upmg = 0.04, & + ! turnrhcrit = 0.900, turnrhcrit_upper = 0.150 + ! in the following inverse of slope_mg and slope_upmg are specified + real(kind=kind_phys),parameter :: slope_mg = 50.0_kind_phys, & + slope_upmg = 25.0_kind_phys ! Initialize CCPP error handling variables errmsg = '' @@ -687,17 +670,22 @@ subroutine GFS_suite_interstitial_3_run (im, levs, nn, cscnv, satmedmf, trans_tr endif ! end if_ras or cfscnv or samf if (ntcw > 0) then - if (imp_physics == imp_physics_mg) then ! compute rhc for GMAO macro physics cloud pdf + if (imp_physics == imp_physics_mg .and. rhcpbl < 0.5) then ! compute rhc for GMAO macro physics cloud pdf do i=1,im tx1(i) = 1.0 / prsi(i,1) - tx2(i) = 1.0 - rhcmax * work1(i)-rhcbot*work2(i) + tx2(i) = 1.0 - rhcmax*work1(i)-rhcbot*work2(i) + + kk = min(kinver(i), max(2,kpbl(i))) + tx3(i) = prsi(i,kk)*tx1(i) + tx4(i) = rhcpbl - rhctop*abs(cos(xlat(i))) enddo do k = 1, levs do i = 1, im - kk = max(2,kpbl(i)) tem = prsl(i,k) * tx1(i) - tem1 = min(max((tem-prsi(i,kk)*tx1(i))/slope_mg, -20.0), 20.0) - tem2 = min(max((0.3-0.2*abs(cos(xlat(i)))-tem)/slope_upmg, -20.0), 20.0) ! Anning + tem1 = min(max((tem-tx3(i))*slope_mg, -20.0), 20.0) + ! Using rhcpbl and rhctop from the namelist instead of 0.3 and 0.2 + ! and rhcbot represents pbl top critical relative humidity + tem2 = min(max((tx4(i)-tem)*slope_upmg, -20.0), 20.0) ! Anning if (islmsk(i) > 0) then tem1 = 1.0 / (1.0+exp(tem1+tem1)) else @@ -706,7 +694,6 @@ subroutine GFS_suite_interstitial_3_run (im, levs, nn, cscnv, satmedmf, trans_tr tem2 = 1.0 / (1.0+exp(tem2)) rhc(i,k) = min(rhcmax, max(0.7, 1.0-tx2(i)*tem1*tem2)) -! rhc(i,k) = min(rhcmax, rhcmax*work1(i) + (1.0-tx2(i)*tem1*tem2)*work2(i)) enddo enddo else @@ -714,11 +701,9 @@ subroutine GFS_suite_interstitial_3_run (im, levs, nn, cscnv, satmedmf, trans_tr do i=1,im kk = max(10,kpbl(i)) if (k < kk) then - tem = rhcbot - (rhcbot-rhcpbl) * (1.0-prslk(i,k)) & - / (1.0-prslk(i,kk)) + tem = rhcbot - (rhcbot-rhcpbl) * (1.0-prslk(i,k)) / (1.0-prslk(i,kk)) else - tem = rhcpbl - (rhcpbl-rhctop) * (prslk(i,kk)-prslk(i,k)) & - / prslk(i,kk) + tem = rhcpbl - (rhcpbl-rhctop) * (prslk(i,kk)-prslk(i,k)) / prslk(i,kk) endif tem = rhcmax * work1(i) + tem * work2(i) rhc(i,k) = max(0.0, min(1.0,tem)) diff --git a/physics/GFS_surface_composites.F90 b/physics/GFS_surface_composites.F90 index e5ca18683..df99b68dc 100644 --- a/physics/GFS_surface_composites.F90 +++ b/physics/GFS_surface_composites.F90 @@ -24,16 +24,19 @@ end subroutine GFS_surface_composites_pre_finalize !! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | !! |----------------|-----------------------------------------------------------------------------------|----------------------------------------------------------------------|------------|------|-----------|-----------|--------|----------| !! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | +!! | frac_grid | flag_for_fractional_grid | flag for fractional grid | flag | 0 | logical | | in | F | +!! | flag_cice | flag_for_cice | flag for cice | flag | 1 | logical | | in | F | !! | cplflx | flag_for_flux_coupling | flag controlling cplflx collection (default off) | flag | 0 | logical | | in | F | !! | landfrac | land_area_fraction | fraction of horizontal grid area occupied by land | frac | 1 | real | kind_phys | in | F | !! | lakefrac | lake_area_fraction | fraction of horizontal grid area occupied by lake | frac | 1 | real | kind_phys | in | F | !! | oceanfrac | sea_area_fraction | fraction of horizontal grid area occupied by ocean | frac | 1 | real | kind_phys | in | F | +!! | frland | land_area_fraction_for_microphysics | land area fraction used in microphysics schemes | frac | 1 | real | kind_phys | out | F | !! | dry | flag_nonzero_land_surface_fraction | flag indicating presence of some land surface area fraction | flag | 1 | logical | | inout | F | !! | icy | flag_nonzero_sea_ice_surface_fraction | flag indicating presence of some sea ice surface area fraction | flag | 1 | logical | | inout | F | !! | lake | flag_nonzero_lake_surface_fraction | flag indicating presence of some lake surface area fraction | flag | 1 | logical | | inout | F | !! | ocean | flag_nonzero_ocean_surface_fraction | flag indicating presence of some ocean surface area fraction | flag | 1 | logical | | inout | F | !! | wet | flag_nonzero_wet_surface_fraction | flag indicating presence of some ocean or lake surface area fraction | flag | 1 | logical | | inout | F | -!! | fice | sea_ice_concentration | ice fraction over open water | frac | 1 | real | kind_phys | in | F | +!! | cice | sea_ice_concentration | ice fraction over open water | frac | 1 | real | kind_phys | in | F | !! | cimin | minimum_sea_ice_concentration | minimum sea ice concentration | frac | 0 | real | kind_phys | in | F | !! | zorl | surface_roughness_length | surface roughness length | cm | 1 | real | kind_phys | in | F | !! | zorlo | surface_roughness_length_over_ocean | surface roughness length over ocean | cm | 1 | real | kind_phys | inout | F | @@ -53,103 +56,140 @@ end subroutine GFS_surface_composites_pre_finalize !! | uustar_lnd | surface_friction_velocity_over_land | surface friction velocity over land | m s-1 | 1 | real | kind_phys | inout | F | !! | uustar_ice | surface_friction_velocity_over_ice | surface friction velocity over ice | m s-1 | 1 | real | kind_phys | inout | F | !! | weasd | water_equivalent_accumulated_snow_depth | water equiv of acc snow depth over land and sea ice | mm | 1 | real | kind_phys | in | F | +!! | weasd_ocn | water_equivalent_accumulated_snow_depth_over_ocean | water equiv of acc snow depth over ocean | mm | 1 | real | kind_phys | inout | F | !! | weasd_lnd | water_equivalent_accumulated_snow_depth_over_land | water equiv of acc snow depth over land | mm | 1 | real | kind_phys | inout | F | !! | weasd_ice | water_equivalent_accumulated_snow_depth_over_ice | water equiv of acc snow depth over ice | mm | 1 | real | kind_phys | inout | F | !! | ep1d_ice | surface_upward_potential_latent_heat_flux_over_ice | surface upward potential latent heat flux over ice | W m-2 | 1 | real | kind_phys | inout | F | -!! | tsfc | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | in | F | +!! | tsfc | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | inout | F | !! | tsfco | sea_surface_temperature | sea surface temperature | K | 1 | real | kind_phys | inout | F | !! | tsfcl | surface_skin_temperature_over_land | surface skin temperature over land | K | 1 | real | kind_phys | inout | F | !! | tsfc_ocn | surface_skin_temperature_over_ocean_interstitial | surface skin temperature over ocean (temporary use as interstitial) | K | 1 | real | kind_phys | inout | F | !! | tsfc_lnd | surface_skin_temperature_over_land_interstitial | surface skin temperature over land (temporary use as interstitial) | K | 1 | real | kind_phys | inout | F | !! | tsfc_ice | surface_skin_temperature_over_ice_interstitial | surface skin temperature over ice (temporary use as interstitial) | K | 1 | real | kind_phys | inout | F | !! | tisfc | sea_ice_temperature | sea ice surface skin temperature | K | 1 | real | kind_phys | inout | F | +!! | tice | sea_ice_temperature_interstitial | sea ice surface skin temperature use as interstitial | K | 1 | real | kind_phys | out | F | !! | tsurf | surface_skin_temperature_after_iteration | surface skin temperature after iteration | K | 1 | real | kind_phys | inout | F | !! | tsurf_ocn | surface_skin_temperature_after_iteration_over_ocean | surface skin temperature after iteration over ocean | K | 1 | real | kind_phys | inout | F | !! | tsurf_lnd | surface_skin_temperature_after_iteration_over_land | surface skin temperature after iteration over land | K | 1 | real | kind_phys | inout | F | !! | tsurf_ice | surface_skin_temperature_after_iteration_over_ice | surface skin temperature after iteration over ice | K | 1 | real | kind_phys | inout | F | +!! | gflx_ice | upward_heat_flux_in_soil_over_ice | soil heat flux over ice | W m-2 | 1 | real | kind_phys | inout | F | !! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | !! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | !! #endif - subroutine GFS_surface_composites_pre_run (im, cplflx, landfrac, lakefrac, oceanfrac, & - dry, icy, lake, ocean, wet, fice, cimin, zorl, zorlo, zorll, zorl_ocn, & - zorl_lnd, zorl_ice, snowd, snowd_ocn, snowd_lnd, snowd_ice, tprcp, tprcp_ocn, & - tprcp_lnd, tprcp_ice, uustar, uustar_lnd, uustar_ice, weasd, weasd_lnd, & - weasd_ice, ep1d_ice, tsfc, tsfco, tsfcl, tsfc_ocn, tsfc_lnd, tsfc_ice, tisfc, & - tsurf, tsurf_ocn, tsurf_lnd, tsurf_ice, errmsg, errflg) + subroutine GFS_surface_composites_pre_run (im, frac_grid, flag_cice, cplflx, landfrac, lakefrac, oceanfrac, & + frland, dry, icy, lake, ocean, wet, cice, cimin, zorl, zorlo, zorll, zorl_ocn, & + zorl_lnd, zorl_ice, snowd, snowd_ocn, snowd_lnd, snowd_ice, tprcp, tprcp_ocn, & + tprcp_lnd, tprcp_ice, uustar, uustar_lnd, uustar_ice, weasd, weasd_ocn, & + weasd_lnd, weasd_ice, ep1d_ice, tsfc, tsfco, tsfcl, tsfc_ocn, tsfc_lnd, & + tsfc_ice, tisfc, tice, tsurf, tsurf_ocn, tsurf_lnd, tsurf_ice, gflx_ice, & + errmsg, errflg) use machine, only: kind_phys implicit none ! Interface variables - integer, intent(in) :: im - logical, intent(in) :: cplflx + integer, intent(in ) :: im + logical, intent(in ) :: frac_grid, cplflx + logical, dimension(im), intent(in ) :: flag_cice logical, dimension(im), intent(inout) :: dry, icy, lake, ocean, wet - real(kind=kind_phys), intent(in) :: cimin - real(kind=kind_phys), dimension(im), intent(in) :: landfrac, lakefrac, oceanfrac, fice - real(kind=kind_phys), dimension(im), intent(in) :: zorl, snowd, tprcp, uustar, weasd, tsfc + real(kind=kind_phys), intent(in ) :: cimin + real(kind=kind_phys), dimension(im), intent(in ) :: landfrac, lakefrac, oceanfrac, cice + real(kind=kind_phys), dimension(im), intent( out) :: frland + real(kind=kind_phys), dimension(im), intent(in ) :: zorl, snowd, tprcp, uustar, weasd - real(kind=kind_phys), dimension(im), intent(inout) :: zorlo, zorll, tsfco, tsfcl, tisfc, tsurf + real(kind=kind_phys), dimension(im), intent(inout) :: zorlo, zorll, tsfc, tsfco, tsfcl, tisfc, tsurf real(kind=kind_phys), dimension(im), intent(inout) :: snowd_ocn, snowd_lnd, snowd_ice, tprcp_ocn, & tprcp_lnd, tprcp_ice, zorl_ocn, zorl_lnd, zorl_ice, tsfc_ocn, tsfc_lnd, tsfc_ice, tsurf_ocn, & - tsurf_lnd, tsurf_ice, uustar_lnd, uustar_ice, weasd_lnd, weasd_ice, ep1d_ice + tsurf_lnd, tsurf_ice, uustar_lnd, uustar_ice, weasd_ocn, weasd_lnd, weasd_ice, ep1d_ice, gflx_ice + real(kind=kind_phys), dimension(im), intent( out) :: tice ! CCPP error handling character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg ! Local variables + real(kind=kind_phys), parameter :: one = 1.0d0 integer :: i ! Initialize CCPP error handling variables errmsg = '' errflg = 0 - do i = 1, im - if(oceanfrac(i)>0.) ocean(i) = .true. - if(landfrac(i) >0.) dry(i) = .true. - if(lakefrac(i) >0.) lake(i) = .true. - if(ocean(i) .or. lake(i)) wet(i) = .true. - if(wet(i) .and. fice(i) >= cimin*max(oceanfrac(i),lakefrac(i))) icy(i) = .true. - enddo - do i=1,im - if (.not. cplflx) then + frland(i) = landfrac(i) + if (frland(i) > 0.0) dry(i) = .true. + if (cice(i) >= cimin*(1.-frland(i)) .and. frland(i)<1.) icy(i) = .true. + if (frland(i)+cice(i) < 1.0 ) wet(i) = .true. ! there is some open water! + enddo + + if (frac_grid) then + do i=1,im + tsfc(i) = tsfcl(i) * frland(i) & + + tisfc(i) * cice(i) & + + tsfco(i) * (one-cice(i)-frland(i)) + enddo + elseif (cplflx) then + do i=1,im + if (flag_cice(i)) then + tsfc(i) = tisfc(i) * cice(i) & + + tsfc (i) * (one-cice(i)) + icy(i) = .true. + endif + enddo + endif + + if (.not. cplflx .or. .not. frac_grid) then + do i=1,im zorll(i) = zorl(i) zorlo(i) = zorl(i) tsfcl(i) = tsfc(i) tsfco(i) = tsfc(i) - tisfc(i) = tsfc(i) - end if - if(wet(i)) then - snowd_ocn(i) = snowd(i) - tprcp_ocn(i) = tprcp(i) - zorl_ocn(i) = zorlo(i) - tsfc_ocn(i) = tsfco(i) - tsurf_ocn(i)= tsfco(i) + !tisfc(i) = tsfc(i) + enddo + endif + + do i=1,im + if (wet(i)) then ! Water + tprcp_ocn(i) = tprcp(i) + zorl_ocn(i) = zorlo(i) + tsfc_ocn(i) = tsfco(i) + tsurf_ocn(i) = tsfco(i) +! weasd_ocn(i) = weasd(i) +! snowd_ocn(i) = snowd(i) + weasd_ocn(i) = 0.0 + snowd_ocn(i) = 0.0 endif - if (dry(i)) then + if (dry(i)) then ! Land uustar_lnd(i) = uustar(i) - weasd_lnd(i) = weasd(i) - tprcp_lnd(i) = tprcp(i) - zorl_lnd(i) = zorll(i) - tsfc_lnd(i) = tsfcl(i) - tsurf_lnd(i) = tsfcl(i) - snowd_lnd(i) = snowd(i) + weasd_lnd(i) = weasd(i) + tprcp_lnd(i) = tprcp(i) + zorl_lnd(i) = zorll(i) + tsfc_lnd(i) = tsfcl(i) + tsurf_lnd(i) = tsfcl(i) + snowd_lnd(i) = snowd(i) end if - if (icy(i)) then + if (icy(i)) then ! Ice uustar_ice(i) = uustar(i) - weasd_ice(i) = weasd(i) - tprcp_ice(i) = tprcp(i) - zorl_ice(i) = zorll(i) - tsfc_ice(i) = tisfc(i) - tsurf_ice(i)= tisfc(i) - snowd_ice(i) = snowd(i) - ep1d_ice(i) = 0. + weasd_ice(i) = weasd(i) + tprcp_ice(i) = tprcp(i) + zorl_ice(i) = zorll(i) +! tsfc_ice(i) = tisfc(i) +! tsurf_ice(i) = tisfc(i) + tsfc_ice(i) = tsfc(i) + tsurf_ice(i) = tsfc(i) + snowd_ice(i) = snowd(i) + ep1d_ice(i) = 0. + gflx_ice(i) = 0. end if enddo + ! Assign sea ice temperature to interstitial variable + do i = 1, im + tice(i) = tisfc(i) + end do + end subroutine GFS_surface_composites_pre_run end module GFS_surface_composites_pre @@ -175,147 +215,155 @@ end subroutine GFS_surface_composites_post_finalize #if 0 !> \section arg_table_GFS_surface_composites_post_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|---------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|-------------|------|------------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | cplflx | flag_for_flux_coupling | flag controlling cplflx collection (default off) | flag | 0 | logical | | in | F | -!! | flag_cice | flag_for_cice | flag for cice | flag | 1 | logical | | in | F | -!! | dry | flag_nonzero_land_surface_fraction | flag indicating presence of some land surface area fraction | flag | 1 | logical | | in | F | -!! | wet | flag_nonzero_wet_surface_fraction | flag indicating presence of some ocean or lake surface area fraction | flag | 1 | logical | | in | F | -!! | icy | flag_nonzero_sea_ice_surface_fraction | flag indicating presence of some sea ice surface area fraction | flag | 1 | logical | | in | F | -!! | lndfrac | land_area_fraction | fraction of horizontal grid area occupied by land | frac | 1 | real | kind_phys | in | F | -!! | lakfrac | lake_area_fraction | fraction of horizontal grid area occupied by lake | frac | 1 | real | kind_phys | in | F | -!! | ocnfrac | sea_area_fraction | fraction of horizontal grid area occupied by ocean | frac | 1 | real | kind_phys | in | F | -!! | cice | sea_ice_concentration | ice fraction over open water | frac | 1 | real | kind_phys | in | F | -!! | zorl | surface_roughness_length | surface roughness length | cm | 1 | real | kind_phys | inout | F | -!! | zorlo | surface_roughness_length_over_ocean | surface roughness length over ocean | cm | 1 | real | kind_phys | inout | F | -!! | zorll | surface_roughness_length_over_land | surface roughness length over land | cm | 1 | real | kind_phys | inout | F | -!! | zorl_ocn | surface_roughness_length_over_ocean_interstitial | surface roughness length over ocean (temporary use as interstitial) | cm | 1 | real | kind_phys | in | F | -!! | zorl_lnd | surface_roughness_length_over_land_interstitial | surface roughness length over land (temporary use as interstitial) | cm | 1 | real | kind_phys | in | F | -!! | zorl_ice | surface_roughness_length_over_ice_interstitial | surface roughness length over ice (temporary use as interstitial) | cm | 1 | real | kind_phys | in | F | -!! | cd | surface_drag_coefficient_for_momentum_in_air | surface exchange coeff for momentum | none | 1 | real | kind_phys | inout | F | -!! | cd_ocn | surface_drag_coefficient_for_momentum_in_air_over_ocean | surface exchange coeff for momentum over ocean | none | 1 | real | kind_phys | in | F | -!! | cd_lnd | surface_drag_coefficient_for_momentum_in_air_over_land | surface exchange coeff for momentum over land | none | 1 | real | kind_phys | in | F | -!! | cd_ice | surface_drag_coefficient_for_momentum_in_air_over_ice | surface exchange coeff for momentum over ice | none | 1 | real | kind_phys | in | F | -!! | cdq | surface_drag_coefficient_for_heat_and_moisture_in_air | surface exchange coeff heat & moisture | none | 1 | real | kind_phys | inout | F | -!! | cdq_ocn | surface_drag_coefficient_for_heat_and_moisture_in_air_over_ocean | surface exchange coeff heat & moisture over ocean | none | 1 | real | kind_phys | in | F | -!! | cdq_lnd | surface_drag_coefficient_for_heat_and_moisture_in_air_over_land | surface exchange coeff heat & moisture over land | none | 1 | real | kind_phys | in | F | -!! | cdq_ice | surface_drag_coefficient_for_heat_and_moisture_in_air_over_ice | surface exchange coeff heat & moisture over ice | none | 1 | real | kind_phys | in | F | -!! | rb | bulk_richardson_number_at_lowest_model_level | bulk Richardson number at the surface | none | 1 | real | kind_phys | inout | F | -!! | rb_ocn | bulk_richardson_number_at_lowest_model_level_over_ocean | bulk Richardson number at the surface over ocean | none | 1 | real | kind_phys | in | F | -!! | rb_lnd | bulk_richardson_number_at_lowest_model_level_over_land | bulk Richardson number at the surface over land | none | 1 | real | kind_phys | in | F | -!! | rb_ice | bulk_richardson_number_at_lowest_model_level_over_ice | bulk Richardson number at the surface over ice | none | 1 | real | kind_phys | in | F | -!! | stress | surface_wind_stress | surface wind stress | m2 s-2 | 1 | real | kind_phys | inout | F | -!! | stress_ocn | surface_wind_stress_over_ocean | surface wind stress over ocean | m2 s-2 | 1 | real | kind_phys | in | F | -!! | stress_lnd | surface_wind_stress_over_land | surface wind stress over land | m2 s-2 | 1 | real | kind_phys | in | F | -!! | stress_ice | surface_wind_stress_over_ice | surface wind stress over ice | m2 s-2 | 1 | real | kind_phys | in | F | -!! | ffmm | Monin-Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity function for momentum | none | 1 | real | kind_phys | inout | F | -!! | ffmm_ocn | Monin-Obukhov_similarity_function_for_momentum_over_ocean | Monin-Obukhov similarity function for momentum over ocean | none | 1 | real | kind_phys | in | F | -!! | ffmm_lnd | Monin-Obukhov_similarity_function_for_momentum_over_land | Monin-Obukhov similarity function for momentum over land | none | 1 | real | kind_phys | in | F | -!! | ffmm_ice | Monin-Obukhov_similarity_function_for_momentum_over_ice | Monin-Obukhov similarity function for momentum over ice | none | 1 | real | kind_phys | in | F | -!! | ffhh | Monin-Obukhov_similarity_function_for_heat | Monin-Obukhov similarity function for heat | none | 1 | real | kind_phys | inout | F | -!! | ffhh_ocn | Monin-Obukhov_similarity_function_for_heat_over_ocean | Monin-Obukhov similarity function for heat over ocean | none | 1 | real | kind_phys | in | F | -!! | ffhh_lnd | Monin-Obukhov_similarity_function_for_heat_over_land | Monin-Obukhov similarity function for heat over land | none | 1 | real | kind_phys | in | F | -!! | ffhh_ice | Monin-Obukhov_similarity_function_for_heat_over_ice | Monin-Obukhov similarity function for heat over ice | none | 1 | real | kind_phys | in | F | -!! | uustar | surface_friction_velocity | boundary layer parameter | m s-1 | 1 | real | kind_phys | inout | F | -!! | uustar_ocn | surface_friction_velocity_over_ocean | surface friction velocity over ocean | m s-1 | 1 | real | kind_phys | in | F | -!! | uustar_lnd | surface_friction_velocity_over_land | surface friction velocity over land | m s-1 | 1 | real | kind_phys | in | F | -!! | uustar_ice | surface_friction_velocity_over_ice | surface friction velocity over ice | m s-1 | 1 | real | kind_phys | in | F | -!! | fm10 | Monin-Obukhov_similarity_function_for_momentum_at_10m | Monin-Obukhov similarity parameter for momentum at 10m | none | 1 | real | kind_phys | inout | F | -!! | fm10_ocn | Monin-Obukhov_similarity_function_for_momentum_at_10m_over_ocean | Monin-Obukhov similarity parameter for momentum at 10m over ocean | none | 1 | real | kind_phys | in | F | -!! | fm10_lnd | Monin-Obukhov_similarity_function_for_momentum_at_10m_over_land | Monin-Obukhov similarity parameter for momentum at 10m over land | none | 1 | real | kind_phys | in | F | -!! | fm10_ice | Monin-Obukhov_similarity_function_for_momentum_at_10m_over_ice | Monin-Obukhov similarity parameter for momentum at 10m over ice | none | 1 | real | kind_phys | in | F | -!! | fh2 | Monin-Obukhov_similarity_function_for_heat_at_2m | Monin-Obukhov similarity parameter for heat at 2m | none | 1 | real | kind_phys | inout | F | -!! | fh2_ocn | Monin-Obukhov_similarity_function_for_heat_at_2m_over_ocean | Monin-Obukhov similarity parameter for heat at 2m over ocean | none | 1 | real | kind_phys | in | F | -!! | fh2_lnd | Monin-Obukhov_similarity_function_for_heat_at_2m_over_land | Monin-Obukhov similarity parameter for heat at 2m over land | none | 1 | real | kind_phys | in | F | -!! | fh2_ice | Monin-Obukhov_similarity_function_for_heat_at_2m_over_ice | Monin-Obukhov similarity parameter for heat at 2m over ice | none | 1 | real | kind_phys | in | F | -!! | tsurf | surface_skin_temperature_after_iteration | surface skin temperature after iteration | K | 1 | real | kind_phys | inout | F | -!! | tsurf_ocn | surface_skin_temperature_after_iteration_over_ocean | surface skin temperature after iteration over ocean | K | 1 | real | kind_phys | in | F | -!! | tsurf_lnd | surface_skin_temperature_after_iteration_over_land | surface skin temperature after iteration over land | K | 1 | real | kind_phys | in | F | -!! | tsurf_ice | surface_skin_temperature_after_iteration_over_ice | surface skin temperature after iteration over ice | K | 1 | real | kind_phys | in | F | -!! | cmm | surface_drag_wind_speed_for_momentum_in_air | momentum exchange coefficient | m s-1 | 1 | real | kind_phys | inout | F | -!! | cmm_ocn | surface_drag_wind_speed_for_momentum_in_air_over_ocean | momentum exchange coefficient over ocean | m s-1 | 1 | real | kind_phys | in | F | -!! | cmm_lnd | surface_drag_wind_speed_for_momentum_in_air_over_land | momentum exchange coefficient over land | m s-1 | 1 | real | kind_phys | in | F | -!! | cmm_ice | surface_drag_wind_speed_for_momentum_in_air_over_ice | momentum exchange coefficient over ice | m s-1 | 1 | real | kind_phys | in | F | -!! | chh | surface_drag_mass_flux_for_heat_and_moisture_in_air | thermal exchange coefficient | kg m-2 s-1 | 1 | real | kind_phys | inout | F | -!! | chh_ocn | surface_drag_mass_flux_for_heat_and_moisture_in_air_over_ocean | thermal exchange coefficient over ocean | kg m-2 s-1 | 1 | real | kind_phys | in | F | -!! | chh_lnd | surface_drag_mass_flux_for_heat_and_moisture_in_air_over_land | thermal exchange coefficient over land | kg m-2 s-1 | 1 | real | kind_phys | in | F | -!! | chh_ice | surface_drag_mass_flux_for_heat_and_moisture_in_air_over_ice | thermal exchange coefficient over ice | kg m-2 s-1 | 1 | real | kind_phys | in | F | -!! | gflx | upward_heat_flux_in_soil | soil heat flux | W m-2 | 1 | real | kind_phys | inout | F | -!! | gflx_ocn | upward_heat_flux_in_soil_over_ocean | soil heat flux over ocean | W m-2 | 1 | real | kind_phys | in | F | -!! | gflx_lnd | upward_heat_flux_in_soil_over_land | soil heat flux over land | W m-2 | 1 | real | kind_phys | in | F | -!! | gflx_ice | upward_heat_flux_in_soil_over_ice | soil heat flux over ice | W m-2 | 1 | real | kind_phys | in | F | -!! | ep1d | surface_upward_potential_latent_heat_flux | surface upward potential latent heat flux | W m-2 | 1 | real | kind_phys | inout | F | -!! | ep1d_ocn | surface_upward_potential_latent_heat_flux_over_ocean | surface upward potential latent heat flux over ocean | W m-2 | 1 | real | kind_phys | in | F | -!! | ep1d_lnd | surface_upward_potential_latent_heat_flux_over_land | surface upward potential latent heat flux over land | W m-2 | 1 | real | kind_phys | in | F | -!! | ep1d_ice | surface_upward_potential_latent_heat_flux_over_ice | surface upward potential latent heat flux over ice | W m-2 | 1 | real | kind_phys | in | F | -!! | weasd | water_equivalent_accumulated_snow_depth | water equiv of acc snow depth over land and sea ice | mm | 1 | real | kind_phys | inout | F | -!! | weasd_lnd | water_equivalent_accumulated_snow_depth_over_land | water equiv of acc snow depth over land | mm | 1 | real | kind_phys | in | F | -!! | weasd_ice | water_equivalent_accumulated_snow_depth_over_ice | water equiv of acc snow depth over ice | mm | 1 | real | kind_phys | in | F | -!! | snowd | surface_snow_thickness_water_equivalent | water equivalent snow depth | mm | 1 | real | kind_phys | inout | F | -!! | snowd_ocn | surface_snow_thickness_water_equivalent_over_ocean | water equivalent snow depth over ocean | mm | 1 | real | kind_phys | in | F | -!! | snowd_lnd | surface_snow_thickness_water_equivalent_over_land | water equivalent snow depth over land | mm | 1 | real | kind_phys | in | F | -!! | snowd_ice | surface_snow_thickness_water_equivalent_over_ice | water equivalent snow depth over ice | mm | 1 | real | kind_phys | in | F | -!! | tprcp | nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep | total precipitation amount in each time step | m | 1 | real | kind_phys | inout | F | -!! | tprcp_ocn | nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep_over_ocean | total precipitation amount in each time step over ocean | m | 1 | real | kind_phys | in | F | -!! | tprcp_lnd | nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep_over_land | total precipitation amount in each time step over land | m | 1 | real | kind_phys | in | F | -!! | tprcp_ice | nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep_over_ice | total precipitation amount in each time step over ice | m | 1 | real | kind_phys | in | F | -!! | evap | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | inout | F | -!! | evap_ocn | kinematic_surface_upward_latent_heat_flux_over_ocean | kinematic surface upward latent heat flux over ocean | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | -!! | evap_lnd | kinematic_surface_upward_latent_heat_flux_over_land | kinematic surface upward latent heat flux over land | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | -!! | evap_ice | kinematic_surface_upward_latent_heat_flux_over_ice | kinematic surface upward latent heat flux over ice | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | -!! | hflx | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | inout | F | -!! | hflx_ocn | kinematic_surface_upward_sensible_heat_flux_over_ocean | kinematic surface upward sensible heat flux over ocean | K m s-1 | 1 | real | kind_phys | in | F | -!! | hflx_lnd | kinematic_surface_upward_sensible_heat_flux_over_land | kinematic surface upward sensible heat flux over land | K m s-1 | 1 | real | kind_phys | in | F | -!! | hflx_ice | kinematic_surface_upward_sensible_heat_flux_over_ice | kinematic surface upward sensible heat flux over ice | K m s-1 | 1 | real | kind_phys | in | F | -!! | qss | surface_specific_humidity | surface air saturation specific humidity | kg kg-1 | 1 | real | kind_phys | inout | F | -!! | qss_ocn | surface_specific_humidity_over_ocean | surface air saturation specific humidity over ocean | kg kg-1 | 1 | real | kind_phys | in | F | -!! | qss_lnd | surface_specific_humidity_over_land | surface air saturation specific humidity over land | kg kg-1 | 1 | real | kind_phys | in | F | -!! | qss_ice | surface_specific_humidity_over_ice | surface air saturation specific humidity over ice | kg kg-1 | 1 | real | kind_phys | in | F | -!! | tsfc | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | inout | F | -!! | tsfco | sea_surface_temperature | sea surface temperature | K | 1 | real | kind_phys | inout | F | -!! | tsfcl | surface_skin_temperature_over_land | surface skin temperature over land | K | 1 | real | kind_phys | inout | F | -!! | tsfc_ocn | surface_skin_temperature_over_ocean_interstitial | surface skin temperature over ocean (temporary use as interstitial) | K | 1 | real | kind_phys | in | F | -!! | tsfc_lnd | surface_skin_temperature_over_land_interstitial | surface skin temperature over land (temporary use as interstitial) | K | 1 | real | kind_phys | in | F | -!! | tsfc_ice | surface_skin_temperature_over_ice_interstitial | surface skin temperature over ice (temporary use as interstitial) | K | 1 | real | kind_phys | in | F | -!! | tisfc | sea_ice_temperature | sea ice surface skin temperature | K | 1 | real | kind_phys | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | +!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | +!! |----------------|-----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|-------------|------|------------|-----------|--------|----------| +!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | +!! | cplflx | flag_for_flux_coupling | flag controlling cplflx collection (default off) | flag | 0 | logical | | in | F | +!! | frac_grid | flag_for_fractional_grid | flag for fractional grid | flag | 0 | logical | | in | F | +!! | flag_cice | flag_for_cice | flag for cice | flag | 1 | logical | | in | F | +!! | islmsk | sea_land_ice_mask | sea/land/ice mask (=0/1/2) | flag | 1 | integer | | in | F | +!! | dry | flag_nonzero_land_surface_fraction | flag indicating presence of some land surface area fraction | flag | 1 | logical | | in | F | +!! | wet | flag_nonzero_wet_surface_fraction | flag indicating presence of some ocean or lake surface area fraction | flag | 1 | logical | | in | F | +!! | icy | flag_nonzero_sea_ice_surface_fraction | flag indicating presence of some sea ice surface area fraction | flag | 1 | logical | | in | F | +!! | landfrac | land_area_fraction | fraction of horizontal grid area occupied by land | frac | 1 | real | kind_phys | in | F | +!! | zorl | surface_roughness_length | surface roughness length | cm | 1 | real | kind_phys | inout | F | +!! | zorlo | surface_roughness_length_over_ocean | surface roughness length over ocean | cm | 1 | real | kind_phys | inout | F | +!! | zorll | surface_roughness_length_over_land | surface roughness length over land | cm | 1 | real | kind_phys | inout | F | +!! | zorl_ocn | surface_roughness_length_over_ocean_interstitial | surface roughness length over ocean (temporary use as interstitial) | cm | 1 | real | kind_phys | in | F | +!! | zorl_lnd | surface_roughness_length_over_land_interstitial | surface roughness length over land (temporary use as interstitial) | cm | 1 | real | kind_phys | in | F | +!! | zorl_ice | surface_roughness_length_over_ice_interstitial | surface roughness length over ice (temporary use as interstitial) | cm | 1 | real | kind_phys | in | F | +!! | cd | surface_drag_coefficient_for_momentum_in_air | surface exchange coeff for momentum | none | 1 | real | kind_phys | inout | F | +!! | cd_ocn | surface_drag_coefficient_for_momentum_in_air_over_ocean | surface exchange coeff for momentum over ocean | none | 1 | real | kind_phys | in | F | +!! | cd_lnd | surface_drag_coefficient_for_momentum_in_air_over_land | surface exchange coeff for momentum over land | none | 1 | real | kind_phys | in | F | +!! | cd_ice | surface_drag_coefficient_for_momentum_in_air_over_ice | surface exchange coeff for momentum over ice | none | 1 | real | kind_phys | in | F | +!! | cdq | surface_drag_coefficient_for_heat_and_moisture_in_air | surface exchange coeff heat & moisture | none | 1 | real | kind_phys | inout | F | +!! | cdq_ocn | surface_drag_coefficient_for_heat_and_moisture_in_air_over_ocean | surface exchange coeff heat & moisture over ocean | none | 1 | real | kind_phys | in | F | +!! | cdq_lnd | surface_drag_coefficient_for_heat_and_moisture_in_air_over_land | surface exchange coeff heat & moisture over land | none | 1 | real | kind_phys | in | F | +!! | cdq_ice | surface_drag_coefficient_for_heat_and_moisture_in_air_over_ice | surface exchange coeff heat & moisture over ice | none | 1 | real | kind_phys | in | F | +!! | rb | bulk_richardson_number_at_lowest_model_level | bulk Richardson number at the surface | none | 1 | real | kind_phys | inout | F | +!! | rb_ocn | bulk_richardson_number_at_lowest_model_level_over_ocean | bulk Richardson number at the surface over ocean | none | 1 | real | kind_phys | in | F | +!! | rb_lnd | bulk_richardson_number_at_lowest_model_level_over_land | bulk Richardson number at the surface over land | none | 1 | real | kind_phys | in | F | +!! | rb_ice | bulk_richardson_number_at_lowest_model_level_over_ice | bulk Richardson number at the surface over ice | none | 1 | real | kind_phys | in | F | +!! | stress | surface_wind_stress | surface wind stress | m2 s-2 | 1 | real | kind_phys | inout | F | +!! | stress_ocn | surface_wind_stress_over_ocean | surface wind stress over ocean | m2 s-2 | 1 | real | kind_phys | in | F | +!! | stress_lnd | surface_wind_stress_over_land | surface wind stress over land | m2 s-2 | 1 | real | kind_phys | in | F | +!! | stress_ice | surface_wind_stress_over_ice | surface wind stress over ice | m2 s-2 | 1 | real | kind_phys | in | F | +!! | ffmm | Monin-Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity function for momentum | none | 1 | real | kind_phys | inout | F | +!! | ffmm_ocn | Monin-Obukhov_similarity_function_for_momentum_over_ocean | Monin-Obukhov similarity function for momentum over ocean | none | 1 | real | kind_phys | in | F | +!! | ffmm_lnd | Monin-Obukhov_similarity_function_for_momentum_over_land | Monin-Obukhov similarity function for momentum over land | none | 1 | real | kind_phys | in | F | +!! | ffmm_ice | Monin-Obukhov_similarity_function_for_momentum_over_ice | Monin-Obukhov similarity function for momentum over ice | none | 1 | real | kind_phys | in | F | +!! | ffhh | Monin-Obukhov_similarity_function_for_heat | Monin-Obukhov similarity function for heat | none | 1 | real | kind_phys | inout | F | +!! | ffhh_ocn | Monin-Obukhov_similarity_function_for_heat_over_ocean | Monin-Obukhov similarity function for heat over ocean | none | 1 | real | kind_phys | in | F | +!! | ffhh_lnd | Monin-Obukhov_similarity_function_for_heat_over_land | Monin-Obukhov similarity function for heat over land | none | 1 | real | kind_phys | in | F | +!! | ffhh_ice | Monin-Obukhov_similarity_function_for_heat_over_ice | Monin-Obukhov similarity function for heat over ice | none | 1 | real | kind_phys | in | F | +!! | uustar | surface_friction_velocity | boundary layer parameter | m s-1 | 1 | real | kind_phys | inout | F | +!! | uustar_ocn | surface_friction_velocity_over_ocean | surface friction velocity over ocean | m s-1 | 1 | real | kind_phys | in | F | +!! | uustar_lnd | surface_friction_velocity_over_land | surface friction velocity over land | m s-1 | 1 | real | kind_phys | in | F | +!! | uustar_ice | surface_friction_velocity_over_ice | surface friction velocity over ice | m s-1 | 1 | real | kind_phys | in | F | +!! | fm10 | Monin-Obukhov_similarity_function_for_momentum_at_10m | Monin-Obukhov similarity parameter for momentum at 10m | none | 1 | real | kind_phys | inout | F | +!! | fm10_ocn | Monin-Obukhov_similarity_function_for_momentum_at_10m_over_ocean | Monin-Obukhov similarity parameter for momentum at 10m over ocean | none | 1 | real | kind_phys | in | F | +!! | fm10_lnd | Monin-Obukhov_similarity_function_for_momentum_at_10m_over_land | Monin-Obukhov similarity parameter for momentum at 10m over land | none | 1 | real | kind_phys | in | F | +!! | fm10_ice | Monin-Obukhov_similarity_function_for_momentum_at_10m_over_ice | Monin-Obukhov similarity parameter for momentum at 10m over ice | none | 1 | real | kind_phys | in | F | +!! | fh2 | Monin-Obukhov_similarity_function_for_heat_at_2m | Monin-Obukhov similarity parameter for heat at 2m | none | 1 | real | kind_phys | inout | F | +!! | fh2_ocn | Monin-Obukhov_similarity_function_for_heat_at_2m_over_ocean | Monin-Obukhov similarity parameter for heat at 2m over ocean | none | 1 | real | kind_phys | in | F | +!! | fh2_lnd | Monin-Obukhov_similarity_function_for_heat_at_2m_over_land | Monin-Obukhov similarity parameter for heat at 2m over land | none | 1 | real | kind_phys | in | F | +!! | fh2_ice | Monin-Obukhov_similarity_function_for_heat_at_2m_over_ice | Monin-Obukhov similarity parameter for heat at 2m over ice | none | 1 | real | kind_phys | in | F | +!! | tsurf | surface_skin_temperature_after_iteration | surface skin temperature after iteration | K | 1 | real | kind_phys | inout | F | +!! | tsurf_ocn | surface_skin_temperature_after_iteration_over_ocean | surface skin temperature after iteration over ocean | K | 1 | real | kind_phys | in | F | +!! | tsurf_lnd | surface_skin_temperature_after_iteration_over_land | surface skin temperature after iteration over land | K | 1 | real | kind_phys | in | F | +!! | tsurf_ice | surface_skin_temperature_after_iteration_over_ice | surface skin temperature after iteration over ice | K | 1 | real | kind_phys | in | F | +!! | cmm | surface_drag_wind_speed_for_momentum_in_air | momentum exchange coefficient | m s-1 | 1 | real | kind_phys | inout | F | +!! | cmm_ocn | surface_drag_wind_speed_for_momentum_in_air_over_ocean | momentum exchange coefficient over ocean | m s-1 | 1 | real | kind_phys | in | F | +!! | cmm_lnd | surface_drag_wind_speed_for_momentum_in_air_over_land | momentum exchange coefficient over land | m s-1 | 1 | real | kind_phys | in | F | +!! | cmm_ice | surface_drag_wind_speed_for_momentum_in_air_over_ice | momentum exchange coefficient over ice | m s-1 | 1 | real | kind_phys | in | F | +!! | chh | surface_drag_mass_flux_for_heat_and_moisture_in_air | thermal exchange coefficient | kg m-2 s-1 | 1 | real | kind_phys | inout | F | +!! | chh_ocn | surface_drag_mass_flux_for_heat_and_moisture_in_air_over_ocean | thermal exchange coefficient over ocean | kg m-2 s-1 | 1 | real | kind_phys | in | F | +!! | chh_lnd | surface_drag_mass_flux_for_heat_and_moisture_in_air_over_land | thermal exchange coefficient over land | kg m-2 s-1 | 1 | real | kind_phys | in | F | +!! | chh_ice | surface_drag_mass_flux_for_heat_and_moisture_in_air_over_ice | thermal exchange coefficient over ice | kg m-2 s-1 | 1 | real | kind_phys | in | F | +!! | gflx | upward_heat_flux_in_soil | soil heat flux | W m-2 | 1 | real | kind_phys | inout | F | +!! | gflx_ocn | upward_heat_flux_in_soil_over_ocean | soil heat flux over ocean | W m-2 | 1 | real | kind_phys | in | F | +!! | gflx_lnd | upward_heat_flux_in_soil_over_land | soil heat flux over land | W m-2 | 1 | real | kind_phys | in | F | +!! | gflx_ice | upward_heat_flux_in_soil_over_ice | soil heat flux over ice | W m-2 | 1 | real | kind_phys | in | F | +!! | ep1d | surface_upward_potential_latent_heat_flux | surface upward potential latent heat flux | W m-2 | 1 | real | kind_phys | inout | F | +!! | ep1d_ocn | surface_upward_potential_latent_heat_flux_over_ocean | surface upward potential latent heat flux over ocean | W m-2 | 1 | real | kind_phys | in | F | +!! | ep1d_lnd | surface_upward_potential_latent_heat_flux_over_land | surface upward potential latent heat flux over land | W m-2 | 1 | real | kind_phys | in | F | +!! | ep1d_ice | surface_upward_potential_latent_heat_flux_over_ice | surface upward potential latent heat flux over ice | W m-2 | 1 | real | kind_phys | in | F | +!! | weasd | water_equivalent_accumulated_snow_depth | water equiv of acc snow depth over land and sea ice | mm | 1 | real | kind_phys | inout | F | +!! | weasd_ocn | water_equivalent_accumulated_snow_depth_over_ocean | water equiv of acc snow depth over ocean | mm | 1 | real | kind_phys | in | F | +!! | weasd_lnd | water_equivalent_accumulated_snow_depth_over_land | water equiv of acc snow depth over land | mm | 1 | real | kind_phys | in | F | +!! | weasd_ice | water_equivalent_accumulated_snow_depth_over_ice | water equiv of acc snow depth over ice | mm | 1 | real | kind_phys | in | F | +!! | snowd | surface_snow_thickness_water_equivalent | water equivalent snow depth | mm | 1 | real | kind_phys | inout | F | +!! | snowd_ocn | surface_snow_thickness_water_equivalent_over_ocean | water equivalent snow depth over ocean | mm | 1 | real | kind_phys | in | F | +!! | snowd_lnd | surface_snow_thickness_water_equivalent_over_land | water equivalent snow depth over land | mm | 1 | real | kind_phys | in | F | +!! | snowd_ice | surface_snow_thickness_water_equivalent_over_ice | water equivalent snow depth over ice | mm | 1 | real | kind_phys | in | F | +!! | tprcp | nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep | total precipitation amount in each time step | m | 1 | real | kind_phys | inout | F | +!! | tprcp_ocn | nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep_over_ocean | total precipitation amount in each time step over ocean | m | 1 | real | kind_phys | in | F | +!! | tprcp_lnd | nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep_over_land | total precipitation amount in each time step over land | m | 1 | real | kind_phys | in | F | +!! | tprcp_ice | nonnegative_lwe_thickness_of_precipitation_amount_on_dynamics_timestep_over_ice | total precipitation amount in each time step over ice | m | 1 | real | kind_phys | in | F | +!! | evap | kinematic_surface_upward_latent_heat_flux | kinematic surface upward latent heat flux | kg kg-1 m s-1 | 1 | real | kind_phys | inout | F | +!! | evap_ocn | kinematic_surface_upward_latent_heat_flux_over_ocean | kinematic surface upward latent heat flux over ocean | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | +!! | evap_lnd | kinematic_surface_upward_latent_heat_flux_over_land | kinematic surface upward latent heat flux over land | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | +!! | evap_ice | kinematic_surface_upward_latent_heat_flux_over_ice | kinematic surface upward latent heat flux over ice | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | +!! | hflx | kinematic_surface_upward_sensible_heat_flux | kinematic surface upward sensible heat flux | K m s-1 | 1 | real | kind_phys | inout | F | +!! | hflx_ocn | kinematic_surface_upward_sensible_heat_flux_over_ocean | kinematic surface upward sensible heat flux over ocean | K m s-1 | 1 | real | kind_phys | in | F | +!! | hflx_lnd | kinematic_surface_upward_sensible_heat_flux_over_land | kinematic surface upward sensible heat flux over land | K m s-1 | 1 | real | kind_phys | in | F | +!! | hflx_ice | kinematic_surface_upward_sensible_heat_flux_over_ice | kinematic surface upward sensible heat flux over ice | K m s-1 | 1 | real | kind_phys | in | F | +!! | qss | surface_specific_humidity | surface air saturation specific humidity | kg kg-1 | 1 | real | kind_phys | inout | F | +!! | qss_ocn | surface_specific_humidity_over_ocean | surface air saturation specific humidity over ocean | kg kg-1 | 1 | real | kind_phys | in | F | +!! | qss_lnd | surface_specific_humidity_over_land | surface air saturation specific humidity over land | kg kg-1 | 1 | real | kind_phys | in | F | +!! | qss_ice | surface_specific_humidity_over_ice | surface air saturation specific humidity over ice | kg kg-1 | 1 | real | kind_phys | in | F | +!! | tsfc | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | inout | F | +!! | tsfco | sea_surface_temperature | sea surface temperature | K | 1 | real | kind_phys | inout | F | +!! | tsfcl | surface_skin_temperature_over_land | surface skin temperature over land | K | 1 | real | kind_phys | inout | F | +!! | tsfc_ocn | surface_skin_temperature_over_ocean_interstitial | surface skin temperature over ocean (temporary use as interstitial) | K | 1 | real | kind_phys | in | F | +!! | tsfc_lnd | surface_skin_temperature_over_land_interstitial | surface skin temperature over land (temporary use as interstitial) | K | 1 | real | kind_phys | in | F | +!! | tsfc_ice | surface_skin_temperature_over_ice_interstitial | surface skin temperature over ice (temporary use as interstitial) | K | 1 | real | kind_phys | in | F | +!! | tisfc | sea_ice_temperature | sea ice surface skin temperature | K | 1 | real | kind_phys | inout | F | +!! | tice | sea_ice_temperature_interstitial | sea ice surface skin temperature use as interstitial | K | 1 | real | kind_phys | in | F | +!! | hice | sea_ice_thickness | sea ice thickness | m | 1 | real | kind_phys | inout | F | +!! | cice | sea_ice_concentration | ice fraction over open water | frac | 1 | real | kind_phys | inout | F | +!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | +!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | !! #endif - subroutine GFS_surface_composites_post_run ( & - im, cplflx, flag_cice, dry, wet, icy, lndfrac, lakfrac, ocnfrac, cice, zorl, zorlo, zorll, zorl_ocn, zorl_lnd, zorl_ice, & + subroutine GFS_surface_composites_post_run ( & + im, cplflx, frac_grid, flag_cice, islmsk, dry, wet, icy, landfrac, zorl, zorlo, zorll, zorl_ocn, zorl_lnd, zorl_ice, & cd, cd_ocn, cd_lnd, cd_ice, cdq, cdq_ocn, cdq_lnd, cdq_ice, rb, rb_ocn, rb_lnd, rb_ice, stress, stress_ocn, stress_lnd, & stress_ice, ffmm, ffmm_ocn, ffmm_lnd, ffmm_ice, ffhh, ffhh_ocn, ffhh_lnd, ffhh_ice, uustar, uustar_ocn, uustar_lnd, & uustar_ice, fm10, fm10_ocn, fm10_lnd, fm10_ice, fh2, fh2_ocn, fh2_lnd, fh2_ice, tsurf, tsurf_ocn, tsurf_lnd, tsurf_ice, & cmm, cmm_ocn, cmm_lnd, cmm_ice, chh, chh_ocn, chh_lnd, chh_ice, gflx, gflx_ocn, gflx_lnd, gflx_ice, ep1d, ep1d_ocn, & - ep1d_lnd, ep1d_ice, weasd, weasd_lnd, weasd_ice, snowd, snowd_ocn, snowd_lnd, snowd_ice, tprcp, tprcp_ocn, tprcp_lnd, & - tprcp_ice, evap, evap_ocn, evap_lnd, evap_ice, hflx, hflx_ocn, hflx_lnd, hflx_ice, qss, qss_ocn, qss_lnd, qss_ice, & - tsfc, tsfco, tsfcl, tsfc_ocn, tsfc_lnd, tsfc_ice, tisfc, errmsg, errflg) + ep1d_lnd, ep1d_ice, weasd, weasd_ocn, weasd_lnd, weasd_ice, snowd, snowd_ocn, snowd_lnd, snowd_ice, tprcp, tprcp_ocn, & + tprcp_lnd, tprcp_ice, evap, evap_ocn, evap_lnd, evap_ice, hflx, hflx_ocn, hflx_lnd, hflx_ice, qss, qss_ocn, qss_lnd, & + qss_ice, tsfc, tsfco, tsfcl, tsfc_ocn, tsfc_lnd, tsfc_ice, tisfc, tice, hice, cice, errmsg, errflg) use machine, only: kind_phys implicit none integer, intent(in) :: im - logical, intent(in) :: cplflx + logical, intent(in) :: cplflx, frac_grid logical, dimension(im), intent(in) :: flag_cice, dry, wet, icy - - real(kind=kind_phys), dimension(im), intent(in) :: lndfrac, lakfrac, ocnfrac, cice, & + integer, dimension(im), intent(in) :: islmsk + real(kind=kind_phys), dimension(im), intent(in) :: landfrac, & zorl_ocn, zorl_lnd, zorl_ice, cd_ocn, cd_lnd, cd_ice, cdq_ocn, cdq_lnd, cdq_ice, rb_ocn, rb_lnd, rb_ice, stress_ocn, & stress_lnd, stress_ice, ffmm_ocn, ffmm_lnd, ffmm_ice, ffhh_ocn, ffhh_lnd, ffhh_ice, uustar_ocn, uustar_lnd, uustar_ice, & fm10_ocn, fm10_lnd, fm10_ice, fh2_ocn, fh2_lnd, fh2_ice, tsurf_ocn, tsurf_lnd, tsurf_ice, cmm_ocn, cmm_lnd, cmm_ice, & - chh_ocn, chh_lnd, chh_ice, gflx_ocn, gflx_lnd, gflx_ice, ep1d_ocn, ep1d_lnd, ep1d_ice, weasd_lnd, weasd_ice, snowd_ocn, & - snowd_lnd, snowd_ice,tprcp_ocn, tprcp_lnd, tprcp_ice, evap_ocn, evap_lnd, evap_ice, hflx_ocn, hflx_lnd, hflx_ice, & - qss_ocn, qss_lnd, qss_ice, tsfc_ocn, tsfc_lnd, tsfc_ice + chh_ocn, chh_lnd, chh_ice, gflx_ocn, gflx_lnd, gflx_ice, ep1d_ocn, ep1d_lnd, ep1d_ice, weasd_ocn, weasd_lnd, weasd_ice, & + snowd_ocn, snowd_lnd, snowd_ice,tprcp_ocn, tprcp_lnd, tprcp_ice, evap_ocn, evap_lnd, evap_ice, hflx_ocn, hflx_lnd, & + hflx_ice, qss_ocn, qss_lnd, qss_ice, tsfc_ocn, tsfc_lnd, tsfc_ice real(kind=kind_phys), dimension(im), intent(inout) :: zorl, zorlo, zorll, 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 + character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg + ! Local variables integer :: i + real(kind=kind_phys) :: txl, txi, txo ! Initialize CCPP error handling variables errmsg = '' @@ -323,155 +371,174 @@ subroutine GFS_surface_composites_post_run ( ! --- generate ocean/land/ice composites - ! DH* - !write(0,*) "DH DEBUG composites: i, cplflx, flag_cice, dry, wet, icy, ocnfrac, lndfrac, lakfrac, cice, tsfc_{lnd,ocn,ice}, tsfc, tsfcl, tsfco, tisfc" - ! *DH - - do i=1, im - - ! --- three-way composites (fields from sfc_diff) - zorl(i) = cmposit3(ocnfrac(i), lndfrac(i), & - lakfrac(i),cice(i), & - zorl_ocn(i), zorl_lnd(i), zorl_ice(i)) - cd(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - cd_ocn(i), cd_lnd(i), cd_ice(i)) - cdq(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - cdq_ocn(i), cdq_lnd(i), cdq_ice(i)) - rb(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - rb_ocn(i), rb_lnd(i), rb_ice(i)) - stress(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - stress_ocn(i),stress_lnd(i),stress_ice(i)) - ffmm(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - ffmm_ocn(i), ffmm_lnd(i), ffmm_ice(i)) - ffhh(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - ffhh_ocn(i), ffhh_lnd(i), ffhh_ice(i)) - uustar(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - uustar_ocn(i),uustar_lnd(i),uustar_ice(i)) - fm10(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - fm10_ocn(i), fm10_lnd(i), fm10_ice(i)) - fh2(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - fh2_ocn(i), fh2_lnd(i), fh2_ice(i)) - tsurf(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - tsurf_ocn(i), tsurf_lnd(i), tsurf_ice(i)) - cmm(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - cmm_ocn(i), cmm_lnd(i), cmm_ice(i)) - chh(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - chh_ocn(i), chh_lnd(i), chh_ice(i)) - gflx(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - gflx_ocn(i), gflx_lnd(i), gflx_ice(i)) - ep1d(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - ep1d_ocn(i), ep1d_lnd(i), ep1d_ice(i)) - weasd(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - weasd(i), weasd_lnd(i), weasd_ice(i)) - snowd(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - snowd_ocn(i), snowd_lnd(i), snowd_ice(i)) - tprcp(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - tprcp_ocn(i), tprcp_lnd(i), tprcp_ice(i)) - - if(cplflx .and. flag_cice(i)) then ! 3-way when sfc_cice is used - evap(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - evap_ocn(i), evap_lnd(i), evap_ice(i)) - hflx(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - hflx_ocn(i), hflx_lnd(i), hflx_ice(i)) - qss(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - qss_ocn(i), qss_lnd(i), qss_ice(i)) - tsfc(i) = cmposit3(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - tsfc_ocn(i), tsfc_lnd(i), tsfc_ice(i)) - else ! 2-way when sfc_sice used (fields already composited in sfc_sice) - evap(i) = cmposit2(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - evap_ocn(i), evap_lnd(i), evap_ice(i)) - hflx(i) = cmposit2(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - hflx_ocn(i), hflx_lnd(i), hflx_ice(i)) - qss(i) = cmposit2(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - qss_ocn(i), qss_lnd(i), qss_ice(i)) - tsfc(i) = cmposit2(ocnfrac(i),lndfrac(i), & - lakfrac(i),cice(i), & - tsfc_ocn(i), tsfc_lnd(i), tsfc_ice(i)) - if(icy(i)) then - cmm(i) = cmm_ice(i) - chh(i) = chh_ice(i) - gflx(i) = gflx_ice(i) - ep1d(i) = ep1d_ice(i) - weasd(i) = weasd_ice(i) - snowd(i) = snowd_ice(i) + if (frac_grid) then + + do i=1, im + + ! Three-way composites (fields from sfc_diff) + txl = landfrac(i) + txi = cice(i) ! here cice is grid fraction that is ice + txo = 1.0 - txl - txi + + zorl(i) = txl*zorl_lnd(i) + txi*zorl_ice(i) + txo*zorl_ocn(i) + cd(i) = txl*cd_lnd(i) + txi*cd_ice(i) + txo*cd_ocn(i) + cdq(i) = txl*cdq_lnd(i) + txi*cdq_ice(i) + txo*cdq_ocn(i) + rb(i) = txl*rb_lnd(i) + txi*rb_ice(i) + txo*rb_ocn(i) + stress(i) = txl*stress_lnd(i) + txi*stress_ice(i) + txo*stress_ocn(i) + ffmm(i) = txl*ffmm_lnd(i) + txi*ffmm_ice(i) + txo*ffmm_ocn(i) + ffhh(i) = txl*ffhh_lnd(i) + txi*ffhh_ice(i) + txo*ffhh_ocn(i) + uustar(i) = txl*uustar_lnd(i) + txi*uustar_ice(i) + txo*uustar_ocn(i) + fm10(i) = txl*fm10_lnd(i) + txi*fm10_ice(i) + txo*fm10_ocn(i) + fh2(i) = txl*fh2_lnd(i) + txi*fh2_ice(i) + txo*fh2_ocn(i) + !tsurf(i) = txl*tsurf_lnd(i) + txi*tice(i) + txo*tsurf_ocn(i) + !tsurf(i) = txl*tsurf_lnd(i) + txi*tsurf_ice(i) + txo*tsurf_ocn(i) ! not used again! Moorthi + cmm(i) = txl*cmm_lnd(i) + txi*cmm_ice(i) + txo*cmm_ocn(i) + chh(i) = txl*chh_lnd(i) + txi*chh_ice(i) + txo*chh_ocn(i) + gflx(i) = txl*gflx_lnd(i) + txi*gflx_ice(i) + txo*gflx_ocn(i) + ep1d(i) = txl*ep1d_lnd(i) + txi*ep1d_ice(i) + txo*ep1d_ocn(i) + !weasd(i) = txl*weasd_lnd(i) + txi*weasd_ice(i) + txo*weasd_ocn(i) + !snowd(i) = txl*snowd_lnd(i) + txi*snowd_ice(i) + txo*snowd_ocn(i) + weasd(i) = txl*weasd_lnd(i) + txi*weasd_ice(i) + snowd(i) = txl*snowd_lnd(i) + txi*snowd_ice(i) + tprcp(i) = txl*tprcp_lnd(i) + txi*tprcp_ice(i) + txo*tprcp_ocn(i) + evap(i) = txl*evap_lnd(i) + txi*evap_ice(i) + txo*evap_ocn(i) + hflx(i) = txl*hflx_lnd(i) + txi*hflx_ice(i) + txo*hflx_ocn(i) + qss(i) = txl*qss_lnd(i) + txi*qss_ice(i) + txo*qss_ocn(i) + tsfc(i) = txl*tsfc_lnd(i) + txi*tice(i) + txo*tsfc_ocn(i) + !tsfc(i) = txl*tsfc_lnd(i) + txi*tsfc_ice(i) + txo*tsfc_ocn(i) + + zorll(i) = zorl_lnd(i) + zorlo(i) = zorl_ocn(i) + + if (dry(i)) tsfcl(i) = tsfc_lnd(i) ! over land + if (wet(i)) tsfco(i) = tsfc_ocn(i) ! over lake or ocean when uncoupled + tisfc(i) = tsfc(i) ! assume bitwise identical on non-icy points + if (icy(i)) then + tisfc(i) = tsfc_ice(i) ! over ice when uncoupled +! tisfc(i) = tice(i) ! over ice when uncoupled + else + hice(i) = 0.0 + cice(i) = 0.0 end if - endif ! cplflx .and. flag_cice - - zorll(i) = zorl_lnd(i) - zorlo(i) = zorl_ocn(i) - if (dry(i)) tsfcl(i) = tsfc_lnd(i) - if (wet(i)) then - tsfco(i) = tsfc_ocn(i) - tisfc(i) = tsfc_ice(i) - end if - - ! DH* - !write(0,'(i5,5(1x,l),11e16.7)') i, cplflx, flag_cice(i), dry(i), wet(i), icy(i), & - ! ocnfrac(i), lndfrac(i), lakfrac(i), & - ! cice(i), tsfc_lnd(i), tsfc_ocn(i), tsfc_ice(i), & - ! tsfc(i), tsfcl(i), tsfco(i), tisfc(i) - ! *DH - - end do +! if (wet(i) .and. .not. cplflx) then +! tsfco(i) = tsfc3_ocn(i) ! over lake or ocean when uncoupled +! tisfc(i) = tsfc3_ice(i) ! over ice when uncoupled +! endif - ! --- compositing done - - end subroutine GFS_surface_composites_post_run + end do + else - real function cmposit2(frac_ocean,frac_dry,frac_lake,frac_ice,oceanval,landval,iceval) -! --- 2-way compositing (use with ice/non-ice composited variables) - implicit none - real(kind=kind_phys),intent(IN) :: frac_ocean,frac_dry,frac_lake,frac_ice,oceanval,landval,iceval - real(kind=kind_phys) :: frac_wet + do i=1,im + if (islmsk(i) == 1) then + zorl(i) = zorl_lnd(i) + cd(i) = cd_lnd(i) + cdq(i) = cdq_lnd(i) + rb(i) = rb_lnd(i) + stress(i) = stress_lnd(i) + ffmm(i) = ffmm_lnd(i) + ffhh(i) = ffhh_lnd(i) + uustar(i) = uustar_lnd(i) + fm10(i) = fm10_lnd(i) + fh2(i) = fh2_lnd(i) + !tsurf(i) = tsurf_lnd(i) + cmm(i) = cmm_lnd(i) + chh(i) = chh_lnd(i) + gflx(i) = gflx_lnd(i) + ep1d(i) = ep1d_lnd(i) + weasd(i) = weasd_lnd(i) + snowd(i) = snowd_lnd(i) + tprcp(i) = tprcp_lnd(i) + evap(i) = evap_lnd(i) + hflx(i) = hflx_lnd(i) + qss(i) = qss_lnd(i) + tsfc(i) = tsfc_lnd(i) + cmm(i) = cmm_lnd(i) + chh(i) = chh_lnd(i) + elseif (islmsk(i) == 0) then + zorl(i) = zorl_ocn(i) + cd(i) = cd_ocn(i) + cdq(i) = cdq_ocn(i) + rb(i) = rb_ocn(i) + stress(i) = stress_ocn(i) + ffmm(i) = ffmm_ocn(i) + ffhh(i) = ffhh_ocn(i) + uustar(i) = uustar_ocn(i) + fm10(i) = fm10_ocn(i) + fh2(i) = fh2_ocn(i) + !tsurf(i) = tsurf_ocn(i) + cmm(i) = cmm_ocn(i) + chh(i) = chh_ocn(i) + gflx(i) = gflx_ocn(i) + ep1d(i) = ep1d_ocn(i) + weasd(i) = weasd_ocn(i) + snowd(i) = snowd_ocn(i) + tprcp(i) = tprcp_ocn(i) + evap(i) = evap_ocn(i) + hflx(i) = hflx_ocn(i) + qss(i) = qss_ocn(i) + tsfc(i) = tsfc_ocn(i) + cmm(i) = cmm_ocn(i) + chh(i) = chh_ocn(i) + else + zorl(i) = zorl_ice(i) + cd(i) = cd_ice(i) + cdq(i) = cdq_ice(i) + rb(i) = rb_ice(i) + stress(i) = stress_ice(i) + ffmm(i) = ffmm_ice(i) + ffhh(i) = ffhh_ice(i) + uustar(i) = uustar_ice(i) + fm10(i) = fm10_ice(i) + fh2(i) = fh2_ice(i) + !tsurf(i) = tsurf_ice(i) + cmm(i) = cmm_ice(i) + chh(i) = chh_ice(i) + gflx(i) = gflx_ice(i) + ep1d(i) = ep1d_ice(i) + weasd(i) = weasd_ice(i) + snowd(i) = snowd_ice(i) + tprcp(i) = tprcp_ice(i) + evap(i) = evap_ice(i) + hflx(i) = hflx_ice(i) + qss(i) = qss_ice(i) + tsfc(i) = tsfc_ice(i) + cmm(i) = cmm_ice(i) + chh(i) = chh_ice(i) + endif + + zorll(i) = zorl_lnd(i) + zorlo(i) = zorl_ocn(i) + + if (flag_cice(i)) then + evap(i) = cice(i) * evap_ice(i) + (1.0-cice(i)) * evap_ocn(i) + hflx(i) = cice(i) * hflx_ice(i) + (1.0-cice(i)) * hflx_ocn(i) + tsfc(i) = cice(i) * tsfc_ice(i) + (1.0-cice(i)) * tsfc_ocn(i) + endif + + if (dry(i)) tsfcl(i) = tsfc_lnd(i) ! over land + if (wet(i)) tsfco(i) = tsfc_ocn(i) ! over lake or ocean when uncoupled + tisfc(i) = tsfc(i) ! assume bitwise identical on non-icy points + if (icy(i)) then +! tisfc(i) = tsfc_ice(i) ! over ice when uncoupled + tisfc(i) = tice(i) ! over ice when uncoupled + else + hice(i) = 0.0 + cice(i) = 0.0 + end if - frac_wet=max(frac_lake,frac_ocean) - if (frac_ice.eq.0.) then - cmposit2 = frac_dry*landval + frac_wet*oceanval - else - cmposit2 = frac_dry*landval + frac_wet*iceval - end if - return - end function cmposit2 +! if (wet(i) .and. .not. cplflx) then +! tsfco(i) = tsfc_ocn(i) ! over lake or ocean when uncoupled +! tisfc(i) = tsfc_ice(i) ! over ice when uncoupled +! endif + end do - real function cmposit3(frac_ocean,frac_dry,frac_lake,frac_ice,oceanval,landval,iceval) -! --- 3-way compositing - implicit none - real(kind=kind_phys),intent(IN) :: frac_ocean,frac_dry,frac_lake,frac_ice,oceanval,landval,iceval + end if ! if (frac_grid) - if (frac_dry == 0.0 .and. iceval == oceanval) then - cmposit3 = oceanval - else - cmposit3 = frac_dry*landval + frac_ice*iceval + (1.-frac_dry-frac_ice)*oceanval - endif + ! --- compositing done - return - end function cmposit3 + end subroutine GFS_surface_composites_post_run end module GFS_surface_composites_post diff --git a/physics/GFS_surface_generic.F90 b/physics/GFS_surface_generic.F90 index 42fe8c646..5504eb7cd 100644 --- a/physics/GFS_surface_generic.F90 +++ b/physics/GFS_surface_generic.F90 @@ -243,7 +243,8 @@ end subroutine GFS_surface_generic_post_finalize !! | cplflx | flag_for_flux_coupling | flag controlling cplflx collection (default off) | flag | 0 | logical | | in | F | !! | cplwav | flag_for_wave_coupling | flag controlling cplwav collection (default off) | flag | 0 | logical | | in | F | !! | lssav | flag_diagnostics | logical flag for storing diagnostics | flag | 0 | logical | | in | F | -!! | lndfrac | land_area_fraction | fraction of horizontal grid area occupied by land | frac | 1 | real | kind_phys | in | F | +!! | icy | flag_nonzero_sea_ice_surface_fraction | flag indicating presence of some sea ice surface area fraction | flag | 1 | logical | | in | F | +!! | wet | flag_nonzero_wet_surface_fraction | flag indicating presence of some ocean or lake surface area fraction | flag | 1 | logical | | in | F | !! | dtf | time_step_for_dynamics | dynamics timestep | s | 0 | real | kind_phys | in | F | !! | ep1d | surface_upward_potential_latent_heat_flux | surface upward potential latent heat flux | W m-2 | 1 | real | kind_phys | in | F | !! | gflx | upward_heat_flux_in_soil | upward soil heat flux | W m-2 | 1 | real | kind_phys | in | F | @@ -327,7 +328,7 @@ end subroutine GFS_surface_generic_post_finalize !! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | !! #endif - subroutine GFS_surface_generic_post_run (im, cplflx, cplwav, lssav, lndfrac, dtf, ep1d, gflx, tgrs_1, qgrs_1, ugrs_1, vgrs_1, & + subroutine GFS_surface_generic_post_run (im, cplflx, cplwav, lssav, icy, wet, dtf, ep1d, gflx, tgrs_1, qgrs_1, ugrs_1, vgrs_1,& adjsfcdlw, adjsfcdsw, adjnirbmd, adjnirdfd, adjvisbmd, adjvisdfd, adjsfculw, adjnirbmu, adjnirdfu, adjvisbmu, adjvisdfu, & t2m, q2m, u10m, v10m, tsfc, pgr, xcosz, evbs, evcw, trans, sbsno, snowc, snohf, & epi, gfluxi, t1, q1, u1, v1, dlwsfci_cpl, dswsfci_cpl, dlwsfc_cpl, dswsfc_cpl, dnirbmi_cpl, dnirdfi_cpl, dvisbmi_cpl, & @@ -340,11 +341,10 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplwav, lssav, lndfrac, dtf implicit none - integer, intent(in) :: im - logical, intent(in) :: cplflx, cplwav, lssav - real(kind=kind_phys), dimension(im), intent(in) :: lndfrac - - real(kind=kind_phys), intent(in) :: dtf + integer, intent(in) :: im + logical, intent(in) :: cplflx, cplwav, lssav + logical, dimension(im), 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, & adjnirbmd, adjnirdfd, adjvisbmd, adjvisdfd, adjsfculw, adjnirbmu, adjnirdfu, adjvisbmu, adjvisdfu, & @@ -362,7 +362,7 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplwav, lssav, lndfrac, dtf character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg - real(kind=kind_phys), parameter :: albdf = 0.06 + real(kind=kind_phys), parameter :: albdf = 0.06d0 integer :: i real(kind=kind_phys) :: tem, xcosz_loc, ocalnirdf_cpl, ocalnirbm_cpl, ocalvisdf_cpl, ocalvisbm_cpl @@ -413,7 +413,7 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplwav, lssav, lndfrac, dtf ! them to net SW heat fluxes do i=1,im - if(lndfrac(i) < 1.) then ! Not 100% land + if (wet(i) .or. icy(i)) then ! not 100% land ! --- compute open water albedo xcosz_loc = max( 0.0, min( 1.0, xcosz(i) )) ocalnirdf_cpl = 0.06 diff --git a/physics/cldmacro.F b/physics/cldmacro.F index 086277f0e..a2d5aeb70 100644 --- a/physics/cldmacro.F +++ b/physics/cldmacro.F @@ -625,8 +625,10 @@ subroutine fix_up_clouds_2M(QV, TE, QLC, QIC, CF, QLA, QIA, AF, & real, intent(inout) :: TE,QV,QLC,CF,QLA,AF,QIC,QIA, NL, NI ! real, parameter :: qmin = 1.0e-8, qmini = 1.0e-7 - real, parameter :: nmin = 1.0e-3, cfmin = 1.0e-5 +! real, parameter :: nmin = 1.0e-3, cfmin = 1.0e-5 + real, parameter :: nmin = 1.0, cfmin = 1.0e-5 &, RI_cub = 6.4e-14, RL_cub = 1.0e-15 + &, fourb3 = 4.0/3.0 if (AF <= cfmin) then ! Fix if Anvil cloud fraction too small QV = QV + QLA + QIA @@ -687,13 +689,13 @@ subroutine fix_up_clouds_2M(QV, TE, QLC, QIC, CF, QLA, QIA, AF, & if (QLA+QLC <= qc_min(1)) then NL = 0.0 elseif (NL <= nmin) then ! make sure NL > 0 if Q >0 - NL = max((QLA+QLC)/( 1.333 * MAPL_PI *RL_cub*997.0), nmin) + NL = max((QLA+QLC)/( fourb3 * MAPL_PI *RL_cub*997.0), nmin) endif if (QIA+QIC <= qc_min(2)) then NI = 0.0 elseif (NI <= nmin) then ! make sure NI > 0 if Q >0 - NI = max((QIA+QIC)/( 1.333 * MAPL_PI *RI_cub*500.0), nmin) + NI = max((QIA+QIC)/( fourb3 * MAPL_PI *RI_cub*500.0), nmin) endif end subroutine fix_up_clouds_2M diff --git a/physics/cs_conv.F90 b/physics/cs_conv.F90 index d5c2e1011..2d88200c3 100644 --- a/physics/cs_conv.F90 +++ b/physics/cs_conv.F90 @@ -209,9 +209,9 @@ module cs_conv ! spblcrit=0.03, & !< minimum cloudbase height in p/ps ! spblcrit=0.035,& !< minimum cloudbase height in p/ps ! spblcrit=0.025,& !< minimum cloudbase height in p/ps - cincrit=-150.0 -! cincrit=-120.0 -! cincrit=-100.0 + cincrit= 150.0 +! cincrit= 120.0 +! cincrit= 100.0 !DD precz0 and preczh control partitioning of water between detrainment !DD and precipitation. Decrease for more precip @@ -390,15 +390,15 @@ subroutine cs_conv_run(IM , IJSDIM , KMAX , ntracp1 , NN, & ! ! input arguments ! - INTEGER, INTENT(IN) :: IM,IJSDIM, KMAX, ntracp1, NN, NTR, mype, nctp, mp_phys, kdt, lat !! DD, for GFS, pass in - logical, intent(in) :: otspt(ntracp1,2) ! 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 + INTEGER, INTENT(IN) :: IM,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 + ! 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(IM,KMAX) ! temperature at mid-layer (K) real(r8), intent(inout) :: q(IM,KMAX) ! water vapor array including moisture (kg/kg) - real(r8), intent(inout) :: clw(IM,KMAX,NN) ! tracer array including cloud condensate (kg/kg) + real(r8), intent(inout) :: clw(IM,KMAX,nn) ! tracer array including cloud condensate (kg/kg) real(r8), intent(in) :: pap(IM,KMAX) ! pressure at mid-layer (Pa) real(r8), intent(in) :: paph(IM,KMAX+1) ! pressure at boundaries (Pa) real(r8), intent(in) :: zm(IM,KMAX) ! geopotential at mid-layer (m) @@ -1177,7 +1177,7 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions ENDDO DO I=ISTS,IENS IF (JBUOY(I) /= 2) CIN(I) = -999.D0 - if (cin(i) < cincrit) kb(i) = -1 + if (cin(i) > cincrit) kb(i) = -1 ENDDO !DDsigma some initialization before summing over cloud type diff --git a/physics/cs_conv_aw_adj.F90 b/physics/cs_conv_aw_adj.F90 index 08d3f4516..82807dbdd 100644 --- a/physics/cs_conv_aw_adj.F90 +++ b/physics/cs_conv_aw_adj.F90 @@ -45,6 +45,8 @@ end subroutine cs_conv_aw_adj_finalize !! | cldfrac | cloud_fraction_for_MG | cloud fraction used by Morrison-Gettelman MP | frac | 2 | real | kind_phys | inout | F | !! | subcldfrac | subgrid_scale_cloud_fraction_from_shoc | subgrid-scale cloud fraction from the SHOC scheme | frac | 2 | real | kind_phys | inout | F | !! | prcp | lwe_thickness_of_explicit_precipitation_amount | explicit precipitation (rain, ice, snow, graupel, ...) on physics timestep | m | 1 | real | kind_phys | inout | F | +!! | imp_physics | flag_for_microphysics_scheme | choice of microphysics scheme | flag | 0 | integer | | in | F | +!! | imp_physics_mg | flag_for_morrison_gettelman_microphysics_scheme | choice of Morrison-Gettelman microphysics scheme | flag | 0 | integer | | in | F | !! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | !! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | !! @@ -52,7 +54,7 @@ end subroutine cs_conv_aw_adj_finalize subroutine cs_conv_aw_adj_run(im, levs, do_cscnv, do_aw, do_shoc, & ntrac, ncld, ntcw, ntclamt, nncl, con_g, sigmafrac, & gt0, gq0, save_t, save_q, prsi, cldfrac, subcldfrac, & - prcp, errmsg, errflg) + prcp, imp_physics, imp_physics_mg, errmsg, errflg) use machine, only: kind_phys @@ -72,6 +74,7 @@ subroutine cs_conv_aw_adj_run(im, levs, do_cscnv, do_aw, do_shoc, & 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 + integer, intent(in ) :: imp_physics, imp_physics_mg character(len=*), intent( out) :: errmsg integer, intent( out) :: errflg @@ -109,6 +112,14 @@ subroutine cs_conv_aw_adj_run(im, levs, do_cscnv, do_aw, do_shoc, & temrain1(i) = temrain1(i) - (prsi(i,k)-prsi(i,k+1)) * tem2 * onebg enddo enddo +! add convective clouds if shoc is true and not MG microphysics + if (do_shoc .and. imp_physics /= imp_physics_mg) then + do k = 1,levs + do i = 1,im + subcldfrac(i,k) = min(1.0, subcldfrac(i,k) + sigmafrac(i,k)) + enddo + enddo + endif ! do n=ntcw,ntcw+nncl-1 do k = 1,levs diff --git a/physics/dcyc2.f b/physics/dcyc2.f index a6f699fa2..5844e7371 100644 --- a/physics/dcyc2.f +++ b/physics/dcyc2.f @@ -51,7 +51,7 @@ end subroutine dcyc2t3_finalize ! sfcdsw,sfcnsw,sfcdlw,swh,swhc,hlw,hlwc, ! ! sfcnirbmu,sfcnirdfu,sfcvisbmu,sfcvisdfu, ! ! sfcnirbmd,sfcnirdfd,sfcvisbmd,sfcvisdfd, ! -! ix, im, levs, ! +! ix, im, levs, deltim, fhswr, ! ! input/output: ! ! dtdt,dtdtc, ! ! outputs: ! @@ -90,6 +90,8 @@ end subroutine dcyc2t3_finalize ! sfcvisdfd(im)- real, tot sky sfc uv+vis-diff sw dnward flux (w/m2)! ! ix, im - integer, horiz. dimention and num of used points ! ! levs - integer, vertical layer dimension ! +! deltim - real, physics time step in seconds ! +! fhswr - real, Short wave radiation time step in seconds ! ! ! ! input/output: ! ! dtdt(im,levs)- real, model time step adjusted total radiation ! @@ -154,6 +156,9 @@ end subroutine dcyc2t3_finalize !! spectral component fluxes !!- Oct 2014 y. hous s. moorthi - add emissivity contribution to !! upward longwave flux +!!- Mar 2019 s. moorthi - modify xmu calculation in a time centered +!! way and add more accuracy when physics +!! time step is close to radiation time step !> \section arg_table_dcyc2t3_run Argument Table !! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | !! |----------------|------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|---------|------|-----------|-----------|--------|----------| @@ -188,6 +193,7 @@ end subroutine dcyc2t3_finalize !! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | !! | levs | vertical_dimension | number of vertical layers | count | 0 | integer | | in | F | !! | deltim | time_step_for_dynamics | dynamics timestep | s | 0 | real | kind_phys | in | F | +!! | fhswr | frequency_for_shortwave_radiation | frequency for shortwave radiation | s | 0 | real | kind_phys | in | F | !! | dtdt | tendency_of_air_temperature_due_to_model_physics | total radiative heating rate at current time | K s-1 | 2 | real | kind_phys | inout | F | !! | dtdtc | tendency_of_air_temperature_due_to_radiative_heating_assuming_clear_sky | clear sky radiative (shortwave + longwave) heating rate at current time | K s-1 | 2 | real | kind_phys | inout | F | !! | adjsfcdsw | surface_downwelling_shortwave_flux | surface downwelling shortwave flux at current time | W m-2 | 1 | real | kind_phys | out | F | @@ -215,7 +221,7 @@ subroutine dcyc2t3_run & & sfcdsw,sfcnsw,sfcdlw,swh,swhc,hlw,hlwc, & & sfcnirbmu,sfcnirdfu,sfcvisbmu,sfcvisdfu, & & sfcnirbmd,sfcnirdfd,sfcvisbmd,sfcvisdfd, & - & ix, im, levs, deltim, & + & ix, im, levs, deltim, fhswr, & & dtdt,dtdtc, & ! --- input/output: & adjsfcdsw,adjsfcnsw,adjsfcdlw,adjsfculw,xmu,xcosz, & ! --- outputs: & adjnirbmu,adjnirdfu,adjvisbmu,adjvisdfu, & @@ -229,15 +235,18 @@ subroutine dcyc2t3_run & implicit none ! ! --- constant parameters: - real(kind=kind_phys), parameter :: f_eps = 0.0001, hour12 = 12.0,& - & f7200 = 1.0/7200.0, & + real(kind=kind_phys), parameter :: f_eps = 0.0001_kind_phys, & + & hour12 = 12.0_kind_phys, & + & f3600 = 1.0/3600.0_kind_phys, & + & f7200 = 1.0/7200.0_kind_phys, & + & czlimt = 0.0001_kind_phys, & ! ~ cos(89.99427) & pid12 = con_pi / hour12 ! --- inputs: integer, intent(in) :: ix, im, levs real(kind=kind_phys), intent(in) :: solhr, slag, cdec, sdec, & - & deltim + & deltim, fhswr real(kind=kind_phys), dimension(im), intent(in) :: & & sinlat, coslat, xlon, coszen, tsea, tf, tsflw, sfcdlw, & @@ -262,16 +271,51 @@ subroutine dcyc2t3_run & integer, intent(out) :: errflg ! --- locals: - integer :: i, k - real(kind=kind_phys) :: cns, ss, cc, ch, tem1, tem2 + integer :: i, k, nstp, nstl, it, istsun(im) + real(kind=kind_phys) :: cns, coszn, tem1, tem2, anginc, & + & rstl, solang ! !===> ... begin here ! ! Initialize CCPP error handling variables errmsg = '' errflg = 0 + + tem1 = fhswr / deltim + nstp = max(6, nint(tem1)) + nstl = max(1, nint(nstp/tem1)) ! - cns = pid12 * (solhr + deltim*f7200 - hour12) + slag +! --- ... sw time-step adjustment for current cosine of zenith angle +! ---------------------------------------------------------- + if (nstl == 1) then + cns = pid12 * (solhr + deltim*f7200 - hour12) + slag + do i = 1, IM + xcosz(i) = sdec*sinlat(i) + cdec*coslat(i)*cos(cns+xlon(i)) + enddo + elseif (nstl == nstp) then + do i = 1, IM + xcosz(i) = coszen(i) + enddo + else + rstl = 1.0 / float(nstl) + solang = pid12 * (solhr - hour12) + anginc = pid12 * deltim * f3600 * rstl + do i = 1, im + xcosz(i) = 0.0 + istsun(i) = 0.0 + enddo + do it=1,nstl + cns = solang + (float(it)-0.5)*anginc + slag + do i = 1, IM + coszn = sdec*sinlat(i) + cdec*coslat(i)*cos(cns+xlon(i)) + xcosz(i) = xcosz(i) + max(0.0, coszn) + if (coszn > czlimt) istsun(i) = istsun(i) + 1 + enddo + enddo + do i = 1, IM + if (istsun(i) > 0) xcosz(i) = xcosz(i) / istsun(i) ! mean cosine of solar zenith angle at current time + enddo + endif ! do i = 1, im @@ -289,15 +333,8 @@ subroutine dcyc2t3_run & adjsfculw(i) = sfcemis(i) * con_sbc * tem2 * tem2 & + (1.0 - sfcemis(i)) * adjsfcdlw(i) ! -!> - SW time-step adjustment: - - ss = sinlat(i) * sdec - cc = coslat(i) * cdec - ch = cc * cos( xlon(i)+cns ) - xcosz(i) = ch + ss ! cosine of solar zenith angle at current time !> - normalize by average value over radiation period for daytime. - if ( xcosz(i) > f_eps .and. coszen(i) > f_eps ) then xmu(i) = xcosz(i) / coszen(i) else diff --git a/physics/docs/pdftxt/CPT_adv_suite.txt b/physics/docs/pdftxt/CPT_adv_suite.txt index fa9801e07..1edb934a2 100644 --- a/physics/docs/pdftxt/CPT_adv_suite.txt +++ b/physics/docs/pdftxt/CPT_adv_suite.txt @@ -118,7 +118,6 @@ The advanced CPT physics suite uses the parameterizations in the following order m_micro_post cs_conv_aw_adj GFS_MP_generic_post - sfc_sice_post diff --git a/physics/docs/pdftxt/GFSv14_suite.txt b/physics/docs/pdftxt/GFSv14_suite.txt index 138de59e6..25e03e7fd 100644 --- a/physics/docs/pdftxt/GFSv14_suite.txt +++ b/physics/docs/pdftxt/GFSv14_suite.txt @@ -106,7 +106,6 @@ The GFS v14 suite uses the parameterizations in the following order, as defined zhaocarr_gscond zhaocarr_precpd GFS_MP_generic_post - sfc_sice_post maximum_hourly_diagnostics diff --git a/physics/docs/pdftxt/GFSv15_suite.txt b/physics/docs/pdftxt/GFSv15_suite.txt index cf7e68068..821ca9680 100644 --- a/physics/docs/pdftxt/GFSv15_suite.txt +++ b/physics/docs/pdftxt/GFSv15_suite.txt @@ -126,7 +126,6 @@ The GFSv15 suite uses the parameterizations in the following order, as defined i GFS_MP_generic_pre gfdl_cloud_microphys GFS_MP_generic_post - sfc_sice_post maximum_hourly_diagnostics diff --git a/physics/docs/pdftxt/GFSv15_suite_TKEEDMF.txt b/physics/docs/pdftxt/GFSv15_suite_TKEEDMF.txt index 3b0868cec..a60f3b3b6 100644 --- a/physics/docs/pdftxt/GFSv15_suite_TKEEDMF.txt +++ b/physics/docs/pdftxt/GFSv15_suite_TKEEDMF.txt @@ -113,7 +113,6 @@ The GFSv15plus suite uses the parameterizations in the following order, as defin GFS_MP_generic_pre gfdl_cloud_microphys GFS_MP_generic_post - sfc_sice_post maximum_hourly_diagnostics diff --git a/physics/gcm_shoc.F90 b/physics/gcm_shoc.F90 index f2c9b7a7b..dff067893 100644 --- a/physics/gcm_shoc.F90 +++ b/physics/gcm_shoc.F90 @@ -33,7 +33,7 @@ end subroutine shoc_finalize !! | imp_physics_gfdl | flag_for_gfdl_microphysics_scheme | choice of GFDL microphysics scheme | flag | 0 | integer | | in | F | !! | imp_physics_zhao_carr | flag_for_zhao_carr_microphysics_scheme | choice of Zhao-Carr microphysics scheme | flag | 0 | integer | | in | F | !! | imp_physics_zhao_carr_pdf | flag_for_zhao_carr_pdf_microphysics_scheme | choice of Zhao-Carr microphysics scheme with PDF clouds | flag | 0 | integer | | in | F | -!! | imp_physics_mg | flag_for_morrison_gettelman_microphysics_scheme | choice of Morrison-Gettelman rmicrophysics scheme | flag | 0 | integer | | in | F | +!! | imp_physics_mg | flag_for_morrison_gettelman_microphysics_scheme | choice of Morrison-Gettelman microphysics scheme | flag | 0 | integer | | in | F | !! | fprcp | number_of_frozen_precipitation_species | number of frozen precipitation species | count | 0 | integer | | in | F | !! | tcr | cloud_phase_transition_threshold_temperature | threshold temperature below which cloud starts to freeze | K | 0 | real | kind_phys | in | F | !! | tcrf | cloud_phase_transition_denominator | denominator in cloud phase transition = 1/(tcr-tf) | K-1 | 0 | real | kind_phys | in | F | @@ -110,7 +110,7 @@ subroutine shoc_run (ix, nx, nzm, do_shoc, shocaftcnv, mg3_as_mg2, imp_physics, character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg - real(kind=kind_phys), parameter :: epsq = 1.e-20 + real(kind=kind_phys), parameter :: epsq = 1.d-20 integer :: i, k @@ -125,7 +125,6 @@ subroutine shoc_run (ix, nx, nzm, do_shoc, shocaftcnv, mg3_as_mg2, imp_physics, if (shocaftcnv) then if (imp_physics == imp_physics_mg) then - skip_macro = do_shoc if (abs(fprcp) == 1 .or. mg3_as_mg2) then do k=1,nzm do i=1,nx @@ -147,11 +146,10 @@ subroutine shoc_run (ix, nx, nzm, do_shoc, shocaftcnv, mg3_as_mg2, imp_physics, endif else if (imp_physics == imp_physics_mg) then - skip_macro = do_shoc do k=1,nzm do i=1,nx - ! DH* THESE ARE NOT IN THE ORIGINAL CODE (AND THEY WERE NEVER) ::: clw_ice(i,k) = gq0_cloud_ice(i,k) ! ice - ! DH* THESE ARE NOT IN THE ORIGINAL CODE (AND THEY WERE NEVER) ::: clw_liquid(i,k) = gq0_cloud_liquid(i,k) ! water + !clw_ice(i,k) = gq0_cloud_ice(i,k) ! ice + !clw_liquid(i,k) = gq0_cloud_liquid(i,k) ! water !GF - since gq0(ntlnc/ntinc) are passed in directly, no need to copy !ncpl(i,k) = Stateout%gq0(i,k,ntlnc) !ncpi(i,k) = Stateout%gq0(i,k,ntinc) @@ -172,7 +170,7 @@ subroutine shoc_run (ix, nx, nzm, do_shoc, shocaftcnv, mg3_as_mg2, imp_physics, !qrn(i,k) = gq0_rain(i,k) qsnw(i,k) = gq0_snow(i,k) + gq0_graupel(i,k) qgl(i,k) = 0.0 - clw_ice(i,k) = clw_ice(i,k) + gq0_graupel(i,k) + !clw_ice(i,k) = clw_ice(i,k) + gq0_graupel(i,k) enddo enddo endif @@ -221,18 +219,18 @@ subroutine shoc_run (ix, nx, nzm, do_shoc, shocaftcnv, mg3_as_mg2, imp_physics, cld_sgs, tke, hflx, evap, prnum, tkh, wthv_sec, .false., 1, ncpl, ncpi, & con_cp, con_g, con_hvap, con_hfus, con_rv, con_rd, con_pi, con_fvirt) - if (.not.shocaftcnv) then - if (imp_physics == imp_physics_mg .and. fprcp > 1) then - do k=1,nzm - do i=1,nx - clw_ice(i,k) = clw_ice(i,k) - gq0_graupel(i,k) - enddo - enddo - endif - endif ! .not. shocaftcnv + !if (.not.shocaftcnv) then + ! if (imp_physics == imp_physics_mg .and. fprcp > 1) then + ! do k=1,nzm + ! do i=1,nx + ! clw_ice(i,k) = clw_ice(i,k) - gq0_graupel(i,k) + ! enddo + ! enddo + ! endif + !endif ! .not. shocaftcnv !GF since gq0(ntlnc/ntinc) are passed in directly, no need to copy back - ! if (ntlnc > 0 .and. ntinc > 0 .and. ncld >= 2) then + ! if (imp_physics == Model%imp_physics_mg) then ! do k=1,nzm ! do i=1,nx ! Stateout%gq0(i,k,ntlnc) = ncpl(i,k) diff --git a/physics/gfdl_cloud_microphys.F90 b/physics/gfdl_cloud_microphys.F90 index 3fd83210f..8e6f645ca 100644 --- a/physics/gfdl_cloud_microphys.F90 +++ b/physics/gfdl_cloud_microphys.F90 @@ -159,8 +159,7 @@ end subroutine gfdl_cloud_microphys_finalize !! | phys_hydrostatic | flag_for_hydrostatic_heating_from_physics | flag indicating hydrostatic heating from physics | flag | 0 | logical | | in | F | !! | lradar | flag_for_radar_reflectivity | flag for radar reflectivity | flag | 0 | logical | | in | F | !! | refl_10cm | radar_reflectivity_10cm | instantaneous refl_10cm | dBZ | 2 | real | kind_phys | inout | F | -!! | kdt | index_of_time_step | current forecast iteration | index | 0 | integer | | in | F | -!! | nsteps_per_reset | number_of_time_steps_per_maximum_hourly_time_interval | number_of_time_steps_per_maximum_hourly_time_interval | count | 0 | integer | | in | F | +!! | reset | flag_reset_maximum_hourly_fields | flag for resetting maximum hourly fields | flag | 0 | logical | | in | F | !! | effr_in | flag_for_cloud_effective_radii | flag for cloud effective radii calculations in microphysics | | 0 | logical | | in | F | !! | rew | effective_radius_of_stratiform_cloud_liquid_water_particle_in_um | eff. radius of cloud liquid water particle in micrometer | um | 2 | real | kind_phys | inout | F | !! | rei | effective_radius_of_stratiform_cloud_ice_particle_in_um | eff. radius of cloud ice water particle in micrometer | um | 2 | real | kind_phys | inout | F | @@ -176,7 +175,7 @@ subroutine gfdl_cloud_microphys_run( & gt0, gu0, gv0, vvl, prsl, phii, del, & rain0, ice0, snow0, graupel0, prcp0, sr, & dtp, hydrostatic, phys_hydrostatic, lradar, refl_10cm, & - kdt, nsteps_per_reset, effr_in, rew, rei, rer, res, reg, errmsg, errflg) + reset, effr_in, rew, rei, rer, res, reg, errmsg, errflg) use machine, only: kind_phys @@ -187,11 +186,7 @@ subroutine gfdl_cloud_microphys_run( & real(kind=kind_phys), parameter :: one = 1.0d0 real(kind=kind_phys), parameter :: con_p001= 0.001d0 real(kind=kind_phys), parameter :: con_day = 86400.d0 -#ifdef TRANSITION real(kind=kind_phys), parameter :: rainmin = 1.0d-13 -#else - real(kind=kind_phys), parameter :: rainmin = 1.0e-13 -#endif ! *DH ! interface variables @@ -217,8 +212,7 @@ subroutine gfdl_cloud_microphys_run( & logical, intent (in) :: lradar real(kind=kind_phys), intent(inout), dimension(1:im,1:levs) :: refl_10cm - integer, intent (in) :: kdt, nsteps_per_reset - logical, intent (in) :: effr_in + logical, intent (in) :: reset, effr_in real(kind=kind_phys), intent(inout), dimension(1:im,1:levs) :: rew, rei, rer, res, reg character(len=*), intent(out) :: errmsg @@ -237,7 +231,6 @@ subroutine gfdl_cloud_microphys_run( & real(kind=kind_phys), volatile :: volatile_var1, volatile_var2 #endif - ! Initialize CCPP error handling variables errmsg = '' errflg = 0 @@ -298,7 +291,7 @@ subroutine gfdl_cloud_microphys_run( & qv1, ql1, qr1, qi1, qs1, qg1, qa1, qn1, qv_dt, ql_dt, qr_dt, qi_dt, & qs_dt, qg_dt, qa_dt, pt_dt, pt, w, uin, vin, u_dt, v_dt, dz, delp, & garea, dtp, frland, rain0, snow0, ice0, graupel0, hydrostatic, & - phys_hydrostatic, p123, lradar, refl, kdt, nsteps_per_reset) + phys_hydrostatic, p123, lradar, refl, reset) tem = dtp*con_p001/con_day ! fix negative values diff --git a/physics/gfs_phy_tracer_config.f b/physics/gfs_phy_tracer_config.F similarity index 100% rename from physics/gfs_phy_tracer_config.f rename to physics/gfs_phy_tracer_config.F diff --git a/physics/m_micro.F90 b/physics/m_micro.F90 index f973842f0..2e33ce542 100644 --- a/physics/m_micro.F90 +++ b/physics/m_micro.F90 @@ -20,7 +20,7 @@ module m_micro !! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | !! |------------------------|-------------------------------------------------|---------------------------------------------------------------------------------------------|-------------|------|------------|-----------|--------|----------| !! | imp_physics | flag_for_microphysics_scheme | choice of microphysics scheme | flag | 0 | integer | | in | F | -!! | imp_physics_mg | flag_for_morrison_gettelman_microphysics_scheme | choice of Morrison-Gettelman rmicrophysics scheme | flag | 0 | integer | | in | F | +!! | imp_physics_mg | flag_for_morrison_gettelman_microphysics_scheme | choice of Morrison-Gettelman microphysics scheme | flag | 0 | integer | | in | F | !! | fprcp | number_of_frozen_precipitation_species | number of frozen precipitation species | count | 0 | integer | | in | F | !! | gravit | gravitational_acceleration | gravitational acceleration | m s-2 | 0 | real | kind_phys | in | F | !! | rair | gas_constant_dry_air | ideal gas constant for dry air | J kg-1 K-1 | 0 | real | kind_phys | in | F | @@ -260,7 +260,7 @@ subroutine m_micro_run( im, ix, lm, flipv, dt_i & use aer_cloud, only: AerProps, getINsubset,init_aer, & & aerosol_activate,AerConversion1 use cldmacro, only: macro_cloud,meltfrz_inst,update_cld, & - & meltfrz_inst + & meltfrz_inst, fix_up_clouds_2M use cldwat2m_micro,only: mmicro_pcond use micro_mg2_0, only: micro_mg_tend2_0 => micro_mg_tend, qcvar2 => qcvar use micro_mg3_0, only: micro_mg_tend3_0 => micro_mg_tend, qcvar3 => qcvar @@ -284,7 +284,8 @@ subroutine m_micro_run( im, ix, lm, flipv, dt_i & real, parameter :: one=1.0, oneb3=one/3.0, onebcp=one/cp, & & kapa=rgas*onebcp, cpbg=cp/grav, & & lvbcp=hvap*onebcp, lsbcp=(hvap+hfus)*onebcp,& - qsmall=1.e-14, rainmin = 1.0e-13 + & qsmall=1.e-14, rainmin = 1.0e-13, & + & fourb3=4.0/3.0, RL_cub=1.0e-15, nmin=1.0 integer, parameter :: ncolmicro = 1 integer,intent(in) :: im, ix,lm, ipr, kdt, fprcp, pdfflag @@ -627,6 +628,32 @@ subroutine m_micro_run( im, ix, lm, flipv, dt_i & DT_MOIST = dt_i dt_r8 = dt_i + if (kdt == 1) then + DO K=1, LM + DO I = 1,IM + CALL fix_up_clouds_2M(Q1(I,K), TEMP(i,k), QLLS(I,K), & + & QILS(I,K), CLLS(I,K), QLCN(I,K), & + & QICN(I,K), CLCN(I,K), NCPL(I,K), & + & NCPI(I,K), qc_min) + if (rnw(i,k) <= qc_min(1)) then + ncpl(i,k) = 0.0 + elseif (ncpl(i,k) <= nmin) then ! make sure NL > 0 if Q >0 + ncpl(i,k) = max(rnw(i,k) / (fourb3 * PI *RL_cub*997.0), nmin) + endif + if (snw(i,k) <= qc_min(2)) then + ncpl(i,k) = 0.0 + elseif (ncps(i,k) <= nmin) then + ncps(i,k) = max(snw(i,k) / (fourb3 * PI *RL_cub*500.0), nmin) + endif + if (qgl(i,k) <= qc_min(2)) then + ncgl(i,k) = 0.0 + elseif (ncgl(i,k) <= nmin) then + ncgl(i,k) = max(qgl(i,k) / (fourb3 * PI *RL_cub*500.0), nmin) + endif + + enddo + enddo + endif do i=1,im KCBL(i) = max(LM-KCBL(i),10) KCT(i) = 10 @@ -1743,15 +1770,39 @@ subroutine m_micro_run( im, ix, lm, flipv, dt_i & !TVQX1 = SUM( ( Q1 + QL_TOT + QI_TOT(1:im,:,:))*DM, 3) & - if (.not. skip_macro) then + if (skip_macro) then + do k=1,lm + do i=1,im + CALL fix_up_clouds_2M(Q1(I,K), TEMP(i,k), QLLS(I,K), & + & QILS(I,K), CLLS(I,K), QLCN(I,K), & + & QICN(I,K), CLCN(I,K), NCPL(I,K), & + & NCPI(I,K), qc_min) + if (rnw(i,k) <= qc_min(1)) then + ncpl(i,k) = 0.0 + elseif (ncpl(i,k) <= nmin) then ! make sure NL > 0 if Q >0 + ncpl(i,k) = max(rnw(i,k) / (fourb3 * PI *RL_cub*997.0), nmin) + endif + if (snw(i,k) <= qc_min(2)) then + ncpl(i,k) = 0.0 + elseif (ncps(i,k) <= nmin) then + ncps(i,k) = max(snw(i,k) / (fourb3 * PI *RL_cub*500.0), nmin) + endif + if (qgl(i,k) <= qc_min(2)) then + ncgl(i,k) = 0.0 + elseif (ncgl(i,k) <= nmin) then + ncgl(i,k) = max(qgl(i,k) / (fourb3 * PI *RL_cub*500.0), nmin) + endif + enddo + enddo + else do k=1,lm do i=1,im QLCN(i,k) = QL_TOT(i,k) * FQA(i,k) QLLS(i,k) = QL_TOT(i,k) - QLCN(i,k) QICN(i,k) = QI_TOT(i,k) * FQA(i,k) QILS(i,k) = QI_TOT(i,k) - QICN(i,k) - end do - end do + enddo + enddo !> - Call update_cld() call update_cld(im, lm, DT_MOIST, ALPHT_X, qc_min & @@ -1765,8 +1816,24 @@ subroutine m_micro_run( im, ix, lm, flipv, dt_i & do i=1,im QL_TOT(I,K) = QLLS(I,K) + QLCN(I,K) QI_TOT(I,K) = QILS(I,K) + QICN(I,K) - end do - end do +! + if (rnw(i,k) <= qc_min(1)) then + ncpl(i,k) = 0.0 + elseif (ncpl(i,k) <= nmin) then ! make sure NL > 0 if Q >0 + ncpl(i,k) = max(rnw(i,k) / (fourb3 * PI *RL_cub*997.0), nmin) + endif + if (snw(i,k) <= qc_min(2)) then + ncpl(i,k) = 0.0 + elseif (ncps(i,k) <= nmin) then + ncps(i,k) = max(snw(i,k) / (fourb3 * PI *RL_cub*500.0), nmin) + endif + if (qgl(i,k) <= qc_min(2)) then + ncgl(i,k) = 0.0 + elseif (ncgl(i,k) <= nmin) then + ncgl(i,k) = max(qgl(i,k) / (fourb3 * PI *RL_cub*500.0), nmin) + endif + enddo + enddo deallocate(CNV_MFD,CNV_FICE,CNV_NDROP,CNV_NICE) ! deallocate(CNV_MFD,CNV_PRC3,CNV_FICE,CNV_NDROP,CNV_NICE) endif @@ -1806,11 +1873,17 @@ subroutine m_micro_run( im, ix, lm, flipv, dt_i & qi_o(i,k) = QI_TOT(i,ll) END DO END DO - if (.not. skip_macro) then + if (skip_macro) then + DO K=1, LM + ll = lm-k+1 + DO I = 1,IM + CLLS_io(i,k) = max(0.0, min(CLLS(i,ll)+CLCN(i,ll),1.0)) + enddo + enddo + else DO K=1, LM ll = lm-k+1 DO I = 1,IM -! CLLS_io(i,k) = max(0.0, min(CLLS(i,ll)+CLCN(i,ll),1.0)) CLLS_io(i,k) = CLLS(i,ll) enddo enddo @@ -1832,15 +1905,21 @@ subroutine m_micro_run( im, ix, lm, flipv, dt_i & qi_o(i,k) = QI_TOT(i,k) END DO END DO - if (.not. skip_macro) then + if (skip_macro) then + DO K=1, LM + DO I = 1,IM + CLLS_io(i,k) = max(0.0, min(CLLS(i,k)+CLCN(i,k),1.0)) + enddo + enddo + else DO K=1, LM DO I = 1,IM -! CLLS_io(i,k) = max(0.0, min(CLLS(i,k)+CLCN(i,k),1.0)) CLLS_io(i,k) = CLLS(i,k) enddo enddo endif - endif + endif ! end of flipv if + DO I = 1,IM tx1 = LS_PRC2(i) + LS_SNR(i) rn_o(i) = tx1 * dt_i * 0.001 diff --git a/physics/m_micro_interstitial.F90 b/physics/m_micro_interstitial.F90 index 259c82519..c40740e63 100644 --- a/physics/m_micro_interstitial.F90 +++ b/physics/m_micro_interstitial.F90 @@ -23,6 +23,7 @@ end subroutine m_micro_pre_init !! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | !! | levs | vertical_dimension | number of vertical layers | count | 0 | integer | | in | F | !! | do_shoc | flag_for_shoc | flag for SHOC | flag | 0 | logical | | in | F | +!! | skip_macro | flag_skip_macro | flag to skip cloud macrophysics in Morrison scheme | flag | 0 | logical | | inout | F | !! | fprcp | number_of_frozen_precipitation_species | number of frozen precipitation species | count | 0 | integer | | in | F | !! | mg3_as_mg2 | flag_mg3_as_mg2 | flag for controlling prep for Morrison-Gettelman microphysics | flag | 0 | logical | | in | F | !! | gq0_ice | ice_water_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of ice water updated by physics | kg kg-1 | 2 | real | kind_phys | in | F | @@ -56,8 +57,8 @@ end subroutine m_micro_pre_init !! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | !! #endif - subroutine m_micro_pre_run (im, levs, do_shoc, fprcp, mg3_as_mg2, gq0_ice, gq0_water, gq0_rain, & - gq0_snow, gq0_graupel, gq0_rain_nc, gq0_snow_nc, gq0_graupel_nc, cld_shoc, cnvc, cnvw, tcr, tcrf, gt0, & + subroutine m_micro_pre_run (im, levs, do_shoc, skip_macro, fprcp, mg3_as_mg2, gq0_ice, gq0_water, gq0_rain, & + gq0_snow, gq0_graupel, gq0_rain_nc, gq0_snow_nc, gq0_graupel_nc, cld_shoc, cnvc, cnvw, tcr, tcrf, gt0, & qrn, qsnw, qgl, ncpr, ncps, ncgl, cld_frc_MG, qlcn, qicn, cf_upi, clw_water, clw_ice, clcn, errmsg, errflg ) use machine, only : kind_phys @@ -65,6 +66,7 @@ subroutine m_micro_pre_run (im, levs, do_shoc, fprcp, mg3_as_mg2, gq0_ice, gq0_w integer, intent(in) :: im, levs, fprcp logical, intent(in) :: do_shoc, mg3_as_mg2 + logical, intent(inout) :: skip_macro real(kind=kind_phys), intent(in) :: tcr, tcrf real(kind=kind_phys), intent(in) :: & @@ -97,6 +99,7 @@ subroutine m_micro_pre_run (im, levs, do_shoc, fprcp, mg3_as_mg2, gq0_ice, gq0_w ! year. I believe this will make the physical interaction more reasonable ! Anning 12/5/2015 changed ntcw hold liquid only if (do_shoc) then + skip_macro = do_shoc if (fprcp == 0) then do k=1,levs do i=1,im @@ -215,19 +218,24 @@ end subroutine m_micro_post_init !! | qrn | local_rain_water_mixing_ratio | moist (dry+vapor, no condensates) mixing ratio of rain water local to physics | kg kg-1 | 2 | real | kind_phys | inout | F | !! | qsnw | local_snow_water_mixing_ratio | moist (dry+vapor, no condensates) mixing ratio of snow water local to physics | kg kg-1 | 2 | real | kind_phys | inout | F | !! | qgl | local_graupel_mixing_ratio | moist (dry+vapor, no condensates) mixing ratio of graupel local to physics | kg kg-1 | 2 | real | kind_phys | inout | F | +!! | gq0_ice | ice_water_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of ice water updated by physics | kg kg-1 | 2 | real | kind_phys | in | F | !! | gq0_rain | rain_water_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of rain water updated by physics | kg kg-1 | 2 | real | kind_phys | out | F | !! | gq0_snow | snow_water_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of snow water updated by physics | kg kg-1 | 2 | real | kind_phys | out | F | !! | gq0_graupel | graupel_mixing_ratio_updated_by_physics | moist (dry+vapor, no condensates) mixing ratio of graupel updated by physics | kg kg-1 | 2 | real | kind_phys | out | F | !! | gq0_rain_nc | rain_number_concentration_updated_by_physics | number concentration of rain updated by physics | kg-1 | 2 | real | kind_phys | out | F | !! | gq0_snow_nc | snow_number_concentration_updated_by_physics | number concentration of snow updated by physics | kg-1 | 2 | real | kind_phys | out | F | !! | gq0_graupel_nc | graupel_number_concentration_updated_by_physics | number concentration of graupel updated by physics | kg-1 | 2 | real | kind_phys | out | F | +!! | ice | lwe_thickness_of_ice_amount_on_dynamics_timestep | ice fall at this time step | m | 1 | real | kind_phys | out | F | +!! | snow | lwe_thickness_of_snow_amount_on_dynamics_timestep | snow fall at this time step | m | 1 | real | kind_phys | out | F | +!! | graupel | lwe_thickness_of_graupel_amount_on_dynamics_timestep | graupel fall at this time step | m | 1 | real | kind_phys | out | F | +!! | dtp | time_step_for_physics | physics timestep | s | 0 | real | kind_phys | in | F | !! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | !! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | !! - subroutine m_micro_post_run( & - im, levs, fprcp, mg3_as_mg2, ncpr, ncps, ncgl, qrn, qsnw, qgl, & - gq0_rain, gq0_snow, gq0_graupel, gq0_rain_nc, gq0_snow_nc, & - gq0_graupel_nc, errmsg, errflg) + subroutine m_micro_post_run( & + im, levs, fprcp, mg3_as_mg2, ncpr, ncps, ncgl, qrn, qsnw, qgl, & + gq0_ice, gq0_rain, gq0_snow, gq0_graupel, gq0_rain_nc, gq0_snow_nc, & + gq0_graupel_nc, ice, snow, graupel, dtp, errmsg, errflg) use machine, only : kind_phys implicit none @@ -235,17 +243,33 @@ subroutine m_micro_post_run( & integer, intent(in) :: im, levs, fprcp logical, intent(in) :: mg3_as_mg2 - real(kind=kind_phys), intent(in) :: ncpr(:,:), ncps(:,:), ncgl(:,:) - real(kind=kind_phys), intent(inout) :: qrn(:,:), qsnw(:,:), qgl(:,:) - real(kind=kind_phys), intent(inout) :: gq0_rain(:,:), gq0_snow(:,:), & - gq0_graupel(:,:), gq0_rain_nc(:,:), gq0_snow_nc(:,:), gq0_graupel_nc(:,:) + 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 ) :: dtp character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg + ! Local variables + real(kind=kind_phys), parameter :: qsmall = 1.0d-20 + real(kind=kind_phys), parameter :: con_p001 = 0.001d0 + real(kind=kind_phys), parameter :: con_day = 86400.0d0 integer :: i, k - - real(kind=kind_phys), parameter :: qsmall = 1.0e-20 + real(kind=kind_phys) :: tem ! Initialize CCPP error handling variables errmsg = '' @@ -260,7 +284,7 @@ subroutine m_micro_post_run( & ! &, gq0(1,1,1),gq0(1,1,ntcw),gq0(1,1,ntcw+1),' m_micro ') ! if (lprnt) write(0,*) ' rain1=',rain1(ipr)*86400.0, & -! &' rainc=',diag%rainc(ipr)*86400.0 & +! &' rainc=',diag%rainc(ipr)*86400.0 ! &,' cn_prc=',cn_prc(ipr),' cn_snr=',cn_snr(ipr) ! if(lprnt) write(0,*) ' aftgt0=',Stateout%gt0(ipr,:),' kdt=',kdt ! if (lprnt) write(0,*) ' aftlsgq0=',stateout%gq0(ipr,:,1),' kdt=',kdt @@ -273,6 +297,7 @@ subroutine m_micro_post_run( & ! if (lprnt) write(0,*)' qsnwa=',qsnw(ipr,:),' kdt=',kdt ! if (lprnt) write(0,*)' qglba',qgl(ipr,:),' kdt=',kdt + tem = dtp * con_p001 / con_day if (abs(fprcp) == 1 .or. mg3_as_mg2) then do k=1,levs do i=1,im @@ -284,6 +309,10 @@ subroutine m_micro_post_run( & gq0_snow_nc(i,k) = ncps(i,k) enddo enddo + do i=1,im + ice(i) = tem * gq0_ice(i,1) + snow(i) = tem * qsnw(i,1) + enddo elseif (fprcp > 1) then do k=1,levs do i=1,im @@ -298,6 +327,11 @@ subroutine m_micro_post_run( & gq0_graupel_nc(i,k) = ncgl(i,k) enddo enddo + do i=1,im + ice(i) = tem * gq0_ice(i,1) + snow(i) = tem * qsnw(i,1) + graupel(i) = tem * qgl(i,1) + enddo endif diff --git a/physics/maximum_hourly_diagnostics.F90 b/physics/maximum_hourly_diagnostics.F90 index 545f393b9..62c68c937 100644 --- a/physics/maximum_hourly_diagnostics.F90 +++ b/physics/maximum_hourly_diagnostics.F90 @@ -26,8 +26,7 @@ end subroutine maximum_hourly_diagnostics_finalize !! |----------------------|--------------------------------------------------------------------|--------------------------------------------------------------------|------------|------|-----------|-----------|--------|----------| !! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | !! | levs | vertical_dimension | number of vertical levels | count | 0 | integer | | in | F | -!! | kdt | index_of_time_step | current forecast iteration | index | 0 | integer | | in | F | -!! | nsteps_per_reset | number_of_time_steps_per_maximum_hourly_time_interval | number_of_time_steps_per_maximum_hourly_time_interval | count | 0 | integer | | in | F | +!! | reset | flag_reset_maximum_hourly_fields | flag for resetting maximum hourly fields | flag | 0 | logical | | in | F | !! | lradar | flag_for_radar_reflectivity | flag for radar reflectivity | flag | 0 | logical | | in | F | !! | imp_physics | flag_for_microphysics_scheme | choice of microphysics scheme | flag | 0 | integer | | in | F | !! | imp_physics_gfdl | flag_for_gfdl_microphysics_scheme | choice of GFDL microphysics scheme | flag | 0 | integer | | in | F | @@ -54,15 +53,15 @@ end subroutine maximum_hourly_diagnostics_finalize !! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | !! #endif - subroutine maximum_hourly_diagnostics_run(im, levs, kdt, nsteps_per_reset, lradar, imp_physics, & + subroutine maximum_hourly_diagnostics_run(im, levs, reset, lradar, imp_physics, & imp_physics_gfdl, imp_physics_thompson, con_g, phil, & gt0, refl_10cm, refdmax, refdmax263k, u10m, v10m, & u10max, v10max, spd10max, pgr, t2m, q2m, t02max, & t02min, rh02max, rh02min, errmsg, errflg) ! Interface variables - integer, intent(in) :: im, levs, kdt, nsteps_per_reset - logical, intent(in) :: lradar + integer, intent(in) :: im, levs + logical, intent(in) :: reset, lradar integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson real(kind_phys), intent(in ) :: con_g real(kind_phys), intent(in ) :: phil(im,levs) @@ -88,30 +87,24 @@ subroutine maximum_hourly_diagnostics_run(im, levs, kdt, nsteps_per_reset, lrada ! Local variables real(kind_phys), dimension(:), allocatable :: refd, refd263k real(kind_phys) :: tem, pshltr, QCQ, rh02 - integer :: kdtminus1, i + integer :: i ! Initialize CCPP error handling variables errmsg = '' errflg = 0 - kdtminus1 = kdt-1 - !Calculate hourly max 1-km agl and -10C reflectivity if (lradar .and. (imp_physics == imp_physics_gfdl .or. imp_physics == imp_physics_thompson)) then allocate(refd(im)) allocate(refd263k(im)) call max_fields(phil,refl_10cm,con_g,im,levs,refd,gt0,refd263k) - if(mod(kdtminus1,nsteps_per_reset)==0)then + if (reset) then do i=1,im refdmax(i) = -35. refdmax263k(i) = -35. enddo endif do i=1,im - !if(mod(kdtminus1,nsteps_per_reset)==0)then - ! refdmax(I) = -35. - ! refdmax263k(I) = -35. - !endif refdmax(i) = max(refdmax(i),refd(i)) refdmax263k(i) = max(refdmax263k(i),refd263k(i)) enddo @@ -119,7 +112,7 @@ subroutine maximum_hourly_diagnostics_run(im, levs, kdt, nsteps_per_reset, lrada deallocate (refd263k) endif ! - if(mod(kdtminus1,nsteps_per_reset)==0)then + if (reset) then do i=1,im spd10max(i) = -999. u10max(i) = -999. @@ -133,15 +126,6 @@ subroutine maximum_hourly_diagnostics_run(im, levs, kdt, nsteps_per_reset, lrada do i=1,im ! find max hourly wind speed then decompose tem = sqrt(u10m(i)*u10m(i) + v10m(i)*v10m(i)) - !if(mod(kdtminus1,nsteps_per_reset)==0)then - ! spd10max(i) = -999. - ! u10max(i) = -999. - ! v10max(i) = -999. - ! t02max(i) = -999. - ! t02min(i) = 999. - ! rh02max(i) = -999. - ! rh02min(i) = 999. - !endif if (tem > spd10max(i)) then spd10max(i) = tem u10max(i) = u10m(i) @@ -150,16 +134,16 @@ subroutine maximum_hourly_diagnostics_run(im, levs, kdt, nsteps_per_reset, lrada pshltr=pgr(i)*exp(-0.068283/gt0(i,1)) QCQ=PQ0/pshltr*EXP(A2A*(t2m(i)-A3)/(t2m(i)-A4)) rh02=q2m(i)/QCQ - IF (rh02.GT.1.0) THEN - rh02=1.0 + IF (rh02 > 1.0) THEN + rh02 = 1.0 ENDIF - IF (rh02.LT.RHmin) THEN !use smaller RH limit for stratosphere - rh02=RHmin + IF (rh02 < RHmin) THEN !use smaller RH limit for stratosphere + rh02 = RHmin ENDIF - rh02max(i)=max(rh02max(i),rh02) - rh02min(i)=min(rh02min(i),rh02) - t02max(i)=max(t02max(i),t2m(i)) !<--- hourly max 2m t - t02min(i)=min(t02min(i),t2m(i)) !<--- hourly min 2m t + rh02max(i) = max(rh02max(i),rh02) + rh02min(i) = min(rh02min(i),rh02) + t02max(i) = max(t02max(i),t2m(i)) !<--- hourly max 2m t + t02min(i) = min(t02min(i),t2m(i)) !<--- hourly min 2m t enddo end subroutine maximum_hourly_diagnostics_run @@ -183,8 +167,7 @@ subroutine max_fields(phil,ref3D,grav,im,levs,refd,tk,refd263k) do i=1,im refd(I) = -35. vloop: do k=1,levs-1 - if ( (z(i,k+1)) .ge. 1000. & - .and.(z(i,k)) .le. 1000.) then + if ( z(i,k+1) >= 1000. .and. z(i,k) <= 1000.) then zmidp1=z(i,k+1) zmidLOC=z(i,k) dbz1(1)=ref3d(i,k+1) !- dBZ (not Z) values diff --git a/physics/micro_mg_utils.F90 b/physics/micro_mg_utils.F90 index fe1c8c8b0..46985c46c 100644 --- a/physics/micro_mg_utils.F90 +++ b/physics/micro_mg_utils.F90 @@ -253,7 +253,8 @@ module micro_mg_utils ! Mass of each raindrop created from autoconversion. real(r8), parameter :: droplet_mass_25um = 4._r8/3._r8*pi*rhow*(25.e-6_r8)**3 -real(r8), parameter :: droplet_mass_40um = 4._r8/3._r8*pi*rhow*(40.e-6_r8)**3 +real(r8), parameter :: droplet_mass_40um = 4._r8/3._r8*pi*rhow*(40.e-6_r8)**3, & + droplet_mass_40umi = 1._r8/droplet_mass_40um !========================================================= ! Constants set in initialization @@ -1014,7 +1015,8 @@ subroutine sb2001v2_liq_autoconversion(pgam,qc,nc,qr,rho,relvar,au,nprc,nprc1,mg ! parameters for Seifert and Beheng (2001) autoconversion/accretion real(r8), parameter :: kc = 9.44e9_r8 real(r8), parameter :: kr = 5.78e3_r8 - real(r8), parameter :: auf = kc / (20._r8*2.6e-7_r8) * 1000._r8 + real(r8), parameter :: auf = kc / (20._r8*2.6e-7_r8) * 1000._r8, & + con_nprc1 = two/2.6e-7_r8*1000._r8 real(r8) :: dum, dum1, nu, pra_coef, tx1, tx2, tx3, tx4 integer :: dumi, i @@ -1045,8 +1047,10 @@ subroutine sb2001v2_liq_autoconversion(pgam,qc,nc,qr,rho,relvar,au,nprc,nprc1,mg ! (rho(i)*qc(i)/1000._r8)**4._r8/(rho(i)*nc(i)/1.e6_r8)**2._r8* & ! (1._r8+dum1/(1._r8-dum)**2)*1000._r8 / rho(i) - nprc1(i) = au(i) * two / 2.6e-7_r8 * 1000._r8 - nprc(i) = au(i) / droplet_mass_40um +! nprc1(i) = au(i) * two / 2.6e-7_r8 * 1000._r8 +! nprc(i) = au(i) / droplet_mass_40um + nprc1(i) = au(i) * con_nprc1 + nprc(i) = au(i) * droplet_mass_40umi else au(i) = zero nprc1(i) = zero @@ -1080,7 +1084,8 @@ subroutine liu_liq_autoconversion(pgam,qc,nc,qr,rho,relvar, & real(r8) :: xs,lw, nw, beta6 ! real(r8), parameter :: dcrit=1.0e-6, miu_disp=1. ! real(r8), parameter :: dcrit=1.0e-3, miu_disp=1. - real(r8), parameter :: dcrit=2.0e-3, miu_disp=0.8 + real(r8), parameter :: dcrit = 2.0e-3, miu_disp = 0.8, & + con_nprc1 = two/2.6e-7_r8*1000._r8 integer :: i do i=1,mgncol @@ -1099,8 +1104,10 @@ subroutine liu_liq_autoconversion(pgam,qc,nc,qr,rho,relvar, & / (gamma(relvar(i))*(relvar(i)*relvar(i))) au(i) = au(i) * dcrit - nprc1(i)= au(i) * (two/2.6e-7_r8*1000._r8) - nprc(i) = au(i) / droplet_mass_40um +! nprc1(i)= au(i) * (two/2.6e-7_r8*1000._r8) +! nprc(i) = au(i) / droplet_mass_40um + nprc1(i)= au(i) * con_nprc1 + nprc(i) = au(i) * droplet_mass_40umi else au(i) = zero nprc1(i) = zero diff --git a/physics/module_gfdl_cloud_microphys.F90 b/physics/module_gfdl_cloud_microphys.F90 index 23acefb9b..ac3795566 100644 --- a/physics/module_gfdl_cloud_microphys.F90 +++ b/physics/module_gfdl_cloud_microphys.F90 @@ -327,7 +327,7 @@ subroutine gfdl_cloud_microphys_mod_driver ( qv_dt, ql_dt, qr_dt, qi_dt, qs_dt, qg_dt, qa_dt, pt_dt, pt, w, & uin, vin, udt, vdt, dz, delp, area, dt_in, land, & rain, snow, ice, graupel, hydrostatic, phys_hydrostatic, & - p, lradar, refl_10cm, kdt, nsteps_per_reset) + p, lradar, refl_10cm,reset) implicit none @@ -357,7 +357,7 @@ subroutine gfdl_cloud_microphys_mod_driver ( real, intent (in), dimension (iis:iie, jjs:jje, kks:kke) :: p logical, intent (in) :: lradar real, intent (out), dimension (iis:iie, jjs:jje, kks:kke) :: refl_10cm - integer, intent (in) :: kdt, nsteps_per_reset + logical, intent (in) :: reset ! Local variables logical :: melti = .false. @@ -595,7 +595,7 @@ subroutine gfdl_cloud_microphys_mod_driver ( ! call mpp_clock_end (gfdl_mp_clock) if(lradar) then ! Only set melti to true at the output times - if(mod(kdt,nsteps_per_reset)==0)then + if (reset) then melti=.true. else melti=.false. diff --git a/physics/module_nst_water_prop.f90 b/physics/module_nst_water_prop.f90 index 8b38ffb18..20c4dff88 100644 --- a/physics/module_nst_water_prop.f90 +++ b/physics/module_nst_water_prop.f90 @@ -746,7 +746,7 @@ subroutine get_dtzm_2d(xt,xz,dt_cool,zc,wet,icy,z1,z2,nx,ny,dtm) endif endif endif - endif ! if ( wet(i,j) .and. .not.icy(i,j) ) then + endif ! if wet(i,j) .and. .not.icy(i,j) enddo enddo ! diff --git a/physics/moninshoc.f b/physics/moninshoc.f index 05473db6c..96b294824 100644 --- a/physics/moninshoc.f +++ b/physics/moninshoc.f @@ -40,7 +40,7 @@ end subroutine moninshoc_finalize !! | q1 | vertically_diffused_tracer_concentration | tracer concentration diffused by PBL scheme | kg kg-1 | 3 | real | kind_phys | in | F | !! | tkh | atmosphere_heat_diffusivity_from_shoc | diffusivity for heat from the SHOC scheme | m2 s-1 | 2 | real | kind_phys | in | F | !! | prnum | prandtl_number | turbulent Prandtl number | none | 2 | real | kind_phys | inout | F | -!! | ntke | index_for_turbulent_kinetic_energy | tracer index for turbulent kinetic energy | index | 0 | integer | | in | F | +!! | ntke | index_for_turbulent_kinetic_energy_vertical_diffusion_tracer | index for turbulent kinetic energy in the vertically diffused tracer array | index | 0 | integer | | in | F | !! | psk | dimensionless_exner_function_at_lowest_model_interface | dimensionless Exner function at the surface interface | none | 1 | real | kind_phys | in | F | !! | rbsoil | bulk_richardson_number_at_lowest_model_level | bulk Richardson number at the surface | none | 1 | real | kind_phys | in | F | !! | zorl | surface_roughness_length | surface roughness length in cm | cm | 1 | real | kind_phys | in | F | @@ -71,6 +71,7 @@ end subroutine moninshoc_finalize !! | xkzm_m | atmosphere_momentum_diffusivity_background | background value of momentum diffusivity | m2 s-1 | 0 | real | kind_phys | in | F | !! | xkzm_h | atmosphere_heat_diffusivity_background | background value of heat diffusivity | m2 s-1 | 0 | real | kind_phys | in | F | !! | xkzm_s | diffusivity_background_sigma_level | sigma level threshold for background diffusivity | none | 0 | real | kind_phys | in | F | +!! | xkzminv | atmosphere_heat_diffusivity_background_maximum | max. background val. diffusivity in inversion layers | m2 s-1 | 0 | real | kind_phys | in | F | !! | lprnt | flag_print | flag for printing diagnostics to output | flag | 0 | logical | | in | F | !! | ipr | horizontal_index_of_printed_column | horizontal index of printed column | index | 0 | integer | | in | F | !! | me | mpi_rank | current MPI-rank | index | 0 | integer | | in | F | @@ -88,7 +89,8 @@ subroutine moninshoc_run (ix,im,km,ntrac,ntcw,ncnd,dv,du,tau,rtg, & tsea,heat,evap,stress,spd1,kpbl, & prsi,del,prsl,prslk,phii,phil,delt, & dusfc,dvsfc,dtsfc,dqsfc,dkt,hpbl, - & kinver,xkzm_m,xkzm_h,xkzm_s,lprnt,ipr,me, + & kinver,xkzm_m,xkzm_h,xkzm_s,xkzminv, + & lprnt,ipr,me, & grav, rd, cp, hvap, fv, & errmsg,errflg) ! @@ -105,7 +107,7 @@ subroutine moninshoc_run (ix,im,km,ntrac,ntcw,ncnd,dv,du,tau,rtg, integer, dimension(im), intent(in) :: kinver real(kind=kind_phys), intent(in) :: delt, - & xkzm_m, xkzm_h, xkzm_s + & 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, @@ -208,7 +210,8 @@ subroutine moninshoc_run (ix,im,km,ntrac,ntcw,ncnd,dv,du,tau,rtg, do i=1,im xkzo(i,k) = 0.0 xkzmo(i,k) = 0.0 - if (k < kinver(i)) then +! if (k < kinver(i)) then + if (k <= kinver(i)) then ! vertical background diffusivity for heat and momentum tem1 = 1.0 - prsi(i,k+1) * tx1(i) tem1 = min(1.0, exp(-tem1 * tem1 * 10.0)) @@ -224,16 +227,16 @@ subroutine moninshoc_run (ix,im,km,ntrac,ntcw,ncnd,dv,du,tau,rtg, ! ! diffusivity in the inversion layer is set to be xkzminv (m^2/s) ! -! do k = 1,kmpbl -! do i=1,im -! if(zi(i,k+1) > 250.) then -! tem1 = (t1(i,k+1)-t1(i,k)) * rdzt(i,k) -! if(tem1 > 1.e-5) then -! xkzo(i,k) = min(xkzo(i,k),xkzminv) -! endif -! endif -! enddo -! enddo + do k = 1,kmpbl + do i=1,im + if(zi(i,k+1) > 250.) then + tem1 = (t1(i,k+1)-t1(i,k)) * rdzt(i,k) + if(tem1 > 1.e-5) then + xkzo(i,k) = min(xkzo(i,k),xkzminv) + endif + endif + enddo + enddo ! ! do i = 1,im @@ -499,8 +502,6 @@ subroutine moninshoc_run (ix,im,km,ntrac,ntcw,ncnd,dv,du,tau,rtg, ttend = (a1(i,k)-t1(i,k)) * rdt qtend = (a2(i,k)-q1(i,k,1)) * rdt tau(i,k) = tau(i,k) + ttend -! if(lprnt .and. i==ipr .and. k<11) write(0,*)' tau=',tau(ipr,k) -! &,' ttend=',ttend,' a1=',a1(ipr,k),' t1=',t1(ipr,k) rtg(i,k,1) = rtg(i,k,1) + qtend dtsfc(i) = dtsfc(i) + cont*del(i,k)*ttend dqsfc(i) = dqsfc(i) + conq*del(i,k)*qtend diff --git a/physics/mp_thompson.F90 b/physics/mp_thompson.F90 index e87847f95..9fdd43bad 100644 --- a/physics/mp_thompson.F90 +++ b/physics/mp_thompson.F90 @@ -183,9 +183,9 @@ end subroutine mp_thompson_init !! | sr | ratio_of_snowfall_to_rainfall | ratio of snowfall to large-scale rainfall | frac | 1 | real | kind_phys | out | F | !! | refl_10cm | radar_reflectivity_10cm | instantaneous refl_10cm | dBZ | 2 | real | kind_phys | out | F | !! | do_radar_ref | flag_for_radar_reflectivity | flag for radar reflectivity | flag | 0 | logical | | in | F | -!! | re_cloud | effective_radius_of_stratiform_cloud_liquid_water_particle_in_um | eff. radius of cloud liquid water particle in micrometer | um | 2 | real | kind_phys | none | F | -!! | re_ice | effective_radius_of_stratiform_cloud_ice_particle_in_um | eff. radius of cloud ice water particle in micrometer | um | 2 | real | kind_phys | none | F | -!! | re_snow | effective_radius_of_stratiform_cloud_snow_particle_in_um | effective radius of cloud snow particle in micrometers | um | 2 | real | kind_phys | none | F | +!! | re_cloud | effective_radius_of_stratiform_cloud_liquid_water_particle_in_um | eff. radius of cloud liquid water particle in micrometer | um | 2 | real | kind_phys | out | F | +!! | re_ice | effective_radius_of_stratiform_cloud_ice_particle_in_um | eff. radius of cloud ice water particle in micrometer | um | 2 | real | kind_phys | out | F | +!! | re_snow | effective_radius_of_stratiform_cloud_snow_particle_in_um | effective radius of cloud snow particle in micrometers | um | 2 | real | kind_phys | out | F | !! | mpicomm | mpi_comm | MPI communicator | index | 0 | integer | | in | F | !! | mpirank | mpi_rank | current MPI-rank | index | 0 | integer | | in | F | !! | mpiroot | mpi_root | master MPI-rank | index | 0 | integer | | in | F | diff --git a/physics/physcons.F90 b/physics/physcons.F90 index 9027f4cba..0a95bc679 100644 --- a/physics/physcons.F90 +++ b/physics/physcons.F90 @@ -44,45 +44,47 @@ module physcons !> \name Math constants ! real(kind=kind_phys),parameter:: con_pi =3.1415926535897931 !< pi real(kind=kind_phys),parameter:: con_pi =4.0d0*atan(1.0d0) !< pi - real(kind=kind_phys),parameter:: con_sqrt2 =1.414214e+0 !< square root of 2 - real(kind=kind_phys),parameter:: con_sqrt3 =1.732051e+0 !< quare root of 3 + real(kind=kind_phys),parameter:: con_sqrt2 =1.414214e+0_kind_phys !< square root of 2 + real(kind=kind_phys),parameter:: con_sqrt3 =1.732051e+0_kind_phys !< quare root of 3 !> \name Geophysics/Astronomy constants - real(kind=kind_phys),parameter:: con_rerth =6.3712e+6 !< radius of earth (\f$m\f$) - real(kind=kind_phys),parameter:: con_g =9.80665e+0 !< gravity (\f$m/s^{2}\f$) - real(kind=kind_phys),parameter:: con_omega =7.2921e-5 !< ang vel of earth (\f$s^{-1}\f$) - real(kind=kind_phys),parameter:: con_p0 =1.01325e5 !< standard atmospheric pressure (\f$Pa\f$) -! real(kind=kind_phys),parameter:: con_solr =1.36822e+3 ! solar constant (W/m2)-aer(2001) - real(kind=kind_phys),parameter:: con_solr_old =1.3660e+3 !< solar constant (\f$W/m^{2}\f$)-Liu(2002) - real(kind=kind_phys),parameter:: con_solr =1.3608e+3 !< solar constant (\f$W/m^{2}\f$)-nasa-sorce Tim(2008) -! real(kind=kind_phys),parameter:: con_solr =1.36742732e+3 ! solar constant (W/m2)-gfdl(1989) - OPR as of Jan 2006 - ! Selected geophysics/astronomy constants with kind=kind_dyn - real(kind=kind_dyn), parameter:: con_g_dyn =9.80665e+0 !< gravity (\f$m/s^{2}\f$) + real(kind=kind_phys),parameter:: con_rerth =6.3712e+6_kind_phys !< radius of earth (\f$m\f$) + real(kind=kind_phys),parameter:: con_g =9.80665e+0_kind_phys !< gravity (\f$m/s^{2}\f$) + real(kind=kind_phys),parameter:: con_omega =7.2921e-5_kind_phys !< ang vel of earth (\f$s^{-1}\f$) + real(kind=kind_phys),parameter:: con_p0 =1.01325e5_kind_phys !< standard atmospheric pressure (\f$Pa\f$) +! real(kind=kind_phys),parameter:: con_solr =1.36822e+3_kind_phys ! solar constant (W/m2)-aer(2001) + real(kind=kind_phys),parameter:: con_solr_old =1.3660e+3_kind_phys !< solar constant (\f$W/m^{2}\f$)-Liu(2002) + real(kind=kind_phys),parameter:: con_solr =1.3608e+3_kind_phys !< solar constant (\f$W/m^{2}\f$)-nasa-sorce Tim(2008) +! real(kind=kind_phys),parameter:: con_solr =1.36742732e+3_kind_phys ! solar constant (W/m2)-gfdl(1989) - OPR as of Jan 2006 + ! Selected geophysics/astronomy constants with kind=kind_dyn DH* CHECK IF THIS BREAKS B4B AND IF SO REMOVE _kind_dyn + real(kind=kind_dyn), parameter:: con_g_dyn =9.80665e+0_kind_dyn !< gravity (\f$m/s^{2}\f$) !> \name Thermodynamics constants - real(kind=kind_phys),parameter:: con_rgas =8.314472 !< molar gas constant (\f$J/mol/K\f$) - real(kind=kind_phys),parameter:: con_rd =2.8705e+2 !< gas constant air (\f$J/kg/K\f$) - real(kind=kind_phys),parameter:: con_rv =4.6150e+2 !< gas constant H2O (\f$J/kg/K\f$) - real(kind=kind_phys),parameter:: con_cp =1.0046e+3 !< spec heat air at p (\f$J/kg/K\f$) - real(kind=kind_phys),parameter:: con_cv =7.1760e+2 !< spec heat air at v (\f$J/kg/K\f$) - real(kind=kind_phys),parameter:: con_cvap =1.8460e+3 !< spec heat H2O gas (\f$J/kg/K\f$) - real(kind=kind_phys),parameter:: con_cliq =4.1855e+3 !< spec heat H2O liq (\f$J/kg/K\f$) - real(kind=kind_phys),parameter:: con_csol =2.1060e+3 !< spec heat H2O ice (\f$J/kg/K\f$) - real(kind=kind_phys),parameter:: con_hvap =2.5000e+6 !< lat heat H2O cond (\f$J/kg\f$) - real(kind=kind_phys),parameter:: con_hfus =3.3358e+5 !< lat heat H2O fusion (\f$J/kg\f$) - real(kind=kind_phys),parameter:: con_psat =6.1078e+2 !< pres at H2O 3pt (\f$Pa\f$) - real(kind=kind_phys),parameter:: con_t0c =2.7315e+2 !< temp at 0C (K) - real(kind=kind_phys),parameter:: con_ttp =2.7316e+2 !< temp at H2O 3pt (K) - real(kind=kind_phys),parameter:: con_tice =2.7120e+2 !< temp freezing sea (K) - real(kind=kind_phys),parameter:: con_jcal =4.1855E+0 !< joules per calorie - real(kind=kind_phys),parameter:: con_rhw0 =1022.0 !< sea water reference density (\f$kg/m^{3}\f$) - real(kind=kind_phys),parameter:: con_epsq =1.0E-12 !< min q for computing precip type - ! Selected thermodynamics constants with kind=kind_dyn - real(kind=kind_dyn), parameter:: con_rd_dyn =2.8705e+2 !< gas constant air (\f$J/kg/K\f$) - real(kind=kind_dyn), parameter:: con_rv_dyn =4.6150e+2 !< gas constant H2O (\f$J/kg/K\f$) - real(kind=kind_dyn), parameter:: con_cp_dyn =1.0046e+3 !< spec heat air at p (\f$J/kg/K\f$) - real(kind=kind_dyn), parameter:: con_hvap_dyn =2.5000e+6 !< lat heat H2O cond (\f$J/kg\f$) - real(kind=kind_dyn), parameter:: con_hfus_dyn =3.3358e+5 !< lat heat H2O fusion (\f$J/kg\f$) + real(kind=kind_phys),parameter:: con_rgas =8.314472_kind_phys !< molar gas constant (\f$J/mol/K\f$) + real(kind=kind_phys),parameter:: con_rd =2.8705e+2_kind_phys !< gas constant air (\f$J/kg/K\f$) + real(kind=kind_phys),parameter:: con_rv =4.6150e+2_kind_phys !< gas constant H2O (\f$J/kg/K\f$) + real(kind=kind_phys),parameter:: con_cp =1.0046e+3_kind_phys !< spec heat air at p (\f$J/kg/K\f$) + real(kind=kind_phys),parameter:: con_cv =7.1760e+2_kind_phys !< spec heat air at v (\f$J/kg/K\f$) + real(kind=kind_phys),parameter:: con_cvap =1.8460e+3_kind_phys !< spec heat H2O gas (\f$J/kg/K\f$) + real(kind=kind_phys),parameter:: con_cliq =4.1855e+3_kind_phys !< spec heat H2O liq (\f$J/kg/K\f$) + real(kind=kind_phys),parameter:: con_csol =2.1060e+3_kind_phys !< spec heat H2O ice (\f$J/kg/K\f$) + real(kind=kind_phys),parameter:: con_hvap =2.5000e+6_kind_phys !< lat heat H2O cond (\f$J/kg\f$) +! real(kind=kind_phys),parameter:: con_hvap =2.5010e+6_kind_phys ! from AMS + real(kind=kind_phys),parameter:: con_hfus =3.3358e+5_kind_phys !< lat heat H2O fusion (\f$J/kg\f$) +! real(kind=kind_phys),parameter:: con_hfus =3.3370e+5_kind_phys ! from AMS + real(kind=kind_phys),parameter:: con_psat =6.1078e+2_kind_phys !< pres at H2O 3pt (\f$Pa\f$) + real(kind=kind_phys),parameter:: con_t0c =2.7315e+2_kind_phys !< temp at 0C (K) + real(kind=kind_phys),parameter:: con_ttp =2.7316e+2_kind_phys !< temp at H2O 3pt (K) + real(kind=kind_phys),parameter:: con_tice =2.7120e+2_kind_phys !< temp freezing sea (K) + real(kind=kind_phys),parameter:: con_jcal =4.1855E+0_kind_phys !< joules per calorie + real(kind=kind_phys),parameter:: con_rhw0 =1022.0_kind_phys !< sea water reference density (\f$kg/m^{3}\f$) + real(kind=kind_phys),parameter:: con_epsq =1.0E-12_kind_phys !< min q for computing precip type + ! Selected thermodynamics constants with kind=kind_dyn DH* CHECK IF THIS BREAKS B4B AND IF SO REMOVE _kind_dyn + real(kind=kind_dyn), parameter:: con_rd_dyn =2.8705e+2_kind_dyn !< gas constant air (\f$J/kg/K\f$) + real(kind=kind_dyn), parameter:: con_rv_dyn =4.6150e+2_kind_dyn !< gas constant H2O (\f$J/kg/K\f$) + real(kind=kind_dyn), parameter:: con_cp_dyn =1.0046e+3_kind_dyn !< spec heat air at p (\f$J/kg/K\f$) + real(kind=kind_dyn), parameter:: con_hvap_dyn =2.5000e+6_kind_dyn !< lat heat H2O cond (\f$J/kg\f$) + real(kind=kind_dyn), parameter:: con_hfus_dyn =3.3358e+5_kind_dyn !< lat heat H2O fusion (\f$J/kg\f$) !> \name Secondary constants real(kind=kind_phys),parameter:: con_rocp =con_rd/con_cp @@ -96,23 +98,24 @@ module physcons real(kind=kind_phys),parameter:: con_xponb =-con_dldt/con_rv+con_hvap/(con_rv*con_ttp) !> \name Other Physics/Chemistry constants (source: 2002 CODATA) - real(kind=kind_phys),parameter:: con_c =2.99792458e+8 !< speed of light (\f$m/s\f$) - real(kind=kind_phys),parameter:: con_plnk =6.6260693e-34 !< planck constant (\f$J/s\f$) - real(kind=kind_phys),parameter:: con_boltz =1.3806505e-23 !< boltzmann constant (\f$J/K\f$) - real(kind=kind_phys),parameter:: con_sbc =5.670400e-8 !< stefan-boltzmann (\f$W/m^{2}/K^{4}\f$) - real(kind=kind_phys),parameter:: con_avgd =6.0221415e23 !< avogadro constant (\f$mol^{-1}\f$) - real(kind=kind_phys),parameter:: con_gasv =22413.996e-6 !< vol of ideal gas at 273.15K, 101.325kPa (\f$m^{3}/mol\f$) -! real(kind=kind_phys),parameter:: con_amd =28.970 !< molecular wght of dry air (g/mol) - real(kind=kind_phys),parameter:: con_amd =28.9644 !< molecular wght of dry air (\f$g/mol\f$) - real(kind=kind_phys),parameter:: con_amw =18.0154 !< molecular wght of water vapor (\f$g/mol\f$) - real(kind=kind_phys),parameter:: con_amo3 =47.9982 !< molecular wght of o3 (\f$g/mol\f$) -! real(kind=kind_phys),parameter:: con_amo3 =48.0 !< molecular wght of o3 (g/mol) - real(kind=kind_phys),parameter:: con_amco2 =44.011 !< molecular wght of co2 (\f$g/mol\f$) - real(kind=kind_phys),parameter:: con_amo2 =31.9999 !< molecular wght of o2 (\f$g/mol\f$) - real(kind=kind_phys),parameter:: con_amch4 =16.043 !< molecular wght of ch4 (\f$g/mol\f$) - real(kind=kind_phys),parameter:: con_amn2o =44.013 !< molecular wght of n2o (\f$g/mol\f$) - real(kind=kind_phys),parameter:: con_thgni =-38.15 !< temperature the H.G.Nuc. ice starts - real(kind=kind_phys),parameter:: cimin =0.15 !< minimum ice concentration + real(kind=kind_phys),parameter:: con_c =2.99792458e+8_kind_phys !< speed of light (\f$m/s\f$) + real(kind=kind_phys),parameter:: con_plnk =6.6260693e-34_kind_phys !< planck constant (\f$J/s\f$) + real(kind=kind_phys),parameter:: con_boltz =1.3806505e-23_kind_phys !< boltzmann constant (\f$J/K\f$) + real(kind=kind_phys),parameter:: con_sbc =5.670400e-8_kind_phys !< stefan-boltzmann (\f$W/m^{2}/K^{4}\f$) + real(kind=kind_phys),parameter:: con_avgd =6.0221415e23_kind_phys !< avogadro constant (\f$mol^{-1}\f$) + real(kind=kind_phys),parameter:: con_gasv =22413.996e-6_kind_phys !< vol of ideal gas at 273.15K, 101.325kPa (\f$m^{3}/mol\f$) +! real(kind=kind_phys),parameter:: con_amd =28.970_kind_phys !< molecular wght of dry air (g/mol) + real(kind=kind_phys),parameter:: con_amd =28.9644_kind_phys !< molecular wght of dry air (\f$g/mol\f$) + real(kind=kind_phys),parameter:: con_amw =18.0154_kind_phys !< molecular wght of water vapor (\f$g/mol\f$) + real(kind=kind_phys),parameter:: con_amo3 =47.9982_kind_phys !< molecular wght of o3 (\f$g/mol\f$) +! real(kind=kind_phys),parameter:: con_amo3 =48.0_kind_phys !< molecular wght of o3 (g/mol) + real(kind=kind_phys),parameter:: con_amco2 =44.011_kind_phys !< molecular wght of co2 (\f$g/mol\f$) + real(kind=kind_phys),parameter:: con_amo2 =31.9999_kind_phys !< molecular wght of o2 (\f$g/mol\f$) + real(kind=kind_phys),parameter:: con_amch4 =16.043_kind_phys !< molecular wght of ch4 (\f$g/mol\f$) + real(kind=kind_phys),parameter:: con_amn2o =44.013_kind_phys !< molecular wght of n2o (\f$g/mol\f$) + real(kind=kind_phys),parameter:: con_thgni =-38.15_kind_phys !< temperature the H.G.Nuc. ice starts + + real(kind=kind_phys),parameter:: cimin =0.15 !< minimum ice concentration !> \name Miscellaneous physics related constants (For WSM6; Moorthi - Jul 2014) ! integer, parameter :: max_lon=16000, max_lat=8000, min_lon=192, min_lat=94 @@ -123,12 +126,12 @@ module physcons ! real(kind=kind_phys), parameter:: rlapse = 0.65e-2, rhc_max = 0.9999999 ! new ! real(kind=kind_phys), parameter:: rlapse = 0.65e-2, rhc_max = 0.9900 - real(kind=kind_phys), parameter:: rlapse = 0.65e-2 - real(kind=kind_phys), parameter:: cb2mb = 10.0, pa2mb = 0.01 + real(kind=kind_phys), parameter:: rlapse = 0.65e-2_kind_phys + real(kind=kind_phys), parameter:: cb2mb = 10.0_kind_phys, pa2mb = 0.01_kind_phys ! for wsm6 - real(kind=kind_phys),parameter:: rhowater = 1000. !< density of water (kg/m^3) - real(kind=kind_phys),parameter:: rhosnow = 100. !< density of snow (kg/m^3) - real(kind=kind_phys),parameter:: rhoair = 1.28 !< density of air near surface (kg/m^3) + real(kind=kind_phys),parameter:: rhowater = 1000._kind_phys !< density of water (kg/m^3) + real(kind=kind_phys),parameter:: rhosnow = 100._kind_phys !< density of snow (kg/m^3) + real(kind=kind_phys),parameter:: rhoair = 1.28_kind_phys !< density of air near surface (kg/m^3) !........................................! end module physcons ! diff --git a/physics/radiation_astronomy.f b/physics/radiation_astronomy.f index 8a788b257..f1651ca84 100644 --- a/physics/radiation_astronomy.f +++ b/physics/radiation_astronomy.f @@ -611,7 +611,7 @@ subroutine sol_update & ! --- ... setting up calculation parameters used by subr coszmn - nswr = nint(deltsw / deltim) ! number of mdl t-step per sw call + nswr = max(1, nint(deltsw/deltim)) ! number of mdl t-step per sw call dtswh = deltsw / f3600 ! time length in hours ! if ( deltsw >= f3600 ) then ! for longer sw call interval @@ -624,7 +624,7 @@ subroutine sol_update & ! anginc = pid12 * dtswh / float(nstp-1) ! solar angle inc during each calc step - nstp = nswr + nstp = max(6, nswr) anginc = pid12 * dtswh / float(nstp) if ( me == 0 ) then @@ -870,7 +870,7 @@ subroutine coszmn & real (kind=kind_phys), intent(out) :: coszen(:), coszdg(:) ! --- locals: - real (kind=kind_phys) :: coszn, cns, ss, cc, solang, rstp + real (kind=kind_phys) :: coszn, cns, solang, rstp integer :: istsun(IM), i, it, j, lat @@ -886,12 +886,9 @@ subroutine coszmn & do it = 1, nstp cns = solang + (float(it)-0.5)*anginc + sollag - do i = 1, IM - ss = sinlat(i) * sindec - cc = coslat(i) * cosdec - - coszn = ss + cc * cos(cns + xlon(i)) + coszn = sindec * sinlat(i) + cosdec * coslat(i) & + & * cos(cns+xlon(i)) coszen(i) = coszen(i) + max(0.0, coszn) if (coszn > czlimt) istsun(i) = istsun(i) + 1 enddo diff --git a/physics/radiation_clouds.f b/physics/radiation_clouds.f index 5fa31a670..506723ff1 100644 --- a/physics/radiation_clouds.f +++ b/physics/radiation_clouds.f @@ -2741,26 +2741,27 @@ subroutine progclduni & ! ==================== definition of variables ==================== ! ! ! ! input variables: ! -! plyr (IX,NLAY) : model layer mean pressure in mb (100Pa) ! -! plvl (IX,NLP1) : model level pressure in mb (100Pa) ! -! tlyr (IX,NLAY) : model layer mean temperature in k ! -! tvly (IX,NLAY) : model layer virtual temperature in k ! -! ccnd (IX,NLAY) : layer cloud condensate amount ! -! ncnd : number of layer cloud condensate types ! -! xlat (IX) : grid latitude in radians, default to pi/2 -> -pi/2! -! range, otherwise see in-line comment ! -! xlon (IX) : grid longitude in radians (not used) ! -! slmsk (IX) : sea/land mask array (sea:0,land:1,sea-ice:2) ! -! IX : horizontal dimention ! -! NLAY,NLP1 : vertical layer/level dimensions ! -! cldtot : unified cloud fracrion from moist physics ! -! effrl (ix,nlay) : effective radius for liquid water ! -! effri (ix,nlay) : effective radius for ice water ! -! effrr (ix,nlay) : effective radius for rain water ! -! effrs (ix,nlay) : effective radius for snow water ! -! effr_in : logical - if .true. use input effective radii ! -! dz (ix,nlay) : layer thickness (km) ! -! delp (ix,nlay) : model layer pressure thickness in mb (100Pa) ! +! plyr (IX,NLAY) : model layer mean pressure in mb (100Pa) ! +! plvl (IX,NLP1) : model level pressure in mb (100Pa) ! +! tlyr (IX,NLAY) : model layer mean temperature in k ! +! tvly (IX,NLAY) : model layer virtual temperature in k ! +! ccnd (IX,NLAY,ncnd) : layer cloud condensate amount ! +! water, ice, rain, snow (+ graupel) ! +! ncnd : number of layer cloud condensate types (max of 4) ! +! xlat (IX) : grid latitude in radians, default to pi/2 -> -pi/2! +! range, otherwise see in-line comment ! +! xlon (IX) : grid longitude in radians (not used) ! +! slmsk (IX) : sea/land mask array (sea:0,land:1,sea-ice:2) ! +! IX : horizontal dimention ! +! NLAY,NLP1 : vertical layer/level dimensions ! +! cldtot : unified cloud fracrion from moist physics ! +! effrl (ix,nlay) : effective radius for liquid water ! +! effri (ix,nlay) : effective radius for ice water ! +! effrr (ix,nlay) : effective radius for rain water ! +! effrs (ix,nlay) : effective radius for snow water ! +! effr_in : logical - if .true. use input effective radii ! +! dz (ix,nlay) : layer thickness (km) ! +! delp (ix,nlay) : model layer pressure thickness in mb (100Pa) ! ! ! ! output variables: ! ! clouds(IX,NLAY,NF_CLDS) : cloud profiles ! @@ -2818,7 +2819,7 @@ subroutine progclduni & ! --- local variables: real (kind=kind_phys), dimension(IX,NLAY) :: cldcnv, cwp, cip, & - & crp, csp, rew, rei, res, rer, tem2d + & crp, csp, rew, rei, res, rer real (kind=kind_phys), dimension(IX,NLAY,ncnd) :: cndf real (kind=kind_phys) :: ptop1(IX,NK_CLDS+1), rxlat(ix) @@ -2830,47 +2831,23 @@ subroutine progclduni & ! !===> ... begin here ! - do nf=1,nf_clds - do k=1,nlay - do i=1,ix - clouds(i,k,nf) = 0.0 - enddo +! do nf=1,nf_clds +! do k=1,nlay +! do i=1,ix +! clouds(i,k,nf) = 0.0 +! enddo +! enddo +! enddo +! + do k = 1, NLAY + do i = 1, IX + cldcnv(i,k) = 0.0 + cwp(i,k) = 0.0 + cip(i,k) = 0.0 + crp(i,k) = 0.0 + csp(i,k) = 0.0 enddo enddo -! clouds(:,:,:) = 0.0 - - if (effr_in) then - do k = 1, NLAY - do i = 1, IX - cldcnv(i,k) = 0.0 - cwp (i,k) = 0.0 - cip (i,k) = 0.0 - crp (i,k) = 0.0 - csp (i,k) = 0.0 - rew (i,k) = effrl (i,k) - rei (i,k) = max(10.0, min(150.0,effri (i,k))) - rer (i,k) = effrr (i,k) - res (i,k) = effrs (i,k) - tem2d (i,k) = min( 1.0, max( 0.0,(con_ttp-tlyr(i,k))*0.05)) - enddo - enddo - else - do k = 1, NLAY - do i = 1, IX - cldcnv(i,k) = 0.0 - cwp (i,k) = 0.0 - cip (i,k) = 0.0 - crp (i,k) = 0.0 - csp (i,k) = 0.0 - rew (i,k) = reliq_def ! default liq radius to 10 micron - rei (i,k) = reice_def ! default ice radius to 50 micron - rer (i,k) = rrain_def ! default rain radius to 1000 micron - res (i,k) = rsnow_def ! default snow radius to 250 micron - tem2d (i,k) = min(1.0, max(0.0, (con_ttp-tlyr(i,k))*0.05)) - enddo - enddo - endif -! do n=1,ncnd do k = 1, NLAY do i = 1, IX @@ -2878,7 +2855,7 @@ subroutine progclduni & enddo enddo enddo - if ( lcrick ) then + if ( lcrick ) then ! vertical smoorthing do n=1,ncnd do i = 1, IX cndf(i,1,n) = 0.75*ccnd(i,1,n) + 0.25*ccnd(i,2,n) @@ -2893,54 +2870,25 @@ subroutine progclduni & enddo endif -!> - Find top pressure for each cloud domain for given latitude. -! ptopc(k,i): top presure of each cld domain (k=1-4 are sfc,L,m,h; -! --- i=1,2 are low-lat (<45 degree) and pole regions) - - do i =1, IX - rxlat(i) = abs( xlat(i) / con_pi ) ! if xlat in pi/2 -> -pi/2 range -! rxlat(i) = abs(0.5 - xlat(i)/con_pi) ! if xlat in 0 -> pi range - enddo - - do id = 1, 4 - tem1 = ptopc(id,2) - ptopc(id,1) - - do i =1, IX - ptop1(i,id) = ptopc(id,1) + tem1*max( 0.0, 4.0*rxlat(i)-1.0 ) - enddo - enddo - !> -# Compute cloud liquid/ice condensate path in \f$ g/m^2 \f$ . - if (ncnd == 2) then - do k = 1, NLAY - do i = 1, IX - tem1 = gfac * delp(i,k) - cwp(i,k) = cndf(i,k,1) * tem1 - cip(i,k) = cndf(i,k,2) * tem1 - enddo + if (ncnd == 2) then + do k = 1, NLAY + do i = 1, IX + tem1 = gfac * delp(i,k) + cwp(i,k) = cndf(i,k,1) * tem1 + cip(i,k) = cndf(i,k,2) * tem1 enddo - elseif (ncnd == 4 .or. ncnd == 5) then - do k = 1, NLAY - do i = 1, IX - tem1 = gfac * delp(i,k) - cwp(i,k) = cndf(i,k,1) * tem1 - cip(i,k) = cndf(i,k,2) * tem1 - crp(i,k) = cndf(i,k,3) * tem1 - csp(i,k) = cndf(i,k,4) * tem1 - enddo + enddo + elseif (ncnd == 4) then + do k = 1, NLAY + do i = 1, IX + tem1 = gfac * delp(i,k) + cwp(i,k) = cndf(i,k,1) * tem1 + cip(i,k) = cndf(i,k,2) * tem1 + crp(i,k) = cndf(i,k,3) * tem1 + csp(i,k) = cndf(i,k,4) * tem1 enddo - endif - -!> -# Compute effective liquid cloud droplet radius over land. - - if(.not. effr_in) then - do i = 1, IX - if (nint(slmsk(i)) == 1) then - do k = 1, NLAY - rew(i,k) = 5.0 + 5.0 * tem2d(i,k) - enddo - endif enddo endif @@ -2969,10 +2917,39 @@ subroutine progclduni & enddo endif -!> - Compute effective ice cloud droplet radius following -!! Heymsfield and McFarquhar (1996) \cite heymsfield_and_mcfarquhar_1996. +! assign/calculate efective radii for cloud water, ice, rain, snow + + if (effr_in) then + do k = 1, NLAY + do i = 1, IX + rew(i,k) = effrl (i,k) + rei(i,k) = max(10.0, min(150.0,effri (i,k))) + rer(i,k) = effrr (i,k) + res(i,k) = effrs (i,k) + enddo + enddo + else + do k = 1, NLAY + do i = 1, IX + rew(i,k) = reliq_def ! default liq radius to 10 micron + rei(i,k) = reice_def ! default ice radius to 50 micron + rer(i,k) = rrain_def ! default rain radius to 1000 micron + res(i,k) = rsnow_def ! default snow radius to 250 micron + enddo + enddo +!> -# Compute effective liquid cloud droplet radius over land. + do i = 1, IX + if (nint(slmsk(i)) == 1) then + do k = 1, NLAY + tem1 = min(1.0, max(0.0, (con_ttp-tlyr(i,k))*0.05)) + rew(i,k) = 5.0 + 5.0 * tem1 + enddo + endif + enddo + +!> -# Compute effective ice cloud droplet radius following Heymsfield +!! and McFarquhar (1996) \cite heymsfield_and_mcfarquhar_1996. - if(.not. effr_in) then do k = 1, NLAY do i = 1, IX tem2 = tlyr(i,k) - con_ttp @@ -2997,7 +2974,6 @@ subroutine progclduni & enddo enddo endif - ! do k = 1, NLAY do i = 1, IX @@ -3013,8 +2989,24 @@ subroutine progclduni & enddo enddo -! --- ... estimate clouds decorrelation length in km -! this is only a tentative test, need to consider change later +!> -# Find top pressure for each cloud domain for given latitude. +! ptopc(k,i): top presure of each cld domain (k=1-4 are sfc,L,m,h; +! --- i=1,2 are low-lat (<45 degree) and pole regions) + + do i =1, IX + rxlat(i) = abs( xlat(i) / con_pi ) ! if xlat in pi/2 -> -pi/2 range +! rxlat(i) = abs(0.5 - xlat(i)/con_pi) ! if xlat in 0 -> pi range + enddo + + do id = 1, 4 + tem1 = ptopc(id,2) - ptopc(id,1) + do i =1, IX + ptop1(i,id) = ptopc(id,1) + tem1*max( 0.0, 4.0*rxlat(i)-1.0 ) + enddo + enddo + +!> -# Estimate clouds decorrelation length in km +! this is only a tentative test, need to consider change later if ( iovr == 3 ) then do i = 1, ix diff --git a/physics/samfdeepcnv.f b/physics/samfdeepcnv.f index 4577d96d3..d4b48af35 100644 --- a/physics/samfdeepcnv.f +++ b/physics/samfdeepcnv.f @@ -104,7 +104,7 @@ end subroutine samfdeepcnv_finalize !! | cnv_ndrop | number_concentration_of_cloud_liquid_water_particles_for_detrainment | droplet number concentration in convective detrainment | m-3 | 2 | real | kind_phys | inout | F | !! | cnv_nice | number_concentration_of_ice_crystals_for_detrainment | crystal number concentration in convective detrainment | m-3 | 2 | real | kind_phys | inout | F | !! | mp_phys | flag_for_microphysics_scheme | choice of microphysics scheme | flag | 0 | integer | | in | F | -!! | mp_phys_mg | flag_for_morrison_gettelman_microphysics_scheme | choice of Morrison-Gettelman rmicrophysics scheme | flag | 0 | integer | | in | F | +!! | mp_phys_mg | flag_for_morrison_gettelman_microphysics_scheme | choice of Morrison-Gettelman microphysics scheme | flag | 0 | integer | | in | F | !! | clam | entrainment_rate_coefficient_deep_convection | entrainment rate coefficient for deep conv. | none | 0 | real | kind_phys | in | F | !! | c0s | rain_conversion_parameter_deep_convection | convective rain conversion parameter for deep conv. | m-1 | 0 | real | kind_phys | in | F | !! | c1 | detrainment_conversion_parameter_deep_convection | convective detrainment conversion parameter for deep conv. | m-1 | 0 | real | kind_phys | in | F | diff --git a/physics/samfshalcnv.f b/physics/samfshalcnv.f index de64cf211..183467d4b 100644 --- a/physics/samfshalcnv.f +++ b/physics/samfshalcnv.f @@ -1880,7 +1880,6 @@ subroutine samfshalcnv_post_run (im, levs, lssav, shcnvcw, frain, character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg - real(kind=kind_phys), dimension(im) :: raincs integer :: i, k ! Initialize CCPP error handling variables @@ -1888,15 +1887,8 @@ subroutine samfshalcnv_post_run (im, levs, lssav, shcnvcw, frain, errflg = 0 do i=1,im - raincs(i) = frain * rain1(i) - rainc(i) = rainc(i) + raincs(i) + rainc(i) = rainc(i) + frain * rain1(i) enddo - if (lssav) then - do i=1,im - cnvprcp(i) = cnvprcp(i) + raincs(i) - cnvprcpb(i) = cnvprcpb(i) + raincs(i) - enddo - endif ! in mfshalcnv, 'cnvw' and 'cnvc' are set to zero before computation starts: if (shcnvcw .and. num_p3d == 4 .and. npdf3d == 3) then do k=1,levs diff --git a/physics/sfc_diag.f b/physics/sfc_diag.f index 86fb9f39b..7200e9231 100644 --- a/physics/sfc_diag.f +++ b/physics/sfc_diag.f @@ -28,6 +28,12 @@ end subroutine sfc_diag_finalize !! | v1 | y_wind_at_lowest_model_layer_updated_by_physics | y component of 1st model layer wind | m s-1 | 1 | real | kind_phys | in | F | !! | t1 | air_temperature_at_lowest_model_layer_updated_by_physics | 1st model layer air temperature | K | 1 | real | kind_phys | in | F | !! | q1 | water_vapor_specific_humidity_at_lowest_model_layer_updated_by_physics | 1st model layer specific humidity | kg kg-1 | 1 | real | kind_phys | in | F | +!! | prslki | ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer | Exner function ratio bt midlayer and interface at 1st layer | ratio | 1 | real | kind_phys | in | F | +!! | evap | kinematic_surface_upward_latent_heat_flux | surface upward evaporation flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | +!! | fm | Monin-Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity parameter for momentum | none | 1 | real | kind_phys | in | F | +!! | fh | Monin-Obukhov_similarity_function_for_heat | Monin-Obukhov similarity parameter for heat | none | 1 | real | kind_phys | in | F | +!! | fm10 | Monin-Obukhov_similarity_function_for_momentum_at_10m | Monin-Obukhov similarity parameter for momentum | none | 1 | real | kind_phys | in | F | +!! | fh2 | Monin-Obukhov_similarity_function_for_heat_at_2m | Monin-Obukhov similarity parameter for heat | none | 1 | real | kind_phys | in | F | !! | tskin | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | in | F | !! | qsurf | surface_specific_humidity | surface specific humidity | kg kg-1 | 1 | real | kind_phys | in | F | !! | f10m | ratio_of_wind_at_lowest_model_layer_and_wind_at_10m | ratio of fm10 and fm | ratio | 1 | real | kind_phys | out | F | @@ -35,12 +41,6 @@ end subroutine sfc_diag_finalize !! | v10m | y_wind_at_10m | y component of wind at 10 m | m s-1 | 1 | real | kind_phys | out | F | !! | t2m | temperature_at_2m | temperature at 2 m | K | 1 | real | kind_phys | out | F | !! | q2m | specific_humidity_at_2m | specific humidity at 2 m | kg kg-1 | 1 | real | kind_phys | out | F | -!! | prslki | ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer | Exner function ratio bt midlayer and interface at 1st layer | ratio | 1 | real | kind_phys | in | F | -!! | evap | kinematic_surface_upward_latent_heat_flux | surface upward evaporation flux | kg kg-1 m s-1 | 1 | real | kind_phys | in | F | -!! | fm | Monin-Obukhov_similarity_function_for_momentum | Monin-Obukhov similarity parameter for momentum | none | 1 | real | kind_phys | in | F | -!! | fh | Monin-Obukhov_similarity_function_for_heat | Monin-Obukhov similarity parameter for heat | none | 1 | real | kind_phys | in | F | -!! | fm10 | Monin-Obukhov_similarity_function_for_momentum_at_10m | Monin-Obukhov similarity parameter for momentum | none | 1 | real | kind_phys | in | F | -!! | fh2 | Monin-Obukhov_similarity_function_for_heat_at_2m | Monin-Obukhov similarity parameter for heat | none | 1 | real | kind_phys | in | F | !! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | !! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | !! @@ -48,9 +48,9 @@ end subroutine sfc_diag_finalize !! \section detailed Detailed Algorithm !! @{ subroutine sfc_diag_run & - & (im,grav,cp,eps,epsm1,ps,u1,v1,t1,q1, & - & tskin,qsurf,f10m,u10m,v10m,t2m,q2m, & - & prslki,evap,fm,fh,fm10,fh2,errmsg,errflg & + & (im,grav,cp,eps,epsm1,ps,u1,v1,t1,q1,prslki, & + & evap,fm,fh,fm10,fh2,tskin,qsurf, & + & f10m,u10m,v10m,t2m,q2m,errmsg,errflg & & ) ! use machine , only : kind_phys @@ -70,7 +70,7 @@ subroutine sfc_diag_run & ! locals ! real(kind=kind_phys), parameter :: qmin=1.0e-8 - integer ::k,i + integer :: k,i ! real(kind=kind_phys) :: fhi, qss, wrk ! real(kind=kind_phys) sig2k, fhi, qss diff --git a/physics/sfc_diff.f b/physics/sfc_diff.f index ff503d3b2..5361b6355 100644 --- a/physics/sfc_diff.f +++ b/physics/sfc_diff.f @@ -59,7 +59,6 @@ end subroutine sfc_diff_finalize !! | wet | flag_nonzero_wet_surface_fraction | flag indicating presence of some ocean or lake surface area fraction | flag | 1 | logical | | in | F | !! | dry | flag_nonzero_land_surface_fraction | flag indicating presence of some land surface area fraction | flag | 1 | logical | | in | F | !! | icy | flag_nonzero_sea_ice_surface_fraction | flag indicating presence of some sea ice surface area fraction | flag | 1 | logical | | in | F | -!! | fice | sea_ice_concentration | ice fraction over open water | frac | 1 | real | kind_phys | in | F | !! | tskin_ocn | surface_skin_temperature_over_ocean_interstitial | surface skin temperature over ocean (temporary use as interstitial) | K | 1 | real | kind_phys | in | F | !! | tskin_lnd | surface_skin_temperature_over_land_interstitial | surface skin temperature over land (temporary use as interstitial) | K | 1 | real | kind_phys | in | F | !! | tskin_ice | surface_skin_temperature_over_ice_interstitial | surface skin temperature over ice (temporary use as interstitial) | K | 1 | real | kind_phys | in | F | @@ -135,7 +134,7 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) & sigmaf,vegtype,shdmax,ivegsrc, & !intent(in) & z0pert,ztpert, & ! mg, sfc-perts !intent(in) & flag_iter,redrag, & !intent(in) - & wet,dry,icy,fice, & !intent(in) + & wet,dry,icy, & !intent(in) & tskin_ocn, tskin_lnd, tskin_ice, & !intent(in) & tsurf_ocn, tsurf_lnd, tsurf_ice, & !intent(in) & snwdph_ocn,snwdph_lnd,snwdph_ice, & !intent(in) @@ -170,8 +169,7 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) real(kind=kind_phys), dimension(im), intent(in) :: & & tskin_ocn, tskin_lnd, tskin_ice, & & tsurf_ocn, tsurf_lnd, tsurf_ice, & - & snwdph_ocn,snwdph_lnd,snwdph_ice, & - & fice + & snwdph_ocn,snwdph_lnd,snwdph_ice real(kind=kind_phys), dimension(im), intent(inout) :: & & z0rl_ocn, z0rl_lnd, z0rl_ice, & @@ -237,24 +235,24 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) & + max(0.0, min(ddvel(i), 30.0)), 1.0) tem1 = 1.0 + rvrdm1 * max(q1(i),1.e-8) thv1 = t1(i) * prslki(i) * tem1 - tvs_ocn = 0.5 * (tsurf_ocn(i)+tskin_ocn(i)) * tem1 tvs_lnd = 0.5 * (tsurf_lnd(i)+tskin_lnd(i)) * tem1 tvs_ice = 0.5 * (tsurf_ice(i)+tskin_ice(i)) * tem1 + tvs_ocn = 0.5 * (tsurf_ocn(i)+tskin_ocn(i)) * tem1 qs1 = fpvs(t1(i)) qs1 = max(1.0e-8, eps * qs1 / (prsl1(i) + epsm1 * qs1)) - z0_ocn = 0.01 * z0rl_ocn(i) - z0max_ocn = max(1.0e-6, min(z0_ocn,z1(i))) - z0_lnd = 0.01 * z0rl_lnd(i) - z0max_lnd = max(1.0e-6, min(z0_lnd,z1(i))) - z0_ice = 0.01 * z0rl_ice(i) - z0max_ice = max(1.0e-6, min(z0_ice,z1(i))) + z0_lnd = 0.01 * z0rl_lnd(i) + z0max_lnd = max(1.0e-6, min(z0_lnd,z1(i))) + z0_ice = 0.01 * z0rl_ice(i) + z0max_ice = max(1.0e-6, min(z0_ice,z1(i))) + z0_ocn = 0.01 * z0rl_ocn(i) + z0max_ocn = max(1.0e-6, min(z0_ocn,z1(i))) ! compute stability dependent exchange coefficients ! this portion of the code is presently suppressed ! - if (wet(i) .and. fice(i) < 1.) then ! some open ocean + if (wet(i)) then ! some open ocean ustar_ocn(i) = sqrt(grav * z0_ocn / charnock) !** test xubin's new z0 @@ -346,7 +344,7 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) ztmax_ice = max(ztmax_ice,1.0e-6) ! BWG begin "stability" block, 2019-03-23 - if (wet(i) .and. fice(i) < 1.) then ! Some open ocean + if (wet(i)) then ! Some open ocean call stability ! --- inputs: & (z1(i),snwdph_ocn(i),thv1,wind(i), @@ -382,7 +380,7 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) ! ! update z0 over ocean ! - if (wet(i) .and. fice(i) < 1.) then + if (wet(i)) then z0_ocn = (charnock / grav) * ustar_ocn(i) * ustar_ocn(i) ! mbek -- toga-coare flux algorithm diff --git a/physics/sfc_drv.f b/physics/sfc_drv.f index 51ed2fe98..ffe47ee17 100644 --- a/physics/sfc_drv.f +++ b/physics/sfc_drv.f @@ -514,13 +514,12 @@ subroutine lsm_noah_run & !! 0.5 and the perturbations go to zero as vegetation fraction approaches its upper !! or lower bound. vegfp = vegfpert(i) ! sfc-perts, mgehne - ! sfc perts, mgehne if (pertvegf(1)>0.0) then ! compute beta distribution parameters for vegetation fraction mv = shdfac sv = pertvegf(1)*mv*(1.-mv) - alphav = mv*mv*(1.-mv)/(sv*sv)-mv - betav = alphav*(1.-mv)/mv + alphav = mv*mv*(1.0-mv)/(sv*sv)-mv + betav = alphav*(1.0-mv)/mv ! compute beta distribution value corresponding ! to the given percentile albPpert to use as new albedo call ppfbet(vegfp,alphav,betav,iflag,vegftmp) diff --git a/physics/sfc_drv_ruc.F90 b/physics/sfc_drv_ruc.F90 index f7899a75d..3b0e64637 100644 --- a/physics/sfc_drv_ruc.F90 +++ b/physics/sfc_drv_ruc.F90 @@ -189,8 +189,8 @@ end subroutine lsm_ruc_finalize !! | snet | surface_net_downwelling_shortwave_flux | surface net downwelling shortwave flux at current time | W m-2 | 1 | real | kind_phys | in | F | !! | sfcemis | surface_longwave_emissivity | surface lw emissivity in fraction | frac | 1 | real | kind_phys | inout | F | !! | wspd | wind_speed_at_lowest_model_layer | wind speed at lowest model level | m s-1 | 1 | real | kind_phys | inout | F | -!! | cm | surface_drag_coefficient_for_momentum_in_air | surface exchange coeff for momentum | none | 1 | real | kind_phys | in | F | -!! | ch | surface_drag_coefficient_for_heat_and_moisture_in_air | surface exchange coeff heat & moisture | none | 1 | real | kind_phys | in | F | +!! | cm | surface_drag_coefficient_for_momentum_in_air_over_land | surface exchange coeff for momentum over land | none | 1 | real | kind_phys | in | F | +!! | ch | surface_drag_coefficient_for_heat_and_moisture_in_air_over_land | surface exchange coeff heat & moisture over land | none | 1 | real | kind_phys | in | F | !! | chh | surface_drag_mass_flux_for_heat_and_moisture_in_air_over_land | thermal exchange coefficient over land | kg m-2 s-1 | 1 | real | kind_phys | inout | F | !! | cmm | surface_drag_wind_speed_for_momentum_in_air_over_land | momentum exchange coefficient over land | m s-1 | 1 | real | kind_phys | inout | F | !! | wet1 | normalized_soil_wetness | normalized soil wetness | frac | 1 | real | kind_phys | inout | F | @@ -222,9 +222,9 @@ end subroutine lsm_ruc_finalize !! | smfrkeep | volume_fraction_of_frozen_soil_moisture_for_land_surface_model | volume fraction of frozen soil moisture for lsm | frac | 2 | real | kind_phys | inout | F | !! | tslb | soil_temperature_for_land_surface_model | soil temperature for land surface model | K | 2 | real | kind_phys | inout | F | !! | stm | soil_moisture_content | soil moisture content | kg m-2 | 1 | real | kind_phys | inout | F | -!! | tskin | surface_skin_temperature_over_land_interstitial | surface skin temperature over land (temporary use as interstitial)| K | 1 | real | kind_phys | inout | F | +!! | tskin | surface_skin_temperature_over_land_interstitial | surface skin temperature over land use as interstitial | K | 1 | real | kind_phys | inout | F | !! | tsurf | surface_skin_temperature_after_iteration_over_land | surface skin temperature after iteration over land | K | 1 | real | kind_phys | inout | F | -!! | tice | sea_ice_temperature | sea ice surface skin temperature | K | 1 | real | kind_phys | inout | F | +!! | tice | sea_ice_temperature_interstitial | sea ice surface skin temperature use as interstitial | K | 1 | real | kind_phys | inout | F | !! | tsnow | snow_temperature_bottom_first_layer | snow temperature at the bottom of first snow layer | K | 1 | real | kind_phys | inout | F | !! | snowfallac | total_accumulated_snowfall | run-total snow accumulation on the ground | kg m-2 | 1 | real | kind_phys | inout | F | !! | acsnow | accumulated_water_equivalent_of_frozen_precip | snow water equivalent of run-total frozen precip | kg m-2 | 1 | real | kind_phys | inout | F | @@ -1069,12 +1069,6 @@ subroutine lsm_ruc_run & ! --- inpu smfrkeep(i,k) = smfrsoil(i,k,j) enddo - !do k = 1, lsoil - ! smc(i,k) = smsoil(i,k,j) - ! slc(i,k) = slsoil(i,k,j) - ! stc(i,k) = stsoil(i,k,j) - !enddo - ! --- ... do not return the following output fields to parent model ! ec - canopy water evaporation (m s-1) ! edir - direct soil evaporation (m s-1) @@ -1139,6 +1133,17 @@ subroutine lsm_ruc_run & ! --- inpu deallocate(soilctop) deallocate(landusef) ! + ! Update standard (Noah LSM) soil variables for physics + ! that require these variables (e.g. sfc_sice), independent + ! of whether it is a land point or not + do i = 1, im + do k = 1, lsoil + smc(i,k) = smois(i,k) + slc(i,k) = sh2o(i,k) + stc(i,k) = tslb(i,k) + enddo + enddo + return !................................... end subroutine lsm_ruc_run diff --git a/physics/sfc_nst.f b/physics/sfc_nst.f index a0e60f380..1e2eeb3e0 100644 --- a/physics/sfc_nst.f +++ b/physics/sfc_nst.f @@ -165,8 +165,8 @@ subroutine sfc_nst_run & ! ch - real, surface exchange coeff heat & moisture(m/s) im ! ! prsl1 - real, surface layer mean pressure (pa) im ! ! prslki - real, im ! -! wet - logical, =T if any ocn/lak water (F otherwise) im ! -! icy - logical, =T if "enough" ice (F otherwise) im ! +! wet - logical, =T if any ocn/lake water (F otherwise) im ! +! icy - logical, =T if any ice im ! ! xlon - real, longitude (radians) im ! ! sinlat - real, sin of latitude im ! ! stress - real, wind stress (n/m**2) im ! @@ -620,8 +620,8 @@ subroutine sfc_nst_run & & zsea1,zsea2,dtz) tsurf(i) = max(271.2, tref(i) + dtz ) - if (lprnt .and. i == ipr) print *,' tsurf=',tsurf(i),' tref=', - &tref(i),' xz=',xz(i),' dt_cool=',dt_cool(i) +! if (lprnt .and. i == ipr) print *,' tsurf=',tsurf(i),' tref=', +! &tref(i),' xz=',xz(i),' dt_cool=',dt_cool(i) !> - Call cal_w() to calculate \a w_0 and \a w_d. if ( xt(i) > 0.0 ) then @@ -667,9 +667,9 @@ subroutine sfc_nst_run & ! if ( nstf_name1 > 1 ) then tskin(i) = tsurf(i) - endif ! if ( nstf_name1 > 1 then - endif ! if(flag_guess(i)) then - endif ! if(wet(i) .and. .not.icy(i)) then + endif ! if nstf_name1 > 1 + endif ! if flag_guess(i) + endif ! if wet(i) .and. .not.icy(i) enddo ! if (lprnt .and. i == ipr) print *,' beg xz8=',xz(i) @@ -799,21 +799,6 @@ subroutine sfc_nst_pre_run errmsg = '' errflg = 0 - do i=1,im - if(icy(i)) then - zorl_ocn(i) = zorl_ice(i) - cd_ocn(i) = cd_ice(i) - cdq_ocn(i) = cdq_ice(i) - rb_ocn(i) = rb_ice(i) - stress_ocn(i) = stress_ice(i) - ffmm_ocn(i) = ffmm_ice(i) - ffhh_ocn(i) = ffhh_ice(i) - uustar_ocn(i) = uustar_ice(i) - fm10_ocn(i) = fm10_ice(i) - fh2_ocn(i) = fh2_ice(i) - endif - enddo - do i=1,im if (wet(i) .and. .not. icy(i)) then tem = (oro(i)-oro_uf(i)) * rlapse @@ -923,7 +908,7 @@ subroutine sfc_nst_post_run & do i = 1, im if (wet(i) .and. .not. icy(i)) then - tsurf_ocn(i) = tsurf_ocn(i) - (oro(i)-oro_uf(i)) * rlapse + tsurf_ocn(i) = tsurf_ocn(i) - (oro(i)-oro_uf(i)) * rlapse endif enddo @@ -938,7 +923,7 @@ subroutine sfc_nst_post_run & & im, 1, dtzm) do i = 1, im if ( wet(i) .and. .not. icy(i) ) then - tsfc_ocn(i) = max(271.2,tref(i) + dtzm(i)) - & + tsfc_ocn(i) = max(271.2,tref(i) + dtzm(i)) - & & (oro(i)-oro_uf(i))*rlapse endif enddo diff --git a/physics/sfc_ocean.F b/physics/sfc_ocean.F index a0a835555..e5cb95232 100644 --- a/physics/sfc_ocean.F +++ b/physics/sfc_ocean.F @@ -37,7 +37,6 @@ end subroutine sfc_ocean_finalize !! | prsl1 | air_pressure_at_lowest_model_layer | surface layer mean pressure | Pa | 1 | real | kind_phys | in | F | !! | prslki | ratio_of_exner_function_between_midlayer_and_interface_at_lowest_model_layer | Exner function ratio bt midlayer and interface at 1st layer | ratio | 1 | real | kind_phys | in | F | !! | wet | flag_nonzero_wet_surface_fraction | flag indicating presence of some ocean or lake surface area fraction | flag | 1 | logical | | in | F | -!! | fice | sea_ice_concentration | ice fraction over open water | frac | 1 | real | kind_phys | in | F | !! | ddvel | surface_wind_enhancement_due_to_convection | wind enhancement due to convection | m s-1 | 1 | real | kind_phys | in | F | !! | flag_iter | flag_for_iteration | flag for iteration | flag | 1 | logical | | in | F | !! | qsurf | surface_specific_humidity_over_ocean | surface air saturation specific humidity over ocean | kg kg-1 | 1 | real | kind_phys | inout | F | @@ -55,7 +54,7 @@ subroutine sfc_ocean_run & !................................... ! --- inputs: & ( im, cp, rd, eps, epsm1, hvap, rvrdm1, ps, u1, v1, t1, q1, & - & tskin, cm, ch, prsl1, prslki, wet, fice, ddvel, & + & tskin, cm, ch, prsl1, prslki, wet, ddvel, & & flag_iter, & ! --- outputs: & qsurf, cmm, chh, gflux, evap, hflx, ep, & @@ -70,7 +69,7 @@ subroutine sfc_ocean_run & ! call sfc_ocean ! ! inputs: ! ! ( im, ps, u1, v1, t1, q1, tskin, cm, ch, ! -! prsl1, prslki, wet, fice, ddvel, flag_iter, ! +! prsl1, prslki, wet, ddvel, flag_iter, ! ! outputs: ! ! qsurf, cmm, chh, gflux, evap, hflx, ep ) ! ! ! @@ -102,7 +101,6 @@ subroutine sfc_ocean_run & ! prsl1 - real, surface layer mean pressure im ! ! prslki - real, im ! ! wet - logical, =T if any ocean/lak, =F otherwise im ! -! fice - real, ice fraction im ! ! ddvel - real, wind enhancement due to convection (m/s) im ! ! flag_iter- logical, im ! ! ! @@ -128,7 +126,7 @@ subroutine sfc_ocean_run & & rvrdm1 real (kind=kind_phys), dimension(im), intent(in) :: ps, u1, v1, & - & t1, q1, tskin, cm, ch, prsl1, prslki, ddvel, fice + & t1, q1, tskin, cm, ch, prsl1, prslki, ddvel logical, dimension(im), intent(in) :: flag_iter, wet @@ -159,7 +157,7 @@ subroutine sfc_ocean_run & ! ! --- ... flag for open water do i = 1, im - flag(i) = (wet(i) .and. fice(i)<1. .and. flag_iter(i)) + flag(i) = (wet(i) .and. flag_iter(i)) ! --- ... initialize variables. all units are supposedly m.k.s. unless specified ! ps is in pascals, wind is wind speed, diff --git a/physics/sfc_sice.f b/physics/sfc_sice.f index 19b05f789..58f1c0549 100644 --- a/physics/sfc_sice.f +++ b/physics/sfc_sice.f @@ -1,82 +1,6 @@ !> \file sfc_sice.f !! This file contains the GFS three level thermodynamic sea ice model. -!> This module comtains the CCPP-compliant GFS sea ice post interstitial codes, which returns -!! updated ice thickness and concentration to global arrays -!! where there is no ice, and set temperature to surface skin temperature. - module sfc_sice_post - - contains - -!! \section arg_table_sfc_sice_post_init Argument Table -!! - subroutine sfc_sice_post_init - end subroutine sfc_sice_post_init - -!! \section arg_table_sfc_sice_post_finalize Argument Table -!! - subroutine sfc_sice_post_finalize - end subroutine sfc_sice_post_finalize - -!! \section arg_table_sfc_sice_post_run Argument Table -!! | local_name | standard_name | long_name | units | rank | type | kind | intent | optional | -!! |----------------|-------------------------------------------------------|---------------------------------------------------|-------|------|-----------|-----------|--------|----------| -!! | im | horizontal_loop_extent | horizontal loop extent | count | 0 | integer | | in | F | -!! | cplflx | flag_for_flux_coupling | flag controlling cplflx collection (default off) | flag | 0 | logical | | in | F | -!! | islmsk | sea_land_ice_mask | sea/land/ice mask (=0/1/2) | flag | 1 | integer | | in | F | -!! | tice | sea_ice_temperature_interstitial | sea-ice surface temperature use as interstitial | K | 1 | real | kind_phys | in | F | -!! | tsfc | surface_skin_temperature | surface skin temperature | K | 1 | real | kind_phys | in | F | -!! | fice | sea_ice_concentration | sea-ice concentration [0,1] | frac | 1 | real | kind_phys | inout | F | -!! | hice | sea_ice_thickness | sea-ice thickness | m | 1 | real | kind_phys | inout | F | -!! | tisfc | sea_ice_temperature | sea-ice surface temperature | K | 1 | real | kind_phys | inout | F | -!! | errmsg | ccpp_error_message | error message for error handling in CCPP | none | 0 | character | len=* | out | F | -!! | errflg | ccpp_error_flag | error flag for error handling in CCPP | flag | 0 | integer | | out | F | -!! - subroutine sfc_sice_post_run(im, cplflx, islmsk, tice, tsfc, & - & fice, hice, tisfc, errmsg, errflg) - - use machine, only : kind_phys - - implicit none - -! --- input - integer, intent(in) :: im - logical, intent(in) :: cplflx - integer, dimension(im), intent(in) :: islmsk - real(kind=kind_phys), dimension(im), intent(in) :: tice, tsfc - -! --- input/output - real(kind=kind_phys), dimension(im), intent(inout) :: fice, hice, & - & tisfc - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - -! --- locals - integer :: i - - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - -!--- return updated ice thickness & concentration to global arrays -! where there is no ice, set temperature to surface skin temperature. - if(.not. cplflx) then - do i = 1, im - if (islmsk(i) == 2) then - tisfc(i) = tice(i) - else - hice(i) = 0.0 - fice(i) = 0.0 - tisfc(i) = tsfc(i) - endif - enddo - endif - - end subroutine sfc_sice_post_run - - end module sfc_sice_post - !> This module contains the CCPP-compliant GFS sea ice scheme. module sfc_sice @@ -124,8 +48,6 @@ end subroutine sfc_sice_finalize !! | islimsk | sea_land_ice_mask | sea/land/ice mask (=0/1/2) | flag | 1 | integer | | in | F | !! | ddvel | surface_wind_enhancement_due_to_convection | wind enhancement due to convection | m s-1 | 1 | real | kind_phys | in | F | !! | flag_iter | flag_for_iteration | flag for iteration | flag | 1 | logical | | in | F | -!! | mom4ice | flag_for_mom4_coupling | flag for Mom4 coupling | flag | 0 | logical | | in | F | -!! | lsm | flag_for_land_surface_scheme | flag for land sfc scheme =0: osu; =1: noah | flag | 0 | integer | | in | F | !! | lprnt | flag_print | switch for printing sample column to stdout | flag | 0 | logical | | in | F | !! | ipr | horizontal_index_of_printed_column | horizontal index of printed column | index | 0 | integer | | in | F | !! | hice | sea_ice_thickness | sea-ice thickness | m | 1 | real | kind_phys | inout | F | @@ -174,7 +96,7 @@ subroutine sfc_sice_run & & t0c, rd, cimin, ps, u1, v1, t1, q1, delt, & & sfcemis, dlwflx, sfcnsw, sfcdsw, srflag, & & cm, ch, prsl1, prslki, islimsk, ddvel, & - & flag_iter, mom4ice, lsm, lprnt, ipr, & + & flag_iter, lprnt, ipr, & & hice, fice, tice, weasd, tskin, tprcp, stc, ep, & ! --- input/outputs: & snwdph, qsurf, snowmt, gflux, cmm, chh, evap, hflx, & ! --- outputs: & errmsg, errflg @@ -190,7 +112,7 @@ subroutine sfc_sice_run & ! ( im, km, ps, u1, v1, t1, q1, delt, ! ! sfcemis, dlwflx, sfcnsw, sfcdsw, srflag, ! ! cm, ch, prsl1, prslki, islimsk, ddvel, ! -! flag_iter, mom4ice, lsm, ! +! flag_iter, ! ! input/outputs: ! ! hice, fice, tice, weasd, tskin, tprcp, stc, ep, ! ! outputs: ! @@ -203,7 +125,8 @@ subroutine sfc_sice_run & !! two-layer ice model !!- 200x -- sarah lu added flag_iter !!- oct 2006 -- h. wei added cmm and chh to output -!!- 2007 -- x. wu modified for mom4 coupling (i.e. mom4ice) +!!- 2007 -- x. wu modified for mom4 coupling (i.e. cpldice) +!! (not used anymore) !!- 2007 -- s. moorthi micellaneous changes !!- may 2009 -- y.-t. hou modified to include surface emissivity !! effect on lw radiation. replaced the confusing @@ -236,9 +159,6 @@ subroutine sfc_sice_run & ! islimsk - integer, sea/land/ice mask (=0/1/2) im ! ! ddvel - real, im ! ! flag_iter- logical, im ! -! mom4ice - logical, im ! -! lsm - integer, flag for land surface model scheme 1 ! -! =0: use osu scheme; =1: use noah scheme ! ! ! ! input/outputs: ! ! hice - real, sea-ice thickness im ! @@ -268,16 +188,17 @@ subroutine sfc_sice_run & implicit none ! ! - Define constant parameters - integer, parameter :: kmi = 2 !< 2-layer of ice - real(kind=kind_phys), parameter :: himax = 8.0 !< maximum ice thickness allowed - real(kind=kind_phys), parameter :: himin = 0.1 !< minimum ice thickness required - real(kind=kind_phys), parameter :: hsmax = 2.0 !< maximum snow depth allowed - real(kind=kind_phys), parameter :: timin = 173.0 !< minimum temperature allowed for snow/ice - real(kind=kind_phys), parameter :: albfw = 0.06 !< albedo for lead - real(kind=kind_phys), parameter :: dsi = 1.0/0.33 + integer, parameter :: kmi = 2 !< 2-layer of ice + real(kind=kind_phys), parameter :: zero = 0.0d0, one = 1.0d0 + real(kind=kind_phys), parameter :: himax = 8.0d0 !< maximum ice thickness allowed + real(kind=kind_phys), parameter :: himin = 0.1d0 !< minimum ice thickness required + real(kind=kind_phys), parameter :: hsmax = 2.0d0 !< maximum snow depth allowed + real(kind=kind_phys), parameter :: timin = 173.0d0 !< minimum temperature allowed for snow/ice + real(kind=kind_phys), parameter :: albfw = 0.06d0 !< albedo for lead + real(kind=kind_phys), parameter :: dsi = one/0.33d0 ! --- inputs: - integer, intent(in) :: im, km, lsm, ipr + integer, intent(in) :: im, km, ipr logical, intent(in) :: lprnt real (kind=kind_phys), intent(in) :: sbc, hvap, tgice, cp, eps, & @@ -291,7 +212,6 @@ subroutine sfc_sice_run & real (kind=kind_phys), intent(in) :: delt logical, dimension(im), intent(in) :: flag_iter - logical, intent(in) :: mom4ice ! --- input/outputs: real (kind=kind_phys), dimension(im), intent(inout) :: hice, & @@ -310,7 +230,7 @@ subroutine sfc_sice_run & real (kind=kind_phys), dimension(im) :: ffw, evapi, evapw, & & sneti, snetw, hfd, hfi, & ! & hflxi, hflxw, sneti, snetw, qssi, qssw, hfd, hfi, hfw, & - & focn, snof, hi_save, hs_save, rch, rho, & + & focn, snof, rch, rho, & & snowd, theta1 real (kind=kind_phys) :: t12, t14, tem, stsice(im,kmi) @@ -323,8 +243,8 @@ subroutine sfc_sice_run & ! !===> ... begin here ! - cpinv = 1.0/cp - hvapi = 1.0/hvap + cpinv = one/cp + hvapi = one/hvap elocp = hvap/cp ! Initialize CCPP error handling variables @@ -336,11 +256,20 @@ subroutine sfc_sice_run & do i = 1, im flag(i) = (islimsk(i) == 2) .and. flag_iter(i) if (flag_iter(i) .and. islimsk(i) < 2) then - hice(i) = 0.0 - fice(i) = 0.0 + hice(i) = zero + fice(i) = zero + endif + enddo +! + do i = 1, im + if (flag(i)) then + if (srflag(i) > zero) then + ep(i) = ep(i)*(one-srflag(i)) + weasd(i) = weasd(i) + 1.e3*tprcp(i)*srflag(i) + tprcp(i) = tprcp(i)*(one-srflag(i)) + endif endif enddo - !> - Update/read sea ice temperature from soil temperature and initialize variables. do k = 1, kmi @@ -350,25 +279,6 @@ subroutine sfc_sice_run & endif enddo enddo -! - if (mom4ice) then - do i = 1, im - if (flag(i)) then ! sea ice - hi_save(i) = hice(i) - hs_save(i) = weasd(i) * 0.001 - endif - enddo - elseif (lsm > 0) then ! --- ... snow-rain detection - do i = 1, im - if (flag(i)) then - if (srflag(i) > 0) then - ep(i) = ep(i)*(1.-srflag(i)) - weasd(i) = weasd(i) + 1.e3*tprcp(i)*srflag(i) - tprcp(i) = tprcp(i)*(1.-srflag(i)) - endif - endif - enddo - endif ! --- ... initialize variables. all units are supposedly m.k.s. unless specifie ! psurf is in pascals, wind is wind speed, theta1 is adiabatic surface @@ -385,25 +295,24 @@ subroutine sfc_sice_run & ! sfcnsw is the net shortwave flux (direction: dn-up) wind = max(sqrt(u1(i)*u1(i) + v1(i)*v1(i)) & - & + max(0.0, min(ddvel(i), 30.0)), 1.0) + & + max(zero, min(ddvel(i), 30.0d0)), one) q0 = max(q1(i), 1.0e-8) ! tsurf(i) = tskin(i) theta1(i) = t1(i) * prslki(i) - rho(i) = prsl1(i) / (rd*t1(i)*(1.0+rvrdm1*q0)) + rho(i) = prsl1(i) / (rd*t1(i)*(one+rvrdm1*q0)) qs1 = fpvs(t1(i)) qs1 = max(eps*qs1 / (prsl1(i) + epsm1*qs1), 1.e-8) q0 = min(qs1, q0) - ffw(i) = 1.0 - fice(i) if (fice(i) < cimin) then print *,'warning: ice fraction is low:', fice(i) fice(i) = cimin - ffw (i) = 1.0 - fice(i) tice(i) = tgice tskin(i)= tgice print *,'fix ice fraction: reset it to:', fice(i) endif + ffw(i) = 1.0 - fice(i) qssi = fpvs(tice(i)) qssi = eps*qssi / (ps(i) + epsm1*qssi) @@ -412,11 +321,7 @@ subroutine sfc_sice_run & !> - Convert snow depth in water equivalent from mm to m unit. - if (mom4ice) then - snowd(i) = weasd(i) * 0.001 / fice(i) - else - snowd(i) = weasd(i) * 0.001 - endif + snowd(i) = weasd(i) * 0.001d0 ! flagsnw(i) = .false. ! --- ... when snow depth is less than 1 mm, a patchy snow is assumed and @@ -436,10 +341,8 @@ subroutine sfc_sice_run & evapw(i) = elocp * rch(i) * (qssw - q0) ! evap(i) = fice(i)*evapi(i) + ffw(i)*evapw(i) -! if (lprnt) write(0,*)' tice=',tice(ipr) - - snetw(i) = sfcdsw(i) * (1.0 - albfw) - snetw(i) = min(3.0*sfcnsw(i)/(1.0+2.0*ffw(i)), snetw(i)) + snetw(i) = sfcdsw(i) * (one - albfw) + snetw(i) = min(3.0*sfcnsw(i)/(one+2.0d0*ffw(i)), snetw(i)) !> - Calculate net solar incoming at top \a sneti. sneti(i) = (sfcnsw(i) - ffw(i)*snetw(i)) / fice(i) @@ -451,8 +354,8 @@ subroutine sfc_sice_run & hfi(i) = -dlwflx(i) + sfcemis(i)*sbc*t14 + evapi(i) & & + rch(i)*(tice(i) - theta1(i)) !> - Calculate heat flux derivative at surface \a hfd. - hfd(i) = 4.0*sfcemis(i)*sbc*tice(i)*t12 & - & + (1.0 + elocp*eps*hvap*qs1/(rd*t12)) * rch(i) + hfd(i) = 4.0d0*sfcemis(i)*sbc*tice(i)*t12 & + & + (one + elocp*eps*hvap*qs1/(rd*t12)) * rch(i) t12 = tgice * tgice t14 = t12 * t12 @@ -464,14 +367,14 @@ subroutine sfc_sice_run & !> - Assigin heat flux from ocean \a focn and snowfall rate as constants, which !! should be from ocean model and other physics. - focn(i) = 2.0 ! heat flux from ocean - should be from ocn model - snof(i) = 0.0 ! snowfall rate - snow accumulates in gbphys + focn(i) = 2.0d0 ! heat flux from ocean - should be from ocn model + snof(i) = zero ! snowfall rate - snow accumulates in gbphys !> - Initialize snow depth \a snowd. hice(i) = max( min( hice(i), himax ), himin ) snowd(i) = min( snowd(i), hsmax ) - if (snowd(i) > (2.0*hice(i))) then + if (snowd(i) > (2.0d0*hice(i))) then print *, 'warning: too much snow :',snowd(i) snowd(i) = hice(i) + hice(i) print *,'fix: decrease snow depth to:',snowd(i) @@ -480,23 +383,13 @@ subroutine sfc_sice_run & enddo !> - Call the three-layer thermodynamics sea ice model ice3lay(). -! if (lprnt) write(0,*)' tice2=',tice(ipr) call ice3lay ! --- inputs: ! & ( im, kmi, fice, flag, hfi, hfd, sneti, focn, delt, ! + & lprnt, ipr, ! --- outputs: ! & snowd, hice, stsice, tice, snof, snowmt, gflux ) ! -! if (lprnt) write(0,*)' tice3=',tice(ipr) - if (mom4ice) then - do i = 1, im - if (flag(i)) then - hice(i) = hi_save(i) - snowd(i) = hs_save(i) - endif - enddo - endif - do i = 1, im if (flag(i)) then if (tice(i) < timin) then @@ -589,6 +482,7 @@ subroutine ice3lay !................................... ! --- inputs: & ( im, kmi, fice, flag, hfi, hfd, sneti, focn, delt, & + & lprnt, ipr, ! --- input/outputs: & snowd, hice, stsice, tice, snof, & ! --- outputs: @@ -648,31 +542,32 @@ subroutine ice3lay ! ! --- constant parameters: (properties of ice, snow, and seawater) - real (kind=kind_phys), parameter :: ds = 330.0 !< snow (ov sea ice) density (kg/m^3) - real (kind=kind_phys), parameter :: dw =1000.0 !< fresh water density (kg/m^3) + real (kind=kind_phys), parameter :: ds = 330.0d0 !< snow (ov sea ice) density (kg/m^3) + real (kind=kind_phys), parameter :: dw =1000.0d0 !< fresh water density (kg/m^3) real (kind=kind_phys), parameter :: dsdw = ds/dw real (kind=kind_phys), parameter :: dwds = dw/ds - real (kind=kind_phys), parameter :: t0c =273.15 !< freezing temp of fresh ice (k) - real (kind=kind_phys), parameter :: ks = 0.31 !< conductivity of snow (w/mk) - real (kind=kind_phys), parameter :: i0 = 0.3 !< ice surface penetrating solar fraction - real (kind=kind_phys), parameter :: ki = 2.03 !< conductivity of ice (w/mk) - real (kind=kind_phys), parameter :: di = 917.0 !< density of ice (kg/m^3) + real (kind=kind_phys), parameter :: ks = 0.31d0 !< conductivity of snow (w/mk) + real (kind=kind_phys), parameter :: i0 = 0.3d0 !< ice surface penetrating solar fraction + real (kind=kind_phys), parameter :: ki = 2.03d0 !< conductivity of ice (w/mk) + real (kind=kind_phys), parameter :: di = 917.0d0 !< density of ice (kg/m^3) real (kind=kind_phys), parameter :: didw = di/dw real (kind=kind_phys), parameter :: dsdi = ds/di - real (kind=kind_phys), parameter :: ci = 2054.0 !< heat capacity of fresh ice (j/kg/k) - real (kind=kind_phys), parameter :: li = 3.34e5 !< latent heat of fusion (j/kg-ice) - real (kind=kind_phys), parameter :: si = 1.0 !< salinity of sea ice - real (kind=kind_phys), parameter :: mu = 0.054 !< relates freezing temp to salinity - real (kind=kind_phys), parameter :: tfi = -mu*si !< sea ice freezing temp = -mu*salinity - real (kind=kind_phys), parameter :: tfw = -1.8 !< tfw - seawater freezing temp (c) - real (kind=kind_phys), parameter :: tfi0 = tfi-0.0001 + real (kind=kind_phys), parameter :: ci = 2054.0d0 !< heat capacity of fresh ice (j/kg/k) + real (kind=kind_phys), parameter :: li = 3.34e5 !< latent heat of fusion (j/kg-ice) + real (kind=kind_phys), parameter :: si = 1.0d0 !< salinity of sea ice + real (kind=kind_phys), parameter :: mu = 0.054d0 !< relates freezing temp to salinity + real (kind=kind_phys), parameter :: tfi = -mu*si !< sea ice freezing temp = -mu*salinity + real (kind=kind_phys), parameter :: tfw = -1.8d0 !< tfw - seawater freezing temp (c) + real (kind=kind_phys), parameter :: tfi0 = tfi-0.0001d0 real (kind=kind_phys), parameter :: dici = di*ci real (kind=kind_phys), parameter :: dili = di*li real (kind=kind_phys), parameter :: dsli = ds*li - real (kind=kind_phys), parameter :: ki4 = ki*4.0 + real (kind=kind_phys), parameter :: ki4 = ki*4.0d0 + real (kind=kind_phys), parameter :: zero = 0.0d0, one = 1.0d0 ! --- inputs: - integer, intent(in) :: im, kmi + integer, intent(in) :: im, kmi, ipr + logical :: lprnt real (kind=kind_phys), dimension(im), intent(in) :: fice, hfi, & & hfd, sneti, focn @@ -701,10 +596,10 @@ subroutine ice3lay ! !===> ... begin here ! - dt2 = 2.0 * delt - dt4 = 4.0 * delt - dt6 = 6.0 * delt - dt2i = 1.0 / dt2 + dt2 = 2.0d0 * delt + dt4 = 4.0d0 * delt + dt6 = 6.0d0 * delt + dt2i = one / dt2 do i = 1, im if (flag(i)) then @@ -723,9 +618,9 @@ subroutine ice3lay stsice(i,2) = min(stsice(i,2)-t0c, tfi0) ! degc ip = i0 * sneti(i) ! ip +v (in winton ip=-i0*sneti as sol -v) - if (snowd(i) > 0.0) then - tsf = 0.0 - ip = 0.0 + if (snowd(i) > zero) then + tsf = zero + ip = zero else tsf = tfi ip = i0 * sneti(i) ! ip +v here (in winton ip=-i0*sneti) @@ -745,7 +640,7 @@ subroutine ice3lay !! points (see \a eq.(10) in Winton (2000) \cite winton_2000). k32 = (ki+ki) / hice(i) - wrk = 1.0 / (dt6*k32 + dici*hice(i)) + wrk = one / (dt6*k32 + dici*hice(i)) a10 = dici*hice(i)*dt2i + k32*(dt4*k32 + dici*hice(i))*wrk b10 = -di*hice(i) * (ci*stsice(i,1) + li*tfi/stsice(i,1)) & & * dt2i - ip & @@ -758,7 +653,7 @@ subroutine ice3lay !> - Calculate the new upper ice temperature following \a eq.(21) !! in Winton (2000) \cite winton_2000. - stsice(i,1) = -(sqrt(b1*b1 - 4.0*a1*c1) + b1)/(a1+a1) + stsice(i,1) = -(sqrt(b1*b1 - 4.0d0*a1*c1) + b1)/(a1+a1) tice(i) = (k12*stsice(i,1) - ai) / (k12 + bi) !> - If the surface temperature is greater than the freezing temperature @@ -771,11 +666,11 @@ subroutine ice3lay if (tice(i) > tsf) then a1 = a10 + k12 b1 = b10 - k12*tsf - stsice(i,1) = -(sqrt(b1*b1 - 4.0*a1*c1) + b1)/(a1+a1) + stsice(i,1) = -(sqrt(b1*b1 - 4.0d0*a1*c1) + b1)/(a1+a1) tice(i) = tsf tmelt = (k12*(stsice(i,1)-tsf) - (ai+bi*tsf)) * delt else - tmelt = 0.0 + tmelt =zero snowd(i) = snowd(i) + snof(i)*delt endif !> - Calculate the new lower ice temperature following \a eq.(15) @@ -791,8 +686,8 @@ subroutine ice3lay !> - Calculation of ice and snow mass changes. - h1 = 0.5 * hice(i) - h2 = 0.5 * hice(i) + h1 = 0.5d0 * hice(i) + h2 = 0.5d0 * hice(i) !> - Calculate the top layer thickness. @@ -803,14 +698,14 @@ subroutine ice3lay snowmt(i) = snowd(i) h1 = h1 - (tmelt - snowd(i)*dsli) & & / (di * (ci - li/stsice(i,1)) * (tfi - stsice(i,1))) - snowd(i) = 0.0 + snowd(i) = zero endif ! --- ... and bottom !> - When the energy for bottem melting \f$M_b\f$ is negative (i.e., freezing !! is happening),calculate the bottom layer thickness \f$h_2\f$ and the new !! lower layer temperature (see \a eqs.(24)-(26)). - if (bmelt < 0.0) then + if (bmelt < zero) then dh = -bmelt / (dili + dici*(tfi - tfw)) stsice(i,2) = (h2*stsice(i,2) + dh*tfw) / (h2 + dh) h2 = h2 + dh @@ -823,11 +718,11 @@ subroutine ice3lay hice(i) = h1 + h2 - if (hice(i) > 0.0) then - if (h1 > 0.5*hice(i)) then - f1 = 1.0 - (h2+h2) / hice(i) + if (hice(i) > zero) then + if (h1 > 0.5d0*hice(i)) then + f1 = one - (h2+h2) / hice(i) stsice(i,2) = f1 * (stsice(i,1) + li*tfi/(ci*stsice(i,1)))& - & + (1.0 - f1)*stsice(i,2) + & + (one - f1)*stsice(i,2) if (stsice(i,2) > tfi) then hice(i) = hice(i) - h2*ci*(stsice(i,2) - tfi)/ (li*delt) @@ -836,23 +731,23 @@ subroutine ice3lay else f1 = (h1+h1) / hice(i) stsice(i,1) = f1 * (stsice(i,1) + li*tfi/(ci*stsice(i,1)))& - & + (1.0 - f1)*stsice(i,2) + & + (one - f1)*stsice(i,2) stsice(i,1) = (stsice(i,1) - sqrt(stsice(i,1)*stsice(i,1) & - & - 4.0*tfi*li/ci)) * 0.5 + & - 4.0d0*tfi*li/ci)) * 0.5d0 endif k12 = ki4*ks / (ks*hice(i) + ki4*snowd(i)) gflux(i) = k12 * (stsice(i,1) - tice(i)) else snowd(i) = snowd(i) + (h1*(ci*(stsice(i,1) - tfi) & - & - li*(1.0 - tfi/stsice(i,1))) & + & - li*(one - tfi/stsice(i,1))) & & + h2*(ci*(stsice(i,2) - tfi) - li)) / li - hice(i) = max(0.0, snowd(i)*dsdi) - snowd(i) = 0.0 + hice(i) = max(zero, snowd(i)*dsdi) + snowd(i) = zero stsice(i,1) = tfw stsice(i,2) = tfw - gflux(i) = 0.0 + gflux(i) = zero endif ! end if_hice_block gflux(i) = fice(i) * gflux(i) diff --git a/physics/sflx.f b/physics/sflx.f index 926115f13..102d25fcd 100644 --- a/physics/sflx.f +++ b/physics/sflx.f @@ -345,10 +345,9 @@ subroutine gfssflx &! --- input ! ! --- parameters for heat storage parametrization ! - real (kind=kind_phys) :: cpx, cpx1, cpfac, xx1, xx2, xx3 - real (kind=kind_phys), parameter :: z0min=0.2 - real (kind=kind_phys), parameter :: z0max=1.0 - + real (kind=kind_phys) :: cpx, cpx1, cpfac, xx1, xx2 + real (kind=kind_phys), parameter :: z0min=0.2_kind_phys, & + & z0max=1.0_kind_phys ! !===> ... begin here ! @@ -802,19 +801,18 @@ subroutine gfssflx &! --- input ! ! --- enhance cp as a function of z0 to mimic heat storage ! - cpx = cp - cpx1 = cp1 - cpfac = 1. - if(lheatstrg) then - if((ivegsrc == 1 .and. vegtyp /= 13) - & .or. ivegsrc == 2) then - xx1 = (z0 - z0min) / (z0max - z0min) - xx2 = min(max(xx1, 0.), 1.) - xx3 = 1. + xx2 - cpx = cp * xx3 - cpx1 = cp1 * xx3 - cpfac = cp / cpx - endif + cpx = cp + cpx1 = cp1 + cpfac = 1.0 + if (lheatstrg) then + if ((ivegsrc == 1 .and. vegtyp /= 13) + & .or. ivegsrc == 2) then + xx1 = (z0 - z0min) / (z0max - z0min) + xx2 = 1.0 + min(max(xx1, 0.0), 1.0) + cpx = cp * xx2 + cpx1 = cp1 * xx2 + cpfac = cp / cpx + endif endif !> - Call penman() to calculate potential evaporation (\a etp), @@ -2724,7 +2722,7 @@ subroutine snopac ! --- ... before call shflx in this snowpack case, set zz1 and yy arguments to ! special values that ensure that ground heat flux calculated in shflx -! matches that already computer for below the snowpack, thus the sfc +! matches that already computed for below the snowpack, thus the sfc ! heat flux to be computed in shflx will effectively be the flux at the ! snow top surface. t11 is a dummy arguement so we will not use the ! skin temp value as revised by shflx.