Skip to content

Commit

Permalink
Makefile for jfrs, flow
Browse files Browse the repository at this point in the history
  • Loading branch information
smaeyama committed Mar 15, 2023
1 parent 97be366 commit d029c71
Show file tree
Hide file tree
Showing 5 changed files with 212 additions and 186 deletions.
201 changes: 97 additions & 104 deletions run/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ FFLAGS += -mcmodel=large # Static memory larger than 2GB
#FFLAGS += -Haefosux -NRtrap #-O0 # Debug
OPTRPT = 'lst'
#FFLAGS += -Nfjprof # Fujitsu profiler fapp
#FFLAGS += -Ksimd_nouse_multiple_structures # Specific option for compiler tcs1.2.26 to avoid slowing down GKV
#FFLAGS += -Knosch_pre_ra # Specific option for compiler tcs1.2.26 to avoid slowing down GKV
FFLAGS += -Ksimd_nouse_multiple_structures # Specific option for compiler tcs1.2.26 to avoid slowing down GKV
FFLAGS += -Knosch_pre_ra # Specific option for compiler tcs1.2.26 to avoid slowing down GKV
INC =
LIB =


PROG = 'gkvp.exe'
Expand All @@ -21,121 +23,112 @@ MYL = ../lib/
MATH = gkvp_math_portable

FFT = gkvp_fft_fftw
### Usage of FFTW
### Usage of FFTW (module load fftw-tune)
ifeq ($(FFT),gkvp_fft_fftw)
### FFTW-SVE
FFTW_DIR=/home/apps/r/OSS_CN/fftw-3.3.8/
INC = -I$(FFTW_DIR)/include
LIB = -L$(FFTW_DIR)/lib64 -lfftw3 -lm -SSL2
#### FFTW-SPACK (. /home/apps/oss/spack/share/spack/setup-env.sh; spack load fftw) ###
#FFTW_DIR=`spack location -i fftw`
#INC = -I$(FFTW_DIR)/include
#LIB = -L$(FFTW_DIR)/lib -lfftw3 -lm -SSL2
#INC += -I$(FFTW_DIR)/include
#LIB += -L$(FFTW_DIR)/lib -lfftw3 -lm
LIB += -lfftw3 -lm
endif

FILEIO=gkvp_fileio_fortran
#FILEIO=gkvp_fileio_netcdf
### Usage of NetCDF (. /home/apps/oss/spack/share/spack/setup-env.sh; spack load netcdf-fortran%fj) ###
### Operation of NetCDF has not yet been checked on Fugaku, Jan 26 2021
### Usage of NetCDF (module load netcdf-fortran netcdf-c phdf5)
### NetCDF does not work on the FLOW supercomputer for now, Jan 17 2021
ifeq ($(FILEIO),gkvp_fileio_netcdf)
NETCDF_DIR=`spack location -i netcdf-fortran%fj`
INC += -I$(NETCDF_DIR)/include
LIB += -L$(NETCDF_DIR)/lib -lnetcdff -lnetcdf -lhdf5_hl -lhdf5
#INC += -I$(NETCDF_FORTRAN_DIR)/include -I$(NETCDF_DIR)/include -I$(PHDF5_DIR)/include
#LIB += -L$(NETCDF_FORTRAN_DIR)/lib -L$(NETCDF_DIR)/lib -L$(PHDF5_DIR)/lib -lnetcdff -lnetcdf -lhdf5_hl -lhdf5
LIB += -lnetcdff -lnetcdf -lhdf5_hl -lhdf5
endif

OBJS = gkvp_header.o\
gkvp_mpienv.o\
$(MATH).o\
gkvp_clock.o\
$(FILEIO).o\
gkvp_intgrl.o\
gkvp_tips.o\
gkvp_vmecbzx.o\
gkvp_igs.o\
gkvp_ring.o\
gkvp_bndry.o\
gkvp_colli.o\
$(FFT).o\
gkvp_fld.o\
gkvp_colliimp.o\
gkvp_freq.o\
gkvp_zfilter.o\
gkvp_geom.o\
gkvp_exb.o\
gkvp_trans.o\
gkvp_advnc.o\
gkvp_shearflow.o\
gkvp_dtc.o\
gkvp_out.o\
gkvp_set.o\
gkvp_main.o

