Skip to content

Commit

Permalink
Merge pull request #1 from AER-RC/release_1.1
Browse files Browse the repository at this point in the history
minor changes to release examples script -- release v1.1
  • Loading branch information
jrmascio authored Oct 31, 2023
2 parents 03a3acc + a22423f commit 98d0a11
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 30 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ CLBLM uses the line parameters and [MT_CKD continuum](https://github.com/AER-RC/

| CLBLM Release | MT_CKD Release | Line File |
| :---: | :---: | :---: |
| [v1](https://github.com/AER-RC/CLBLM/releases/tag/v1) | [4.1.1](https://github.com/AER-RC/MT_CKD/releases/tag/4.1.1) | [v3.8.1](https://zenodo.org/record/4019178/files/aer_v_3.8.1.tar.gz?download=1) |
| [v1.1](https://github.com/AER-RC/CLBLM/releases/tag/v1.1) | [4.1.1](https://github.com/AER-RC/MT_CKD/releases/tag/4.1.1) | [v3.8.1](https://zenodo.org/record/4019178/files/aer_v_3.8.1.tar.gz?download=1) |

If any build or run issues occur, please [create an issue](https://github.com/AER-RC/LBLRTM/issues) or contact the [AER-RC Group](https://github.com/AER-RC).

Expand Down Expand Up @@ -60,10 +60,10 @@ git submodule update

in the `CLBLM` directory.

The current release is CLBLM v1, and it is recommended that this be the version that users clone and checkout (rather than the `master` branch). To do this, one needs to simply checkout the `v1` tag:
The current release is CLBLM v1.1, and it is recommended that this be the version that users clone and checkout (rather than the `master` branch). To do this, one needs to simply checkout the `v1.1` tag:

```
git checkout tags/v1
git checkout tags/v1.1
```

Instead of cloning, users can also download a CLBLM [tarball](https://github.com/AER-RC/CLBLM/archive/v1.zip) and unpack it:
Expand Down
61 changes: 35 additions & 26 deletions clblm_release_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,59 +15,68 @@
data_path=clblm_path+'/clblm_data/'

# array of examples to run
Case = ['AERI','IASI_US_Standard_PWV', 'Solar', 'Jacobian', 'LW_Flux']
test_Cases = ['AERI','IASI_US_Standard_PWV', 'Solar', 'Jacobian', 'LW_Flux']
# Aeri convolved (with XS and ILS applied), Jacobian H2O, LW_Flux_10-2000 Lamberian emissivity=1, Solar NRL 3-component
out = ['AERI_example', 'IASI_example', 'Solar_example', 'Jacobian_example','LW_Flux_example']
out_string = ['AERI_example', 'IASI_example', 'Solar_example', 'jacobian_example','LW_flux_example']


index=0

for y in Case:
print ('case', Case[index])

for Case, out in zip(test_Cases, out_string):
print ('case', Case)

# first delete the scratch directory to avoid any problems
shutil.rmtree(scratch_path)
if os.path.exists(scratch_path):
shutil.rmtree(scratch_path)
# then remake it
os.mkdir(scratch_path)

# link to the correct line file
os.remove(data_path+'spectroscopy/TAPE3')
if Case[index] == "Solar":
if os.path.islink(data_path+'spectroscopy/TAPE3'):
os.remove(data_path+'spectroscopy/TAPE3')
if Case == "Solar":
src= clblm_path+'/release_examples/TAPE3_files/TAPE3_aer_v_3.8.1_solar'
else:
src= clblm_path+'/release_xamples/TAPE3_files//TAPE3_LNFL_v3.2_AER_v3.8.1'
src= clblm_path+'/release_examples/TAPE3_files/TAPE3_aer_v_3.8.1_ex_ir'
os.symlink(src,data_path+'spectroscopy/TAPE3')


#for each case, setup the input files
#Cp example scene
shutil.copyfile(example_path+Case[index]+'/scenes_'+Case[index]+'.nc',clblm_path+'/user_archive/scene_files/scenes.nc')
shutil.copyfile(example_path+Case+'/scenes_'+Case+'.nc',clblm_path+'/user_archive/scene_files/scenes.nc')

#Cp example json
shutil.copyfile(example_path+Case[index]+'/clblm_config.'+Case[index]+'.json',clblm_path+'/clblm_config.json')
shutil.copyfile(example_path+Case+'/clblm_config.'+Case+'.json',clblm_path+'/clblm_config.json')

#Cp emissivity/reflectivity files, if needed
if Case[index] == "IASI_US_Standard_PWV":
shutil.copyfile(example_path+Case[index]+'/EMISSIVITY',clblm_path+'/EMISSIVITY')
shutil.copyfile(example_path+Case[index]+'/REFLECTIVITY',clblm_path+'/REFLECTIVITY')
if Case == "IASI_US_Standard_PWV":
shutil.copyfile(example_path+Case+'/EMISSIVITY',clblm_path+'/EMISSIVITY')
shutil.copyfile(example_path+Case+'/REFLECTIVITY',clblm_path+'/REFLECTIVITY')
print('copy reflectivity and emissivity files')

#Cp solar irradiance files, if needed
if Case[index] == "Solar":
if Case == "Solar":
print('copy solar irradiance file')
shutil.copyfile(example_path+Case[index]+'/SOLAR.RAD.nc',data_path+'solar_irradiance/SOLAR.RAD.nc')
shutil.copyfile(example_path+Case+'/SOLAR.RAD.nc',data_path+'solar_irradiance/SOLAR.RAD.nc')

#for each case, Run clblm
print('Running CLBLM')
sub.call(["clblm"])

#Cp output to Case directory
out_path=clblm_path+'/clblm_out/'+out[index]+'*.nc'
for file in glob.glob(out_path):
shutil.move(file,example_path+Case[index])


index=index+1




out_path=clblm_path+'/clblm_out/'
search_string = '%s/'+out+'*.nc'
nc_outs = sorted(glob.glob(search_string % out_path))
if len(nc_outs) > 0:
for file in nc_outs:
out_2 = file.replace(out,out+'_run')
shutil.move(file,out_2)
shutil.move(out_2,example_path+Case)
if len(nc_outs) == 0:
print()
print('CLBLM run failed. See error message(s) above.')
exit()

print()
print('All example case runs are complete!')
print()
2 changes: 1 addition & 1 deletion src/clblm_src/read_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function getData(fname, dat) result(isError)
integer(kind=4) :: ncid
integer(kind=4) :: nWavenumbers
integer(kind=4) :: stat
print*'get data function'

! check on the file
inquire(file = fname, EXIST=isError)
isError = .NOT. isError
Expand Down

0 comments on commit 98d0a11

Please sign in to comment.