Skip to content

Instantly share code, notes, and snippets.

View ashao's full-sized avatar

Andrew Shao ashao

  • Hewlett Packard Enterprise
  • Victoria, BC, Canada
View GitHub Profile
# Reintegrate column based on subroutine in MOM6: MOM_diag_vkernels.F90 translated into python
# Redo a reintegration
def reintegrate_column(h_src, uh_src, h_dest):
missing_value = 0.
nsrc = h_src.size
ndest = h_dest.size
uh_dest = np.zeros(h_dest.shape)
print(uh_dest.shape)
k_src = -1
k_dest = -1
@ashao
ashao / diag_table
Created February 10, 2018 00:42
Salt/Heat budget diag_table for OM4_05-like experiments
Mediterranean_OM4_05
1 1 1 0 0 0
"tendency_native", 5, "days", 1, "days", "time"
"tendency_z", 5, "days", 1, "days", "time"
### Tendencies in z space
"ocean_model_z", "umo", "umo", "tendency_z", "all", "mean", "none",2
"ocean_model_z", "vmo", "vmo", "tendency_z", "all", "mean", "none",2
# Thicknesses at various points
"ocean_model_z", "h_pre_sync", "h_pre_sync", "tendency_z", "all", "mean", "none",2
@ashao
ashao / example_chksum_diag
Created March 3, 2018 03:25
A demonstration of chksum_diag that can be used for regression testing of diagnostics
ocean_model-Ahh 02866317
ocean_model_z-Ahh 00980365
ocean_model-FrictWorkIntz 00000000
ocean_model-Ahh 03894013
ocean_model_z-Ahh 01749930
ocean_model-FrictWorkIntz 00056107
ocean_model_z-uh 00981635
ocean_model_z-vh 00973516
ocean_model_z-uhml 00000000
ocean_model_z-vhml 00000000
@ashao
ashao / MIDAS.yml
Last active September 7, 2018 19:22
YML for MIDAS using conda
# This file may be used to create an environment using:
# $ conda create --name <env> --file <this file>
# platform: linux-64
@EXPLICIT
https://repo.continuum.io/pkgs/main/linux-64/blas-1.0-mkl.tar.bz2
https://repo.continuum.io/pkgs/main/linux-64/ca-certificates-2018.03.07-0.tar.bz2
https://repo.continuum.io/pkgs/main/linux-64/intel-openmp-2018.0.3-0.tar.bz2
https://repo.continuum.io/pkgs/main/linux-64/libgcc-ng-7.2.0-h7cc24e2_2.tar.bz2
https://repo.continuum.io/pkgs/free/linux-64/libgfortran-3.0.0-1.tar.bz2
https://repo.continuum.io/pkgs/main/linux-64/libgfortran-ng-7.3.0-hdf63c60_0.tar.bz2
! This file was written by the model and records the non-default parameters used at run-time.
! === module MOM ===
ENABLE_THERMODYNAMICS = False ! [Boolean] default = True
! If true, Temperature and salinity are used as state
! variables.
ADIABATIC = True ! [Boolean] default = False
! There are no diapycnal mass fluxes if ADIABATIC is
! true. This assumes that KD = KDML = 0.0 and that
! there is no buoyancy forcing, but makes the model
@ashao
ashao / input.nml
Created October 31, 2018 17:13
input.nml for coupled aquaplanet
&aerosol_nml ! Can change to use single values
! Aerosol effects
use_aerosol_timeseries = .false.
aerosol_dataset_entry = 1990, 1, 1, 0, 0, 0,
1990, 1, 1, 0, 0, 0,
1990, 1, 1, 0, 0, 0,
1990, 1, 1, 0, 0, 0,
1990, 1, 1, 0, 0, 0,
1990, 1, 1, 0, 0, 0,
1990, 1, 1, 0, 0, 0,
@ashao
ashao / demonstrate_sorting.ipynb
Last active December 17, 2018 18:02
Demonstration of sorting algorithm for neutral diffusion using discontinuous reconstructions
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ashao
ashao / checksums.F90
Created January 11, 2019 21:45
Checksum code for NEMO
MODULE checksums
!!======================================================================
!! *** MODULE checksums ***
!! Utility functions: Calculate checksums of arrays. Robust across PE
!! count and domain decomposition
!!
!!======================================================================
!! History : 3.4 ! Initial implementation 2018-04 (A.Shao)
!!----------------------------------------------------------------------
!! chksum : Calculates a checksum of a given 2d/3d array
@ashao
ashao / DailyVariance_EOF.ipynb
Created March 22, 2019 00:21
Example of making normal subdaily variance via EOFs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.