Skip to content

Commit

Permalink
1. Deleted modules that were not used (an_header.f90) and moved files…
Browse files Browse the repository at this point in the history
… that were only

    used by the coupled model to BRAMS/src/ed2 (ed_mem_grid_dim_defs.f90)
2.  Deleted unused variables, and changed compilation instructions to turn unused variable
    warnings into errors.
3.  Merged the code with the current main line to reduce issues in the future pull requests.
  • Loading branch information
mpaiao committed Feb 2, 2018
1 parent f91d21c commit 7a09814
Show file tree
Hide file tree
Showing 68 changed files with 1,463 additions and 1,628 deletions.
2 changes: 1 addition & 1 deletion BRAMS/build/bin/objects.mk
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ OBJ_MODEL = \
varutils.o \
vformat.o \
vtab_fill.o \
ed_mem_grid_dim_defs.o \
edcp_driver.o \
edcp_init.o \
edcp_lake_driver.o \
Expand Down Expand Up @@ -300,7 +301,6 @@ OBJ_MODEL = \
ed_init.o \
ed_init_atm.o \
ed_max_dims.o \
ed_mem_grid_dim_defs.o \
ed_misc_coms.o \
ed_nbg_init.o \
ed_node_coms.o \
Expand Down
10 changes: 5 additions & 5 deletions BRAMS/build/bin/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -1319,6 +1319,11 @@ vtab_fill.o : $(MEMORY)/vtab_fill.f90
#------------------------------------------------------------------------------------------#
#------------------------------------------------------------------------------------------#

ed_mem_grid_dim_defs.o : $(ED_MIXED)/ed_mem_grid_dim_defs.f90
cp -f $< $(<F:.f90=.f90)
$(F90_COMMAND) $(<F:.f90=.f90)
rm -f $(<F:.f90=.f90)

edcp_driver.o : $(ED_MIXED)/edcp_driver.F90
cp -f $< $(<F:.f90=.F90)
$(FPP_COMMAND) $(<F:.f90=.F90)
Expand Down Expand Up @@ -1504,11 +1509,6 @@ ed_max_dims.o : $(ED_MEMORY)/ed_max_dims.F90
$(FPP_COMMAND) $(<F:.F90=.F90)
rm -f $(<F:.F90=.F90)

ed_mem_grid_dim_defs.o : $(ED_MEMORY)/ed_mem_grid_dim_defs.f90
cp -f $< $(<F:.f90=.f90)
$(F90_COMMAND) $(<F:.f90=.f90)
rm -f $(<F:.f90=.f90)

ed_misc_coms.o : $(ED_MEMORY)/ed_misc_coms.f90
cp -f $< $(<F:.f90=.f90)
$(F90_COMMAND) $(<F:.f90=.f90)
Expand Down
2 changes: 1 addition & 1 deletion BRAMS/dbgbuild/bin/objects.mk
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ OBJ_MODEL = \
varutils.o \
vformat.o \
vtab_fill.o \
ed_mem_grid_dim_defs.o \
edcp_driver.o \
edcp_init.o \
edcp_lake_driver.o \
Expand Down Expand Up @@ -306,7 +307,6 @@ OBJ_MODEL = \
ed_init.o \
ed_init_atm.o \
ed_max_dims.o \
ed_mem_grid_dim_defs.o \
ed_misc_coms.o \
ed_nbg_init.o \
ed_node_coms.o \
Expand Down
10 changes: 5 additions & 5 deletions BRAMS/dbgbuild/bin/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -1319,6 +1319,11 @@ vtab_fill.o : $(MEMORY)/vtab_fill.f90
#------------------------------------------------------------------------------------------#
#------------------------------------------------------------------------------------------#

ed_mem_grid_dim_defs.o : $(ED_MIXED)/ed_mem_grid_dim_defs.f90
/bin/rm -f $(<F:.f90=.f90)
/bin/cp -f $< $(<F:.f90=.f90)
$(F90_COMMAND) $(<F:.f90=.f90)

edcp_driver.o : $(ED_MIXED)/edcp_driver.F90
/bin/rm -f $(<F:.f90=.F90)
/bin/cp -f $< $(<F:.f90=.F90)
Expand Down Expand Up @@ -1509,11 +1514,6 @@ ed_max_dims.o : $(ED_MEMORY)/ed_max_dims.F90
/bin/cp -f $< $(<F:.F90=.F90)
$(FPP_COMMAND) $(<F:.F90=.F90)

ed_mem_grid_dim_defs.o : $(ED_MEMORY)/ed_mem_grid_dim_defs.f90
/bin/rm -f $(<F:.f90=.f90)
/bin/cp -f $< $(<F:.f90=.f90)
$(F90_COMMAND) $(<F:.f90=.f90)

