Commit 5bef05f3 authored by Youngsung Kim's avatar Youngsung Kim
Browse files

added crm_main kernel

parent b4f5da0f
*.o
*.mod
# Makefile for KGEN-generated kernel
# Originally used compiler(s)
FC_0 := /sw/summit/xl/16.1.1-5/xlf/16.1.1/bin/.orig/xlf2008_r
#FC_0 := mpif90
#FC_FLAGS_SET_0 := -F/sw/summit/xl/16.1.1-5/xlf/16.1.1/etc/xlf.cfg.rhel.7.6.gcc.4.8.5.cuda.10.1 -g -qfullpath -qmaxmem=-1 -qphsinfo -qzerosize -qfree=f90 -qxlf2003=polymorphic -qspillsize=2500 -qextname=flush -qsuffix=f=f90:cpp=F90 -g -O2 -qoffload -qthreaded -D_MPI
FC_FLAGS_SET_0 := -F/sw/summit/xl/16.1.1-5/xlf/16.1.1/etc/xlf.cfg.rhel.7.6.gcc.4.8.5.cuda.10.1 -g -qfullpath -qmaxmem=-1 -qphsinfo -qzerosize -qfree=f90 -qxlf2003=polymorphic -qspillsize=2500 -qextname=flush -qsuffix=f=f90:cpp=F90 -g -O2 -qoffload -qthreaded
CC_0 := /sw/summit/xl/16.1.1-5/xlC/16.1.1/bin/xlc_r
ALL_OBJS := crm_module.o vars.o grid.o domain.o crmdims.o sgs.o scalar_momentum.o params.o microphysics.o cloud.o precip_init.o task_util_NOMPI.o precip_proc.o micro_params.o damping.o crm_output_module.o kurant.o abcoefs.o buoyancy.o crm_surface.o zero.o forcing.o ice_fall.o shr_const_mod.o shr_kind_mod.o boundaries.o periodic.o bound_exchange.o advection.o tke_full.o shear_prod3D.o shear_prod2D.o sat.o advect_mom.o advect2_mom_z.o advect2_mom_xy.o diffuse_mom.o diffuse_mom2D.o diffuse_mom3D.o diagnose.o uvw.o coriolis.o pressure.o fft.o press_rhs.o bound_duvdt.o press_grad.o adams.o advect_all_scalars.o advect_scalar.o advect_scalar2D.o advect_scalar3D.o diffuse_scalar.o diffuse_scalar3D.o diffuse_scalar2D.o accelerate_crm.o kernel_driver.o kgen_utils.o tprof_mod.o gammafff.o
build: ${ALL_OBJS}
${FC_0} ${FC_FLAGS_SET_0} -o kernel.exe $^
run: build
#mpirun -np 2 ./kernel.exe
./kernel.exe
crm_module.o: crm_module.F90 vars.o grid.o domain.o crmdims.o sgs.o scalar_momentum.o params.o microphysics.o cloud.o precip_init.o task_util_NOMPI.o precip_proc.o micro_params.o damping.o crm_output_module.o kurant.o abcoefs.o buoyancy.o crm_surface.o zero.o forcing.o ice_fall.o shr_const_mod.o shr_kind_mod.o boundaries.o periodic.o bound_exchange.o advection.o tke_full.o shear_prod3D.o shear_prod2D.o sat.o advect_mom.o advect2_mom_z.o advect2_mom_xy.o diffuse_mom.o diffuse_mom2D.o diffuse_mom3D.o diagnose.o uvw.o coriolis.o pressure.o fft.o press_rhs.o bound_duvdt.o press_grad.o adams.o advect_all_scalars.o advect_scalar.o advect_scalar2D.o advect_scalar3D.o diffuse_scalar.o diffuse_scalar3D.o diffuse_scalar2D.o accelerate_crm.o kgen_utils.o tprof_mod.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
vars.o: vars.F90 kgen_utils.o tprof_mod.o grid.o params.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
grid.o: grid.F90 kgen_utils.o tprof_mod.o domain.o params.o advection.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
domain.o: domain.F90 kgen_utils.o tprof_mod.o crmdims.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
crmdims.o: crmdims.F90 kgen_utils.o tprof_mod.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
sgs.o: sgs.F90 kgen_utils.o tprof_mod.o params.o grid.o tke_full.o vars.o diffuse_mom.o diffuse_scalar.o microphysics.o scalar_momentum.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
scalar_momentum.o: scalar_momentum.F90 kgen_utils.o tprof_mod.o params.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
params.o: params.F90 kgen_utils.o tprof_mod.o shr_const_mod.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
microphysics.o: microphysics.F90 kgen_utils.o tprof_mod.o params.o vars.o micro_params.o grid.o precip_init.o cloud.o precip_proc.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
cloud.o: cloud.F90 kgen_utils.o tprof_mod.o micro_params.o vars.o params.o sat.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
precip_init.o: precip_init.F90 kgen_utils.o tprof_mod.o micro_params.o vars.o task_util_NOMPI.o sat.o params.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
task_util_NOMPI.o: task_util_NOMPI.F90 kgen_utils.o tprof_mod.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
precip_proc.o: precip_proc.F90 kgen_utils.o tprof_mod.o micro_params.o vars.o sat.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
micro_params.o: micro_params.F90 kgen_utils.o tprof_mod.o params.o grid.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
damping.o: damping.F90 kgen_utils.o tprof_mod.o params.o vars.o task_util_NOMPI.o microphysics.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
crm_output_module.o: crm_output_module.F90 kgen_utils.o tprof_mod.o params.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
kurant.o: kurant.F90 kgen_utils.o tprof_mod.o params.o vars.o sgs.o task_util_NOMPI.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
abcoefs.o: abcoefs.F90 kgen_utils.o tprof_mod.o params.o grid.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
buoyancy.o: buoyancy.F90 kgen_utils.o tprof_mod.o params.o vars.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
crm_surface.o: crm_surface.F90 kgen_utils.o tprof_mod.o params.o vars.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
zero.o: zero.F90 kgen_utils.o tprof_mod.o vars.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
forcing.o: forcing.F90 kgen_utils.o tprof_mod.o params.o vars.o microphysics.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
ice_fall.o: ice_fall.F90 kgen_utils.o tprof_mod.o params.o vars.o microphysics.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
shr_const_mod.o: shr_const_mod.F90 kgen_utils.o tprof_mod.o shr_kind_mod.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
shr_kind_mod.o: shr_kind_mod.F90 kgen_utils.o tprof_mod.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
boundaries.o: boundaries.F90 kgen_utils.o tprof_mod.o periodic.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
periodic.o: periodic.F90 kgen_utils.o tprof_mod.o bound_exchange.o vars.o sgs.o params.o microphysics.o scalar_momentum.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
bound_exchange.o: bound_exchange.F90 kgen_utils.o tprof_mod.o params.o grid.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
advection.o: advection.F90 kgen_utils.o tprof_mod.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
tke_full.o: tke_full.F90 kgen_utils.o tprof_mod.o params.o vars.o shear_prod3D.o shear_prod2D.o sat.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
shear_prod3D.o: shear_prod3D.F90 kgen_utils.o tprof_mod.o params.o vars.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
shear_prod2D.o: shear_prod2D.F90 kgen_utils.o tprof_mod.o params.o vars.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
sat.o: sat.F90 kgen_utils.o tprof_mod.o params.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
advect_mom.o: advect_mom.F90 kgen_utils.o tprof_mod.o advect2_mom_xy.o advect2_mom_z.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
advect2_mom_z.o: advect2_mom_z.F90 kgen_utils.o tprof_mod.o params.o vars.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
advect2_mom_xy.o: advect2_mom_xy.F90 kgen_utils.o tprof_mod.o params.o vars.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
diffuse_mom.o: diffuse_mom.F90 kgen_utils.o tprof_mod.o vars.o diffuse_mom3D.o diffuse_mom2D.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
diffuse_mom2D.o: diffuse_mom2D.F90 kgen_utils.o tprof_mod.o params.o vars.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
diffuse_mom3D.o: diffuse_mom3D.F90 kgen_utils.o tprof_mod.o params.o vars.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
diagnose.o: diagnose.F90 kgen_utils.o tprof_mod.o params.o vars.o sat.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
uvw.o: uvw.F90 kgen_utils.o tprof_mod.o vars.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
coriolis.o: coriolis.F90 kgen_utils.o tprof_mod.o params.o vars.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
pressure.o: pressure.F90 kgen_utils.o tprof_mod.o vars.o params.o press_rhs.o fft.o press_grad.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
fft.o: fft.F90 kgen_utils.o tprof_mod.o params.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
press_rhs.o: press_rhs.F90 kgen_utils.o tprof_mod.o params.o vars.o bound_duvdt.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
bound_duvdt.o: bound_duvdt.F90 kgen_utils.o tprof_mod.o vars.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
press_grad.o: press_grad.F90 kgen_utils.o tprof_mod.o vars.o params.o bound_duvdt.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
adams.o: adams.F90 kgen_utils.o tprof_mod.o params.o vars.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
advect_all_scalars.o: advect_all_scalars.F90 kgen_utils.o tprof_mod.o vars.o advect_scalar.o microphysics.o scalar_momentum.o sgs.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
advect_scalar.o: advect_scalar.F90 kgen_utils.o tprof_mod.o params.o grid.o advect_scalar3D.o vars.o advect_scalar2D.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
advect_scalar2D.o: advect_scalar2D.F90 kgen_utils.o tprof_mod.o params.o grid.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
advect_scalar3D.o: advect_scalar3D.F90 kgen_utils.o tprof_mod.o params.o grid.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
diffuse_scalar.o: diffuse_scalar.F90 kgen_utils.o tprof_mod.o params.o grid.o diffuse_scalar3D.o vars.o diffuse_scalar2D.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
diffuse_scalar3D.o: diffuse_scalar3D.F90 kgen_utils.o tprof_mod.o params.o grid.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
diffuse_scalar2D.o: diffuse_scalar2D.F90 kgen_utils.o tprof_mod.o params.o grid.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
accelerate_crm.o: accelerate_crm.F90 kgen_utils.o tprof_mod.o params.o shr_kind_mod.o grid.o vars.o microphysics.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
kernel_driver.o: kernel_driver.F90 crm_module.o vars.o grid.o domain.o crmdims.o sgs.o scalar_momentum.o params.o microphysics.o cloud.o precip_init.o task_util_NOMPI.o precip_proc.o micro_params.o damping.o crm_output_module.o kurant.o abcoefs.o buoyancy.o crm_surface.o zero.o forcing.o ice_fall.o shr_const_mod.o shr_kind_mod.o boundaries.o periodic.o bound_exchange.o advection.o tke_full.o shear_prod3D.o shear_prod2D.o sat.o advect_mom.o advect2_mom_z.o advect2_mom_xy.o diffuse_mom.o diffuse_mom2D.o diffuse_mom3D.o diagnose.o uvw.o coriolis.o pressure.o fft.o press_rhs.o bound_duvdt.o press_grad.o adams.o advect_all_scalars.o advect_scalar.o advect_scalar2D.o advect_scalar3D.o diffuse_scalar.o diffuse_scalar3D.o diffuse_scalar2D.o accelerate_crm.o kgen_utils.o tprof_mod.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
kgen_utils.o: kgen_utils.f90
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
tprof_mod.o: tprof_mod.f90
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
gammafff.o: gammafff.c
${CC_0} -c -o $@ $<
clean:
rm -f kernel.exe *.mod ${ALL_OBJS}
# Makefile for KGEN-generated kernel
# Originally used compiler(s)
#FC_0 := /sw/summit/xl/16.1.1-5/xlf/16.1.1/bin/.orig/xlf2008_r
FC_0 := mpif90
FC_FLAGS_SET_0 := -F/sw/summit/xl/16.1.1-5/xlf/16.1.1/etc/xlf.cfg.rhel.7.6.gcc.4.8.5.cuda.10.1 -g -qfullpath -qmaxmem=-1 -qphsinfo -qzerosize -qfree=f90 -qxlf2003=polymorphic -qspillsize=2500 -qextname=flush -qsuffix=f=f90:cpp=F90 -g -O2 -qoffload -qthreaded -D_MPI
FC_FLAGS_SET_1 := -F/sw/summit/xl/16.1.1-5/xlf/16.1.1/etc/xlf.cfg.rhel.7.6.gcc.4.8.5.cuda.10.1 -g -qfullpath -qmaxmem=-1 -qphsinfo -qzerosize -qfree=f90 -qxlf2003=polymorphic -qspillsize=2500 -qextname=flush -qsuffix=f=f90:cpp=F90 -qthreaded -D_MPI
ALL_OBJS := crm_module.o vars.o grid.o domain.o crmdims.o sgs.o scalar_momentum.o params.o microphysics.o cloud.o precip_init.o task_util_NOMPI.o precip_proc.o micro_params.o damping.o crm_output_module.o kurant.o abcoefs.o buoyancy.o crm_surface.o zero.o forcing.o ice_fall.o shr_const_mod.o shr_kind_mod.o boundaries.o periodic.o bound_exchange.o advection.o tke_full.o shear_prod3D.o shear_prod2D.o sat.o advect_mom.o advect2_mom_z.o advect2_mom_xy.o diffuse_mom.o diffuse_mom2D.o diffuse_mom3D.o diagnose.o uvw.o coriolis.o pressure.o fft.o press_rhs.o bound_duvdt.o press_grad.o adams.o advect_all_scalars.o advect_scalar.o advect_scalar2D.o advect_scalar3D.o diffuse_scalar.o diffuse_scalar3D.o diffuse_scalar2D.o accelerate_crm.o kernel_driver.o kgen_utils.o tprof_mod.o
build: ${ALL_OBJS}
${FC_0} ${FC_FLAGS_SET_0} -o kernel.exe $^
run: build
mpirun -np 2 ./kernel.exe
crm_module.o: crm_module.F90 vars.o grid.o domain.o crmdims.o sgs.o scalar_momentum.o params.o microphysics.o cloud.o precip_init.o task_util_NOMPI.o precip_proc.o micro_params.o damping.o crm_output_module.o kurant.o abcoefs.o buoyancy.o crm_surface.o zero.o forcing.o ice_fall.o shr_const_mod.o shr_kind_mod.o boundaries.o periodic.o bound_exchange.o advection.o tke_full.o shear_prod3D.o shear_prod2D.o sat.o advect_mom.o advect2_mom_z.o advect2_mom_xy.o diffuse_mom.o diffuse_mom2D.o diffuse_mom3D.o diagnose.o uvw.o coriolis.o pressure.o fft.o press_rhs.o bound_duvdt.o press_grad.o adams.o advect_all_scalars.o advect_scalar.o advect_scalar2D.o advect_scalar3D.o diffuse_scalar.o diffuse_scalar3D.o diffuse_scalar2D.o accelerate_crm.o kgen_utils.o tprof_mod.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
vars.o: vars.F90 kgen_utils.o tprof_mod.o grid.o params.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
grid.o: grid.F90 kgen_utils.o tprof_mod.o domain.o params.o advection.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
domain.o: domain.F90 kgen_utils.o tprof_mod.o crmdims.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
crmdims.o: crmdims.F90 kgen_utils.o tprof_mod.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
sgs.o: sgs.F90 kgen_utils.o tprof_mod.o params.o grid.o tke_full.o vars.o diffuse_mom.o diffuse_scalar.o microphysics.o scalar_momentum.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
scalar_momentum.o: scalar_momentum.F90 kgen_utils.o tprof_mod.o params.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
params.o: params.F90 kgen_utils.o tprof_mod.o shr_const_mod.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
microphysics.o: microphysics.F90 kgen_utils.o tprof_mod.o params.o vars.o micro_params.o grid.o precip_init.o cloud.o precip_proc.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
cloud.o: cloud.F90 kgen_utils.o tprof_mod.o micro_params.o vars.o params.o sat.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
precip_init.o: precip_init.F90 kgen_utils.o tprof_mod.o micro_params.o vars.o task_util_NOMPI.o sat.o params.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
task_util_NOMPI.o: task_util_NOMPI.F90 kgen_utils.o tprof_mod.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
precip_proc.o: precip_proc.F90 kgen_utils.o tprof_mod.o micro_params.o vars.o sat.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
micro_params.o: micro_params.F90 kgen_utils.o tprof_mod.o params.o grid.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
damping.o: damping.F90 kgen_utils.o tprof_mod.o params.o vars.o task_util_NOMPI.o microphysics.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
crm_output_module.o: crm_output_module.F90 kgen_utils.o tprof_mod.o params.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
kurant.o: kurant.F90 kgen_utils.o tprof_mod.o params.o vars.o sgs.o task_util_NOMPI.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
abcoefs.o: abcoefs.F90 kgen_utils.o tprof_mod.o params.o grid.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
buoyancy.o: buoyancy.F90 kgen_utils.o tprof_mod.o params.o vars.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
crm_surface.o: crm_surface.F90 kgen_utils.o tprof_mod.o params.o vars.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
zero.o: zero.F90 kgen_utils.o tprof_mod.o vars.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
forcing.o: forcing.F90 kgen_utils.o tprof_mod.o params.o vars.o microphysics.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
ice_fall.o: ice_fall.F90 kgen_utils.o tprof_mod.o params.o vars.o microphysics.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
shr_const_mod.o: shr_const_mod.F90 kgen_utils.o tprof_mod.o shr_kind_mod.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
shr_kind_mod.o: shr_kind_mod.F90 kgen_utils.o tprof_mod.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
boundaries.o: boundaries.F90 kgen_utils.o tprof_mod.o periodic.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
periodic.o: periodic.F90 kgen_utils.o tprof_mod.o bound_exchange.o vars.o sgs.o params.o microphysics.o scalar_momentum.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
bound_exchange.o: bound_exchange.F90 kgen_utils.o tprof_mod.o params.o grid.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
advection.o: advection.F90 kgen_utils.o tprof_mod.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
tke_full.o: tke_full.F90 kgen_utils.o tprof_mod.o params.o vars.o shear_prod3D.o shear_prod2D.o sat.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
shear_prod3D.o: shear_prod3D.F90 kgen_utils.o tprof_mod.o params.o vars.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
shear_prod2D.o: shear_prod2D.F90 kgen_utils.o tprof_mod.o params.o vars.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
sat.o: sat.F90 kgen_utils.o tprof_mod.o params.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
advect_mom.o: advect_mom.F90 kgen_utils.o tprof_mod.o advect2_mom_xy.o advect2_mom_z.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
advect2_mom_z.o: advect2_mom_z.F90 kgen_utils.o tprof_mod.o params.o vars.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
advect2_mom_xy.o: advect2_mom_xy.F90 kgen_utils.o tprof_mod.o params.o vars.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
diffuse_mom.o: diffuse_mom.F90 kgen_utils.o tprof_mod.o vars.o diffuse_mom3D.o diffuse_mom2D.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
diffuse_mom2D.o: diffuse_mom2D.F90 kgen_utils.o tprof_mod.o params.o vars.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
diffuse_mom3D.o: diffuse_mom3D.F90 kgen_utils.o tprof_mod.o params.o vars.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
diagnose.o: diagnose.F90 kgen_utils.o tprof_mod.o params.o vars.o sat.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
uvw.o: uvw.F90 kgen_utils.o tprof_mod.o vars.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
coriolis.o: coriolis.F90 kgen_utils.o tprof_mod.o params.o vars.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
pressure.o: pressure.F90 kgen_utils.o tprof_mod.o vars.o params.o press_rhs.o fft.o press_grad.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
fft.o: fft.F90 kgen_utils.o tprof_mod.o params.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
press_rhs.o: press_rhs.F90 kgen_utils.o tprof_mod.o params.o vars.o bound_duvdt.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
bound_duvdt.o: bound_duvdt.F90 kgen_utils.o tprof_mod.o vars.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
press_grad.o: press_grad.F90 kgen_utils.o tprof_mod.o vars.o params.o bound_duvdt.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
adams.o: adams.F90 kgen_utils.o tprof_mod.o params.o vars.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
advect_all_scalars.o: advect_all_scalars.F90 kgen_utils.o tprof_mod.o vars.o advect_scalar.o microphysics.o scalar_momentum.o sgs.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
advect_scalar.o: advect_scalar.F90 kgen_utils.o tprof_mod.o params.o grid.o advect_scalar3D.o vars.o advect_scalar2D.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
advect_scalar2D.o: advect_scalar2D.F90 kgen_utils.o tprof_mod.o params.o grid.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
advect_scalar3D.o: advect_scalar3D.F90 kgen_utils.o tprof_mod.o params.o grid.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
diffuse_scalar.o: diffuse_scalar.F90 kgen_utils.o tprof_mod.o params.o grid.o diffuse_scalar3D.o vars.o diffuse_scalar2D.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
diffuse_scalar3D.o: diffuse_scalar3D.F90 kgen_utils.o tprof_mod.o params.o grid.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
diffuse_scalar2D.o: diffuse_scalar2D.F90 kgen_utils.o tprof_mod.o params.o grid.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
accelerate_crm.o: accelerate_crm.F90 kgen_utils.o tprof_mod.o params.o shr_kind_mod.o grid.o vars.o microphysics.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
kernel_driver.o: kernel_driver.F90 crm_module.o vars.o grid.o domain.o crmdims.o sgs.o scalar_momentum.o params.o microphysics.o cloud.o precip_init.o task_util_NOMPI.o precip_proc.o micro_params.o damping.o crm_output_module.o kurant.o abcoefs.o buoyancy.o crm_surface.o zero.o forcing.o ice_fall.o shr_const_mod.o shr_kind_mod.o boundaries.o periodic.o bound_exchange.o advection.o tke_full.o shear_prod3D.o shear_prod2D.o sat.o advect_mom.o advect2_mom_z.o advect2_mom_xy.o diffuse_mom.o diffuse_mom2D.o diffuse_mom3D.o diagnose.o uvw.o coriolis.o pressure.o fft.o press_rhs.o bound_duvdt.o press_grad.o adams.o advect_all_scalars.o advect_scalar.o advect_scalar2D.o advect_scalar3D.o diffuse_scalar.o diffuse_scalar3D.o diffuse_scalar2D.o accelerate_crm.o kgen_utils.o tprof_mod.o
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
kgen_utils.o: kgen_utils.f90
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
tprof_mod.o: tprof_mod.f90
${FC_0} ${FC_FLAGS_SET_0} -c -o $@ $<
clean:
rm -f kernel.exe *.mod ${ALL_OBJS}
!KGEN-generated Fortran source file
!Generated at : 2020-05-29 19:47:48
!KGEN version : 0.9.0
module abcoefs_mod
USE kgen_utils_mod, ONLY: kgen_dp, kgen_array_sumcheck
USE tprof_mod, ONLY: tstart, tstop, tnull, tprnt
IMPLICIT NONE
contains
subroutine abcoefs(ncrms)
! coefficients for the Adams-Bashforth scheme
USE grid
USE params, ONLY: crm_rknd
implicit none
integer, intent(in) :: ncrms
real(crm_rknd) alpha, beta
if(nstep.ge.3.and.nadams.eq.3.or.nrestart.eq.2) then
alpha = dt3(nb) / dt3(na)
beta = dt3(nc) / dt3(na)
ct = (2.+3.* alpha) / (6.* (alpha + beta) * beta)
bt = -(1.+2.*(alpha + beta) * ct)/(2. * alpha)
at = 1. - bt - ct
else if(nstep.ge.2) then
at = 3./2.
bt = -1./2.
ct = 0.
else
at = 1.
bt = 0.
ct = 0.
end if
!$omp target update to (dt3)
end subroutine abcoefs
end module abcoefs_mod
\ No newline at end of file
!KGEN-generated Fortran source file
!Generated at : 2020-05-29 19:47:49
!KGEN version : 0.9.0
! -----------------------------------------------------------------------------
! MODULE accelerate_crm_mod
! This module provides functionality to apply mean-state acceleration (MSA)
! (Jones et al., 2015, doi:10.1002/2015MS000488) to the CRMs when using
! superparameterization.
! PUBLIC SUBROUTINES:
! crm_accel_init: initialize quantities needed to apply MSA
! crm_accel_nstop: adjusts 'nstop' in crm_module based on crm_accel_factor
! accelerate_crm: calculates and applies MSA tendency to CRM
! PUBLIC MODULE VARIABLES:
! logical :: use_crm_accel - apply MSA if true (cam namelist variable)
! real(r8) :: crm_accel_factor - MSA factor to use (cam namelist variable)
! REVISION HISTORY:
! 2018-Nov-01: Initial implementation
! 2019-Jan-30: Initial subroutine port to GPU using openacc directives
! CONTACT: Christopher Jones (christopher.jones@pnnl.gov)
! -----------------------------------------------------------------------------
!
!
!
!
module accelerate_crm_mod
USE grid, ONLY: nx, ny
USE shr_kind_mod, ONLY: r8=>shr_kind_r8
USE params, ONLY: rc=>crm_rknd
USE kgen_utils_mod, ONLY: kgen_dp, kgen_array_sumcheck
USE tprof_mod, ONLY: tstart, tstop, tnull, tprnt
IMPLICIT NONE
! private module variables
real(r8), parameter :: coef = 1._r8 / dble(nx * ny) ! coefficient for horizontal averaging
logical :: crm_accel_uv ! (false) apply MSA only to scalar fields (T and QT)
! (true) apply MSA to winds (U/V) and scalar fields
! public module variables
logical :: use_crm_accel ! use MSA if true
real(r8) :: crm_accel_factor ! 1 + crm_accel_factor = 'a' in Jones etal (2015)
PRIVATE coef, crm_accel_uv
PUBLIC use_crm_accel, crm_accel_factor
PUBLIC accelerate_crm
PUBLIC kr_externs_in_accelerate_crm_mod
PUBLIC kr_externs_out_accelerate_crm_mod
contains
subroutine accelerate_crm(ncrms, nstep, nstop, ceaseflag)
! Applies mean-state acceleration (MSA) to CRM
! Applies MSA to the following crm fields:
! t, qv, qcl, qci, micro_field(:,:,:,index_water_vapor,:),
! u (optional), v (optional)
! Raises ceaseflag and aborts MSA if the magnitude of
! the change in "t" exceeds 5K at any point.
! Arguments:
! ncrms (in) - number of crm columns in this group
! nstep (in) - current crm iteration, needed only if
! ceaseflag is triggered
! nstop (inout) - number of crm iterations, adjusted only
! if ceaseflag is triggered
! ceaseflag (inout) - returns true if accelerate_crm aborted
! before MSA applied; otherwise false
! Notes:
! micro_field(:,:,:,index_water_vapor,:) is the non-precipitating
! _total_ water mixing ratio for None microphysics.
! Intended to be called from crm subroutine in crm_module
! -----------------------------------------------------------------------
!
!
USE grid, ONLY: nzm
USE vars, ONLY: u, v, u0, v0, t0, q0, t, qcl, qci, qv
USE microphysics, ONLY: micro_field, idx_qt=>index_water_vapor
implicit none
integer, intent(in ) :: ncrms
integer, intent(in ) :: nstep
integer, intent(inout) :: nstop
logical, intent(inout) :: ceaseflag
real(rc), allocatable :: ubaccel (:,:) ! u before applying MSA tendency
real(rc), allocatable :: vbaccel (:,:) ! v before applying MSA tendency
real(rc), allocatable :: tbaccel (:,:) ! t before applying MSA tendency
real(rc), allocatable :: qtbaccel (:,:) ! Non-precipitating qt before applying MSA tendency
real(rc), allocatable :: ttend_acc(:,:) ! MSA adjustment of t
real(rc), allocatable :: qtend_acc(:,:) ! MSA adjustment of qt
real(rc), allocatable :: utend_acc(:,:) ! MSA adjustment of u
real(rc), allocatable :: vtend_acc(:,:) ! MSA adjustment of v
real(r8), allocatable :: qpoz (:,:) ! total positive micro_field(:,:,k,idx_qt,:) in level k
real(r8), allocatable :: qneg (:,:) ! total negative micro_field(:,:,k,idx_qt,:) in level k
real(rc) :: tmp ! temporary variable for atomic updates
integer i, j, k, icrm ! iteration variables
real(r8) :: factor, qt_res ! local variables for redistributing moisture
real(rc) :: ttend_threshold ! threshold for ttend_acc at which MSA aborts
real(rc) :: tmin ! mininum value of t allowed (sanity factor)
ttend_threshold = 5. ! 5K, following UP-None implementation
tmin = 50. ! should never get below 50K in crm, following UP-None implementation
allocate( ubaccel (ncrms,nzm) )
allocate( vbaccel (ncrms,nzm) )
allocate( tbaccel (ncrms,nzm) )
allocate( qtbaccel (ncrms,nzm) )
allocate( ttend_acc(ncrms,nzm) )
allocate( qtend_acc(ncrms,nzm) )
allocate( utend_acc(ncrms,nzm) )
allocate( vtend_acc(ncrms,nzm) )
allocate( qpoz (ncrms,nzm) )
allocate( qneg (ncrms,nzm) )
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! Compute the average among horizontal columns for each variable
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!$omp target enter data map(alloc: ubaccel)
!$omp target enter data map(alloc: vbaccel)
!$omp target enter data map(alloc: tbaccel)
!$omp target enter data map(alloc: qtbaccel)
!$omp target enter data map(alloc: ttend_acc)
!$omp target enter data map(alloc: qtend_acc)
!$omp target enter data map(alloc: utend_acc)
!$omp target enter data map(alloc: vtend_acc)
!$omp target enter data map(alloc: qpoz)
!$omp target enter data map(alloc: qneg)
!$omp target teams distribute parallel do collapse(2)
do k = 1, nzm
do icrm = 1, ncrms
tbaccel(icrm,k) = 0
qtbaccel(icrm,k) = 0
if (crm_accel_uv) then
ubaccel(icrm,k) = 0
vbaccel(icrm,k) = 0
endif
enddo
enddo
!$omp target teams distribute parallel do collapse(4)
do k = 1, nzm
do j = 1 , ny
do i = 1 , nx
do icrm = 1, ncrms
! calculate tendency * dtn
tmp = t(icrm,i,j,k) * coef
!$omp atomic update
tbaccel(icrm,k) = tbaccel(icrm,k) + tmp
tmp = (qcl(icrm,i,j, k) + qci(icrm,i,j, k) + qv(icrm,i,j, k)) * coef
!$omp atomic update
qtbaccel(icrm,k) = qtbaccel(icrm,k) + tmp
if (crm_accel_uv) then
tmp = u(icrm,i,j,k) * coef
!$omp atomic update
ubaccel(icrm,k) = ubaccel(icrm,k) + tmp
tmp = v(icrm,i,j,k) * coef
!$omp atomic update
vbaccel(icrm,k) = vbaccel(icrm,k) + tmp
endif
enddo
enddo
enddo
enddo
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! Compute the accelerated tendencies
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!$omp target teams distribute parallel do collapse(2)
do k = 1, nzm
do icrm = 1, ncrms