Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Microphysics tuning PR #177

Draft
wants to merge 56 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
7b39eb3
Change saturation
nbren12 Mar 5, 2021
52118a1
Another suggestion of Linjiongs
nbren12 Mar 5, 2021
7a2b2b4
Decrease even further
nbren12 Mar 5, 2021
1015da4
Revert "Decrease even further"
nbren12 Mar 5, 2021
e40c856
Revert "Another suggestion of Linjiongs"
nbren12 Mar 5, 2021
3a38a38
Revert "Change saturation"
nbren12 Mar 5, 2021
2b5aab2
Reduce rh dependent factor
nbren12 Mar 5, 2021
f038d35
Change auto-conversion temperature threshold
nbren12 Mar 9, 2021
36a1782
nix: build fv3 with nix
nbren12 Mar 17, 2021
b5f1bf4
Repair bug in CI
nbren12 Mar 17, 2021
7367c7a
Use cachix in circle build
nbren12 Mar 17, 2021
5fd19bc
Push to specified cache
nbren12 Mar 17, 2021
9efbbe1
Run tests in nix CircleCI builds
nbren12 Mar 17, 2021
c33d481
Fix nix-build calls
nbren12 Mar 17, 2021
21e6049
Make rudimentary test
nbren12 Mar 17, 2021
5905866
Attempt repair of nix-mac
nbren12 Mar 17, 2021
f12f6d7
Fix again
nbren12 Mar 17, 2021
af37ac0
Delete install script
nbren12 Mar 17, 2021
ed62097
Revert dockerfile and test cahnge
nbren12 Mar 17, 2021
9425de0
Remove unused file
nbren12 Mar 17, 2021
fd1fbce
Cleanup unused code
nbren12 Mar 17, 2021
a15d2b8
Use vulcanclimatemodeling cachix
nbren12 Mar 17, 2021
49d7378
Google auth for mac builds
nbren12 Mar 17, 2021
c5222a5
Delete unused file
nbren12 Mar 17, 2021
1b12883
Document the nix workflow
nbren12 Mar 17, 2021
df00733
More doc
nbren12 Mar 17, 2021
be810c4
Make it clear that cachix is optional
nbren12 Mar 17, 2021
c709d7f
Better docs
nbren12 Mar 17, 2021
f4a6a9d
Comment on tox test
nbren12 Mar 17, 2021
61a260e
Revert change to configure.fv3
nbren12 Mar 17, 2021
7518318
Revert "Change auto-conversion temperature threshold"
Mar 18, 2021
8d097ee
Revise the cloud ice deposition and sublimation process.
linjiongzhou Mar 18, 2021
7e613f2
fv_cmp.f90: workaround reference to qi_gen
Mar 18, 2021
d8a36b3
microphysics: enhance effect of qi_lim
Mar 18, 2021
9abeb39
nix: big sur mac builds
nbren12 Mar 19, 2021
c626c0b
Update README.md
nbren12 Mar 19, 2021
420a84a
Merge branch 'feature/nix-rebased' into mp-changes-1
nbren12 Mar 19, 2021
7093a56
microphysics: reduce cloud ice sublimation
nbren12 Mar 19, 2021
50eaf72
cloud-ice: new tuning parameter
nbren12 Mar 19, 2021
7560e45
Merge branch 'master' into mp-changes-1
nbren12 Mar 30, 2021
297922e
Revert "Revise the cloud ice deposition and sublimation process."
nbren12 Mar 30, 2021
4dc5a74
microphysics: simplify ice-->vapor transition rate
nbren12 Mar 30, 2021
cd7dddd
microphysics: parameterize water-vapor transition
nbren12 Mar 30, 2021
9ec1005
microphysics: remove limits on h_var magnitude
nbren12 Mar 30, 2021
f1a238d
microphysics: delete another limiter
nbren12 Mar 30, 2021
09ef08d
Revert "microphysics: delete another limiter"
nbren12 Mar 30, 2021
3fcf3c1
Revert "microphysics: remove limits on h_var magnitude"
nbren12 Mar 30, 2021
691cffe
Remove the changes in fv_cmp.F90.
linjiongzhou Mar 31, 2021
9816047
Add the RH factor to the rain evaporation.
linjiongzhou Mar 31, 2021
396a274
microphysics: parameterize sublimation processes
nbren12 Apr 5, 2021
dcee278
add graupel deposition parameter
nbren12 Apr 12, 2021
73f87fc
Parameterize convective trigger thresholds
nbren12 Apr 22, 2021
8eae741
revert rain evaporation factor change
nbren12 May 4, 2021
87fe79a
Revert "revert rain evaporation factor change"
nbren12 May 12, 2021
674dd11
deep conv: parameterize cinarcmn
nbren12 May 28, 2021
2caa879
deep conv: add timescale_grid_factor parameter
nbren12 May 28, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 11 additions & 19 deletions FV3/conf/configure.fv3
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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 :=
Expand All @@ -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)
Expand All @@ -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)
4 changes: 3 additions & 1 deletion FV3/gfsphysics/GFS_layer/GFS_physics_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 17 additions & 1 deletion FV3/gfsphysics/GFS_layer/GFS_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
32 changes: 23 additions & 9 deletions FV3/gfsphysics/physics/gfdl_cloud_microphys.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
! -----------------------------------------------------------------------
Expand All @@ -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, &
Expand All @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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
! -----------------------------------------------------------------------
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions FV3/gfsphysics/physics/samfdeepcnv.f
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
!
Expand Down Expand Up @@ -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)
Expand Down