main:
(cp Makefile $(SRC); cd $(SRC); make gkvp)
gkvp: $(SRC)gkvp_header.f90\
$(SRC)gkvp_mpienv.f90\
$(MYL)$(MATH).f90\
$(SRC)gkvp_clock.f90\
$(SRC)$(FILEIO).f90\
$(SRC)gkvp_intgrl.f90\
$(SRC)gkvp_tips.f90\
$(SRC)gkvp_vmecbzx.f90\
$(SRC)gkvp_igs.f90\
$(SRC)gkvp_ring.f90\
$(SRC)gkvp_bndry.f90\
$(SRC)gkvp_colli.f90\
$(SRC)$(FFT).f90\
$(SRC)gkvp_fld.f90\
$(SRC)gkvp_colliimp.f90\
$(SRC)gkvp_freq.f90\
$(SRC)gkvp_zfilter.f90\
$(SRC)gkvp_geom.f90\
$(SRC)gkvp_exb.f90\
$(SRC)gkvp_trans.f90\
$(SRC)gkvp_advnc.f90\
$(SRC)gkvp_shearflow.f90\
$(SRC)gkvp_dtc.f90\
$(SRC)gkvp_out.f90\
$(SRC)gkvp_set.f90\
$(SRC)gkvp_main.f90

gkvp: $(OBJS)
$(FC) $(FFLAGS) $(OBJS) -o $(PROG) $(LIB)
mv $(PROG) ../run/
$(FC) $(FFLAGS) -c $(SRC)gkvp_header.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_mpienv.f90
$(FC) $(FFLAGS) -c $(MYL)$(MATH).f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_clock.f90
$(FC) $(FFLAGS) -c $(SRC)$(FILEIO).f90 $(INC)
$(FC) $(FFLAGS) -c $(SRC)gkvp_intgrl.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_tips.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_vmecbzx.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_igs.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_ring.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_bndry.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_colli.f90
$(FC) $(FFLAGS) -c $(SRC)$(FFT).f90 $(INC)
$(FC) $(FFLAGS) -c $(SRC)gkvp_fld.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_colliimp.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_freq.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_zfilter.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_geom.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_exb.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_trans.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_advnc.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_shearflow.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_dtc.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_out.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_set.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_main.f90