ed_misc_coms.o : $(ED_MEMORY)/ed_misc_coms.f90
/bin/rm -f $(<F:.f90=.f90)
/bin/cp -f $< $(<F:.f90=.f90)
Expand Down
File renamed without changes.
23 changes: 12 additions & 11 deletions BRAMS/src/ed2/edcp_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,16 @@ subroutine ed_coup_driver()



!---------------------------------------------------------------------------------------!
! Initialise any variable that should be initialised after the xml parameters have !
! been read. !
!---------------------------------------------------------------------------------------!
if (mynum == nnodetot) write (unit=*,fmt='(a)') ' [+] Init_derived_params_after_xml...'
call init_derived_params_after_xml()
!---------------------------------------------------------------------------------------!



!---------------------------------------------------------------------------------------!
! In case this simulation will use horizontal shading, initialise the landscape !
! arrays. !
Expand All @@ -126,15 +136,6 @@ subroutine ed_coup_driver()



!---------------------------------------------------------------------------------------!
! Initialise derived radiation parameters. !
!---------------------------------------------------------------------------------------!
if (mynum == nnodetot) write (unit=*,fmt='(a)') ' [+] Init_derived_rad_variables...'
call init_derived_rad_params()
!---------------------------------------------------------------------------------------!




!---------------------------------------------------------------------------------------!
! Allocate soil grid arrays. !
Expand Down Expand Up @@ -168,8 +169,8 @@ subroutine ed_coup_driver()
,MPI_STATUS_IGNORE,ierr)
#endif

if (mynum == nnodetot) write (unit=*,fmt='(a)') ' [+] Init_Full_History_Restart...'
call init_full_history_restart()
if (mynum == nnodetot) write (unit=*,fmt='(a)') ' [+] Resume_From_History...'
call resume_from_history()
#if defined(RAMS_MPI)
if (mynum < nnodetot ) call MPI_Send(ping,1,MPI_INTEGER,sendnum,90,MPI_COMM_WORLD &
,ierr)
Expand Down
2 changes: 1 addition & 1 deletion ED/Template/odyssey/make_joborder.r
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ default = list( run = "unnamed"
, igndvap = 0
, iphen = -1
, iallom = 3
, igrass = 0
, igrass = 1
, ibigleaf = 0
, integ.scheme = 1
, nsub.euler = 50
Expand Down
12 changes: 7 additions & 5 deletions ED/Template/odyssey/spawn_poly.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1187,14 +1187,16 @@ do
#---------------------------------------------------------------------------------------#
# Correct years so it is not tower-based or Sheffield. #
#---------------------------------------------------------------------------------------#
if [ ${iscenario} != "default" ] && [ ${iscenario} != "eft" ] &&
[ ${iscenario} != "shr" ] && [ ${iscenario} != "sheffield" ] &&
[ ${iscenario} != "WFDEI" ]
then
case ${iscenario} in
default|eft|shr|sheffield|WFDEI*)
echo "Nothing" > /dev/null
;;
*)
metcyc1=1972
metcycf=2012
imetavg=1
fi
;;
esac
#---------------------------------------------------------------------------------------#


Expand Down
2 changes: 1 addition & 1 deletion ED/Template/sdumont/make_joborder.r
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ default = list( run = "unnamed"
, igndvap = 0
, iphen = -1
, iallom = 3
, igrass = 0
, igrass = 1
, ibigleaf = 0
, integ.scheme = 1
, nsub.euler = 50
Expand Down
12 changes: 7 additions & 5 deletions ED/Template/sdumont/spawn_poly.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1059,14 +1059,16 @@ do
#---------------------------------------------------------------------------------------#
# Correct years so it is not tower-based or Sheffield. #
#---------------------------------------------------------------------------------------#
if [ ${iscenario} != "default" ] && [ ${iscenario} != "eft" ] &&
[ ${iscenario} != "shr" ] && [ ${iscenario} != "sheffield" ] &&
[ ${iscenario} != "WFDEI" ]
then
case ${iscenario} in
default|eft|shr|sheffield|WFDEI*)
echo "Nothing" > /dev/null
;;
*)
metcyc1=1972
metcycf=2012
imetavg=1
fi
;;
esac
#---------------------------------------------------------------------------------------#


