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

Update coupling between phantom and KROME #510

Merged
merged 3 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
53 changes: 53 additions & 0 deletions .github/workflows/krome.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: krome

# Trigger on pull request, but only for the master branch
on:
pull_request:
branches: [ master ]
paths-ignore:
- 'docs/**'
- 'README.md'

env:
PREFIX: /usr/local/
PHANTOM_DIR: ${{ github.workspace }}
KROMEPATH: ${{ github.workspace }}/krome

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
toolchain: [{compiler: gcc}, {compiler: intel-classic}]
exclude:
- os: macos-latest
toolchain: {compiler: intel-classic}

steps:
- uses: awvwgk/setup-fortran@v1
with:
compiler: ${{ matrix.toolchain.compiler }}

- name: "Clone phantom"
uses: actions/checkout@v3

- name: "Clone krome"
run: git clone https://bitbucket.org/tgrassi/krome.git krome

- name: "make krome.setup"
run: echo -e "-n=networks/react_AGBwind_nucleation\n-cooling=ATOMIC,CHEM,H2,CIE,Z,CI,CII,OI,OII,CO,OH,H2O,HCN\n-heating=CHEM,CR\n-H2opacity=RIPAMONTI\n-gamma=EXACT\n-noSinkCheck\n-noRecCheck\n-noTlimits\n-useX\n-conserveLin\n-useTabs\n-unsafe\n-iRHS" > krome.setup && cat krome.setup

- name: "Compile phantom and link with krome"
run: make SYSTEM=${{ env.FC }} SETUP=wind KROME=krome KROMEPATH=${KROMEPATH} PREFIX=${PREFIX} RUNDIR=${{ github.workspace }}

- name: "Compile phantomsetup and link with krome"
run: make SYSTEM=${{ env.FC }} SETUP=wind KROME=krome KROMEPATH=${KROMEPATH} PREFIX=${PREFIX} RUNDIR=${PREFIX} setup

- name: "Compile phantomanalysis and link with krome"
run: make SYSTEM=${{ env.FC }} SETUP=wind KROME=krome KROMEPATH=${KROMEPATH} PREFIX=${PREFIX} RUNDIR=${PREFIX} analysis

- name: "Compile phantommoddump and link with krome"
run: make SYSTEM=${{ env.FC }} SETUP=wind KROME=krome KROMEPATH=${KROMEPATH} PREFIX=${PREFIX} RUNDIR=${PREFIX} moddump
16 changes: 10 additions & 6 deletions build/MakeKrome
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@

KROME_BUILD_DIR = ${KROMEPATH}/build

KFLAGS="$(FFLAGS)"
KFLAGS=$(filter-out -std=f2008, $(FFLAGS))
ifeq ($(SYSTEM), ifort)
KFLAGS += -O3 -ipo -ip -unroll -xHost -g -fp-model precise
else
KFLAGS += -ffree-line-length-none -w -fallow-argument-mismatch
endif
FFLAGS+= -I$(KROME_BUILD_DIR)
PASSED=0

Expand All @@ -21,23 +26,22 @@ endif
ifeq ("$(wildcard ${KROMEPATH}/build/optionsKrome.opt)","")
cp $(RUNDIR)/krome.setup ${KROMEPATH}/build/optionsKrome.opt
cd ${KROMEPATH}; ./krome -options=build/optionsKrome.opt
cp -f ${KROMEPATH}/data/coolCO.dat ${KROMEPATH}/data/coolH2O.dat ${KROMEPATH}/data/coolOH.dat ${KROMEPATH}/data/coolHCN.dat ${KROMEPATH}/build/reactions_verbatim.dat ${RUNDIR}
cp -f ${KROMEPATH}/build/*.dat ${KROMEPATH}/build/*.gfe ${RUNDIR}
make clean_krome
override PASSED:=1
endif
ifeq ("$(PASSED)$(wildcard ${KROMEPATH}/build/reactions_verbatim.dat)","0")
cd ${KROMEPATH}; ./krome -options=build/optionsKrome.opt
cp ${KROMEPATH}/data/coolCO.dat ${KROMEPATH}/data/coolH2O.dat ${KROMEPATH}/data/coolOH.dat ${KROMEPATH}/data/coolHCN.dat ${KROMEPATH}/build/reactions_verbatim.dat ${RUNDIR}
cp -f ${KROMEPATH}/build/*.dat ${KROMEPATH}/build/*.gfe ${RUNDIR}
endif

krome: $(KROME_OBJS)
ifeq ("$(wildcard coolCO.dat)","")
cp -f ${KROMEPATH}/data/coolCO.dat ${KROMEPATH}/data/coolH2O.dat ${KROMEPATH}/data/coolOH.dat ${KROMEPATH}/data/coolHCN.dat ${KROMEPATH}/build/reactions_verbatim.dat ${RUNDIR}
cp -f ${KROMEPATH}/build/*.dat ${KROMEPATH}/build/*.gfe ${RUNDIR}
endif


$(KROME_OBJS):
$(MAKE) -C $(KROME_BUILD_DIR) fc=$(FC) switch=$(KFLAGS)
$(MAKE) -C $(KROME_BUILD_DIR) fc=$(FC) switch="$(KFLAGS)"

clean_krome:
$(MAKE) -C $(KROME_BUILD_DIR) clean
7 changes: 4 additions & 3 deletions build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,10 @@ endif
ifeq ($(KROME), krome)
FPPFLAGS += -DKROME
ifeq ($(SYSTEM), ifort)
LDFLAGS += -mkl
LDFLAGS += -llapack
else
LDFLAGS += -L/usr/lib/x86_64-linux-gnu -lmkl_core -lmkl_gnu_thread -lmkl_gf_lp64 -fopenmp
# LDFLAGS += -L/usr/lib/x86_64-linux-gnu -lmkl_core -lmkl_gnu_thread -lmkl_gf_lp64 -fopenmp
LDFLAGS += -llapack
endif
endif

Expand Down Expand Up @@ -554,7 +555,7 @@ OBJECTS = $(OBJECTS1:.F90=.o)
ifeq ($(KROME), krome)
.PHONY: all

all: checksystem krome_setup krome phantom
all: checksystem checkparams krome_setup krome phantom
include MakeKrome
else
.PHONY: phantom
Expand Down
12 changes: 0 additions & 12 deletions build/optionsKrome.opt

This file was deleted.

Loading
Loading