From a22423ffa5bbbfe40a8a5a319973fc2e96c12e5b Mon Sep 17 00:00:00 2001 From: "Mascio, Jeana" Date: Tue, 31 Oct 2023 10:41:27 -0400 Subject: [PATCH] minor changes to release examples script -- release v1.1 --- README.md | 6 ++-- clblm_release_examples.py | 61 ++++++++++++++++++++--------------- src/clblm_src/read_module.f90 | 2 +- 3 files changed, 39 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 1e3271f..d5cba07 100644 --- a/README.md +++ b/README.md @@ -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). @@ -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: diff --git a/clblm_release_examples.py b/clblm_release_examples.py index df65b96..90063f2 100755 --- a/clblm_release_examples.py +++ b/clblm_release_examples.py @@ -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() \ No newline at end of file diff --git a/src/clblm_src/read_module.f90 b/src/clblm_src/read_module.f90 index 85c1ceb..432a941 100644 --- a/src/clblm_src/read_module.f90 +++ b/src/clblm_src/read_module.f90 @@ -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