Expand Down
2 changes: 1 addition & 1 deletion ED/Template/sun-lncc/make_joborder.r
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ default = list( run = "unnamed"
, igndvap = 0
, iphen = -1
, iallom = 3
, igrass = 0
, igrass = 1
, ibigleaf = 0
, integ.scheme = 1
, nsub.euler = 50
Expand Down
12 changes: 7 additions & 5 deletions ED/Template/sun-lncc/spawn_poly.sh
Original file line number Diff line number Diff line change
Expand Up @@ -944,14 +944,16 @@ do
#---------------------------------------------------------------------------------------#
# Correct years so it is not tower-based or Sheffield. #
#---------------------------------------------------------------------------------------#
if [ ${iscenario} != "default" ] && [ ${iscenario} != "eft" ] &&
[ ${iscenario} != "shr" ] && [ ${iscenario} != "sheffield" ] &&
[ ${iscenario} != "WFDEI" ]
then
case ${iscenario} in
default|eft|shr|sheffield|WFDEI*)
echo "Nothing" > /dev/null
;;
*)
metcyc1=1972
metcycf=2012
imetavg=1
fi
;;
esac
#---------------------------------------------------------------------------------------#


Expand Down
4 changes: 2 additions & 2 deletions ED/build/make/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ include objects.mk
#----- Define targets. --------------------------------------------------------------------#

#------------------------------------------------------------------------------------------#
# MLO. The six "make $(EXE) below may look like a typo, but it is actually a rather #
# MLO. The six "make $(EXE)" below may look like a typo, but it is actually a rather #
# ugly solution for a problem with make. When someone changes a fortran file #
# that is a module, all files that use the module must be recompiled too. Some #
# files are updated in the first pass, but not all of them are recompiled, and #
# nested modules (a module used by another module) may require multiple #
# compilations so the final executable is consistent. Failing to do so may #
# cause the executable to be inconsistent, with dangerous results. If anyone #
# knows a better way to ensure all dependencies are recompiled, feel free to #
# implement, but for the time being please keep the five make calls. #
# implement, but for the time being please keep all the "make $(EXE)" calls. #
#------------------------------------------------------------------------------------------#
all:
make gendep
Expand Down
18 changes: 10 additions & 8 deletions ED/build/make/include.mk.odyssey
Original file line number Diff line number Diff line change
Expand Up @@ -86,45 +86,47 @@ ifeq ($(KIND_COMP),A)
F_OPTS= -FR -O0 -recursive -check all,noarg_temp_created -g -debug extended \
-debug-parameters all -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \
-implicitnone -assume byterecl -warn unused -warn uncalled -warn usage \
-gen-interfaces -qopenmp -static
-gen-interfaces -qopenmp -diag-error=all -static
C_OPTS= -O0 -DLITTLE -g -traceback -qopenmp -static
LOADER_OPTS=-FR -O0 -recursive -check all,noarg_temp_created -g -debug extended \
-debug-parameters all -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \
-implicitnone -assume byterecl -warn unused -warn uncalled -warn usage \
-gen-interfaces -qopenmp
-gen-interfaces -qopenmp -diag-error=all
#---------------------------------------------------------------------------------------#
endif
ifeq ($(KIND_COMP),B)
USE_INTERF=0
F_OPTS= -FR -O0 -recursive -check all,noarg_temp_created -g -debug extended \
-debug-parameters all -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \
-implicitnone -assume byterecl -warn unused -warn uncalled -warn usage \
-warn interfaces -qopenmp -static
-warn interfaces -qopenmp -diag-error=all -static
C_OPTS= -O0 -DLITTLE -g -traceback -qopenmp -static
LOADER_OPTS=-FR -O0 -recursive -check all,noarg_temp_created -g -debug extended \
-debug-parameters all -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \
-implicitnone -assume byterecl -warn unused -warn uncalled -warn usage \
-warn interfaces -qopenmp
-warn interfaces -qopenmp -diag-error=all
#---------------------------------------------------------------------------------------#
endif
ifeq ($(KIND_COMP),C)
USE_INTERF=1
F_OPTS= -FR -O0 -recursive -check all,noarg_temp_created -g -debug extended \
-debug-parameters all -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \
-implicitnone -assume byterecl -qopenmp -static
-implicitnone -assume byterecl -qopenmp -diag-error=all -static
C_OPTS= -O0 -DLITTLE -g -traceback -qopenmp -static
LOADER_OPTS=-FR -O0 -recursive -check all,noarg_temp_created -g -debug extended \
-debug-parameters all -fpe0 -no-ftz -traceback -ftrapuv -fp-stack-check \
-implicitnone -assume byterecl -qopenmp
-implicitnone -assume byterecl -qopenmp -diag-error=all
#---------------------------------------------------------------------------------------#
endif
ifeq ($(KIND_COMP),D)
USE_INTERF=1
F_OPTS= -FR -O0 -recursive -check all,noarg_temp_created -fpe0 -no-ftz -traceback \
-ftrapuv -fp-stack-check -implicitnone -assume byterecl -qopenmp -static
-ftrapuv -fp-stack-check -implicitnone -assume byterecl -qopenmp \
-diag-error=all -static
C_OPTS= -O0 -DLITTLE -g -traceback -qopenmp -static
LOADER_OPTS=-FR -O0 -recursive -check all,noarg_temp_created -fpe0 -no-ftz -traceback \
-ftrapuv -fp-stack-check -implicitnone -assume byterecl -qopenmp
-ftrapuv -fp-stack-check -implicitnone -assume byterecl -qopenmp \
-diag-error=all
#---------------------------------------------------------------------------------------#
endif
ifeq ($(KIND_COMP),E)
Expand Down
2 changes: 0 additions & 2 deletions ED/build/make/objects.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ MAINOBJ = edmain.o

