Skip to content

Commit

Permalink
Merge pull request #393 from mpaiao/mpaiao-pr-init-multisite
Browse files Browse the repository at this point in the history
New multi-site IED_INIT_MODE option
  • Loading branch information
mpaiao authored Jul 24, 2024
2 parents 48c99d8 + a2dfb03 commit b75775f
Show file tree
Hide file tree
Showing 40 changed files with 3,386 additions and 1,212 deletions.
17 changes: 12 additions & 5 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
17 changes: 12 additions & 5 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
1 change: 1 addition & 0 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
2 changes: 1 addition & 1 deletion BRAMS/src/ed2/edcp_load_namelist.f90
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ subroutine read_ednl(iunit,filename)
, sl_felling_s_ltharv & ! intent(out)
, cl_fseeds_harvest & ! intent(out)
, cl_fstorage_harvest & ! intent(out)
, cl_fleaf_harvest ! ! intent(out)
, cl_fleaf_harvest & ! intent(out)
, lu_database & ! intent(out)
, plantation_file & ! intent(out)
, lu_rescale_file & ! intent(out)
Expand Down
17 changes: 12 additions & 5 deletions ED/Template/Template/ED2IN
Original file line number Diff line number Diff line change
Expand Up @@ -414,14 +414,18 @@ $ED_NL
! /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. !
!---------------------------------------------------------------------------------------!
NL%IED_INIT_MODE = myinitmode
!---------------------------------------------------------------------------------------!
Expand Down Expand Up @@ -715,14 +719,17 @@ $ED_NL
!---------------------------------------------------------------------------------------!
! ISOILBC -- This controls the soil moisture boundary condition at the bottom. Choose !
! the option according to the site characteristics. !
! 0. Flat bedrock. Flux from the bottom of the bottommost layer is zero. !
! 1. Gravitational flow (free drainage). The flux from the bottom of the !
! -1. Hybrid. If the depth to bedrock is shorter than the deepest layer, use !
! flat bedrock, otherwise assume free drainage. This option is more !
! relevant when initialising ED2 with multiple sites per polygon. !
! 0. Flat bedrock. Flux from the bottom of the bottommost layer is zero. !
! 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 is !
! 3. Aquifer. Soil moisture of the ficticious layer beneath the bottom is !
! always at saturation. !
!---------------------------------------------------------------------------------------!
NL%ISOILBC = mysoilbc
Expand Down
6 changes: 3 additions & 3 deletions ED/build/make/include.mk.macosx
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ USE_INTERF=1
#################################### COMPILER SETTINGS #####################################
CMACH=MAC_OS_X
FC_TYPE=GNU
F_COMP=/usr/local/bin/gfortran-12
C_COMP=/usr/local/bin/gcc-12
LOADER=/usr/local/bin/gfortran-12
F_COMP=/usr/local/bin/gfortran-14
C_COMP=/usr/local/bin/gcc-14
LOADER=/usr/local/bin/gfortran-14
LIBS=
MOD_EXT=mod
############################################################################################
Expand Down
1 change: 1 addition & 0 deletions ED/build/make/objects.mk
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ OBJ_MODEL = \
ed_print.o \
ed_read_ed10_20_history.o \
ed_read_ed21_history.o \
ed_read_ed22_initial.o \
ed_state_vars.o \
ed_therm_lib.o \
ed_type_init.o \
Expand Down
13 changes: 9 additions & 4 deletions ED/build/make/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,11 @@ ed_read_ed21_history.o : $(ED_IO)/ed_read_ed21_history.f90
/bin/cp -f $< $(<F:.f90=.f90)
$(F90_COMMAND) $(<F:.f90=.f90)

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

ed_state_vars.o : $(ED_MEMORY)/ed_state_vars.F90
/bin/rm -f $(<F:.F90=.F90)
/bin/cp -f $< $(<F:.F90=.F90)
Expand Down Expand Up @@ -498,10 +503,10 @@ rsys.o: $(ED_UTILS)/rsys.F90
/bin/cp -f $< $(<F:.F90=.F90)
$(FPP_COMMAND) $(<F:.F90=.F90)

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

soil_respiration.o : $(ED_DYNAMICS)/soil_respiration.f90
/bin/rm -f $(<F:.f90=.f90)
Expand Down
17 changes: 12 additions & 5 deletions ED/run/ED2IN
Original file line number Diff line number Diff line change
Expand Up @@ -412,14 +412,18 @@ $ED_NL
! /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. !
!---------------------------------------------------------------------------------------!
NL%IED_INIT_MODE = 6
!---------------------------------------------------------------------------------------!
Expand Down Expand Up @@ -728,14 +732,17 @@ $ED_NL
!---------------------------------------------------------------------------------------!
! ISOILBC -- This controls the soil moisture boundary condition at the bottom. Choose !
! the option according to the site characteristics. !
! 0. Flat bedrock. Flux from the bottom of the bottommost layer is zero. !
! 1. Gravitational flow (free drainage). The flux from the bottom of the !
! -1. Hybrid. If the depth to bedrock is shorter than the deepest layer, use !
! flat bedrock, otherwise assume free drainage. This option is more !
! relevant when initialising ED2 with multiple sites per polygon. !
! 0. Flat bedrock. Flux from the bottom of the bottommost layer is zero. !
! 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 is !
! 3. Aquifer. Soil moisture of the ficticious layer beneath the bottom is !
! always at saturation. !
!---------------------------------------------------------------------------------------!
NL%ISOILBC = 1
Expand Down
Loading

0 comments on commit b75775f

Please sign in to comment.