Changeset 2007 in lmdz_wrf for trunk


Ignore:
Timestamp:
Aug 2, 2018, 2:41:43 PM (7 years ago)
Author:
lfita
Message:

Adding new output file name to `DataSetSection_multidims' as 'newfile_multidims.nc'

Location:
trunk/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/nc_var_tools.py

    r1998 r2007  
    64696469    return
    64706470
    6471 def DataSetSection_multidims(values, filen, varn):
     6471def DataSetSection_multidims(values0, filen, varn):
    64726472    """ Function to get a section (values along multiple dimensions) of a given data-set
    6473       values= [dimn1],[beg1],[end1],[int1]@[...[[dimnM],[begM],[endM],[intM]]]
     6473      values0= [dimn1],[beg1],[end1],[int1]@[...[[dimnM],[begM],[endM],[intM]]]:[oldname]
    64746474        [dimni]: name of the dimension
    64756475        [begi],[endi],[inti]: beginning, end and interval along the dimension-axis
    64766476          [endi] = -1, last value
    64776477          NOTE: dimensions without values are taken allover their size
     6478        [oldname]= whether should be used the 'old' name version (using slice values) or not ('False')
     6479          * NOTE: this value is optional if it is not present oldname = True
    64786480      filen= netCDF with the data-set
    64796481      varn= ',' list of variables, 'all' for all variables in data-set
     
    64866488        print DataSetSection_multidims.__doc__
    64876489        quit()
     6490
     6491    if len(values0.split(':')) == 1:
     6492        values = values0 + []
     6493        oldn = True
     6494    else:
     6495        values = values0.split(':')[0]
     6496        oldn = gen.Str_Bool(values0.split(':')[1])
    64886497
    64896498    Ndims = len(values.split('@'))
     
    65046513          str(endvs[idim]) + '-I' + str(intvs[idim])
    65056514
    6506     ofile = ofile=filen.split('.')[0] + ofiletile + '.nc'
     6515    # Old name
     6516    if oldn:
     6517        ofile = ofile=filen.split('.')[0] + ofiletile + '.nc'
     6518    else:
     6519        ofile = 'newfile_multidims.nc'
    65076520
    65086521    nciobj = NetCDFFile(filen,'r')
  • trunk/tools/obs-sim_Comparison.bash

    r2006 r2007  
    189189    values='Time,0,-1,1@bottom_top,0,-1,1@south_north,'${ysnd}','${ysnd}',1@'
    190190    values=${values}'west_east,'${xsnd}','${xsnd}',1@south_north_stag,'${ysnd}','
    191     values=${values}${ysnd1}',1@west_east_stag,'${xsnd}','${xsnd1}',1'
     191    values=${values}${ysnd1}',1@west_east_stag,'${xsnd}','${xsnd1}',1:False'
    192192    python ${pyHOME}/nc_var.py -o DataSetSection_multidims -f ${filen}               \
    193193      -S ${values} -v all
     
    213213    Hhfilen=`echo ${Hfilen} | tr '.' ' ' | awk '{print $1}'`
    214214
    215     ofilen=${Dfilen}/${Hhfilen}'_Time_B0-E-1-I1_bottom_top_B0-E-1-I1_'${yslc}'_'${xslc}'_'
    216     ofilen=${ofilen}${ystslc}'_'${xstslc}'.nc'
     215    ofilen='newfile_multidims.nc'
    217216    mv ${ofilen} ${simsndptf}
    218217  fi
     
    304303    values='Time,0,-1,1@south_north,'${ysnd}','${ysnd}',1@'
    305304    values=${values}'west_east,'${xsnd}','${xsnd}',1@south_north_stag,'${ysnd}','
    306     values=${values}${ysnd1}',1@west_east_stag,'${xsnd}','${xsnd1}',1'
     305    values=${values}${ysnd1}',1@west_east_stag,'${xsnd}','${xsnd1}',1:False'
    307306    python ${pyHOME}/nc_var.py -o DataSetSection_multidims -f ${filen}               \
    308307      -S ${values} -v all
     
    323322    xstslc='west_east_stag_B'${xsnd}'-E'${xsnd1}'-I1'
    324323
    325     ofilen=${filen}'_Time_B0-E-1-I1_'${yslc}'_'${xslc}'_'${ystslc}'_'${xstslc}'.nc'
     324    ofilen='newfile_multidims.nc'
    326325    mv ${ofilen} ${simsfcptf}
    327326  fi
     
    836835      if test ${Nconfc} -gt 1; then
    837836        values=${odir}',Time,time'
    838         HMT='simout_snddiags_,'${stid},'nc'
     837        HMT='simout_snddiags_,'${stid}'_'${expn},'nc'
    839838        python ${pyHOME}/nc_var.py -o netcdf_fold_concatenation_HMT -S ${values}      \
    840839         -f ${HMT} -v all
     
    857856    fi
    858857
    859     iexp=`ecpr ${iexp} + 1`
     858    iexp=`expr ${iexp} + 1`
    860859  # end of experiments
    861860  done
Note: See TracChangeset for help on using the changeset viewer.