Skip to content

Commit

Permalink
Fixes to Makefiles, update bin.block, update gitignore, update README…
Browse files Browse the repository at this point in the history
… for dprep.
  • Loading branch information
smsaleeb committed Sep 15, 2023
1 parent 183c7e0 commit e9d4867
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 4 deletions.
16 changes: 15 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,27 @@
*.grb1
*.grb2
dp-p[0-9]*

bin.block/example_modis_sst/*
bin.block/example_reynolds_sst/*
bin.block/mk-blkfiles*
bin.block/CreateSSTblockfiles.sc
bin.block/run_test_sstfiles.sc

bin.dp.grib1/example_data/*
bin.dp.grib1/dgrib*
bin.dp.grib1/rams_wgrib

bin.dp.grib2/example_data/*
bin.revu/example_data/*
bin.dp.grib2/wgrib*
bin.dp.grib2/dgrib*

bin.revu/example_data/*
bin.revu/revu*

bin.rams/dprep.test/*
bin.rams/rams*
bin.rams/cleanup.sc

# Ignore external libraries
misc/*
Expand Down
74 changes: 74 additions & 0 deletions bin.block/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#Makefile
###############################################################################
# Include definitions
###############################################################################
include ../include.mk
###############################################################################
# Compiler commands
###############################################################################
INCLUDES = $(UTILS_INCS) $(PAR_INCS) $(HDF5_INCS)
F_CD1 = $(F_COMP) -c $(F_OPTS1) $(INCLUDES)
F_CD2 = $(F_COMP) -c $(F_OPTS2) $(INCLUDES)
C_CD = $(C_COMP) -c $(C_OPTS) $(INCLUDES) $(PAR_DEFS) $(HDF5_DEFS)

C_CM =$(C_CD) -D$(CMACH) $< && $(ARCH) $@ $(<F:.c=.o) && rm -f $(<F:.c=.o)
F_CM1=$(F_CD1) $< && $(ARCH) $@ $(<F:.f90=.o) && rm -f $(<F:.f90=.o)
F_CM2=$(F_CD2) $< && $(ARCH) $@ $(<F:.f90=.o) && rm -f $(<F:.f90=.o)
F_CM3=$(F_CD2) -D$(CMACH) $< && $(ARCH) $@ $(<F:.F90=.o) && rm -f $(<F:.F90=.o)

################################################################################
## File extension rules
################################################################################
$(ARC)(%.o): %.f90; $(F_CM2)

$(ARC)(%.o): %.F90; $(F_CM3)

$(ARC)(%.o): %.c; $(C_CM)

################################################################################
# Define objects
################################################################################
OBJ = $(ARC)($(MODEL)/block/hdf5_f2c.o) \
$(ARC)($(MODEL)/block/hdf5_utils.o) \
$(ARC)($(MODEL)/lib/rget.o)

###############################################################################
# Define archive and executable names
###############################################################################
BASE=mk-blkfiles
EXE=$(BASE)-$(RAMS_VERSION)
ARC=$(BASE)-$(RAMS_VERSION).a

# Define main source.
MAIN_OBJ = ./mk_main.o
MAIN = $(MODEL)/block/mk_main.f90

# Define targets.
all: $(EXE)

$(EXE): $(ARC) $(MAIN) FORCE
@echo ""
$(F_COMP) -o $(EXE) $(MAIN_OBJ) $(LOADER_OPTS) $(ARC) \
$(HDF5_LIBS) $(LIBS) $(PAR_LIBS)
rm -f *.o
@echo ""
@echo Finished building === $(EXE)
@echo ""

$(MAIN): FORCE
@echo ""
$(F_CD2) $@

$(ARC): $(OBJ)

FORCE:

check: FORCE
@echo ""
check

clean:
@echo ""
rm -f $(ARC) $(EXE) $(BASE) *.o *.mod *.f
@echo ""

2 changes: 1 addition & 1 deletion bin.dp.grib1/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ rams_wgrib:
$(EXE): $(ARC) $(MAIN) FORCE
@echo ""
$(F_COMP) -o $(EXE) $(MAIN_OBJ) $(LOADER_OPTS) $(ARC) \
$(PAR_LIBS)
$(HDF5_LIBS) $(LIBS) $(PAR_LIBS)
rm -f *.o
@echo ""
@echo Finished building === $(EXE)
Expand Down
2 changes: 1 addition & 1 deletion bin.dp.grib2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ wgrib2:
$(EXE): $(ARC) $(MAIN) FORCE
@echo ""
$(F_COMP) -o $(EXE) $(MAIN_OBJ) $(LOADER_OPTS) $(ARC) \
$(PAR_LIBS)
$(HDF5_LIBS) $(LIBS) $(PAR_LIBS)
rm -f *.o
@echo ""
@echo Finished building === $(EXE)
Expand Down
7 changes: 7 additions & 0 deletions bin.dp.grib2/README.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Before compiling, you need a precompiled executable for "wgrib2".
We have used version wgrib2 2.0.3 downloaded September 19, 2019.
You will need to search for this software online and compile for your system.
The executable name should be "wgrib2" and should be placed in this directory
for the Makefile to find.

1. Type "make" to compile after you have setup your ../include.mk file.

2. Run sample executable like "dgrib-6.2.11" to see instructions on how to
Expand All @@ -12,3 +18,4 @@
In these routines are the specfications for adding a new dataset. Grib
names and numbers and labels can vary among datasets and each variation
has to be customized as a new datatype.

2 changes: 1 addition & 1 deletion include.mk
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ MAKE=/usr/bin/make
#############################################################################
# Set your RAMS root path and version number.
#############################################################################
RAMS_ROOT=/home/smsaleeb/rams_steve_git/RAMS
RAMS_ROOT=/home/smsaleeb/rams_git_dev
RAMS_VERSION=6.3.04

#############################################################################
Expand Down

0 comments on commit e9d4867

Please sign in to comment.