OBJ_MODEL = \
allometry.o \
an_header.o \
average_utils.o \
bdf2_solver.o \
budget_utils.o \
Expand Down Expand Up @@ -39,7 +38,6 @@ OBJ_MODEL = \
ed_load_namelist.o \
ed_max_dims.o \
ed_mem_alloc.o \
ed_mem_grid_dim_defs.o \
ed_met_driver.o \
ed_misc_coms.o \
ed_model.o \
Expand Down
10 changes: 0 additions & 10 deletions ED/build/make/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ allometry.o : $(ED_UTILS)/allometry.f90
/bin/cp -f $< $(<F:.f90=.f90)
$(F90_COMMAND) $(<F:.f90=.f90)

an_header.o: $(ED_IO)/an_header.f90
/bin/rm -f $(<F:.f90=.f90)
/bin/cp -f $< $(<F:.f90=.f90)
$(F90_COMMAND) $(<F:.f90=.f90)

average_utils.o : $(ED_IO)/average_utils.f90
/bin/rm -f $(<F:.f90=.f90)
/bin/cp -f $< $(<F:.f90=.f90)
Expand Down Expand Up @@ -148,11 +143,6 @@ ed_mem_alloc.o : $(ED_MEMORY)/ed_mem_alloc.f90
/bin/cp -f $< $(<F:.f90=.f90)
$(F90_COMMAND) $(<F:.f90=.f90)

ed_mem_grid_dim_defs.o : $(ED_MEMORY)/ed_mem_grid_dim_defs.f90
/bin/rm -f $(<F:.f90=.f90)
/bin/cp -f $< $(<F:.f90=.f90)
$(F90_COMMAND) $(<F:.f90=.f90)

ed_met_driver.o : $(ED_DRIVER)/ed_met_driver.f90
/bin/rm -f $(<F:.f90=.f90)
/bin/cp -f $< $(<F:.f90=.f90)
Expand Down
9 changes: 2 additions & 7 deletions ED/src/driver/ed_1st.F90
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ subroutine ed_1st_master (ipara, nnodestotal,nslaves, headnode_num, max_threads,
real :: wtime_start
!----- Local parameters, this sub-routine shan't ever be called by coupled runs. -------!
logical , parameter :: masterworks = .true. ! Master should solve polygons
logical , parameter :: standalone = .true. ! ED will be run on its own.
!----- External functions. -------------------------------------------------------------!
real , external :: walltime ! wall time
!---------------------------------------------------------------------------------------!
Expand Down Expand Up @@ -136,7 +135,7 @@ subroutine ed_1st_master (ipara, nnodestotal,nslaves, headnode_num, max_threads,
! The following subroutine does node decomposition, but it also does the initial !
! read-in of the land-sea mask and soil textural class. !
!---------------------------------------------------------------------------------------!
call ed_node_decomp(1,standalone,masterworks)
call ed_node_decomp(masterworks)
#if defined(RAMS_MPI)
if (iparallel == 1) call MPI_Barrier(MPI_COMM_WORLD,ierr)
#endif
Expand Down Expand Up @@ -169,17 +168,13 @@ end subroutine ed_1st_master
! polygons and parameters for the nodes. This sub-routine won't be called if this is a !
! serial run. !
!------------------------------------------------------------------------------------------!
subroutine ed_1st_node(init)
subroutine ed_1st_node()
use ed_mem_alloc, only : ed_memory_allocation ! ! subroutine
implicit none
!----- Pre-compiled variables from MPI. ------------------------------------------------!
#if defined(RAMS_MPI)
include 'mpif.h'
#endif
!----- Arguments. ----------------------------------------------------------------------!
integer, intent(in) :: init
!----- Local variable (MPI only). ------------------------------------------------------!
#if defined(RAMS_MPI)
integer :: ierr
#endif
!---------------------------------------------------------------------------------------!
Expand Down
Loading

0 comments on commit 7a09814

Please sign in to comment.