Skip to content

Commit

Permalink
Merge branch 'master' into mpaiao-pr-init-multisite
Browse files Browse the repository at this point in the history
  • Loading branch information
mpaiao authored Jul 24, 2024
2 parents 9692af6 + 48c99d8 commit a2dfb03
Show file tree
Hide file tree
Showing 206 changed files with 16,709 additions and 9,480 deletions.
20 changes: 13 additions & 7 deletions BRAMS/Template/RAMSIN
Original file line number Diff line number Diff line change
Expand Up @@ -2354,13 +2354,19 @@ $ED2_INFO
! a few genera in Costa Rica. References: !
! Cole and Ewel (2006, Forest Ecol. Manag.), and Calvo-Alvarado et al. !
! (2008, Tree Physiol.). !
! 3. (Beta) Updated allometric for tropical PFTs based on data from !
! Sustainable Landscapes Brazil (Height and crown area), Chave et al. !
! (2014, Glob. Change Biol.) (biomass) and the BAAD data base, Falster et !
! al. (2015, Ecology) (leaf area). Both leaf and structural biomass take !
! DBH and Height as dependent variables, and DBH-Height takes a simpler !
! log-linear form fitted using SMA so it can be inverted (useful for !
! airborne lidar initialisation). !
! 3. (Beta) Revised tropical PFT allometric (Longo et al. 2020, JGR-B). !
! a. Height -> DBH and DBH^2*H -> CA. Model fitting using the Sustainable !
! Landscapes Dataset (Longo et al. 2016, Glob. Biogeochem. Cycles). !
! DBH-Height takes a simpler log-linear form fitted using SMA so it can !
! be inverted (useful for airborne lidar initialisation). !
! b. DBH^2*H -> AGB. Based on Chave et al. (2014, Glob. Change Biol.) !
! c. DBH^2*H -> Leaf area based on the BAAD data base: !
! Falster et al. (2015, Ecology). !
! 4. (Under Development) Similar to 3 but (a) leaf and height allometric !
! equations depend on wood density; (b) use height-based root allometry !
! from Smith-Martin et al. (2020, New Phyt.). !
! 5. (Under Development) Similar to IALLOM = 3 but using the rooting !
! allometry from IALLOM = 4. !
!---------------------------------------------------------------------------------------!
IALLOM = 3,
!---------------------------------------------------------------------------------------!
Expand Down
20 changes: 13 additions & 7 deletions BRAMS/run/RAMSIN
Original file line number Diff line number Diff line change
Expand Up @@ -2372,13 +2372,19 @@ $ED2_INFO
! a few genera in Costa Rica. References: !
! Cole and Ewel (2006, Forest Ecol. Manag.), and Calvo-Alvarado et al. !
! (2008, Tree Physiol.). !
! 3. (Beta) Updated allometric for tropical PFTs based on data from !
! Sustainable Landscapes Brazil (Height and crown area), Chave et al. !
! (2014, Glob. Change Biol.) (biomass) and the BAAD data base, Falster et !
! al. (2015, Ecology) (leaf area). Both leaf and structural biomass take !
! DBH and Height as dependent variables, and DBH-Height takes a simpler !
! log-linear form fitted using SMA so it can be inverted (useful for !
! airborne lidar initialisation). !
! 3. (Beta) Revised tropical PFT allometric (Longo et al. 2020, JGR-B). !
! a. Height -> DBH and DBH^2*H -> CA. Model fitting using the Sustainable !
! Landscapes Dataset (Longo et al. 2016, Glob. Biogeochem. Cycles). !
! DBH-Height takes a simpler log-linear form fitted using SMA so it can !
! be inverted (useful for airborne lidar initialisation). !
! b. DBH^2*H -> AGB. Based on Chave et al. (2014, Glob. Change Biol.) !
! c. DBH^2*H -> Leaf area based on the BAAD data base: !
! Falster et al. (2015, Ecology). !
! 4. (Under Development) Similar to 3 but (a) leaf and height allometric !
! equations depend on wood density; (b) use height-based root allometry !
! from Smith-Martin et al. (2020, New Phyt.). !
! 5. (Under Development) Similar to IALLOM = 3 but using the rooting !
! allometry from IALLOM = 4. !
!---------------------------------------------------------------------------------------!
IALLOM = 3,
!---------------------------------------------------------------------------------------!
Expand Down
23 changes: 11 additions & 12 deletions BRAMS/src/core/local_proc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,9 @@ subroutine master_putdxt(master_num)
use rpara, only : &
nmachs, & ! INTENT(IN)
machnum ! INTENT(IN)
#if defined(RAMS_MPI)
use mpi
#endif

