diff --git a/templates/coawst/.keep b/templates/coawst/.keep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/templates/coawst/KJQX/.keep b/templates/coawst/KJQX/.keep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/templates/coawst/KJQX/ARmake.inc.patch b/templates/coawst/KJQX/ARmake.inc.patch new file mode 100644 index 0000000000000000000000000000000000000000..3cffae8fbe30464520e9dde98c315abf5653f312 --- /dev/null +++ b/templates/coawst/KJQX/ARmake.inc.patch @@ -0,0 +1,213 @@ +--- ARmake.inc 2023-06-03 19:45:17.000000000 +0800 ++++ ARmake.inc-modified 2025-06-10 17:52:58.902219964 +0800 +@@ -1,4 +1,4 @@ +-############################################################################ ++########################################################################### + # + # Program: ARPACK + # +@@ -19,55 +19,94 @@ + # %---------------------------------% + # + # %---------------------------------------------------------% ++# | If you are using a VENDOR SUPPLIED VERSION of MPI, you | ++# | must replace the mpif.h in the following directories | ++# | | ++# | ARPACK/PARPACK/SRC/MPI/mpif.h | ++# | ARPACK/PARPACK/UTIL/MPI/mpif.h | ++# | ARPACK/PARPACK/EXAMPLES/MPI/mpif.h | ++# | | ++# | with the one for the native implementation. | ++# %---------------------------------------------------------% ++# ++# %---------------------------------------------------------% + # | The complete path to the top level of ARPACK directory, | + # | usually $(HOME)/ARPACK | + # %---------------------------------------------------------% + # +-ROMSHOME=/home/export/online3/swsoftware/yyj/coawst/COAWST-x86 +-export ROMSHOME=/home/export/online3/swsoftware/yyj/coawst/COAWST-x86 ++ROMSHOME=${COAWST_INSTALL_PATH} ++export ROMSHOME=${COAWST_INSTALL_PATH} + home = $(ROMSHOME)/Lib/ARPACK + # +-# %--------------------------------------% +-# | The platform identifier to suffix to | +-# | the end of library names | +-# %--------------------------------------% +-# +-#PLAT = dbg_daggoo +-#PLAT = daggoo +-#PLAT = dbg_moby +- PLAT = moby +-# +-# %------------------------------------------------------% +-# | The directories to find the various pieces of ARPACK | +-# %------------------------------------------------------% ++# ++# %---------------------------------------------------------% ++# | The platform identifier to suffix to the end of library | ++# | names. Don't forget to include the underscore! | ++# | | ++# | PLAT = _myhost | ++# %---------------------------------------------------------% ++# ++PLAT = ++# ++# %---------------------------------------------------------% ++# | The communication library (for parallel library only) | ++# | Current availible platforms are: BLACS or MPI | ++# %---------------------------------------------------------% ++# ++COMMLIB = MPI ++# ++# %--------------------------------------------------------% ++# | The directories to find the various pieces of ARPACK | ++# %--------------------------------------------------------% + # + BLASdir = $(home)/BLAS + LAPACKdir = $(home)/LAPACK + UTILdir = $(home)/UTIL + SRCdir = $(home)/SRC +-# ++PSRCdir = $(home)/PARPACK/SRC/$(COMMLIB) ++PUTILdir = $(home)/PARPACK/UTIL/$(COMMLIB) + # + DIRS = $(BLASdir) $(LAPACKdir) $(UTILdir) $(SRCdir) + # +-# %-------------------------------------------------------------------% +-# | Comment out the previous line and uncomment the following | +-# | if you already have the BLAS and LAPACK installed on your system. | +-# | NOTE: ARPACK assumes the use of LAPACK version 2 codes. | +-# %-------------------------------------------------------------------% +-# ++# %---------------------------------------------------------% ++# | Comment out the previous line and uncomment the | ++# | following if you already have BLAS and LAPACK installed | ++# | on your system. | ++# | NOTE: ARPACK assumes the use of LAPACK version 2 codes. | ++# %---------------------------------------------------------% ++# + #DIRS = $(UTILdir) $(SRCdir) + # ++# %---------------------------------------------------------% ++# | The name of the libraries to be created/linked to. | ++# | If you set PLAT above make sure to include it in the | ++# | library name(s): | ++# | | ++# | ARPACKLIB = $(home)/libarpack$(PLAT).a | ++# | PARPACKLIB = $(home)/libparpack$(PLAT).a | ++# %---------------------------------------------------------% + # +-# %---------------------------------------------------% +-# | The name of the libraries to be created/linked to | +-# %---------------------------------------------------% +-# +-ARPACKLIB = $(home)/libarpack_$(PLAT).a +-LAPACKLIB = +-BLASLIB = ++ARPACKLIB = $(home)/libarpack.a ++PARPACKLIB = $(home)/libparpack.a ++LAPACKLIB = ++BLASLIB = + +-ALIBS = $(ARPACKLIB) $(LAPACKLIB) $(BLASLIB) ++ALIBS = $(ARPACKLIB) $(LAPACKLIB) $(BLASLIB) ++# ++# %---------------------------------------------------------% ++# | If your system users custom MPI libraries specify them | ++# | here for linking with Parallel ARPACK. | ++# | | ++# | MPILIBS = -lfmpi -lmpi | ++# | | ++# | If your system uses mpif90 or other wrapper scripts you | ++# | should leave this blank. | ++# %---------------------------------------------------------% ++# ++MPILIBS = + ++PLIBS = $(PARPACKLIB) $(ALIBS) $(MPILIBS) ++# + # %---------------------------------------------------------% + # | SECTION 2: COMPILERS | + # | | +@@ -82,7 +121,7 @@ + # %------------------------------% + # + .SUFFIXES: +-.SUFFIXES: .f .o ++.SUFFIXES: .f .o + # + # %------------------% + # | Default command. | +@@ -101,43 +140,42 @@ + @$(FC) -c $(FFLAGS) $< + + # +-# %-----------------------------------------% +-# | Various compilation programs and flags. | +-# | You need to make sure these are correct | +-# | for your system. | +-# %-----------------------------------------% ++# %---------------------------------------------------------% ++# | Various compilation programs and flags. You need to | ++# | make sure these are correct for your system. | ++# %---------------------------------------------------------% + # + +-FC = mpif90 +-#FFLAGS = -g +-FFLAGS = ++FC = mpif90 ++PFC = mpif90 ++#FFLAGS = -g ++FFLAGS = -O3 -faarch64-pow-alt-precision=21 -mllvm -enable-alt-precision-math-functions -mllvm -disable-sincos-opt -Hx,124,0xc00000 -faarch64-minmax-alt-precision -ffp-compatibility=21 -ffp-model=precise -ffp-contract=off -lm + +-LDFLAGS = +-CD = cd ++LDFLAGS = ++CD = cd + +-ECHO = echo ++ECHO = echo + +-LN = ln +-LNFLAGS = -s ++LN = ln ++LNFLAGS = -s + +-MAKE = make ++MAKE = make + +-RM = rm +-RMFLAGS = -f ++RM = rm ++RMFLAGS = -f + +-SHELL = /bin/sh ++SHELL = /bin/sh + # +-# %----------------------------------------------------------------% +-# | The archiver and the flag(s) to use when building an archive | +-# | (library). Also the ranlib routine. If your system has no | +-# | ranlib, set RANLIB = touch. | +-# %----------------------------------------------------------------% ++# %--------------------------------------------------------% ++# | The archiver and the flag(s) to use when building an | ++# | archive (library). Also the ranlib routine. If your | ++# | system has no ranlib, set RANLIB = touch. | ++# %--------------------------------------------------------% + # + AR = ar + ARFLAGS = rv + #RANLIB = touch + RANLIB = ranlib +- + # + # %----------------------------------% + # | This is the general help target. | +@@ -145,3 +183,4 @@ + # + help: + @$(ECHO) "usage: make ?" ++ diff --git a/templates/coawst/KJQX/Linux-flang.mk.patch b/templates/coawst/KJQX/Linux-flang.mk.patch new file mode 100644 index 0000000000000000000000000000000000000000..932c8c24468e33f030746ed7ee65e8b81f367ae0 --- /dev/null +++ b/templates/coawst/KJQX/Linux-flang.mk.patch @@ -0,0 +1,280 @@ +--- /dev/null 2025-05-30 14:50:18.936000000 +0800 ++++ Linux-flang.mk 2025-06-10 17:51:04.153943719 +0800 +@@ -0,0 +1,277 @@ ++# svn $Id: Linux-gfortran.mk 897 2018-02-14 17:47:30Z arango $ ++#:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ++# Copyright (c) 2002-2019 The ROMS/TOMS Group ::: ++# Licensed under a MIT/X style license ::: ++# See License_ROMS.txt ::: ++#:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ++# ++# Include file for GNU Fortran compiler on Linux ++# ------------------------------------------------------------------------- ++# ++# ARPACK_LIBDIR ARPACK libary directory ++# FC Name of the fortran compiler to use ++# FFLAGS Flags to the fortran compiler ++# CPP Name of the C-preprocessor ++# CPPFLAGS Flags to the C-preprocessor ++# HDF5_INCDIR HDF5 include directory ++# HDF5_LIBDIR HDF5 library directory ++# HDF5_LIBS HDF5 library switches ++# NF_CONFIG NetCDF Fortran configuration script ++# CC Name of the C compiler ++# CFLAGS Flags to the C compiler ++# CXX Name of the C++ compiler ++# CXXFLAGS Flags to the C++ compiler ++# CLEAN Name of cleaning executable after C-preprocessing ++# NETCDF_INCDIR NetCDF include directory ++# NETCDF_LIBDIR NetCDF library directory ++# NETCDF_LIBS NetCDF library switches ++# LD Program to load the objects into an executable ++# LDFLAGS Flags to the loader ++# RANLIB Name of ranlib command ++# MDEPFLAGS Flags for sfmakedepend (-s if you keep .f files) ++# ++# First the defaults ++# ++ FC := flang ++ FFLAGS := -Wl,-z,muldefs -ffast-math -mllvm -aggressive-pgmath-pow-to-muls -O3 -fstack-arrays -mcpu=hip09 -mllvm -unroll-indirect-loads=true -mrecip=all:1 -L/usr/lib64 -ltirpc -L${BISHENG_INSTALL_PATH}/lib -lksvml -lmathlib -L${KML_NOARCH} -lkm -lm ++ CPP := /usr/bin/cpp ++ CPPFLAGS := -P -traditional ++ CC := clang ++ CXX := clang++ ++ CFLAGS := ++ CXXFLAGS := ++ LDFLAGS := ++ AR := ar ++ ARFLAGS := -r ++ MKDIR := mkdir -p ++ RM := rm -f ++ RANLIB := ranlib ++ PERL := perl ++ TEST := test ++ ++ MDEPFLAGS := --cpp --fext=f90 --file=- --objdir=$(SCRATCH_DIR) ++ ++# ++# Library locations, can be overridden by environment variables. ++# ++ ++ifdef USE_NETCDF4 ++ NF_CONFIG ?= nf-config ++ NETCDF_INCDIR ?= $(shell $(NF_CONFIG) --includedir) ++ LIBS := $(shell $(NF_CONFIG) --flibs) ++ ++else ++ NETCDF_INCDIR ?= /home/export/online3/swsoftware/intel_local/include ++ NETCDF_LIBDIR ?= /home/export/online3/swsoftware/intel_local/lib ++ LIBS := -L$(NETCDF_LIBDIR) -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lcurl -lz ++endif ++ ++ifdef USE_ARPACK ++ ifdef USE_MPI ++ PARPACK_LIBDIR ?= $(COAWST_INSTALL_PATH)/Lib/tool_libs ++ LIBS += -L$(PARPACK_LIBDIR) -lparpack ++ endif ++ ARPACK_LIBDIR ?= $(COAWST_INSTALL_PATH)/Lib/tool_libs ++ LIBS += -L$(ARPACK_LIBDIR) -larpack ++endif ++ ++ifdef USE_MPI ++ CPPFLAGS += -DMPI ++ ifdef USE_MPIF90 ++ FC := mpif90 ++ else ++ LIBS += -lfmpi -lmpi ++ endif ++endif ++ ++ifdef USE_OpenMP ++ CPPFLAGS += -D_OPENMP ++ FFLAGS += -fopenmp ++endif ++ ++ifdef USE_DEBUG ++ FFLAGS += -g -fbounds-check -fbacktrace ++ FFLAGS += -finit-real=nan -ffpe-trap=invalid,zero,overflow ++ CFLAGS += -g ++ CXXFLAGS += -g ++else ++ FFLAGS += -O3 ++# I do not use -ffast-math it does not maintain enough accuracy! ++ FFLAGS += -ftree-vectorize -funroll-loops -w -ffree-form -frecord-marker=4 -fconvert=big-endian -lm ++## -fconvert=big-endian ++endif ++ ++ifdef USE_MPI ++ FFLAGS += -I${$HMPI_INSTALL_PATH}/include ++endif ++ ++ifdef USE_ESMF ++ ESMF_OS ?= $(OS) ++ ESMF_SUBDIR := $(ESMF_OS).$(ESMF_COMPILER).$(ESMF_ABI).$(ESMF_COMM).$(ESMF_SITE) ++ ESMF_MK_DIR ?= $(ESMF_DIR)/lib/lib$(ESMF_BOPT)/$(ESMF_SUBDIR) ++ include $(ESMF_MK_DIR)/esmf.mk ++ FFLAGS += $(ESMF_F90COMPILEPATHS) ++ LIBS += $(ESMF_F90LINKPATHS) $(ESMF_F90ESMFLINKLIBS) ++endif ++ ++ifdef USE_CXX ++ LIBS += -lstdc++ ++endif ++ ++ifdef USE_MCT ++ MCT_INCDIR ?= $(COAWST_INSTALL_PATH)/Lib/tool_libs/include ++ MCT_LIBDIR ?= $(COAWST_INSTALL_PATH)/Lib/tool_libs/lib ++ FFLAGS += -I$(MCT_INCDIR) ++ LIBS += -L$(MCT_LIBDIR) -lmct -lmpeu ++endif ++ ++ifdef USE_WRF ++ FFLAGS += -I$(WRF_DIR)/main -I$(WRF_DIR)/external/esmf_time_f90 -I$(WRF_DIR)/frame -I$(WRF_DIR)/share ++ LIBS += WRF/main/module_wrf_top.o ++ LIBS += WRF/main/libwrflib.a ++ LIBS += WRF/external/fftpack/fftpack5/libfftpack.a ++ LIBS += WRF/external/io_grib1/libio_grib1.a ++ LIBS += WRF/external/io_grib_share/libio_grib_share.a ++ LIBS += WRF/external/io_int/libwrfio_int.a ++ LIBS += WRF/external/esmf_time_f90/libesmf_time.a ++ LIBS += WRF/external/RSL_LITE/librsl_lite.a ++ LIBS += WRF/frame/module_internal_header_util.o ++ LIBS += WRF/frame/pack_utils.o ++ LIBS += WRF/external/io_netcdf/libwrfio_nf.a ++# LIBS += WRF/external/io_netcdf/wrf_io.o ++endif ++ ++ifdef USE_WW3 ++ FFLAGS += -I${COAWST_WW3_DIR}/mod_DIST/ ++ LIBS += WW3/obj/libWW3.a ++endif ++ ++# ++# Use full path of compiler. ++# ++ FC := $(shell which ${FC}) ++ LD := $(FC) ++ ++# ++# Turn off bounds checking for function def_var, as "dimension(*)" ++# declarations confuse Gnu Fortran 95 bounds-checking code. ++# ++ ++$(SCRATCH_DIR)/def_var.o: FFLAGS += -fno-bounds-check ++ ++# ++# Allow integer overflow in ran_state.F. This is not allowed ++# during -O3 optimization. This option should be applied only for ++# Gfortran versions >= 4.2. ++# ++ ++FC_TEST := $(findstring $(shell ${FC} --version | head -1 | \ ++ awk '{ sub("Fortran 95", "Fortran"); print }' | \ ++ cut -d " " -f 4 | \ ++ cut -d "." -f 1-2), \ ++ 4.0 4.1) ++ ++ifeq "${FC_TEST}" "" ++$(SCRATCH_DIR)/ran_state.o: FFLAGS += -fno-strict-overflow ++endif ++ ++# ++# Set free form format in source files to allow long string for ++# local directory and compilation flags inside the code. ++# ++ ++#$(SCRATCH_DIR)/mod_ncparam.o: FFLAGS += -ffree-form -ffree-line-length-none ++#$(SCRATCH_DIR)/mod_strings.o: FFLAGS += -ffree-form -ffree-line-length-none ++#$(SCRATCH_DIR)/analytical.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/mod_ncparam.o: FFLAGS += -ffree-form ++$(SCRATCH_DIR)/mod_strings.o: FFLAGS += -ffree-form ++$(SCRATCH_DIR)/analytical.o: FFLAGS += -ffree-form ++$(SCRATCH_DIR)/biology.o: FFLAGS += -ffree-form -ffree-line-length-none ++ifdef USE_ADJOINT ++$(SCRATCH_DIR)/ad_biology.o: FFLAGS += -ffree-form -ffree-line-length-none ++endif ++ifdef USE_REPRESENTER ++$(SCRATCH_DIR)/rp_biology.o: FFLAGS += -ffree-form -ffree-line-length-none ++endif ++ifdef USE_TANGENT ++$(SCRATCH_DIR)/tl_biology.o: FFLAGS += -ffree-form -ffree-line-length-none ++endif ++ ++# ++# Supress free format in SWAN source files since there are comments ++# beyond column 72. ++# ++ ++ifdef USE_SWAN ++ ++$(SCRATCH_DIR)/ocpcre.o: FFLAGS += -ffixed-form ++$(SCRATCH_DIR)/ocpids.o: FFLAGS += -ffixed-form ++$(SCRATCH_DIR)/ocpmix.o: FFLAGS += -ffixed-form ++$(SCRATCH_DIR)/swancom1.o: FFLAGS += -ffixed-form ++$(SCRATCH_DIR)/swancom2.o: FFLAGS += -ffixed-form ++$(SCRATCH_DIR)/swancom3.o: FFLAGS += -ffixed-form ++$(SCRATCH_DIR)/swancom4.o: FFLAGS += -ffixed-form ++$(SCRATCH_DIR)/swancom5.o: FFLAGS += -ffixed-form ++$(SCRATCH_DIR)/swanmain.o: FFLAGS += -ffixed-form ++$(SCRATCH_DIR)/swanout1.o: FFLAGS += -ffixed-form ++$(SCRATCH_DIR)/swanout2.o: FFLAGS += -ffixed-form ++$(SCRATCH_DIR)/swanparll.o: FFLAGS += -ffixed-form ++$(SCRATCH_DIR)/swanpre1.o: FFLAGS += -ffixed-form ++$(SCRATCH_DIR)/swanpre2.o: FFLAGS += -ffixed-form ++$(SCRATCH_DIR)/swanser.o: FFLAGS += -ffixed-form ++$(SCRATCH_DIR)/swmod1.o: FFLAGS += -ffixed-form ++$(SCRATCH_DIR)/swmod2.o: FFLAGS += -ffixed-form ++$(SCRATCH_DIR)/SwanSpectPart.o: FFLAGS += -ffixed-form ++$(SCRATCH_DIR)/m_constants.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/m_fileio.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/mod_xnl4v5.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/serv_xnl4v5.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/nctablemd.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/agioncmd.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/swn_outnc.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SdsBabanin.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SwanBpntlist.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SwanCheckGrid.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SwanCompdata.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SwanCompUnstruc.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SwanComputeForce.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SwanConvAccur.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SwanConvStopc.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SwanCreateEdges.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SwanCrossObstacle.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SwanDiffPar.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SwanDispParm.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SwanFindObstacles.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SwanFindPoint.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SwanGridCell.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SwanGriddata.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SwanGridFace.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SwanGridobjects.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SwanGridTopology.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SwanGridVert.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SwanGSECorr.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SwanInitCompGrid.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SwanInterpolateAc.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SwanInterpolateOutput.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SwanInterpolatePoint.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SwanIntgratSpc.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SwanPointinMesh.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SwanPrepComp.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SwanPrintGridInfo.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SwanPropvelS.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SwanPropvelX.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SwanReadADCGrid.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SwanReadEasymeshGrid.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SwanReadGrid.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SwanReadTriangleGrid.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SwanSweepSel.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SwanThreadBounds.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SwanTranspAc.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SwanTranspX.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/SwanVertlist.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/waves_control.o: FFLAGS += -ffree-form -ffree-line-length-none ++$(SCRATCH_DIR)/waves_coupler.o: FFLAGS += -ffree-form -ffree-line-length-none ++endif ++ ++ ++ diff --git a/templates/coawst/KJQX/Makefile.conf.patch b/templates/coawst/KJQX/Makefile.conf.patch new file mode 100644 index 0000000000000000000000000000000000000000..b260c1d6690da2eaf030ced6b6d4d14ae86bb1f9 --- /dev/null +++ b/templates/coawst/KJQX/Makefile.conf.patch @@ -0,0 +1,130 @@ +--- Makefile.conf 2023-06-03 19:45:14.000000000 +0800 ++++ Makefile.conf-modified 2025-06-10 17:51:43.564786235 +0800 +@@ -4,64 +4,63 @@ + # FORTRAN COMPILER VARIABLES # + + # FORTRAN COMPILER COMMAND +-FC = mpif90 ++FC = mpif90 + + # FORTRAN AND FORTRAN90 COMPILER FLAGS +-FCFLAGS = ++FCFLAGS = ++# FORTRAN90 ONLY COMPILER FLAGS ++F90FLAGS = + +-# FORTRAN90 ONLY COMPILER FLAGS +-F90FLAGS = +- +-# FORTRAN COMPILE FLAG FOR AUTOPROMOTION ++# FORTRAN COMPILE FLAG FOR AUTOPROMOTION + # OF NATIVE REAL TO 8 BIT REAL +-REAL8 = ++REAL8 = + + # FORTRAN COMPILE FLAG FOR CHANGING BYTE ORDERING +-ENDIAN = ++ENDIAN = + + # INCLUDE FLAG FOR LOCATING MODULES (-I, -M, or -p) + INCFLAG = -I + + # INCLUDE PATHS (PREPEND INCLUDE FLAGS -I, -M or -p) +-INCPATH = ++INCPATH = + + # MPI LIBRARIES (USUALLY -lmpi) +-MPILIBS = ++MPILIBS = + + # PREPROCESSOR VARIABLES # + + # COMPILER AND OS DEFINE FLAGS +-DEFS = -DSYSLINUX -DCPRGNU ++DEFS = -DSYSLINUX -DCPRUNKNOWNCPR + +-# SET A SEPARATE PREPROCESSOR COMMAND IF FORTRAN COMPILER ++# SET A SEPARATE PREPROCESSOR COMMAND IF FORTRAN COMPILER + # DOES NOT HANDLE PREPROCESSING OF SOURCE FILES + + # FORTRAN PREPROCESSOR COMMAND +-FPP = cpp ++FPP = cpp + + # FOTRAN PREPROCESSOR FLAGS +-FPPFLAGS = -P -C -N -traditional ++FPPFLAGS = -P -C -N -traditional + + # C COMPILER VARIABLES # + + # C COMPILER +-CC = gcc ++CC = mpicc + + # C COMPILER FLAGS - APPEND CFLAGS +-ALLCFLAGS = -DFORTRAN_UNDERSCORE_ -DSYSLINUX -DCPRGNU -O ++ALLCFLAGS = -DFORTRAN_UNDERSCORE_ -DSYSLINUX -DCPRUNKNOWNCPR -O + + # LIBRARY SPECIFIC VARIABLES # + + # USED BY MCT BABEL BINDINGS +-COMPILER_ROOT = +-BABELROOT = +-PYTHON = +-PYTHONOPTS = ++COMPILER_ROOT = ++BABELROOT = ++PYTHON = ++PYTHONOPTS = + + # USED BY MPI-SERIAL LIBRARY + + # SIZE OF FORTRAN REAL AND DOUBLE +-FORT_SIZE = ++FORT_SIZE = + + # SOURCE FILE TARGETS # + +@@ -69,7 +68,7 @@ + # BY SETTING TO .c.o + CRULE = .c.o + +-# ENABLE RULE FOR PROCESSING F90 SOURCE FILES ++# ENABLE RULE FOR PROCESSING F90 SOURCE FILES + # BY SETTING TO .F90.o AND DISABLING F90RULECPP + F90RULE = .F90.o + +@@ -81,22 +80,21 @@ + # INSTALLATION VARIABLES # + + # INSTALL COMMANDS +-INSTALL = /home/export/base/swyf/swsoftware/online3/yyj/coawst/COAWST-x86/Lib/MCT/install-sh -c +-MKINSTALLDIRS = /home/export/base/swyf/swsoftware/online3/yyj/coawst/COAWST-x86/Lib/MCT/mkinstalldirs ++INSTALL = ${COAWST_INSTALL_PATH}/Lib/MCT/install-sh -c ++MKINSTALLDIRS = ${COAWST_INSTALL_PATH}/Lib/MCT/mkinstalldirs + + # INSTALLATION DIRECTORIES +-abs_top_builddir= /home/export/base/swyf/swsoftware/online3/yyj/coawst/COAWST-x86/Lib/MCT +-MCTPATH = /home/export/base/swyf/swsoftware/online3/yyj/coawst/COAWST-x86/Lib/MCT/mct +-MPEUPATH = /home/export/base/swyf/swsoftware/online3/yyj/coawst/COAWST-x86/Lib/MCT/mpeu +-EXAMPLEPATH = /home/export/base/swyf/swsoftware/online3/yyj/coawst/COAWST-x86/Lib/MCT/examples +-MPISERPATH = +-libdir = /home/export/online3/swsoftware/yyj/coawst/intel_tool_lib/lib +-includedir = /home/export/online3/swsoftware/yyj/coawst/intel_tool_lib/include ++abs_top_builddir= ${COAWST_INSTALL_PATH}/Lib/MCT ++MCTPATH = ${COAWST_INSTALL_PATH}/Lib/MCT/mct ++MPEUPATH = ${COAWST_INSTALL_PATH}/Lib/MCT/mpeu ++EXAMPLEPATH = ${COAWST_INSTALL_PATH}/Lib/MCT/examples ++MPISERPATH = ++libdir = ${COAWST_INSTALL_PATH}/Lib/tool_libs/lib ++includedir = ${COAWST_INSTALL_PATH}/Lib/tool_libs/include + + # OTHER COMMANDS # +-AR = ar cq +-RM = rm -f +- ++AR = ar cq ++RM = rm -f + + + diff --git a/templates/coawst/KJQX/coawst.bash.patch b/templates/coawst/KJQX/coawst.bash.patch new file mode 100644 index 0000000000000000000000000000000000000000..04a865401cf3253bc388ce9de563a4c9227e0ecc --- /dev/null +++ b/templates/coawst/KJQX/coawst.bash.patch @@ -0,0 +1,92 @@ +--- coawst.bash 2023-06-03 19:43:29.000000000 +0800 ++++ coawst.bash-modified 2025-06-10 17:48:05.257040742 +0800 +@@ -51,7 +51,7 @@ + dprint=0 + cleanwrf=1 + cleanww3=1 +- ++. env.sh + while [ $# -gt 0 ] + do + case "$1" in +@@ -122,7 +122,7 @@ + + # Set a local environmental variable to define the path to the directories + # where all this project's files are kept. +-export MY_ROOT_DIR=/home/export/online3/swsoftware/yyj/coawst/COAWST-x86 ++export MY_ROOT_DIR=${PWD} + export MY_PROJECT_DIR=${MY_ROOT_DIR} + + # The path to the user's local current ROMS source code. +@@ -154,7 +154,7 @@ + # 4) NETCDF_CONFIG is needed by WW3. You need to set this: + #export NETCDF_CONFIG=${NETCDF_LIBDIR}/../bin/nc-config + # This may require nf-config, depending on your system. +-export NETCDF_CONFIG=/usr/sw/yyzlib/netcdf/bin/nc-config ++export NETCDF_CONFIG=`which nc-config` + #export NETCDF_CONFIG=/home/export/online1/swrjsys1/software/program/netcdf-4.1.3_para/bin/nc-config + #export NF_CONFIG=/home/export/online1/swrjsys1/software/program/netcdf-4.1.3_para/bin/nc-config + # +@@ -203,14 +203,14 @@ + + #export USE_OpenMP=on # shared-memory parallelism + +-#export FORT=ifort +-export FORT=gfortran ++export FORT=flang ++#export FORT=gfortran + #export FORT=pgi + + export USE_DEBUG= # use Fortran debugging flags + export USE_LARGE= # activate 64-bit compilation + export USE_NETCDF4=on # compile with NetCDF-4 library +- export USE_PARALLEL_IO=on # Parallel I/O with Netcdf-4/HDF5 ++ #export USE_PARALLEL_IO=on # Parallel I/O with Netcdf-4/HDF5 + + #export USE_MY_LIBS=on # use my library paths below + +@@ -292,15 +292,15 @@ + + if [ -n "${USE_MY_LIBS:+1}" ]; then + case "$FORT" in +- ifort ) ++ flang ) + export ESMF_OS=Linux +- export ESMF_COMPILER=ifort ++ export ESMF_COMPILER=flang + export ESMF_BOPT=O + export ESMF_ABI=64 + export ESMF_COMM=mpich + export ESMF_SITE=default + +- export ARPACK_LIBDIR=/opt/intelsoft/serial/ARPACK ++ export ARPACK_LIBDIR=${COAWST_INSTALL_PATH}/Lib/tool_libs + if [ -n "${USE_MPI:+1}" ]; then + if [ "${which_MPI}" = "mpich" ]; then + export ESMF_DIR=/opt/intelsoft/mpich/esmf +@@ -308,10 +308,10 @@ + export MCT_LIBDIR=/opt/intelsoft/mpich/mct/lib + export PARPACK_LIBDIR=/opt/intelsoft/mpich/PARPACK + elif [ "${which_MPI}" = "mpich2" ]; then +- export ESMF_DIR=/home/export/online3/swsoftware/yyj/coawst/intel_tool_lib/lib +- export MCT_INCDIR=/home/export/online3/swsoftware/yyj/coawst/intel_tool_lib/include +- export MCT_LIBDIR=/home/export/online3/swsoftware/yyj/coawst/intel_tool_lib/lib +- export PARPACK_LIBDIR=/home/export/online3/swsoftware/yyj/coawst/intel_tool_lib/lib ++ export ESMF_DIR=${COAWST_INSTALL_PATH}/Lib/tool_libs ++ export MCT_INCDIR=${COAWST_INSTALL_PATH}/Lib/tool_libs/include ++ export MCT_LIBDIR=${COAWST_INSTALL_PATH}/Lib/tool_libs/lib ++ export PARPACK_LIBDIR=${COAWST_INSTALL_PATH}/Lib/tool_libs + elif [ "${which_MPI}" = "openmpi" ]; then + export ESMF_DIR=/opt/intelsoft/openmpi/esmf + export MCT_INCDIR=/opt/intelsoft/openmpi/mct/include +@@ -333,8 +333,8 @@ + export NETCDF_INCDIR=/opt/intelsoft/openmpi/netcdf4/include + fi + else +- export NF_CONFIG=/opt/intelsoft/serial/netcdf4/bin/nf-config +- export NETCDF_INCDIR=/opt/intelsoft/serial/netcdf4/include ++ export NF_CONFIG=`which nf-config` ++ export NETCDF_INCDIR=`nc-config --includedir` + fi + else + export NETCDF_INCDIR=/opt/intelsoft/serial/netcdf3/include diff --git a/templates/coawst/KJQX/configure.wrf.patch b/templates/coawst/KJQX/configure.wrf.patch new file mode 100644 index 0000000000000000000000000000000000000000..36e79aebd7815e752b15f4e784f8a001ca23f7e1 --- /dev/null +++ b/templates/coawst/KJQX/configure.wrf.patch @@ -0,0 +1,90 @@ +--- configure.wrf 2023-06-03 20:10:38.000000000 +0800 ++++ configure.wrf-modified 2025-06-10 17:49:30.947221165 +0800 +@@ -45,7 +45,7 @@ + DWORDSIZE = 8 + LWORDSIZE = 4 + +-MCT_LIBDIR = /home/export/online3/swsoftware/yyj/coawst/tool_lib/lib ++MCT_LIBDIR = $(COAWST_INSTALL_PATH)/Lib/tool_libs/lib + ############################################################################## + #### The settings in this section are defaults that may be overridden by the + #### architecture-specific settings in the next section. +@@ -116,30 +116,30 @@ + OMP = # -fopenmp + OMPCC = # -fopenmp + SFC = mpif90 +-SCC = mpif90 ++SCC = mpicc + CCOMP = mpicc +-DM_FC = mpif90 +-DM_CC = mpicc -cc=$(SCC) ++DM_FC = mpif90 -I/usr/include/tirpc -L/usr/lib64 -ltirpc ++DM_CC = mpicc + FC = time $(DM_FC) + CC = $(DM_CC) -DFSEEKO64_OK + LD = $(FC) + RWORDSIZE = $(NATIVE_RWORDSIZE) + PROMOTION = #-fdefault-real-8 + ARCH_LOCAL = -DNONSTANDARD_SYSTEM_SUBR -DWRF_USE_CLM +-CFLAGS_LOCAL = -w -O3 -c ++CFLAGS_LOCAL = -w -O3 -c -Mcache_align -march=armv8.5-a+sve -funroll-loops -Wno-implicit-function-declaration -Wno-implicit-int -I/usr/include/tirpc -L/usr/lib64 -ltirpc -fvectorize + LDFLAGS_LOCAL = + CPLUSPLUSLIB = + ESMF_LDFLAG = $(CPLUSPLUSLIB) +-FCOPTIM = -O2 -ftree-vectorize -funroll-loops ++FCOPTIM = -O3 -Mcache_align -march=armv8.5-a+sve -funroll-loops -fhonor-nans -mllvm -unroll-indirect-loads=true -fveclib=KPL_SVML_SVE -fvectorize -L$BISHENG_INSTALL_PATH/lib -lksvml -lmathlib -L$(KML_NOARCH) -lkm -ffast-math -lm -fstack-arrays + FCREDUCEDOPT = $(FCOPTIM) + FCNOOPT = -O0 + FCDEBUG = # -g $(FCNOOPT) # -ggdb -fbacktrace -fcheck=bounds,do,mem,pointer -ffpe-trap=invalid,zero,overflow + FORMAT_FIXED = -ffixed-form +-FORMAT_FREE = -ffree-form -ffree-line-length-none ++FORMAT_FREE = -ffree-form + FCSUFFIX = + BYTESWAPIO = -fconvert='big-endian' -frecord-marker=4 + FCBASEOPTS_NO_G = -w $(FORMAT_FREE) $(BYTESWAPIO) +-FCBASEOPTS = $(FCBASEOPTS_NO_G) $(FCDEBUG) ++FCBASEOPTS = $(FCBASEOPTS_NO_G) $(FCDEBUG) -march=armv8.5-a+sve + MODULE_SRCH_FLAG = + TRADFLAG = -traditional-cpp + CPP = /lib/cpp -P -nostdinc +@@ -148,7 +148,7 @@ + M4 = m4 -G + RANLIB = ranlib + RLFLAGS = +-CC_TOOLS = cc ++CC_TOOLS = $(SCC) -Wno-implicit-function-declaration -Wno-implicit-int -I/usr/include/tirpc -L/usr/lib64 -ltirpc + + ########################################################### + ###################### +@@ -201,7 +201,7 @@ + -I$(WRF_SRC_ROOT_DIR)/wrftladj \ + -I$(WRF_SRC_ROOT_DIR)/chem -I$(WRF_SRC_ROOT_DIR)/inc \ + -I$(NETCDFPATH)/include \ +- -I/home/export/online3/swsoftware/yyj/coawst/COAWST-x86/$(SCRATCH_DIR) \ ++ -I$(COAWST_INSTALL_PATH)/$(SCRATCH_DIR) \ + + REGISTRY = Registry + CC_TOOLS_CFLAGS = -DNMM_CORE=$(WRF_NMM_CORE) +@@ -217,11 +217,11 @@ + $(WRF_SRC_ROOT_DIR)/frame/pack_utils.o + + LIB_EXTERNAL = \ +- -L$(WRF_SRC_ROOT_DIR)/external/io_netcdf -lwrfio_nf -L/home/export/online3/swsoftware/intel_local/lib -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lcurl -lz ++ -L$(WRF_SRC_ROOT_DIR)/external/io_netcdf -lwrfio_nf $(NETCDF_FLIBS) -lnetcdf #-lhdf5_hl -lhdf5 -lz + + LIB = $(LIB_BUNDLED) $(LIB_EXTERNAL) $(LIB_LOCAL) $(LIB_WRF_HYDRO) + LIB += -L$(MCT_LIBDIR) -lmct -lmpeu +-LIB += -L/home/export/online3/swsoftware/intel_local/lib -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lz ++LIB += $(NETCDF_FLIBS) -lnetcdf #-lhdf5_hl -lhdf5 -lz + LDFLAGS = $(OMP) $(FCFLAGS) $(LDFLAGS_LOCAL) + ENVCOMPDEFS = + WRF_CHEM = 0 +@@ -230,7 +230,7 @@ + CPPFLAGS += -D'PROJECT_HEADER="$(MY_HEADER_DIR)/$(HEADER)"' + CPPFLAGS += -D'GLOBAL_DEFS="$(GLOBAL_DEFS_FILE)"' + CPPFLAGS += $(ARCHFLAGS) $(ENVCOMPDEFS) -I$(LIBINCLUDE) $(TRADFLAG) +-NETCDFPATH = /home/export/online3/swsoftware/intel_local ++NETCDFPATH = $(NETCDF_PATH) + HDF5PATH = + WRFPLUSPATH = + RTTOVPATH = diff --git a/templates/coawst/KJQX/data.coawst.arm_clang.cpu.config b/templates/coawst/KJQX/data.coawst.arm_clang.cpu.config new file mode 100644 index 0000000000000000000000000000000000000000..6c5fad7fa4d7dff4928f4ab3f2702d2a5ac90af5 --- /dev/null +++ b/templates/coawst/KJQX/data.coawst.arm_clang.cpu.config @@ -0,0 +1,110 @@ +[SERVER] +11.11.11.11 + +[DOWNLOAD] + + +[DEPENDENCY] +set -e +set -x +# basic system components +module purge +./jarvis -install hpckit/25.0.0 com +module use ./software/compiler/hpckit/25.0.0/HPCKit/latest/modulefiles +module load bisheng/compiler4.2.0/bishengmodule +module load bisheng/hmpi25.0.0/hmpi +export CC="clang -Wno-implicit-function-declaration -Wno-incompatible-function-pointer-types" CXX=clang++ FC=flang +module use ./software/moduledeps/bisheng4.2.0 +export CC=mpicc CXX=mpicxx FC=mpifort +module use ./software/moduledeps/bisheng4.2.0-hmpi25.0.0 +./jarvis -install hdf5/1.12.0/clang clang+mpi +module load hdf5-clang/1.12.0 +./jarvis -install pnetcdf/1.12.1 clang+mpi +module load pnetcdf/1.12.1 +./jarvis -install netcdf/4.7.4/clang clang+mpi +module load netcdf-clang/4.7.4 +tar -zxvf ${JARVIS_DOWNLOAD}/COAWST-x86.tar.gz + +[ENV] +#!/bin/bash +module purge +module use ${JARVIS_ROOT}/software/compiler/hpckit/25.0.0/HPCKit/latest/modulefiles +module load bisheng/compiler4.2.0/bishengmodule +module use ${JARVIS_ROOT}/software/moduledeps/bisheng4.2.0 +module use ${JARVIS_ROOT}/software/moduledeps/bisheng4.2.0-hmpi25.0.0 +module load bisheng/hmpi25.0.0/hmpi +module load hdf5-clang/1.12.0 pnetcdf/1.12.1 netcdf-clang/4.7.4 +module load bisheng/kml25.0.0/kml + +export BISHENG_INSTALL_PATH=`which clang` +export BISHENG_INSTALL_PATH=${ BISHENG_INSTALL_PATH %/*/*} + +export HDF5_INSTALL_PATH=`which h5diff` +export HDF5_INSTALL_PATH=${ HDF5_INSTALL_PATH %/*/*} +export HDF5_PATH=${ HDF5_INSTALL_PATH } + +export PNETCDF_INSTALL_PATH=`pnetcdf-config --prefix` +export PNETCDF_PATH=${PNETCDF_INSTALL_PATH} + +export HMPI_INSTALL_PATH=`which mpirun` +export HMPI_INSTALL_PATH=${HMPI_INSTALL_PATH%/*/*} + +export COAWST_INSTALL_PATH=`pwd` + +export MCT_LIBDIR= ${COAWST_INSTALL_PATH}/Lib/tool_libs/lib +export MCT_INCDIR= ${COAWST_INSTALL_PATH}/Lib/tool_libs/include + +export NETCDF_FLIBS=`nc-config --flibs` +export KML_NOARCH=software/compiler/hpckit/25.0.0/HPCkit/25.0.0/kml/bisheng/lib/noarch + +COAWST_DIR=${JARVIS_ROOT}/COAWST-x86 + +[APP] +app_name = COAWST +build_dir = ${COAWST_DIR} +binary_dir = ${COAWST_DIR} +case_dir = ${COAWST_DIR}/casefile_72h + +[BUILD] +cd ${COAWST_DIR} +find -name *.a -delete +find -name *.o -delete +find -name *.mod -delete + +cd ${COAWST_DIR}/Lib/MCT +cp ${JARVIS_ROOT}/templates/coawst/KJQX/Makefile.conf.patch ./ +patch -p0 < Makefile.conf.patch +make && make install + +cd ${COAWST_DIR}/Lib/ARPACK +cp ${JARVIS_ROOT}/templates/coawst/KJQX/ARmake.inc.patch ./ +patch -p0 < ARmake.inc.patch +make all +cp *.a ../tool_libs + +cd ${COAWST_DIR}/Compilers +cp ${JARVIS_ROOT}/templates/coawst/KJQX/Linux-flang.mk.patch ./ +patch -p0 < Linux-flang.mk.patch + +cd ${COAWST_DIR}/WRF +cp ${JARVIS_ROOT}/templates/coawst/KJQX/configure.wrf.patch ./ +patch -p0 < configure.wrf.patch + +cd ${COAWST_DIR} +cp ${JARVIS_ROOT}/templates/coawst/KJQX/coawst.bash.patch ./ +patch -p0 < coawst.bash.patch + +sed -i '/^[[:space:]]*wrfclean:/,/^[[:space:]]*endif/ { /\.\/configure;[[:space:]]*\\[[:space:]]*$/ s/^/# / }' makefile +sed -i '/^[[:space:]]*wrf:/,/^[[:space:]]*endif/ { s/\.\/compile[[:space:]]\+em_real;[[:space:]]*\(\\\)\?/.\/compile -j 20 em_real; \1/ }' makefile + +./coawst.bash -j 20 2>&1|tee build.log + +[CLEAN] + + +[RUN] +run = mpirun --allow-run-as-root -n 32 -x OMP_NUM_THREADS=1 -bind-to core ./coawstM +binary = +nodes = 1 + +[JOB]