CLM 5.6 Running with your own atmosphere forcing - erika72/clm-docs GitHub Wiki
Here we want to run with our own customized datasets for CLM as well as running with our own supplied atmosphere forcing datasets. Thus we effectively combine the information from the Section called Running Supported Single-point Datasets that have their own Atmospheric Forcing with the Section called Creating your own single-point/regional surface datasets. First we need to follow the procedures in the Section called Running Supported Single-point Datasets that have their own Atmospheric Forcing to come up with CLM datasets that are customized for our point or region in question. This includes running link_dirtree to create a directory location where you can add your own files to it. Next, set DATM_MODE
to CLM1PT
and CLM_USRDAT_NAME
to the id of the data you created. To see a list of what the filenames need to be see the section on setting CLM_USRDAT_NAME.
Next we need to setup the atmosphere forcing data in NetCDF format that can be read by DATM. There is a list of eight variables that are expected to be on the input files with the names and units on the following table (in the table TDEW and SHUM are optional fields that can be used in place of RH). In the table we also list which of the fields are required and if not required what the code will do to replace them. If the names of the fields are different or the list is changed from the standard list of eight fields: FLDS, FSDS, PRECTmms, PSRF, RH, TBOT, WIND, and ZBOT, the resulting streams file will need to be modified to take this into account (see an example streams file for this in Example 5-8 below).
Insert table 5-1
All of the variables should be dimensioned: time, lat, lon, with time being the unlimited dimension. The coordinate variable "time" is also required with CF-compliant units in days, hours, minutes, or seconds. It can also have a calendar attribute that can be "noleap" or "gregorian". Normally the files will be placed in the: $MYCSMDATA/atm/datm7/CLM1PT_data/$MYUSRDAT
directory with separate files per month called YYYY-MM.nc
where YYYY-MM corresponds to the four digit year and two digit month with a dash in-between. You also need a domain file that gives the coordinate information for the data that should be placed in: $MYCSMDATA/atm/datm7/domain.lnd.$MYUSRDAT_USGS.nc.
> cd scripts
# First make sure you have a inputdata location that you can write to
# You only need to do this step once, so you won't need to do this in the future
> setenv MYCSMDATA $HOME/inputdata # Set env var for the directory for input data
> ./link_dirtree $CSMDATA $MYCSMDATA
# Next create and move all your datasets into $MYCSMDATA with id $MYUSRDAT
# See above for naming conventions
# Now create a single-point case
> ./create_newcase -case my_atmforc_test -res pt1_pt1 -compset I1850CRUCLM45BGC \
-mach yellowstone_intel
> cd my_atmforc_test
# Set the data root to your inputdata directory, and set CLM_USRDAT_NAME
# to the user id you created for your datasets above
> ./xmlchange DIN_LOC_ROOT_CSMDATA=$MYCSMDATA,CLM_USRDAT_NAME=$MYUSRDAT
# Set the land-mask to USGS, so both clm and DATM can find files
> ./xmlchange CLM_BLDNML_OPTS='-mask USGS'
# Then set DATM_MODE to single-point mode so DATM will use your forcing datasets
# Put your forcing datasets into $MYCSMDATA/atm/datm7/CLM1PT_data/$MYUSRDAT
> ./xmlchange DATM_MODE=CLM1PT
> ./cesm_setup
# If the list of fields, or filenames, filepaths, or fieldnames are different
# you'll need to edit the DATM namelist streams file to make it consistent
> $EDITOR Buildconf/datm.buildnml.csh
See the Section called Warning about Running with a Single-Processor on a Batch Machine for a warning about running single-point jobs on batch machines.
Note: See the Section called Managing Your Own Data-files in Chapter 3 for notes about managing your data when using link_dirtree.
Now, we'll show an example of what the DATM streams file might look like for a case with your own forcing data with 3-hourly forcing. In this example, we'll leave off the fields: ZBOT, and FLDS so they'll be calculated as given in the Table 5-1 table above. We'll also include: FSDSdif and FSDSdir which aren't required, and we'll use TDEW in place of RH. In this example the datafiles are in NetCDF format and contain the fields: TA, Tdew, WS, PREC, Rg, Rgdir, Rgdif, and PRESS which are translated into the DATM internal names in this streams file. There is also a domain file that has the position information for this location. The normal assumption for CLM1PT mode in the DATM is that data is hourly or half-hourly and as such is often enough that using the data on the nearest time-stamp is reasonable and as such the data is in a single streams file (see the Section called CLM1PT mode and it's DATM settings in Chapter 1 for more information on the default settings for DATM and how to change them. If the data is less often three to six hours -- see Example 5-8 below, where you will need to modify the time-interpolation method as well as the time stamp offsets. In the example below we also have to divide the single stream file into three files to manage the time-stamps and time interpolation algorithm for the different types of data differently.
Precipitation streams file (clm1PT.1x1pt_lapazMEX.precip.stream.txt
file) .
<streamstemplate>
<stream>
<dataSource>
CLMNCEP
</dataSource>
<domainInfo>
<variableNames>
time time
xc lon
yc lat
area area
mask mask
</variableNames>
<filePath>
$DIN_LOC_ROOT/atm/datm7/domain.clm
</filePath>
<fileNames>
domain.lnd.1x1pt_lapazMEX_navy.nc
</fileNames>
</domainInfo>
<fieldInfo>
<variableNames>
PRECTmms PREC
</variableNames>
<offset>
-5400
</offset>
<filePath>
$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/1x1pt_lapazMEX
</filePath>
<fileNames>
2004-01.nc
2004-02.nc
2004-03.nc
.
.
.
2009-12.nc
</fileNames>
</fieldInfo>
</stream>
</streamstemplate>
Solar streams file (clm1PT.1x1pt_lapazMEX.solar.stream.txt
file).
<streamstemplate>
<stream>
<dataSource>
CLMNCEP
</dataSource>
<domainInfo>
<variableNames>
time time
xc lon
yc lat
area area
mask mask
</variableNames>
<filePath>
$DIN_LOC_ROOT/atm/datm7/domain.clm
</filePath>
<fileNames>
domain.lnd.1x1pt_lapazMEX_navy.nc
</fileNames>
</domainInfo>
<fieldInfo>
<variableNames>
FSDS Rg
FSDSdir Rgdir
FSDSdif Rgdif
</variableNames>
<offset>
-10800
</offset>
<filePath>
$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/1x1pt_lapazMEX
</filePath>
<fileNames>
2004-01.nc
2004-02.nc
2004-03.nc
.
.
.
2009-12.nc
</fileNames>
</fieldInfo>
</stream>
</streamstemplate>
Other fields streams file. (clm1PT.1x1pt_lapazMEX.other.stream.txt file) .
<streamstemplate>
<stream>
<dataSource>
CLMNCEP
</dataSource>
<domainInfo>
<variableNames>
time time
xc lon
yc lat
area area
mask mask
</variableNames>
<filePath>
$DIN_LOC_ROOT/atm/datm7/domain.clm
</filePath>
<fileNames>
domain.lnd.1x1pt_lapazMEX_navy.nc
</fileNames>
</domainInfo>
<fieldInfo>
<variableNames>
TBOT TA
TDEW Tdew
WIND WS
PSRF PRESS
</variableNames>
<offset>
-5400
</offset>
<filePath>
$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/1x1pt_lapazMEX
</filePath>
<fileNames>
2004-01.nc
2004-02.nc
2004-03.nc
.
.
.
2009-12.nc
</fileNames>
</fieldInfo>
</stream>
</streamstemplate>
Example streams namelist for the above streams files:
-
&shr_strdata_nml dataMode = 'CLMNCEP' domainFile = '$DOMAINFILE' streams = 'clm1PT.1x1pt_lapazMEX.solar.stream.txt 1 2004 2009 ', 'clm1PT.1x1pt_lapazMEX.precip.stream.txt 1 2004 2009 ', 'clm1PT.1x1pt_lapazMEX.other.stream.txt 1 2004 2009 ', 'presaero.stream.txt 1 2000 2000' vectors = 'null','null','null','null' mapmask = 'nomask','nomask','nomask','nomask' mapalgo = 'nn','nn','nn','nn' tintalgo = 'coszen','nearest','linear','linear' taxmode = 'cycle','cycle','cycle','cycle' /
- Note: The example above shows the resolved namelist and streams file after cesm_setup has been run.
We've outlined and given a few examples of using your own atmosphere forcing. In the next chapter we go into the details of using PTCLM1.110726.