Skip to content

Commit

Permalink
Merge pull request #2 from ESCOMP/add_era5
Browse files Browse the repository at this point in the history
add era5 stream source
  • Loading branch information
jedwards4b authored Jun 23, 2020
2 parents 713233e + 768fc9e commit c0eec95
Show file tree
Hide file tree
Showing 5 changed files with 470 additions and 6 deletions.
3 changes: 2 additions & 1 deletion datm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ project(datm Fortran)
add_library(datm atm_comp_nuopc.F90
datm_datamode_clmncep_mod.F90
datm_datamode_core2_mod.F90
datm_datamode_jra_mod.F90)
datm_datamode_jra_mod.F90
datm_datamode_era5_mod.F90)

add_dependencies(datm dshr streams)
target_include_directories (datm PUBLIC ${ESMF_F90COMPILEPATHS})
Expand Down
26 changes: 24 additions & 2 deletions datm/atm_comp_nuopc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ module atm_comp_nuopc
use datm_datamode_clmncep_mod , only : datm_datamode_clmncep_advance
use datm_datamode_clmncep_mod , only : datm_datamode_clmncep_restart_write
use datm_datamode_clmncep_mod , only : datm_datamode_clmncep_restart_read
use datm_datamode_era5_mod , only : datm_datamode_era5_advertise
use datm_datamode_era5_mod , only : datm_datamode_era5_init_pointers
use datm_datamode_era5_mod , only : datm_datamode_era5_advance
use datm_datamode_era5_mod , only : datm_datamode_era5_restart_write
use datm_datamode_era5_mod , only : datm_datamode_era5_restart_read