#------------------------------>
gkvp_advnc.o : gkvp_advnc.f90 gkvp_geom.o gkvp_tips.o gkvp_zfilter.o gkvp_clock.o gkvp_bndry.o gkvp_colliimp.o gkvp_colli.o gkvp_exb.o gkvp_fld.o gkvp_mpienv.o gkvp_header.o
$(FC) $(FFLAGS) -c $<
gkvp_bndry.o : gkvp_bndry.f90 gkvp_clock.o gkvp_mpienv.o gkvp_header.o
$(FC) $(FFLAGS) -c $<
gkvp_clock.o : gkvp_clock.f90 gkvp_mpienv.o gkvp_header.o
$(FC) $(FFLAGS) -c $<
gkvp_colli.o : gkvp_colli.f90 gkvp_bndry.o gkvp_clock.o gkvp_mpienv.o gkvp_header.o
$(FC) $(FFLAGS) -c $<
gkvp_colliimp.o : gkvp_colliimp.f90 gkvp_fld.o $(MATH).o gkvp_clock.o gkvp_mpienv.o gkvp_header.o
$(FC) $(FFLAGS) -c $<
gkvp_dtc.o : gkvp_dtc.f90 gkvp_colliimp.o gkvp_exb.o gkvp_mpienv.o gkvp_header.o
$(FC) $(FFLAGS) -c $<
gkvp_exb.o : gkvp_exb.f90 gkvp_clock.o $(FFT).o gkvp_mpienv.o gkvp_header.o
$(FC) $(FFLAGS) -c $<
$(FFT).o : $(FFT).f90 gkvp_clock.o gkvp_mpienv.o gkvp_header.o
$(FC) $(FFLAGS) -c $< $(INC)
$(FILEIO).o : $(FILEIO).f90 gkvp_mpienv.o gkvp_header.o
$(FC) $(FFLAGS) -c $< $(INC)
gkvp_fld.o : gkvp_fld.f90 gkvp_clock.o gkvp_intgrl.o gkvp_mpienv.o gkvp_header.o
$(FC) $(FFLAGS) -c $<
gkvp_freq.o : gkvp_freq.f90 gkvp_mpienv.o gkvp_header.o
$(FC) $(FFLAGS) -c $<
gkvp_geom.o : gkvp_geom.f90 gkvp_ring.o gkvp_igs.o gkvp_vmecbzx.o gkvp_intgrl.o $(MATH).o gkvp_mpienv.o gkvp_header.o
$(FC) $(FFLAGS) -c $<
gkvp_header.o : gkvp_header.f90
$(FC) $(FFLAGS) -c $<
gkvp_igs.o : gkvp_igs.f90 gkvp_mpienv.o gkvp_header.o
$(FC) $(FFLAGS) -c $<
gkvp_intgrl.o : gkvp_intgrl.f90 gkvp_mpienv.o gkvp_header.o
$(FC) $(FFLAGS) -c $<
gkvp_main.o : gkvp_main.f90 gkvp_shearflow.o gkvp_tips.o gkvp_freq.o $(FFT).o gkvp_colliimp.o gkvp_advnc.o gkvp_fld.o gkvp_dtc.o gkvp_out.o gkvp_clock.o gkvp_set.o gkvp_mpienv.o gkvp_header.o
$(FC) $(FFLAGS) -c $<
gkvp_mpienv.o : gkvp_mpienv.f90 gkvp_header.o
$(FC) $(FFLAGS) -c $<
gkvp_out.o : gkvp_out.f90 $(FILEIO).o gkvp_tips.o gkvp_dtc.o gkvp_colliimp.o gkvp_advnc.o gkvp_freq.o gkvp_trans.o gkvp_fld.o gkvp_intgrl.o gkvp_mpienv.o gkvp_header.o
$(FC) $(FFLAGS) -c $<
gkvp_ring.o : gkvp_ring.f90 $(MATH).o
$(FC) $(FFLAGS) -c $<
gkvp_set.o : gkvp_set.f90 gkvp_geom.o $(FILEIO).o gkvp_tips.o gkvp_colliimp.o gkvp_colli.o gkvp_dtc.o gkvp_advnc.o gkvp_bndry.o gkvp_fld.o $(MATH).o gkvp_mpienv.o gkvp_header.o
$(FC) $(FFLAGS) -c $<
gkvp_shearflow.o : gkvp_shearflow.f90 gkvp_tips.o gkvp_fld.o gkvp_mpienv.o gkvp_header.o
$(FC) $(FFLAGS) -c $<
gkvp_tips.o : gkvp_tips.f90 gkvp_mpienv.o gkvp_header.o
$(FC) $(FFLAGS) -c $<
gkvp_trans.o : gkvp_trans.f90 $(FILEIO).o gkvp_exb.o gkvp_clock.o gkvp_intgrl.o gkvp_mpienv.o gkvp_header.o
$(FC) $(FFLAGS) -c $<
gkvp_vmecbzx.o : gkvp_vmecbzx.f90 gkvp_mpienv.o gkvp_header.o
$(FC) $(FFLAGS) -c $<
gkvp_vmecin.o : gkvp_vmecin.f90 gkvp_mpienv.o gkvp_header.o
$(FC) $(FFLAGS) -c $<
gkvp_zfilter.o : gkvp_zfilter.f90 gkvp_clock.o gkvp_mpienv.o gkvp_header.o
$(FC) $(FFLAGS) -c $<
$(MATH).o : $(MYL)$(MATH).f90 $(MYL)Bessel0_Zeros.f90 gkvp_header.o
$(FC) $(FFLAGS) -c $<
#------------------------------<
$(FC) $(FFLAGS) \
gkvp_header.o\
gkvp_mpienv.o\
$(MATH).o\
gkvp_clock.o\
$(FILEIO).o\
gkvp_intgrl.o\
gkvp_tips.o\
gkvp_vmecbzx.o\
gkvp_igs.o\
gkvp_ring.o\
gkvp_bndry.o\
gkvp_colli.o\
$(FFT).o\
gkvp_fld.o\
gkvp_colliimp.o\
gkvp_freq.o\
gkvp_zfilter.o\
gkvp_geom.o\
gkvp_exb.o\
gkvp_trans.o\
gkvp_advnc.o\
gkvp_shearflow.o\
gkvp_dtc.o\
gkvp_out.o\
gkvp_set.o\
gkvp_main.o\
-o $(PROG) $(LIB)

cp *.o *.mod *.$(OPTRPT) ../src/
rm -f *.o *.mod *.$(OPTRPT)