implicit none

Expand All @@ -333,10 +336,6 @@ subroutine master_putdxt(master_num)
real :: dxtmax(maxgrds)
integer :: master_num,ierr

#if defined(RAMS_MPI)
include 'mpif.h'
#endif

! Calculating DXTMAX
do ifm = 1,ngrids
nn2 = nnxp(ifm)
Expand Down Expand Up @@ -367,10 +366,10 @@ subroutine master_putcflmax(master_num)
nmachs, & ! INTENT(IN)
machnum, & ! INTENT(IN)
mainnum ! intent(in)

#if defined(RAMS_MPI)
include 'mpif.h'
use mpi
#endif
implicit none
integer :: master_num,ierr

#if defined(RAMS_MPI)
Expand All @@ -387,11 +386,11 @@ subroutine node_getdxt(dxtmax_local)
use io_params, only : &
maxgrds ! INTENT(IN)
use node_mod, only: master_num
implicit none

#if defined(RAMS_MPI)
include 'mpif.h'
use mpi
#endif
implicit none

real, intent(out) :: dxtmax_local(maxgrds)
integer :: ierr
#if defined(RAMS_MPI)
Expand All @@ -413,12 +412,12 @@ subroutine node_getcflmax()
cflxy, & ! INTENT(OUT)
cflz ! INTENT(OUT)
use node_mod, only : master_num
#if defined(RAMS_MPI)
use mpi
#endif

implicit none

#if defined(RAMS_MPI)
include 'mpif.h'
#endif
integer :: ierr

#if defined(RAMS_MPI)
Expand Down
6 changes: 3 additions & 3 deletions BRAMS/src/core/model.F90
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,9 @@ subroutine par_model(master_num)
ptimes ! INTENT(IN)

use dtset, only: dtset_new ! subroutine
#if defined(RAMS_MPI)
use mpi
#endif

implicit none
! +------------------------------------------------------------------
Expand All @@ -284,9 +287,6 @@ subroutine par_model(master_num)

!MLO
integer :: ierr, master_num
#if defined(RAMS_MPI)
include 'mpif.h'
#endif

!ALF
real :: dxtmax_local(maxgrds)
Expand Down
4 changes: 3 additions & 1 deletion BRAMS/src/core/rammain.F90
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ program main
! invoking master/slave processes or full model process
! destroy processes
!
#if defined(RAMS_MPI)
use mpi
#endif

implicit none

Expand Down Expand Up @@ -65,7 +68,6 @@ program main
! For MPI interface
integer :: ierr
#if defined(RAMS_MPI)
include 'mpif.h'
include 'interface.h'
#endif
! Get input arguments (required by C interface of MPI_Init)
Expand Down
4 changes: 3 additions & 1 deletion BRAMS/src/core/rams_master.F90
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ subroutine rams_master(ipara, nslaves, master_num, name_name)
use mem_radiate, only: ISWRTYP, ILWRTYP ! Intent(in)
use mem_leaf, only : isfcl ! Intent(in)
use dtset, only: dtset_new ! subroutine
#if defined(RAMS_MPI)
use mpi
#endif

implicit none

Expand All @@ -63,7 +66,6 @@ subroutine rams_master(ipara, nslaves, master_num, name_name)
integer :: ierr
#if defined(RAMS_MPI)
include 'interface.h'
include 'mpif.h'
#endif
!MLO]

Expand Down
13 changes: 10 additions & 3 deletions BRAMS/src/core/rnode.F90
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,16 @@ subroutine rams_node()
use mem_leaf, only: isfcl ! intent(in)

