Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt-get install -y --no-install-recommends gfortran libhdf5-openmpi-dev libopenmpi-dev libblas-dev liblapack-dev
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends gfortran libhdf5-openmpi-dev libopenmpi-dev libblas-dev liblapack-dev
- name: Install ED2
run: |
cd ED/build
Expand Down Expand Up @@ -43,7 +45,9 @@ jobs:
with:
name: ed2-binary
- name: Install dependencies
run: sudo apt-get install -y --no-install-recommends gfortran libhdf5-openmpi-dev libopenmpi-dev libblas-dev liblapack-dev
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends gfortran libhdf5-openmpi-dev libopenmpi-dev libblas-dev liblapack-dev
- name: Run ED2
working-directory: ./EDTS/
run: |
Expand Down
24 changes: 24 additions & 0 deletions BRAMS/run/RAMSIN
Original file line number Diff line number Diff line change
Expand Up @@ -1296,6 +1296,30 @@ $MODEL_OPTIONS





!------------------------------------------------------------------------------------!
! ESAT_METHOD -- Which method to use for computing vapour pressure at saturation. !
! 0. (Deprecated) Original ED2 formulation, based on Flatau et al. !
! (1992). This is not recommended because the function is not !
! continuous at T = 0 degC. !
! 1. (ED-2.2 default) Based on Murphy and Koop (2005). This is a !
! fairly robust approach and it is continuous at the triple !
! point. The main downside is that it makes the estimate slightly !
! inconsistent with the second law of thermodynamics. !
! 2. (ED-2.2 alternative) Based on Ambaum (2020). This is intended !
! to become the default. It is accurate, and uses the same !
! assumptions as the definition of enthalpy and latent heat of !
! vaporisation and sublimation, so it is consistent with the !
! second law of thermodynamics. The only minor disadvantage is !
! that the function is continuous but not differentiable at the !
! fusion point. !
!------------------------------------------------------------------------------------!
ESAT_METHOD = 1,
!------------------------------------------------------------------------------------!



!------------------------------------------------------------------------------------!
! IGRNDVAP -- Methods to find the ground -> canopy conductance. !
! 0. (ED-2.2 default) Modified Lee and Pielke (1992, J. Appl. Meteorol.), adding !
Expand Down
29 changes: 17 additions & 12 deletions BRAMS/src/ed2/edcp_load_namelist.f90
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,14 @@ subroutine read_ednl(iunit,filename)
use canopy_layer_coms , only : crown_mod ! ! intent(out)
use canopy_radiation_coms, only : icanrad & ! intent(out)
, ihrzrad ! ! intent(out)
use consts_coms , only : day_sec ! ! intent(in)
use detailed_coms , only : dt_census & ! intent(out)
, yr1st_census & ! intent(out)
, mon1st_census & ! intent(out)
, min_recruit_dbh & ! intent(out)
, idetailed & ! intent(out)
, patch_keep ! ! intent(out)
use fusion_fission_coms , only : ifusion ! ! intent(out)
!----- Coupled ED-BRAMS modules. -------------------------------------------------------!
use mem_edcp , only : co2_offset ! ! intent(out)
!----- BRAMS modules. ------------------------------------------------------------------!
Expand Down Expand Up @@ -194,6 +202,7 @@ subroutine read_ednl(iunit,filename)
, itimeh & ! intent(in)
, imonthh & ! intent(in)
, isoilflg ! ! intent(in)
use mem_basic , only : brams_esat_method => esat_method ! ! intent(in)
use mem_leaf , only : nslcon & ! intent(in)
, isoilcol & ! intent(in)
, slz & ! intent(in)
Expand All @@ -207,7 +216,7 @@ subroutine read_ednl(iunit,filename)
, leaf_sldrain => sldrain & ! intent(in)
, leaf_ipercol => ipercol & ! intent(in)
, leaf_runoff_time => runoff_time ! ! intent(in)
use leaf_coms , only : leaf_ubmin => ubmin & ! intent(in)
, leaf_ubmin => ubmin & ! intent(in)
, leaf_ugbmin => ugbmin & ! intent(in)
, leaf_ustmin => ustmin & ! intent(in)
, leaf_gamm => gamm & ! intent(in)
Expand All @@ -217,14 +226,6 @@ subroutine read_ednl(iunit,filename)
, leaf_leaf_maxwhc => leaf_maxwhc & ! intent(in)
, leaf_min_patch_area => min_patch_area ! ! intent(in)
use mem_radiate , only : radfrq ! ! intent(in)
use consts_coms , only : day_sec ! ! intent(in)
use detailed_coms , only : dt_census & ! intent(out)
, yr1st_census & ! intent(out)
, mon1st_census & ! intent(out)
, min_recruit_dbh & ! intent(out)
, idetailed & ! intent(out)
, patch_keep ! ! intent(out)
use fusion_fission_coms , only : ifusion ! ! intent(out)
implicit none
!----- Arguments. ----------------------------------------------------------------------!
integer , intent(in) :: iunit ! Namelist unit number
Expand Down Expand Up @@ -406,7 +407,7 @@ subroutine read_ednl(iunit,filename)
,nzg,nzs,isoilflg,nslcon,isoilcol,slz,slmstr,stgoff,ngrids &
,leaf_ubmin,leaf_ugbmin,leaf_ustmin,leaf_isoilbc,leaf_sldrain &
,leaf_ipercol,leaf_runoff_time,leaf_gamm,leaf_gamh,leaf_tprandtl &
,leaf_ribmax,leaf_leaf_maxwhc)
,leaf_ribmax,leaf_leaf_maxwhc,brams_esat_method)

