pernak18 / g-point-reduction

Jupyter Notebook evolution of RRTMGP g-point reduction (AKA k-distribution optimization) that started with Menno's [k-distribution-opt](https://github.com/MennoVeerman/k-distribution-opt) repo
0 stars 0 forks source link

Record of Reduction #28

Open pernak18 opened 1 year ago

pernak18 commented 1 year ago

what g-points were combined for our "final" product? at this point, "final" can be the 176-iteration run we recently completed in #26

pernak18 commented 1 year ago

it turns out i save the optimized k-files (i.e., which trial produced the winner) in the diagnostics

cd /pscratch/sd/p/pernak18/RRTMGP/quad_regress_abs_val/fullCF_top-layer_redo_abs_parabola/diagnostics
ls # cost_components_iter001.nc...cost_components_iter177.nc

can make a list in Python:

import os, glob

os.getcwd()
# '/pscratch/sd/p/pernak18/RRTMGP/quad_regress_abs_val/fullCF_top-layer_redo_abs_parabola/diagnostics'

ncFiles = sorted(glob.glob('*.nc'))

outFP = open('rec_redux.txt', 'w')
for nc in ncFiles:
  with xa.open_dataset(nc) as ds: outFP.write('{}\n'.format(ds.attrs['optimal']))
outFP.close()

save "permanently" with cp rec_redux.txt /global/cfs/projectdirs/e3sm/pernak18/quad_regress_abs_val_iter176/. some more work needs to be done with those file names (e.g., band01_coefficients_LW_g02-03_iter176_2p176.nc), but i think they have everything we need

pernak18 commented 1 year ago
for iBand in range(1, 17):
    sBand = 'band{:02d}'.format(iBand)
    print(sBand)
    for kFile in kFiles:
        if sBand in kFile: print('\t{}'.format(kFile))
    print()

results in /Users/rpernak/Work/RC/RRTMGP/by-band-g-reduce/rec_redux_by_band.txt