implicit none
private ! except
Expand Down Expand Up @@ -275,7 +280,8 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
if ( trim(datamode) == 'CORE2_NYF' .or. &
trim(datamode) == 'CORE2_IAF' .or. &
trim(datamode) == 'CORE_IAF_JRA' .or. &
trim(datamode) == 'CLMNCEP') then
trim(datamode) == 'CLMNCEP' .or. &
trim(datamode) == 'ERA5') then
else
call shr_sys_abort(' ERROR illegal datm datamode = '//trim(datamode))
endif
Expand All @@ -293,6 +299,9 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
call datm_datamode_clmncep_advertise(exportState, fldsExport, flds_scalar_name, &
flds_co2, flds_wiso, flds_presaero, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
case ('ERA5')
call datm_datamode_era5_advertise(exportState, fldsExport, flds_scalar_name, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
end select

end subroutine InitializeAdvertise
Expand Down Expand Up @@ -528,6 +537,9 @@ subroutine datm_comp_run(importState, exportState, target_ymd, target_tod, targe
case('CLMNCEP')
call datm_datamode_clmncep_init_pointers(importState, exportState, sdat, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
case('ERA5')
call datm_datamode_era5_init_pointers(exportState, sdat, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
end select

! Read restart if needed
Expand All @@ -539,6 +551,8 @@ subroutine datm_comp_run(importState, exportState, target_ymd, target_tod, targe
call datm_datamode_jra_restart_read(restfilm, inst_suffix, logunit, my_task, mpicom, sdat)
case('CLMNCEP')
call datm_datamode_clmncep_restart_read(restfilm, inst_suffix, logunit, my_task, mpicom, sdat)
case('ERA5')
call datm_datamode_era5_restart_read(restfilm, inst_suffix, logunit, my_task, mpicom, sdat)
end select
end if

Expand Down Expand Up @@ -581,6 +595,10 @@ subroutine datm_comp_run(importState, exportState, target_ymd, target_tod, targe
case('CLMNCEP')
call datm_datamode_clmncep_advance(importstate, exportstate, masterproc, logunit, mpicom, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
case('ERA5')
call datm_datamode_era5_advance(exportstate, masterproc, logunit, mpicom, target_ymd, &
target_tod, sdat%model_calendar, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
end select

! Write restarts if needed
Expand All @@ -598,6 +616,10 @@ subroutine datm_comp_run(importState, exportState, target_ymd, target_tod, targe
call datm_datamode_clmncep_restart_write(case_name, inst_suffix, target_ymd, target_tod, &
logunit, mpicom, my_task, sdat)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
case('ERA5')
call datm_datamode_era5_restart_write(case_name, inst_suffix, target_ymd, target_tod, &
logunit, mpicom, my_task, sdat)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
end select
end if

Expand All @@ -606,7 +628,7 @@ subroutine datm_comp_run(importState, exportState, target_ymd, target_tod, targe

! Diagnostics
if (diagnose_data) then
call dshr_state_diagnose(exportState, flds_scalar_name, subname//':ES',rc=rc)
call dshr_state_diagnose(exportState, flds_scalar_name, subname//':ES', rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
end if

Expand Down
6 changes: 4 additions & 2 deletions datm/cime_config/config_component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
This file may have atm desc entries.
-->
<description modifier_mode="1">
<desc atm="DATM[%QIA][%WISOQIA][%CRU][%CRUv7][%GSWP3v1][%NLDAS2][%CPLHIST][%1PT][%NYF][%IAF][%JRA][%JRA-1p4-2018]"> Data driven ATM </desc>
<desc atm="DATM[%QIA][%WISOQIA][%CRU][%CRUv7][%GSWP3v1][%NLDAS2][%CPLHIST][%1PT][%NYF][%IAF][%JRA][%JRA-1p4-2018][%ERA5]"> Data driven ATM </desc>
<desc option="QIA"> QIAN data set </desc>
<desc option="WISOQIA">QIAN with water isotopes</desc>
<desc option="CRU"> CRUNCEP data set </desc>
Expand All @@ -23,6 +23,7 @@
<desc option="IAF">COREv2 interannual forcing</desc>
<desc option="JRA">interannual JRA55 forcing</desc>
<desc option="JRA-1p4-2018">interannual JRA55 forcing, v1.4, through 2018</desc>
<desc option="ERA5">ERA5 interannual forcing</desc>
</description>

<entry id="COMP_ATM">
Expand All @@ -36,7 +37,7 @@

<entry id="DATM_MODE">
<type>char</type>
<valid_values>CORE2_NYF,CORE2_IAF,CLM_QIAN,CLM_QIAN_WISO,CLM1PT,CLMCRUNCEP,CLMCRUNCEPv7,CLMGSWP3v1,CLMNLDAS2,CPLHIST,CORE_IAF_JRA,CORE_IAF_JRA_1p4_2018</valid_values>
<valid_values>CORE2_NYF,CORE2_IAF,CLM_QIAN,CLM_QIAN_WISO,CLM1PT,CLMCRUNCEP,CLMCRUNCEPv7,CLMGSWP3v1,CLMNLDAS2,CPLHIST,CORE_IAF_JRA,CORE_IAF_JRA_1p4_2018,ERA5</valid_values>
<default_value>CORE2_NYF</default_value>
<group>run_component_datm</group>
<file>env_run.xml</file>
Expand All @@ -56,6 +57,7 @@
<value compset="%NLDAS2">CLMNLDAS2</value>
<value compset="%1PT">CLM1PT</value>
<value compset="%CPLHIST">CPLHIST</value>
<value compset="%ERA5">ERA5</value>
</values>
</entry>

Expand Down
62 changes: 61 additions & 1 deletion datm/cime_config/namelist_definition_datm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
CORE2_IAF = CORE2 intra-annual year forcing (for forcing POP and CICE)
CORE_IAF_JRA = JRA55 intra-annual year forcing (for forcing POP and CICE)
CORE_IAF_JRA_1p4_2018 = JRA55 intra-annual year forcing, v1.4, through 2018 (for forcing POP and CICE)
ERA5 = ERA5 intra-annual year forcing
CPLHIST = Streams for lnd or ocn/ice forcing used for spinup
Currently the following optional streams are supported
Expand Down Expand Up @@ -239,6 +240,9 @@
<value datm_mode="CORE2_IAF" atm_grid="01col" >
CORE2_IAF.NCEP.DENS.SOFS,CORE2_IAF.NCEP.PSLV.SOFS,CORE2_IAF.PREC.SOFS.DAILY,CORE2_IAF.LWDN.SOFS.DAILY,CORE2_IAF.SWDN.SOFS.DAILY,CORE2_IAF.SWUP.SOFS.DAILY,CORE2_IAF.SHUM.SOFS.6HOUR,CORE2_IAF.TBOT.SOFS.6HOUR,CORE2_IAF.U.SOFS.6HOUR,CORE2_IAF.V.SOFS.6HOUR,CORE2_IAF.CORE2.ArcFactor
</value>
<value datm_mode="ERA5">
ERA5_HOURLY
</value>
<value datm_mode="CPLHIST">
CPLHISTForcing.Solar,CPLHISTForcing.nonSolarFlux,CPLHISTForcing.State3hr,CPLHISTForcing.State1hr
</value>
Expand Down Expand Up @@ -440,6 +444,12 @@
<value stream="CORE_IAF_JRA.CORE2.ArcFactor">
$DIN_LOC_ROOT/share/meshes/T62_040121_ESMFmesh_c20190714.nc
</value>
<!-- =================== -->
<!-- meshes for datm_mode ERA5 -->
<!-- =================== -->
<value stream="ERA5_HOURLY">
$DIN_LOC_ROOT/share/meshes/TL639_200618_ESMFmesh.nc
</value>
<!-- ===================-->
<!-- optional stream co2tseries -->
<!-- currently all co2 time series are single point and have no mesh -->
Expand Down Expand Up @@ -1763,6 +1773,23 @@
$DIN_LOC_ROOT/atm/datm7/CORE2/CORE2.t_10.ArcFactor.T62.1997-2004.nc
</value>
<!-- ===================-->
<!-- stream data for ERA5 stream -->
<!-- ===================-->
<value stream="ERA5_HOURLY">
$DIN_LOC_ROOT/atm/datm7/ERA5/ERA5.TL639.2019.01.200618.nc
$DIN_LOC_ROOT/atm/datm7/ERA5/ERA5.TL639.2019.02.200618.nc
$DIN_LOC_ROOT/atm/datm7/ERA5/ERA5.TL639.2019.03.200618.nc
$DIN_LOC_ROOT/atm/datm7/ERA5/ERA5.TL639.2019.04.200618.nc
$DIN_LOC_ROOT/atm/datm7/ERA5/ERA5.TL639.2019.05.200618.nc
$DIN_LOC_ROOT/atm/datm7/ERA5/ERA5.TL639.2019.06.200618.nc
$DIN_LOC_ROOT/atm/datm7/ERA5/ERA5.TL639.2019.07.200618.nc
$DIN_LOC_ROOT/atm/datm7/ERA5/ERA5.TL639.2019.08.200618.nc
$DIN_LOC_ROOT/atm/datm7/ERA5/ERA5.TL639.2019.09.200618.nc
$DIN_LOC_ROOT/atm/datm7/ERA5/ERA5.TL639.2019.10.200618.nc
$DIN_LOC_ROOT/atm/datm7/ERA5/ERA5.TL639.2019.11.200618.nc
$DIN_LOC_ROOT/atm/datm7/ERA5/ERA5.TL639.2019.12.200618.nc
</value>
<!-- ===================-->
<!-- stream data for optional stream co2tseries -->
<!-- ===================-->
<value stream="co2tseries.20tr" cime_model="cesm">
Expand Down Expand Up @@ -2172,6 +2199,32 @@
<value stream="CORE_IAF_JRA.CORE2.ArcFactor">
TarcFactor tarcf
</value>
<!-- =================== -->
<!-- datamode ERA5_ERA5_HOURLY -->
<!-- =================== -->
<value stream="ERA5_HOURLY">
u10 Sa_u
v10 Sa_v
t2m Sa_tbot
d2m Sa_tdew
msl Sa_pslv
sp Sa_pbot
tp Faxa_rain
cp Faxa_rainc
lsp Faxa_rainl
csf Faxa_snowc
lsf Faxa_snowl
ssrd Faxa_swdn
strd Faxa_lwdn
aluvp Faxa_swvdr
aluvd Faxa_swvdf
alnip Faxa_swndr
alnid Faxa_swndf
sshf Faxa_sen
slhf Faxa_lat
ewss Faxa_taux
nsss Faxa_tauy
</value>
<!-- =================== -->
<!-- stream variable names for optional stream co2tseries -->
<!-- =================== -->
Expand Down Expand Up @@ -2285,6 +2338,7 @@
<value stream="CORE2_IAF.CORE2.ArcFactor">1</value>
<value stream="CORE2_IAF">1</value>
<value stream="CORE_IAF_JRA">1</value>
<value stream="ERA5_HOURLY">1900</value>
<value stream="co2tseries.20tr">1850</value>
<value stream="co2tseries.SSP">2015</value>
<value stream="BC.CRUNCEP.GPCP.Precip">1979</value>
Expand Down Expand Up @@ -2347,6 +2401,7 @@
<value stream="CORE_IAF_JRA.U_10">1958</value>
<value stream="CORE_IAF_JRA.V_10">1958</value>
<value stream="CORE_IAF_JRA.CORE2.ArcFactor">1958</value>
<value stream="ERA5_HOURLY">2019</value>
<value stream="co2tseries.20tr">1850</value>
<value stream="co2tseries.SSP">2015</value>
<value stream="Anomaly.Forcing">2006</value>
Expand Down Expand Up @@ -2407,6 +2462,7 @@
<value stream="CORE_IAF_JRA.U_10">2016</value>
<value stream="CORE_IAF_JRA.V_10">2016</value>
<value stream="CORE_IAF_JRA.CORE2.ArcFactor">2016</value>
<value stream="ERA5_HOURLY">2019</value>
<value stream="co2tseries.20tr">2014</value>
<value stream="co2tseries.SSP">2500</value>
<value stream="BC.CRUNCEP.GPCP.Precip">2012</value>
Expand Down Expand Up @@ -2600,6 +2656,7 @@
<value datm_mode="CORE2_NYF">u:v</value>
<value datm_mode="CORE2_IAF">u:v</value>
<value datm_mode="CORE_IAF_JRA">u:v</value>
<value datm_mode="ERA5">u:v,taux:tauy</value>
</values>
</entry>

Expand Down Expand Up @@ -2630,7 +2687,7 @@
<type>char</type>
<category>datm</category>
<group>datm_nml</group>
<valid_values>CLMNCEP,COPYALL,CORE2_NYF,CORE2_IAF,CORE_IAF_JRA</valid_values>
<valid_values>CLMNCEP,COPYALL,CORE2_NYF,CORE2_IAF,CORE_IAF_JRA,ERA5</valid_values>
<desc>
general method that operates on the data. this is generally
implemented in the data models but is set in the strdata method for
Expand Down Expand Up @@ -2669,13 +2726,16 @@
mode replicates code previously found in CLM (circa 2005), before the
LMWG started using the CCSM flux coupler and data models to do
active-land-only simulations.
datamode = "ERA5"
Fifth generation ECMWF atmospheric reanalysis of the global climate
</desc>
<values>
<value>COPYALL</value>
<value datm_mode="CLM">CLMNCEP</value>
<value datm_mode="CORE2_NYF">CORE2_NYF</value>
<value datm_mode="CORE2_IAF">CORE2_IAF</value>
<value datm_mode="CORE_IAF_JRA">CORE_IAF_JRA</value>
<value datm_mode="ERA5">ERA5</value>
<value datm_mode="CPLHIST">COPYALL</value>
</values>
</entry>
Expand Down
Loading

0 comments on commit c0eec95

Please sign in to comment.