From 760be1f6f0e6e261340fae3a1453f0cb9272bf31 Mon Sep 17 00:00:00 2001 From: XiaSun-NOAA Date: Fri, 4 Dec 2020 19:13:19 +0000 Subject: [PATCH 01/21] move constant rainmin for gfdl cloud microphys to argument list --- physics/gfdl_cloud_microphys.F90 | 4 ++-- physics/gfdl_cloud_microphys.meta | 9 +++++++++ physics/physcons.F90 | 3 ++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/physics/gfdl_cloud_microphys.F90 b/physics/gfdl_cloud_microphys.F90 index 1ccedb956..fc9471f43 100644 --- a/physics/gfdl_cloud_microphys.F90 +++ b/physics/gfdl_cloud_microphys.F90 @@ -113,7 +113,7 @@ end subroutine gfdl_cloud_microphys_finalize !! \htmlinclude gfdl_cloud_microphys_run.html !! subroutine gfdl_cloud_microphys_run( & - levs, im, con_g, con_fvirt, con_rd, frland, garea, islmsk, & + levs, im, rainmin,con_g, con_fvirt, con_rd, frland, garea, islmsk, & gq0, gq0_ntcw, gq0_ntrw, gq0_ntiw, gq0_ntsw, gq0_ntgl, gq0_ntclamt, & gt0, gu0, gv0, vvl, prsl, phii, del, & rain0, ice0, snow0, graupel0, prcp0, sr, & @@ -129,7 +129,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 - real(kind=kind_phys), parameter :: rainmin = 1.0d-13 + !real(kind=kind_phys), parameter :: rainmin = 1.0d-13 ! *DH ! interface variables diff --git a/physics/gfdl_cloud_microphys.meta b/physics/gfdl_cloud_microphys.meta index 07847ed17..1e3232ec1 100644 --- a/physics/gfdl_cloud_microphys.meta +++ b/physics/gfdl_cloud_microphys.meta @@ -141,6 +141,15 @@ type = integer intent = in optional = F +[rainmin] + standard_name = lwe_thickness_of_minimum_rain_amount + long_name = minimum rain amount + units = m + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F [con_g] standard_name = gravitational_acceleration long_name = gravitational acceleration diff --git a/physics/physcons.F90 b/physics/physcons.F90 index 397fee935..7e548ab75 100644 --- a/physics/physcons.F90 +++ b/physics/physcons.F90 @@ -121,7 +121,8 @@ module physcons !> minimum aerosol concentration real(kind=kind_phys),parameter:: qamin = 1.e-16_kind_phys - +!> minimum rain amount + real(kind=kind_phys),parameter:: rainmin = 1.e-13_kind_phys !> \name Miscellaneous physics related constants (For WSM6; Moorthi - Jul 2014) ! integer, parameter :: max_lon=16000, max_lat=8000, min_lon=192, min_lat=94 ! integer, parameter :: max_lon=5000, max_lat=2500, min_lon=192, min_lat=94 ! current opr From 6500702a33793e53263a84d2103bb626552ace88 Mon Sep 17 00:00:00 2001 From: XiaSun-NOAA Date: Fri, 4 Dec 2020 22:40:33 +0000 Subject: [PATCH 02/21] move constant of rainmax from other two schemes --- physics/GFS_MP_generic.F90 | 5 ++--- physics/GFS_MP_generic.meta | 9 +++++++++ physics/gfdl_cloud_microphys.F90 | 4 ++-- physics/m_micro.F90 | 7 ++++--- physics/m_micro.meta | 9 +++++++++ 5 files changed, 26 insertions(+), 8 deletions(-) diff --git a/physics/GFS_MP_generic.F90 b/physics/GFS_MP_generic.F90 index 435a80509..af5a4d178 100644 --- a/physics/GFS_MP_generic.F90 +++ b/physics/GFS_MP_generic.F90 @@ -85,7 +85,7 @@ end subroutine GFS_MP_generic_post_init !> \section gfs_mp_gen GFS MP Generic Post General Algorithm !> @{ subroutine GFS_MP_generic_post_run(im, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac, imp_physics, imp_physics_gfdl, & - imp_physics_thompson, imp_physics_mg, imp_physics_fer_hires, cal_pre, lssav, ldiag3d, qdiag3d, cplflx, cplchm, con_g, dtf, frain, rainc, rain1, & + imp_physics_thompson, imp_physics_mg, imp_physics_fer_hires, cal_pre, lssav, ldiag3d, qdiag3d, cplflx, cplchm, con_g, rainmin, 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, & @@ -100,7 +100,7 @@ subroutine GFS_MP_generic_post_run(im, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac, integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_mg, imp_physics_fer_hires logical, intent(in) :: cal_pre, lssav, ldiag3d, qdiag3d, cplflx, cplchm - real(kind=kind_phys), intent(in) :: dtf, frain, con_g + real(kind=kind_phys), intent(in) :: dtf, frain, con_g, rainmin real(kind=kind_phys), dimension(im), intent(in) :: rain1, xlat, xlon, tsfc real(kind=kind_phys), dimension(im), intent(inout) :: ice, snow, graupel, rainc real(kind=kind_phys), dimension(im), intent(in) :: rain0, ice0, snow0, graupel0 @@ -147,7 +147,6 @@ subroutine GFS_MP_generic_post_run(im, levs, kdt, nrcm, ncld, nncl, ntcw, ntrac, ! DH* TODO: CLEANUP, all of these should be coming in through the argument list real(kind=kind_phys), parameter :: con_p001= 0.001_kind_phys real(kind=kind_phys), parameter :: con_day = 86400.0_kind_phys - real(kind=kind_phys), parameter :: rainmin = 1.0e-13_kind_phys real(kind=kind_phys), parameter :: p850 = 85000.0_kind_phys ! *DH diff --git a/physics/GFS_MP_generic.meta b/physics/GFS_MP_generic.meta index 981f5478d..2ddbdee55 100644 --- a/physics/GFS_MP_generic.meta +++ b/physics/GFS_MP_generic.meta @@ -168,6 +168,15 @@ type = integer intent = in optional = F +[rainmin] + standard_name = lwe_thickness_of_minimum_rain_amount + long_name = minimum rain amount + units = m + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F [nrcm] standard_name = array_dimension_of_random_number long_name = second dimension of random number stream for RAS diff --git a/physics/gfdl_cloud_microphys.F90 b/physics/gfdl_cloud_microphys.F90 index fc9471f43..d0e0cc17d 100644 --- a/physics/gfdl_cloud_microphys.F90 +++ b/physics/gfdl_cloud_microphys.F90 @@ -113,7 +113,7 @@ end subroutine gfdl_cloud_microphys_finalize !! \htmlinclude gfdl_cloud_microphys_run.html !! subroutine gfdl_cloud_microphys_run( & - levs, im, rainmin,con_g, con_fvirt, con_rd, frland, garea, islmsk, & + levs, im, rainmin, con_g, con_fvirt, con_rd, frland, garea, islmsk, & gq0, gq0_ntcw, gq0_ntrw, gq0_ntiw, gq0_ntsw, gq0_ntgl, gq0_ntclamt, & gt0, gu0, gv0, vvl, prsl, phii, del, & rain0, ice0, snow0, graupel0, prcp0, sr, & @@ -134,7 +134,7 @@ subroutine gfdl_cloud_microphys_run( & ! interface variables integer, intent(in ) :: levs, im - real(kind=kind_phys), intent(in ) :: con_g, con_fvirt, con_rd + real(kind=kind_phys), intent(in ) :: con_g, con_fvirt, con_rd, rainmin real(kind=kind_phys), intent(in ), dimension(1:im) :: frland, garea integer, intent(in ), dimension(1:im) :: islmsk real(kind=kind_phys), intent(inout), dimension(1:im,1:levs) :: gq0, gq0_ntcw, gq0_ntrw, gq0_ntiw, & diff --git a/physics/m_micro.F90 b/physics/m_micro.F90 index 77b51ed62..cb666379e 100644 --- a/physics/m_micro.F90 +++ b/physics/m_micro.F90 @@ -119,7 +119,7 @@ subroutine m_micro_run( im, lm, flipv, dt_i & &, qi_o, t_io, rn_o, sr_o & &, ncpl_io, ncpi_io, fprcp, rnw_io, snw_io& &, qgl_io, ncpr_io, ncps_io, ncgl_io & - &, CLLS_io, KCBL & + &, CLLS_io, KCBL, rainmin & &, CLDREFFL, CLDREFFI, CLDREFFR, CLDREFFS & &, CLDREFFG, aerfld_i & &, naai_i, npccn_i, iccn & @@ -129,7 +129,7 @@ subroutine m_micro_run( im, lm, flipv, dt_i & & errmsg, errflg) use machine , only: kind_phys - use physcons, grav => con_g, pi => con_pi, & + use physcons, only: grav => con_g, pi => con_pi, & & rgas => con_rd, cp => con_cp, & & hvap => con_hvap, hfus => con_hfus, & & ttp => con_ttp, tice => con_t0c, & @@ -164,11 +164,12 @@ subroutine m_micro_run( im, lm, flipv, dt_i & ! input ! real, parameter :: r_air = 3.47d-3 integer, parameter :: kp = kind_phys + real(kind=kind_phys), intent(in ) :: rainmin real, parameter :: one=1.0_kp, oneb3=one/3.0_kp, onebcp=one/cp, & zero=0.0_kp, half=0.5_kp, onebg=one/grav, & & kapa=rgas*onebcp, cpbg=cp/grav, & & lvbcp=hvap*onebcp, lsbcp=(hvap+hfus)*onebcp, & - & qsmall=1.0e-14_kp, rainmin = 1.0e-13_kp, & + & qsmall=1.0e-14_kp, & & fourb3=4.0_kp/3.0_kp, RL_cub=1.0e-15_kp, & & nmin=1.0_kp diff --git a/physics/m_micro.meta b/physics/m_micro.meta index 37437fc73..4aa6989b0 100644 --- a/physics/m_micro.meta +++ b/physics/m_micro.meta @@ -318,6 +318,15 @@ type = integer intent = in optional = F +[rainmin] + standard_name = lwe_thickness_of_minimum_rain_amount + long_name = minimum rain amount + units = m + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F [flipv] standard_name = flag_flip long_name = vertical flip logical From 94e179fea331fe9fe6cc2a0ba9ba44f84eb39cb1 Mon Sep 17 00:00:00 2001 From: XiaSun-NOAA Date: Mon, 7 Dec 2020 17:29:49 +0000 Subject: [PATCH 03/21] clean up von karman (karman=0.4); add karman to physcon --- physics/gfdl_sfc_layer.F90 | 4 ++-- physics/gfdl_sfc_layer.meta | 8 ++++++++ physics/physcons.F90 | 1 + physics/shinhongvdif.F90 | 4 ++-- physics/shinhongvdif.meta | 8 ++++++++ physics/ysuvdif.F90 | 6 +++--- physics/ysuvdif.meta | 8 ++++++++ 7 files changed, 32 insertions(+), 7 deletions(-) diff --git a/physics/gfdl_sfc_layer.F90 b/physics/gfdl_sfc_layer.F90 index 93e38c982..cd0d1d8f0 100644 --- a/physics/gfdl_sfc_layer.F90 +++ b/physics/gfdl_sfc_layer.F90 @@ -100,7 +100,7 @@ end subroutine gfdl_sfc_layer_finalize !! \htmlinclude gfdl_sfc_layer_run.html !! subroutine gfdl_sfc_layer_run (im, nsoil, km, xlat, xlon, flag_iter, lsm, & - lsm_noah, lsm_noahmp, lsm_ruc, lsm_noah_wrfv4, icoef_sf, cplwav, & + lsm_noah, lsm_noahmp, lsm_ruc, lsm_noah_wrfv4, icoef_sf, cplwav, karman,& cplwav2atm, lcurr_sf, pert_Cd, ntsflg, sfenth, z1, shdmax, ivegsrc, & vegtype, sigmaf, dt, wet, dry, icy, isltyp, rd, grav, ep1, ep2, smois, & psfc, prsl1, q1, t1, u1, v1, wspd, u10, v10, gsw, glw, tsurf_ocn, & @@ -157,7 +157,7 @@ subroutine gfdl_sfc_layer_run (im, nsoil, km, xlat, xlon, flag_iter, lsm, & logical :: ch_bound_excursion !GJF: the vonKarman constant should come in through the CCPP and be defined by the host model - real (kind=kind_phys), parameter :: karman = 0.4 + real (kind=kind_phys), intent(in) :: karman real (kind=kind_phys), parameter :: log01=log(0.01), log05=log(0.05), & log07=log(0.07) diff --git a/physics/gfdl_sfc_layer.meta b/physics/gfdl_sfc_layer.meta index 77024c813..4b90f48bd 100644 --- a/physics/gfdl_sfc_layer.meta +++ b/physics/gfdl_sfc_layer.meta @@ -101,6 +101,14 @@ type = integer intent = in optional = F +[karman] + standard_name = von_karman_constant + long_name = von karman constant + units = none + dimensions = () + type = real + intent = in + optional = F [xlat] standard_name = latitude long_name = latitude diff --git a/physics/physcons.F90 b/physics/physcons.F90 index 7e548ab75..41d37491a 100644 --- a/physics/physcons.F90 +++ b/physics/physcons.F90 @@ -115,6 +115,7 @@ module physcons 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:: karman =0.4_kind_phys !< Von Karman constant !> minimum ice concentration real(kind=kind_phys),parameter:: cimin =0.15 !< minimum ice concentration diff --git a/physics/shinhongvdif.F90 b/physics/shinhongvdif.F90 index 4032f1828..d35c74d47 100644 --- a/physics/shinhongvdif.F90 +++ b/physics/shinhongvdif.F90 @@ -25,7 +25,7 @@ end subroutine shinhongvdif_finalize !! \htmlinclude shinhongvdif_run.html !! !------------------------------------------------------------------------------- - subroutine shinhongvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & + subroutine shinhongvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d,karman, & utnp,vtnp,ttnp,qtnp,ntrac,ndiff,ntcw,ntiw, & phii,phil,psfcpa, & zorl,stress,hpbl,psim,psih, & @@ -87,7 +87,7 @@ subroutine shinhongvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & real(kind=kind_phys),parameter :: tmin=1.e-2 real(kind=kind_phys),parameter :: gamcrt = 3.,gamcrq = 2.e-3 real(kind=kind_phys),parameter :: xka = 2.4e-5 - real(kind=kind_phys),parameter :: karman = 0.4 + real(kind=kind_phys),intent(in) :: karman real(kind=kind_phys),parameter :: corf=0.000073 real(kind=kind_phys),parameter :: rcl = 1.0 integer,parameter :: imvdif = 1 diff --git a/physics/shinhongvdif.meta b/physics/shinhongvdif.meta index 8c850ff37..20e668cfb 100644 --- a/physics/shinhongvdif.meta +++ b/physics/shinhongvdif.meta @@ -86,6 +86,14 @@ kind = kind_phys intent = in optional = F +[karman] + standard_name = von_karman_constant + long_name = von karman constant + units = none + dimensions = () + type = real + intent = in + optional = F [vtnp] standard_name = tendency_of_y_wind_due_to_model_physics long_name = updated tendency of the y wind diff --git a/physics/ysuvdif.F90 b/physics/ysuvdif.F90 index 75c0b31d3..14e0481b9 100644 --- a/physics/ysuvdif.F90 +++ b/physics/ysuvdif.F90 @@ -25,7 +25,7 @@ end subroutine ysuvdif_finalize !! \htmlinclude ysuvdif_run.html !! !------------------------------------------------------------------------------- - subroutine ysuvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & + subroutine ysuvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d,karman, & utnp,vtnp,ttnp,qtnp, & swh,hlw,xmu,ntrac,ndiff,ntcw,ntiw, & phii,phil,psfcpa, & @@ -52,10 +52,10 @@ subroutine ysuvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d, & real(kind=kind_phys),parameter :: h1 = 0.33333335, h2 = 0.6666667 real(kind=kind_phys),parameter :: zfmin = 1.e-8,aphi5 = 5.,aphi16 = 16. real(kind=kind_phys),parameter :: tmin=1.e-2 - real(kind=kind_phys),parameter :: gamcrt = 3.,gamcrq = 2.e-3 + real(kind=kind_phys),parameter :: gagreomcrt = 3.,gamcrq = 2.e-3 real(kind=kind_phys),parameter :: xka = 2.4e-5 real(kind=kind_phys),parameter :: rcl = 1.0 - real(kind=kind_phys),parameter :: karman = 0.4 + real(kind=kind_phys),intent(in) :: karman integer,parameter :: imvdif = 1 integer,parameter :: ysu_topdown_pblmix = 1 ! diff --git a/physics/ysuvdif.meta b/physics/ysuvdif.meta index 9ba31ed27..b5bba603a 100644 --- a/physics/ysuvdif.meta +++ b/physics/ysuvdif.meta @@ -86,6 +86,14 @@ kind = kind_phys intent = in optional = F +[karman] + standard_name = von_karman_constant + long_name = von karman constant + units = none + dimensions = () + type = real + intent = in + optional = F [vtnp] standard_name = tendency_of_y_wind_due_to_model_physics long_name = updated tendency of the y wind From fd6bb5e26c738d790ec633545af1de5d6668f53e Mon Sep 17 00:00:00 2001 From: XiaSun-NOAA Date: Mon, 7 Dec 2020 18:49:56 +0000 Subject: [PATCH 04/21] minor fix --- physics/ysuvdif.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/ysuvdif.F90 b/physics/ysuvdif.F90 index 14e0481b9..81e3a79b4 100644 --- a/physics/ysuvdif.F90 +++ b/physics/ysuvdif.F90 @@ -52,7 +52,7 @@ subroutine ysuvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d,karman, & real(kind=kind_phys),parameter :: h1 = 0.33333335, h2 = 0.6666667 real(kind=kind_phys),parameter :: zfmin = 1.e-8,aphi5 = 5.,aphi16 = 16. real(kind=kind_phys),parameter :: tmin=1.e-2 - real(kind=kind_phys),parameter :: gagreomcrt = 3.,gamcrq = 2.e-3 + real(kind=kind_phys),parameter :: gamcrt = 3.,gamcrq = 2.e-3 real(kind=kind_phys),parameter :: xka = 2.4e-5 real(kind=kind_phys),parameter :: rcl = 1.0 real(kind=kind_phys),intent(in) :: karman From 69d33b9018ad25c47ec663794d311e34715bc060 Mon Sep 17 00:00:00 2001 From: XiaSun-NOAA Date: Mon, 7 Dec 2020 20:52:23 +0000 Subject: [PATCH 05/21] clean use physcons in cu_gf_driver --- physics/cu_gf_driver.F90 | 6 +++--- physics/cu_gf_driver.meta | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/physics/cu_gf_driver.F90 b/physics/cu_gf_driver.F90 index dcf0d183b..3b71c761c 100644 --- a/physics/cu_gf_driver.F90 +++ b/physics/cu_gf_driver.F90 @@ -5,7 +5,7 @@ module cu_gf_driver ! DH* TODO: replace constants with arguments to cu_gf_driver_run - use physcons , g => con_g, cp => con_cp, xlv => con_hvap, r_v => con_rv + !use physcons , g => con_g, cp => con_cp, xlv => con_hvap, r_v => con_rv use machine , only: kind_phys use cu_gf_deep, only: cu_gf_deep_run,neg_check,autoconv,aeroevap,fct1d3 use cu_gf_sh , only: cu_gf_sh_run @@ -63,7 +63,7 @@ end subroutine cu_gf_driver_finalize !! !>\section gen_gf_driver GSD GF Cumulus Scheme General Algorithm !> @{ - subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,cactiv, & + subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,cactiv,g,cp,xlv,r_v, & forcet,forceqv_spechum,phil,raincv,qv_spechum,t,cld1d, & us,vs,t2di,w,qv2di_spechum,p2di,psuri, & hbot,htop,kcnv,xland,hfx2,qfx2,cliw,clcw, & @@ -95,7 +95,7 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,cactiv, & integer, intent(in ) :: im,km,ntracer logical, intent(in ) :: flag_for_scnv_generic_tend,flag_for_dcnv_generic_tend logical, intent(in ) :: ldiag3d,qdiag3d - + real (kind=kind_phys), intent(in) :: g,cp,xlv,r_v real(kind=kind_phys), dimension( im , km ), intent(in ) :: forcet,forceqv_spechum,w,phil real(kind=kind_phys), dimension( im , km ), intent(inout ) :: t,us,vs real(kind=kind_phys), dimension( im , km ), intent(inout ) :: qci_conv diff --git a/physics/cu_gf_driver.meta b/physics/cu_gf_driver.meta index f27b2cc91..e22bc516b 100644 --- a/physics/cu_gf_driver.meta +++ b/physics/cu_gf_driver.meta @@ -95,6 +95,42 @@ type = integer intent = inout optional = F +[g] + standard_name = gravitational_acceleration + long_name = gravitational acceleration + units = m s-2 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[cp] + standard_name = specific_heat_of_dry_air_at_constant_pressure + long_name = specific heat !of dry air at constant pressure + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[xlv] + standard_name = latent_heat_of_vaporization_of_water_at_0C + long_name = latent heat of evaporation/sublimation + units = J kg-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[r_v] + standard_name = gas_constant_water_vapor + long_name = ideal gas constant for water vapor + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F [forcet] standard_name = temperature_tendency_due_to_dynamics long_name = temperature tendency due to dynamics only From 3215b4b59d6da8bd8c4029c4e519788d21ca0b43 Mon Sep 17 00:00:00 2001 From: XiaSun-NOAA Date: Mon, 7 Dec 2020 21:33:10 +0000 Subject: [PATCH 06/21] clean use physcon in dcyc2 --- physics/dcyc2.f | 6 ++++-- physics/dcyc2.meta | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/physics/dcyc2.f b/physics/dcyc2.f index 22eece516..f32618416 100644 --- a/physics/dcyc2.f +++ b/physics/dcyc2.f @@ -171,7 +171,7 @@ end subroutine dcyc2t3_finalize !> @{ subroutine dcyc2t3_run & ! --- inputs: - & ( solhr,slag,sdec,cdec,sinlat,coslat, & + & ( solhr,slag,sdec,cdec,sinlat,coslat,con_pi, con_sbc, & & xlon,coszen,tsfc_lnd,tsfc_ice,tsfc_wat,tf,tsflw, & & sfcemis_lnd, sfcemis_ice, sfcemis_wat, & & sfcdsw,sfcnsw,sfcdlw,swh,swhc,hlw,hlwc, & @@ -191,7 +191,6 @@ subroutine dcyc2t3_run & & ) ! use machine, only : kind_phys - use physcons, only : con_pi, con_sbc implicit none ! @@ -228,6 +227,9 @@ subroutine dcyc2t3_run & real(kind=kind_phys), dimension(im,levs), intent(in) :: swh, hlw & &, swhc, hlwc + real(kind_phys), intent(in ) :: con_pi, con_sbc + + ! --- input/output: real(kind=kind_phys), dimension(im,levs), intent(inout) :: dtdt & &, dtdtc diff --git a/physics/dcyc2.meta b/physics/dcyc2.meta index 6fbc7f8b6..75020f2a8 100644 --- a/physics/dcyc2.meta +++ b/physics/dcyc2.meta @@ -79,6 +79,24 @@ kind = kind_phys intent = in optional = F +[con_pi] + standard_name = pi + long_name = ratio of a circle's circumference to its diameter + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[con_sbc] + standard_name = stefan_boltzmann_constant + long_name = Stefan-Boltzmann constant + units = W m-2 K-4 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F [tsfc_lnd] standard_name = surface_skin_temperature_over_land_interstitial long_name = surface skin temperature over land (temporary use as interstitial) From a730494a4291ddc8188e0374d14326eab78be2d7 Mon Sep 17 00:00:00 2001 From: XiaSun-NOAA Date: Mon, 7 Dec 2020 21:40:02 +0000 Subject: [PATCH 07/21] clean up physcon in getprs_fv3 --- physics/get_prs_fv3.F90 | 8 +++++--- physics/get_prs_fv3.meta | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/physics/get_prs_fv3.F90 b/physics/get_prs_fv3.F90 index 224c8c853..c2a5c06d4 100644 --- a/physics/get_prs_fv3.F90 +++ b/physics/get_prs_fv3.F90 @@ -1,7 +1,7 @@ module get_prs_fv3 use machine, only: kind_phys - use physcons, only: con_fvirt +! use physcons, only: con_fvirt !--- public declarations public get_prs_fv3_init, get_prs_fv3_run, get_prs_fv3_finalize @@ -18,12 +18,13 @@ end subroutine get_prs_fv3_init !! \section arg_table_get_prs_fv3_run Argument Table !! \htmlinclude get_prs_fv3_run.html !! - subroutine get_prs_fv3_run(ix, levs, phii, prsi, tgrs, qgrs1, del, del_gz, errmsg, errflg) + subroutine get_prs_fv3_run(ix, levs, con_fvirt, phii, prsi, tgrs, qgrs1, del, del_gz, errmsg, errflg) implicit none ! Interface variables integer, intent(in) :: ix, levs + real(kind=kind_phys), intent(in) :: con_fvirt real(kind=kind_phys), dimension(ix,levs+1), intent(in) :: phii real(kind=kind_phys), dimension(ix,levs+1), intent(in) :: prsi real(kind=kind_phys), dimension(ix,levs), intent(in) :: tgrs @@ -79,12 +80,13 @@ end subroutine get_phi_fv3_init !! \section arg_table_get_phi_fv3_run Argument Table !! \htmlinclude get_phi_fv3_run.html !! - subroutine get_phi_fv3_run(ix, levs, gt0, gq01, del_gz, phii, phil, errmsg, errflg) + subroutine get_phi_fv3_run(ix, levs, con_fvirt, gt0, gq01, del_gz, phii, phil, errmsg, errflg) implicit none ! Interface variables integer, intent(in) :: ix, levs + real(kind=kind_phys), intent(in) :: con_fvirt real(kind=kind_phys), dimension(ix,levs), intent(in) :: gt0 real(kind=kind_phys), dimension(ix,levs), intent(in) :: gq01 real(kind=kind_phys), dimension(ix,levs+1), intent(inout) :: del_gz diff --git a/physics/get_prs_fv3.meta b/physics/get_prs_fv3.meta index 82b6a00d6..53e69990f 100644 --- a/physics/get_prs_fv3.meta +++ b/physics/get_prs_fv3.meta @@ -23,6 +23,15 @@ type = integer intent = in optional = F +[con_fvirt] + standard_name = ratio_of_vapor_to_dry_air_gas_constants_minus_one + long_name = rv/rd - 1 (rv = ideal gas constant for water vapor) + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F [phii] standard_name = geopotential_at_interface long_name = interface geopotential @@ -121,6 +130,15 @@ type = integer intent = in optional = F +[con_fvirt] + standard_name = ratio_of_vapor_to_dry_air_gas_constants_minus_one + long_name = rv/rd - 1 (rv = ideal gas constant for water vapor) + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F [gt0] standard_name = air_temperature_updated_by_physics long_name = updated air temperature From 149d8f6cc2681be5b9cddcca48f9288d4320cd36 Mon Sep 17 00:00:00 2001 From: XiaSun-NOAA Date: Tue, 8 Dec 2020 04:36:57 +0000 Subject: [PATCH 08/21] amend dcyc2 --- physics/dcyc2.f | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/physics/dcyc2.f b/physics/dcyc2.f index f32618416..e3d308e2b 100644 --- a/physics/dcyc2.f +++ b/physics/dcyc2.f @@ -200,8 +200,7 @@ subroutine dcyc2t3_run & & hour12 = 12.0_kind_phys, & & f3600 = one/3600.0_kind_phys, & & f7200 = one/7200.0_kind_phys, & - & czlimt = 0.0001_kind_phys, & ! ~ cos(89.99427) - & pid12 = con_pi / hour12 + & czlimt = 0.0001_kind_phys ! ~ cos(89.99427) ! --- inputs: integer, intent(in) :: im, levs @@ -228,6 +227,7 @@ subroutine dcyc2t3_run & &, swhc, hlwc real(kind_phys), intent(in ) :: con_pi, con_sbc + real(kind_phys) :: pid12 ! --- input/output: @@ -260,6 +260,7 @@ subroutine dcyc2t3_run & tem1 = fhswr / deltim nstp = max(6, nint(tem1)) nstl = max(1, nint(nstp/tem1)) + pid12 = con_pi / hour12 ! ! --- ... sw time-step adjustment for current cosine of zenith angle ! ---------------------------------------------------------- From 3f35140f1fad729976e764aca6fc384a1da7d580 Mon Sep 17 00:00:00 2001 From: XiaSun-NOAA Date: Mon, 14 Dec 2020 22:32:15 +0000 Subject: [PATCH 09/21] clean use physcons in gscond --- physics/gscond.f | 7 ++-- physics/gscond.meta | 90 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+), 4 deletions(-) diff --git a/physics/gscond.f b/physics/gscond.f index 28f24763c..504e46af8 100644 --- a/physics/gscond.f +++ b/physics/gscond.f @@ -43,6 +43,7 @@ end subroutine zhaocarr_gscond_finalize !> @{ subroutine zhaocarr_gscond_run (im,km,dt,dtf,prsl,ps,q,clw1 & &, clw2, cwm, t, tp, qp, psp & + &, psat,hvap,grav,hfus,ttp,rd,cp,eps,epsm1,rv & &, tp1, qp1, psp1, u, lprnt, ipr, errmsg, errflg) ! @@ -63,10 +64,6 @@ subroutine zhaocarr_gscond_run (im,km,dt,dtf,prsl,ps,q,clw1 & ! use machine , only : kind_phys use funcphys , only : fpvs - use physcons, psat => con_psat, hvap => con_hvap, grav => con_g - &, hfus => con_hfus, ttp => con_ttp, rd => con_rd - &, cp => con_cp, eps => con_eps, epsm1 => con_epsm1 - &, rv => con_rv ! use namelist_def, only: nsdfi,fhdfi implicit none ! @@ -82,6 +79,8 @@ subroutine zhaocarr_gscond_run (im,km,dt,dtf,prsl,ps,q,clw1 & &, tp1(im,km), qp1(im,km), psp1(im) real(kind=kind_phys), intent(in) :: u(im,km) logical, intent(in) :: lprnt + real(kind=kind_phys), intent(in) :: psat, hvap, grav, hfus & + &, ttp, rd, cp, eps, epsm1, rv ! character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/gscond.meta b/physics/gscond.meta index 75b2d3a89..fdcbeb567 100644 --- a/physics/gscond.meta +++ b/physics/gscond.meta @@ -131,6 +131,96 @@ kind = kind_phys intent = inout optional = F +[psat] + standard_name = pres_at_H2O_3pt + long_name = pres_at_H2O_3pt + units = Pa + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[hvap] + standard_name = latent_heat_of_vaporization_of_water_at_0C + long_name = latent heat of evaporation/sublimation + units = J kg-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[grav] + standard_name = gravitational_acceleration + long_name = gravitational acceleration + units = m s-2 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[hfus] + standard_name = latent_heat_of_fusion_of_water_at_0C + long_name = latent heat of fusion + units = J kg-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[ttp] + standard_name = triple_point_temperature_of_water + long_name = triple point temperature of water + units = K + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[rd] + standard_name = gas_constant_dry_air + long_name = ideal gas constant for dry air + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[cp] + standard_name = specific_heat_of_dry_air_at_constant_pressure + long_name = specific heat of dry air at constant pressure + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[eps] + standard_name = ratio_of_dry_air_to_water_vapor_gas_constants + long_name = rd/rv + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[epsm1] + standard_name = ratio_of_dry_air_to_water_vapor_gas_constants_minus_one + long_name = (rd/rv) - 1 + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[rv] + standard_name = gas_constant_water_vapor + long_name = ideal gas constant for water vapor + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F [tp1] standard_name = air_temperature_at_previous_timestep long_name = air temperature at previous timestep From 4661b732265c23aecab869d69be99dd6c218cf82 Mon Sep 17 00:00:00 2001 From: XiaSun-NOAA Date: Mon, 14 Dec 2020 22:50:33 +0000 Subject: [PATCH 10/21] clean use_physcons in m_micro --- physics/m_micro.F90 | 14 +++--- physics/m_micro.meta | 117 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 123 insertions(+), 8 deletions(-) diff --git a/physics/m_micro.F90 b/physics/m_micro.F90 index cb666379e..9118adc7c 100644 --- a/physics/m_micro.F90 +++ b/physics/m_micro.F90 @@ -108,6 +108,9 @@ end subroutine m_micro_finalize !>\section detail_m_micro_run MG m_micro_run Detailed Algorithm !> @{ subroutine m_micro_run( im, lm, flipv, dt_i & + &, grav, pi, rgas, cp & + &, hvap, hfus, ttp, tice & + &, eps, epsm1, VIREPS,latvap, latice & &, prsl_i, prsi_i, phil, phii & &, omega_i, QLLS_i, QLCN_i, QILS_i, QICN_i& &, lwheat_i, swheat_i, w_upi, cf_upi & @@ -129,13 +132,6 @@ subroutine m_micro_run( im, lm, flipv, dt_i & & errmsg, errflg) use machine , only: kind_phys - use physcons, only: grav => con_g, pi => con_pi, & - & rgas => con_rd, cp => con_cp, & - & hvap => con_hvap, hfus => con_hfus, & - & ttp => con_ttp, tice => con_t0c, & - & eps => con_eps, epsm1 => con_epsm1, & - & VIREPS => con_fvirt, & - & latvap => con_hvap, latice => con_hfus ! use funcphys, only: fpvs !< saturation vapor pressure for water-ice mixed ! use funcphys, only: fpvsl, fpvsi, fpvs !< saturation vapor pressure for water,ice & mixed @@ -164,7 +160,9 @@ subroutine m_micro_run( im, lm, flipv, dt_i & ! input ! real, parameter :: r_air = 3.47d-3 integer, parameter :: kp = kind_phys - real(kind=kind_phys), intent(in ) :: rainmin + real(kind=kind_phys), intent(in ) :: rainmin, grav, pi, rgas, cp, & + & hvap, hfus, ttp, tice, eps, epsm1, VIREPS, & + & latvap, latice real, parameter :: one=1.0_kp, oneb3=one/3.0_kp, onebcp=one/cp, & zero=0.0_kp, half=0.5_kp, onebg=one/grav, & & kapa=rgas*onebcp, cpbg=cp/grav, & diff --git a/physics/m_micro.meta b/physics/m_micro.meta index 4aa6989b0..d8be61418 100644 --- a/physics/m_micro.meta +++ b/physics/m_micro.meta @@ -344,6 +344,123 @@ kind = kind_phys intent = in optional = F +[grav] + standard_name = gravitational_acceleration + long_name = gravitational acceleration + units = m s-2 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[pi] + standard_name = pi + long_name = ratio of a circle's circumference to its diameter + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[rgas] + standard_name = gas_constant_dry_air + long_name = ideal gas constant for dry air + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[cp] + standard_name = specific_heat_of_dry_air_at_constant_pressure + long_name = specific heat of dry air at constant pressure + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[hvap] + standard_name = latent_heat_of_vaporization_of_water_at_0C + long_name = latent heat of evaporation/sublimation + units = J kg-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[hfus] + standard_name = latent_heat_of_fusion_of_water_at_0C + long_name = latent heat of fusion + units = J kg-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[ttp] + standard_name = triple_point_temperature_of_water + long_name = triple point temperature of water + units = K + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[t0c] + standard_name = temperature_at_zero_celsius + long_name = temperature at 0 degree Celsius + units = K + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[eps] + standard_name = ratio_of_dry_air_to_water_vapor_gas_constants + long_name = rd/rv + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[epsm1] + standard_name = ratio_of_dry_air_to_water_vapor_gas_constants_minus_one + long_name = (rd/rv) - 1 + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[VIREPS] + standard_name = ratio_of_vapor_to_dry_air_gas_constants_minus_one + long_name = (rv/rd) - 1 (rv = ideal gas constant for water vapor) + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[hvap] + standard_name = latent_heat_of_vaporization_of_water_at_0C + long_name = latent heat of evaporation/sublimation + units = J kg-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[latice] + standard_name = latent_heat_of_fusion_of_water_at_0C + long_name = latent heat of fusion + units = J kg-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F [prsl_i] standard_name = air_pressure long_name = layer mean pressure From 436b410af45376ff471cf449bc2482955d945e3e Mon Sep 17 00:00:00 2001 From: XiaSun-NOAA Date: Mon, 14 Dec 2020 23:20:50 +0000 Subject: [PATCH 11/21] clean use_physcons in module_MYNNPBL_wrapper --- physics/module_MYNNPBL_wrapper.F90 | 20 ++---- physics/module_MYNNPBL_wrapper.meta | 108 ++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+), 14 deletions(-) diff --git a/physics/module_MYNNPBL_wrapper.F90 b/physics/module_MYNNPBL_wrapper.F90 index 6011c203e..45a91419f 100644 --- a/physics/module_MYNNPBL_wrapper.F90 +++ b/physics/module_MYNNPBL_wrapper.F90 @@ -39,6 +39,8 @@ end subroutine mynnedmf_wrapper_finalize SUBROUTINE mynnedmf_wrapper_run( & & im,levs, & & flag_init,flag_restart, & + & cp, g, r_d, r_v, cpv, cliq,Cice,& + & rcp, XLV, XLF, EP_1, EP_2, & & lssav, ldiag3d, qdiag3d, & & lsidea, cplflx, & & delt,dtf,dx,zorl, & @@ -100,19 +102,6 @@ SUBROUTINE mynnedmf_wrapper_run( & use machine , only : kind_phys ! use funcphys, only : fpvs - use physcons, only : cp => con_cp, & - & g => con_g, & - & r_d => con_rd, & - & r_v => con_rv, & - & cpv => con_cvap, & - & cliq => con_cliq, & - & Cice => con_csol, & - & rcp => con_rocp, & - & XLV => con_hvap, & - & XLF => con_hfus, & - & EP_1 => con_fvirt, & - & EP_2 => con_eps - USE module_bl_mynn, only : mynn_bl_driver !------------------------------------------------------------------- @@ -172,8 +161,11 @@ SUBROUTINE mynnedmf_wrapper_run( & ! REAL , PARAMETER :: EP_1 = R_v/R_d-1. ! REAL , PARAMETER :: EP_2 = R_d/R_v ! + + real(kind=kind_phys), intent(in) :: cp, g, r_d, r_v, cpv, & + & cliq, Cice, rcp, XLV, XLF, EP_1, EP_2 - REAL, PARAMETER :: xlvcp=xlv/cp, xlscp=(xlv+xlf)/cp, ev=xlv, rd=r_d, & + REAL :: xlvcp=xlv/cp, xlscp=(xlv+xlf)/cp, ev=xlv, rd=r_d, & &rk=cp/rd, svp11=svp1*1.e3, p608=ep_1, ep_3=1.-ep_2 REAL, PARAMETER :: tref=300.0 !< reference temperature (K) diff --git a/physics/module_MYNNPBL_wrapper.meta b/physics/module_MYNNPBL_wrapper.meta index 9b9d4cb52..ca046f21c 100644 --- a/physics/module_MYNNPBL_wrapper.meta +++ b/physics/module_MYNNPBL_wrapper.meta @@ -69,6 +69,114 @@ type = logical intent = in optional = F +[cp] + standard_name = specific_heat_of_dry_air_at_constant_pressure + long_name = specific heat of dry air at constant pressure + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[g] + standard_name = gravitational_acceleration + long_name = gravitational acceleration + units = m s-2 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[r_d] + standard_name = gas_constant_dry_air + long_name = ideal gas constant for dry air + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[r_v] + standard_name = gas_constant_water_vapor + long_name = ideal gas constant for water vapor + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[cpv] + standard_name = specific_heat_of_water_vapor_at_constant_pressure + long_name = specific heat of water vapor at constant pressure + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[cliq] + standard_name = specific_heat_of_liquid_water_at_constant_pressure + long_name = specific heat of liquid water at constant pressure + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[Cice] + standard_name = specific_heat_of_ice_at_constant_pressure + long_name = specific heat of ice at constant pressure + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[rcp] + standard_name = ratio_of_gas_constant_dry_air_to_specific_heat_of_dry_air_at_constant_pressure + long_name = (rd/cp) + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[XLV] + standard_name = latent_heat_of_vaporization_of_water_at_0C + long_name = latent heat of evaporation/sublimation + units = J kg-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[XLF] + standard_name = latent_heat_of_fusion_of_water_at_0C + long_name = latent heat of fusion + units = J kg-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[EP_1] + standard_name = ratio_of_vapor_to_dry_air_gas_constants_minus_one + long_name = (rv/rd) - 1 (rv = ideal gas constant for water vapor) + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[EP_2] + standard_name = ratio_of_dry_air_to_water_vapor_gas_constants + long_name = rd/rv + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F [lssav] standard_name = flag_diagnostics long_name = logical flag for storing diagnostics From f695abb6a61470e19d2e4babbb32d43b91be14cd Mon Sep 17 00:00:00 2001 From: XiaSun-NOAA Date: Mon, 14 Dec 2020 23:25:10 +0000 Subject: [PATCH 12/21] clean up use_physcons in module_SGSCloud_RadPre --- physics/module_SGSCloud_RadPre.F90 | 7 +++--- physics/module_SGSCloud_RadPre.meta | 36 +++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/physics/module_SGSCloud_RadPre.F90 b/physics/module_SGSCloud_RadPre.F90 index ebc5ea2ae..d0b9a289a 100644 --- a/physics/module_SGSCloud_RadPre.F90 +++ b/physics/module_SGSCloud_RadPre.F90 @@ -37,6 +37,7 @@ end subroutine sgscloud_radpre_finalize subroutine sgscloud_radpre_run( & im,levs, & flag_init,flag_restart, & + con_g, con_pi, eps, epsm1, & do_mynnedmf, & qc, qi, qv, T3D, P3D, & qr, qs, qg, & @@ -54,9 +55,6 @@ subroutine sgscloud_radpre_run( & ! should be moved to inside the mynn: use machine , only : kind_phys - use physcons, only : con_g, con_pi, & - eps => con_eps, & ! Rd/Rv - epsm1 => con_epsm1 ! Rd/Rv-1 use module_radiation_clouds, only : gethml use radcons, only: qmin ! Minimum vlaues for varius calculations use funcphys, only: fpvs ! Function ot compute sat. vapor pressure over liq. @@ -64,7 +62,8 @@ subroutine sgscloud_radpre_run( & implicit none !------------------------------------------------------------------- ! Interface variables - real (kind=kind_phys), parameter :: gfac=1.0e5/con_g + real(kind=kind_phys), intent(in) :: con_g, con_pi, eps, epsm1 + real (kind=kind_phys) :: gfac=1.0e5/con_g integer, intent(in) :: im, levs, imfdeepcnv, imfdeepcnv_gf, & & nlay, imp_physics, imp_physics_gfdl logical, intent(in) :: flag_init, flag_restart, do_mynnedmf diff --git a/physics/module_SGSCloud_RadPre.meta b/physics/module_SGSCloud_RadPre.meta index c01cd94af..79c1a91d7 100644 --- a/physics/module_SGSCloud_RadPre.meta +++ b/physics/module_SGSCloud_RadPre.meta @@ -39,6 +39,42 @@ type = logical intent = in optional = F +[con_g] + standard_name = gravitational_acceleration + long_name = gravitational acceleration + units = m s-2 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[con_pi] + standard_name = pi + long_name = ratio of a circle's circumference to its diameter + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[eps] + standard_name = ratio_of_dry_air_to_water_vapor_gas_constants + long_name = rd/rv + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[epsm1] + standard_name = ratio_of_dry_air_to_water_vapor_gas_constants_minus_one + long_name = (rd/rv) - 1 + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F [qc] standard_name = cloud_condensed_water_mixing_ratio long_name = ratio of mass of cloud water to mass of dry air plus vapor (without condensates) From 719338dd7e11cd598b960c38e1a960653ca79818 Mon Sep 17 00:00:00 2001 From: XiaSun-NOAA Date: Mon, 14 Dec 2020 23:35:16 +0000 Subject: [PATCH 13/21] clean up use_physcons in precpd --- physics/precpd.f | 9 ++++--- physics/precpd.meta | 63 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 4 deletions(-) diff --git a/physics/precpd.f b/physics/precpd.f index c64474c01..4674e25f0 100644 --- a/physics/precpd.f +++ b/physics/precpd.f @@ -42,6 +42,7 @@ end subroutine zhaocarr_precpd_init !! \section Zhao-Carr_precip_detailed GFS precpd Scheme Detailed Algorithm !> @{ subroutine zhaocarr_precpd_run (im,km,dt,del,prsl,q,cwm,t,rn & + &, grav, hvap, hfus, ttp, cp, eps, epsm1 & &, sr,rainp,u00k,psautco,prautco,evpco,wminco & &, wk1,lprnt,jpr,errmsg,errflg) @@ -89,14 +90,14 @@ subroutine zhaocarr_precpd_run (im,km,dt,del,prsl,q,cwm,t,rn & ! use machine , only : kind_phys use funcphys , only : fpvs - use physcons, grav => con_g, hvap => con_hvap, hfus => con_hfus - &, ttp => con_ttp, cp => con_cp - &, eps => con_eps, epsm1 => con_epsm1 + implicit none ! include 'constant.h' ! ! Interface variables integer, intent(in) :: im, km, jpr + real (kind=kind_phys), intent(in) :: grav, hvap, hfus, ttp, cp, & + eps, epsm1 real (kind=kind_phys), intent(in) :: dt real (kind=kind_phys), intent(in) :: del(im,km), prsl(im,km) real (kind=kind_phys), intent(inout) :: q(im,km), t(im,km), & @@ -115,7 +116,7 @@ subroutine zhaocarr_precpd_run (im,km,dt,del,prsl,q,cwm,t,rn & &, elwv, eliv, row &, epsq, eliw &, rcp, rrow - parameter (g=grav, h1=1.e0, h1000=1000.0 + real(kind=kind_phys) (g=grav, h1=1.e0, h1000=1000.0 &, d00=0.e0 &, elwv=hvap, eliv=hvap+hfus, row=1.e3 &, epsq=2.e-12 diff --git a/physics/precpd.meta b/physics/precpd.meta index 715991990..a1012a659 100644 --- a/physics/precpd.meta +++ b/physics/precpd.meta @@ -86,6 +86,69 @@ kind = kind_phys intent = out optional = F +[grav] + standard_name = gravitational_acceleration + long_name = gravitational acceleration + units = m s-2 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[hvap] + standard_name = latent_heat_of_vaporization_of_water_at_0C + long_name = latent heat of evaporation/sublimation + units = J kg-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[hfus] + standard_name = latent_heat_of_fusion_of_water_at_0C + long_name = latent heat of fusion + units = J kg-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[ttp] + standard_name = triple_point_temperature_of_water + long_name = triple point temperature of water + units = K + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[cp] + standard_name = specific_heat_of_dry_air_at_constant_pressure + long_name = specific heat of dry air at constant pressure + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[eps] + standard_name = ratio_of_dry_air_to_water_vapor_gas_constants + long_name = rd/rv + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[epsm1] + standard_name = ratio_of_dry_air_to_water_vapor_gas_constants_minus_one + long_name = (rd/rv) - 1 + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F [sr] standard_name = ratio_of_snowfall_to_rainfall long_name = ratio of snowfall to large-scale rainfall From 57958be2d52e6e38f20e47b801a66fe2ee41c675 Mon Sep 17 00:00:00 2001 From: XiaSun-NOAA Date: Wed, 16 Dec 2020 05:35:15 +0000 Subject: [PATCH 14/21] Milestone, several amends and rt tests passed --- physics/gscond.f | 14 ++++++++++---- physics/m_micro.F90 | 4 ++-- physics/m_micro.meta | 18 ------------------ physics/precpd.f | 23 ++++++++++++++--------- 4 files changed, 26 insertions(+), 33 deletions(-) diff --git a/physics/gscond.f b/physics/gscond.f index 504e46af8..42d7330a5 100644 --- a/physics/gscond.f +++ b/physics/gscond.f @@ -90,10 +90,10 @@ subroutine zhaocarr_gscond_run (im,km,dt,dtf,prsl,ps,q,clw1 & &, d00, elwv, eliv &, epsq &, r, cpr, rcp - parameter (h1=1.e0, d00=0.e0 - &, elwv=hvap, eliv=hvap+hfus - &, epsq=2.e-12, r=rd - &, cpr=cp*r, rcp=h1/cp) + + parameter (h1=1.e0, d00=0.e0 & + &, epsq=2.e-12) + ! real(kind=kind_phys), parameter :: cons_0=0.0, cons_m15=-15.0 ! @@ -121,6 +121,12 @@ subroutine zhaocarr_gscond_run (im,km,dt,dtf,prsl,ps,q,clw1 & enddo !-----------------prepare constants for later uses----------------- ! + elwv=hvap + eliv=hvap+hfus + r=rd + cpr=cp*r + rcp=h1/cp + el2orc = hvap*hvap / (rv*cp) albycp = hvap / cp ! write(0,*)' in gscond im=',im diff --git a/physics/m_micro.F90 b/physics/m_micro.F90 index 9118adc7c..873cfc95d 100644 --- a/physics/m_micro.F90 +++ b/physics/m_micro.F90 @@ -110,7 +110,7 @@ end subroutine m_micro_finalize subroutine m_micro_run( im, lm, flipv, dt_i & &, grav, pi, rgas, cp & &, hvap, hfus, ttp, tice & - &, eps, epsm1, VIREPS,latvap, latice & + &, eps, epsm1, VIREPS,latvap, & &, prsl_i, prsi_i, phil, phii & &, omega_i, QLLS_i, QLCN_i, QILS_i, QICN_i& &, lwheat_i, swheat_i, w_upi, cf_upi & @@ -162,7 +162,7 @@ subroutine m_micro_run( im, lm, flipv, dt_i & integer, parameter :: kp = kind_phys real(kind=kind_phys), intent(in ) :: rainmin, grav, pi, rgas, cp, & & hvap, hfus, ttp, tice, eps, epsm1, VIREPS, & - & latvap, latice + & latvap real, parameter :: one=1.0_kp, oneb3=one/3.0_kp, onebcp=one/cp, & zero=0.0_kp, half=0.5_kp, onebg=one/grav, & & kapa=rgas*onebcp, cpbg=cp/grav, & diff --git a/physics/m_micro.meta b/physics/m_micro.meta index d8be61418..48e19ae77 100644 --- a/physics/m_micro.meta +++ b/physics/m_micro.meta @@ -443,24 +443,6 @@ kind = kind_phys intent = in optional = F -[hvap] - standard_name = latent_heat_of_vaporization_of_water_at_0C - long_name = latent heat of evaporation/sublimation - units = J kg-1 - dimensions = () - type = real - kind = kind_phys - intent = in - optional = F -[latice] - standard_name = latent_heat_of_fusion_of_water_at_0C - long_name = latent heat of fusion - units = J kg-1 - dimensions = () - type = real - kind = kind_phys - intent = in - optional = F [prsl_i] standard_name = air_pressure long_name = layer mean pressure diff --git a/physics/precpd.f b/physics/precpd.f index 4674e25f0..6af066afc 100644 --- a/physics/precpd.f +++ b/physics/precpd.f @@ -97,7 +97,7 @@ subroutine zhaocarr_precpd_run (im,km,dt,del,prsl,q,cwm,t,rn & ! Interface variables integer, intent(in) :: im, km, jpr real (kind=kind_phys), intent(in) :: grav, hvap, hfus, ttp, cp, & - eps, epsm1 + & eps, epsm1 real (kind=kind_phys), intent(in) :: dt real (kind=kind_phys), intent(in) :: del(im,km), prsl(im,km) real (kind=kind_phys), intent(inout) :: q(im,km), t(im,km), & @@ -116,14 +116,13 @@ subroutine zhaocarr_precpd_run (im,km,dt,del,prsl,q,cwm,t,rn & &, elwv, eliv, row &, epsq, eliw &, rcp, rrow - real(kind=kind_phys) (g=grav, h1=1.e0, h1000=1000.0 - &, d00=0.e0 - &, elwv=hvap, eliv=hvap+hfus, row=1.e3 - &, epsq=2.e-12 - &, eliw=eliv-elwv, rcp=h1/cp, rrow=h1/row) -! - real(kind=kind_phys), parameter :: cons_0=0.0, cons_p01=0.01 - &, cons_20=20.0 + parameter ( h1=1.e0, h1000=1000.0 & + &, d00=0.e0, row=1.e3 & + &, epsq=2.e-12) +! + + real(kind=kind_phys), parameter :: cons_0=0.0, cons_p01=0.01 & + &, cons_20=20.0 & &, cons_m30=-30.0, cons_50=50.0 ! real (kind=kind_phys) rnp(im), psautco_l(im), prautco_l(im) & @@ -172,6 +171,12 @@ subroutine zhaocarr_precpd_run (im,km,dt,del,prsl,q,cwm,t,rn & ! enddo ! enddo ! + g=grav + elwv=hvap + eliv=hvap+hfus + eliw=eliv-elwv + rcp=h1/cp + rrow=h1/row rdt = h1 / dt ! ke = 2.0e-5 ! commented on 09/10/99 -- opr value ! ke = 2.0e-6 From 51e8c015d8a8ee8bffd239bc5ed2e64f1bb19bbf Mon Sep 17 00:00:00 2001 From: XiaSun-NOAA Date: Wed, 16 Dec 2020 20:19:20 +0000 Subject: [PATCH 15/21] duplicate meta entry, remove latvap not used in _run --- physics/m_micro.F90 | 22 ++++++++++++++-------- physics/m_micro.meta | 2 +- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/physics/m_micro.F90 b/physics/m_micro.F90 index 873cfc95d..e0ee163fe 100644 --- a/physics/m_micro.F90 +++ b/physics/m_micro.F90 @@ -110,7 +110,7 @@ end subroutine m_micro_finalize subroutine m_micro_run( im, lm, flipv, dt_i & &, grav, pi, rgas, cp & &, hvap, hfus, ttp, tice & - &, eps, epsm1, VIREPS,latvap, & + &, eps, epsm1, VIREPS & &, prsl_i, prsi_i, phil, phii & &, omega_i, QLLS_i, QLCN_i, QILS_i, QICN_i& &, lwheat_i, swheat_i, w_upi, cf_upi & @@ -161,16 +161,14 @@ subroutine m_micro_run( im, lm, flipv, dt_i & ! real, parameter :: r_air = 3.47d-3 integer, parameter :: kp = kind_phys real(kind=kind_phys), intent(in ) :: rainmin, grav, pi, rgas, cp, & - & hvap, hfus, ttp, tice, eps, epsm1, VIREPS, & - & latvap - real, parameter :: one=1.0_kp, oneb3=one/3.0_kp, onebcp=one/cp, & - zero=0.0_kp, half=0.5_kp, onebg=one/grav, & - & kapa=rgas*onebcp, cpbg=cp/grav, & - & lvbcp=hvap*onebcp, lsbcp=(hvap+hfus)*onebcp, & + & hvap, hfus, ttp, tice, eps, epsm1, VIREPS + + real, parameter :: one=1.0_kp, oneb3=one/3.0_kp, & + zero=0.0_kp, half=0.5_kp, & & qsmall=1.0e-14_kp, & & fourb3=4.0_kp/3.0_kp, RL_cub=1.0e-15_kp, & & nmin=1.0_kp - + real(kind=kind_phys) :: onebcp, onebg, kapa, cpbg, lvbcp, lsbcp integer, parameter :: ncolmicro = 1 integer,intent(in) :: im, lm, kdt, fprcp, pdfflag, iccn logical,intent(in) :: flipv, skip_macro @@ -403,6 +401,14 @@ subroutine m_micro_run( im, lm, flipv, dt_i & ipr = 1 ! rhr8 = 1.0 + + onebcp=one/cp + onebg=one/grav + kapa=rgas*onebcp + cpbg=cp/grav + lvbcp=hvap*onebcp + lsbcp=(hvap+hfus)*onebcp + if(flipv) then DO K=1, LM ll = lm-k+1 diff --git a/physics/m_micro.meta b/physics/m_micro.meta index 48e19ae77..b504935a6 100644 --- a/physics/m_micro.meta +++ b/physics/m_micro.meta @@ -407,7 +407,7 @@ kind = kind_phys intent = in optional = F -[t0c] +[tice] standard_name = temperature_at_zero_celsius long_name = temperature at 0 degree Celsius units = K From ec19a7eb0efe10bbc23103763f90938ccc86adea Mon Sep 17 00:00:00 2001 From: XiaSun-NOAA Date: Wed, 16 Dec 2020 20:20:27 +0000 Subject: [PATCH 16/21] move calculation to the execution section --- physics/module_SGSCloud_RadPre.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/physics/module_SGSCloud_RadPre.F90 b/physics/module_SGSCloud_RadPre.F90 index d0b9a289a..1d73dd9d1 100644 --- a/physics/module_SGSCloud_RadPre.F90 +++ b/physics/module_SGSCloud_RadPre.F90 @@ -63,7 +63,7 @@ subroutine sgscloud_radpre_run( & !------------------------------------------------------------------- ! Interface variables real(kind=kind_phys), intent(in) :: con_g, con_pi, eps, epsm1 - real (kind=kind_phys) :: gfac=1.0e5/con_g + real (kind=kind_phys) :: gfac integer, intent(in) :: im, levs, imfdeepcnv, imfdeepcnv_gf, & & nlay, imp_physics, imp_physics_gfdl logical, intent(in) :: flag_init, flag_restart, do_mynnedmf @@ -108,7 +108,7 @@ subroutine sgscloud_radpre_run( & !write(0,*)"==============================================" !write(0,*)"in SGSCLoud_RadPre" - + gfac=1.0e5/con_g if (flag_init .and. (.not. flag_restart)) then !write (0,*) 'Skip this flag_init = ', flag_init ! return From ba723471172eaf2b3d897393412b20fe8ef18edd Mon Sep 17 00:00:00 2001 From: XiaSun-NOAA Date: Wed, 16 Dec 2020 20:21:51 +0000 Subject: [PATCH 17/21] move calculation to the execution section for module_MYNNPBL_wrapper --- physics/module_MYNNPBL_wrapper.F90 | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/physics/module_MYNNPBL_wrapper.F90 b/physics/module_MYNNPBL_wrapper.F90 index 45a91419f..61a65dfe9 100644 --- a/physics/module_MYNNPBL_wrapper.F90 +++ b/physics/module_MYNNPBL_wrapper.F90 @@ -165,12 +165,11 @@ SUBROUTINE mynnedmf_wrapper_run( & real(kind=kind_phys), intent(in) :: cp, g, r_d, r_v, cpv, & & cliq, Cice, rcp, XLV, XLF, EP_1, EP_2 - REAL :: xlvcp=xlv/cp, xlscp=(xlv+xlf)/cp, ev=xlv, rd=r_d, & - &rk=cp/rd, svp11=svp1*1.e3, p608=ep_1, ep_3=1.-ep_2 + real(kind=kind_phys) :: xlvcp, xlscp, ev, rd, & + & rk, svp11, p608, ep_3,tv0, tv1, gtr,g_inv REAL, PARAMETER :: tref=300.0 !< reference temperature (K) REAL, PARAMETER :: TKmin=253.0 !< for total water conversion, Tripoli and Cotton (1981) - REAL, PARAMETER :: tv0=p608*tref, tv1=(1.+p608)*tref, gtr=g/tref, g_inv=1./g REAL, PARAMETER :: zero=0.0d0, one=1.0d0 REAL, PARAMETER :: huge=9.9692099683868690E36 ! NetCDF float FillValue, same as in GFS_typedefs.F90 @@ -322,7 +321,7 @@ SUBROUTINE mynnedmf_wrapper_run( & write(0,*)"flag_init=",flag_init write(0,*)"flag_restart=",flag_restart endif - + ! DH* TODO: Use flag_restart to distinguish which fields need ! to be initialized and which are read from restart files if (flag_init) then @@ -332,6 +331,19 @@ SUBROUTINE mynnedmf_wrapper_run( & initflag=0 !print*,"in MYNN, initflag=",initflag endif + + xlvcp=xlv/cp + xlscp=(xlv+xlf)/cp + ev=xlv + rd=r_d + rk=cp/rd + svp11=svp1*1.e3 + p608=ep_1 + ep_3=1.-ep_2 + tv0=p608*tref + tv1=(1.+p608)*tref + gtr=g/tref + g_inv=1./g ! Assign variables for each microphysics scheme if (imp_physics == imp_physics_wsm6) then From 720607bea2623de2e0dc800f6d0d07bbc686b8d5 Mon Sep 17 00:00:00 2001 From: XiaSun-NOAA Date: Thu, 7 Jan 2021 23:09:16 +0000 Subject: [PATCH 18/21] remove physcon; use public for tranfer cons --- physics/radlw_main.F90 | 24 ++++++++++++------ physics/radlw_main.meta | 54 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+), 7 deletions(-) diff --git a/physics/radlw_main.F90 b/physics/radlw_main.F90 index de8d9e973..5ed3397d6 100644 --- a/physics/radlw_main.F90 +++ b/physics/radlw_main.F90 @@ -280,8 +280,7 @@ module rrtmg_lw ! use physparam, only : ilwrate, ilwrgas, ilwcliq, ilwcice, & & isubclw, icldflg, iovr, ivflip - use physcons, only : con_g, con_cp, con_avgd, con_amd, & - & con_amw, con_amo3 + use mersenne_twister, only : random_setseed, random_number, & & random_stat !mz @@ -320,8 +319,8 @@ module rrtmg_lw real (kind=kind_phys), parameter :: f_one = 1.0 ! ... atomic weights for conversion from mass to volume mixing ratios - real (kind=kind_phys), parameter :: amdw = con_amd/con_amw - real (kind=kind_phys), parameter :: amdo3 = con_amd/con_amo3 + ! real (kind=kind_phys), parameter :: amdw = con_amd/con_amw + ! real (kind=kind_phys), parameter :: amdo3 = con_amd/con_amo3 ! ... band indices integer, dimension(nbands) :: nspa, nspb @@ -385,7 +384,9 @@ module rrtmg_lw ! --- public accessable subprograms public rrtmg_lw_init, rrtmg_lw_run, rrtmg_lw_finalize, rlwinit - + + real(kind=kind_phys), public :: con_g, con_cp, & + & con_avgd, con_amd, con_amw, con_amo3 ! ================ contains @@ -423,7 +424,8 @@ end subroutine rrtmg_lw_init !> \section gen_lwrad RRTMG Longwave Radiation Scheme General Algorithm !> @{ subroutine rrtmg_lw_run & - & ( plyr,plvl,tlyr,tlvl,qlyr,olyr,gasvmr_co2, gasvmr_n2o, & ! --- inputs + & ( con_g,con_cp,con_avgd,con_amd,con_amw,con_amo3, & ! --- inputs + & plyr,plvl,tlyr,tlvl,qlyr,olyr,gasvmr_co2, gasvmr_n2o, & & gasvmr_ch4, gasvmr_o2, gasvmr_co, gasvmr_cfc11, & & gasvmr_cfc12, gasvmr_cfc22, gasvmr_ccl4, & & icseed,aeraod,aerssa,sfemis,sfgtmp, & @@ -613,6 +615,12 @@ subroutine rrtmg_lw_run & logical, intent(in) :: lprnt + real(kind=kind_phys),intent(in) :: con_g, con_cp, & + & con_avgd, con_amd, con_amw, con_amo3 + + + real (kind=kind_phys) :: amdw, amdo3 + real (kind=kind_phys), dimension(npts,nlp1), intent(in) :: plvl, & & tlvl real (kind=kind_phys), dimension(npts,nlay), intent(in) :: plyr, & @@ -767,7 +775,9 @@ subroutine rrtmg_lw_run & ! Initialize CCPP error handling variables errmsg = '' errflg = 0 - + + amdw = con_amd/con_amw + amdo3 = con_amd/con_amo3 !mz* ! For passing in cloud physical properties; cloud optics parameterized ! in RRTMG: diff --git a/physics/radlw_main.meta b/physics/radlw_main.meta index 0e7aff8d4..5770a8815 100644 --- a/physics/radlw_main.meta +++ b/physics/radlw_main.meta @@ -7,6 +7,60 @@ [ccpp-arg-table] name = rrtmg_lw_run type = scheme +[con_g] + standard_name = gravitational_acceleration + long_name = gravitational acceleration + units = m s-2 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[con_cp] + standard_name = specific_heat_of_dry_air_at_constant_pressure + long_name = specific heat of dry air at constant pressure + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[con_avgd] + standard_name = avogadro_constant + long_name = avogadro constant + units = mol-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[con_amd] + standard_name = molecular_weight_of_dry_air + long_name = molecular weight of dry air + units = g mol-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[con_amw] + standard_name = molecular_weight_of_water_vapor + long_name = molecular weight of water vapor + units = g mol-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[con_amo3] + standard_name = molecular_weight_of_o3 + long_name = molecular weight of o3 + units = g mol-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F [plyr] standard_name = air_pressure_at_layer_for_radiation_in_hPa long_name = air pressure layer From 501251e6c6aad629f0d1ea5b212f74c7874630a0 Mon Sep 17 00:00:00 2001 From: XiaSun-NOAA Date: Tue, 12 Jan 2021 02:26:17 +0000 Subject: [PATCH 19/21] revert changes to radlw_main for 2nd round clean up --- physics/radlw_main.F90 | 26 ++++++------------- physics/radlw_main.meta | 56 +---------------------------------------- 2 files changed, 9 insertions(+), 73 deletions(-) diff --git a/physics/radlw_main.F90 b/physics/radlw_main.F90 index 5ed3397d6..f1811ed51 100644 --- a/physics/radlw_main.F90 +++ b/physics/radlw_main.F90 @@ -280,7 +280,8 @@ module rrtmg_lw ! use physparam, only : ilwrate, ilwrgas, ilwcliq, ilwcice, & & isubclw, icldflg, iovr, ivflip - + use physcons, only : con_g, con_cp, con_avgd, con_amd, & + & con_amw, con_amo3 use mersenne_twister, only : random_setseed, random_number, & & random_stat !mz @@ -319,8 +320,8 @@ module rrtmg_lw real (kind=kind_phys), parameter :: f_one = 1.0 ! ... atomic weights for conversion from mass to volume mixing ratios - ! real (kind=kind_phys), parameter :: amdw = con_amd/con_amw - ! real (kind=kind_phys), parameter :: amdo3 = con_amd/con_amo3 + real (kind=kind_phys), parameter :: amdw = con_amd/con_amw + real (kind=kind_phys), parameter :: amdo3 = con_amd/con_amo3 ! ... band indices integer, dimension(nbands) :: nspa, nspb @@ -384,9 +385,7 @@ module rrtmg_lw ! --- public accessable subprograms public rrtmg_lw_init, rrtmg_lw_run, rrtmg_lw_finalize, rlwinit - - real(kind=kind_phys), public :: con_g, con_cp, & - & con_avgd, con_amd, con_amw, con_amo3 + ! ================ contains @@ -424,8 +423,7 @@ end subroutine rrtmg_lw_init !> \section gen_lwrad RRTMG Longwave Radiation Scheme General Algorithm !> @{ subroutine rrtmg_lw_run & - & ( con_g,con_cp,con_avgd,con_amd,con_amw,con_amo3, & ! --- inputs - & plyr,plvl,tlyr,tlvl,qlyr,olyr,gasvmr_co2, gasvmr_n2o, & + & ( plyr,plvl,tlyr,tlvl,qlyr,olyr,gasvmr_co2, gasvmr_n2o, & ! --- inputs & gasvmr_ch4, gasvmr_o2, gasvmr_co, gasvmr_cfc11, & & gasvmr_cfc12, gasvmr_cfc22, gasvmr_ccl4, & & icseed,aeraod,aerssa,sfemis,sfgtmp, & @@ -615,12 +613,6 @@ subroutine rrtmg_lw_run & logical, intent(in) :: lprnt - real(kind=kind_phys),intent(in) :: con_g, con_cp, & - & con_avgd, con_amd, con_amw, con_amo3 - - - real (kind=kind_phys) :: amdw, amdo3 - real (kind=kind_phys), dimension(npts,nlp1), intent(in) :: plvl, & & tlvl real (kind=kind_phys), dimension(npts,nlay), intent(in) :: plyr, & @@ -775,9 +767,7 @@ subroutine rrtmg_lw_run & ! Initialize CCPP error handling variables errmsg = '' errflg = 0 - - amdw = con_amd/con_amw - amdo3 = con_amd/con_amo3 + !mz* ! For passing in cloud physical properties; cloud optics parameterized ! in RRTMG: @@ -8978,4 +8968,4 @@ end subroutine cldprmc !........................................!$ end module rrtmg_lw !$ -!========================================!$ +!========================================!$ \ No newline at end of file diff --git a/physics/radlw_main.meta b/physics/radlw_main.meta index 5770a8815..9b2eae7b6 100644 --- a/physics/radlw_main.meta +++ b/physics/radlw_main.meta @@ -7,60 +7,6 @@ [ccpp-arg-table] name = rrtmg_lw_run type = scheme -[con_g] - standard_name = gravitational_acceleration - long_name = gravitational acceleration - units = m s-2 - dimensions = () - type = real - kind = kind_phys - intent = in - optional = F -[con_cp] - standard_name = specific_heat_of_dry_air_at_constant_pressure - long_name = specific heat of dry air at constant pressure - units = J kg-1 K-1 - dimensions = () - type = real - kind = kind_phys - intent = in - optional = F -[con_avgd] - standard_name = avogadro_constant - long_name = avogadro constant - units = mol-1 - dimensions = () - type = real - kind = kind_phys - intent = in - optional = F -[con_amd] - standard_name = molecular_weight_of_dry_air - long_name = molecular weight of dry air - units = g mol-1 - dimensions = () - type = real - kind = kind_phys - intent = in - optional = F -[con_amw] - standard_name = molecular_weight_of_water_vapor - long_name = molecular weight of water vapor - units = g mol-1 - dimensions = () - type = real - kind = kind_phys - intent = in - optional = F -[con_amo3] - standard_name = molecular_weight_of_o3 - long_name = molecular weight of o3 - units = g mol-1 - dimensions = () - type = real - kind = kind_phys - intent = in - optional = F [plyr] standard_name = air_pressure_at_layer_for_radiation_in_hPa long_name = air pressure layer @@ -456,4 +402,4 @@ dimensions = () type = integer intent = out - optional = F + optional = F \ No newline at end of file From 3ba9d4dd6b39f2a4cd542c8bd45b7d330dd48850 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Thu, 29 Jul 2021 16:33:12 -0600 Subject: [PATCH 20/21] Fix merge conflicts --- physics/dcyc2.f | 7 +++++-- physics/dcyc2.meta | 18 ++++++++++++++++++ physics/gscond.meta | 6 +++--- physics/m_micro.meta | 2 +- physics/module_MYNNPBL_wrapper.meta | 2 +- 5 files changed, 28 insertions(+), 7 deletions(-) diff --git a/physics/dcyc2.f b/physics/dcyc2.f index f1e24a0a8..8b311dc02 100644 --- a/physics/dcyc2.f +++ b/physics/dcyc2.f @@ -171,7 +171,8 @@ end subroutine dcyc2t3_finalize !> @{ subroutine dcyc2t3_run & ! --- inputs: - & ( solhr,slag,sdec,cdec,sinlat,coslat,con_pi,con_sbc, & + & ( solhr,slag,sdec,cdec,sinlat,coslat, & + & con_g, con_cp, con_pi, con_sbc, & & xlon,coszen,tsfc_lnd,tsfc_ice,tsfc_wat,tf,tsflw,tsfc, & & sfcemis_lnd, sfcemis_ice, sfcemis_wat, & & sfcdsw,sfcnsw,sfcdlw,swh,swhc,hlw,hlwc, & @@ -236,7 +237,9 @@ subroutine dcyc2t3_run & real(kind=kind_phys), dimension(:,:), intent(in) :: p_lev, & & flux2D_lwUP, flux2D_lwDOWN, fluxlwUP_jac, t_lev - real(kind_phys), intent(in ) :: con_pi, con_sbc + real(kind_phys), intent(in ) :: con_g, con_cp, & + & con_pi, con_sbc + real(kind_phys) :: pid12 diff --git a/physics/dcyc2.meta b/physics/dcyc2.meta index 26652729d..a65d5d451 100644 --- a/physics/dcyc2.meta +++ b/physics/dcyc2.meta @@ -79,6 +79,24 @@ kind = kind_phys intent = in optional = F +[con_g] + standard_name = gravitational_acceleration + long_name = gravitational acceleration + units = m s-2 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[con_cp] + standard_name = specific_heat_of_dry_air_at_constant_pressure + long_name = specific heat of dry air at constant pressure + units = J kg-1 K-1 + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F [con_pi] standard_name = pi long_name = ratio of a circle's circumference to its diameter diff --git a/physics/gscond.meta b/physics/gscond.meta index 8174f2019..202097825 100644 --- a/physics/gscond.meta +++ b/physics/gscond.meta @@ -183,8 +183,8 @@ intent = inout optional = F [psat] - standard_name = pres_at_H2O_3pt - long_name = pres_at_H2O_3pt + standard_name = saturation_pressure_at_triple_point_of_water + long_name = saturation pressure at triple point of water units = Pa dimensions = () type = real @@ -228,7 +228,7 @@ intent = in optional = F [rd] - standard_name = gas_constant_dry_air + standard_name = gas_constant_of_dry_air long_name = ideal gas constant for dry air units = J kg-1 K-1 dimensions = () diff --git a/physics/m_micro.meta b/physics/m_micro.meta index 0f2bc890b..6bda8cec0 100644 --- a/physics/m_micro.meta +++ b/physics/m_micro.meta @@ -363,7 +363,7 @@ intent = in optional = F [rgas] - standard_name = gas_constant_dry_air + standard_name = gas_constant_of_dry_air long_name = ideal gas constant for dry air units = J kg-1 K-1 dimensions = () diff --git a/physics/module_MYNNPBL_wrapper.meta b/physics/module_MYNNPBL_wrapper.meta index a3363ad86..e88975aff 100644 --- a/physics/module_MYNNPBL_wrapper.meta +++ b/physics/module_MYNNPBL_wrapper.meta @@ -96,7 +96,7 @@ intent = in optional = F [r_d] - standard_name = gas_constant_dry_air + standard_name = gas_constant_of_dry_air long_name = ideal gas constant for dry air units = J kg-1 K-1 dimensions = () From 4fa6a3bef55798cf23a092fce1f51053fc42f01a Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Mon, 2 Aug 2021 09:41:04 -0600 Subject: [PATCH 21/21] Initialize MG constants in init phase, adjust formatting in gscond.f --- physics/aerclm_def.F | 2 +- physics/gscond.f | 24 +++---- physics/m_micro.F90 | 67 ++++++++++++-------- physics/m_micro.meta | 145 ++++++++++++++----------------------------- 4 files changed, 96 insertions(+), 142 deletions(-) diff --git a/physics/aerclm_def.F b/physics/aerclm_def.F index 3862aa1b1..157c7b961 100644 --- a/physics/aerclm_def.F +++ b/physics/aerclm_def.F @@ -1,7 +1,7 @@ module aerclm_def use machine , only : kind_phys implicit none - + integer, parameter :: levsaer=72, ntrcaerm=15, timeaer=12 integer :: latsaer, lonsaer, ntrcaer, levsw diff --git a/physics/gscond.f b/physics/gscond.f index f36de0209..8756bc320 100644 --- a/physics/gscond.f +++ b/physics/gscond.f @@ -122,14 +122,10 @@ subroutine zhaocarr_gscond_run (im,km,dt,dtf,prsl,ps,q,clw1 & integer, intent(out) :: errflg ! ! Local variables - real (kind=kind_phys) h1 - &, d00, elwv, eliv - &, epsq - &, r, cpr, rcp - - parameter (h1=1.e0, d00=0.e0 & - &, epsq=2.e-12) - + real (kind=kind_phys) h1, d00, elwv, eliv + &, epsq, r, cpr, rcp +! + parameter (h1=1.e0, d00=0.e0, epsq=2.e-12) ! real(kind=kind_phys), parameter :: cons_0=0.0, cons_m15=-15.0 ! @@ -157,15 +153,13 @@ subroutine zhaocarr_gscond_run (im,km,dt,dtf,prsl,ps,q,clw1 & enddo !-----------------prepare constants for later uses----------------- ! - elwv=hvap - eliv=hvap+hfus - r=rd - cpr=cp*r - rcp=h1/cp - + elwv = hvap + eliv = hvap+hfus + r = rd + cpr = cp*r + rcp = h1/cp el2orc = hvap*hvap / (rv*cp) albycp = hvap / cp -! write(0,*)' in gscond im=',im ! rdt = h1/dt us = h1 diff --git a/physics/m_micro.F90 b/physics/m_micro.F90 index 51ce44d7f..15e30b0a6 100644 --- a/physics/m_micro.F90 +++ b/physics/m_micro.F90 @@ -7,11 +7,26 @@ !> This module contains the CCPP-compliant Morrison-Gettelman microphysics (MG1, MG2 and MG3) scheme. module m_micro + use machine, only: kind_phys + implicit none public :: m_micro_init, m_micro_run, m_micro_finalize private logical :: is_initialized = .False. + real, parameter :: one = 1.0_kind_phys, & + oneb3 = one/3.0_kind_phys, & + zero = 0.0_kind_phys, & + half = 0.5_kind_phys, & + qsmall = 1.0e-14_kind_phys, & + fourb3 = 4.0_kind_phys/3.0_kind_phys, & + RL_cub = 1.0e-15_kind_phys, & + nmin = 1.0_kind_phys + + real(kind=kind_phys) :: grav, pi, rgas, cp, hvap, hfus, ttp, & + tice, eps, epsm1, VIREPS, onebcp, onebg, & + kapa, cpbg, lvbcp, lsbcp + contains !> This subroutine is the MG initialization. @@ -19,7 +34,8 @@ module m_micro !! \htmlinclude m_micro_init.html !! subroutine m_micro_init(imp_physics, imp_physics_mg, fprcp, gravit, rair, rh2o, cpair,& - eps, tmelt, latvap, latice, mg_dcs, mg_qcvar, mg_ts_auto_ice, & + eps_in, epsm1_in, tmelt, latvap, latice, pi_in, tice_in, & + VIREPS_in, mg_dcs, mg_qcvar, mg_ts_auto_ice, & mg_rhmini, microp_uniform, do_cldice, hetfrz_classnuc, & mg_precip_frac_method, mg_berg_eff_factor, sed_supersat, & do_sb_physics, mg_do_hail, mg_do_graupel, mg_nccons, & @@ -37,7 +53,8 @@ subroutine m_micro_init(imp_physics, imp_physics_mg, fprcp, gravit, rair, rh2o, sed_supersat, do_sb_physics, mg_do_hail, & mg_do_graupel, mg_nccons, mg_nicons, mg_ngcons, & mg_do_ice_gmao, mg_do_liq_liu - real(kind=kind_phys), intent(in) :: gravit, rair, rh2o, cpair, eps, tmelt, latvap, latice + real(kind=kind_phys), intent(in) :: gravit, rair, rh2o, cpair, eps_in, epsm1_in, & + tmelt, latvap, latice, pi_in, tice_in, VIREPS_in real(kind=kind_phys), intent(in) :: mg_dcs, mg_qcvar, mg_ts_auto_ice(:), mg_rhmini, & mg_berg_eff_factor, mg_ncnst, mg_ninst, mg_ngnst character(len=16), intent(in) :: mg_precip_frac_method @@ -55,6 +72,25 @@ subroutine m_micro_init(imp_physics, imp_physics_mg, fprcp, gravit, rair, rh2o, return end if + ! Assign constants + grav = gravit + pi = pi_in + rgas = rair + cp = cpair + hvap = latvap + hfus = latice + ttp = tmelt + tice = tice_in + eps = eps_in + epsm1 = epsm1_in + VIREPS = VIREPS_in + onebcp = one/cp + onebg = one/grav + kapa = rgas*onebcp + cpbg = cp/grav + lvbcp = hvap*onebcp + lsbcp = (hvap+hfus)*onebcp + if (fprcp <= 0) then call ini_micro (mg_dcs, mg_qcvar, mg_ts_auto_ice(1)) elseif (fprcp == 1) then @@ -108,9 +144,6 @@ end subroutine m_micro_finalize !>\section detail_m_micro_run MG m_micro_run Detailed Algorithm !> @{ subroutine m_micro_run( im, lm, flipv, dt_i & - &, grav, pi, rgas, cp & - &, hvap, hfus, ttp, tice & - &, eps, epsm1, VIREPS & &, prsl_i, prsi_i, phil, phii & &, omega_i, QLLS_i, QLCN_i, QILS_i, QICN_i& &, lwheat_i, swheat_i, w_upi, cf_upi & @@ -124,15 +157,13 @@ subroutine m_micro_run( im, lm, flipv, dt_i & &, qgl_io, ncpr_io, ncps_io, ncgl_io & &, CLLS_io, KCBL, rainmin & &, CLDREFFL, CLDREFFI, CLDREFFR, CLDREFFS & - &, CLDREFFG, aerfld_i & + &, CLDREFFG, ntrcaer, aerfld_i & &, naai_i, npccn_i, iccn & &, skip_macro & &, alf_fac, qc_min, pdfflag & &, kdt, xlat, xlon, rhc_i, & & errmsg, errflg) - use machine , only: kind_phys - ! use funcphys, only: fpvs !< saturation vapor pressure for water-ice mixed ! use funcphys, only: fpvsl, fpvsi, fpvs !< saturation vapor pressure for water,ice & mixed use aer_cloud, only: AerProps, getINsubset,init_aer, & @@ -142,8 +173,6 @@ subroutine m_micro_run( im, lm, flipv, dt_i & 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 - ! DH* TODO - make this an input argument, no cross-import! - use aerclm_def, only: ntrcaer ! use wv_saturation, only: aqsat @@ -160,17 +189,10 @@ subroutine m_micro_run( im, lm, flipv, dt_i & ! input ! real, parameter :: r_air = 3.47d-3 integer, parameter :: kp = kind_phys - real(kind=kind_phys), intent(in ) :: rainmin, grav, pi, rgas, cp, & - & hvap, hfus, ttp, tice, eps, epsm1, VIREPS + real(kind=kind_phys), intent(in ) :: rainmin - real, parameter :: one=1.0_kp, oneb3=one/3.0_kp, & - zero=0.0_kp, half=0.5_kp, & - & qsmall=1.0e-14_kp, & - & fourb3=4.0_kp/3.0_kp, RL_cub=1.0e-15_kp, & - & nmin=1.0_kp - real(kind=kind_phys) :: onebcp, onebg, kapa, cpbg, lvbcp, lsbcp integer, parameter :: ncolmicro = 1 - integer,intent(in) :: im, lm, kdt, fprcp, pdfflag, iccn + integer,intent(in) :: im, lm, kdt, fprcp, pdfflag, iccn, ntrcaer logical,intent(in) :: flipv, skip_macro real (kind=kind_phys), intent(in):: dt_i, alf_fac, qc_min(:) @@ -394,13 +416,6 @@ subroutine m_micro_run( im, lm, flipv, dt_i & ipr = 1 ! rhr8 = 1.0 - - onebcp=one/cp - onebg=one/grav - kapa=rgas*onebcp - cpbg=cp/grav - lvbcp=hvap*onebcp - lsbcp=(hvap+hfus)*onebcp if(flipv) then DO K=1, LM diff --git a/physics/m_micro.meta b/physics/m_micro.meta index 6bda8cec0..8a51a6ec6 100644 --- a/physics/m_micro.meta +++ b/physics/m_micro.meta @@ -67,7 +67,7 @@ kind = kind_phys intent = in optional = F -[eps] +[eps_in] standard_name = ratio_of_dry_air_to_water_vapor_gas_constants long_name = rd/rv units = none @@ -76,6 +76,15 @@ kind = kind_phys intent = in optional = F +[epsm1_in] + standard_name = ratio_of_dry_air_to_water_vapor_gas_constants_minus_one + long_name = (rd/rv) - 1 + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F [tmelt] standard_name = triple_point_temperature_of_water long_name = triple point temperature of water @@ -103,6 +112,33 @@ kind = kind_phys intent = in optional = F +[pi_in] + standard_name = pi + long_name = ratio of a circle's circumference to its diameter + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[tice_in] + standard_name = temperature_at_zero_celsius + long_name = temperature at 0 degree Celsius + units = K + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F +[VIREPS_in] + standard_name = ratio_of_vapor_to_dry_air_gas_constants_minus_one + long_name = (rv/rd) - 1 (rv = ideal gas constant for water vapor) + units = none + dimensions = () + type = real + kind = kind_phys + intent = in + optional = F [mg_dcs] standard_name = autoconverion_to_snow_size_threshold long_name = autoconversion size threshold for cloud ice to snow for MG microphysics @@ -344,105 +380,6 @@ kind = kind_phys intent = in optional = F -[grav] - standard_name = gravitational_acceleration - long_name = gravitational acceleration - units = m s-2 - dimensions = () - type = real - kind = kind_phys - intent = in - optional = F -[pi] - standard_name = pi - long_name = ratio of a circle's circumference to its diameter - units = none - dimensions = () - type = real - kind = kind_phys - intent = in - optional = F -[rgas] - standard_name = gas_constant_of_dry_air - long_name = ideal gas constant for dry air - units = J kg-1 K-1 - dimensions = () - type = real - kind = kind_phys - intent = in - optional = F -[cp] - standard_name = specific_heat_of_dry_air_at_constant_pressure - long_name = specific heat of dry air at constant pressure - units = J kg-1 K-1 - dimensions = () - type = real - kind = kind_phys - intent = in - optional = F -[hvap] - standard_name = latent_heat_of_vaporization_of_water_at_0C - long_name = latent heat of evaporation/sublimation - units = J kg-1 - dimensions = () - type = real - kind = kind_phys - intent = in - optional = F -[hfus] - standard_name = latent_heat_of_fusion_of_water_at_0C - long_name = latent heat of fusion - units = J kg-1 - dimensions = () - type = real - kind = kind_phys - intent = in - optional = F -[ttp] - standard_name = triple_point_temperature_of_water - long_name = triple point temperature of water - units = K - dimensions = () - type = real - kind = kind_phys - intent = in - optional = F -[tice] - standard_name = temperature_at_zero_celsius - long_name = temperature at 0 degree Celsius - units = K - dimensions = () - type = real - kind = kind_phys - intent = in - optional = F -[eps] - standard_name = ratio_of_dry_air_to_water_vapor_gas_constants - long_name = rd/rv - units = none - dimensions = () - type = real - kind = kind_phys - intent = in - optional = F -[epsm1] - standard_name = ratio_of_dry_air_to_water_vapor_gas_constants_minus_one - long_name = (rd/rv) - 1 - units = none - dimensions = () - type = real - kind = kind_phys - intent = in - optional = F -[VIREPS] - standard_name = ratio_of_vapor_to_dry_air_gas_constants_minus_one - long_name = (rv/rd) - 1 (rv = ideal gas constant for water vapor) - units = none - dimensions = () - type = real - kind = kind_phys - intent = in - optional = F [prsl_i] standard_name = air_pressure long_name = layer mean pressure @@ -882,6 +819,14 @@ kind = kind_phys intent = out optional = F +[ntrcaer] + standard_name = number_of_aerosol_tracers_MG + long_name = number of aerosol tracers for Morrison Gettelman MP + units = count + dimensions = () + type = integer + intent = in + optional = F [aerfld_i] standard_name = mass_number_concentration_of_aerosol_from_gocart_climatology long_name = GOCART aerosol climatology number concentration