Skip to content

Commit

Permalink
deep conv: parameterize cinarcmn
Browse files Browse the repository at this point in the history
  • Loading branch information
nbren12 committed May 28, 2021
1 parent 87fe79a commit 0d3a251
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 22 deletions.
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)
2 changes: 1 addition & 1 deletion FV3/gfsphysics/GFS_layer/GFS_physics_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3595,7 +3595,7 @@ subroutine GFS_physics_driver &
Model%c1_deep, Model%betal_deep, Model%betas_deep, &
Model%evfact_deep, Model%evfactl_deep, &
Model%pgcon_deep, Model%asolfac_deep,&
Model%cinpcrmx, Model%cinpcrmn)
Model%cinpcrmx, Model%cinpcrmn, Model%cinacrmn)
! if (lprnt) print *,' rain1=',rain1(ipr)
!elseif (Model%imfdeepcnv == 3) then
! if (Model%me==0) then
Expand Down
3 changes: 3 additions & 0 deletions FV3/gfsphysics/GFS_layer/GFS_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,7 @@ module GFS_typedefs
!--- mass flux deep convection
real(kind=kind_phys) :: cinpcrmx
real(kind=kind_phys) :: cinpcrmn
real(kind=kind_phys) :: cinacrmn
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 @@ -3129,6 +3130,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
! convection parameterization
real(kind=kind_phys) :: cinpcrmx = 180.0
real(kind=kind_phys) :: cinpcrmn = 120.0
real(kind=kind_phys) :: cinacrmn = -120.0

!--- aerosol scavenging factors
character(len=20) :: fscav_aero(20) = 'default'
Expand Down Expand Up @@ -3611,6 +3613,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
!--- mass flux deep convection
Model%cinpcrmn = cinpcrmn
Model%cinpcrmx = cinpcrmx
Model%cinacrmn = cinacrmn
Model%clam_deep = clam_deep
Model%c0s_deep = c0s_deep
Model%c1_deep = c1_deep
Expand Down
4 changes: 2 additions & 2 deletions FV3/gfsphysics/physics/samfdeepcnv.f
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ subroutine samfdeepcnv(im,ix,km,delt,itc,ntc,ntk,ntr,delp,
! & 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,
& cinpcrmx, cinpcrmn)
& cinpcrmx, cinpcrmn, cinacrmn)
!
use machine , only : kind_phys
use funcphys , only : fpvs
Expand Down Expand Up @@ -213,7 +213,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(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

0 comments on commit 0d3a251

Please sign in to comment.