Global OCpetro Oxidation: data, code and environments
收藏Mendeley Data2024-05-17 更新2024-06-28 收录
下载链接:
https://zenodo.org/records/8144244
下载链接
链接失效反馈官方服务:
资源简介:
A repository of data files, code and python/R environments for the manuscript "Rock organic carbon oxidation CO2 release offsets silicate weathering sink" by Jesse R. Zondervan, Robert G. Hilton, Mathieu Dellinger, Fiona J. Clubb, Tobias Roylands, Mateja Ogrič. This repository contains an Excel file and several zip files. Zip files containing code, data and python environment to run a simulation of the Global OCpetro Oxidation model: River rhenium (Re) and OCpetro oxidation data: Supplementary Tables.xlsx Code only: Global_OCpetro_Oxidation-v1.1.0.zip (uploaded Github repository) Geospatial data files only: input_global_(data files only).zip Python environment only: ocpetro_oxidation_env.zip Code, data and environment: ocpetro_oxidation_code_data_env.zip Outputs of the model presented in the manuscript: Geospatial raster files of Fig 1: Re sample locations shapefile (panel A): Re_sample_locations.zip Re sample catchment shapefile (panel A): Re_sample_catchments.zip Median OCpetro stocks model (panel B): Output_OCpetro_stock_median.zip Median denudation model (panel C): Output_denudation_median.zip Best-fit OCpetro oxidation extrapolation (panel D): Output_OC_petro_oxidation.zip Denudation and OCpetro stock subroutines (for transparency only, not needed to run OCpetro oxidation simulation): Code, data and R environment (python environment from ocpetro_oxidation_env.zip, see above): Submodels_code_data_Renv.zip The easiest way to run the code is by downloading the zip file containing code, data and environment, and then unpacking using packages provided by the OS, or by running the 'anaconda-project unarchive' command. Instructions for this can be found by searching for anaconda-project online, or directly via https://anaconda-project.readthedocs.io/en/latest/user-guide/tasks/create-project-archive.html?highlight=unarchive#extracting-the-archive-file [last accessed 26/01/2023] The code was developed in a python environment detailed in anaconda-project.yml, with every recursive dependency down to the individual build in anaconda-project-locked.yml. The code file is "Glob_newmethod_parr_globalresidual.py" in this repository. This code should be reproducible indefinitely, without depending on online package repositories. Both the commands and the environment have been captured into a fully locked anaconda project with all conda packages unpacked and included using anaconda-project --pack-envs. Note that only packages for running the code on Linux can be unpacked in this way; building on other platforms (Windows, Mac) will still require access to repositories. Notes: This code was run on an HPC environment with a job submitter called SLURM. As such, the code will run according to a slurm job array with numbers from 1-100 (10,000 monte carlo simulations). The command to run the Monte Carlo simulation as 10,000 seperate jobs is done like this: "sbatch --array=1-10000:1 job_script_file_name.sh". Note that the version of code uploaded here is set to run 100 simulations ("sbatch --array=1-100:1 job_script_file_name.sh"). When running 10,000 simulations, please change line 46 to "quantile = float(os.getenv('SLURM_ARRAY_TASK_ID'))/10000." Whilst it is possible to run this code on a single machine such as a personal computer, the user is warned that it takes 24 core hours per simulation to run. For example, a typical 4-core laptop would need 6 hours to run one simulation. Now calculate how many 10,000 would take... To run one simulation, line 46 ("quantile = float(os.getenv('SLURM_ARRAY_TASK_ID'))/100.") can be replaced with ("quantile = float(number between 0 and 1)"). Outputs will be saved for each simulation, which can rack up a lot of space, unless you specifically put in lines to delete these from the disk, or, in the case of the example job script for HPC usage, exclude the files when moving data from the node that ran the job. Example: sbatch --array=1-100:1 run_Glob_OCpetro_model.sh #note that this runs 100 simulations. An example of a job script file has been appended. Please note that the details of this job script depend on your machine or HPC system. Please consult your HPC support or platform's (Linux, Mac, Windows) command prompt instructions.
本数据集仓库对应Jesse R. Zondervan、Robert G. Hilton、Mathieu Dellinger、Fiona J. Clubb、Tobias Roylands、Mateja Ogrič合著的论文《岩石有机碳氧化释放的CO₂抵消硅酸盐风化汇》,内含数据文件、代码以及Python/R运行环境。
本仓库包含1个Excel文件与多个压缩包。用于运行全球石油类有机碳(OCpetro)氧化模型模拟的代码、数据及Python环境打包在以下压缩包中:《河流铼(Re)与石油类有机碳氧化数据:补充表》.xlsx
仅含代码:Global_OCpetro_Oxidation-v1.1.0.zip(已上传至GitHub仓库)
仅含地理空间数据文件:input_global_(仅数据文件).zip
仅含Python运行环境:ocpetro_oxidation_env.zip
包含代码、数据与运行环境:ocpetro_oxidation_code_data_env.zip
本文手稿中提及的模型输出如下:图1的地理空间栅格文件:
- 铼采样点位矢量形状文件(shapefile,图A):Re_sample_locations.zip
- 铼采样流域矢量形状文件(shapefile,图A):Re_sample_catchments.zip
- 石油类有机碳储量中位数模型(图B):Output_OCpetro_stock_median.zip
- 剥蚀速率中位数模型(图C):Output_denudation_median.zip
- 最优拟合石油类有机碳氧化外推结果(图D):Output_OC_petro_oxidation.zip
剥蚀速率与石油类有机碳储量子程序(仅用于开源透明化,无需用于石油类有机碳氧化模拟运行):包含代码、数据与R环境(Python环境同前述ocpetro_oxidation_env.zip)的压缩包:Submodels_code_data_Renv.zip
运行本代码的最简方式为:下载包含代码、数据与运行环境的压缩包,随后通过操作系统自带解压工具解压,或执行`anaconda-project unarchive`命令完成解压。相关操作指南可通过搜索anaconda-project在线文档获取,或直接访问以下链接:https://anaconda-project.readthedocs.io/en/latest/user-guide/tasks/create-project-archive.html?highlight=unarchive#extracting-the-archive-file [最后访问时间:2023年1月26日]
本代码基于anaconda-project.yml中定义的Python环境开发,所有递归依赖乃至具体构建版本均在anaconda-project-locked.yml中完成锁定。本仓库中的代码文件为`Glob_newmethod_parr_globalresidual.py`,该代码可永久复现,无需依赖在线软件包仓库。本项目通过`anaconda-project --pack-envs`命令将所有运行命令与运行环境完整打包,包含所有已解压的Conda软件包。需注意:仅Linux平台的运行软件包可通过此方式打包完成;若需在Windows、Mac等其他平台构建代码,仍需访问在线软件包仓库。
注意事项:本代码在搭载SLURM作业调度器的高性能计算(HPC)环境中运行。因此,代码将通过编号为1-100的SLURM作业数组运行(对应10000次蒙特卡洛模拟)。若需以10000个独立作业运行蒙特卡洛模拟,可执行如下命令:`sbatch --array=1-10000:1 job_script_file_name.sh`。需注意:本仓库上传的代码版本默认运行100次模拟(命令为`sbatch --array=1-100:1 job_script_file_name.sh`)。当需运行10000次模拟时,请将第46行代码修改为`quantile = float(os.getenv('SLURM_ARRAY_TASK_ID'))/10000.`
尽管本代码可在个人电脑等单机环境中运行,但需提醒用户:单次模拟需消耗24核时。例如,一台典型的4核笔记本电脑运行单次模拟需耗时6小时,由此可推算10000次模拟所需的总时长。
若仅需运行单次模拟,可将第46行代码(`quantile = float(os.getenv('SLURM_ARRAY_TASK_ID'))/100.`)替换为`quantile = float(0至1之间的任意数值)`。每次模拟的结果均会单独保存,若未配置磁盘自动删除逻辑,大量模拟结果将占用可观的存储空间;若使用高性能计算的示例作业脚本,可在从计算节点传输数据时排除这些结果文件。
运行示例:`sbatch --array=1-100:1 run_Glob_OCpetro_model.sh`,该命令将运行100次模拟。本仓库已附带作业脚本文件示例。需注意:作业脚本的具体参数需根据您的单机环境或高性能计算系统进行调整,请咨询您的高性能计算支持人员,或查阅对应平台(Linux、Mac、Windows)的命令行操作指南。
创建时间:
2023-07-26



