Large Language Models for Atmospheric Science: A Practical Guide to Cross-Disciplinary Workflows

    This article explains how large language models (LLMs) can support atmospheric science research by reducing trial-and-error in data discovery, scripting, literature review, and plotting. It covers capability boundaries and task-based model selection, a five-part prompt structure, a minimal Python stack, literature-to-peer-review assistance, data acquisition and preprocessing automation, visualization and diagnostics, typical application scenarios, and a three-stage review mechanism for quality control and reproducibility. All model outputs require physical consistency checks, including units, time coordinates, and missing-value conventions.

    1. Why Atmospheric Science Needs “LLMs +”

    Atmospheric science research is inherently complex in three ways: heterogeneous data sources (station observations, satellite retrievals, reanalysis, numerical forecasts), wide spatiotemporal scales (from minute-scale convection to interannual variability), and long method chains (quality control, statistical diagnosis, visualization, and physical attribution). Under traditional workflows, researchers spend much of their time on low-creativity tasks such as finding data, writing download scripts, reading literature, and tuning plotting parameters.

    The value of LLMs is not to replace physical reasoning but to reduce the trial-and-error cost of these tasks: turning natural-language requirements into executable code skeletons, compressing long documents into structured key points, and translating scattered error messages into interpretable troubleshooting paths. Model outputs must be validated by researchers for physical consistency, especially dimensions, units, time coordinates, and missing-value conventions.

    2. Understanding Capability Boundaries: General Models vs. Scenario-Based Selection

    Different models vary in long-context handling, reasoning depth, multimodal recognition, and local deployment. A task-based approach is recommended:

    • Long-document review and formula understanding: prioritize long-context capability;
    • Code generation and debugging: prioritize reasoning and stable structured output;
    • Image/chart recognition: prioritize multimodal capability;
    • Data-sensitive scenarios: prioritize private deployment or local inference.

    For cloud-based calls, general-purpose service categories are usually sufficient, such as object storage for archiving materials, message queues for task decoupling, container platforms for hosting inference services, and logging plus monitoring alerts for tracing call chains. There is no need to bind to any proprietary interface.

    3. Prompt Engineering: Translating Research Intent into Machine-Executable Constraints

    Prompt quality determines output usability. A five-part structure is recommended: role + goal + input + constraints + output format.

    1. Role: You are an atmospheric science data processing engineer
    2. Goal: Mark missing values and impute a daily station precipitation series
    3. Input: DataFrame columns [station_id, date, prcp]
    4. Constraints: Missing-value threshold > -9999; impute using linear interpolation only, for no more than 3 consecutive days
    5. Output: A directly runnable Python function + explanation of key steps

    Common templates can be standardized: literature extraction, code generation, peer-review comments, and chart specifications. The key is to explicitly state units, coordinate reference, time baseline, and outlier rules to prevent the model from improvising.

    4. A Minimal Python Stack

    Keep dependencies lean in research settings: basic syntax and file path management, a numerical computing library, a tabular data library, a multidimensional array library (suitable for NetCDF/GRIB-like data), and a plotting library. Example:

    1. import xarray as xr
    2. ds = xr.open_dataset("era5_tmp.nc")
    3. t2m = ds["t2m"] - 273.15 # Unit conversion must be explicitly validated

    5. Research Assistance: A Closed Loop from Retrieval to Peer Review

    1. Literature and materials: structurally extract study area, period, data sources, methods, conclusions, and limitations;
    2. Writing support: draft abstracts, polish language, and standardize terminology;
    3. Code understanding: explain errors, locate dimension mismatches, and complete broadcasting rules;
    4. Formulas and charts: identify symbol meanings and check axis and legend conventions;
    5. Local document Q&A: split PDFs into a knowledge base for retrieval-augmented Q&A to reduce hallucinations.

    6. Data Acquisition and Preprocessing Automation

    Let the model generate download and processing skeletons, then manually replace them with compliant data sources and authentication methods:

    1. # Pseudocode: generated by the model; interfaces and parameters require manual verification
    2. def fetch_daily_station(start, end, var):
    3. ...
    4. def qc(series):
    5. series = series.where(series > -9999)
    6. return series.interpolate(limit=3)

    Key tasks include unifying time coordinates across multiple sources, standardizing units, aligning station metadata, and masking continuous missing-data segments.

    7. Visualization and Diagnostic Figures

    Common atmospheric science figures include statistical plots, wind fields and streamlines, wind roses, filled contour plots, and multi-panel layouts. The model can generate plotting templates with enforced constraints: coordinate projection, color scale range, colorblind-friendly palettes, resolution, and font size. Example:

    1. import matplotlib.pyplot as plt
    2. fig, ax = plt.subplots(1, 2, figsize=(10, 4))
    3. ax[0].plot(dates, prcp); ax[1].bar(dates, wind_speed)

    8. Typical Scenarios

    • Satellite precipitation: quality control and bias diagnosis before multi-source fusion;
    • Reanalysis data: streamlined workflows for interannual trends and significance testing;
    • Drought monitoring: multi-indicator standardization and threshold classification;
    • Wind and solar resource assessment: wind power density and irradiance statistics from wind towers and reanalysis data.

    9. Standards and Risk Control

    Establish a “three-review” mechanism: first review units and dimensions, second review spatiotemporal alignment, third review whether conclusions are supported by data. All generated code should be placed under version control and unit testing, sensitive materials should be processed locally whenever possible, forming a reproducible and auditable research pipeline.