Skip to content

Commit

Permalink
Merge pull request #198 from alperaltuntas/merge_simple_forcing
Browse files Browse the repository at this point in the history
Simple DATM forcing mode
  • Loading branch information
jedwards4b authored Oct 9, 2023
2 parents 4a6b374 + 3501b20 commit 74b5c4c
Show file tree
Hide file tree
Showing 7 changed files with 519 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 @@ -6,7 +6,8 @@ set(SRCFILES atm_comp_nuopc.F90
datm_datamode_jra_mod.F90
datm_datamode_gefs_mod.F90
datm_datamode_cfsr_mod.F90
datm_datamode_era5_mod.F90)
datm_datamode_era5_mod.F90
datm_datamode_simple_mod.F90)


foreach(FILE ${SRCFILES})
Expand Down
25 changes: 24 additions & 1 deletion datm/atm_comp_nuopc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ module cdeps_datm_comp
use datm_datamode_cfsr_mod , only : datm_datamode_cfsr_restart_write
use datm_datamode_cfsr_mod , only : datm_datamode_cfsr_restart_read

use datm_datamode_simple_mod , only : datm_datamode_simple_advertise
use datm_datamode_simple_mod , only : datm_datamode_simple_init_pointers
use datm_datamode_simple_mod , only : datm_datamode_simple_advance
use datm_datamode_simple_mod , only : datm_datamode_simple_restart_write
use datm_datamode_simple_mod , only : datm_datamode_simple_restart_read

implicit none
private ! except

