Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IM1 WIP - ALT and excess_ice changes #3

Merged
merged 7 commits into from
May 1, 2024
Merged
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
56 changes: 56 additions & 0 deletions .github/workflows/ci-compile-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: CI
on:
push:
branches:
- '**'
jobs:
container-test-job:
runs-on: ubuntu-latest
container:
image: rfiorella/e3sm-dev:latest
steps:
- name: Check out the NGEE-Arctic-E3SM repo
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
submodules: true
- name: Setup cime and input datafiles
run: |
mkdir ~/.cime
cp /home/e3smuser/.cime/* /github/home/.cime/
git clone https://github.com/rfiorella/pt-e3sm-inputdata /home/e3smuser/inputdata
cd /home/e3smuser/inputdata/lnd/clm2/firedata
tar -zxvf clmforc.Li_2012_hdm_0.5x0.5_AVHRR_simyr1850-2010_c130401.nc.tar.gz
cd /home/e3smuser/inputdata/atm/datm7/NASA_LIS/
tar -zxvf clmforc.Li_2012_climo1995-2011.T62.lnfm_c130327.nc.tar.gz
tar -zxvf clmforc.Li_2012_climo1995-2011.T62.lnfm_Total_c140423.nc.tar.gz
ls -v /home/e3smuser/inputdata/atm/datm7/NASA_LIS/
- name: create new case and setup
run: |
cd cime/scripts && ./create_newcase --mach docker --res ELM_USRDAT --compset ICB1850CNPRDCTCBC --case ~/output/ci_test \
&& cd ~/output/ci_test
./xmlchange MOSART_MODE=NULL,DOUT_S=FALSE,DIN_LOC_ROOT=/home/e3smuser/inputdata
./xmlchange DIN_LOC_ROOT_CLMFORC=/home/e3smuser/inputdata/atm/datm7
./xmlchange ELM_USRDAT_NAME=1x1pt_AK-TLG
./xmlchange ATM_DOMAIN_PATH=/home/e3smuser/inputdata/share/domains/domain.clm
./xmlchange LND_DOMAIN_PATH=/home/e3smuser/inputdata/share/domains/domain.clm
./xmlchange ATM_DOMAIN_FILE=domain.lnd.1x1pt_teller-GRID_navy.nc
./xmlchange LND_DOMAIN_FILE=domain.lnd.1x1pt_teller-GRID_navy.nc
./xmlchange PIO_TYPENAME=netcdf,NTASKS=1,NTHRDS=1
./xmlchange STOP_OPTION=nyears,STOP_N=5
./xmlchange BATCH_SYSTEM=none
echo "&clm_inparm" >> user_nl_elm
echo " do_budgets = .false." >> user_nl_elm
echo " use_nofire = .true." >> user_nl_elm
echo " metdata_type = 'gswp3'" >> user_nl_elm
echo " metdata_bypass = '/home/e3smuser/inputdata/atm/datm7/atm_forcing.datm7.GSWP3.0.5d.v2.c180716_NGEE-Grid/cpl_bypass_teller-Grid'" >> user_nl_elm
echo " fsurdat = '/home/e3smuser/inputdata/lnd/clm2/surfdata_map/surfdata_1x1pt_teller-GRID_simyr1850_c360x720_c171002.nc'" >> user_nl_elm
echo " stream_fldfilename_popdens = '/home/e3smuser/inputdata/lnd/clm2/firedata/clmforc.Li_2012_hdm_0.5x0.5_AVHRR_simyr1850-2010_c130401.nc'" >> user_nl_elm
./case.setup
# add coupler bypass flag to cmake macros.
echo 'string(APPEND CPPDEFS " -DCPL_BYPASS")' >> cmake_macros/universal.cmake
./case.build || cat /home/e3smuser/output/ci_test/bld/e3sm.bldlog.*
./case.submit --no-batch
cat /home/e3smuser/output/ci_test/run/e3sm.log.*
cat /home/e3smuser/output/ci_test/run/lnd.log.*

3 changes: 3 additions & 0 deletions components/elm/src/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"cmake.configureOnOpen": false
}
49 changes: 30 additions & 19 deletions components/elm/src/biogeophys/ActiveLayerMod.F90
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
module ActiveLayerMod

!-----------------------------------------------------------------------
! !DESCRIPTION:
! Module holding routines for calculation of active layer dynamics
!
! !USES:
use shr_kind_mod , only : r8 => shr_kind_r8
use shr_const_mod , only : SHR_CONST_TKFRZ
use elm_varctl , only : iulog
use elm_varctl , only : iulog, spinup_state
use TemperatureType , only : temperature_type
use CanopyStateType , only : canopystate_type
use GridcellType , only : grc_pp
use GridcellType , only : grc_pp
use ColumnType , only : col_pp
use ColumnDataType , only : col_es
use ColumnDataType , only : col_es
!
implicit none
save
Expand All @@ -21,12 +21,12 @@ module ActiveLayerMod
! !PUBLIC MEMBER FUNCTIONS:
public:: alt_calc
!-----------------------------------------------------------------------

contains

!-----------------------------------------------------------------------
subroutine alt_calc(num_soilc, filter_soilc, &
temperature_vars, canopystate_vars)
temperature_vars, canopystate_vars)
!
! !DESCRIPTION:
! define active layer thickness similarly to frost_table, except set as deepest thawed layer and define on nlevgrnd
Expand Down Expand Up @@ -68,15 +68,17 @@ subroutine alt_calc(num_soilc, filter_soilc, &
real(r8) :: t1, t2, z1, z2 ! temporary variables
!-----------------------------------------------------------------------

associate( &
t_soisno => col_es%t_soisno , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) (-nlevsno+1:nlevgrnd)

alt => canopystate_vars%alt_col , & ! Output: [real(r8) (:) ] current depth of thaw
altmax => canopystate_vars%altmax_col , & ! Output: [real(r8) (:) ] maximum annual depth of thaw
altmax_lastyear => canopystate_vars%altmax_lastyear_col , & ! Output: [real(r8) (:) ] prior year maximum annual depth of thaw
alt_indx => canopystate_vars%alt_indx_col , & ! Output: [integer (:) ] current depth of thaw
altmax_indx => canopystate_vars%altmax_indx_col , & ! Output: [integer (:) ] maximum annual depth of thaw
altmax_lastyear_indx => canopystate_vars%altmax_lastyear_indx_col & ! Output: [integer (:) ] prior year maximum annual depth of thaw
associate( &
t_soisno => col_es%t_soisno , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) (-nlevsno+1:nlevgrnd)

alt => canopystate_vars%alt_col , & ! Output: [real(r8) (:) ] current depth of thaw
altmax => canopystate_vars%altmax_col , & ! Output: [real(r8) (:) ] maximum annual depth of thaw
altmax_lastyear => canopystate_vars%altmax_lastyear_col , & ! Output: [real(r8) (:) ] prior year maximum annual depth of thaw
altmax_ever => canopystate_vars%altmax_ever_col , & ! Output: [real(r8) (:) ] maximum thaw depth since initialization
alt_indx => canopystate_vars%alt_indx_col , & ! Output: [integer (:) ] current depth of thaw
altmax_indx => canopystate_vars%altmax_indx_col , & ! Output: [integer (:) ] maximum annual depth of thaw
altmax_lastyear_indx => canopystate_vars%altmax_lastyear_indx_col , & ! Output: [integer (:) ] prior year maximum annual depth of thaw
altmax_ever_indx => canopystate_vars%altmax_ever_indx_col & ! Output: [integer (:) ] maximum thaw depth since initialization
)

! on a set annual timestep, update annual maxima
Expand All @@ -88,7 +90,7 @@ subroutine alt_calc(num_soilc, filter_soilc, &
c = filter_soilc(fc)
g = col_pp%gridcell(c)
if ( grc_pp%lat(g) > 0. ) then

altmax_lastyear(c) = altmax(c)
altmax_lastyear_indx(c) = altmax_indx(c)
altmax(c) = 0.
Expand All @@ -100,7 +102,7 @@ subroutine alt_calc(num_soilc, filter_soilc, &
do fc = 1,num_soilc
c = filter_soilc(fc)
g = col_pp%gridcell(c)
if ( grc_pp%lat(g) <= 0. ) then
if ( grc_pp%lat(g) <= 0. ) then
altmax_lastyear(c) = altmax(c)
altmax_lastyear_indx(c) = altmax_indx(c)
altmax(c) = 0.
Expand Down Expand Up @@ -150,11 +152,20 @@ subroutine alt_calc(num_soilc, filter_soilc, &
altmax(c) = alt(c)
altmax_indx(c) = alt_indx(c)
endif
if (alt(c) > altmax_ever(c)) then
if (spinup_state .eq. 0) then !overwrite if in spinup
altmax_ever(c) = alt(c)
altmax_ever_indx(c) = alt_indx(c)
else
altmax_ever(c) = 0._r8
altmax_ever_indx(c) = 0
endif
endif

end do

end associate
end associate

end subroutine alt_calc

end module ActiveLayerMod
Loading