Skip to content

Instantly share code, notes, and snippets.

@sanAkel
sanAkel / plot_bcs.py
Last active March 16, 2022 23:39
To plot binary SST, ICEC, mask (within GEOS-ESM)
#!/usr/bin/env python
'''
to plot the SST and SIC boundary conditions (binary files) that are used by the GCM
SA, Jul 2018, Aug 2020, Mar 2022
'''
#-----------------------------------------------------------------
import argparse

Imports

Following list has been gathered from: https://github.com/GEOS-ESM/GEOSgcm_GridComp/blob/develop/GEOS_GcmGridComp.F90 , scan for:

  1. call DO_O2A (impSKIN,' var_name' , GEX(OGCM), 'var_name' , RC=STATUS)
  2. call DO_O2A_SUBTILES_R{x}R{y}(expSKIN ,'var_name', SUBINDEX_{x1}, GIM(OGCM), 'var_name' , SUBINDEX_{y1}, RC=STATUS) NOTE: above
    • where x1 = O, A; y1 = A, O, respectively
    • where x = 4, 8; y = 8, 4, respectively
      above sequence in x, y and x1, y1 may be incorrect! One should carefully scan the above (URL to) GEOS_GcmGridComp.F90
@sanAkel
sanAkel / try1.py
Last active August 1, 2020 00:25
Thanks to @yvikhlya for the help!
import xarray as xr
import matplotlib.pyplot as plt
ds=xr.open_mfdataset('/discover/nobackup/sakella/m6_test/holding/geosgcm_surf/*/m6_test.geosgcm_surf.*_1200z.nc4')
frice = ds['FRSEAICE']
frocn = ds['FROCEAN']
ts = ds['TS']
t2m = ds['T2M']