Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
danishyo committed Feb 18, 2022
2 parents 7d2ece4 + 10127da commit e6ef960
Show file tree
Hide file tree
Showing 19 changed files with 40 additions and 40 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -126,18 +126,18 @@ install-nuopc: schism_nuopc_lib
cp libschism_cap.a $(SCHISM_BUILD_DIR)/lib
#cp $(SCHISM_NUOPC_MODS) $(DESTDIR)
cp $(SCHISM_NUOPC_MODS) $(SCHISM_BUILD_DIR)/include/
sed 's#@@SCHISM_BUILD_DIR@@#'$(SCHISM_BUILD_DIR)'#g' ./src/schism/schism_cmi_nuopc.mk.in > $(DESTDIR)/schism.mk
#sed 's#@@SCHISM_BUILD_DIR@@#'$(SCHISM_BUILD_DIR)'#g' ./src/schism/schism_cmi_nuopc.mk.in > $(SCHISM_BUILD_DIR)/include/schism.mk
sed 's#@@SCHISM_BUILD_DIR@@#'$(SCHISM_BUILD_DIR)'#g' ./src/schism/schism_nuopc_cap.mk.in > $(DESTDIR)/schism.mk
#sed 's#@@SCHISM_BUILD_DIR@@#'$(SCHISM_BUILD_DIR)'#g' ./src/schism/schism_nuopc_cap.mk.in > $(SCHISM_BUILD_DIR)/include/schism.mk

##test: concurrent_esmf_test triple_schism multi_schism schism_pdaf
test: pdaf
pdaf: schism_pdaf

