Neural-network parameterization of subgrid momentum transport learned from a high-resolution simulation
Here we have the code and processed data from simulations and neural network parameterizations for momentum transport.
The code is divided to three main directories:
- sam_code_momentum: Fortran code with all changes done to SAM used in the simulations.
- The subdirectory SRC include all code for running SAM with an NN parameteriztion for momentum.
- The subdirectory namelist_files contains the namelist (prm) for the x4-MOM and x8-MOM simulations
- NN_training: python code used for creating all Neural Networks used in the manuscript. There are two directories here.
- run_training: examples of the input files used to train the NNs (first the files starting with 'build' were run to create the train and test data sets, and later the files starting with 'train' were run where we trained the neural networks).
- src: python code to process the coarse-grained high-resolution data and to train the neural networks.
- high_res_processing_code: matlab code used to calculate the coarse-grained and resolved tendencies, fluxes, diffusivity and input variables. This code uses the high-resolution data to calculate these quantities. The code that was ran was main.m, and later the file Add_Momentum_terms_collacated_grid.m was run to coarse-grain the momentum variables and subrid terms on a collocated grid.
The high-resolution simulation output and a readme.txt file describing the high-resolution data is found at this google drive.
All the neural networks used in this study are saved in the NNs directory. We included both the networks that predict momentum outputs (momentum_param directory) and the networks that predict moisture and energy related variables (energy_moisture_param). These networks are used when running SAM simulations (see SAM_code_momentum directory), and also to produce plots showing offline results.
In data_online there are different libraries for different simulations described in the manuscript:
- data_x4_reference - data from the x4 (no NN parameterization;48km grid spacing)
- data_x8_reference - data from the x8 (no NN parameterization;96km grid spacing)
- data_x4_5_layers - data from the x4-NN simulation (48km grid spacing) with neural-network parameterization for moistu re and energy vars
- data_x8_5_layers - data from the x8-NN simulation (96km grid spacing) with neural-network parameterization for moisture and energy vars
- data_x4_5layer_with_momentum_with_tkz_before_adams - data from the x4-MOM simulation (48km grid spacing) with neural-network parameterization for moisture, energy and momentum
- data_x8_5layer_with_momentum_with_tkz_before_adams - data from the x8-MOM simulation (96km grid spacing) with neural-network parameterization for moisture, energy and momentum
Each folder contains a netcdf file with the following data:
- x - longitudinal coordinate (units:meters)
- y - latitudinal coordinate (units:meters)
- z(z) - vertical coordinate (units:meters)
The time and zonal average (taken from 3-hourly snapshot over 500 days):
- U(y, z) - zonal wind
- V(y, z) - meridional wind
- W(y, z) - vertical wind
- U2(y, z) - zonal wind squared
- V2(y, z) - meridional wind squared
- W2(y, z) - vertical wind squared
- T(y, z) - temperature
- QV(y, z) - water vapor
- QC(y, z) - cloud water
- QI(y, z) - cloud ice
- QP(y, z) - precipitable water
Precipitation averaged over 500 days:
- precip_avg_rf - mean precipitation
The files 12km_diff_coarse_space_corrected_tkz8_statistics.mat and 12km_diff_coarse_space_corrected_tkz4_statistics.mat include data from hi-res that was coarsened to x8 and x4, respectively.
Code used to produced plots for this manuscript is found in the plot_notebooks directory.
The notebook Online_simulations_production_git.ipynb contains the code to produce the online plots (e.g., figure 3 in the manuscript), and the associated data is found in the directory data_online.
The notebook Offline_momentum_production_git.ipynb contains the data to plot the