!---------------------------------------------------------------------------------------!
! The following variables can be defined in the regular ED2IN file for stand-alone !
Expand Down Expand Up @@ -592,7 +593,7 @@ subroutine copy_in_bramsnl(expnme_b,runtype_b,itimez_b,idatez_b,imonthz_b,iyearz
,iclobber_b,nzg_b,nzs_b,isoilflg_b,nslcon_b,isoilcol_b,slz_b &
,slmstr_b,stgoff_b,ngrids_b,ubmin_b,ugbmin_b,ustmin_b,isoilbc_b &
,sldrain_b,ipercol_b,runoff_time_b,gamm_b,gamh_b,tprandtl_b &
,ribmax_b,leaf_maxwhc_b)
,ribmax_b,leaf_maxwhc_b,esat_method_b)
use ed_misc_coms , only : expnme & ! intent(out)
, runtype & ! intent(out)
, itimez & ! intent(out)
Expand All @@ -608,7 +609,8 @@ subroutine copy_in_bramsnl(expnme_b,runtype_b,itimez_b,idatez_b,imonthz_b,iyearz
, imonthh & ! intent(out)
, iyearh & ! intent(out)
, iclobber & ! intent(out)
, radfrq ! ! intent(out)
, radfrq & ! intent(out)
, esat_method ! ! intent(out)
use grid_coms , only : centlon & ! intent(out)
, centlat & ! intent(out)
, deltax & ! intent(out)
Expand Down Expand Up @@ -698,6 +700,7 @@ subroutine copy_in_bramsnl(expnme_b,runtype_b,itimez_b,idatez_b,imonthz_b,iyearz
real , intent(in) :: gamh_b ! Sfc. lyr. Gamma for heat
real , intent(in) :: tprandtl_b ! Turbulent Prandtl number
real , intent(in) :: leaf_maxwhc_b ! Leaf max. water holding cap.
integer , intent(in) :: esat_method_b ! Method for esat.
!---------------------------------------------------------------------------------------!


Expand Down Expand Up @@ -760,6 +763,8 @@ subroutine copy_in_bramsnl(expnme_b,runtype_b,itimez_b,idatez_b,imonthz_b,iyearz
ribmax = ribmax_b
leaf_maxwhc = leaf_maxwhc_b
isoilcol = isoilcol_b

esat_method = esat_method_b
!---------------------------------------------------------------------------------------!

return
Expand Down
6 changes: 5 additions & 1 deletion BRAMS/src/ed2/edcp_mpiutils.F90
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ subroutine masterput_ednl(mainnum)
, thsums_database & ! intent(in)
, ivegt_dynamics & ! intent(in)
, ibigleaf & ! intent(in)
, esat_method & ! intent(in)
, integration_scheme & ! intent(in)
, nsub_euler & ! intent(in)
, end_time & ! intent(in)
Expand Down Expand Up @@ -263,6 +264,7 @@ subroutine masterput_ednl(mainnum)
call MPI_Bcast(sldrain,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr)
call MPI_Bcast(ivegt_dynamics,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr)
call MPI_Bcast(ibigleaf,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr)
call MPI_Bcast(esat_method,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr)
call MPI_Bcast(integration_scheme,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr)
call MPI_Bcast(nsub_euler,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr)
call MPI_Bcast(rk4_tolerance,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr)
Expand Down Expand Up @@ -474,6 +476,7 @@ subroutine nodeget_ednl(master_num)
, thsums_database & ! intent(out)
, ivegt_dynamics & ! intent(out)
, ibigleaf & ! intent(out)
, esat_method & ! intent(out)
, integration_scheme & ! intent(out)
, nsub_euler & ! intent(out)
, end_time & ! intent(out)
Expand Down Expand Up @@ -695,7 +698,8 @@ subroutine nodeget_ednl(master_num)
call MPI_Bcast(isoilbc,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr)
call MPI_Bcast(sldrain,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr)
call MPI_Bcast(ivegt_dynamics,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr)
call MPI_Bcast(ibigleaf,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr)
call MPI_Bcast(ibigleaf,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr)
call MPI_Bcast(esat_method,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr)
call MPI_Bcast(integration_scheme,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr)
call MPI_Bcast(nsub_euler,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr)
call MPI_Bcast(rk4_tolerance,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr)
Expand Down
22 changes: 12 additions & 10 deletions BRAMS/src/init/rdint.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1063,7 +1063,8 @@ subroutine read_nl(filename)
, maxubtp ! ! intent(out)
use mem_basic , only : co2_on & ! intent(out)
, co2con & ! intent(out)
, ico2 ! ! intent(out)
, ico2 & ! intent(out)
, esat_method ! ! intent(out)
use domain_decomp , only : domain_fname ! ! intent(out)
use therm_lib , only : vapour_on & ! intent(out)
, cloud_on & ! intent(out)
Expand Down Expand Up @@ -1141,15 +1142,15 @@ subroutine read_nl(filename)
namelist /MODEL_OPTIONS/ naddsc,icorflg,iadvec,iexev,imassflx,ibnd,jbnd,cphas &
,lsflg,nfpt,distim,iswrtyp,ilwrtyp,icumfdbk,radfrq,lonrad &
,npatch,nvegpat,min_patch_area,isfcl,dtleaf,ndtveg,istar &
,igrndvap,ubmin,ugbmin,ustmin,gamm,gamh,tprandtl,ribmax &
,leaf_maxwhc,ico2,co2con,nvgcon,pctlcon,nslcon,isoilcol &
,drtcon,zrough,albedo,seatmp,dthcon,soil_moist &
,soil_moist_fail,usdata_in,usmodel_in,slz,slmstr,stgoff &
,isoilbc,sldrain,ipercol,runoff_time,if_urban_canopy &
,idiffk,ibruvais,ibotflx,ihorgrad,csx,csz,xkhkm,zkhkm &
,nna,nnb,nnc,akmin,akmax,hgtmin,hgtmax,level,icloud,irain &
,ipris,isnow,iaggr,igraup,ihail,cparm,rparm,pparm,sparm &
,aparm,gparm,hparm,gnu
,esat_method,igrndvap,ubmin,ugbmin,ustmin,gamm,gamh &
,tprandtl,ribmax,leaf_maxwhc,ico2,co2con,nvgcon,pctlcon &
,nslcon,isoilcol,drtcon,zrough,albedo,seatmp,dthcon &
,soil_moist,soil_moist_fail,usdata_in,usmodel_in,slz &
,slmstr,stgoff,isoilbc,sldrain,ipercol,runoff_time &
,if_urban_canopy,idiffk,ibruvais,ibotflx,ihorgrad,csx,csz &
,xkhkm,zkhkm,nna,nnb,nnc,akmin,akmax,hgtmin,hgtmax,level &
,icloud,irain,ipris,isnow,iaggr,igraup,ihail,cparm,rparm &
,pparm,sparm,aparm,gparm,hparm,gnu

namelist /MODEL_SOUND/ ipsflg,itsflg,irtsflg,iusflg,hs,ps,ts,rts,us,vs,co2s

Expand Down Expand Up @@ -1811,6 +1812,7 @@ subroutine read_nl(filename)
write (unit=*,fmt=*) ' dtleaf =',dtleaf
write (unit=*,fmt=*) ' ndtveg =',ndtveg
write (unit=*,fmt=*) ' istar =',istar
write (unit=*,fmt=*) ' esat_method =',esat_method
write (unit=*,fmt=*) ' igrndvap =',igrndvap
write (unit=*,fmt=*) ' ubmin =',ubmin
write (unit=*,fmt=*) ' ugbmin =',ugbmin
Expand Down
7 changes: 7 additions & 0 deletions BRAMS/src/io/opspec.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1136,6 +1136,13 @@ subroutine opspec3
ifaterr=ifaterr+1
end if

! Check whether the choice of vapour pressure formula is valid.
if (esat_method < 0 .or. esat_method > 2) then
print *, 'fatal - ESAT_METHOD must be between 0 and 2, and yours is set to ' &
,esat_method,'...'
ifaterr=ifaterr+1
end if

! Check whether the ground vapour method scheme the user chose is fine or not.
if (isfcl /= 0 .and. (igrndvap < 0 .or. igrndvap > 5)) then
print *, 'fatal - IGRNDVAP must be between 0 and 5, and yours is set to ' &
Expand Down
Loading
Loading