use dtset, only: dtset_new ! subroutine
#if defined(RAMS_MPI)
use mpi
#endif


implicit none

! Local Variables:
#if defined(RAMS_MPI)
include 'interface.h'
include 'mpif.h'
#endif
integer :: isendflg,isendlite,isendmean,isendboth,nt,npass,icm,ifm,nfeed
real :: wstart,totcpu,t1,w1,t6,w6
Expand Down Expand Up @@ -385,13 +388,15 @@ subroutine init_params(init)
use mem_oda
use mem_radiate, only: ISWRTYP, ILWRTYP ! Intent(in)
use mem_leaf , only: isfcl ! Intent(in)
#if defined(RAMS_MPI)
use mpi
#endif

implicit none

integer, intent(in) :: init

#if defined(RAMS_MPI)
include 'mpif.h'
include 'interface.h'
#endif
integer :: ierr
Expand Down Expand Up @@ -438,6 +443,9 @@ subroutine init_fields(init)
use mem_cuparm, only : nclouds
use mem_aerad , only : nwave
use grid_dims , only : ndim_types
#if defined(RAMS_MPI)
use mpi
#endif

implicit none
!----- Arguments. ----------------------------------------------------------------------!
Expand Down Expand Up @@ -473,7 +481,6 @@ subroutine init_fields(init)
!----- Include modules. ----------------------------------------------------------------!
#if defined(RAMS_MPI)
include 'interface.h'
include 'mpif.h'
#endif
!---------------------------------------------------------------------------------------!

Expand Down
10 changes: 5 additions & 5 deletions BRAMS/src/ed2/edcp_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ subroutine ed_coup_driver()
use budget_utils , only : ed_init_budget ! ! sub-routine
use ed_type_init , only : ed_init_viable ! ! sub-routine
use soil_respiration , only : zero_litter_inputs ! ! sub-routine
#if defined(RAMS_MPI)
use mpi
#endif

implicit none
!----- Local variables. ----------------------------------------------------------------!
Expand All @@ -64,17 +67,14 @@ subroutine ed_coup_driver()
integer :: jd2
integer :: ierr
integer :: igr
integer :: ping
integer :: ping
logical :: new_day
real :: wtime1
real :: wtime2
real :: wtime_start ! wall time
real :: cputime1
!----- External function. --------------------------------------------------------------!
real , external :: walltime ! wall time
!----- MPI header. ---------------------------------------------------------------------!
#if defined(RAMS_MPI)
include 'mpif.h'
#endif
!---------------------------------------------------------------------------------------!


