From ceb6252de55a0a3c5eac885e096bd03edf63281b Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Mon, 14 Apr 2025 09:23:27 -0400 Subject: [PATCH 01/54] Update gitignore --- .gitignore | 185 ++++++++++++++++++++++++++++++++++++++++++++++++++- CHANGELOG.md | 3 + 2 files changed, 187 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 2ebffd1..c5329df 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,186 @@ -*.pyc +# Ignore usual suspect binary files + *.nc +*.nc4 +*.bin +*.hdf +*.h5 + +# Below is the github gitignore for Python +# https://github.com/github/gitignore/blob/main/Python.gitignore +# as of 2025-Apr-14 + +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# UV +# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +#uv.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/latest/usage/project/#working-with-version-control +.pdm.toml +.pdm-python +.pdm-build/ + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +#.idea/ + +# Ruff stuff: +.ruff_cache/ +# PyPI configuration file +.pypirc diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d0aeba..4c80559 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Updated `.gitignore` to ignore more binary file types as well as the recommended Python patterns + ### Removed ### Deprecated @@ -20,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [1.2.1] - 2025-04-10 ### Added + - Added components.yaml and CMakeLists.txt and directory structure to bring GMAOpyobs into GEOSmie From 6a739a46b2cf4fd8172b43023e066b7d086bddb3 Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Mon, 14 Apr 2025 16:34:12 -0400 Subject: [PATCH 02/54] fix indexing of S11, etc --- utils/eval_gsfun.py | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/utils/eval_gsfun.py b/utils/eval_gsfun.py index aac5581..7e467c9 100755 --- a/utils/eval_gsfun.py +++ b/utils/eval_gsfun.py @@ -115,6 +115,14 @@ def __init__(self,inFile,irh=None,ibin=None,iwav=None): # calculate phase matrix from expansion coefficients self.getPmatrix() + # pull out the indices of S-elements selected for plotting later + self.s11 = self.optics['s11'].isel(rh=self.irh,bin=self.ibin,wavelength=self.iwav) + self.s12 = self.optics['s12'].isel(rh=self.irh,bin=self.ibin,wavelength=self.iwav) + self.s22 = self.optics['s22'].isel(rh=self.irh,bin=self.ibin,wavelength=self.iwav) + self.s33 = self.optics['s33'].isel(rh=self.irh,bin=self.ibin,wavelength=self.iwav) + self.s34 = self.optics['s34'].isel(rh=self.irh,bin=self.ibin,wavelength=self.iwav) + self.s44 = self.optics['s44'].isel(rh=self.irh,bin=self.ibin,wavelength=self.iwav) + def getPmatrix(self): """ regenerate the phase matrix from the GSF coefficients @@ -284,11 +292,11 @@ def plotPmatrix(self,irh=None,iwav=None,ibin=None): """ if irh is None: - irh = np.arange(self.optics.rh.size) + irh = np.arange(self.p11.sizes['rh']) if iwav is None: - iwav = np.arange(self.optics.wavelength.size) + iwav = np.arange(self.p11.sizes['wavelength']) if ibin is None: - ibin = np.arange(self.optics.bin.size) + ibin = np.arange(self.p11.sizes['bin']) for rh in irh: for wav in iwav: @@ -299,7 +307,7 @@ def plotPmatrix(self,irh=None,iwav=None,ibin=None): p11 = self.p11.isel(rh=rh,wavelength=wav,bin=bin) ax.plot(self.angle, p11,label='GSF') # normalize S11 - s11 = self.optics['s11'].isel(rh=rh,wavelength=wav,bin=bin) + s11 = self.s11.isel(rh=rh,wavelength=wav,bin=bin) s11n = 2.*s11 / np.trapz(s11 * np.sin(self.theta),self.theta) ax.plot(self.angle,s11n,label='S11') ax.legend() @@ -308,14 +316,14 @@ def plotPmatrix(self,irh=None,iwav=None,ibin=None): # P12 ax = axes[0,1] ax.plot(self.angle, self.p12.isel(rh=rh,wavelength=wav,bin=bin)/p11,label='GSF') - ax.plot(self.angle,self.optics['s12'].isel(rh=rh,wavelength=wav,bin=bin)/s11,label='S12') + ax.plot(self.angle,self.s12.isel(rh=rh,wavelength=wav,bin=bin)/s11,label='S12') ax.legend() ax.set_title('P12=P2') # P22 ax = axes[1,1] ax.plot(self.angle, self.p22.isel(rh=rh,wavelength=wav,bin=bin)/p11,label='GSF') - ax.plot(self.angle,self.optics['s22'].isel(rh=rh,wavelength=wav,bin=bin)/s11,label='S22') + ax.plot(self.angle,self.s22.isel(rh=rh,wavelength=wav,bin=bin)/s11,label='S22') ax.legend() ax.set_yscale('log') ax.set_title('P22=P5') @@ -323,21 +331,21 @@ def plotPmatrix(self,irh=None,iwav=None,ibin=None): # P33 ax = axes[0,2] ax.plot(self.angle, self.p33.isel(rh=rh,wavelength=wav,bin=bin)/p11,label='GSF') - ax.plot(self.angle,self.optics['s33'].isel(rh=rh,wavelength=wav,bin=bin)/s11,label='S33') + ax.plot(self.angle,self.s33.isel(rh=rh,wavelength=wav,bin=bin)/s11,label='S33') ax.legend() ax.set_title('P33=P3') # P34 ax = axes[1,0] ax.plot(self.angle, self.p34.isel(rh=rh,wavelength=wav,bin=bin)/p11,label='GSF') - ax.plot(self.angle,self.optics['s34'].isel(rh=rh,wavelength=wav,bin=bin)/s11,label='S34') + ax.plot(self.angle,self.s34.isel(rh=rh,wavelength=wav,bin=bin)/s11,label='S34') ax.legend() ax.set_title('P34=P4') # P44 ax = axes[1,2] ax.plot(self.angle, self.p44.isel(rh=rh,wavelength=wav,bin=bin)/p11,label='GSF') - ax.plot(self.angle,self.optics['s44'].isel(rh=rh,wavelength=wav,bin=bin)/s11,label='S44') + ax.plot(self.angle,self.s44.isel(rh=rh,wavelength=wav,bin=bin)/s11,label='S44') ax.legend() ax.set_title('P44=P6') @@ -351,11 +359,11 @@ def plotPmatrix(self,irh=None,iwav=None,ibin=None): inDir = '/discover/nobackup/pcastell/workspace/aero_work/aist/sbg/aop_testing/ExtDataColarco' # inFile = 'optics_SU.v2.0.0.GSFun-129.nc4' - inFile = 'optics_DU.v2.0.0.GSFun-129.nc4' + inFile = 'optics_BC.v2.0.0.GSFun-129.nc4' # optics = OPTICS(inDir+'/'+inFile,irh=[0],ibin=[0],iwav=[0]) -# optics.plotPmatrix(irh=[0],ibin=[0],iwav=[0]) +# optics.plotPmatrix() - optics = OPTICS(inDir+'/'+inFile) - optics.plotPmatrix(irh=[0]) + optics = OPTICS(inDir+'/'+inFile,irh=[35],iwav=[0]) + optics.plotPmatrix() From 8968eabfe0c9c46ffd5d66b22fca5f306407057f Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Mon, 14 Apr 2025 16:42:23 -0400 Subject: [PATCH 03/54] fix legendre overflows --- utils/eval_gsfun.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/eval_gsfun.py b/utils/eval_gsfun.py index 7e467c9..8a8ab35 100755 --- a/utils/eval_gsfun.py +++ b/utils/eval_gsfun.py @@ -13,7 +13,7 @@ import numpy as np from math import sqrt, cos, factorial import matplotlib.pyplot as plt -from scipy.special import legendre +from scipy.special import eval_legendre def recur_d_mn(m,n,s,theta): @@ -161,8 +161,8 @@ def calcP11(self,ipol): p11 = xr.DataArray(dims=self.dims,coords=self.coords) p11[:] = 0.0 for s in range(self.nMom): - P = legendre(s) - p11 += self.optics['pmom'].isel(p=ipol,m=s,rh=self.irh,wavelength=self.iwav,bin=self.ibin)*P(mu) + P = eval_legendre(s,mu) + p11 += self.optics['pmom'].isel(p=ipol,m=s,rh=self.irh,wavelength=self.iwav,bin=self.ibin)*P return p11 From a0bf16bd86efc2d9d11c60ce9385016e9ece75da Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Mon, 14 Apr 2025 16:44:42 -0400 Subject: [PATCH 04/54] update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c80559..468f39f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Fixed - +- fixed eval_gsfun script for legendre overflows and bad indexing of scattering phase functions when plotting ### Added ### Changed From c1de3e10822393bb37361fb076a159219f9208de Mon Sep 17 00:00:00 2001 From: Peter Colarco Date: Sun, 20 Apr 2025 12:06:47 -0400 Subject: [PATCH 05/54] prc: changes naming scheme for output files so that post-gsf we have traditional name for final file --- dointegration.py | 4 ++-- gsf/convertncdf.py | 7 ++----- runoptics.py | 4 ++-- scripts/proc.v2.0.0.csh | 16 ++++++++-------- 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/dointegration.py b/dointegration.py index 74b000f..d374d53 100755 --- a/dointegration.py +++ b/dointegration.py @@ -205,12 +205,12 @@ def find_closest_ind(myList, myNumber, typ='none',ide=''): def createNCDF(ncdfID, oppfx, rarr, rharr, lambarr, ang, oppclassic): if oppclassic: - ncdf = netCDF4.Dataset(os.path.join(oppfx, 'optics_%s.legacy.nc4'%ncdfID), 'w') + ncdf = netCDF4.Dataset(os.path.join(oppfx, 'optics_%s.nomom.legacy.nc4'%ncdfID), 'w') radiusNm = 'radius' lambdaNm = 'lambda' npolNm = 'nPol' else: - ncdf = netCDF4.Dataset(os.path.join(oppfx, 'optics_%s.nc4'%ncdfID), 'w') + ncdf = netCDF4.Dataset(os.path.join(oppfx, 'optics_%s.nomom.nc4'%ncdfID), 'w') radiusNm = 'bin' lambdaNm = 'wavelength' npolNm = 'p' diff --git a/gsf/convertncdf.py b/gsf/convertncdf.py index f2d211c..1ea454d 100755 --- a/gsf/convertncdf.py +++ b/gsf/convertncdf.py @@ -319,16 +319,13 @@ def fun(fn, whichproc, rhop0, ice, keydic): def processFileRaw(infile, outdir, whichproc, rhop0, mode, ice): # mischenko expects the order p11, p22, p33, p44, p12, p34 #numExpand = 2001 # this needs to match what is set in params.h - #numExpand = 300 + #numExpand = 1000 numExpand = 129 num_gauss = 960 # arbitrary? perhaps try adaptive # mishchenko's code gives errors in num_gauss is bigger than 1000, though this can probably be changed in params.h fn = os.path.basename(infile) - sfx = fn.split('.')[-1] # file suffix - outfn = fn.replace(sfx, 'GSFun.%s'%sfx) - if numExpand != 2001: - outfn = outfn.replace('.GSFun.%s'%sfx, '.GSFun-%d.%s'%(numExpand, sfx)) + outfn = fn.replace('nomom.','') outfile = os.path.join(outdir, outfn) diff --git a/runoptics.py b/runoptics.py index 2d8149b..0f91ba9 100755 --- a/runoptics.py +++ b/runoptics.py @@ -107,9 +107,9 @@ # that is prepended to the results of the initial hydrophilic # calculation if options.classic: - opfn = "optics_%s.legacy.nc4"%particlename + opfn = "optics_%s.nomom.legacy.nc4"%particlename else: - opfn = "optics_%s.nc4"%particlename + opfn = "optics_%s.nomom.nc4"%particlename if "hydrophobic" in params and params["hydrophobic"]: # rename non-HP file fn2 = "%s.nohp"%opfn diff --git a/scripts/proc.v2.0.0.csh b/scripts/proc.v2.0.0.csh index fa1b1d7..af43b7c 100755 --- a/scripts/proc.v2.0.0.csh +++ b/scripts/proc.v2.0.0.csh @@ -30,19 +30,19 @@ mkdir -p ../AerosolOptics/$ver/x # Run the cases # All wavelengths - foreach XX (DU BC OC NI SS SU BR) + foreach XX (DU BC OC SU BR NI SS) ./runoptics.py --name $ver/$XX.$ver.json --dest=$ver> $ver/optics_$XX.$ver.txt & end wait -# Bands - foreach XX (DU BC OC NI SS SU BR) - ./runbands.py --filename $ver/optics_$XX.$ver.nc4 --dest=$ver +# Add phase matrices + foreach XX (DU BC OC SU BR NI SS) + ./rungsf.py --filename $ver/optics_$XX.$ver.nomom.nc4 --dest=$ver end -# Add phase matrices - foreach XX (DU BC OC NI SS SU BR) - ./rungsf.py --filename $ver/optics_$XX.$ver.nc4 --dest=$ver +# Bands + foreach XX (DU BC OC SU BR NI SS) + ./runbands.py --filename $ver/optics_$XX.$ver.nc4 --dest=$ver end # Move files @@ -50,5 +50,5 @@ mkdir -p ../AerosolOptics/$ver/x # Clean up - rm -f runbands.py runoptics.py rungsf.py a.out +# rm -f runbands.py runoptics.py rungsf.py a.out From f607c4afa1ad7e4f3b76ca5fdc938ac59812014b Mon Sep 17 00:00:00 2001 From: Peter Colarco Date: Sun, 20 Apr 2025 12:12:04 -0400 Subject: [PATCH 06/54] prc: update CHANGELOG --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 468f39f..3cba349 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed +- Changed naming convention so that output of runoptics.py files are labeled ".nomom." to + explicitly indicate that expansion moments are not included; post-processing by rungsf.py + now results in a filename that strips out ".nomom" and so looks like classic files +- Modify processing script (proc.v2.0.0.csh) to accommodate the above change + ### Fixed - fixed eval_gsfun script for legendre overflows and bad indexing of scattering phase functions when plotting ### Added From fe80d6e8bd8811e905b70d49c3ad9e702c347fe6 Mon Sep 17 00:00:00 2001 From: Peter Colarco Date: Tue, 22 Apr 2025 10:41:30 -0400 Subject: [PATCH 07/54] prc: add a posteriori normalization of phase matrix elements and change file handling to accommodate; change name of elements from s11, etc., to p11, etc. --- CHANGELOG.md | 27 ++++++++++++------- dointegration.py | 66 ++++++++++++++++++++++----------------------- gsf/convertncdf.py | 4 +-- utils/eval_gsfun.py | 24 ++++++++--------- 4 files changed, 65 insertions(+), 56 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3cba349..42289d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,24 +7,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -### Changed -- Changed naming convention so that output of runoptics.py files are labeled ".nomom." to - explicitly indicate that expansion moments are not included; post-processing by rungsf.py - now results in a filename that strips out ".nomom" and so looks like classic files -- Modify processing script (proc.v2.0.0.csh) to accommodate the above change - ### Fixed -- fixed eval_gsfun script for legendre overflows and bad indexing of scattering phase functions when plotting + ### Added ### Changed -- Updated `.gitignore` to ignore more binary file types as well as the recommended Python patterns - ### Removed ### Deprecated +## [1.2.2] - 2025-04-22 + +### Fixed +- fixed eval_gsfun script for legendre overflows and bad indexing of scattering phase functions when plotting + +### Changed +- Changed output variables of runoptics.py from s11, s12, etc. to p11, p12, etc. + and applied an a posteriori normalization to them. These are now directly the + the phase function elements at the indicated angles as f(bin,wavelength,rh,ang) +- Changed rungsf.py and utils/eval_gsfun.py to accommodate change in phase function + element naming as above. +- Changed naming convention so that output of runoptics.py files are labeled ".nomom." to + explicitly indicate that expansion moments are not included; post-processing by rungsf.py + now results in a filename that strips out ".nomom" and so looks like classic files. +- Modify processing script (proc.v2.0.0.csh) to accommodate the above change. +- Updated `.gitignore` to ignore more binary file types as well as the recommended Python patterns + ## [1.2.1] - 2025-04-10 ### Added diff --git a/dointegration.py b/dointegration.py index d374d53..7580da5 100755 --- a/dointegration.py +++ b/dointegration.py @@ -13,7 +13,7 @@ """ These govern how integration and dimensions etc are done, so define them here """ -scatkeys = ['s11', 's12', 's22', 's33', 's34', 's44'] +scatkeys = ['p11', 'p12', 'p22', 'p33', 'p34', 'p44'] #scalarkeys = ['qext', 'qsca', 'qabs', 'g', 'qb', 'csca', 'cext'] scalarkeys = ['qext', 'qsca', 'qabs', 'qb', 'g', 'csca', 'cext'] extrakeys = ['ssa', 'bsca', 'bext', 'bbck', 'refreal', 'refimag', 'lidar_ratio'] @@ -242,23 +242,23 @@ def createNCDF(ncdfID, oppfx, rarr, rharr, lambarr, ang, oppclassic): 'long_name': 'scattering angle' } - vardict['s11'] = {'units': 'dimensionless', \ - 'long_name': 'S11 element of the scattering matrix' + vardict['p11'] = {'units': 'dimensionless', \ + 'long_name': 'P11 element of the normalized scattering matrix' } - vardict['s12'] = {'units': 'dimensionless', \ - 'long_name': 'S12 element of the scattering matrix' + vardict['p12'] = {'units': 'dimensionless', \ + 'long_name': 'P12 element of the normalized scattering matrix' } - vardict['s22'] = {'units': 'dimensionless', \ - 'long_name': 'S22 element of the scattering matrix' + vardict['p22'] = {'units': 'dimensionless', \ + 'long_name': 'P22 element of the normalized scattering matrix' } - vardict['s33'] = {'units': 'dimensionless', \ - 'long_name': 'S33 element of the scattering matrix' + vardict['p33'] = {'units': 'dimensionless', \ + 'long_name': 'P33 element of the normalized scattering matrix' } - vardict['s34'] = {'units': 'dimensionless', \ - 'long_name': 'S34 element of the scattering matrix' + vardict['p34'] = {'units': 'dimensionless', \ + 'long_name': 'P34 element of the normalized scattering matrix' } - vardict['s44'] = {'units': 'dimensionless', \ - 'long_name': 'S44 element of the scattering matrix' + vardict['p44'] = {'units': 'dimensionless', \ + 'long_name': 'P44 element of the normalized scattering matrix' } vardict['qsca'] = {'units': 'dimensionless', \ 'long_name':'scattering efficiency' @@ -372,12 +372,12 @@ def createNCDF(ncdfID, oppfx, rarr, rharr, lambarr, ang, oppclassic): # for each NetCDF variable, assign one dimension type based on the dimension types dictionary ncdfVariableDimensionTypes = {\ - "s11": "scatteringFun",\ - "s12": "scatteringFun",\ - "s22": "scatteringFun",\ - "s33": "scatteringFun",\ - "s34": "scatteringFun",\ - "s44": "scatteringFun",\ + "p11": "scatteringFun",\ + "p12": "scatteringFun",\ + "p22": "scatteringFun",\ + "p33": "scatteringFun",\ + "p34": "scatteringFun",\ + "p44": "scatteringFun",\ "qsca": "scalarScattering",\ "qabs": "scalarScattering",\ "qext": "scalarScattering",\ @@ -881,7 +881,7 @@ def fun(partID0, datatype, oppfx, oppclassic): keys = ['ext', 'abs', 'sca', 'qext', 'qabs', 'qsca', 'qb', 'g', 'cext', 'csca', 'cabs'] # keys = ['ext', 'abs', 'sca', 'qext', 'qsca', 'qb', 'g', 'cext', 'csca'] scatelekeys = ['scama'] - scatelems = ['s11', 's22', 's33', 's44', 's12', 's34'] # order Mischenko's code expects + scatelems = ['p11', 'p22', 'p33', 'p44', 'p12', 'p34'] # order Mischenko's code expects ret1 = {} for kk in keys: valmat = ret0[kk][:,:,:] @@ -947,7 +947,19 @@ def fun(partID0, datatype, oppfx, oppclassic): ret['rLow'] = rLow ret['rUp'] = rUp - pbackorder = ['s11', 's12', 's33', 's34', 's22', 's44'] + """ + Calculate a posteriori normalization of phase matrix elements + """ + theta = np.radians(ang) + p11n = 2.*ret['p11'] / np.trapz(ret['p11'] * np.sin(theta),theta) + ret['p12'] = ret['p12']*p11n/ret['p11'] + ret['p22'] = ret['p22']*p11n/ret['p11'] + ret['p33'] = ret['p33']*p11n/ret['p11'] + ret['p34'] = ret['p34']*p11n/ret['p11'] + ret['p44'] = ret['p44']*p11n/ret['p11'] + ret['p11'] = p11n + + pbackorder = ['p11', 'p12', 'p33', 'p34', 'p22', 'p44'] ret['pback'] = np.array([ret[key][-1] for key in pbackorder]) ret['growth_factor'] = gf @@ -1126,21 +1138,9 @@ def integratePSD(xxarr, rawret, psd, fracs, lam, reff0, rhop0, rhop): if key in scatkeys: thisvals = rawret[fraci][key] thisret[key] = np.dot(thisvals.T, psd[fraci]) # integrate -# PRC: tried the block below, didn't like it -# thisq = np.array(rawret[fraci]['qsca']) -# beta = np.sum(thisq*rarr2)*np.pi -# fac = 1./beta -# if(key == 's11'): -# print(key, thisvals[0,370], fac) -# thiskey = np.zeros((thisvals.shape)) -# for i in range(0,371): -# thiskey[:,i] = thisvals[:,i]*thisarea*(4.*np.pi) -# thisret[key] = np.dot(thiskey.T, psd[fraci])*fac*thisret['qsca']/(4.*np.pi) elif key in qbwght: thisret[key] = p11back*thisret['qsca']/(4.*np.pi) -# print(thisret[key]) -# exit() else: """ For external mixing we first need to integrate over the individual PSD, diff --git a/gsf/convertncdf.py b/gsf/convertncdf.py index 1ea454d..f37c29b 100755 --- a/gsf/convertncdf.py +++ b/gsf/convertncdf.py @@ -12,7 +12,7 @@ -open a netcdf file -loop over all lambda -loop over all RH --read in s11, s12, etc, write them in a temp table file, run Mishchenko's code for that file, +-read in p11, p12, etc, write them in a temp table file, run Mishchenko's code for that file, read in Mishchenko's output, save that output back to NetCDF under another variable name (or separate file) -delete temporary file and Mischenko's output @@ -174,7 +174,7 @@ def convertData(ncdf, mode, ice, whichproc, radind, rhi, lami, rhop0, num_gauss, ang = ncdf.variables['ang'][:] numang = len(ang) allvals = np.zeros([7,numang]) - keys = ['s11', 's22', 's33', 's44', 's12', 's34'] # order Mischenko's code expects + keys = ['p11', 'p22', 'p33', 'p44', 'p12', 'p34'] # order Mischenko's code expects allvals[0,:] = ang for ki, key in enumerate(keys): if oppclassic: diff --git a/utils/eval_gsfun.py b/utils/eval_gsfun.py index 8a8ab35..1a135df 100755 --- a/utils/eval_gsfun.py +++ b/utils/eval_gsfun.py @@ -116,12 +116,12 @@ def __init__(self,inFile,irh=None,ibin=None,iwav=None): self.getPmatrix() # pull out the indices of S-elements selected for plotting later - self.s11 = self.optics['s11'].isel(rh=self.irh,bin=self.ibin,wavelength=self.iwav) - self.s12 = self.optics['s12'].isel(rh=self.irh,bin=self.ibin,wavelength=self.iwav) - self.s22 = self.optics['s22'].isel(rh=self.irh,bin=self.ibin,wavelength=self.iwav) - self.s33 = self.optics['s33'].isel(rh=self.irh,bin=self.ibin,wavelength=self.iwav) - self.s34 = self.optics['s34'].isel(rh=self.irh,bin=self.ibin,wavelength=self.iwav) - self.s44 = self.optics['s44'].isel(rh=self.irh,bin=self.ibin,wavelength=self.iwav) + self.s11 = self.optics['p11'].isel(rh=self.irh,bin=self.ibin,wavelength=self.iwav) + self.s12 = self.optics['p12'].isel(rh=self.irh,bin=self.ibin,wavelength=self.iwav) + self.s22 = self.optics['p22'].isel(rh=self.irh,bin=self.ibin,wavelength=self.iwav) + self.s33 = self.optics['p33'].isel(rh=self.irh,bin=self.ibin,wavelength=self.iwav) + self.s34 = self.optics['p34'].isel(rh=self.irh,bin=self.ibin,wavelength=self.iwav) + self.s44 = self.optics['p44'].isel(rh=self.irh,bin=self.ibin,wavelength=self.iwav) def getPmatrix(self): """ @@ -309,21 +309,21 @@ def plotPmatrix(self,irh=None,iwav=None,ibin=None): # normalize S11 s11 = self.s11.isel(rh=rh,wavelength=wav,bin=bin) s11n = 2.*s11 / np.trapz(s11 * np.sin(self.theta),self.theta) - ax.plot(self.angle,s11n,label='S11') + ax.plot(self.angle,s11n,label='P11') ax.legend() ax.set_title('P11=P1') # P12 ax = axes[0,1] ax.plot(self.angle, self.p12.isel(rh=rh,wavelength=wav,bin=bin)/p11,label='GSF') - ax.plot(self.angle,self.s12.isel(rh=rh,wavelength=wav,bin=bin)/s11,label='S12') + ax.plot(self.angle,self.s12.isel(rh=rh,wavelength=wav,bin=bin)/s11,label='P12') ax.legend() ax.set_title('P12=P2') # P22 ax = axes[1,1] ax.plot(self.angle, self.p22.isel(rh=rh,wavelength=wav,bin=bin)/p11,label='GSF') - ax.plot(self.angle,self.s22.isel(rh=rh,wavelength=wav,bin=bin)/s11,label='S22') + ax.plot(self.angle,self.s22.isel(rh=rh,wavelength=wav,bin=bin)/s11,label='P22') ax.legend() ax.set_yscale('log') ax.set_title('P22=P5') @@ -331,21 +331,21 @@ def plotPmatrix(self,irh=None,iwav=None,ibin=None): # P33 ax = axes[0,2] ax.plot(self.angle, self.p33.isel(rh=rh,wavelength=wav,bin=bin)/p11,label='GSF') - ax.plot(self.angle,self.s33.isel(rh=rh,wavelength=wav,bin=bin)/s11,label='S33') + ax.plot(self.angle,self.s33.isel(rh=rh,wavelength=wav,bin=bin)/s11,label='P33') ax.legend() ax.set_title('P33=P3') # P34 ax = axes[1,0] ax.plot(self.angle, self.p34.isel(rh=rh,wavelength=wav,bin=bin)/p11,label='GSF') - ax.plot(self.angle,self.s34.isel(rh=rh,wavelength=wav,bin=bin)/s11,label='S34') + ax.plot(self.angle,self.s34.isel(rh=rh,wavelength=wav,bin=bin)/s11,label='P34') ax.legend() ax.set_title('P34=P4') # P44 ax = axes[1,2] ax.plot(self.angle, self.p44.isel(rh=rh,wavelength=wav,bin=bin)/p11,label='GSF') - ax.plot(self.angle,self.s44.isel(rh=rh,wavelength=wav,bin=bin)/s11,label='S44') + ax.plot(self.angle,self.s44.isel(rh=rh,wavelength=wav,bin=bin)/s11,label='P44') ax.legend() ax.set_title('P44=P6') From f1479c8ee9a6f971ccc054e2e53a16d96c041c7b Mon Sep 17 00:00:00 2001 From: Peter Colarco Date: Tue, 22 Apr 2025 11:57:31 -0400 Subject: [PATCH 08/54] prc: made some documentation updates --- CHANGELOG.md | 4 ++++ README.md | 2 +- scripts/README.md | 53 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 scripts/README.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 42289d6..926a380 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Modify processing script (proc.v2.0.0.csh) to accommodate the above change. - Updated `.gitignore` to ignore more binary file types as well as the recommended Python patterns +### Added +- Added some documentation in the scripts directory of specific optical + property assumptions. + ## [1.2.1] - 2025-04-10 ### Added diff --git a/README.md b/README.md index 5b3ea29..aaea7e3 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Table of Contents # GEOSmie -See [Kemppinen et al. 2002](https://gmao.gsfc.nasa.gov/pubs/docs/Kemppinen1447.pdf) for documentation of +See [Kemppinen et al. 2022](https://gmao.gsfc.nasa.gov/pubs/docs/Kemppinen1447.pdf) for documentation of the approach. Below is a brief summary of the structure and usage of the package. diff --git a/scripts/README.md b/scripts/README.md new file mode 100644 index 0000000..35fe9b7 --- /dev/null +++ b/scripts/README.md @@ -0,0 +1,53 @@ +Table of Contents +================= + +* [GEOSmie](#geosmie) + * [v2.0.0](#v2.0.0) + + + + +# GEOSmie + +See [Kemppinen et al. 2022](https://gmao.gsfc.nasa.gov/pubs/docs/Kemppinen1447.pdf) for +documentation of the approach. In the following is some brief document of the particlular +characteristics of specific optical tables generated, sorted by a carefully thought +out versioning scheme! + +## V2.0.0 + +This version is intended to be as close as possible to the legacy IDL-based tables, which +in turn are mainly based on OPAC-like assumptions of particle properties (growth factor +and complex refractive index). Some details are made explicit in Chin et al. 2002 and +Colarco et al. 2010. Specific details are provided in the JSON files in the geosparticles +sub-directory and additional information in Kemppinen et al. 2022. + +### Carbonaceous Aerosols +Following Chin et al. 2002 the particle size distributions are lognormal modes specified +in terms of number mode median radius (in microns) with a given width and truncated at +0.3 micron radius (dry particle). Growth factors specify the ratio of wet-to-dry particle +radius at the given RH. Refractive indices are given spectrally for the dry particles +and are volume weighted with water refractive index to give an effective refractive index +for the Mie calculations. For each of the carbonaceous species there are two size modes: +the first mode is hydrophobic (undergoes no growth with RH) and the second mode is +hydrophilic (grows with RH with specified growth factor). + +| Species | rnum [um] | sigma | Density [kg m-3] | Notes | +| --- | --- | --- | --- | --- | +| BC | 0.0118 | 2.0 | 1000 | bc.json | +| OC | 0.0212 | 2.20 | 1800 | oc.json | +| BR | 0.0212 | 2.20 | 1800 | brc.json | + +### Sulfate +Following Chin et al. 2002 the particle size distributions are lognormal modes specified +in terms of number mode median radius (in microns) with a given width and truncated at +0.3 micron radius (dry particle). Growth factors specify the ratio of wet-to-dry particle +radius at the given RH. Refractive indices are given spectrally for the dry particles +and are volume weighted with water refractive index to give an effective refractive index +for the Mie calculations. A single mode of sulfate is provided here. + +| Species | rnum [um] | sigma | Density [kg m-3] | Notes | +| --- | --- | --- | --- | --- | +| SU | 0.0695 | 2.03 | 1000 | su.json | + + From a07d64d255c6e05fa5d928667b37fdee28cfa9e1 Mon Sep 17 00:00:00 2001 From: Peter Colarco Date: Tue, 22 Apr 2025 15:58:52 -0400 Subject: [PATCH 09/54] prc: update README --- README.md | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index aaea7e3..2259fa2 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,28 @@ Table of Contents # GEOSmie -See [Kemppinen et al. 2022](https://gmao.gsfc.nasa.gov/pubs/docs/Kemppinen1447.pdf) for documentation of -the approach. Below is a brief summary of the structure and usage of the -package. +The GEOSmie package is used to generate aerosol optical property lookup tables (LUTs) +for use with the GOCART2G package in the GEOS Earth system model and related tools. + +In general, two sorts of LUTs are produced for each of the aerosol species simulated. +The first is the monochromatic table (i.e., optical properties at specified wavelengths) +which has a form like "optics_XX.vY.Y.Y.nc4" where "XX" is a label indicating the +aerosol species and "vY.Y.Y" is some sort of versioning string (e.g., optics_DU.v2.2.2.nc4). +This file is produced with a call to "runoptics.py" and a subsequent call to "rungsf.py" +to add the expansion moments of the phase function elements. The monochromatic tables are +used for higher precision calculation of aerosol optical properties at specified +wavelengths, for example the aerosol optical depth at 550 nm. +The second sort of LUT is generated from the monochromatic table and is averaged over +spectral bands dictated by the GEOS-internal radiative transfer code used for radiative +flux and forcing calculation (i.e., RRTMG). The wavelength index in that table is related +to the radiative transfer code band indices in that case. These files are produced by a +call to "runbands.py". See below for usage examples. + +See [Kemppinen et al. 2022](https://gmao.gsfc.nasa.gov/pubs/docs/Kemppinen1447.pdf) for +documentation of the approach. Below is a brief summary of the structure and usage of the +package. More specific information about the optical property assumptions is provided in +the README.md in the `scripts` subdirectory, which also contains version-specific +table generation scripts in an attempt to make this as turnkey as possible. The package consists of the following parts: From 088bb4b633c865fc126a6e26168bd672946b68e7 Mon Sep 17 00:00:00 2001 From: Peter Colarco Date: Tue, 22 Apr 2025 17:05:14 -0400 Subject: [PATCH 10/54] prc: added documentation and make runkernelconversion.py executable --- README.md | 28 +++++----- runkernelconversion.py | 10 ++++ scripts/README.md | 113 ++++++++++++++++++++++++++++++++++++++--- 3 files changed, 133 insertions(+), 18 deletions(-) mode change 100644 => 100755 runkernelconversion.py diff --git a/README.md b/README.md index 2259fa2..a61f745 100644 --- a/README.md +++ b/README.md @@ -15,26 +15,29 @@ Table of Contents # GEOSmie The GEOSmie package is used to generate aerosol optical property lookup tables (LUTs) -for use with the GOCART2G package in the GEOS Earth system model and related tools. - -In general, two sorts of LUTs are produced for each of the aerosol species simulated. -The first is the monochromatic table (i.e., optical properties at specified wavelengths) -which has a form like "optics_XX.vY.Y.Y.nc4" where "XX" is a label indicating the -aerosol species and "vY.Y.Y" is some sort of versioning string (e.g., optics_DU.v2.2.2.nc4). -This file is produced with a call to "runoptics.py" and a subsequent call to "rungsf.py" +for use with the GOCART2G package in the GEOS Earth system model and related tools. It +supports table generation either from direct Mie calculations or from integration over +externally provided kernels in a specified format. + +In general, two sorts of LUTs are produced for each of the aerosol species simulated: +- The first is the monochromatic table (i.e., optical properties at specified wavelengths) +which has a form like `optics_XX.vY.Y.Y.nc4` where `XX` is a label indicating the +aerosol species and `vY.Y.Y` is some sort of versioning string (e.g., `optics_DU.v2.0.0.nc4`). +This file is produced with a call to `runoptics.py` and a subsequent call to `rungsf.py` to add the expansion moments of the phase function elements. The monochromatic tables are used for higher precision calculation of aerosol optical properties at specified wavelengths, for example the aerosol optical depth at 550 nm. -The second sort of LUT is generated from the monochromatic table and is averaged over +- The second sort of LUT is generated from the monochromatic table and is averaged over spectral bands dictated by the GEOS-internal radiative transfer code used for radiative -flux and forcing calculation (i.e., RRTMG). The wavelength index in that table is related +flux and forcing calculation (i.e., RRTMG). The tables have a form like `optics_XX.vY.Y.Y.RRTMG.nc4` +(e.g., `optics_DU.v2.0.0.RRTMG.nc4`). The wavelength index in that table is related to the radiative transfer code band indices in that case. These files are produced by a -call to "runbands.py". See below for usage examples. +call to `runbands.py`. See below for usage examples. See [Kemppinen et al. 2022](https://gmao.gsfc.nasa.gov/pubs/docs/Kemppinen1447.pdf) for documentation of the approach. Below is a brief summary of the structure and usage of the package. More specific information about the optical property assumptions is provided in -the README.md in the `scripts` subdirectory, which also contains version-specific +the `README.md` in the `scripts` subdirectory, which also contains version-specific table generation scripts in an attempt to make this as turnkey as possible. The package consists of the following parts: @@ -42,6 +45,7 @@ The package consists of the following parts: - Mie code (pymiecoated/) - Main code (root directory), which can calculate single-scattering and bulk optical properties for both individual wavelengths and wavelength bands - Generalized spherical function expansion code (gsf/) +- Kernel generation code (root directory) ## Mie code @@ -137,7 +141,7 @@ External kernels (e.g. GRASP spheroids) have to be converted into a specific Net A tool is provided for converting kernels from GRASP-like format to the GEOSmie-compatible NetCDF file. ```bash -python runkernelconversion.py --filename data/kernelconversion/filename.json --dest /path/to/output/directory +./runkernelconversion.py --filename data/kernelconversion/filename.json --dest /path/to/output/directory ``` where filename.json is a parameter file that specifies various aspects on how the kernels should be read, and has to be updated if the incoming kernel format changes in virtually any way. Sample JSON files are provided for GRASP kernels (grasp.json) and GRASP-like Saito et al. kernels (saito.json). diff --git a/runkernelconversion.py b/runkernelconversion.py old mode 100644 new mode 100755 index ae0b402..a5e6eb3 --- a/runkernelconversion.py +++ b/runkernelconversion.py @@ -1,3 +1,13 @@ +#!/usr/bin/env python3.11 + +""" + Utility to create GEOSmie compatible netcdf kernel + kernel files from input GRASP-like text files. + Usage example: + runkernelconversion.py --filename data/kernelconversion/grasp.json + will produce an output file named "kernel-grasp-v1.1.3-integrated_V4.nc" + +""" import shutil import os from optparse import OptionParser diff --git a/scripts/README.md b/scripts/README.md index 35fe9b7..8debdfb 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -22,7 +22,7 @@ and complex refractive index). Some details are made explicit in Chin et al. 200 Colarco et al. 2010. Specific details are provided in the JSON files in the geosparticles sub-directory and additional information in Kemppinen et al. 2022. -### Carbonaceous Aerosols +### Carbonaceous Aerosols - BC = Black Carbon, OC = Organic Carbon, BR = Brown Carbon Following Chin et al. 2002 the particle size distributions are lognormal modes specified in terms of number mode median radius (in microns) with a given width and truncated at 0.3 micron radius (dry particle). Growth factors specify the ratio of wet-to-dry particle @@ -30,7 +30,9 @@ radius at the given RH. Refractive indices are given spectrally for the dry part and are volume weighted with water refractive index to give an effective refractive index for the Mie calculations. For each of the carbonaceous species there are two size modes: the first mode is hydrophobic (undergoes no growth with RH) and the second mode is -hydrophilic (grows with RH with specified growth factor). +hydrophilic (grows with RH with specified growth factor). Dry particle refractive indices +are from OPAC (soot00 for BC; waso00 for OC; waso00 is used for BR from wavelengths >= 550 nm +and follow Colarco et al. 2017 for shorter wavelengths). | Species | rnum [um] | sigma | Density [kg m-3] | Notes | | --- | --- | --- | --- | --- | @@ -38,16 +40,115 @@ hydrophilic (grows with RH with specified growth factor). | OC | 0.0212 | 2.20 | 1800 | oc.json | | BR | 0.0212 | 2.20 | 1800 | brc.json | -### Sulfate +### Sulfate - SU Following Chin et al. 2002 the particle size distributions are lognormal modes specified in terms of number mode median radius (in microns) with a given width and truncated at 0.3 micron radius (dry particle). Growth factors specify the ratio of wet-to-dry particle -radius at the given RH. Refractive indices are given spectrally for the dry particles -and are volume weighted with water refractive index to give an effective refractive index -for the Mie calculations. A single mode of sulfate is provided here. +radius at the given RH. Refractive indices are given spectrally for the dry particles using OPAC +(suso00) and are volume weighted with water refractive index to give an effective refractive index +for the Mie calculations. A single mode of sulfate is provided here (su.json). | Species | rnum [um] | sigma | Density [kg m-3] | Notes | | --- | --- | --- | --- | --- | | SU | 0.0695 | 2.03 | 1000 | su.json | +### Sea salt - SS +Following Colarco et al. 2010, sea salt aerosol optical properties are computed for each +of five size bins. The v2.0.0 implementation treats the bins as truncated bins with the +optical properties integrated across the bin. Growth factors are based on the Gerber [1986] +parameterization. Properties for the dry particle bins are given below and dry sea salt density +is assumed to be 2200 kg m-3. A sub-bin distribution is assumed across the bin following Gong [2003]. +Refractive indices are given spectrally for the dry particles using OPAC +(sscm00) and are volume weighted with water refractive index to give an effective refractive index +for the Mie calculations. + +| Bin | rMin [um] | rMax [um] | Notes | +| --- | --- | --- | --- | +| 1 | 0.03 | 0.1 | ss.json | +| 2 | 0.1 | 0.5 | ss.json | +| 3 | 0.5 | 1.5 | ss.json | +| 4 | 1.5 | 5.0 | ss.json | +| 5 | 5.0 | 10.0 | ss.json | + +### Nitrate - NI +Following Bian et al. 2017, nitrate aerosol optical properties are computed for each of three +size bins (ni.json). The bins are lognormal modes with a specified number mode radius (in microns) +and width (sigma) and are not truncated with sharp edges. +Hygroscopic growth factor is taken to be 1.06 * growth factor of sulfate, +following Fitzgerald 1975. Refractive indices are given spectrally for the dry particles after +Bian et al. 2017 and are volume weighted with water refractive index to give an effective +refractive index for the Mie calculations. + +| Bin | rNum [um] | sigma | density [kg m-3] | Notes | +| --- | --- | --- | --- | --- | +| 1 | 0.04455 | 2.03 | 1725 | ni.json | +| 2 | 0.6000 | 2.03 | 2200 | ni.json | +| 3 | 2.3316 | 2.0 | 2650 | ni.json | + +### Dust - DU +Dust is novel in that non-spherical optics are considered and Mie calculations are not used. +Optical properties are from the GRASP kernels assuming the spheroidal shape distribution of +Dubovik et al. 2006. Refractive indices are from Colarco et al. 2014, which are a combination +of observation-based shortwave values and OPAC values in the longwave. Five size bins are +considered, but properties are integrated across generally wider distributions than the bin +edges. + +| Bin | rMin [um] | rMax [um] | rNum [uM] | sigma | density [kg m-3] | Notes | +| --- | --- | --- | --- | --- | --- | --- | +| 1 | 0.1 | 1.0 | 0.5173 | 1.327 | 2500 | du-grasp_spheroid-lognormal.json | +| 2 | 1.0 | 1.8 | 1.031 | 1.284 | 2650 | du-grasp_spheroid-lognormal.json | +| 3 | 1.8 | 3.0 | 1.611 | 1.411 | 2650 | du-grasp_spheroid-lognormal.json | +| 4 | 3.0 | 6.0 | 1.198 | 2.028 | 2650 | du-grasp_spheroid-lognormal.json | +| 5 | 6.0 | 10.0 | 2.047 | 2.067 | 2650 | du-grasp_spheroid-lognormal.json | + +### Band Average Properties +A simple linear weighting of monochromatic properties is applied across the RRTMG bands (see `bandaverage.py`). + +Shortwave bands [cm-1] +| Index | lower | upper | +| --- | --- | --- | +| 1 | 2600 | 3250 | +| 2 | 3250 | 4000 | +| 3 | 4000 | 4650 | +| 4 | 4650 | 5150 | +| 5 | 5150 | 6150 | +| 6 | 6150 | 7700 | +| 7 | 7700 | 8050 | +| 8 | 8050 | 12850 | +| 9 | 12850 | 16000 | +| 10 | 16000 | 22650 | +| 11 | 22650 | 29000 | +| 12 | 29000 | 38000 | +| 13 | 38000 | 50000 | +| 14 | 820 | 2600 | + +Longwave bands [cm-1] +| Index | lower | upper | +| --- | --- | --- | +| 15 | 10 | 250 | +| 16 | 250 | 500 | +| 17 | 500 | 630 | +| 18 | 630 | 700 | +| 19 | 700 | 820 | +| 20 | 820 | 980 | +| 21 | 980 | 1080 | +| 22 | 1080 | 1180 | +| 23 | 1180 | 1390 | +| 24 | 1390 | 1480 | +| 25 | 1480 | 1800 | +| 26 | 1800 | 2080 | +| 27 | 2080 | 2250 | +| 28 | 2250 | 2380 | +| 29 | 2380 | 2600 | +| 30 | 2600 | 3250 | +### References +- Bian, H., Chin, M., Hauglustaine, D. A., Schulz, M., Myhre, G., Bauer, S. E., Lund, M. T., Karydis, V. A., Kucsera, T. L., Pan, X., Pozzer, A., Skeie, R. B., Steenrod, S. D., Sudo, K., Tsigaridis, K., Tsimpidi, A. P., and Tsyro, S. G.: Investigation of global particulate nitrate from the AeroCom phase III experiment, Atmos Chem Phys, 17, 12911–12940, https://doi.org/10.5194/acp-17-12911-2017, 2017. +- Chin, M., Ginoux, P., Kinne, S., Torres, O., Holben, B. N., Duncan, B. N., Martin, R. V., Logan, J. A., Higurashi, A., and Nakajima, T.: Tropospheric Aerosol Optical Thickness from the GOCART Model and Comparisons with Satellite and Sun Photometer Measurements, J Atmos Sci, 59, 461–483, https://doi.org/10.1175/1520-0469(2002)059<0461:taotft>2.0.co;2, 2002. +- Colarco, P., Silva, A. D., Chin, M., and Diehl, T.: Online simulations of global aerosol distributions in the NASA GEOS-4 model and comparisons to satellite and ground-based aerosol optical depth, J Geophys Res Atmospheres 1984 2012, 115, D10S07, https://doi.org/10.1029/2009jd012820, 2010. +- Colarco, P. R., Nowottnick, E. P., Randles, C. A., Yi, B., Yang, P., Kim, K.-M., Smith, J. A., and Bardeen, C. G.: Impact of radiatively interactive dust aerosols in the NASA GEOS-5 climate model: Sensitivity to dust particle shape and refractive index, J Geophys Res Atmospheres, 119, 753 786, https://doi.org/10.1002/2013jd020046, 2014. +- Colarco, P. R., Gassó, S., Ahn, C., Buchard, V., Silva, A. M. da, and Torres, O.: Simulation of the Ozone Monitoring Instrument aerosol index using the NASA Goddard Earth Observing System aerosol reanalysis products, Atmos Meas Tech, 10, 4121–4134, https://doi.org/10.5194/amt-10-4121-2017, 2017. +- Dubovik, O., Sinyuk, A., Lapyonok, T., Holben, B. N., Mishchenko, M., Yang, P., Eck, T. F., Volten, H., Muñoz, O., Veihelmann, B., Zande, W. J. van der, Leon, J.-F., Sorokin, M., and Slutsker, I.: Application of spheroid models to account for aerosol particle nonsphericity in remote sensing of desert dust, J Geophys Res Atmospheres 1984 2012, 111, https://doi.org/10.1029/2005jd006619, 2006. +- FITZGERALD, J.: APPROXIMATION FORMULAS FOR EQUILIBRIUM SIZE OF AN AEROSOL PARTICLE AS A FUNCTION OF ITS DRY SIZE AND COMPOSITION AND AMBIENT RELATIVE HUMIDITY, Journal Of Applied Meteorology, 14, 1044 1049, 1975. +- Gerber, H. E.: Relative-Humidity Parameterization of the Navy Aerosol Model (NAM), NRL Report 8956, 1 16, 1985. +- OPAC: Hess, M., Koepke, P., and Schult, I.: Optical Properties of Aerosols and Clouds: The Software Package OPAC, B Am Meteorol Soc, 79, 831–844, https://doi.org/10.1175/1520-0477(1998)079<0831:opoaac>2.0.co;2, 1998. From 27e621320e216ddd7d3574ddcdc50537959ddd67 Mon Sep 17 00:00:00 2001 From: Peter Colarco Date: Tue, 22 Apr 2025 17:13:22 -0400 Subject: [PATCH 11/54] prc: clean up references --- scripts/README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/README.md b/scripts/README.md index 8debdfb..cba328c 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -143,12 +143,12 @@ Longwave bands [cm-1] | 30 | 2600 | 3250 | ### References -- Bian, H., Chin, M., Hauglustaine, D. A., Schulz, M., Myhre, G., Bauer, S. E., Lund, M. T., Karydis, V. A., Kucsera, T. L., Pan, X., Pozzer, A., Skeie, R. B., Steenrod, S. D., Sudo, K., Tsigaridis, K., Tsimpidi, A. P., and Tsyro, S. G.: Investigation of global particulate nitrate from the AeroCom phase III experiment, Atmos Chem Phys, 17, 12911–12940, https://doi.org/10.5194/acp-17-12911-2017, 2017. -- Chin, M., Ginoux, P., Kinne, S., Torres, O., Holben, B. N., Duncan, B. N., Martin, R. V., Logan, J. A., Higurashi, A., and Nakajima, T.: Tropospheric Aerosol Optical Thickness from the GOCART Model and Comparisons with Satellite and Sun Photometer Measurements, J Atmos Sci, 59, 461–483, https://doi.org/10.1175/1520-0469(2002)059<0461:taotft>2.0.co;2, 2002. -- Colarco, P., Silva, A. D., Chin, M., and Diehl, T.: Online simulations of global aerosol distributions in the NASA GEOS-4 model and comparisons to satellite and ground-based aerosol optical depth, J Geophys Res Atmospheres 1984 2012, 115, D10S07, https://doi.org/10.1029/2009jd012820, 2010. -- Colarco, P. R., Nowottnick, E. P., Randles, C. A., Yi, B., Yang, P., Kim, K.-M., Smith, J. A., and Bardeen, C. G.: Impact of radiatively interactive dust aerosols in the NASA GEOS-5 climate model: Sensitivity to dust particle shape and refractive index, J Geophys Res Atmospheres, 119, 753 786, https://doi.org/10.1002/2013jd020046, 2014. -- Colarco, P. R., Gassó, S., Ahn, C., Buchard, V., Silva, A. M. da, and Torres, O.: Simulation of the Ozone Monitoring Instrument aerosol index using the NASA Goddard Earth Observing System aerosol reanalysis products, Atmos Meas Tech, 10, 4121–4134, https://doi.org/10.5194/amt-10-4121-2017, 2017. -- Dubovik, O., Sinyuk, A., Lapyonok, T., Holben, B. N., Mishchenko, M., Yang, P., Eck, T. F., Volten, H., Muñoz, O., Veihelmann, B., Zande, W. J. van der, Leon, J.-F., Sorokin, M., and Slutsker, I.: Application of spheroid models to account for aerosol particle nonsphericity in remote sensing of desert dust, J Geophys Res Atmospheres 1984 2012, 111, https://doi.org/10.1029/2005jd006619, 2006. -- FITZGERALD, J.: APPROXIMATION FORMULAS FOR EQUILIBRIUM SIZE OF AN AEROSOL PARTICLE AS A FUNCTION OF ITS DRY SIZE AND COMPOSITION AND AMBIENT RELATIVE HUMIDITY, Journal Of Applied Meteorology, 14, 1044 1049, 1975. +- Bian et al. 2017: https://doi.org/10.5194/acp-17-12911-2017 +- Chin et al. 2002: https://journals.ametsoc.org/view/journals/atsc/59/3/1520-0469_2002_059_0461_taotft_2.0.co_2.xml +- Colarco et al. 2010: https://doi.org/10.1029/2009jd012820 +- Colarco et al. 2014: https://doi.org/10.1002/2013jd020046 +- Colarco et al. 2017: https://doi.org/10.5194/amt-10-4121-2017 +- Dubovik et al. 2006: https://doi.org/10.1029/2005jd006619 +- Fitzgerald 1975: https://journals.ametsoc.org/view/journals/apme/14/6/1520-0450_1975_014_1044_afftes_2_0_co_2.xml - Gerber, H. E.: Relative-Humidity Parameterization of the Navy Aerosol Model (NAM), NRL Report 8956, 1 16, 1985. -- OPAC: Hess, M., Koepke, P., and Schult, I.: Optical Properties of Aerosols and Clouds: The Software Package OPAC, B Am Meteorol Soc, 79, 831–844, https://doi.org/10.1175/1520-0477(1998)079<0831:opoaac>2.0.co;2, 1998. +- OPAC: Hess et al. 1998: https://journals.ametsoc.org/view/journals/bams/79/5/1520-0477_1998_079_0831_opoaac_2_0_co_2.xml From 37fbfedb308b4d911413a78073fe92e1d6d064ec Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Mon, 23 Jun 2025 11:01:25 -0400 Subject: [PATCH 12/54] move config files to config folder --- {geosparticles => src/config/geosparticles}/bc.json | 0 {geosparticles => src/config/geosparticles}/brc.json | 0 .../config/geosparticles}/du-grasp_spheroid-lognormal.json | 0 .../config/geosparticles}/du-grasp_spheroid.json | 0 .../config/geosparticles}/du-grasp_spheroid_sphere.json | 0 {geosparticles => src/config/geosparticles}/du-mie.json | 0 .../config/geosparticles}/du-saito_hexahedra.json | 0 {geosparticles => src/config/geosparticles}/du.json | 0 .../config/geosparticles}/experimental/du-lognorm.json | 0 .../config/geosparticles}/experimental/du-mie.json | 0 .../config/geosparticles}/experimental/du-saito.json | 0 .../config/geosparticles}/experimental/du-sphere.json | 0 {geosparticles => src/config/geosparticles}/ni.json | 0 {geosparticles => src/config/geosparticles}/oc.json | 0 {geosparticles => src/config/geosparticles}/ss.json | 0 {geosparticles => src/config/geosparticles}/su.json | 0 16 files changed, 0 insertions(+), 0 deletions(-) rename {geosparticles => src/config/geosparticles}/bc.json (100%) rename {geosparticles => src/config/geosparticles}/brc.json (100%) rename {geosparticles => src/config/geosparticles}/du-grasp_spheroid-lognormal.json (100%) rename {geosparticles => src/config/geosparticles}/du-grasp_spheroid.json (100%) rename {geosparticles => src/config/geosparticles}/du-grasp_spheroid_sphere.json (100%) rename {geosparticles => src/config/geosparticles}/du-mie.json (100%) rename {geosparticles => src/config/geosparticles}/du-saito_hexahedra.json (100%) rename {geosparticles => src/config/geosparticles}/du.json (100%) rename {geosparticles => src/config/geosparticles}/experimental/du-lognorm.json (100%) rename {geosparticles => src/config/geosparticles}/experimental/du-mie.json (100%) rename {geosparticles => src/config/geosparticles}/experimental/du-saito.json (100%) rename {geosparticles => src/config/geosparticles}/experimental/du-sphere.json (100%) rename {geosparticles => src/config/geosparticles}/ni.json (100%) rename {geosparticles => src/config/geosparticles}/oc.json (100%) rename {geosparticles => src/config/geosparticles}/ss.json (100%) rename {geosparticles => src/config/geosparticles}/su.json (100%) diff --git a/geosparticles/bc.json b/src/config/geosparticles/bc.json similarity index 100% rename from geosparticles/bc.json rename to src/config/geosparticles/bc.json diff --git a/geosparticles/brc.json b/src/config/geosparticles/brc.json similarity index 100% rename from geosparticles/brc.json rename to src/config/geosparticles/brc.json diff --git a/geosparticles/du-grasp_spheroid-lognormal.json b/src/config/geosparticles/du-grasp_spheroid-lognormal.json similarity index 100% rename from geosparticles/du-grasp_spheroid-lognormal.json rename to src/config/geosparticles/du-grasp_spheroid-lognormal.json diff --git a/geosparticles/du-grasp_spheroid.json b/src/config/geosparticles/du-grasp_spheroid.json similarity index 100% rename from geosparticles/du-grasp_spheroid.json rename to src/config/geosparticles/du-grasp_spheroid.json diff --git a/geosparticles/du-grasp_spheroid_sphere.json b/src/config/geosparticles/du-grasp_spheroid_sphere.json similarity index 100% rename from geosparticles/du-grasp_spheroid_sphere.json rename to src/config/geosparticles/du-grasp_spheroid_sphere.json diff --git a/geosparticles/du-mie.json b/src/config/geosparticles/du-mie.json similarity index 100% rename from geosparticles/du-mie.json rename to src/config/geosparticles/du-mie.json diff --git a/geosparticles/du-saito_hexahedra.json b/src/config/geosparticles/du-saito_hexahedra.json similarity index 100% rename from geosparticles/du-saito_hexahedra.json rename to src/config/geosparticles/du-saito_hexahedra.json diff --git a/geosparticles/du.json b/src/config/geosparticles/du.json similarity index 100% rename from geosparticles/du.json rename to src/config/geosparticles/du.json diff --git a/geosparticles/experimental/du-lognorm.json b/src/config/geosparticles/experimental/du-lognorm.json similarity index 100% rename from geosparticles/experimental/du-lognorm.json rename to src/config/geosparticles/experimental/du-lognorm.json diff --git a/geosparticles/experimental/du-mie.json b/src/config/geosparticles/experimental/du-mie.json similarity index 100% rename from geosparticles/experimental/du-mie.json rename to src/config/geosparticles/experimental/du-mie.json diff --git a/geosparticles/experimental/du-saito.json b/src/config/geosparticles/experimental/du-saito.json similarity index 100% rename from geosparticles/experimental/du-saito.json rename to src/config/geosparticles/experimental/du-saito.json diff --git a/geosparticles/experimental/du-sphere.json b/src/config/geosparticles/experimental/du-sphere.json similarity index 100% rename from geosparticles/experimental/du-sphere.json rename to src/config/geosparticles/experimental/du-sphere.json diff --git a/geosparticles/ni.json b/src/config/geosparticles/ni.json similarity index 100% rename from geosparticles/ni.json rename to src/config/geosparticles/ni.json diff --git a/geosparticles/oc.json b/src/config/geosparticles/oc.json similarity index 100% rename from geosparticles/oc.json rename to src/config/geosparticles/oc.json diff --git a/geosparticles/ss.json b/src/config/geosparticles/ss.json similarity index 100% rename from geosparticles/ss.json rename to src/config/geosparticles/ss.json diff --git a/geosparticles/su.json b/src/config/geosparticles/su.json similarity index 100% rename from geosparticles/su.json rename to src/config/geosparticles/su.json From 846e83a678a3fd7841558ff6a321fff12c57bdce Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Mon, 23 Jun 2025 11:03:21 -0400 Subject: [PATCH 13/54] move utils to src --- {utils => src/utils}/eval_gsfun.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {utils => src/utils}/eval_gsfun.py (100%) diff --git a/utils/eval_gsfun.py b/src/utils/eval_gsfun.py similarity index 100% rename from utils/eval_gsfun.py rename to src/utils/eval_gsfun.py From 329cc838c2f32bfaaf4df247b9110c051dc7b227 Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Mon, 23 Jun 2025 11:16:08 -0400 Subject: [PATCH 14/54] ignore env and cmake directories --- .gitignore | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.gitignore b/.gitignore index c5329df..fc03a0e 100644 --- a/.gitignore +++ b/.gitignore @@ -147,6 +147,13 @@ venv/ ENV/ env.bak/ venv.bak/ +/env/ +/@env/ +/env@/ +/cmake/ +/@cmake/ +/cmake@/ +/.mepo/ # Spyder project settings .spyderproject From 63c67693c870c6ef772220fb277c591429a9fc09 Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Mon, 23 Jun 2025 11:17:05 -0400 Subject: [PATCH 15/54] ignore shared --- src/Shared/GMAO_Shared/.gitignore | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 src/Shared/GMAO_Shared/.gitignore diff --git a/src/Shared/GMAO_Shared/.gitignore b/src/Shared/GMAO_Shared/.gitignore new file mode 100644 index 0000000..fe8d620 --- /dev/null +++ b/src/Shared/GMAO_Shared/.gitignore @@ -0,0 +1,3 @@ +/GMAO_pyobs +/@GMAO_pyobs +/GMAO_pyobs@ From e1e97553279919a6f962aeb76f53e941c45fd735 Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Mon, 23 Jun 2025 11:17:56 -0400 Subject: [PATCH 16/54] move scripts to src --- {scripts => src/scripts}/README.md | 0 {scripts => src/scripts}/proc.v2.0.0.csh | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename {scripts => src/scripts}/README.md (100%) rename {scripts => src/scripts}/proc.v2.0.0.csh (100%) diff --git a/scripts/README.md b/src/scripts/README.md similarity index 100% rename from scripts/README.md rename to src/scripts/README.md diff --git a/scripts/proc.v2.0.0.csh b/src/scripts/proc.v2.0.0.csh similarity index 100% rename from scripts/proc.v2.0.0.csh rename to src/scripts/proc.v2.0.0.csh From e7c3b533254d5cb9f088a79490001fec8e074b2b Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Mon, 23 Jun 2025 11:18:58 -0400 Subject: [PATCH 17/54] move scripts to geosmie --- bandaverage.py => src/geosmie/bandaverage.py | 0 convertkernels.py => src/geosmie/convertkernels.py | 0 dointegration.py => src/geosmie/dointegration.py | 0 hydrophobic.py => src/geosmie/hydrophobic.py | 0 particleparams.py => src/geosmie/particleparams.py | 0 runbands.py => src/geosmie/runbands.py | 0 runkernelconversion.py => src/geosmie/runkernelconversion.py | 0 runoptics.py => src/geosmie/runoptics.py | 0 8 files changed, 0 insertions(+), 0 deletions(-) rename bandaverage.py => src/geosmie/bandaverage.py (100%) rename convertkernels.py => src/geosmie/convertkernels.py (100%) rename dointegration.py => src/geosmie/dointegration.py (100%) rename hydrophobic.py => src/geosmie/hydrophobic.py (100%) rename particleparams.py => src/geosmie/particleparams.py (100%) rename runbands.py => src/geosmie/runbands.py (100%) rename runkernelconversion.py => src/geosmie/runkernelconversion.py (100%) rename runoptics.py => src/geosmie/runoptics.py (100%) diff --git a/bandaverage.py b/src/geosmie/bandaverage.py similarity index 100% rename from bandaverage.py rename to src/geosmie/bandaverage.py diff --git a/convertkernels.py b/src/geosmie/convertkernels.py similarity index 100% rename from convertkernels.py rename to src/geosmie/convertkernels.py diff --git a/dointegration.py b/src/geosmie/dointegration.py similarity index 100% rename from dointegration.py rename to src/geosmie/dointegration.py diff --git a/hydrophobic.py b/src/geosmie/hydrophobic.py similarity index 100% rename from hydrophobic.py rename to src/geosmie/hydrophobic.py diff --git a/particleparams.py b/src/geosmie/particleparams.py similarity index 100% rename from particleparams.py rename to src/geosmie/particleparams.py diff --git a/runbands.py b/src/geosmie/runbands.py similarity index 100% rename from runbands.py rename to src/geosmie/runbands.py diff --git a/runkernelconversion.py b/src/geosmie/runkernelconversion.py similarity index 100% rename from runkernelconversion.py rename to src/geosmie/runkernelconversion.py diff --git a/runoptics.py b/src/geosmie/runoptics.py similarity index 100% rename from runoptics.py rename to src/geosmie/runoptics.py From 483cc4a060c2f44ef4bf961c199338a20dcaa33e Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Mon, 23 Jun 2025 11:19:31 -0400 Subject: [PATCH 18/54] move scripts to scripts --- .../scripts/generate_geos_optics.legacy.sh | 0 generate_geos_optics.sh => src/scripts/generate_geos_optics.sh | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename generate_geos_optics.legacy.sh => src/scripts/generate_geos_optics.legacy.sh (100%) rename generate_geos_optics.sh => src/scripts/generate_geos_optics.sh (100%) diff --git a/generate_geos_optics.legacy.sh b/src/scripts/generate_geos_optics.legacy.sh similarity index 100% rename from generate_geos_optics.legacy.sh rename to src/scripts/generate_geos_optics.legacy.sh diff --git a/generate_geos_optics.sh b/src/scripts/generate_geos_optics.sh similarity index 100% rename from generate_geos_optics.sh rename to src/scripts/generate_geos_optics.sh From 4a60c1a7f9b9d2c961d843dd42df13a0fed29b61 Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Mon, 23 Jun 2025 11:21:27 -0400 Subject: [PATCH 19/54] move api to src --- {api => src/api}/geosmie/__init__.py | 0 {api => src/api}/geosmie/mietable.py | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename {api => src/api}/geosmie/__init__.py (100%) rename {api => src/api}/geosmie/mietable.py (100%) diff --git a/api/geosmie/__init__.py b/src/api/geosmie/__init__.py similarity index 100% rename from api/geosmie/__init__.py rename to src/api/geosmie/__init__.py diff --git a/api/geosmie/mietable.py b/src/api/geosmie/mietable.py similarity index 100% rename from api/geosmie/mietable.py rename to src/api/geosmie/mietable.py From 273b46d8004f63db2db2312391f376a049b9c987 Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Mon, 23 Jun 2025 11:22:49 -0400 Subject: [PATCH 20/54] move api to shared and data to goesmie --- src/{ => Shared}/api/geosmie/__init__.py | 0 src/{ => Shared}/api/geosmie/mietable.py | 0 {data => src/geosmie/data}/kernel_shape_dist/preintegrated.txt | 0 {data => src/geosmie/data}/kernel_shape_dist/saito_hexahedra.txt | 0 {data => src/geosmie/data}/kernel_shape_dist/spheroid_fixed.txt | 0 .../geosmie/data}/kernel_shape_dist/spheroid_fixed_simple.txt | 0 {data => src/geosmie/data}/kernel_shape_dist/spheroid_sphere.txt | 0 .../geosmie/data}/kernel_shape_dist/spheroid_sphere_simple.txt | 0 {data => src/geosmie/data}/kernelconversion/dls.json | 0 {data => src/geosmie/data}/kernelconversion/grasp.json | 0 .../geosmie/data}/kernelconversion/saito_fullResolution.json | 0 .../geosmie/data}/kernelconversion/saito_oneDegResolution.json | 0 {data => src/geosmie/data}/miam00 | 0 {data => src/geosmie/data}/refrac.water.txt | 0 {data => src/geosmie/data}/ri-brc.wsv | 0 {data => src/geosmie/data}/ri-dust.wsv | 0 {data => src/geosmie/data}/ri-nitrate.wsv | 0 {data => src/geosmie/data}/soot00 | 0 {data => src/geosmie/data}/sscm00 | 0 {data => src/geosmie/data}/suso00 | 0 {data => src/geosmie/data}/waso00 | 0 21 files changed, 0 insertions(+), 0 deletions(-) rename src/{ => Shared}/api/geosmie/__init__.py (100%) rename src/{ => Shared}/api/geosmie/mietable.py (100%) rename {data => src/geosmie/data}/kernel_shape_dist/preintegrated.txt (100%) rename {data => src/geosmie/data}/kernel_shape_dist/saito_hexahedra.txt (100%) rename {data => src/geosmie/data}/kernel_shape_dist/spheroid_fixed.txt (100%) rename {data => src/geosmie/data}/kernel_shape_dist/spheroid_fixed_simple.txt (100%) rename {data => src/geosmie/data}/kernel_shape_dist/spheroid_sphere.txt (100%) rename {data => src/geosmie/data}/kernel_shape_dist/spheroid_sphere_simple.txt (100%) rename {data => src/geosmie/data}/kernelconversion/dls.json (100%) rename {data => src/geosmie/data}/kernelconversion/grasp.json (100%) rename {data => src/geosmie/data}/kernelconversion/saito_fullResolution.json (100%) rename {data => src/geosmie/data}/kernelconversion/saito_oneDegResolution.json (100%) rename {data => src/geosmie/data}/miam00 (100%) rename {data => src/geosmie/data}/refrac.water.txt (100%) rename {data => src/geosmie/data}/ri-brc.wsv (100%) rename {data => src/geosmie/data}/ri-dust.wsv (100%) rename {data => src/geosmie/data}/ri-nitrate.wsv (100%) rename {data => src/geosmie/data}/soot00 (100%) rename {data => src/geosmie/data}/sscm00 (100%) rename {data => src/geosmie/data}/suso00 (100%) rename {data => src/geosmie/data}/waso00 (100%) diff --git a/src/api/geosmie/__init__.py b/src/Shared/api/geosmie/__init__.py similarity index 100% rename from src/api/geosmie/__init__.py rename to src/Shared/api/geosmie/__init__.py diff --git a/src/api/geosmie/mietable.py b/src/Shared/api/geosmie/mietable.py similarity index 100% rename from src/api/geosmie/mietable.py rename to src/Shared/api/geosmie/mietable.py diff --git a/data/kernel_shape_dist/preintegrated.txt b/src/geosmie/data/kernel_shape_dist/preintegrated.txt similarity index 100% rename from data/kernel_shape_dist/preintegrated.txt rename to src/geosmie/data/kernel_shape_dist/preintegrated.txt diff --git a/data/kernel_shape_dist/saito_hexahedra.txt b/src/geosmie/data/kernel_shape_dist/saito_hexahedra.txt similarity index 100% rename from data/kernel_shape_dist/saito_hexahedra.txt rename to src/geosmie/data/kernel_shape_dist/saito_hexahedra.txt diff --git a/data/kernel_shape_dist/spheroid_fixed.txt b/src/geosmie/data/kernel_shape_dist/spheroid_fixed.txt similarity index 100% rename from data/kernel_shape_dist/spheroid_fixed.txt rename to src/geosmie/data/kernel_shape_dist/spheroid_fixed.txt diff --git a/data/kernel_shape_dist/spheroid_fixed_simple.txt b/src/geosmie/data/kernel_shape_dist/spheroid_fixed_simple.txt similarity index 100% rename from data/kernel_shape_dist/spheroid_fixed_simple.txt rename to src/geosmie/data/kernel_shape_dist/spheroid_fixed_simple.txt diff --git a/data/kernel_shape_dist/spheroid_sphere.txt b/src/geosmie/data/kernel_shape_dist/spheroid_sphere.txt similarity index 100% rename from data/kernel_shape_dist/spheroid_sphere.txt rename to src/geosmie/data/kernel_shape_dist/spheroid_sphere.txt diff --git a/data/kernel_shape_dist/spheroid_sphere_simple.txt b/src/geosmie/data/kernel_shape_dist/spheroid_sphere_simple.txt similarity index 100% rename from data/kernel_shape_dist/spheroid_sphere_simple.txt rename to src/geosmie/data/kernel_shape_dist/spheroid_sphere_simple.txt diff --git a/data/kernelconversion/dls.json b/src/geosmie/data/kernelconversion/dls.json similarity index 100% rename from data/kernelconversion/dls.json rename to src/geosmie/data/kernelconversion/dls.json diff --git a/data/kernelconversion/grasp.json b/src/geosmie/data/kernelconversion/grasp.json similarity index 100% rename from data/kernelconversion/grasp.json rename to src/geosmie/data/kernelconversion/grasp.json diff --git a/data/kernelconversion/saito_fullResolution.json b/src/geosmie/data/kernelconversion/saito_fullResolution.json similarity index 100% rename from data/kernelconversion/saito_fullResolution.json rename to src/geosmie/data/kernelconversion/saito_fullResolution.json diff --git a/data/kernelconversion/saito_oneDegResolution.json b/src/geosmie/data/kernelconversion/saito_oneDegResolution.json similarity index 100% rename from data/kernelconversion/saito_oneDegResolution.json rename to src/geosmie/data/kernelconversion/saito_oneDegResolution.json diff --git a/data/miam00 b/src/geosmie/data/miam00 similarity index 100% rename from data/miam00 rename to src/geosmie/data/miam00 diff --git a/data/refrac.water.txt b/src/geosmie/data/refrac.water.txt similarity index 100% rename from data/refrac.water.txt rename to src/geosmie/data/refrac.water.txt diff --git a/data/ri-brc.wsv b/src/geosmie/data/ri-brc.wsv similarity index 100% rename from data/ri-brc.wsv rename to src/geosmie/data/ri-brc.wsv diff --git a/data/ri-dust.wsv b/src/geosmie/data/ri-dust.wsv similarity index 100% rename from data/ri-dust.wsv rename to src/geosmie/data/ri-dust.wsv diff --git a/data/ri-nitrate.wsv b/src/geosmie/data/ri-nitrate.wsv similarity index 100% rename from data/ri-nitrate.wsv rename to src/geosmie/data/ri-nitrate.wsv diff --git a/data/soot00 b/src/geosmie/data/soot00 similarity index 100% rename from data/soot00 rename to src/geosmie/data/soot00 diff --git a/data/sscm00 b/src/geosmie/data/sscm00 similarity index 100% rename from data/sscm00 rename to src/geosmie/data/sscm00 diff --git a/data/suso00 b/src/geosmie/data/suso00 similarity index 100% rename from data/suso00 rename to src/geosmie/data/suso00 diff --git a/data/waso00 b/src/geosmie/data/waso00 similarity index 100% rename from data/waso00 rename to src/geosmie/data/waso00 From 700631811982123c0b57b565ac03aae1e368d7bf Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Mon, 23 Jun 2025 11:23:31 -0400 Subject: [PATCH 21/54] move gsf to src --- {gsf => src/gsf}/convertncdf.py | 0 {gsf => src/gsf}/howto_compile | 0 {gsf => src/gsf}/params.h | 0 {gsf => src/gsf}/rungsf.py | 0 {gsf => src/gsf}/spher_expan.f | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename {gsf => src/gsf}/convertncdf.py (100%) rename {gsf => src/gsf}/howto_compile (100%) rename {gsf => src/gsf}/params.h (100%) rename {gsf => src/gsf}/rungsf.py (100%) rename {gsf => src/gsf}/spher_expan.f (100%) diff --git a/gsf/convertncdf.py b/src/gsf/convertncdf.py similarity index 100% rename from gsf/convertncdf.py rename to src/gsf/convertncdf.py diff --git a/gsf/howto_compile b/src/gsf/howto_compile similarity index 100% rename from gsf/howto_compile rename to src/gsf/howto_compile diff --git a/gsf/params.h b/src/gsf/params.h similarity index 100% rename from gsf/params.h rename to src/gsf/params.h diff --git a/gsf/rungsf.py b/src/gsf/rungsf.py similarity index 100% rename from gsf/rungsf.py rename to src/gsf/rungsf.py diff --git a/gsf/spher_expan.f b/src/gsf/spher_expan.f similarity index 100% rename from gsf/spher_expan.f rename to src/gsf/spher_expan.f From 8f93333f547f3e4fcd566af0456316aa6db7c84a Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Mon, 23 Jun 2025 11:23:58 -0400 Subject: [PATCH 22/54] move namelists to geosmie --- {namelists => src/geosmie/namelists}/geos.txt | 0 {namelists => src/geosmie/namelists}/geos_bands.txt | 0 {namelists => src/geosmie/namelists}/geos_dust.txt | 0 {namelists => src/geosmie/namelists}/geos_dust_bands.legacy.txt | 0 {namelists => src/geosmie/namelists}/geos_dust_bands.txt | 0 {namelists => src/geosmie/namelists}/geos_nodust.txt | 0 {namelists => src/geosmie/namelists}/geos_nodust_bands.legacy.txt | 0 {namelists => src/geosmie/namelists}/geos_nodust_bands.txt | 0 8 files changed, 0 insertions(+), 0 deletions(-) rename {namelists => src/geosmie/namelists}/geos.txt (100%) rename {namelists => src/geosmie/namelists}/geos_bands.txt (100%) rename {namelists => src/geosmie/namelists}/geos_dust.txt (100%) rename {namelists => src/geosmie/namelists}/geos_dust_bands.legacy.txt (100%) rename {namelists => src/geosmie/namelists}/geos_dust_bands.txt (100%) rename {namelists => src/geosmie/namelists}/geos_nodust.txt (100%) rename {namelists => src/geosmie/namelists}/geos_nodust_bands.legacy.txt (100%) rename {namelists => src/geosmie/namelists}/geos_nodust_bands.txt (100%) diff --git a/namelists/geos.txt b/src/geosmie/namelists/geos.txt similarity index 100% rename from namelists/geos.txt rename to src/geosmie/namelists/geos.txt diff --git a/namelists/geos_bands.txt b/src/geosmie/namelists/geos_bands.txt similarity index 100% rename from namelists/geos_bands.txt rename to src/geosmie/namelists/geos_bands.txt diff --git a/namelists/geos_dust.txt b/src/geosmie/namelists/geos_dust.txt similarity index 100% rename from namelists/geos_dust.txt rename to src/geosmie/namelists/geos_dust.txt diff --git a/namelists/geos_dust_bands.legacy.txt b/src/geosmie/namelists/geos_dust_bands.legacy.txt similarity index 100% rename from namelists/geos_dust_bands.legacy.txt rename to src/geosmie/namelists/geos_dust_bands.legacy.txt diff --git a/namelists/geos_dust_bands.txt b/src/geosmie/namelists/geos_dust_bands.txt similarity index 100% rename from namelists/geos_dust_bands.txt rename to src/geosmie/namelists/geos_dust_bands.txt diff --git a/namelists/geos_nodust.txt b/src/geosmie/namelists/geos_nodust.txt similarity index 100% rename from namelists/geos_nodust.txt rename to src/geosmie/namelists/geos_nodust.txt diff --git a/namelists/geos_nodust_bands.legacy.txt b/src/geosmie/namelists/geos_nodust_bands.legacy.txt similarity index 100% rename from namelists/geos_nodust_bands.legacy.txt rename to src/geosmie/namelists/geos_nodust_bands.legacy.txt diff --git a/namelists/geos_nodust_bands.txt b/src/geosmie/namelists/geos_nodust_bands.txt similarity index 100% rename from namelists/geos_nodust_bands.txt rename to src/geosmie/namelists/geos_nodust_bands.txt From 46e419870e67f3ee28c896643f2adfb10e21f025 Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Mon, 23 Jun 2025 11:25:44 -0400 Subject: [PATCH 23/54] move pymiecoated to src --- readme_json.txt => src/config/geosparticles/readme_json.txt | 0 compile_all.sh => src/gsf/compile_all.sh | 0 {pymiecoated => src/pymiecoated}/MANIFEST | 0 {pymiecoated => src/pymiecoated}/MANIFEST.in | 0 {pymiecoated => src/pymiecoated}/README | 0 {pymiecoated => src/pymiecoated}/README.md | 0 {pymiecoated => src/pymiecoated}/pymiecoated/__init__.py | 0 {pymiecoated => src/pymiecoated}/pymiecoated/demos/__init__.py | 0 {pymiecoated => src/pymiecoated}/pymiecoated/demos/mie_demos.py | 0 {pymiecoated => src/pymiecoated}/pymiecoated/mie_aux.py | 0 {pymiecoated => src/pymiecoated}/pymiecoated/mie_coated.py | 0 {pymiecoated => src/pymiecoated}/pymiecoated/mie_coeffs.py | 0 {pymiecoated => src/pymiecoated}/pymiecoated/mie_props.py | 0 {pymiecoated => src/pymiecoated}/pymiecoated/test/__init__.py | 0 {pymiecoated => src/pymiecoated}/pymiecoated/test/test_mie.py | 0 {pymiecoated => src/pymiecoated}/setup.py | 0 16 files changed, 0 insertions(+), 0 deletions(-) rename readme_json.txt => src/config/geosparticles/readme_json.txt (100%) rename compile_all.sh => src/gsf/compile_all.sh (100%) rename {pymiecoated => src/pymiecoated}/MANIFEST (100%) rename {pymiecoated => src/pymiecoated}/MANIFEST.in (100%) rename {pymiecoated => src/pymiecoated}/README (100%) rename {pymiecoated => src/pymiecoated}/README.md (100%) rename {pymiecoated => src/pymiecoated}/pymiecoated/__init__.py (100%) rename {pymiecoated => src/pymiecoated}/pymiecoated/demos/__init__.py (100%) rename {pymiecoated => src/pymiecoated}/pymiecoated/demos/mie_demos.py (100%) rename {pymiecoated => src/pymiecoated}/pymiecoated/mie_aux.py (100%) rename {pymiecoated => src/pymiecoated}/pymiecoated/mie_coated.py (100%) rename {pymiecoated => src/pymiecoated}/pymiecoated/mie_coeffs.py (100%) rename {pymiecoated => src/pymiecoated}/pymiecoated/mie_props.py (100%) rename {pymiecoated => src/pymiecoated}/pymiecoated/test/__init__.py (100%) rename {pymiecoated => src/pymiecoated}/pymiecoated/test/test_mie.py (100%) rename {pymiecoated => src/pymiecoated}/setup.py (100%) diff --git a/readme_json.txt b/src/config/geosparticles/readme_json.txt similarity index 100% rename from readme_json.txt rename to src/config/geosparticles/readme_json.txt diff --git a/compile_all.sh b/src/gsf/compile_all.sh similarity index 100% rename from compile_all.sh rename to src/gsf/compile_all.sh diff --git a/pymiecoated/MANIFEST b/src/pymiecoated/MANIFEST similarity index 100% rename from pymiecoated/MANIFEST rename to src/pymiecoated/MANIFEST diff --git a/pymiecoated/MANIFEST.in b/src/pymiecoated/MANIFEST.in similarity index 100% rename from pymiecoated/MANIFEST.in rename to src/pymiecoated/MANIFEST.in diff --git a/pymiecoated/README b/src/pymiecoated/README similarity index 100% rename from pymiecoated/README rename to src/pymiecoated/README diff --git a/pymiecoated/README.md b/src/pymiecoated/README.md similarity index 100% rename from pymiecoated/README.md rename to src/pymiecoated/README.md diff --git a/pymiecoated/pymiecoated/__init__.py b/src/pymiecoated/pymiecoated/__init__.py similarity index 100% rename from pymiecoated/pymiecoated/__init__.py rename to src/pymiecoated/pymiecoated/__init__.py diff --git a/pymiecoated/pymiecoated/demos/__init__.py b/src/pymiecoated/pymiecoated/demos/__init__.py similarity index 100% rename from pymiecoated/pymiecoated/demos/__init__.py rename to src/pymiecoated/pymiecoated/demos/__init__.py diff --git a/pymiecoated/pymiecoated/demos/mie_demos.py b/src/pymiecoated/pymiecoated/demos/mie_demos.py similarity index 100% rename from pymiecoated/pymiecoated/demos/mie_demos.py rename to src/pymiecoated/pymiecoated/demos/mie_demos.py diff --git a/pymiecoated/pymiecoated/mie_aux.py b/src/pymiecoated/pymiecoated/mie_aux.py similarity index 100% rename from pymiecoated/pymiecoated/mie_aux.py rename to src/pymiecoated/pymiecoated/mie_aux.py diff --git a/pymiecoated/pymiecoated/mie_coated.py b/src/pymiecoated/pymiecoated/mie_coated.py similarity index 100% rename from pymiecoated/pymiecoated/mie_coated.py rename to src/pymiecoated/pymiecoated/mie_coated.py diff --git a/pymiecoated/pymiecoated/mie_coeffs.py b/src/pymiecoated/pymiecoated/mie_coeffs.py similarity index 100% rename from pymiecoated/pymiecoated/mie_coeffs.py rename to src/pymiecoated/pymiecoated/mie_coeffs.py diff --git a/pymiecoated/pymiecoated/mie_props.py b/src/pymiecoated/pymiecoated/mie_props.py similarity index 100% rename from pymiecoated/pymiecoated/mie_props.py rename to src/pymiecoated/pymiecoated/mie_props.py diff --git a/pymiecoated/pymiecoated/test/__init__.py b/src/pymiecoated/pymiecoated/test/__init__.py similarity index 100% rename from pymiecoated/pymiecoated/test/__init__.py rename to src/pymiecoated/pymiecoated/test/__init__.py diff --git a/pymiecoated/pymiecoated/test/test_mie.py b/src/pymiecoated/pymiecoated/test/test_mie.py similarity index 100% rename from pymiecoated/pymiecoated/test/test_mie.py rename to src/pymiecoated/pymiecoated/test/test_mie.py diff --git a/pymiecoated/setup.py b/src/pymiecoated/setup.py similarity index 100% rename from pymiecoated/setup.py rename to src/pymiecoated/setup.py From 8654178b9dc579463044dc3a142ff2c6e48cc036 Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Tue, 24 Jun 2025 09:27:53 -0400 Subject: [PATCH 24/54] remove references to pyobs --- CMakeLists.txt | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e26eb3e..e63774d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Top cmake rules for GMAOpyobs +# Top cmake rules for GEOSmie # # Boiler plate preamble @@ -46,7 +46,6 @@ if (NOT CMAKE_BUILD_TYPE) include (esma) - set (PYOBS_STANDALONE TRUE) endif () ecbuild_declare_project() @@ -75,8 +74,3 @@ if (NOT CMAKE_BUILD_TYPE) DESTINATION ${CMAKE_INSTALL_PREFIX} ) -# Adds ability to tar source -# -------------------------- - if (PYOBS_STANDALONE) - include(esma_cpack OPTIONAL) - endif () From b0d76cf7064013159c1b26e3671ecbd857d6b8b9 Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Tue, 24 Jun 2025 09:33:33 -0400 Subject: [PATCH 25/54] add a cmakeit script --- cmake_it | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 cmake_it diff --git a/cmake_it b/cmake_it new file mode 100755 index 0000000..c0e6b69 --- /dev/null +++ b/cmake_it @@ -0,0 +1,11 @@ +#!/bin/csh -f +# +# Run cmake with reasonable defaults. Why make the user do all these steps? +# + +source env@/g5_modules # to be sure +mkdir -p build +cd build +cmake .. -DBASEDIR=$BASEDIR/`uname -s` \ + -DCMAKE_Fortran_COMPILER=ifort \ + -DCMAKE_INSTALL_PREFIX=../install From 7d1c0cc4afdd09560dfd76573caf63cb5a8cf3b1 Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Tue, 24 Jun 2025 09:33:54 -0400 Subject: [PATCH 26/54] add the config directory to cmake --- src/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9aa07dd..4e0324b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1 +1,2 @@ add_subdirectory (Shared) +add_subdirectory(config) From ac7dde2ce38e9f8d02fb1cd868a8865748c9640e Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Tue, 24 Jun 2025 09:34:16 -0400 Subject: [PATCH 27/54] add a cmakelists for config directory --- src/config/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/config/CMakeLists.txt diff --git a/src/config/CMakeLists.txt b/src/config/CMakeLists.txt new file mode 100644 index 0000000..2574227 --- /dev/null +++ b/src/config/CMakeLists.txt @@ -0,0 +1 @@ +install(DIRECTORY geosparticles DESTINATION etc) From f3a5fd9319b1bc7355d14602d43b3f6ac096dd88 Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Tue, 24 Jun 2025 09:37:01 -0400 Subject: [PATCH 28/54] install utils in bin --- src/CMakeLists.txt | 1 + src/utils/CMakeLists.txt | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 src/utils/CMakeLists.txt diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4e0324b..9fd7874 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,2 +1,3 @@ add_subdirectory (Shared) add_subdirectory(config) +add_subdirectory(utils) diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt new file mode 100644 index 0000000..eeeac4e --- /dev/null +++ b/src/utils/CMakeLists.txt @@ -0,0 +1,7 @@ +# +# Cmake fules for utils +# + +# Python executables +# ------------------ + install(PROGRAMS eval_gsfun.py DESTINATION bin) From 03e25e52bf8de042bd7e10696cdca3b6d98833c0 Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Tue, 24 Jun 2025 09:39:47 -0400 Subject: [PATCH 29/54] install scripts --- src/CMakeLists.txt | 1 + src/scripts/CMakeLists.txt | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 src/scripts/CMakeLists.txt diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9fd7874..4ddaa6f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,3 +1,4 @@ add_subdirectory (Shared) add_subdirectory(config) add_subdirectory(utils) +add_subdirectory(scripts) diff --git a/src/scripts/CMakeLists.txt b/src/scripts/CMakeLists.txt new file mode 100644 index 0000000..b8421f7 --- /dev/null +++ b/src/scripts/CMakeLists.txt @@ -0,0 +1,8 @@ +# +# Cmake fules for scipts +# + +# Install scripts +# ------------------ + file(GLOB scripts *sh) + install(PROGRAMS ${scripts} DESTINATION bin) From 939fa66fa5ce999cdc58e1442f90eb9068d45a28 Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Tue, 24 Jun 2025 09:48:11 -0400 Subject: [PATCH 30/54] install pymiecoated package --- src/CMakeLists.txt | 1 + src/pymiecoated/CMakeLists.txt | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 src/pymiecoated/CMakeLists.txt diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4ddaa6f..a3587be 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,3 +2,4 @@ add_subdirectory (Shared) add_subdirectory(config) add_subdirectory(utils) add_subdirectory(scripts) +add_subdirectory(pymiecoated) diff --git a/src/pymiecoated/CMakeLists.txt b/src/pymiecoated/CMakeLists.txt new file mode 100644 index 0000000..10e92c7 --- /dev/null +++ b/src/pymiecoated/CMakeLists.txt @@ -0,0 +1,8 @@ +# +# Cmake rules for pymiecoated +# + +# Install pymiecoated package +# ---------------------------- + install(DIRECTORY pymiecoated DESTINATION lib/Python) + From e9ab01136902240a7ed3e7a272f0a5b159a6a3ab Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Tue, 24 Jun 2025 11:02:48 -0400 Subject: [PATCH 31/54] install geosmie and gsf --- src/CMakeLists.txt | 2 ++ src/geosmie/CMakeLists.txt | 10 ++++++++++ src/gsf/CMakeLists.txt | 18 ++++++++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 src/geosmie/CMakeLists.txt create mode 100644 src/gsf/CMakeLists.txt diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a3587be..411c722 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -3,3 +3,5 @@ add_subdirectory(config) add_subdirectory(utils) add_subdirectory(scripts) add_subdirectory(pymiecoated) +add_subdirectory(geosmie) +add_subdirectory(gsf) diff --git a/src/geosmie/CMakeLists.txt b/src/geosmie/CMakeLists.txt new file mode 100644 index 0000000..353adeb --- /dev/null +++ b/src/geosmie/CMakeLists.txt @@ -0,0 +1,10 @@ +# +# Cmake rules for geosmie +# + + esma_set_this() + file(GLOB scripts *.py) + install(PROGRAMS ${scripts} DESTINATION bin/${this}) + + install(DIRECTORY data DESTINATION bin/${this}) + install(DIRECTORY namelists DESTINATION bin/${this}) diff --git a/src/gsf/CMakeLists.txt b/src/gsf/CMakeLists.txt new file mode 100644 index 0000000..67e7d11 --- /dev/null +++ b/src/gsf/CMakeLists.txt @@ -0,0 +1,18 @@ +# +# Cmake rules for gsf +# + + esma_set_this() + file(GLOB scripts *.py) + install(PROGRAMS ${scripts} DESTINATION bin/${this}) + +ecbuild_add_executable ( + TARGET spher_expan.x + SOURCES spher_expan.f params.h + NOINSTALL + ) + +install ( + TARGETS spher_expan.x + DESTINATION bin/${this} + ) From a1e51c6e657df0f2e257c3947ff0696f73fb4028 Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Tue, 24 Jun 2025 11:03:53 -0400 Subject: [PATCH 32/54] remove reference to a.out --- src/gsf/convertncdf.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gsf/convertncdf.py b/src/gsf/convertncdf.py index f37c29b..59667cd 100755 --- a/src/gsf/convertncdf.py +++ b/src/gsf/convertncdf.py @@ -185,7 +185,7 @@ def convertData(ncdf, mode, ice, whichproc, radind, rhi, lami, rhop0, num_gauss, # write the temp file tempfn = 'tempfile%d.txt'%whichproc np.savetxt(tempfn, allvals.T) - os.system('./a.out %s > /dev/null'%tempfn) + os.system('./spher_expan.x %s > /dev/null'%tempfn) newdata = np.loadtxt('%s.expan_coeff'%tempfn, skiprows=1, unpack=True) elif mode == 'legendre': gpoints, gweights = leggauss(num_gauss) @@ -215,7 +215,7 @@ def convertData(ncdf, mode, ice, whichproc, radind, rhi, lami, rhop0, num_gauss, # write the temp file tempfn = 'tempfile%d.txt'%whichproc np.savetxt(tempfn, allvals.T) - os.system('./a.out %s > /dev/null'%tempfn) + os.system('./spher_expan.x %s > /dev/null'%tempfn) newdata = np.loadtxt('%s.expan_coeff'%tempfn, skiprows=1, unpack=True) if ice: # for ice we have to calculate extra variables @@ -291,7 +291,7 @@ def convertData(ncdf, mode, ice, whichproc, radind, rhi, lami, rhop0, num_gauss, # write the temp file tempfn = 'tempfile%d.txt'%whichproc np.savetxt(tempfn, allvals.T) - os.system('./a.out %s > /dev/null'%tempfn) + os.system('./spher_expan.x %s > /dev/null'%tempfn) newdata = np.loadtxt('%s.expan_coeff'%tempfn, skiprows=1, unpack=True) return newdata, linvals From 4e666afbb736e0291adf40ed617bec65168195f5 Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Tue, 24 Jun 2025 11:04:53 -0400 Subject: [PATCH 33/54] remove reference to a.out --- src/gsf/compile_all.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gsf/compile_all.sh b/src/gsf/compile_all.sh index 2b919ed..bc487ab 100755 --- a/src/gsf/compile_all.sh +++ b/src/gsf/compile_all.sh @@ -1,2 +1,2 @@ # compile gsf -gfortran -o gsf/a.out gsf/spher_expan.f +gfortran -o gsf/spher_expan.x gsf/spher_expan.f From daff7d463eedc91b81c3cd5cf01bccd59246cfff Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Tue, 24 Jun 2025 16:53:21 -0400 Subject: [PATCH 34/54] create geosmie_setup --- src/geosmie/geosmie_run.j | 31 +++++++ src/geosmie/geosmie_setup.py | 169 +++++++++++++++++++++++++++++++++++ 2 files changed, 200 insertions(+) create mode 100755 src/geosmie/geosmie_run.j create mode 100755 src/geosmie/geosmie_setup.py diff --git a/src/geosmie/geosmie_run.j b/src/geosmie/geosmie_run.j new file mode 100755 index 0000000..919894d --- /dev/null +++ b/src/geosmie/geosmie_run.j @@ -0,0 +1,31 @@ +#!/bin/csh -f + +####################################################################### +# Batch Parameters for Run Job +####################################################################### + +#SBATCH -J geosmie +#SBATCH --nodes=1 +#SBATCH --constraint=mil +#SBATCH --time=01:00:00 +#SBATCH -A @GROUPID +#SBATCH -o output_geosaqcgan-%j.log +#SBATCH --mail-type=BEGIN +#SBATCH --mail-type=END +#SBATCH --qos=debug +####################################################################### +# Run GEOS implementation of NASA-AQcGAN to test running a forecast +####################################################################### +# Architecture Specific Environment Variables +####################################################################### + +setenv SRC_DIR @SRCDIR +setenv PYTHONPATH ${SRC_DIR}/install/lib/Python + +source $SRC_DIR/env@/g5_modules + +####################################################################### +# Run the GEOSMIE code +####################################################################### + +./runoptics.py --name path/to/file.json diff --git a/src/geosmie/geosmie_setup.py b/src/geosmie/geosmie_setup.py new file mode 100755 index 0000000..5677e49 --- /dev/null +++ b/src/geosmie/geosmie_setup.py @@ -0,0 +1,169 @@ +#!/usr/bin/env python + +""" + This script is expected to be run from the GEOSAQcGAN/install/bin folder. + It assumes that the template file geosmie_run.j is available in the folder. + + The script asks the user to provide: + - an experiment name (exp_name) + - the group id (group_id), i.e., the NCCS sponsor code to be used in SLURM. + + It will then create an experiment directory that has a self-contained and ready + to use SLURM script geosmie_run.j. +""" + +from pathlib import Path +import sys +import os +import subprocess +import shutil +import glob + +def print_message(): + mssg = """ + --------------------------------------------------------------------------------- + This setup script creates a self-contained experiment directory to run + geosmie. + + The script is interactive and asks the user to provide: + + - an experiment name (exp_name) + - the group id (group_id), i.e., the NCCS sponsor code to be used in SLURM. + + It will then create an experiment directory that has a self-contained and ready + to use SLURM script geosmis_run.j. + --------------------------------------------------------------------------------- + """ + print(mssg) + +def search_reaplace_in_file(loc_filename: str, + target_dir: Path, + dict_words: dict) -> None: + """ + Take a file template to search and replace collection of words. + The new file (with the same name) will be created in the target directory. + + Parameters + ---------- + loc_filename : str + Local template file name. + target_dir : Path + Target directory where the new file will be created. + dict_words : dict + Dictionary where the keys are old words and the corresponding values + are the new words. + """ + new_filename = target_dir / loc_filename + shutil.copy(loc_filename, new_filename) + + try: + with open(new_filename, 'r') as fid: + file_content = fid.read() + + for key in dict_words: + file_content = file_content.replace(key, dict_words[key]) + print(f"Successfully replaced '{key}' with '{dict_words[key]}' in '{new_filename}'.") + + with open(new_filename, 'w') as file: + file.write(file_content) + + except FileNotFoundError: + print(f"Error: File '{new_filename}' not found.") + except Exception as e: + print(f"An error occurred: {e}") + +def ignore_top_level(dir, files): + # Ignore the source directory itself + if dir == source_directory: + return [source_directory] # Return a list containing the source directory name + return [] # Don't ignore anything else + + +def create_experiment_directory(): + + # Get the current directory + # Will be in the form FULL_PATH/GEOSmie/install/bin + current_directory = Path.cwd() + + # Determine the source code main directory + # Will be FULL_PATH/GEOSmie + source_directory = current_directory.parent.parent.parent + + reference_directory = source_directory.parent + + # Obtain the experiment name + experiment_name = input("Provide the experiment name (one word): ") + experiment_name = experiment_name.strip() + + if not experiment_name: + print("You need to provide and experiment name") + sys.exit() + + if len(experiment_name.split()) > 1: + print(f"The experiment name ({experiment_name}) should be in one word.") + sys.exit() + + # Create the experiment directory + + experiment_directory = reference_directory / experiment_name + print(f"The following experiment directory will be created: \n\n\t {experiment_directory}") + print() + + experiment_directory.mkdir(parents=True, exist_ok=True) + + # Copy the geosparticles configuration files to the experiment directory. + config_filepath = current_directory.parent.parent / "etc/geosparticles" + shutil.copytree(config_filepath, experiment_directory / config_filepath.name,dirs_exist_ok=True) + + # Copy geosmie scripts to the experiment directory + config_filepath = current_directory.parent / "geosmie/*" + for p in glob.glob(str(config_filepath)): + if os.path.isfile(p): + shutil.copy(p, experiment_directory) + elif os.path.isdir(p): + shutil.copytree(p, experiment_directory / os.path.basename(p),dirs_exist_ok=True) + + + # Get the sponsor code id + + result = subprocess.run(["groups"], shell=True, capture_output=True, text=True) + + groups = result.stdout.strip().split() + + print(f"The list of available group ids is: \n\n\t {result.stdout.strip()}") + print() + my_group = input(f"Provide the group id do you want to use (default: {groups[0]}): ") + my_group = my_group.strip() + + if not my_group: + my_group = groups[0] + + print() + print(f"Your group is is: {my_group}") + print() + + if my_group not in groups: + print(f"You selected and invalid group.") + print(f"The group {groups[0]} will be used.") + print(f"You can change the group id in the SLURM script available in the experiment directory") + print() + + loc_filename = "geosmie_run.j" + target_dir = experiment_directory + dict_words = {"@SRCDIR": str(source_directory), "@GROUPID": my_group} + search_reaplace_in_file(loc_filename, target_dir, dict_words) + + print() + print("-"*70) + print(f"The experiment directory was created: \n\n\t {experiment_directory}") + print() + print(f"Go to the folder and if necessary edit the file {loc_filename}.") + print() + print("From the experiment directory, issue the command: ") + print(f" sbatch {loc_filename}") + print("-"*70) + print() + +if __name__ == "__main__": + print_message() + create_experiment_directory() From 63a28c8478260bfdfb459a29f6d53114a4491c43 Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Tue, 24 Jun 2025 16:53:40 -0400 Subject: [PATCH 35/54] add slurm script to cmake --- src/geosmie/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/geosmie/CMakeLists.txt b/src/geosmie/CMakeLists.txt index 353adeb..64e7ac1 100644 --- a/src/geosmie/CMakeLists.txt +++ b/src/geosmie/CMakeLists.txt @@ -5,6 +5,7 @@ esma_set_this() file(GLOB scripts *.py) install(PROGRAMS ${scripts} DESTINATION bin/${this}) + install(PROGRAMS geosmie_run.j DESTINATION bin/${this}) install(DIRECTORY data DESTINATION bin/${this}) install(DIRECTORY namelists DESTINATION bin/${this}) From ec8c1b4695bbb0b66ceb0fb41b636ac25620ea1d Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Tue, 24 Jun 2025 17:03:39 -0400 Subject: [PATCH 36/54] change slurm file name --- src/geosmie/{geosmie_run.j => geosmie_runoptics.j} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/geosmie/{geosmie_run.j => geosmie_runoptics.j} (100%) diff --git a/src/geosmie/geosmie_run.j b/src/geosmie/geosmie_runoptics.j similarity index 100% rename from src/geosmie/geosmie_run.j rename to src/geosmie/geosmie_runoptics.j From c273810cd148adf04d9b17d06d0718e0b1ddfc0f Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Tue, 24 Jun 2025 17:03:53 -0400 Subject: [PATCH 37/54] add some comments --- src/geosmie/geosmie_runoptics.j | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/geosmie/geosmie_runoptics.j b/src/geosmie/geosmie_runoptics.j index 919894d..d18e4c9 100755 --- a/src/geosmie/geosmie_runoptics.j +++ b/src/geosmie/geosmie_runoptics.j @@ -26,6 +26,13 @@ source $SRC_DIR/env@/g5_modules ####################################################################### # Run the GEOSMIE code +# To calculate single-scattering properties at individual wavelengths +# Where file.json defines all of the parameters of the calculation. +# ".json" can be omitted from the runoptics.py command as a convenience. +# See JSON examples under geosparticles/ for current GEOS aerosol particles. + ####################################################################### ./runoptics.py --name path/to/file.json + + From f04c85a32ffc1b591d93d3d9e24e3a6804e3799a Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Tue, 24 Jun 2025 17:08:53 -0400 Subject: [PATCH 38/54] add runbands --- src/geosmie/CMakeLists.txt | 3 ++- src/geosmie/geosmie_runbands.j | 34 ++++++++++++++++++++++++++++++++++ src/geosmie/geosmie_setup.py | 13 ++++++++----- 3 files changed, 44 insertions(+), 6 deletions(-) create mode 100755 src/geosmie/geosmie_runbands.j diff --git a/src/geosmie/CMakeLists.txt b/src/geosmie/CMakeLists.txt index 64e7ac1..1db7068 100644 --- a/src/geosmie/CMakeLists.txt +++ b/src/geosmie/CMakeLists.txt @@ -5,7 +5,8 @@ esma_set_this() file(GLOB scripts *.py) install(PROGRAMS ${scripts} DESTINATION bin/${this}) - install(PROGRAMS geosmie_run.j DESTINATION bin/${this}) + file(GLOB scripts *.j) + install(PROGRAMS ${scripts} DESTINATION bin/${this}) install(DIRECTORY data DESTINATION bin/${this}) install(DIRECTORY namelists DESTINATION bin/${this}) diff --git a/src/geosmie/geosmie_runbands.j b/src/geosmie/geosmie_runbands.j new file mode 100755 index 0000000..45c6af5 --- /dev/null +++ b/src/geosmie/geosmie_runbands.j @@ -0,0 +1,34 @@ +#!/bin/csh -f + +####################################################################### +# Batch Parameters for Run Job +####################################################################### + +#SBATCH -J geosmie +#SBATCH --nodes=1 +#SBATCH --constraint=mil +#SBATCH --time=01:00:00 +#SBATCH -A @GROUPID +#SBATCH -o output_geosaqcgan-%j.log +#SBATCH --mail-type=BEGIN +#SBATCH --mail-type=END +#SBATCH --qos=debug +####################################################################### +# Run GEOS implementation of NASA-AQcGAN to test running a forecast +####################################################################### +# Architecture Specific Environment Variables +####################################################################### + +setenv SRC_DIR @SRCDIR +setenv PYTHONPATH ${SRC_DIR}/install/lib/Python + +source $SRC_DIR/env@/g5_modules + +####################################################################### +# Run the GEOSMIE code +# To calculate single-scattering properties at wavelength bands +# filename.nc should be an output file from runoptics.py +####################################################################### + +./runbands.py --filename filename.nc + diff --git a/src/geosmie/geosmie_setup.py b/src/geosmie/geosmie_setup.py index 5677e49..47da03a 100755 --- a/src/geosmie/geosmie_setup.py +++ b/src/geosmie/geosmie_setup.py @@ -148,19 +148,22 @@ def create_experiment_directory(): print(f"You can change the group id in the SLURM script available in the experiment directory") print() - loc_filename = "geosmie_run.j" + loc_filename = "geosmie_runoptics.j" target_dir = experiment_directory dict_words = {"@SRCDIR": str(source_directory), "@GROUPID": my_group} search_reaplace_in_file(loc_filename, target_dir, dict_words) + loc_filename2 = "geosmie_runbands.j" + target_dir = experiment_directory + dict_words = {"@SRCDIR": str(source_directory), "@GROUPID": my_group} + search_reaplace_in_file(loc_filename2, target_dir, dict_words) + + print() print("-"*70) print(f"The experiment directory was created: \n\n\t {experiment_directory}") print() - print(f"Go to the folder and if necessary edit the file {loc_filename}.") - print() - print("From the experiment directory, issue the command: ") - print(f" sbatch {loc_filename}") + print(f"Go to the folder and if necessary edit the file {loc_filename} or {loc_filename2}.") print("-"*70) print() From b4c110664e6738ef12b2eafd6dfd1c0e5d4c8919 Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Tue, 24 Jun 2025 17:13:09 -0400 Subject: [PATCH 39/54] move script to scripts --- src/geosmie/CMakeLists.txt | 2 -- src/scripts/CMakeLists.txt | 3 +++ src/{geosmie => scripts}/geosmie_runbands.j | 0 src/{geosmie => scripts}/geosmie_runoptics.j | 0 src/{geosmie => scripts}/geosmie_setup.py | 0 5 files changed, 3 insertions(+), 2 deletions(-) rename src/{geosmie => scripts}/geosmie_runbands.j (100%) rename src/{geosmie => scripts}/geosmie_runoptics.j (100%) rename src/{geosmie => scripts}/geosmie_setup.py (100%) diff --git a/src/geosmie/CMakeLists.txt b/src/geosmie/CMakeLists.txt index 1db7068..353adeb 100644 --- a/src/geosmie/CMakeLists.txt +++ b/src/geosmie/CMakeLists.txt @@ -5,8 +5,6 @@ esma_set_this() file(GLOB scripts *.py) install(PROGRAMS ${scripts} DESTINATION bin/${this}) - file(GLOB scripts *.j) - install(PROGRAMS ${scripts} DESTINATION bin/${this}) install(DIRECTORY data DESTINATION bin/${this}) install(DIRECTORY namelists DESTINATION bin/${this}) diff --git a/src/scripts/CMakeLists.txt b/src/scripts/CMakeLists.txt index b8421f7..a04db7f 100644 --- a/src/scripts/CMakeLists.txt +++ b/src/scripts/CMakeLists.txt @@ -6,3 +6,6 @@ # ------------------ file(GLOB scripts *sh) install(PROGRAMS ${scripts} DESTINATION bin) + + file(GLOB scripts *.j) + install(PROGRAMS ${scripts} DESTINATION bin/${this}) diff --git a/src/geosmie/geosmie_runbands.j b/src/scripts/geosmie_runbands.j similarity index 100% rename from src/geosmie/geosmie_runbands.j rename to src/scripts/geosmie_runbands.j diff --git a/src/geosmie/geosmie_runoptics.j b/src/scripts/geosmie_runoptics.j similarity index 100% rename from src/geosmie/geosmie_runoptics.j rename to src/scripts/geosmie_runoptics.j diff --git a/src/geosmie/geosmie_setup.py b/src/scripts/geosmie_setup.py similarity index 100% rename from src/geosmie/geosmie_setup.py rename to src/scripts/geosmie_setup.py From 52ccdcd3dfcfe99457d3233314823544c9327ef6 Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Tue, 24 Jun 2025 17:42:23 -0400 Subject: [PATCH 40/54] add environment set up to scripts --- src/scripts/generate_geos_optics.legacy.sh | 9 +++++++++ src/scripts/generate_geos_optics.sh | 8 ++++++++ src/scripts/proc.v2.0.0.csh | 6 ++++++ 3 files changed, 23 insertions(+) diff --git a/src/scripts/generate_geos_optics.legacy.sh b/src/scripts/generate_geos_optics.legacy.sh index 5cfcc5c..5db2f7a 100755 --- a/src/scripts/generate_geos_optics.legacy.sh +++ b/src/scripts/generate_geos_optics.legacy.sh @@ -1,3 +1,12 @@ +#!/bin/tcsh + +# setup environment +setenv SRC_DIR @SRCDIR +setenv PYTHONPATH ${SRC_DIR}/install/lib/Python + +source $SRC_DIR/env@/g5_modules + + # full suite assumes geosparticles/du.json has a valid path to dust kernels # which are not included by default in GEOSmie distribution #./runoptics.py --namelist namelists/geos.txt diff --git a/src/scripts/generate_geos_optics.sh b/src/scripts/generate_geos_optics.sh index 8fc28a3..67449e9 100755 --- a/src/scripts/generate_geos_optics.sh +++ b/src/scripts/generate_geos_optics.sh @@ -1,3 +1,11 @@ +#!/bin/tcsh + +# setup environment +setenv SRC_DIR @SRCDIR +setenv PYTHONPATH ${SRC_DIR}/install/lib/Python + +source $SRC_DIR/env@/g5_modules + # full suite assumes geosparticles/du.json has a valid path to dust kernels # which are not included by default in GEOSmie distribution #./runoptics.py --namelist namelists/geos.txt diff --git a/src/scripts/proc.v2.0.0.csh b/src/scripts/proc.v2.0.0.csh index af43b7c..8fe7853 100755 --- a/src/scripts/proc.v2.0.0.csh +++ b/src/scripts/proc.v2.0.0.csh @@ -1,5 +1,11 @@ #!/bin/tcsh +# setup environment +setenv SRC_DIR @SRCDIR +setenv PYTHONPATH ${SRC_DIR}/install/lib/Python + +source $SRC_DIR/env@/g5_modules + # Script to reproduce v2.0.0 optics tables # JSON files live in geosparticles # Output will be placed in AerosolOptics/v2.0.0/x directory From 8ef494931dafe039d29d836b308e79ba4a76b7f8 Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Tue, 24 Jun 2025 17:42:46 -0400 Subject: [PATCH 41/54] remove slurm scripts --- src/scripts/geosmie_runbands.j | 34 ----------------------------- src/scripts/geosmie_runoptics.j | 38 --------------------------------- 2 files changed, 72 deletions(-) delete mode 100755 src/scripts/geosmie_runbands.j delete mode 100755 src/scripts/geosmie_runoptics.j diff --git a/src/scripts/geosmie_runbands.j b/src/scripts/geosmie_runbands.j deleted file mode 100755 index 45c6af5..0000000 --- a/src/scripts/geosmie_runbands.j +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/csh -f - -####################################################################### -# Batch Parameters for Run Job -####################################################################### - -#SBATCH -J geosmie -#SBATCH --nodes=1 -#SBATCH --constraint=mil -#SBATCH --time=01:00:00 -#SBATCH -A @GROUPID -#SBATCH -o output_geosaqcgan-%j.log -#SBATCH --mail-type=BEGIN -#SBATCH --mail-type=END -#SBATCH --qos=debug -####################################################################### -# Run GEOS implementation of NASA-AQcGAN to test running a forecast -####################################################################### -# Architecture Specific Environment Variables -####################################################################### - -setenv SRC_DIR @SRCDIR -setenv PYTHONPATH ${SRC_DIR}/install/lib/Python - -source $SRC_DIR/env@/g5_modules - -####################################################################### -# Run the GEOSMIE code -# To calculate single-scattering properties at wavelength bands -# filename.nc should be an output file from runoptics.py -####################################################################### - -./runbands.py --filename filename.nc - diff --git a/src/scripts/geosmie_runoptics.j b/src/scripts/geosmie_runoptics.j deleted file mode 100755 index d18e4c9..0000000 --- a/src/scripts/geosmie_runoptics.j +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/csh -f - -####################################################################### -# Batch Parameters for Run Job -####################################################################### - -#SBATCH -J geosmie -#SBATCH --nodes=1 -#SBATCH --constraint=mil -#SBATCH --time=01:00:00 -#SBATCH -A @GROUPID -#SBATCH -o output_geosaqcgan-%j.log -#SBATCH --mail-type=BEGIN -#SBATCH --mail-type=END -#SBATCH --qos=debug -####################################################################### -# Run GEOS implementation of NASA-AQcGAN to test running a forecast -####################################################################### -# Architecture Specific Environment Variables -####################################################################### - -setenv SRC_DIR @SRCDIR -setenv PYTHONPATH ${SRC_DIR}/install/lib/Python - -source $SRC_DIR/env@/g5_modules - -####################################################################### -# Run the GEOSMIE code -# To calculate single-scattering properties at individual wavelengths -# Where file.json defines all of the parameters of the calculation. -# ".json" can be omitted from the runoptics.py command as a convenience. -# See JSON examples under geosparticles/ for current GEOS aerosol particles. - -####################################################################### - -./runoptics.py --name path/to/file.json - - From fc5abe9e42ab7fe93e3aa749261e9358e465739a Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Tue, 24 Jun 2025 17:43:05 -0400 Subject: [PATCH 42/54] modify setup to use existing scripts --- src/scripts/CMakeLists.txt | 4 +-- src/scripts/geosmie_setup.py | 63 ++++++++++++------------------------ 2 files changed, 22 insertions(+), 45 deletions(-) diff --git a/src/scripts/CMakeLists.txt b/src/scripts/CMakeLists.txt index a04db7f..f6737cd 100644 --- a/src/scripts/CMakeLists.txt +++ b/src/scripts/CMakeLists.txt @@ -7,5 +7,5 @@ file(GLOB scripts *sh) install(PROGRAMS ${scripts} DESTINATION bin) - file(GLOB scripts *.j) - install(PROGRAMS ${scripts} DESTINATION bin/${this}) + file(GLOB scripts *.py) + install(PROGRAMS ${scripts} DESTINATION bin) diff --git a/src/scripts/geosmie_setup.py b/src/scripts/geosmie_setup.py index 47da03a..1982d44 100755 --- a/src/scripts/geosmie_setup.py +++ b/src/scripts/geosmie_setup.py @@ -28,10 +28,10 @@ def print_message(): The script is interactive and asks the user to provide: - an experiment name (exp_name) - - the group id (group_id), i.e., the NCCS sponsor code to be used in SLURM. + - the run script you want to start from It will then create an experiment directory that has a self-contained and ready - to use SLURM script geosmis_run.j. + to use run script --------------------------------------------------------------------------------- """ print(mssg) @@ -72,12 +72,6 @@ def search_reaplace_in_file(loc_filename: str, except Exception as e: print(f"An error occurred: {e}") -def ignore_top_level(dir, files): - # Ignore the source directory itself - if dir == source_directory: - return [source_directory] # Return a list containing the source directory name - return [] # Don't ignore anything else - def create_experiment_directory(): @@ -87,7 +81,7 @@ def create_experiment_directory(): # Determine the source code main directory # Will be FULL_PATH/GEOSmie - source_directory = current_directory.parent.parent.parent + source_directory = current_directory.parent.parent reference_directory = source_directory.parent @@ -116,54 +110,37 @@ def create_experiment_directory(): shutil.copytree(config_filepath, experiment_directory / config_filepath.name,dirs_exist_ok=True) # Copy geosmie scripts to the experiment directory - config_filepath = current_directory.parent / "geosmie/*" + config_filepath = current_directory / "geosmie/*" for p in glob.glob(str(config_filepath)): if os.path.isfile(p): shutil.copy(p, experiment_directory) elif os.path.isdir(p): shutil.copytree(p, experiment_directory / os.path.basename(p),dirs_exist_ok=True) + # Copy gsf scripts to the experiment directory + config_filepath = current_directory.parent / "gsf/*" + for p in glob.glob(str(config_filepath)): + if os.path.isfile(p): + shutil.copy(p, experiment_directory) + elif os.path.isdir(p): + shutil.copytree(p, experiment_directory / os.path.basename(p),dirs_exist_ok=True) - # Get the sponsor code id - - result = subprocess.run(["groups"], shell=True, capture_output=True, text=True) - - groups = result.stdout.strip().split() - - print(f"The list of available group ids is: \n\n\t {result.stdout.strip()}") - print() - my_group = input(f"Provide the group id do you want to use (default: {groups[0]}): ") - my_group = my_group.strip() - - if not my_group: - my_group = groups[0] - - print() - print(f"Your group is is: {my_group}") - print() - - if my_group not in groups: - print(f"You selected and invalid group.") - print(f"The group {groups[0]} will be used.") - print(f"You can change the group id in the SLURM script available in the experiment directory") - print() - - loc_filename = "geosmie_runoptics.j" - target_dir = experiment_directory - dict_words = {"@SRCDIR": str(source_directory), "@GROUPID": my_group} - search_reaplace_in_file(loc_filename, target_dir, dict_words) + # Get the template script + nscript = "proc.v2.0.0.csh" + script_name = input(f"Provide the script name [default:{nscript}]: ") + script_name = script_name.strip() + if not script_name: + script_name = nscript - loc_filename2 = "geosmie_runbands.j" target_dir = experiment_directory - dict_words = {"@SRCDIR": str(source_directory), "@GROUPID": my_group} - search_reaplace_in_file(loc_filename2, target_dir, dict_words) - + dict_words = {"@SRCDIR": str(source_directory)} + search_reaplace_in_file(script_name, target_dir, dict_words) print() print("-"*70) print(f"The experiment directory was created: \n\n\t {experiment_directory}") print() - print(f"Go to the folder and if necessary edit the file {loc_filename} or {loc_filename2}.") + print(f"Go to the folder and if necessary edit the file {script_name}.") print("-"*70) print() From 0fc7be66b9886b79ec2ba8ba0f1ce49b5b40693a Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Tue, 24 Jun 2025 17:50:59 -0400 Subject: [PATCH 43/54] fix location of configs --- src/scripts/geosmie_setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scripts/geosmie_setup.py b/src/scripts/geosmie_setup.py index 1982d44..dcf2a8e 100755 --- a/src/scripts/geosmie_setup.py +++ b/src/scripts/geosmie_setup.py @@ -106,7 +106,7 @@ def create_experiment_directory(): experiment_directory.mkdir(parents=True, exist_ok=True) # Copy the geosparticles configuration files to the experiment directory. - config_filepath = current_directory.parent.parent / "etc/geosparticles" + config_filepath = source_directory / "install/etc/geosparticles" shutil.copytree(config_filepath, experiment_directory / config_filepath.name,dirs_exist_ok=True) # Copy geosmie scripts to the experiment directory @@ -127,7 +127,7 @@ def create_experiment_directory(): # Get the template script nscript = "proc.v2.0.0.csh" - script_name = input(f"Provide the script name [default:{nscript}]: ") + script_name = input(f"Provide the script name [default: {nscript}]: ") script_name = script_name.strip() if not script_name: script_name = nscript From 1233b0b95bb40e522ff093e31d97500eb62edfdc Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Tue, 24 Jun 2025 18:01:48 -0400 Subject: [PATCH 44/54] include linking to kernels --- src/scripts/geosmie_setup.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/scripts/geosmie_setup.py b/src/scripts/geosmie_setup.py index dcf2a8e..08f633a 100755 --- a/src/scripts/geosmie_setup.py +++ b/src/scripts/geosmie_setup.py @@ -29,6 +29,7 @@ def print_message(): - an experiment name (exp_name) - the run script you want to start from + - the location of GRASP dust kernels It will then create an experiment directory that has a self-contained and ready to use run script @@ -63,6 +64,7 @@ def search_reaplace_in_file(loc_filename: str, for key in dict_words: file_content = file_content.replace(key, dict_words[key]) print(f"Successfully replaced '{key}' with '{dict_words[key]}' in '{new_filename}'.") + print("") with open(new_filename, 'w') as file: file.write(file_content) @@ -136,6 +138,17 @@ def create_experiment_directory(): dict_words = {"@SRCDIR": str(source_directory)} search_reaplace_in_file(script_name, target_dir, dict_words) + # Dust kernels + dkernel = "/home/pcolarco/geos_aerosols/pcolarco/GEOSmie/kernels" + kernel_dir = input(f"Provide the location of the GRASP dust kernels [default: {dkernel}]: ") + kernel_dir = kernel_dir.strip() + if not kernel_dir: + kernel_dir = dkernel + + # copy kernels over + os.symlink(kernel_dir, experiment_directory / os.path.basename(kernel_dir), target_is_directory=False) + + print() print("-"*70) print(f"The experiment directory was created: \n\n\t {experiment_directory}") From cd6b46de4fa7413b5563dd4ae4371e7e1a01e95b Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Tue, 24 Jun 2025 18:10:37 -0400 Subject: [PATCH 45/54] fix location. remove copying over of scripts --- src/scripts/proc.v2.0.0.csh | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/src/scripts/proc.v2.0.0.csh b/src/scripts/proc.v2.0.0.csh index 8fe7853..a427ad8 100755 --- a/src/scripts/proc.v2.0.0.csh +++ b/src/scripts/proc.v2.0.0.csh @@ -13,25 +13,16 @@ source $SRC_DIR/env@/g5_modules set ver = "v2.0.0" mkdir $ver -mkdir -p ../AerosolOptics/$ver/x +mkdir -p ./AerosolOptics/$ver/x # Link the desired files - ln -s ../../geosparticles/bc.json $ver/BC.$ver.json - ln -s ../../geosparticles/oc.json $ver/OC.$ver.json - ln -s ../../geosparticles/ni.json $ver/NI.$ver.json - ln -s ../../geosparticles/su.json $ver/SU.$ver.json - ln -s ../../geosparticles/ss.json $ver/SS.$ver.json - ln -s ../../geosparticles/brc.json $ver/BR.$ver.json - ln -s ../../geosparticles/du-grasp_spheroid-lognormal.json $ver/DU.$ver.json - -# Copy the relevant drivers here - setenv PYTHONPATH /home/colarco/GEOSmie:/home/colarco/GEOSmie/gsf:$PYTHONPATH - ln -s ../data data - ln -s ../kernels kernels - \cp -f ../runbands.py . - \cp -f ../runoptics.py . - \cp -f ../gsf/rungsf.py . - \cp -f ../gsf/a.out . + ln -s ${PWD}/geosparticles/bc.json $ver/BC.$ver.json + ln -s ${PWD}/geosparticles/oc.json $ver/OC.$ver.json + ln -s ${PWD}/geosparticles/ni.json $ver/NI.$ver.json + ln -s ${PWD}/geosparticles/su.json $ver/SU.$ver.json + ln -s ${PWD}/geosparticles/ss.json $ver/SS.$ver.json + ln -s ${PWD}/geosparticles/brc.json $ver/BR.$ver.json + ln -s ${PWD}/geosparticles/du-grasp_spheroid-lognormal.json $ver/DU.$ver.json # Run the cases @@ -52,9 +43,5 @@ mkdir -p ../AerosolOptics/$ver/x end # Move files - \mv -f $ver/*nc4 ../AerosolOptics/$ver/x - - -# Clean up -# rm -f runbands.py runoptics.py rungsf.py a.out + \mv -f $ver/*nc4 ./AerosolOptics/$ver/x From af55ba64abd3b0871dcc453b55c049c8a5b2466e Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Tue, 24 Jun 2025 18:28:45 -0400 Subject: [PATCH 46/54] update README --- README.md | 123 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) diff --git a/README.md b/README.md index a61f745..ee9f891 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ Table of Contents ================= * [GEOSmie](#geosmie) + * [How to build GEOSmie](#how-to-build-geosmie) * [Mie code](#mie-code) * [Main code](#main-code) * [Calculations at individual wavelengths](#calculations-at-individual-wavelengths) @@ -47,6 +48,119 @@ The package consists of the following parts: - Generalized spherical function expansion code (gsf/) - Kernel generation code (root directory) +## How to Build GEOSmie +### Preliminary Steps + +#### Load Build Modules + +In your `.bashrc` or `.tcshrc` or other rc file add a line: + +##### NCCS + +``` +module use -a /discover/swdev/gmao_SIteam/modulefiles-SLES15 +``` + +##### NAS +``` +module use -a /nobackup/gmao_SIteam/modulefiles +``` + +##### GMAO Desktops + +On the GMAO desktops, the SI Team modulefiles should automatically be +part of running `module avail` but if not, they are in: + +``` +module use -a /ford1/share/gmao_SIteam/modulefiles +``` + +Also do this in any interactive window you have. This allows you to get module files needed to correctly checkout and build the model. + +Now load the `GEOSenv` module: +``` +module load GEOSenv +``` +which obtains the latest `git`, `CMake`, etc. modules needed to build. + +### Use mepo to clone the repository + +[Mepo](https://github.com/GEOS-ESM/mepo) is a multiple repository tool available on github. + +``` +mepo clone git@github.com:GEOS-ESM/GEOSmie.git +``` + +##### Slow clones + +If you notice your clone is taking a while, we recommend running: + +``` +mepo config set clone.partial blobless +``` + +This is a one-time command that tells mepo to use blobless clones for all future clones. +Blobless clones are much faster than the default clone method, +especially for repositories with a large history like MAPL. + +#### Build the Model + +##### Load Compiler, MPI Stack, and Baselibs + +On tcsh: +``` +source env@/g5_modules +``` +or on bash: +``` +source env@/g5_modules.sh +``` + +##### Create Build Directory + +##### Run CMake + +CMake generates the Makefiles needed to build the model. + +``` +./cmake_it +``` + +This will build the code in `build/` and will install in `install`. + +NOTE: You can choose any directory for your build and install in `cmake_it`. That +said, what you pass to `--install-prefix=` *MUST* be a full path. + +###### Building with Debugging Flags + +To build with debugging flags add: + +``` +-DCMAKE_BUILD_TYPE=Debug +``` +to the cmake line. + +##### Build and Install with Make + +``` +cmake --build build --target install -j6 +``` + +If you put your build in a directory other than `build` use that in the +above command. + +## Setup and experiment + +Navigate to `install/bin` and run the `geosmies_setup` script: + +``` +./geosmie_setup.py +``` + +This will create an independent experiment directory for running GEOSmie. +You can choose between starting scripts found in `src/scripts` as a template. +These scripts implement the following ways to run GEOSmie. + ## Mie code Before any spherical aerosol calculations can be done the Mie code needs to be installed. @@ -145,3 +259,12 @@ A tool is provided for converting kernels from GRASP-like format to the GEOSmie- ``` where filename.json is a parameter file that specifies various aspects on how the kernels should be read, and has to be updated if the incoming kernel format changes in virtually any way. Sample JSON files are provided for GRASP kernels (grasp.json) and GRASP-like Saito et al. kernels (saito.json). + +## Contributing + +Please check out our [contributing guidelines](CONTRIBUTING.md). + +## License + +All files are currently licensed under the Apache-2.0 license, see [`LICENSE`](LICENSE). + From 5a6053987eb75b9d91887448c7fe9c12de7806b2 Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Tue, 24 Jun 2025 18:29:02 -0400 Subject: [PATCH 47/54] fix setup of gsf codes --- src/scripts/geosmie_setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripts/geosmie_setup.py b/src/scripts/geosmie_setup.py index 08f633a..d6a391f 100755 --- a/src/scripts/geosmie_setup.py +++ b/src/scripts/geosmie_setup.py @@ -120,7 +120,7 @@ def create_experiment_directory(): shutil.copytree(p, experiment_directory / os.path.basename(p),dirs_exist_ok=True) # Copy gsf scripts to the experiment directory - config_filepath = current_directory.parent / "gsf/*" + config_filepath = current_directory / "gsf/*" for p in glob.glob(str(config_filepath)): if os.path.isfile(p): shutil.copy(p, experiment_directory) From b49430309fb6b0fa3ce0d694e1ab9ab7ffca44ce Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Tue, 24 Jun 2025 18:32:47 -0400 Subject: [PATCH 48/54] take out old install information --- README.md | 33 ++------------------------------- 1 file changed, 2 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index ee9f891..f5f3182 100644 --- a/README.md +++ b/README.md @@ -151,7 +151,7 @@ above command. ## Setup and experiment -Navigate to `install/bin` and run the `geosmies_setup` script: +Navigate to `install/bin` and run the `geosmie_setup` script: ``` ./geosmie_setup.py @@ -161,26 +161,6 @@ This will create an independent experiment directory for running GEOSmie. You can choose between starting scripts found in `src/scripts` as a template. These scripts implement the following ways to run GEOSmie. -## Mie code - -Before any spherical aerosol calculations can be done the Mie code needs to be installed. - -Starting in the root directory of this repository: - -```bash -cd pymiecoated -python setup.py install -``` - -In some systems the following may be needed instead: - -```bash -python setup.py install --user -``` - -The Mie code does not need to be used directly; runoptics.py calls it as needed. The functions within the module can be used directly to run custom Mie simulations but that is beyond the scope of this README. - - ## Main code The main single-scattering property calculator consists of two parts: calculation at individual wavelengths, and calculation over wavelength bands. The first part is always necessary, the second needs to be run only if wavelength band integrated files are necessary. @@ -225,16 +205,7 @@ The generalized spherical function expansion code is needed to convert the phase The code uses spher_expan.f code by Michael Mishchenko. Before conversions can be done the Fortran code needs to be compiled. -Starting in the root directory of this repository: - -```bash -cd gsf -gfortran spher_expan.f -``` - -Other compilers beyond gfortran may work. Testing has been performed with gfortran 11.2.0 on Gentoo. - -To run the conversion code, assuming the code has been compiled and you are in the gsf/ subdirectory: +To run the conversion code: ```bash ./rungsf.py --filename ../filename.nc From 70f444ffb5160e16a1764ac84b8e2024ff01a7a9 Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Tue, 24 Jun 2025 18:33:30 -0400 Subject: [PATCH 49/54] take out unused link --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index f5f3182..812d3b5 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,6 @@ Table of Contents * [GEOSmie](#geosmie) * [How to build GEOSmie](#how-to-build-geosmie) - * [Mie code](#mie-code) * [Main code](#main-code) * [Calculations at individual wavelengths](#calculations-at-individual-wavelengths) * [Calculations over wavelength bands](#calculations-over-wavelength-bands) From 1fdccf8b5ca4aa0d7bf8c04d871e4c16a0bc92a8 Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Tue, 24 Jun 2025 18:38:48 -0400 Subject: [PATCH 50/54] add some clarifying comments --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 812d3b5..2395121 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ especially for repositories with a large history like MAPL. #### Build the Model -##### Load Compiler, MPI Stack, and Baselibs +##### Step 1: Load Compiler, MPI Stack, and Baselibs On tcsh: ``` @@ -117,7 +117,7 @@ source env@/g5_modules.sh ##### Create Build Directory -##### Run CMake +##### Step 2: Run CMake CMake generates the Makefiles needed to build the model. @@ -139,7 +139,7 @@ To build with debugging flags add: ``` to the cmake line. -##### Build and Install with Make +##### Step 3: Build and Install with CMake ``` cmake --build build --target install -j6 @@ -148,9 +148,9 @@ cmake --build build --target install -j6 If you put your build in a directory other than `build` use that in the above command. -## Setup and experiment +## Setup an experiment -Navigate to `install/bin` and run the `geosmie_setup` script: +Navigate to `install/bin` and run the `geosmie_setup` script and follow the prompts: ``` ./geosmie_setup.py From 6fc2f38501261ca9d405f1d97e1c8b1d3ce1b59a Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Tue, 24 Jun 2025 18:40:05 -0400 Subject: [PATCH 51/54] fix typos --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2395121..30c93d3 100644 --- a/README.md +++ b/README.md @@ -150,7 +150,7 @@ above command. ## Setup an experiment -Navigate to `install/bin` and run the `geosmie_setup` script and follow the prompts: +Navigate to `install/bin`. Run the `geosmie_setup` script and follow the prompts: ``` ./geosmie_setup.py From 19de0058d3452a82ca83933c37e6119dd17f8984 Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Wed, 25 Jun 2025 10:35:36 -0400 Subject: [PATCH 52/54] ouput dust phase functions at same angular resolution as the other species --- src/geosmie/dointegration.py | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/geosmie/dointegration.py b/src/geosmie/dointegration.py index 7580da5..1259a80 100755 --- a/src/geosmie/dointegration.py +++ b/src/geosmie/dointegration.py @@ -1,7 +1,7 @@ import netCDF4 import numpy as np import bisect -from scipy.interpolate import interp1d +from scipy.interpolate import interp1d, CubicSpline from scipy.stats import lognorm import os import numba @@ -721,12 +721,14 @@ def fun(partID0, datatype, oppfx, oppclassic): """ # Angles phase functions will be written at + # Define output scattering angles + ang1 = np.linspace(0., 1., 100, endpoint=False) + ang2 = np.linspace(1., 10., 100, endpoint=False) + ang3 = np.linspace(10., 180., 171, endpoint=True) + angmie = np.concatenate([ang1,ang2,ang3]) if mode =='mie': # Define output scattering angles - ang1 = np.linspace(0., 1., 100, endpoint=False) - ang2 = np.linspace(1., 10., 100, endpoint=False) - ang3 = np.linspace(10., 180., 171, endpoint=True) - ang = np.concatenate([ang1,ang2,ang3]) + ang = angmie elif useGrasp: ang = np.linspace(0., 180., 181) @@ -734,7 +736,7 @@ def fun(partID0, datatype, oppfx, oppclassic): minlam = lambarr[0] maxlam = lambarr[-1] - opncdf = createNCDF(ncdfID, oppfx, radiusarr, rh, lambarr, ang[:], oppclassic) + opncdf = createNCDF(ncdfID, oppfx, radiusarr, rh, lambarr, angmie[:], oppclassic) if useGrasp: # if we are using a spheroid kernel system then override xxarr with @@ -950,6 +952,15 @@ def fun(partID0, datatype, oppfx, oppclassic): """ Calculate a posteriori normalization of phase matrix elements """ + if useGrasp: + # interpolate Grasp phase matrix to same angles as mie particles + costarrmie = np.cos(np.radians(angmie)) + for key in scatelems: + cs = CubicSpline(costarr[::-1],ret[key][::-1]) # reverse because CS requires ascending x-values + ret[key] = cs(costarrmie[::-1])[::-1] # reverse it back after interpolation + + ang = angmie + theta = np.radians(ang) p11n = 2.*ret['p11'] / np.trapz(ret['p11'] * np.sin(theta),theta) ret['p12'] = ret['p12']*p11n/ret['p11'] From c60d36988c5e45520a39a279126c10fd9f0ae513 Mon Sep 17 00:00:00 2001 From: Patricia Castellanos Date: Wed, 25 Jun 2025 10:37:16 -0400 Subject: [PATCH 53/54] update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 926a380..7a0a4a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,8 +10,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed ### Added +- output dust phase matrix at same angular resolution as mie particles ### Changed +- refactor to use cmake for installation ### Removed From 125d8ab3dbcfde369b5ca50e1917105aaeb8d295 Mon Sep 17 00:00:00 2001 From: Peter Colarco Date: Wed, 25 Jun 2025 11:54:13 -0400 Subject: [PATCH 54/54] prc: update CHANGELOG --- CHANGELOG.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a0a4a8..187b4ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,15 +10,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed ### Added -- output dust phase matrix at same angular resolution as mie particles ### Changed -- refactor to use cmake for installation ### Removed ### Deprecated +## [2.0.0] - 2025-06-25 + +### Added +- output dust phase matrix at same angular resolution as mie particles + +### Changed +- refactor to use cmake for installation + ## [1.2.2] - 2025-04-22 ### Fixed