PRO Read_UCARdry, in_path, $ output_file, $ version=version, $ return_code=return_code return_code=0 if keyword_set(version) then this_version=version else this_version=0 file_list=file_search(in_path+'/atmPrf*nc',count=file_count) print,in_path+'/*nc'+string(10B) print,'file_count= ',file_count if file_count eq 0 then begin return_code=1 goto, jump_end endif data=[] for file_loop = 0, file_count-1 do begin ;-------------------------------------- ; reading ;print,file_list[file_loop] status = Extract_UCARdry(file_list[file_loop], data_this, version=this_version) if status eq 0 then continue if n_elements(data_this) gt 0 then data =[data, data_this] endfor ; file_loop ; no ref if n_elements(data) eq 0 then begin print,'No valid input' stop endif ; --- choose the atmPhs/conPhs file --- ; convert: ; input/COSMIC2_STAR_v2.0/ROPPdry_noref/cosmic2_2021-02-06.sav ; to: ; input_atmPhs/COSMIC2/UCAR/cosmic2_2021-02-12.sav path_array = strsplit(output_file, '/', /extract) mission = strsplit(path_array[-3], '_', /extract) mission = mission[0] if strpos(path_array[-3], '_nrt') gt 0 then mission = mission+'_nrt' $ else if strpos(path_array[-3], '_v2021') gt 0 then mission = mission+'_v2021' file_atmPhs = output_file file_atmPhs=StrJoin(StrSplit(file_atmPhs, path_array[-2] ,/Regex,/Extract,/Preserve_Null), 'UCAR') ; always UCAR file_atmPhs=StrJoin(StrSplit(file_atmPhs, path_array[-3] ,/Regex,/Extract,/Preserve_Null), mission) ; COSMIC/SPIRE etc. file_atmPhs=StrJoin(StrSplit(file_atmPhs, 'input',/Regex,/Extract,/Preserve_Null), 'input_atmPhs'); path_array[-4] print, '---' print, 'output_file:',output_file print, 'file_atmPhs:',file_atmPhs print, 'mission:',mission print, '---' if file_test(file_atmPhs) then begin SUB_read_atmPhs, data, file_atmPhs endif else print,'No file_atmPhs found' save, data, filename=output_file, /COMPRESS print,'end at : ',systime() return_code=2 jump_end: stop END