diff --git a/setup.py b/setup.py index 6fe6caea..6b051ec5 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ def package_files(directory, prefixes, extensions): data_files = package_files( - "zppy", prefixes=[], extensions=["bash", "csh", "cfg", "ini", "sh"] + "zppy", prefixes=[], extensions=["bash", "csh", "cfg", "ini", "sh", "json"] ) setup( diff --git a/zppy/__main__.py b/zppy/__main__.py index 40bfe283..0a195f79 100644 --- a/zppy/__main__.py +++ b/zppy/__main__.py @@ -9,6 +9,7 @@ from zppy.climo import climo from zppy.e3sm_diags import e3sm_diags from zppy.global_time_series import global_time_series +from zppy.ilamb_run import ilamb_run from zppy.mpas_analysis import mpas_analysis from zppy.tc_analysis import tc_analysis from zppy.ts import ts @@ -117,6 +118,9 @@ def main(): # global time series tasks global_time_series(config, scriptDir) + # ilamb_run tasks + ilamb_run(config, scriptDir) + def _validate_config(config): validator = Validator() diff --git a/zppy/ilamb_run.py b/zppy/ilamb_run.py new file mode 100644 index 00000000..cfaaf218 --- /dev/null +++ b/zppy/ilamb_run.py @@ -0,0 +1,92 @@ +import os +import pprint + +import jinja2 + +from zppy.utils import checkStatus, getTasks, getYears, submitScript + + +# ----------------------------------------------------------------------------- +def ilamb_run(config, scriptDir): + + # Initialize jinja2 template engine + templateLoader = jinja2.FileSystemLoader( + searchpath=config["default"]["templateDir"] + ) + templateEnv = jinja2.Environment(loader=templateLoader) + template = templateEnv.get_template("ilamb_run.bash") + + # --- List of ilamb_run tasks --- + tasks = getTasks(config, "ilamb_run") + if len(tasks) == 0: + return + + # --- Generate and submit ilamb_run scripts --- + dependencies = [] + + for c in tasks: + + if "ts_num_years" in c.keys(): + c["ts_num_years"] = int(c["ts_num_years"]) + + # Loop over year sets + year_sets = getYears(c["years"]) + for s in year_sets: + c["year1"] = s[0] + c["year2"] = s[1] + c["scriptDir"] = scriptDir + + # List of dependencies + dependencies.append( + os.path.join( + scriptDir, + "ts_%s_%04d-%04d-%04d.status" + % ("land_monthly", c["year1"], c["year2"], c["ts_num_years"]), + ), + ) + if not c["land_only"]: + dependencies.append( + os.path.join( + scriptDir, + "ts_%s_%04d-%04d-%04d.status" + % ( + "atm_monthly_180x360_aave", + c["year1"], + c["year2"], + c["ts_num_years"], + ), + ), + ) + + prefix = "ilamb_run_%04d-%04d" % ( + c["year1"], + c["year2"], + ) + c["prefix"] = prefix + print(prefix) + scriptFile = os.path.join(scriptDir, "%s.bash" % (prefix)) + statusFile = os.path.join(scriptDir, "%s.status" % (prefix)) + settingsFile = os.path.join(scriptDir, "%s.settings" % (prefix)) + skip = checkStatus(statusFile) + if skip: + continue + + # Create script + with open(scriptFile, "w") as f: + f.write(template.render(**c)) + + with open(settingsFile, "w") as sf: + p = pprint.PrettyPrinter(indent=2, stream=sf) + p.pprint(c) + p.pprint(s) + + if not c["dry_run"]: + # Submit job + jobid = submitScript( + scriptFile, dependFiles=dependencies, export="NONE" + ) + + if jobid != -1: + # Update status file + with open(statusFile, "w") as f: + f.write("WAITING %d\n" % (jobid)) diff --git a/zppy/templates/default.ini b/zppy/templates/default.ini index ee9c55cf..41df47f6 100644 --- a/zppy/templates/default.ini +++ b/zppy/templates/default.ini @@ -64,6 +64,9 @@ dpf = integer(default=30) extra_vars = string(default="") # Time-steps per day tpd = integer(default=1) +ts_fmt = string(default="ts_only") +cmip_metadata = string(default="e3sm_to_cmip/default_metadata.json") + [[__many__]] area_nm = string(default=None) @@ -253,3 +256,10 @@ moc_file = string(default="") ts_num_years = integer(default=10) ts_years = string_list(default=list("")) # `years = "1-100",` would plot years 1 to 100 on the graphs. + +[ilamb_run] +qos = string(default="regular") +nodes = integer(default=1) +walltime = string(default="02:00:00") +land_only = boolean(default=False) +cfg = string(default="ilamb_run/cmip.cfg") diff --git a/zppy/templates/e3sm_to_cmip/default_metadata.json b/zppy/templates/e3sm_to_cmip/default_metadata.json new file mode 100644 index 00000000..f6243ce3 --- /dev/null +++ b/zppy/templates/e3sm_to_cmip/default_metadata.json @@ -0,0 +1,107 @@ +{ + "#note_source_type": "explanation of what source_type is goes here", + + "source_type": "AOGCM AER", + + "#note_experiment_id": "CMIP6 valid experiment_ids are found in CMIP6_CV.json", + + "experiment_id": "piControl", + + "activity_id": "CMIP", + + "sub_experiment_id": "none", + + "realization_index": "1", + + "initialization_index": "1", + + "physics_index": "1", + + "forcing_index": "1", + + "#note_run_variant": "Text stored in attribute variant_info (recommended, not required description of run variant)", + + "run_variant": "", + + "parent_experiment_id": "piControl-spinup", + + "parent_activity_id": "CMIP", + + "parent_source_id": "E3SM-1-0", + + "parent_variant_label": "r1i1p1f1", + + "parent_time_units": "days since 0001-01-01", + + "branch_method": "standard", + + "branch_time_in_child": 0.0, + + "branch_time_in_parent": 0.0, + + "#note_institution_id": "institution_id must be registered at https://github.com/WCRP-CMIP/CMIP6_CVs/issues/new ", + + "institution_id": "E3SM-Project", + + "#note_source_id": "source_id (model name) must be registered at https://github.com/WCRP-CMIP/CMIP6_CVs/issues/new ", + + "source_id": "E3SM-1-0", + + "calendar": "noleap", + + "grid": "data regridded to a CMIP6 standard 1x1 degree lonxlat grid from the native grid using an area-average preserving method.", + + "grid_label": "gr", + + "nominal_resolution": "100 km", + + "license": "CMIP6 model data produced by E3SM is licensed under a Creative Commons Attribution ShareAlike 4.0 International License (https://creativecommons.org/licenses). Consult https://pcmdi.llnl.gov/CMIP6/TermsOfUse for terms of use governing CMIP6 output, including citation requirements and proper acknowledgment. Further information about this data, including some limitations, can be found via the further_info_url (recorded as a global attribute in this file) and at https:///pcmdi.llnl.gov/. The data producers and data providers make no warranty, either express or implied, including, but not limited to, warranties of merchantability and fitness for a particular purpose. All liabilities arising from the supply of the information (including any liability arising in negligence) are excluded to the fullest extent permitted by law.", + + "#output": "Root directory for output (can be either a relative or full path)", + + "outpath": "CMIP6", + + "#note_optional": " **** The following descriptors are optional and may be set to an empty string ", + + "project PI": "Dave Bader (bader2@llnl.gov)", + + "data contact": "E3SM-DATA-SUPPORT@LISTSERV.LLNL.GOV", + + "history": "Output from 20180129.DECKv1b_piControl.ne30_oEC.edison. compset = A_WCYCL1850S_CMIP6", + + "comment": "This is the default metadata file, any data should only be used for testing purposes", + + "references": "Golaz, J.-C., P. M. Caldwell, L. P. Van Roekel and co-authors, 2019: The DOE E3SM coupled model version 1: Overview and evaluation at standard resolution. JAMES, doi: 10.1029/2018MS001603; http://e3sm.org'", + + "#note_CV": " **** The following will be obtained from the CV and do not need to be defined here", + + "sub_experiment": "none", + + "institution": "E3SM-Project", + + "source": "E3SM 1.0 (2018)", + + "#note_CMIP6": " **** The following are set correctly for CMIP6 and should not normally need editing", + + "_control_vocabulary_file": "CMIP6_CV.json", + + "_AXIS_ENTRY_FILE": "CMIP6_coordinate.json", + + "_FORMULA_VAR_FILE": "CMIP6_formula_terms.json", + + "_cmip6_option": "CMIP6", + + "mip_era": "CMIP6", + + "parent_mip_era": "CMIP6", + + "tracking_prefix": "hdl:21.14100", + + "_history_template": "%s ;rewrote data to be consistent with for variable found in table .", + + "#output_path_template": "Template for output path directory using tables keys or global attributes, these should follow the relevant data reference syntax", + + "output_path_template": "<_member_id>", + + "output_file_template": "
<_member_id>" +} diff --git a/zppy/templates/ilamb_run.bash b/zppy/templates/ilamb_run.bash new file mode 100644 index 00000000..5aead05f --- /dev/null +++ b/zppy/templates/ilamb_run.bash @@ -0,0 +1,112 @@ +#!/bin/bash +{% include 'slurm_header.sh' %} + +{{ environment_commands }} + +# Turn on debug output if needed +debug={{ debug }} +if [[ "${debug,,}" == "true" ]]; then + set -x +fi + +# Point to obsersvation data +# TODO: need to update these data to other supported machines +export ILAMB_ROOT=/lcrc/group/acme/public_html/diagnostics/ilamb_data + +# Script dir +cd {{ scriptDir }} + +# Get jobid +id=${SLURM_JOBID} + +# Update status file +STARTTIME=$(date +%s) +echo "RUNNING ${id}" > {{ prefix }}.status + +# Basic definitions +case="{{ case }}" +short="{{ short_name }}" +www="{{ www }}" +y1={{ year1 }} +y2={{ year2 }} +Y1="{{ '%04d' % (year1) }}" +Y2="{{ '%04d' % (year2) }}" +scriptDir="{{ scriptDir }}" + +# Create temporary workdir +workdir=`mktemp -d tmp.${id}.XXXX` +workdir=${scriptDir}/${workdir} +model_root=${workdir}/model_data + +if [ $short != "" ]; then + case=${short} +fi + +mkdir -p ${model_root}/${case} +cd ${model_root}/${case} + +# Create output directory +# Create local links to input cmip time-series files +lnd_ts_for_ilamb={{ output }}/post/lnd/180x360_aave/cmip_ts/monthly/ +atm_ts_for_ilamb={{ output }}/post/atm/180x360_aave/cmip_ts/monthly/ +cp -s ${lnd_ts_for_ilamb}/*_*_*_*_*_*_${Y1}??-${Y2}??.nc . +cp -s ${atm_ts_for_ilamb}/*_*_*_*_*_*_${Y1}??-${Y2}??.nc . +cd ../.. + +echo +echo ===== RUN ILAMB ===== +echo + +# Run diagnostics +# Note --export=All is needed to make sure the executable is copied and executed on the nodes. +# TODO: find the mpi run format for different platforms + +# include cfg file +cat > ilamb_run.cfg << EOF +{% include cfg %} +EOF + +echo ${workdir} +echo {{ scriptDir }} + +srun --export=ALL -N 1 ilamb-run --config ilamb_run.cfg --model_root $model_root --regions global --model_year ${Y1} 2000 + +if [ $? != 0 ]; then + cd {{ scriptDir }} + echo 'ERROR (2)' > {{ prefix }}.status + exit 2 +fi + +# Copy output to web server +echo +echo ===== COPY FILES TO WEB SERVER ===== +echo + +# TODO copy _build from $workdir to web server + +## Create top-level directory +#f=${www}/${case}/ilamb/{{ grid }} +#mkdir -p ${f} +#if [ $? != 0 ]; then +# cd {{ scriptDir }} +# echo 'ERROR (3)' > {{ prefix }}.status +# exit 3 +#fi +# +## Delete temporary workdir +#cd ${workdir} +#cd .. +#if [[ "${debug,,}" != "true" ]]; then +# rm -rf ${workdir} +#fi + +# Update status file and exit +{% raw %} +ENDTIME=$(date +%s) +ELAPSEDTIME=$(($ENDTIME - $STARTTIME)) +{% endraw %} +echo ============================================== +echo "Elapsed time: $ELAPSEDTIME seconds" +echo ============================================== +echo 'OK' > {{ prefix }}.status +exit 0 diff --git a/zppy/templates/ilamb_run/cmip.cfg b/zppy/templates/ilamb_run/cmip.cfg new file mode 100644 index 00000000..c50ba0bb --- /dev/null +++ b/zppy/templates/ilamb_run/cmip.cfg @@ -0,0 +1,635 @@ +# This configure file uses observational data which can be obtained by +# running the following command after exporting ILAMB_ROOT to the +# appropriate location. +# +# ilamb-fetch --remote_root https://www.ilamb.org/ILAMB-Data +# +# Extra ilamb-run options are defined here with the '#!' symbols: +# +#! define_regions = DATA/regions/GlobalLand.nc +# +[h1: Ecosystem and Carbon Cycle] +bgcolor = "#ECFFE6" + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Biomass] +variable = "biomass" +alternate_vars = "cVeg" +weight = 5 +skip_rmse = True +mass_weighting = True + +[Tropical] +source = "DATA/biomass/Tropical/biomass_0.5x0.5.nc" +weight = 20 +table_unit = "Pg" +plot_unit = "kg m-2" +space_mean = False + +[GlobalCarbon] +source = "DATA/biomass/GLOBAL.CARBON/biomass_0.5x0.5.nc" +weight = 16 +table_unit = "Pg" +plot_unit = "kg m-2" +space_mean = False + +[NBCD2000] +source = "DATA/biomass/NBCD2000/biomass_0.5x0.5.nc" +weight = 8 +table_unit = "Pg" +plot_unit = "kg m-2" +space_mean = False + +[USForest] +source = "DATA/biomass/US.FOREST/biomass_0.5x0.5.nc" +weight = 8 +table_unit = "Pg" +plot_unit = "kg m-2" +space_mean = False + +[Thurner] +source = "DATA/biomass/Thurner/biomass_0.5x0.5.nc" +weight = 15 +table_unit = "Pg" +plot_unit = "kg m-2" +space_mean = False + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# +#[h2: Burned Area] +#variable = "burntArea" +#alternate_vars = "burntFractionAll" +#weight = 4 +#cmap = "OrRd" +#mass_weighting = True +# +#[GFED4.1S] +#source = "DATA/burntArea/GFED4.1S/burntArea.nc" +#weight = 20 +#relationships = "Precipitation/GPCPv2.3","SurfaceAirTemperature/CRU4.02" +# +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Carbon Dioxide] +variable = "co2" +ctype = "ConfCO2" +weight = 5 + +[NOAA.Emulated] +source = "DATA/co2/NOAA.GMD/co2.nc" +emulated_flux = "nbp" +sites = "alt,asc,azr,bhd,bmw,brw,cba,cgo,chr,crz,gmi,hba,ice,key,kum,mhd,mid,pocs35,pocs30,pocs25,pocs20,pocs15,pocs10,pocs05,poc000,pocn05,pocn10,pocn15,pocn20,pocn25,psa,rpb,sey,shm,smo,spo,syo,zep" +lat_bands = "-90,-60,-23,0,+23,+60,+90" +force_emulation = True + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Gross Primary Productivity] +variable = "gpp" +cmap = "Greens" +weight = 5 +mass_weighting = True + +[FLUXNET2015] +source = "DATA/gpp/FLUXNET2015/gpp.nc" +weight = 9 +table_unit = "g m-2 d-1" +plot_unit = "g m-2 d-1" + +[FLUXCOM] +source = "DATA/gpp/FLUXCOM/gpp.nc" +weight = 15 +table_unit = "Pg yr-1" +plot_unit = "g m-2 d-1" +space_mean = False +skip_iav = True +relationships = "Evapotranspiration/GLEAMv3.3a","Precipitation/GPCPv2.3","SurfaceDownwardSWRadiation/CERESed4.1","SurfaceNetSWRadiation/CERESed4.1","SurfaceAirTemperature/CRU4.02" + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Leaf Area Index] +variable = "lai" +cmap = "Greens" +weight = 3 +mass_weighting = True + +[AVHRR] +source = "DATA/lai/AVHRR/lai_0.5x0.5.nc" +weight = 15 +relationships = "Precipitation/GPCPv2.3" + +[AVH15C1] +source = "DATA/lai/AVH15C1/lai.nc" +weight = 15 +relationships = "Precipitation/GPCPv2.3" + +[MODIS] +source = "DATA/lai/MODIS/lai_0.5x0.5.nc" +weight = 15 +relationships = "Precipitation/GPCPv2.3" +skip_iav = True + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Global Net Ecosystem Carbon Balance] +variable = "nbp" +weight = 5 +ctype = "ConfNBP" + +[GCP] +source = "DATA/nbp/GCP/nbp_1959-2016.nc" +weight = 20 + +[Hoffman] +source = "DATA/nbp/HOFFMAN/nbp_1850-2010.nc" +weight = 20 +skip_taylor = True + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Net Ecosystem Exchange] +variable = "nee" +derived = "ra+rh-gpp" +weight = 5 +mass_weighting = True + +[FLUXNET2015] +source = "DATA/nee/FLUXNET2015/nee.nc" +weight = 9 +table_unit = "g m-2 d-1" +plot_unit = "g m-2 d-1" + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Ecosystem Respiration] +variable = "reco" +derived = "ra+rh" +weight = 4 +mass_weighting = True + +[FLUXNET2015] +source = "DATA/reco/FLUXNET2015/reco.nc" +weight = 6 +table_unit = "g m-2 d-1" +plot_unit = "g m-2 d-1" + +[FLUXCOM] +source = "DATA/reco/FLUXCOM/reco.nc" +weight = 4 +table_unit = "Pg yr-1" +plot_unit = "g m-2 d-1" +space_mean = False +skip_iav = True + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Soil Carbon] +variable = "cSoilAbove1m" +alternate_vars = "cSoil" +weight = 5 +mass_weighting = True + +[HWSD] +source = "DATA/soilc/HWSD/soilc_0.5x0.5.nc" +weight = 15 +table_unit = "Pg" +plot_unit = "kg m-2" +space_mean = False +skip_rmse = True + +[NCSCDV22] +source = "DATA/soilc/NCSCDV22/soilc_0.5x0.5.nc" +weight = 12 +table_unit = "Pg" +plot_unit = "kg m-2" +space_mean = False +skip_rmse = True + +[Koven] +ctype = "ConfSoilCarbon" +source = "DATA/soilc/NCSCDV22/soilc_0.5x0.5.nc" +weight = 15 +soilc_source = "DATA/soilc/NCSCDV22/soilc_0.5x0.5.nc, DATA/soilc/HWSD/soilc_0.5x0.5.nc" +tas_source = "DATA/tas/CRU4.02/tas.nc" +pr_source = "DATA/pr/GPCCv2018/pr.nc" +npp_source = "DATA/soilc/Koven/npp_0.5x0.5.nc" +pet_source = "DATA/soilc/Koven/pet_0.5x0.5.nc" +fracpeat_source = "DATA/soilc/Koven/fracpeat_0.5x0.5.nc" + +########################################################################### + +[h1: Hydrology Cycle] +bgcolor = "#E6F9FF" + +[h2: Evapotranspiration] +variable = "et" +alternate_vars = "evspsbl" +cmap = "Blues" +weight = 5 +mass_weighting = True + +[GLEAMv3.3a] +source = "DATA/et/GLEAMv3.3a/et.nc" +weight = 15 +table_unit = "mm d-1" +plot_unit = "mm d-1" +relationships = "Precipitation/GPCPv2.3","SurfaceAirTemperature/CRU4.02" + +[MODIS] +source = "DATA/et/MODIS/et_0.5x0.5.nc" +weight = 15 +table_unit = "mm d-1" +plot_unit = "mm d-1" +relationships = "Precipitation/GPCPv2.3","SurfaceAirTemperature/CRU4.02" + +[MOD16A2] +source = "DATA/et/MOD16A2/et.nc" +weight = 15 +table_unit = "mm d-1" +plot_unit = "mm d-1" +relationships = "Precipitation/GPCPv2.3","SurfaceAirTemperature/CRU4.02" + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Evaporative Fraction] +variable = "EvapFrac" +weight = 5 +mass_weighting = True +ctype = "ConfEvapFraction" + +[FLUXCOM] +hfss_source = "DATA/sh/FLUXCOM/sh.nc" +hfls_source = "DATA/le/FLUXCOM/le.nc" +weight = 9 +skip_rmse = True + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Latent Heat] +variable = "hfls" +alternate_vars = "le" +cmap = "Oranges" +weight = 5 +mass_weighting = True + +[FLUXNET2015] +source = "DATA/le/FLUXNET2015/hfls.nc" +weight = 3 + +[FLUXCOM] +source = "DATA/le/FLUXCOM/le.nc" +land = True +weight = 9 +skip_iav = True + +[DOLCE] +source = "DATA/et/DOLCE/DOLCE.nc" +weight = 15 +land = True + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Runoff] +variable = "runoff" +alternate_vars = "mrro" +weight = 5 +mass_weighting = True + +[Dai] +ctype = "ConfRunoff" +source = "DATA/runoff/Dai/runoff.nc" +weight = 15 + +[LORA] +source = "DATA/runoff/LORA/LORA.nc" +table_unit = "mm d-1" +plot_unit = "mm d-1" +weight = 15 + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Sensible Heat] +variable = "hfss" +alternate_vars = "sh" +weight = 2 +mass_weighting = True + +[FLUXNET2015] +source = "DATA/sh/FLUXNET2015/hfss.nc" +weight = 9 + +[FLUXCOM] +source = "DATA/sh/FLUXCOM/sh.nc" +weight = 15 +skip_iav = True + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Terrestrial Water Storage Anomaly] +variable = "twsa" +alternate_vars = "tws" +derived = "pr-evspsbl-mrro" +cmap = "Blues" +weight = 5 +ctype = "ConfTWSA" + +[GRACE] +source = "DATA/twsa/GRACE/twsa_0.5x0.5.nc" +weight = 25 + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Permafrost] +variable = "tsl" + +[NSIDC] +ctype = "ConfPermafrost" +source = "DATA/permafrost/NSIDC/NSIDC_0.5x0.5.nc" +y0 = 1970. +yf = 2000. +Teps = 273.15 +dmax = 3.5 + +########################################################################### + +[h1: Radiation and Energy Cycle] +bgcolor = "#FFECE6" + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Albedo] +variable = "albedo" +weight = 1 +ctype = "ConfAlbedo" + +[CERESed4.1] +source = "DATA/albedo/CERESed4.1/albedo.nc" +weight = 20 + +[GEWEX.SRB] +source = "DATA/albedo/GEWEX.SRB/albedo_0.5x0.5.nc" +weight = 20 + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Surface Upward SW Radiation] +variable = "rsus" +weight = 1 + +[CERESed4.1] +source = "DATA/rsus/CERESed4.1/rsus.nc" +weight = 15 + +[FLUXNET2015] +source = "DATA/rsus/FLUXNET2015/rsus.nc" +weight = 12 + +[GEWEX.SRB] +source = "DATA/rsus/GEWEX.SRB/rsus_0.5x0.5.nc" +weight = 15 + +[WRMC.BSRN] +source = "DATA/rsus/WRMC.BSRN/rsus.nc" +weight = 12 + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Surface Net SW Radiation] +variable = "rsns" +derived = "rsds-rsus" +weight = 1 + +[CERESed4.1] +source = "DATA/rsns/CERESed4.1/rsns.nc" +weight = 15 + +[FLUXNET2015] +source = "DATA/rsns/FLUXNET2015/rsns.nc" +weight = 12 + +[GEWEX.SRB] +source = "DATA/rsns/GEWEX.SRB/rsns_0.5x0.5.nc" +weight = 15 + +[WRMC.BSRN] +source = "DATA/rsns/WRMC.BSRN/rsns.nc" +weight = 12 + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Surface Upward LW Radiation] +variable = "rlus" +weight = 1 + +[CERESed4.1] +source = "DATA/rlus/CERESed4.1/rlus.nc" +weight = 15 + +[FLUXNET2015] +source = "DATA/rlus/FLUXNET2015/rlus.nc" +weight = 12 + +[GEWEX.SRB] +source = "DATA/rlus/GEWEX.SRB/rlus_0.5x0.5.nc" +weight = 15 + +[WRMC.BSRN] +source = "DATA/rlus/WRMC.BSRN/rlus.nc" +weight = 12 + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Surface Net LW Radiation] +variable = "rlns" +derived = "rlds-rlus" +weight = 1 + +[CERESed4.1] +source = "DATA/rlns/CERESed4.1/rlns.nc" +weight = 15 + +[FLUXNET2015] +source = "DATA/rlns/FLUXNET2015/rlns.nc" +weight = 12 + +[GEWEX.SRB] +source = "DATA/rlns/GEWEX.SRB/rlns_0.5x0.5.nc" +weight = 15 + +[WRMC.BSRN] +source = "DATA/rlns/WRMC.BSRN/rlns.nc" +weight = 12 + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Surface Net Radiation] +variable = "rns" +derived = "rlds-rlus+rsds-rsus" +weight = 2 + +[CERESed4.1] +source = "DATA/rns/CERESed4.1/rns.nc" +weight = 15 + +[FLUXNET2015] +source = "DATA/rns/FLUXNET2015/rns.nc" +weight = 12 + +[GEWEX.SRB] +source = "DATA/rns/GEWEX.SRB/rns_0.5x0.5.nc" +weight = 15 + +[WRMC.BSRN] +source = "DATA/rns/WRMC.BSRN/rns.nc" +weight = 12 + +########################################################################### + +[h1: Forcings] +bgcolor = "#EDEDED" + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Surface Air Temperature] +variable = "tas" +weight = 2 + +[CRU4.02] +source = "DATA/tas/CRU4.02/tas.nc" +weight = 25 + +[FLUXNET2015] +source = "DATA/tas/FLUXNET2015/tas.nc" +weight = 9 + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Diurnal Max Temperature] +variable = "tasmax" +weight = 2 + +[CRU4.02] +source = "DATA/tasmax/CRU4.02/tasmax.nc" +weight = 25 + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Diurnal Min Temperature] +variable = "tasmin" +weight = 2 + +[CRU4.02] +source = "DATA/tasmin/CRU4.02/tasmin.nc" +weight = 25 + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Diurnal Temperature Range] +variable = "dtr" +weight = 2 +derived = "tasmax-tasmin" + +[CRU4.02] +source = "DATA/dtr/CRU4.02/dtr.nc" +weight = 25 + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Precipitation] +variable = "pr" +cmap = "Blues" +weight = 2 +mass_weighting = True + +[CMAPv1904] +source = "DATA/pr/CMAPv1904/pr.nc" +land = True +weight = 20 +table_unit = "mm d-1" +plot_unit = "mm d-1" +space_mean = True + +[FLUXNET2015] +source = "DATA/pr/FLUXNET2015/pr.nc" +land = True +weight = 9 +table_unit = "mm d-1" +plot_unit = "mm d-1" + +[GPCCv2018] +source = "DATA/pr/GPCCv2018/pr.nc" +land = True +weight = 20 +table_unit = "mm d-1" +plot_unit = "mm d-1" +space_mean = True + +[GPCPv2.3] +source = "DATA/pr/GPCPv2.3/pr.nc" +land = True +weight = 20 +table_unit = "mm d-1" +plot_unit = "mm d-1" +space_mean = True + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Surface Relative Humidity] +variable = "rhums" +alternate_vars = "hurs" +cmap = "Blues" +weight = 3 +mass_weighting = True + +[ERA5] +source = "DATA/rhums/ERA5/rhums.nc" +weight = 10 + +[CRU4.02] +source = "DATA/rhums/CRU4.02/rhums.nc" +weight = 10 + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Surface Downward SW Radiation] +variable = "rsds" +weight = 2 + +[CERESed4.1] +source = "DATA/rsds/CERESed4.1/rsds.nc" +weight = 15 + +[FLUXNET2015] +source = "DATA/rsds/FLUXNET2015/rsds.nc" +weight = 12 + +[GEWEX.SRB] +source = "DATA/rsds/GEWEX.SRB/rsds_0.5x0.5.nc" +weight = 15 + +[WRMC.BSRN] +source = "DATA/rsds/WRMC.BSRN/rsds.nc" +weight = 12 + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Surface Downward LW Radiation] +variable = "rlds" +weight = 1 + +[CERESed4.1] +source = "DATA/rlds/CERESed4.1/rlds.nc" +weight = 15 + +[FLUXNET2015] +source = "DATA/rlds/FLUXNET2015/rlds.nc" +weight = 12 + +[GEWEX.SRB] +source = "DATA/rlds/GEWEX.SRB/rlds_0.5x0.5.nc" +weight = 15 + +[WRMC.BSRN] +source = "DATA/rlds/WRMC.BSRN/rlds.nc" +weight = 12 diff --git a/zppy/templates/ilamb_run/ilamb.cfg b/zppy/templates/ilamb_run/ilamb.cfg new file mode 100644 index 00000000..770240b0 --- /dev/null +++ b/zppy/templates/ilamb_run/ilamb.cfg @@ -0,0 +1,567 @@ +# This configure file uses observational data which can be obtained by +# running the following command after exporting ILAMB_ROOT to the +# appropriate location. +# +# ilamb-fetch --remote_root https://www.ilamb.org/ILAMB-Data +# +[h1: Ecosystem and Carbon Cycle] +bgcolor = "#ECFFE6" + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Biomass] +variable = "biomass" +alternate_vars = "cVeg" +weight = 5 +skip_rmse = True +mass_weighting = True + +[GEOCARBON] +source = "DATA/biomass/GEOCARBON/biomass_0.5x0.5.nc" +weight = 20 +table_unit = "Pg" +plot_unit = "kg m-2" +space_mean = False + +[Tropical] +source = "DATA/biomass/Tropical/biomass_0.5x0.5.nc" +weight = 20 +table_unit = "Pg" +plot_unit = "kg m-2" +space_mean = False + +[GlobalCarbon] +source = "DATA/biomass/GLOBAL.CARBON/biomass_0.5x0.5.nc" +weight = 16 +table_unit = "Pg" +plot_unit = "kg m-2" +space_mean = False + +[NBCD2000] +source = "DATA/biomass/NBCD2000/biomass_0.5x0.5.nc" +weight = 8 +table_unit = "Pg" +plot_unit = "kg m-2" +space_mean = False + +[USForest] +source = "DATA/biomass/US.FOREST/biomass_0.5x0.5.nc" +weight = 8 +table_unit = "Pg" +plot_unit = "kg m-2" +space_mean = False + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Burned Area] +variable = "burntArea" +weight = 4 +cmap = "OrRd" +mass_weighting = True + +[GFED4S] +source = "DATA/burntArea/GFED4S/burntArea_0.5x0.5.nc" +weight = 20 +relationships = "Precipitation/GPCP2","SurfaceAirTemperature/CRU" + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Carbon Dioxide] +variable = "co2" +ctype = "ConfCO2" +weight = 5 + +[NOAA] +source = "DATA/co2/NOAA.GMD/co2.nc" +emulated_flux = "nbp" +sites = "alt,asc,azr,bhd,bmw,brw,cba,cgo,chr,crz,gmi,hba,ice,key,kum,mhd,mid,pocs35,pocs30,pocs25,pocs20,pocs15,pocs10,pocs05,poc000,pocn05,pocn10,pocn15,pocn20,pocn25,psa,rpb,sey,shm,smo,spo,syo,zep" +lat_bands = "-90,-60,-23,0,+23,+60,+90" + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Gross Primary Productivity] +variable = "gpp" +cmap = "Greens" +weight = 5 +mass_weighting = True + +[Fluxnet] +source = "DATA/gpp/FLUXNET/gpp.nc" +weight = 9 +table_unit = "g m-2 d-1" +plot_unit = "g m-2 d-1" + +[GBAF] +source = "DATA/gpp/GBAF/gpp_0.5x0.5.nc" +weight = 15 +table_unit = "Pg yr-1" +plot_unit = "g m-2 d-1" +space_mean = False +skip_iav = True +relationships = "Evapotranspiration/GLEAM","Precipitation/GPCP2","SurfaceDownwardSWRadiation/CERES","SurfaceNetSWRadiation/CERES","SurfaceAirTemperature/CRU" + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Leaf Area Index] +variable = "lai" +cmap = "Greens" +weight = 3 +mass_weighting = True + +[AVHRR] +source = "DATA/lai/AVHRR/lai_0.5x0.5.nc" +weight = 15 +relationships = "Precipitation/GPCP2" + +[MODIS] +source = "DATA/lai/MODIS/lai_0.5x0.5.nc" +weight = 15 +relationships = "Precipitation/GPCP2" +skip_iav = True + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Global Net Ecosystem Carbon Balance] +variable = "nbp" +weight = 5 +ctype = "ConfNBP" + +[GCP] +source = "DATA/nbp/GCP/nbp_1959-2012.nc" +weight = 20 + +[Hoffman] +source = "DATA/nbp/HOFFMAN/nbp_1850-2010.nc" +weight = 20 +skip_taylor = True + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Net Ecosystem Exchange] +variable = "nee" +derived = "gpp-ra-rh" +weight = 5 +mass_weighting = True + +[Fluxnet] +source = "DATA/nee/FLUXNET/nee.nc" +weight = 9 +table_unit = "g m-2 d-1" +plot_unit = "g m-2 d-1" + +[GBAF] +source = "DATA/nee/GBAF/nee_0.5x0.5.nc" +weight = 4 +table_unit = "Pg yr-1" +plot_unit = "g m-2 d-1" +space_mean = False +skip_iav = True + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Ecosystem Respiration] +variable = "reco" +derived = "ra+rh" +weight = 4 +mass_weighting = True + +[Fluxnet] +source = "DATA/reco/FLUXNET/reco.nc" +weight = 6 +table_unit = "g m-2 d-1" +plot_unit = "g m-2 d-1" + +[GBAF] +source = "DATA/reco/GBAF/reco_0.5x0.5.nc" +weight = 4 +table_unit = "Pg yr-1" +plot_unit = "g m-2 d-1" +space_mean = False +skip_iav = True + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Soil Carbon] +variable = "cSoil" +alternate_vars = "soilc" +weight = 5 +mass_weighting = True + +[HWSD] +source = "DATA/soilc/HWSD/soilc_0.5x0.5.nc" +weight = 15 +table_unit = "Pg" +plot_unit = "kg m-2" +space_mean = False +skip_rmse = True + +[NCSCDV22] +source = "DATA/soilc/NCSCDV22/soilc_0.5x0.5.nc" +weight = 12 +table_unit = "Pg" +plot_unit = "kg m-2" +space_mean = False +skip_rmse = True + +########################################################################### + +[h1: Hydrology Cycle] +bgcolor = "#E6F9FF" + +[h2: Evapotranspiration] +variable = "et" +alternate_vars = "evspsbl" +cmap = "Blues" +weight = 5 +mass_weighting = True + +[GLEAM] +source = "DATA/et/GLEAM/et_0.5x0.5.nc" +weight = 15 +table_unit = "mm d-1" +plot_unit = "mm d-1" +relationships = "Precipitation/GPCP2","SurfaceAirTemperature/CRU" + +[MODIS] +source = "DATA/et/MODIS/et_0.5x0.5.nc" +weight = 15 +table_unit = "mm d-1" +plot_unit = "mm d-1" +relationships = "Precipitation/GPCP2","SurfaceAirTemperature/CRU" + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Evaporative Fraction] +variable = "EvapFrac" +weight = 5 +mass_weighting = True +ctype = "ConfEvapFraction" + +[GBAF] +source = "DATA/EvapFrac/GBAF/EvapFrac_0.5x0.5.nc" +weight = 9 +skip_rmse = True +skip_iav = True +limit_type = "99per" + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Latent Heat] +variable = "hfls" +alternate_vars = "le" +cmap = "Oranges" +weight = 5 +mass_weighting = True + +[Fluxnet] +source = "DATA/le/FLUXNET/le.nc" +weight = 3 + +[GBAF] +source = "DATA/le/GBAF/le_0.5x0.5.nc" +land = True +weight = 9 +skip_iav = True + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Runoff] +variable = "runoff" +alternate_vars = "mrro" +weight = 5 + +[Dai] +ctype = "ConfRunoff" +source = "DATA/runoff/Dai/runoff.nc" +weight = 15 + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Sensible Heat] +variable = "hfss" +alternate_vars = "sh" +weight = 2 +mass_weighting = True + +[Fluxnet] +source = "DATA/sh/FLUXNET/sh.nc" +weight = 9 + +[GBAF] +source = "DATA/sh/GBAF/sh_0.5x0.5.nc" +weight = 15 +skip_iav = True + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Terrestrial Water Storage Anomaly] +variable = "twsa" +alternate_vars = "tws" +derived = "pr-evspsbl-mrro" +cmap = "Blues" +weight = 5 +ctype = "ConfTWSA" + +[GRACE] +source = "DATA/twsa/GRACE/twsa_0.5x0.5.nc" +weight = 25 + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Snow Water Equivalent] +variable = "swe" +alternate_vars = "snw" +cmap = "Blues" +weight = 5 +ctype = "ConfSWE" + +[CanSISE] +source = "DATA/swe/CanSISE/swe.nc" +weight = 25 +plot_unit = "cm" +table_unit = "cm" + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Permafrost] +variable = "tsl" + +[NSIDC] +ctype = "ConfPermafrost" +source = "DATA/permafrost/NSIDC/NSIDC_0.5x0.5.nc" +y0 = 1970. +yf = 2000. +Teps = 273.15 +dmax = 3.5 + +########################################################################### + +[h1: Radiation and Energy Cycle] +bgcolor = "#FFECE6" + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Albedo] +variable = "albedo" +weight = 1 +ctype = "ConfAlbedo" + +[CERES] +source = "DATA/albedo/CERES/albedo_0.5x0.5.nc" +weight = 20 + +[GEWEX.SRB] +source = "DATA/albedo/GEWEX.SRB/albedo_0.5x0.5.nc" +weight = 20 + +#[MODIS] +#source = "DATA/albedo/MODIS/albedo_0.5x0.5.nc" +#weight = 20 + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Surface Upward SW Radiation] +variable = "rsus" +weight = 1 + +[CERES] +source = "DATA/rsus/CERES/rsus_0.5x0.5.nc" +weight = 15 + +[GEWEX.SRB] +source = "DATA/rsus/GEWEX.SRB/rsus_0.5x0.5.nc" +weight = 15 + +[WRMC.BSRN] +source = "DATA/rsus/WRMC.BSRN/rsus.nc" +weight = 12 + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Surface Net SW Radiation] +variable = "rsns" +derived = "rsds-rsus" +weight = 1 + +[CERES] +source = "DATA/rsns/CERES/rsns_0.5x0.5.nc" +weight = 15 + +[GEWEX.SRB] +source = "DATA/rsns/GEWEX.SRB/rsns_0.5x0.5.nc" +weight = 15 + +[WRMC.BSRN] +source = "DATA/rsns/WRMC.BSRN/rsns.nc" +weight = 12 + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Surface Upward LW Radiation] +variable = "rlus" +weight = 1 + +[CERES] +source = "DATA/rlus/CERES/rlus_0.5x0.5.nc" +weight = 15 + +[GEWEX.SRB] +source = "DATA/rlus/GEWEX.SRB/rlus_0.5x0.5.nc" +weight = 15 + +[WRMC.BSRN] +source = "DATA/rlus/WRMC.BSRN/rlus.nc" +weight = 12 + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Surface Net LW Radiation] +variable = "rlns" +derived = "rlds-rlus" +weight = 1 + +[CERES] +source = "DATA/rlns/CERES/rlns_0.5x0.5.nc" +weight = 15 + +[GEWEX.SRB] +source = "DATA/rlns/GEWEX.SRB/rlns_0.5x0.5.nc" +weight = 15 + +[WRMC.BSRN] +source = "DATA/rlns/WRMC.BSRN/rlns.nc" +weight = 12 + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Surface Net Radiation] +variable = "rns" +derived = "rlds-rlus+rsds-rsus" +weight = 2 + +[CERES] +source = "DATA/rns/CERES/rns_0.5x0.5.nc" +weight = 15 + +[Fluxnet] +source = "DATA/rns/FLUXNET/rns.nc" +weight = 12 + +[GEWEX.SRB] +source = "DATA/rns/GEWEX.SRB/rns_0.5x0.5.nc" +weight = 15 + +[WRMC.BSRN] +source = "DATA/rns/WRMC.BSRN/rns.nc" +weight = 12 + +########################################################################### + +[h1: Forcings] +bgcolor = "#EDEDED" + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Surface Air Temperature] +variable = "tas" +weight = 2 + +[CRU] +source = "DATA/tas/CRU/tas_0.5x0.5.nc" +weight = 25 + +[Fluxnet] +source = "DATA/tas/FLUXNET/tas.nc" +weight = 9 + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Precipitation] +variable = "pr" +cmap = "Blues" +weight = 2 +mass_weighting = True + +[CMAP] +source = "DATA/pr/CMAP/pr_0.5x0.5.nc" +land = True +weight = 20 +table_unit = "mm d-1" +plot_unit = "mm d-1" +space_mean = True + +[Fluxnet] +source = "DATA/pr/FLUXNET/pr.nc" +land = True +weight = 9 +table_unit = "mm d-1" +plot_unit = "mm d-1" + +[GPCC] +source = "DATA/pr/GPCC/pr_0.5x0.5.nc" +land = True +weight = 20 +table_unit = "mm d-1" +plot_unit = "mm d-1" +space_mean = True + +[GPCP2] +source = "DATA/pr/GPCP2/pr_0.5x0.5.nc" +land = True +weight = 20 +table_unit = "mm d-1" +plot_unit = "mm d-1" +space_mean = True + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Surface Relative Humidity] +variable = "rhums" +alternate_vars = "hurs" +cmap = "Blues" +weight = 3 +mass_weighting = True + +[ERA] +source = "DATA/rhums/ERA/rhums_0.5x0.5.nc" +weight = 10 + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Surface Downward SW Radiation] +variable = "rsds" +weight = 2 + +[CERES] +source = "DATA/rsds/CERES/rsds_0.5x0.5.nc" +weight = 15 + +[Fluxnet] +source = "DATA/rsds/FLUXNET/rsds.nc" +weight = 12 + +[GEWEX.SRB] +source = "DATA/rsds/GEWEX.SRB/rsds_0.5x0.5.nc" +weight = 15 + +[WRMC.BSRN] +source = "DATA/rsds/WRMC.BSRN/rsds.nc" +weight = 12 + +#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +[h2: Surface Downward LW Radiation] +variable = "rlds" +weight = 1 + +[CERES] +source = "DATA/rlds/CERES/rlds_0.5x0.5.nc" +weight = 15 + +[GEWEX.SRB] +source = "DATA/rlds/GEWEX.SRB/rlds_0.5x0.5.nc" +weight = 15 + +[WRMC.BSRN] +source = "DATA/rlds/WRMC.BSRN/rlds.nc" +weight = 12 diff --git a/zppy/templates/ts.bash b/zppy/templates/ts.bash index 989b6e35..e4d293d5 100644 --- a/zppy/templates/ts.bash +++ b/zppy/templates/ts.bash @@ -33,6 +33,9 @@ do done done +ts_fmt={{ ts_fmt }} +echo $ts_fmt + {%- if frequency != 'monthly' %} # For non-monthly input files, need to add the last file of the previous year year={{ yr_start - 1 }} @@ -86,7 +89,7 @@ cat input.txt | ncclimo \ {%- endif %} {%- if input_files.split(".")[0] == 'cam' or input_files.split(".")[0] == 'eam'%} --prc_typ={{ input_files.split(".")[0] }} -{%- else -%} +{%- else %} --prc_typ=sgs {%- endif %} @@ -110,6 +113,54 @@ if [ $? != 0 ]; then exit 2 fi +# Generate CMIP ts +cat > default_metadata.json << EOF +{% include cmip_metadata %} +EOF +{ + if [ "$ts_fmt" != "ts_only" ]; then + + export cmortables_dir=/lcrc/group/acme/public_html/diagnostics/cmip6-cmor-tables/Tables + input_dir={{ output }}/post/{{ component }}/{{ grid }}/ts/{{ frequency }}/{{ '%dyr' % (ypf) }} + dest_cmip={{ output }}/post/{{ component }}/{{ grid }}/cmip_ts/{{ frequency }} + mkdir -p ${dest_cmip} + e3sm_to_cmip \ + --output-path \ + ${dest_cmip}/tmp \ + {% if input_files == 'elm.h0' -%} + --var-list \ + 'mrsos, mrso, mrfso, mrros, mrro, prveg, evspsblveg, evspsblsoi, tran, tsl, lai, cLitter, cProduct, cSoilFast,cSoilMedium,cSoilSlow fFire, fHarvest, cVeg, nbp, gpp, ra, rh' \ + --realm \ + lnd \ + {% endif -%} + {% if input_files == 'eam.h0' -%} + --var-list \ + 'pr, tas, rsds, rlds, rsus' \ + --realm \ + atm \ + {% endif -%} + --input-path \ + ${input_dir}\ + --user-metadata \ + {{ scriptDir }}/${workdir}/default_metadata.json \ + --num-proc \ + 12 \ + --tables-path \ + ${cmortables_dir} + + + # Move output ts files to final destination + mv ${dest_cmip}/tmp/CMIP6/CMIP/*/*/*/*/*/*/*/*/*.nc ${dest_cmip} + rm -r ${dest_cmip}/tmp + + fi +} +if [ $? != 0 ]; then + cd {{ scriptDir }} + echo 'ERROR (3)' > {{ prefix }}.status + exit 3 +fi + # Delete temporary workdir cd .. if [[ "${debug,,}" != "true" ]]; then