diff --git a/FV3/conf/configure.fv3 b/FV3/conf/configure.fv3 index b941f6b98..1eb218ca0 100644 --- a/FV3/conf/configure.fv3 +++ b/FV3/conf/configure.fv3 @@ -2,10 +2,13 @@ ############ # commands # ############ -FC = FC=gfortran mpifort -CC = CC=gcc mpicc +SHELL = bash +FC = mpif90 +CC = mpicc CXX = g++ -LD = mpifort +LD = mpif90 +CPP = cpp + NETCDF_DIR = /usr @@ -36,7 +39,7 @@ $(error Need at least make version $(need). Load module gmake/3.81) endif NETCDF_ROOT = $(NETCDF_DIR) -INCLUDE = -I$(NETCDF_ROOT)/include +INCLUDE ?= -I$(NETCDF_ROOT)/include FPPFLAGS := -cpp -Wp,-w $(INCLUDE) -fPIC CFLAGS := $(INCLUDE) -fPIC @@ -46,10 +49,6 @@ FFLAGS := $(INCLUDE) -fcray-pointer -ffree-line-length-none -fno-range-check -fP CPPDEFS += -Duse_libMPI -Duse_netCDF -DSPMD -DUSE_LOG_DIAG_FIELD_INFO -Duse_LARGEFILE -DUSE_GFSL63 -DGFS_PHYS -DNO_INLINE_POST CPPDEFS += -DNEW_TAUCTMAX -DINTERNAL_FILE_NML -ifeq ($(GT4PY_DEV),Y) -CPPDEFS += -DGT4PY_DEV -endif - ifeq ($(HYDRO),Y) CPPDEFS += else @@ -70,7 +69,6 @@ endif FFLAGS_OPT = -O2 FFLAGS_REPRO = -O2 -g -fbacktrace FFLAGS_DEBUG = -O0 -g -fbacktrace -fno-fast-math -ffree-line-length-none -fno-backslash -pedantic -Waliasing -Wampersand -Wline-truncation -Wsurprising -Wtabs -Wunderflow -fdump-core -ffpe-trap=invalid,zero,overflow -fbounds-check -finit-real=nan -finit-integer=9999999 -finit-logical=true -finit-character=35 -FFLAGS_GCOV = --coverage TRANSCENDENTALS := -fast-transcendentals FFLAGS_OPENMP = -fopenmp @@ -82,17 +80,15 @@ CFLAGS_OPT = -O2 CFLAGS_REPRO = -O2 CFLAGS_OPENMP = -fopenmp CFLAGS_DEBUG = -O0 -g -CFLAGS_GCOV = --coverage # Optional Testing compile flags. Mutually exclusive from DEBUG, REPRO, and OPT # *_TEST will match the production if no new option(s) is(are) to be tested. FFLAGS_TEST = -O3 -debug minimal -fp-model source -qoverride-limits CFLAGS_TEST = -O2 -LDFLAGS := -L${ESMF_DIR}/lib/libO3/Linux.gfortran.64.mpiuni.default/ -L${FMS_DIR}/libFMS/.libs/ +#LDFLAGS := -L${ESMF_DIR}/lib/libO3/Darwin.gfortran.64.mpiuni.default/ -L${FMS_DIR}/libFMS/.libs/ LDFLAGS_OPENMP := -fopenmp LDFLAGS_VERBOSE := -Wl,-V,--verbose,-cref,-M -LDFLAGS_GCOV = --coverage # start with blank LIBS LIBS := @@ -117,12 +113,6 @@ FFLAGS += $(FFLAGS_OPT) FAST := $(TRANSCENDENTALS) endif -ifneq ($(GCOV),) -CFLAGS += $(CFLAGS_GCOV) -FFLAGS += $(FFLAGS_GCOV) -LDFLAGS += $(LDFLAGS_GCOV) -endif - ifneq ($(OPENMP),) CFLAGS += $(CFLAGS_OPENMP) FFLAGS += $(FFLAGS_OPENMP) @@ -138,6 +128,8 @@ FFLAGS += $(FFLAGS_VERBOSE) LDFLAGS += $(LDFLAGS_VERBOSE) endif -LIBS += -lFMS -lesmf -lnetcdff -lnetcdf -llapack -lblas -lc -lrt +# static linking of esmf works on darwin +#LIBS += -lFMS -lnetcdff -lnetcdf -llapack -lblas ${ESMF_DIR}/lib/libesmf.a -lstdc++ #-lc -lrt +LIBS += -lFMS -lnetcdff -lnetcdf -llapack -lblas -lesmf #-lc -lrt LDFLAGS += $(LIBS) diff --git a/FV3/gfsphysics/GFS_layer/GFS_physics_driver.F90 b/FV3/gfsphysics/GFS_layer/GFS_physics_driver.F90 index b5700764c..68012e23f 100644 --- a/FV3/gfsphysics/GFS_layer/GFS_physics_driver.F90 +++ b/FV3/gfsphysics/GFS_layer/GFS_physics_driver.F90 @@ -3594,7 +3594,9 @@ subroutine GFS_physics_driver & Model%clam_deep, Model%c0s_deep, & Model%c1_deep, Model%betal_deep, Model%betas_deep, & Model%evfact_deep, Model%evfactl_deep, & - Model%pgcon_deep, Model%asolfac_deep) + Model%pgcon_deep, Model%asolfac_deep,& + Model%cinpcrmx, Model%cinpcrmn, Model%cinacrmn,& + Model%timescale_grid_factor) ! if (lprnt) print *,' rain1=',rain1(ipr) !elseif (Model%imfdeepcnv == 3) then ! if (Model%me==0) then diff --git a/FV3/gfsphysics/GFS_layer/GFS_typedefs.F90 b/FV3/gfsphysics/GFS_layer/GFS_typedefs.F90 index 54e6c10ce..865534f35 100644 --- a/FV3/gfsphysics/GFS_layer/GFS_typedefs.F90 +++ b/FV3/gfsphysics/GFS_layer/GFS_typedefs.F90 @@ -892,6 +892,10 @@ module GFS_typedefs real(kind=kind_phys) :: ral_ts !< time scale for Rayleigh damping in days !--- mass flux deep convection + real(kind=kind_phys) :: cinpcrmx + real(kind=kind_phys) :: cinpcrmn + real(kind=kind_phys) :: cinacrmn + real(kind=kind_phys) :: timescale_grid_factor real(kind=kind_phys) :: clam_deep !< c_e for deep convection (Han and Pan, 2011, eq(6)) real(kind=kind_phys) :: c0s_deep !< convective rain conversion parameter real(kind=kind_phys) :: c1_deep !< conversion parameter of detrainment from liquid water into grid-scale cloud water @@ -3124,6 +3128,12 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & real(kind=kind_phys) :: pertalb = -999. real(kind=kind_phys) :: pertvegf = -999. +! convection parameterization + real(kind=kind_phys) :: cinpcrmx = 180.0 + real(kind=kind_phys) :: cinpcrmn = 120.0 + real(kind=kind_phys) :: cinacrmn = -120.0 + real(kind=kind_phys) :: timescale_grid_factor = 1.33333e-05 + !--- aerosol scavenging factors character(len=20) :: fscav_aero(20) = 'default' @@ -3221,7 +3231,9 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !--- aerosol scavenging factors ('name:value' string array) fscav_aero, & sst_perturbation, & - override_surface_radiative_fluxes, use_climatological_sst + override_surface_radiative_fluxes, use_climatological_sst, & + cinpcrmx, cinpcrmn, cinacrmn, timescale_grid_factor + !--- other parameters integer :: nctp = 0 !< number of cloud types in CS scheme @@ -3601,6 +3613,10 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%ral_ts = ral_ts !--- mass flux deep convection + Model%cinpcrmn = cinpcrmn + Model%cinpcrmx = cinpcrmx + Model%cinacrmn = cinacrmn + Model%timescale_grid_factor = timescale_grid_factor Model%clam_deep = clam_deep Model%c0s_deep = c0s_deep Model%c1_deep = c1_deep diff --git a/FV3/gfsphysics/physics/gfdl_cloud_microphys.F90 b/FV3/gfsphysics/physics/gfdl_cloud_microphys.F90 index 9a1820465..68831e8ec 100644 --- a/FV3/gfsphysics/physics/gfdl_cloud_microphys.F90 +++ b/FV3/gfsphysics/physics/gfdl_cloud_microphys.F90 @@ -304,6 +304,15 @@ module gfdl_cloud_microphys_mod real :: resmin = 150.0, resmax = 10000.0 real :: regmin = 300.0, regmax = 10000.0 + ! Linjiong-Noah custom tunining parameters + ! TODO give these better names + real :: ice_sublimation_factor = 0.2 + real :: snow_sublimation_factor = 0.2 + real :: graupel_sublimation_factor = 0.1 + real :: graupel_deposition_factor = 0.2 + real :: rh_factor = 10.0 + real :: re_factor = 100.0 + ! ----------------------------------------------------------------------- ! namelist ! ----------------------------------------------------------------------- @@ -320,7 +329,9 @@ module gfdl_cloud_microphys_mod rad_snow, rad_graupel, rad_rain, cld_min, use_ppm, mono_prof, & do_sedi_heat, sedi_transport, do_sedi_w, de_ice, icloud_f, irain_f, & mp_print, reiflag, rewmin, rewmax, reimin, reimax, rermin, rermax, & - resmin, resmax, regmin, regmax, tintqs + resmin, resmax, regmin, regmax, tintqs, rh_factor, re_factor, & + snow_sublimation_factor, ice_sublimation_factor, & + graupel_sublimation_factor, graupel_deposition_factor public & mp_time, t_min, t_sub, tau_r2g, tau_smlt, tau_g2r, dw_land, dw_ocean, & @@ -334,7 +345,9 @@ module gfdl_cloud_microphys_mod rad_snow, rad_graupel, rad_rain, cld_min, use_ppm, mono_prof, & do_sedi_heat, sedi_transport, do_sedi_w, de_ice, icloud_f, irain_f, & mp_print, reiflag, rewmin, rewmax, reimin, reimax, rermin, rermax, & - resmin, resmax, regmin, regmax, tintqs + resmin, resmax, regmin, regmax, tintqs, rh_factor, re_factor, & + snow_sublimation_factor, ice_sublimation_factor, & + graupel_sublimation_factor, graupel_deposition_factor contains @@ -1327,7 +1340,7 @@ subroutine revap_racc (ktop, kbot, dt, tz, qv, ql, qr, qi, qs, qg, den, denfac, real, dimension (ktop:kbot) :: lhl, cvm, q_liq, q_sol, lcpk real :: dqv, qsat, dqsdt, evap, t2, qden, q_plus, q_minus, sink - real :: qpz, dq, dqh, tin + real :: qpz, dq, dqh, tin, factor integer :: k @@ -1377,7 +1390,8 @@ subroutine revap_racc (ktop, kbot, dt, tz, qv, ql, qr, qi, qs, qg, den, denfac, t2 = tin * tin evap = crevp (1) * t2 * dq * (crevp (2) * sqrt (qden) + crevp (3) * & exp (0.725 * log (qden))) / (crevp (4) * t2 + crevp (5) * qsat * den (k)) - evap = min (qr (k), dt * evap, dqv / (1. + lcpk (k) * dqsdt)) + factor = min (1., re_factor * dqv / qsat) + evap = min (qr (k), dt * evap, factor * dqv / (1. + lcpk (k) * dqsdt)) ! ----------------------------------------------------------------------- ! alternative minimum evap in dry environmental air ! sink = min (qr (k), dim (rh_rain * qsat, qv (k)) / (1. + lcpk (k) * dqsdt)) @@ -2083,7 +2097,7 @@ subroutine subgrid_z_proc (ktop, kbot, p1, den, denfac, dts, rh_adj, tz, qv, & ! factor = min (1., fac_l2v * sqrt (max (0., ql (k)) / 1.e-5) * 10. * dq0 / qsw) ! factor = fac_l2v ! factor = 1 - factor = min (1., fac_l2v * (10. * dq0 / qsw)) ! the rh dependent factor = 1 at 90% + factor = min (1., fac_l2v * (rh_factor * dq0 / qsw)) ! the rh dependent factor = 1 at 90% evap = min (ql (k), factor * dq0 / (1. + tcp3 (k) * dwsdt)) else ! condensate all excess vapor into cloud water ! ----------------------------------------------------------------------- @@ -2181,7 +2195,7 @@ subroutine subgrid_z_proc (ktop, kbot, p1, den, denfac, dts, rh_adj, tz, qv, & qi_crt = qi_gen * min (qi_lim, 0.1 * tmp) / den (k) sink = min (sink, max (qi_crt - qi (k), pidep), tmp / tcpk (k)) else ! ice -- > vapor - pidep = pidep * min (1., dim (tz (k), t_sub) * 0.2) + pidep = pidep * min (1., dim (tz (k), t_sub) * ice_sublimation_factor) sink = max (pidep, sink, - qi (k)) endif qv (k) = qv (k) - sink @@ -2216,7 +2230,7 @@ subroutine subgrid_z_proc (ktop, kbot, p1, den, denfac, dts, rh_adj, tz, qv, & sqrt (denfac (k))) / (cssub (4) * tsq + cssub (5) * qsi * den (k)) pssub = (qsi - qv (k)) * dts * pssub if (pssub > 0.) then ! qs -- > qv, sublimation - pssub = min (pssub * min (1., dim (tz (k), t_sub) * 0.2), qs (k)) + pssub = min (pssub * min (1., dim (tz (k), t_sub) * snow_sublimation_factor), qs (k)) else if (tz (k) > tice) then pssub = 0. ! no deposition @@ -2253,11 +2267,11 @@ subroutine subgrid_z_proc (ktop, kbot, p1, den, denfac, dts, rh_adj, tz, qv, & if (tz (k) > tice) then pgsub = 0. ! no deposition else - pgsub = min (fac_v2g * pgsub, 0.2 * dq, ql (k) + qr (k), & + pgsub = min (fac_v2g * pgsub, graupel_deposition_factor * dq, ql (k) + qr (k), & (tice - tz (k)) / tcpk (k)) endif else ! submilation - pgsub = max (fac_g2v * pgsub, dq) * min (1., dim (tz (k), t_sub) * 0.1) + pgsub = max (fac_g2v * pgsub, dq) * min (1., dim (tz (k), t_sub) * graupel_sublimation_factor) endif qg (k) = qg (k) + pgsub qv (k) = qv (k) - pgsub diff --git a/FV3/gfsphysics/physics/samfdeepcnv.f b/FV3/gfsphysics/physics/samfdeepcnv.f index 76204ebb4..cacbf5b87 100644 --- a/FV3/gfsphysics/physics/samfdeepcnv.f +++ b/FV3/gfsphysics/physics/samfdeepcnv.f @@ -86,7 +86,8 @@ subroutine samfdeepcnv(im,ix,km,delt,itc,ntc,ntk,ntr,delp, & QLCN, QICN, w_upi, cf_upi, CNV_MFD, ! & QLCN, QICN, w_upi, cf_upi, CNV_MFD, CNV_PRC3, & CNV_DQLDT,CLCN,CNV_FICE,CNV_NDROP,CNV_NICE,mp_phys, - & clam,c0s,c1,betal,betas,evfact,evfactl,pgcon,asolfac) + & clam,c0s,c1,betal,betas,evfact,evfactl,pgcon,asolfac, + & cinpcrmx, cinpcrmn, cinacrmn, timescale_grid_factor) ! use machine , only : kind_phys use funcphys , only : fpvs @@ -113,9 +114,11 @@ subroutine samfdeepcnv(im,ix,km,delt,itc,ntc,ntk,ntr,delp, & rn(im), cnvw(ix,km), cnvc(ix,km), & ud_mf(im,km),dd_mf(im,km), dt_mf(im,km) + + real(kind=kind_phys) timescale_grid_factor real(kind=kind_phys) clam, c0s, c1, & betal, betas, asolfac, - & evfact, evfactl, pgcon + & evfact, evfactl, pgcon, cinpcrmn, cinpcrmx ! !------local variables integer i, indx, jmn, k, kk, km1, n @@ -182,8 +185,7 @@ subroutine samfdeepcnv(im,ix,km,delt,itc,ntc,ntk,ntr,delp, ! real(kind=kind_phys) c0(im) cj - real(kind=kind_phys) cinpcr, cinpcrmx, cinpcrmn, - & cinacr, cinacrmx, cinacrmn + real(kind=kind_phys) cinpcr, cinacr, cinacrmx, cinacrmn cj ! ! parameters for updraft velocity calculation @@ -213,9 +215,7 @@ subroutine samfdeepcnv(im,ix,km,delt,itc,ntc,ntk,ntr,delp, parameter(dtke=tkemx-tkemn) parameter(dbeta=0.1) parameter(cthk=200.,dthk=25.) - parameter(cinpcrmx=180.,cinpcrmn=120.) -! parameter(cinacrmx=-120.,cinacrmn=-120.) - parameter(cinacrmx=-120.,cinacrmn=-80.) + parameter(cinacrmx=-120.) parameter(bet1=1.875,cd1=.506,f1=2.0,gam1=.5) parameter(betaw=.03,dxcrtas=8.e3,dxcrtuf=15.e3) ! @@ -2275,7 +2275,7 @@ subroutine samfdeepcnv(im,ix,km,delt,itc,ntc,ntk,ntr,delp, if(cnvflg(i)) then tem = zi(i,ktcon1(i)) - zi(i,kbcon1(i)) dtconv(i) = tem / wc(i) - tfac = 1. + gdx(i) / 75000. + tfac = 1. + timescale_grid_factor * gdx(i) dtconv(i) = tfac * dtconv(i) dtconv(i) = max(dtconv(i),dtmin) dtconv(i) = min(dtconv(i),dtmax)