Expand Down Expand Up @@ -350,7 +356,8 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
trim(datamode) == 'CPLHIST' .or. &
trim(datamode) == 'GEFS' .or. &
trim(datamode) == 'CFSR' .or. &
trim(datamode) == 'ERA5') then
trim(datamode) == 'ERA5' .or. &
trim(datamode) == 'SIMPLE') then
else
call shr_sys_abort(' ERROR illegal datm datamode = '//trim(datamode))
endif
Expand Down Expand Up @@ -382,6 +389,10 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
case ('CFSR')
call datm_datamode_cfsr_advertise(exportState, fldsExport, flds_scalar_name, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
case ('SIMPLE')
call datm_datamode_simple_advertise(exportState, fldsExport, flds_scalar_name, &
nlfilename, my_task, vm, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
end select

end subroutine InitializeAdvertise
Expand Down Expand Up @@ -625,6 +636,9 @@ subroutine datm_comp_run(importState, exportState, target_ymd, target_tod, targe
case('CFSR')
call datm_datamode_cfsr_init_pointers(exportState, sdat, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
case('SIMPLE')
call datm_datamode_simple_init_pointers(exportState, sdat, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
end select

! Read restart if needed
Expand All @@ -644,6 +658,8 @@ subroutine datm_comp_run(importState, exportState, target_ymd, target_tod, targe
call datm_datamode_gefs_restart_read(restfilm, inst_suffix, logunit, my_task, mpicom, sdat)
case('CFSR')
call datm_datamode_cfsr_restart_read(restfilm, inst_suffix, logunit, my_task, mpicom, sdat)
case('SIMPLE')
call datm_datamode_simple_restart_read(restfilm, inst_suffix, logunit, my_task, mpicom, sdat)
end select
end if

Expand Down Expand Up @@ -698,6 +714,10 @@ subroutine datm_comp_run(importState, exportState, target_ymd, target_tod, targe
call datm_datamode_cfsr_advance(exportstate, mainproc, logunit, mpicom, target_ymd, &
target_tod, sdat%model_calendar, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
case('SIMPLE')
call datm_datamode_simple_advance(target_ymd, target_tod, target_mon, &
sdat%model_calendar, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
end select

! Write restarts if needed
Expand Down Expand Up @@ -726,6 +746,9 @@ subroutine datm_comp_run(importState, exportState, target_ymd, target_tod, targe
call datm_datamode_cfsr_restart_write(case_name, inst_suffix, target_ymd, target_tod, &
logunit, my_task, sdat)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
case('SIMPLE')
call datm_datamode_simple_restart_write(case_name, inst_suffix, target_ymd, target_tod, &
logunit, my_task, sdat)
end select
end if

Expand Down
2 changes: 1 addition & 1 deletion datm/cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def _create_namelists(case, confdir, inst_string, infile, nmlgen, data_list_path

# Generate datm_in
namelist_file = os.path.join(confdir, "datm_in")
nmlgen.write_output_file(namelist_file, data_list_path, groups=['datm_nml'])
nmlgen.write_output_file(namelist_file, data_list_path, groups=['datm_nml','const_forcing_nml'])

# Determine streams
streamlist = nmlgen.get_streams()
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][%MOSARTTEST][%NLDAS2][%CPLHIST][%1PT][%NYF][%IAF][%JRA][%JRA-1p4-2018][%JRA-RYF8485][%JRA-RYF9091][%JRA-RYF0304]"> Data driven ATM </desc>
<desc atm="DATM[%QIA][%WISOQIA][%CRU][%CRUv7][%GSWP3v1][%MOSARTTEST][%NLDAS2][%CPLHIST][%1PT][%NYF][%IAF][%JRA][%JRA-1p4-2018][%JRA-RYF8485][%JRA-RYF9091][%JRA-RYF0304][%SIMPLE]"> 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 @@ -27,6 +27,7 @@
<desc option="JRA-RYF9091"> JRA55 Repeat Year Forcing v1.3 1990-1991</desc>
<desc option="JRA-RYF0304"> JRA55 Repeat Year Forcing v1.3 2003-2004</desc>
<desc option="ERA5">ERA5 interannual forcing</desc>
<desc option="SIMPLE">Namelist-configurable, constant datm forcing for simple experiments</desc>
</description>

<entry id="COMP_ATM">
Expand All @@ -40,7 +41,7 @@

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

Expand Down
111 changes: 110 additions & 1 deletion datm/cime_config/namelist_definition_datm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
<value datm_mode="ERA5">
ERA5_HOURLY
</value>
<value datm_mode="SIMPLE" ></value>
<value datm_mode="CPLHIST">
CPLHISTForcing.Solar,CPLHISTForcing.nonSolarFlux,CPLHISTForcing.State3hr,CPLHISTForcing.State1hr
</value>
Expand All @@ -80,7 +81,7 @@
<type>char</type>
<category>datm</category>
<group>datm_nml</group>
<valid_values>CLMNCEP,CORE2_NYF,CORE2_IAF,CORE_IAF_JRA,ERA5,CPLHIST,1PT</valid_values>
<valid_values>CLMNCEP,CORE2_NYF,CORE2_IAF,CORE_IAF_JRA,ERA5,SIMPLE,CPLHIST,1PT</valid_values>
<desc>
general method that operates on the data.
----datamode = "CPLHIST"----
Expand Down Expand Up @@ -114,6 +115,8 @@
active-land-only simulations.
----datamode = "ERA5"----
Fifth generation ECMWF atmospheric reanalysis of the global climate
----datamode = "SIMPLE"----
Namelist-configurable, constant datm forcing for simple experiments
----datamode = "CPLHIST" ----
</desc>
<values>
Expand All @@ -132,6 +135,9 @@
<value datm_mode="ERA5">
ERA5
</value>
<value datm_mode="SIMPLE">
SIMPLE
</value>
<value datm_mode="CPLHIST">
CPLHIST
</value>
Expand Down Expand Up @@ -364,4 +370,107 @@
</values>
</entry>

<entry id="dn10">
<type>real</type>
<category>datm</category>
<group>const_forcing_nml</group>
<desc>
density at the lowest model layer
units: kg m-3
</desc>
<values>
<value>1.204</value>
</values>
</entry>

<entry id="slp">
<type>real</type>
<category>datm</category>
<group>const_forcing_nml</group>
<desc>
inst_pres_height_surface
units: Pa
</desc>
<values>
<value>101325.0</value>
</values>
</entry>

<entry id="q">
<type>real</type>
<category>datm</category>
<group>const_forcing_nml</group>
<desc>
Constant bottom layer specific humidity
units: kg kg-1
</desc>
<values>
<value>0.0</value>
</values>
</entry>

<entry id="t">
<type>real</type>
<category>datm</category>
<group>const_forcing_nml</group>
<desc>
Constant air temperature at lowest model layer
units: K
</desc>
<values>
<value>273.15</value>
</values>
</entry>

<entry id="u">
<type>real</type>
<category>datm</category>
<group>const_forcing_nml</group>
<desc>
Constant zonal wind speed forcing for simple models.
units: m s-1
</desc>
<values>
<value>0.0</value>
</values>
</entry>

<entry id="v">
<type>real</type>
<category>datm</category>
<group>const_forcing_nml</group>
<desc>
Constant meridional wind speed forcing for simple models.
units: m s-1
</desc>
<values>
<value>0.0</value>
</values>
</entry>

<entry id="peak_swdn">
<type>real</type>
<category>datm</category>
<group>const_forcing_nml</group>
<desc>
Peak idealized shortwave radiation to be passed to ice/ocean surface.
units: W m-2
</desc>
<values>
<value>330.0</value>
</values>
</entry>

<entry id="peak_lwdn">
<type>real</type>
<category>datm</category>
<group>const_forcing_nml</group>
<desc>
Peak idealized longwave radiation to be passed to ice/ocean surface.
units: W m-2
</desc>
<values>
<value>450.0</value>
</values>
</entry>
</entry_id>
1 change: 1 addition & 0 deletions datm/cime_config/stream_definition_datm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
CORE_RYF9091_JRA = JRA55 repeat year forcing, v1.3, 1990-1991 (for forcing POP and CICE)
CORE_RYF0304_JRA = JRA55 repeat year forcing, v1.3, 2003-2004 (for forcing POP and CICE)
ERA5 = ERA5 intra-annual year forcing
SIMPLE = Namelist-configurable, constant datm forcing for simple experiments
CPLHIST = Streams for lnd or ocn/ice forcing used for spinup
Currently the following optional streams are supported
Expand Down
Loading

0 comments on commit 74b5c4c

Please sign in to comment.