Skip to content

Commit

Permalink
Merge branch 'master' into mpaiao-pr-thvavg
Browse files Browse the repository at this point in the history
  • Loading branch information
mpaiao authored Jul 24, 2024
2 parents c20eb83 + caf4a9e commit 29e1879
Show file tree
Hide file tree
Showing 226 changed files with 20,373 additions and 10,776 deletions.
52 changes: 40 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 Expand Up @@ -2425,10 +2438,25 @@ $ED2_INFO
! conifers - evergreen; !
! hardwoods - cold-deciduous; !
! !
! 4: (Beta). !
! grasses - drought-deciduous (hydraulics scheme); !
! tropical - drought-deciduous (hydraulics scheme); !
! conifers - evergreen; !
! hardwoods - cold-deciduous; !
! !
! 5: (Beta). !
! grasses - drought-deciduous (hydraulics scheme); !
! tropical - drought-deciduous (hydraulics scheme + light phenology); !
! conifers - evergreen; !
! hardwoods - cold-deciduous; !
! !
! !
! Old scheme: plants shed their leaves once instantaneous amount of available water !
! becomes less than a critical value. !
! New scheme: plants shed their leaves once a 10-day running average of available !
! water becomes less than a critical value. !
! Hydraulics scheme: plants shed their leaves once predawn leaf water potential is !
! lower than tugor loss point for 10 consecutive days !
!---------------------------------------------------------------------------------------!
IPHEN_SCHEME = 2,
!---------------------------------------------------------------------------------------!
Expand Down
52 changes: 40 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 Expand Up @@ -2443,10 +2456,25 @@ $ED2_INFO
! conifers - evergreen; !
! hardwoods - cold-deciduous; !
! !
! 4: (Beta). !
! grasses - drought-deciduous (hydraulics scheme); !
! tropical - drought-deciduous (hydraulics scheme); !
! conifers - evergreen; !
! hardwoods - cold-deciduous; !
! !
! 5: (Beta). !
! grasses - drought-deciduous (hydraulics scheme); !
! tropical - drought-deciduous (hydraulics scheme + light phenology); !
! conifers - evergreen; !
! hardwoods - cold-deciduous; !
! !
! !
! Old scheme: plants shed their leaves once instantaneous amount of available water !
! becomes less than a critical value. !
! New scheme: plants shed their leaves once a 10-day running average of available !
! water becomes less than a critical value. !
! Hydraulics scheme: plants shed their leaves once predawn leaf water potential is !
! lower than tugor loss point for 10 consecutive days !
!---------------------------------------------------------------------------------------!
IPHEN_SCHEME = 2,
!---------------------------------------------------------------------------------------!
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
Loading

0 comments on commit 29e1879

Please sign in to comment.