Expand Down
30 changes: 14 additions & 16 deletions BRAMS/src/ed2/edcp_init.F90
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ subroutine master_ed_init(iparallel)
, allocate_edglobals & ! subroutine
, allocate_edtype & ! subroutine
, edgrid_g ! ! intent(inout)
implicit none
!------Included variables. -------------------------------------------------------------!
!------MPI variables and procedures. ---------------------------------------------------!
#if defined(RAMS_MPI)
include 'mpif.h'
use mpi
#endif
implicit none
!----- Arguments. ----------------------------------------------------------------------!
integer, intent(in) :: iparallel
!----- Local variables. ----------------------------------------------------------------!
Expand Down Expand Up @@ -108,11 +108,11 @@ subroutine node_ed_init
, allocate_edglobals & ! sub-routine
, allocate_edtype & ! sub-routine
, edgrid_g ! ! structure
implicit none
!------Included variables. -------------------------------------------------------------!
!------MPI variables and procedures. ---------------------------------------------------!
#if defined(RAMS_MPI)
include 'mpif.h'
use mpi
#endif
implicit none
!----- Local variables. ----------------------------------------------------------------!
integer :: ifm
integer :: ierr
Expand Down Expand Up @@ -181,12 +181,11 @@ subroutine copy_in_bramsmpi(master_num_b,mchnum_b,mynum_b,nmachs_b,machs_b,ipara
use grid_coms , only : ngrids & ! intent(out)
, nnxp & ! intent(out)
, nnyp ! ! intent(out)

implicit none
!----- Included variables. -------------------------------------------------------------!
#if defined(RAMS_MPI)
include 'mpif.h'
use mpi
#endif

implicit none
!----- Arguments. ----------------------------------------------------------------------!
integer , intent(in) :: master_num_b
integer , intent(in) :: mchnum_b
Expand Down Expand Up @@ -267,11 +266,11 @@ subroutine init_master_work(ipara)
, allocate_edglobals & ! sub-routine
, allocate_edtype ! ! sub-routine
use mem_polygons , only : maxsite ! ! intent(in)
implicit none
!----- Included variables. -------------------------------------------------------------!
!----- MPI variables and procedures. ---------------------------------------------------!
#if defined(RAMS_MPI)
include 'mpif.h'
use mpi
#endif
implicit none
!----- Arguments. ----------------------------------------------------------------------!
integer, intent(in) :: ipara
!----- Local variables. ----------------------------------------------------------------!
Expand Down Expand Up @@ -510,11 +509,10 @@ subroutine init_node_work()
, allocate_edglobals & ! sub-routine
, allocate_edtype ! ! sub-routine
use mem_polygons , only : maxsite ! ! sub-routine
implicit none
!----- Included variables. -------------------------------------------------------------!
#if defined(RAMS_MPI)
include 'mpif.h'
use mpi
#endif
implicit none
!----- Local variables. ----------------------------------------------------------------!
integer :: ifm
integer :: nm
Expand Down
10 changes: 4 additions & 6 deletions BRAMS/src/ed2/edcp_mpiutils.F90
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,10 @@ subroutine masterput_ednl(mainnum)
, idetailed & ! intent(in)
, patch_keep ! ! intent(in)
use fusion_fission_coms , only : ifusion ! ! intent(in)
implicit none
!----- Standard common blocks. ---------------------------------------------------------!
#if defined(RAMS_MPI)
include 'mpif.h'
use mpi
#endif
implicit none
!----- Arguments. ----------------------------------------------------------------------!
integer, intent(in) :: mainnum
!----- Local variables. ----------------------------------------------------------------!
Expand Down Expand Up @@ -760,11 +759,10 @@ subroutine nodeget_ednl(master_num)
, idetailed & ! intent(out)
, patch_keep ! ! intent(out)
use fusion_fission_coms , only : ifusion ! ! intent(out)
implicit none
!----- Standard common blocks. ---------------------------------------------------------!
#if defined(RAMS_MPI)
include 'mpif.h'
use mpi
#endif
implicit none
!----- Arguments. ----------------------------------------------------------------------!
integer, intent(in) :: master_num
!----- Local variables. ----------------------------------------------------------------!
Expand Down
12 changes: 6 additions & 6 deletions BRAMS/src/io/error_mess.F90
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ subroutine abort_run(reason,subr,file)
! being frozen. !
!------------------------------------------------------------------------------------------!
use node_mod, only: nmachs,mynum
implicit none
character(len=*), intent(in) :: reason,subr,file
#if defined(RAMS_MPI)
include 'mpif.h'
use mpi
#endif
implicit none
character(len=*), intent(in) :: reason,subr,file
write(unit=*,fmt='(a)') '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::'
write(unit=*,fmt='(a)') '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::'
write(unit=*,fmt='(a)') '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::'
Expand Down Expand Up @@ -49,12 +49,12 @@ subroutine opspec_mess(reason,opssub)
! This is just a first warning to be given in the standard output. Since the namelist !
! may have more than one error, I list all the problems, then the model will stop. !
!------------------------------------------------------------------------------------------!
#if defined(RAMS_MPI)
use mpi
#endif
implicit none
character(len=*), intent(in) :: reason,opssub

#if defined(RAMS_MPI)
include 'mpif.h'
#endif
write (unit=*,fmt='(a)') ' '
write (unit=*,fmt='(a)') '----------------------------------------------------------------------------'
write (unit=*,fmt='(3(a,1x))') '>>>> ',trim(opssub),' error! in your namelist!'
Expand Down
Loading

0 comments on commit a2dfb03

Please sign in to comment.