Skip to content

Commit

Permalink
Merge branch 'master' into mpaiao-pr-phenol
Browse files Browse the repository at this point in the history
  • Loading branch information
mpaiao authored Jul 24, 2024
2 parents 4fc2577 + b75775f commit 0e243a8
Show file tree
Hide file tree
Showing 222 changed files with 20,107 additions and 10,691 deletions.
37 changes: 25 additions & 12 deletions BRAMS/Template/RAMSIN
Original file line number Diff line number Diff line change
Expand Up @@ -1545,14 +1545,17 @@ $MODEL_OPTIONS
! ISOILBC -- This controls the soil moisture boundary condition at the bottom. !
! For regional runs, it is wise to use options 1 or 2, especially for !
! long runs. !
! 0. Flat bedrock. Flux from the bottom of the bottommost layer is 0. !
! 1. Gravitational flow (free drainage). The flux from the bottom of !
! -1. Hybrid. If the depth to bedrock is shorter than the deepest layer, !
! use flat bedrock, otherwise assume free drainage. This option is !
! morerelevant when initialising ED2 with multiple sites per polygon. !
! 0. Flat bedrock. Zero flux from the bottom of the bottommost layer. !
! 1. Gravitational flow (free drainage). The flux from the bottom of !
! the bottommost layer is due to gradient of height only. !
! 2. Lateral drainage. Similar to free drainage, but the gradient is !
! 2. Lateral drainage. Similar to free drainage, but the gradient is !
! reduced by the slope not being completely vertical. The reduction !
! is controlled by variable SLDRAIN. In the future options 0, 1, and !
! 2 may be combined into a single option. !
! 3. Aquifer. Soil moisture of the ficticious layer beneath the bottom !
! 3. Aquifer. Soil moisture of the ficticious layer beneath the bottom !
! is always at saturation. !
!------------------------------------------------------------------------------------!
ISOILBC = 1,
Expand Down Expand Up @@ -2033,14 +2036,18 @@ $ED2_INFO
! /mypath/P1000-S-1687-01-01-000000-g01.h5: !
! SFILIN = '/mypath/P' !
! !
! 6 - Initialize with ED-2 style files without multiple sites, exactly like option !
! 6. Initialize with ED-2 style files without multiple sites, similar to option !
! 2, except that the PFT types are preserved. !
! !
! 7. Initialize from a list of both POI and gridded ED2.1 state files, organized !
! in the same manner as 5. This method overrides the soil database info and !
! takes the soil texture and soil moisture information from the initializing !
! ED2.1 state file. It allows for different layering, and assigns via nearest !
! neighbor. !
! !
! 8. Initialise ED-2.2 style files with multiple sites that may vary in soil depth, !
! texture, and other properties (e.g., colour, pH, cation exchange capacity) but !
! without forcing TOPMODEL. !
!---------------------------------------------------------------------------------------!
IED_INIT_MODE = 5,
!---------------------------------------------------------------------------------------!
Expand Down Expand Up @@ -2347,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
37 changes: 25 additions & 12 deletions BRAMS/run/RAMSIN
Original file line number Diff line number Diff line change
Expand Up @@ -1552,14 +1552,17 @@ $MODEL_OPTIONS
! ISOILBC -- This controls the soil moisture boundary condition at the bottom. !
! For regional runs, it is wise to use options 1 or 2, especially for !
! long runs. !
! 0. Flat bedrock. Flux from the bottom of the bottommost layer is 0. !
! 1. Gravitational flow (free drainage). The flux from the bottom of !
! -1. Hybrid. If the depth to bedrock is shorter than the deepest layer, !
! use flat bedrock, otherwise assume free drainage. This option is !
! morerelevant when initialising ED2 with multiple sites per polygon. !
! 0. Flat bedrock. Zero flux from the bottom of the bottommost layer. !
! 1. Gravitational flow (free drainage). The flux from the bottom of !
! the bottommost layer is due to gradient of height only. !
! 2. Lateral drainage. Similar to free drainage, but the gradient is !
! 2. Lateral drainage. Similar to free drainage, but the gradient is !
! reduced by the slope not being completely vertical. The reduction !
! is controlled by variable SLDRAIN. In the future options 0, 1, and !
! 2 may be combined into a single option. !
! 3. Aquifer. Soil moisture of the ficticious layer beneath the bottom !
! 3. Aquifer. Soil moisture of the ficticious layer beneath the bottom !
! is always at saturation. !
!------------------------------------------------------------------------------------!
ISOILBC = 1,
Expand Down Expand Up @@ -2050,14 +2053,18 @@ $ED2_INFO
! /mypath/P1000-S-1687-01-01-000000-g01.h5: !
! SFILIN = '/mypath/P' !
! !
! 6 - Initialize with ED-2 style files without multiple sites, exactly like option !
! 6. Initialize with ED-2 style files without multiple sites, similar to option !
! 2, except that the PFT types are preserved. !
! !
! 7. Initialize from a list of both POI and gridded ED2.1 state files, organized !
! in the same manner as 5. This method overrides the soil database info and !
! takes the soil texture and soil moisture information from the initializing !
! ED2.1 state file. It allows for different layering, and assigns via nearest !
! neighbor. !
! !
! 8. Initialise ED-2.2 style files with multiple sites that may vary in soil depth, !
! texture, and other properties (e.g., colour, pH, cation exchange capacity) but !
! without forcing TOPMODEL. !
!---------------------------------------------------------------------------------------!
IED_INIT_MODE = 5,
!---------------------------------------------------------------------------------------!
Expand Down Expand Up @@ -2365,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
11 changes: 6 additions & 5 deletions BRAMS/src/ed2/edcp_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ subroutine ed_coup_driver()
, edgrid_g ! ! subroutine
use ed_init , only : read_obstime ! ! subroutine
use ed_misc_coms , only : fast_diagnostics & ! intent(in)
, current_time & ! intent(in)
, iyeara & ! intent(in)
, imontha & ! intent(in)
, idatea & ! intent(in)
Expand Down Expand Up @@ -47,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 @@ -63,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
Loading

0 comments on commit 0e243a8

Please sign in to comment.