# Internal make targets for final linking
SCHISM_NUOPC_MODS=$(addprefix src/schism/,schism_nuopc_util.mod schism_cmi_nuopc.mod)
SCHISM_NUOPC_OBJS=$(addprefix src/schism/,schism_nuopc_util.o schism_cmi_nuopc.o)
SCHISM_ESMF_MODS=$(addprefix src/schism/,schism_cmi_esmf.mod)
SCHISM_ESMF_OBJS=$(addprefix src/schism/,schism_cmi_esmf.o)
SCHISM_NUOPC_MODS=$(addprefix src/schism/,schism_nuopc_util.mod schism_nuopc_cap.mod)
SCHISM_NUOPC_OBJS=$(addprefix src/schism/,schism_nuopc_util.o schism_nuopc_cap.o)
SCHISM_ESMF_MODS=$(addprefix src/schism/,schism_esmf_cap.mod)
SCHISM_ESMF_OBJS=$(addprefix src/schism/,schism_esmf_cap.o)
SCHISM_MODS=$(addprefix src/schism/,schism_bmi.mod schism_esmf_util.mod)
SCHISM_OBJS=$(addprefix src/schism/,schism_bmi.o schism_esmf_util.o)
PDAF_OBJS=$(addprefix src/PDAF_bindings/,parser_mpi.o mod_parallel_pdaf.o mod_assimilation.o init_parallel_pdaf.o \
Expand Down
2 changes: 1 addition & 1 deletion concurrent_esmf_test.F90
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
program main

use esmf
use schism_cmi_esmf, only: schismSetServices => SetServices
use schism_esmf_cap, only: schismSetServices => SetServices
use atmosphere_cmi_esmf, only: atmosSetServices => SetServices

implicit none
Expand Down
2 changes: 1 addition & 1 deletion multi_schism.F90
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
program main

use esmf
use schism_cmi_esmf, only: schismSetServices => SetServices
use schism_esmf_cap, only: schismSetServices => SetServices
use schism_esmf_util, only: clockCreateFrmParam

implicit none
Expand Down
4 changes: 2 additions & 2 deletions schism_pdaf.F90
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
! This code is a main driver for a coupled SCHISM and PDAF
! program for running multiple schism components concurrently in flexible mode
! (i.e. multiple tasks can share same PET list). The coupling model interface is
! schism_cmi_esmf.F90 (and interfaces are defined in schism_bmi.F90)
! schism_esmf_cap.F90 (and interfaces are defined in schism_bmi.F90)
!
! @copyright (C) 2018, 2019, 2020-2021 Helmholtz-Zentrum Geesthacht
! @author Richard Hofmeister
Expand Down Expand Up @@ -36,7 +36,7 @@
program main

use esmf
use schism_cmi_esmf, only: schismSetServices => SetServices
use schism_esmf_cap, only: schismSetServices => SetServices
! use schism_msgp, only: parallel_abort,myrank
! use schism_glbl, only: errmsg,tr_el
! USE mod_assimilation, & ! Variables for assimilation
Expand Down
8 changes: 4 additions & 4 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ endif

MODELS=atmosphere_cmi_nuopc.o

SCHISM_NUOPC=schism_cmi_nuopc.o schism_esmf_util.o schism_nuopc_util.o schism_bmi.o
SCHISM_ESMF=schism_cmi_nuopc.o schism_esmf_util.o schism_bmi.o
SCHISM_NUOPC=schism_nuopc_cap.o schism_esmf_util.o schism_nuopc_util.o schism_bmi.o
SCHISM_ESMF=schism_nuopc_cap.o schism_esmf_util.o schism_bmi.o
MODEL_OBJS:=$(addprefix ../model/,$(MODELS))
SCHISM_NUOPC_OBJS:=$(addprefix ../schism/,$(SCHISM_NUOPC))
SCHISM_ESMF_OBJS:=$(addprefix ../schism/,$(SCHISM_ESMF))
Expand All @@ -61,11 +61,11 @@ default: all
$(ESMF_F90COMPILER) -c $(ESMF_F90COMPILEOPTS) $(ESMF_F90COMPILEPATHS) $(ESMF_F90COMPILEFREECPP) $(ESMF_F90COMPILECPPFLAGS) $(F90FLAGS) -o $@ $<

main_esmf: main_esmf.o driver/toplevel_schism_netcdf.o model/atmosphere_cmi_nuopc.o \
$(addprefix schism/,schism_cmi_esmf.o schism_esmf_util.o schism_bmi.o)
$(addprefix schism/,schism_esmf_cap.o schism_esmf_util.o schism_bmi.o)
$(ESMF_F90LINKER) $(ESMF_F90LINKOPTS) $(ESMF_F90LINKPATHS) $(ESMF_F90LINKRPATHS) -I. -o $@ $^ $(ESMF_F90ESMFLINKLIBS) $(F90FLAGS) $(MOSSCO_LIB) $(LDFLAGS) $(LIBS)

main_nuopc: main_nuopc.o driver/driver_schism_atm.o model/atmosphere_cmi_nuopc.o \
$(addprefix schism/,schism_cmi_nuopc.o schism_esmf_util.o schism_nuopc_util.o schism_bmi.o)
$(addprefix schism/,schism_nuopc_cap.o schism_esmf_util.o schism_nuopc_util.o schism_bmi.o)
$(ESMF_F90LINKER) $(ESMF_F90LINKOPTS) $(ESMF_F90LINKPATHS) $(ESMF_F90LINKRPATHS) -I. -o $@ $^ $(ESMF_F90ESMFLINKLIBS) $(F90FLAGS) $(LDFLAGS) $(LIBS)

main_esmf.o: driver/toplevel_schism_atm.o main_esmf.F90 Makefile
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.nuopc.bak
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ $(error ESMFMKFILE has to be set in environment.)
endif
include $(ESMFMKFILE)

include schism/schism_cmi_nuopc.mk
include schism/schism_nuopc_cap.mk
DEP_FRONTS:= $(DEP_FRONTS) -DFRONT_SCHISM=$(ESMF_DEP_FRONT)
DEP_INCS:= $(DEP_INCS) $(addprefix -I, $(ESMF_DEP_INCPATH))
DEP_CMPL_OBJS:= $(DEP_CMPL_OBJS) $(ESMF_DEP_CMPL_OBJS)
Expand Down
6 changes: 3 additions & 3 deletions src/PDAF_bindings/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ LDFLAGS+= -L$(SCHISM_BUILD_DIR)/lib -L$(PDAF_BUILD_DIR) -lpdaf-d
%.o : %.F90
$(ESMF_F90COMPILER) -c $(ESMF_F90COMPILEOPTS) $(ESMF_F90COMPILEPATHS) $(ESMF_F90COMPILEFREECPP) $(ESMF_F90COMPILECPPFLAGS) $(F90FLAGS) $<

#schism_cmi_nuopc.o: schism_esmf_util.o schism_bmi.o
#schism_cmi_esmf.o: schism_esmf_util.o schism_bmi.o
#schism_nuopc_cap.o: schism_esmf_util.o schism_bmi.o
#schism_esmf_cap.o: schism_esmf_util.o schism_bmi.o
#schism_esmf_util.o: schism_bmi.o

.PHONY: clean default all
Expand All @@ -85,7 +85,7 @@ esmf: parser_mpi.o mod_parallel_pdaf.o mod_assimilation.o init_parallel_pdaf.o i
collect_state_pdaf.o init_dim_obs_pdaf.o obs_op_pdaf.o init_obs_pdaf.o prodrinva_pdaf.o init_obsvar_pdaf.o assimilate_pdaf.o \
init_dim_obs_f_pdaf.o init_dim_obs_l_pdaf.o obs_op_f_pdaf.o init_obs_f_pdaf.o init_obs_l_pdaf.o prodrinva_l_pdaf.o init_obsvar_l_pdaf.o \
init_n_domains_pdaf.o init_dim_l_pdaf.o g2l_state_pdaf.o l2g_state_pdaf.o g2l_obs_pdaf.o
nuopc: schism_cmi_nuopc.o
nuopc: schism_nuopc_cap.o

clean:
$(RM) PET*.ESMF_LogFile traceout *.nc *.stdout
Expand Down
4 changes: 2 additions & 2 deletions src/driver/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ endif
CMI_NUOPC_OBJS:=$(addprefix ../model/,$(CMI_NUOPC))
CMI_ESMF_OBJS:=$(addprefix ../model/,$(CMI_ESMF))
CMI_MOSSCO_OBJS:=$(addprefix ../mossco/,$(CMI_MOSSCO))
CMI_NUOPC_SCHISM_OBJ:=$(addprefix ../schism/,schism_cmi_nuopc.o)
CMI_ESMF_SCHISM_OBJ:=$(addprefix ../schism/,schism_cmi_esmf.o)
CMI_NUOPC_SCHISM_OBJ:=$(addprefix ../schism/,schism_nuopc_cap.o)
CMI_ESMF_SCHISM_OBJ:=$(addprefix ../schism/,schism_esmf_cap.o)

F90FLAGS += -I../model -I ../schism
ifeq ($(origin MOSSCO_DIR), environment)
Expand Down
2 changes: 1 addition & 1 deletion src/driver/driver_schism.F90
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module driver_schism
driver_routine_SS => SetServices, &
driver_label_SetModelServices => label_SetModelServices

use schism_cmi_nuopc, only: schismSS => SetServices
use schism_nuopc_cap, only: schismSS => SetServices

implicit none

Expand Down
2 changes: 1 addition & 1 deletion src/driver/driver_schism_atm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module driver_schism_atm
driver_label_SetModelServices => label_SetModelServices

use atmosphere_cmi_nuopc, only: atmosphereSS => SetServices
use schism_cmi_nuopc, only: schismSS => SetServices
use schism_nuopc_cap, only: schismSS => SetServices

use NUOPC_Connector, only: cplSS => SetServices

Expand Down
2 changes: 1 addition & 1 deletion src/driver/toplevel_schism_atm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
module toplevel_schism_atm

use esmf
use schism_cmi_esmf, only: schismSetServices => SetServices
use schism_esmf_cap, only: schismSetServices => SetServices
use atmosphere_cmi_esmf, only: atmosSetServices => SetServices

implicit none
Expand Down
2 changes: 1 addition & 1 deletion src/driver/toplevel_schism_netcdf.F90
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
module toplevel_schism_netcdf

use esmf
use schism_cmi_esmf, only: schismSetServices => SetServices
use schism_esmf_cap, only: schismSetServices => SetServices
use netcdf_component, only: netcdfSetServices => SetServices

implicit none
Expand Down
8 changes: 4 additions & 4 deletions src/schism/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,17 @@ else
$(ESMF_F90COMPILER) -c $(ESMF_F90COMPILEOPTS) $(ESMF_F90COMPILEPATHS) $(ESMF_F90COMPILEFREECPP) $(ESMF_F90COMPILECPPFLAGS) $(F90FLAGS) $<
endif

schism_cmi_nuopc.o: schism_nuopc_util.o schism_esmf_util.o schism_bmi.o
schism_cmi_esmf.o: schism_esmf_util.o schism_bmi.o
schism_nuopc_cap.o: schism_nuopc_util.o schism_esmf_util.o schism_bmi.o
schism_esmf_cap.o: schism_esmf_util.o schism_bmi.o
schism_esmf_util.o: schism_bmi.o
schism_nuopc_util.o: schism_bmi.o

.PHONY: clean default all

default: all
all: nuopc esmf
esmf: schism_cmi_esmf.o
nuopc: schism_cmi_nuopc.o
esmf: schism_esmf_cap.o
nuopc: schism_nuopc_cap.o
common: schism_esmf_util.o schism_bmi.o

clean:
Expand Down
2 changes: 1 addition & 1 deletion src/schism/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ ESMF gridded component.
For each NUOPC_Model, there is a corresponding Makefile snippet. Currently
available components are

schism_cmi_nuopc
schism_nuopc_cap
: NUOPC cap for SCHISM
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
#define ESMF_CONTEXT line=__LINE__,file=ESMF_FILENAME,method=ESMF_METHOD
#define ESMF_ERR_PASSTHRU msg="SCHISM subroutine call returned error"
#undef ESMF_FILENAME
#define ESMF_FILENAME "schism_cmi_esmf.F90"
#define ESMF_FILENAME "schism_esmf_cap.F90"

#define _SCHISM_LOG_AND_FINALIZE_ON_ERROR_(X) if (ESMF_LogFoundError(localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=X)) call ESMF_Finalize(rc=localrc, endflag=ESMF_END_ABORT)

module schism_cmi_esmf
module schism_esmf_cap

use schism_bmi
use schism_esmf_util
Expand Down Expand Up @@ -1577,4 +1577,4 @@ subroutine schism_get_state(ci)
ncid_schism_io=ncid_c(ci)
end subroutine schism_get_state

end module schism_cmi_esmf
end module schism_esmf_cap
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
#define ESMF_CONTEXT line=__LINE__,file=ESMF_FILENAME,method=ESMF_METHOD
#define ESMF_ERR_PASSTHRU msg="SCHISM subroutine call returned error"
#undef ESMF_FILENAME
#define ESMF_FILENAME "schism_cmi_nuopc.F90"
#define ESMF_FILENAME "schism_nuopc_cap.F90"

#define _SCHISM_LOG_AND_FINALIZE_ON_ERROR_(X) if (ESMF_LogFoundError(rcToCheck=localrc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=X)) call ESMF_Finalize(rc=localrc, endflag=ESMF_END_ABORT)

#define _SCHISM_LOG_AND_FINALIZE_ON_ERRORS_(X) if (ESMF_LogFoundError(rcToCheck=localRc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=X) .or. ESMF_LogFoundError(rcToCheck=userRc, ESMF_ERR_PASSTHRU, ESMF_CONTEXT, rcToReturn=X)) call ESMF_Finalize(rc=localrc, endflag=ESMF_END_ABORT)

module schism_cmi_nuopc
module schism_nuopc_cap

use esmf
use nuopc
Expand Down Expand Up @@ -844,4 +844,4 @@ subroutine SCHISM_RemoveUnconnectedFields(state, rc)
enddo
end subroutine SCHISM_RemoveUnconnectedFields

end module schism_cmi_nuopc
end module schism_nuopc_cap
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ ifeq ($(wildcard $(SCHISM_BUILD_DIR)/lib/libhydro.a),)
$(error SCHISM has to be compiled before ESMF-SCHISM.)
endif

STEMS=schism_bmi schism_esmf_util schism_cmi_nuopc
STEMS=schism_bmi schism_esmf_util schism_nuopc_cap
OBJS=$(addsuffix .o, $(STEMS))
LIBS=-lhydro -lcore -lparmetis -lmetis
CWD=$(shell pwd)/schism

# 1. ESMF_DEP_FRONT - The name of the Fortran module to be used in a USE statement, or (if it ends in ".h") the name of the header file to be used in an #include statement, or (if it ends in ".so") the name of the shared object to be loaded at run-time.

ESMF_DEP_FRONT=schism_cmi_nuopc
ESMF_DEP_FRONT=schism_nuopc_cap

# 2. ESMF_DEP_INCPATH - The include path to find module or header files during compilation. Must be specified as absolute path.
ESMF_DEP_INCPATH=$(CWD) $(SCHISM_BUILD_DIR)/include
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ ifeq ($(wildcard @@SCHISM_BUILD_DIR@@/lib/libhydro.a),)
$(error SCHISM has to be compiled before ESMF-SCHISM in build directory @@SCHISM_BUILD_DIR@@.)
endif

#STEMS=schism_bmi schism_esmf_util schism_cmi_nuopc
#STEMS=schism_bmi schism_esmf_util schism_nuopc_cap
#OBJS=$(addsuffix .o, $(STEMS))
LIBS=-lschism_cap -lhydro -lcore -lparmetis -lmetis
CWD=$(shell pwd)/schism

# 1. ESMF_DEP_FRONT - The name of the Fortran module to be used in a USE statement, or (if it ends in ".h") the name of the header file to be used in an #include statement, or (if it ends in ".so") the name of the shared object to be loaded at run-time.

ESMF_DEP_FRONT=schism_cmi_nuopc
ESMF_DEP_FRONT=schism_nuopc_cap

# 2. ESMF_DEP_INCPATH - The include path to find module or header files during compilation. Must be specified as absolute path.
ESMF_DEP_INCPATH=$(CWD) @@SCHISM_BUILD_DIR@@/include
Expand Down
2 changes: 1 addition & 1 deletion triple_schism.F90
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ program main

use esmf
use schism_esmf_util, only: clockCreateFrmParam
use schism_cmi_esmf, only: schismSetServices => SetServices
use schism_esmf_cap, only: schismSetServices => SetServices
use atmosphere_cmi_esmf, only: atmosSetServices => SetServices

implicit none
Expand Down

0 comments on commit e6ef960

Please sign in to comment.