From 0d3a251c98abb467d2927d96c9a614195fbbbad7 Mon Sep 17 00:00:00 2001 From: "Noah D. Brenowitz" Date: Fri, 28 May 2021 13:05:37 -0700 Subject: [PATCH] deep conv: parameterize cinarcmn --- FV3/conf/configure.fv3 | 30 +++++++------------ .../GFS_layer/GFS_physics_driver.F90 | 2 +- FV3/gfsphysics/GFS_layer/GFS_typedefs.F90 | 3 ++ FV3/gfsphysics/physics/samfdeepcnv.f | 4 +-- 4 files changed, 17 insertions(+), 22 deletions(-) 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 4784b0b4a..d53696059 100644 --- a/FV3/gfsphysics/GFS_layer/GFS_physics_driver.F90 +++ b/FV3/gfsphysics/GFS_layer/GFS_physics_driver.F90 @@ -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 diff --git a/FV3/gfsphysics/GFS_layer/GFS_typedefs.F90 b/FV3/gfsphysics/GFS_layer/GFS_typedefs.F90 index cdc414ef1..9038afd6c 100644 --- a/FV3/gfsphysics/GFS_layer/GFS_typedefs.F90 +++ b/FV3/gfsphysics/GFS_layer/GFS_typedefs.F90 @@ -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 @@ -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' @@ -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 diff --git a/FV3/gfsphysics/physics/samfdeepcnv.f b/FV3/gfsphysics/physics/samfdeepcnv.f index a15921719..66ae72935 100644 --- a/FV3/gfsphysics/physics/samfdeepcnv.f +++ b/FV3/gfsphysics/physics/samfdeepcnv.f @@ -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 @@ -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) !