clean:
rm -f ../src/Makefile ../src/*.o ../src/*.mod ../src/*.$(OPTRPT) ./*.exe ./sub.q.*.o* \
rm -f ../src/*.o ../src/*.mod ../src/*.$(OPTRPT) ./*.exe ./sub.q.*.o* \
./*.o ./*.mod ./*.$(OPTRPT) ./*namelist.* ./sub.q.*

clear:
Expand Down
6 changes: 6 additions & 0 deletions run/backup/Makefile_flow
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,15 @@ gkvp: $(SRC)gkvp_header.f90\
$(SRC)gkvp_tips.f90\
$(SRC)gkvp_vmecbzx.f90\
$(SRC)gkvp_igs.f90\
$(SRC)gkvp_ring.f90\
$(SRC)gkvp_bndry.f90\
$(SRC)gkvp_colli.f90\
$(SRC)$(FFT).f90\
$(SRC)gkvp_fld.f90\
$(SRC)gkvp_colliimp.f90\
$(SRC)gkvp_freq.f90\
$(SRC)gkvp_zfilter.f90\
$(SRC)gkvp_geom.f90\
$(SRC)gkvp_exb.f90\
$(SRC)gkvp_trans.f90\
$(SRC)gkvp_advnc.f90\
Expand All @@ -75,13 +77,15 @@ gkvp: $(SRC)gkvp_header.f90\
$(FC) $(FFLAGS) -c $(SRC)gkvp_tips.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_vmecbzx.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_igs.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_ring.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_bndry.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_colli.f90
$(FC) $(FFLAGS) -c $(SRC)$(FFT).f90 $(INC)
$(FC) $(FFLAGS) -c $(SRC)gkvp_fld.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_colliimp.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_freq.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_zfilter.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_geom.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_exb.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_trans.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_advnc.f90
Expand All @@ -101,13 +105,15 @@ gkvp: $(SRC)gkvp_header.f90\
gkvp_tips.o\
gkvp_vmecbzx.o\
gkvp_igs.o\
gkvp_ring.o\
gkvp_bndry.o\
gkvp_colli.o\
$(FFT).o\
gkvp_fld.o\
gkvp_colliimp.o\
gkvp_freq.o\
gkvp_zfilter.o\
gkvp_geom.o\
gkvp_exb.o\
gkvp_trans.o\
gkvp_advnc.o\
Expand Down
6 changes: 6 additions & 0 deletions run/backup/Makefile_jfrs
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,15 @@ gkvp: $(SRC)gkvp_header.f90\
$(SRC)gkvp_tips.f90\
$(SRC)gkvp_vmecbzx.f90\
$(SRC)gkvp_igs.f90\
$(SRC)gkvp_ring.f90\
$(SRC)gkvp_bndry.f90\
$(SRC)gkvp_colli.f90\
$(SRC)$(FFT).f90\
$(SRC)gkvp_fld.f90\
$(SRC)gkvp_colliimp.f90\
$(SRC)gkvp_freq.f90\
$(SRC)gkvp_zfilter.f90\
$(SRC)gkvp_geom.f90\
$(SRC)gkvp_exb.f90\
$(SRC)gkvp_trans.f90\
$(SRC)gkvp_advnc.f90\
Expand All @@ -87,13 +89,15 @@ gkvp: $(SRC)gkvp_header.f90\
$(FC) $(FFLAGS) -c $(SRC)gkvp_tips.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_vmecbzx.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_igs.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_ring.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_bndry.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_colli.f90
$(FC) $(FFLAGS) -c $(SRC)$(FFT).f90 $(INC)
$(FC) $(FFLAGS) -c $(SRC)gkvp_fld.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_colliimp.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_freq.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_zfilter.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_geom.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_exb.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_trans.f90
$(FC) $(FFLAGS) -c $(SRC)gkvp_advnc.f90
Expand All @@ -112,13 +116,15 @@ gkvp: $(SRC)gkvp_header.f90\
gkvp_tips.o\
gkvp_vmecbzx.o\
gkvp_igs.o\
gkvp_ring.o\
gkvp_bndry.o\
gkvp_colli.o\
$(FFT).o\
gkvp_fld.o\
gkvp_colliimp.o\
gkvp_freq.o\
gkvp_zfilter.o\
gkvp_geom.o\
gkvp_exb.o\
gkvp_trans.o\
gkvp_advnc.o\
Expand Down
14 changes: 5 additions & 9 deletions run/shoot
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ if [ $# -lt 2 ]; then
fi

#### Environment setting
DIR=/data/lng/maeyama/gkvp/f0.62/dev_shearflow/dev19_gamma0.2_remap
DIR=/data/group1/z43460z/gkvp/f0.61/ITGae-lin
LDM=gkvp.exe
NL=gkvp_namelist
SC=qsub
SC=pjsub
JS=sub.q
### For VMEC, set VMCDIR including metric_boozer.bin.dat
#VMCDIR=./input_vmec/vmec_sample_nss501ntheta1024nzeta0
Expand Down Expand Up @@ -76,19 +76,15 @@ do
#${SC} ${fln_JS}
if [ -z "$j" -a $i -eq $1 ]; then
echo "*** submit first step job ${fln_JS} ***"
${SC} ${fln_JS} | tee shoottempfile
j=`awk '{sub(".nqsv*",""); print $2}' shoottempfile`
${SC} --step --sparam "sn=$i" ${fln_JS} | tee shoottempfile
j=`awk '{sub("_.*",""); print $6}' shoottempfile`
rm shoottempfile
else
echo "*** submit sequential step job ${fln_JS} ***"
${SC} --after $j ${fln_JS} | tee shoottempfile
j=`awk '{sub(".nqsv*",""); print $2}' shoottempfile`
rm shoottempfile
${SC} --step --sparam "jid=$j,sd=ec!=0:all" ${fln_JS}
fi


sleep 1
i=$(( $i + 1 ))

done

Loading

0 comments on commit d029c71

Please sign in to comment.