path(path,'/home/sergio/KCARTA/SRC/NONLTE2/sergio/NONLTE_MATLAB');

cd /home/sergio/KCARTA/SRC/NONLTE2/sergio/NONLTE_MATLAB

homedir = pwd;

clear topts

topts.RemoveSomeBands = +1;
toptsRMV.iKCBand = [2310 2311 2320 2321 2350 2351 2352 2353 2354 2355];
toptsRMV.iISO =    [   1    2    1    2    1    2    3    1    1    4];  
toptsRMV.iL =      [   4    4    2    2    1    1    1    3    5    1];
toptsRMV.iU =      [  24   24   16   16    9    9    9   23   25    9];

iaFr = 2205 : 25 : 2505;
iaFr = 2305 : 25 : 2405;

profname = '/home/sergio/SPECTRA/IPFILES/layop_md_va0_usethis_co2';

for iF = 1 : length(iaFr)
  %% run run7lbl
  clear fr k
  f1 = iaFr(iF);
  f2 = f1 + 25.0;

  fprintf(1,'doing %3i of %3i : %8.4f %8.4f\n',iF,length(iaFr),f1,f2);

  cd /home/sergio/SPECTRA;

  topts.HITRAN = '/asl/data/hitran/h2koldiso';
  topts.HITRAN = '/asl/data/hitran/h96.by.gas';
  topts.ffin = 0.0001;
  topts.nbox = 5;

  %topts.ffin = 0.0005;
  %topts.nbox = 1;

  [fr,k] = run7co2_weakbackgnd(2,f1,f2,profname,topts,toptsRMV);      

  %% save the data

  outname = ['/carrot/s1/sergio/AIRSCO2/BACKGND_vt_mdH96/'];
  outname = [outname 'hehe_highres_weaklte_' num2str(f1)];

  saver = ['save ' outname ' fr k f1 f2 topts toptsRMV profname'];
  eval(saver);
  end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%% save the data in a big fat file %%%%%%%%%%%%%%%
frall = [];
kall = [];
for iF = 1 : length(iaFr)
  f1 = iaFr(iF);
  iname = ['/carrot/s1/sergio/AIRSCO2/BACKGND_vt_mdH96/hehe_highres_weaklte'];
  iname = [iname '_' num2str(f1) '.mat'];
  loader = ['load ' iname];
  eval(loader);
  [f1 f2]
  frall = [frall fr];
  kall = [kall k];
  end

fr = frall;
k00 = kall;
outname = '/carrot/s1/sergio/AIRSCO2/BACKGND_vt_mdH96/';
outname = [outname 'hehe_highres_weaklte_2305_2405.mat'];
saver = ['save ' outname ' fr k00'];
eval(saver);

%%%% and save it to nm_spectra format using ~/KCARTA/UTILITY/umbclbl_2_kcarta.m
cd ~/KCARTA/UTILITY 
umbclbl_2_kcarta_highres
  