Пример #1
0
        fldpltclimdt[skey], sh = cutl.calc_totseaicearea(fldclimdt[skey], lat, lon)
        fldplttsdt[skey], sh = cutl.calc_totseaicearea(flddt[skey], lat, lon)

    tstr = "SIA (millions of km^2)"
    divby = np.float(1e12)  # convert sea ice area to millions of km2

elif field == "sic":
    # need sea ice area to calc volume
    field = "sicn"
    ncfield = field.upper()
    conv = 1

    for skey in sims:
        fname = basepath + skey + subdir + skey + "_" + field + "_" + timeperdt[skey] + "_ts.nc"
        flds = cnc.getNCvar(fname, ncfield, timesel=timeseldt[skey]) * conv  # sea ice conc
        fldplttsdt[skey], sh = cutl.calc_totseaicevol(flddt[skey], flds, lat, lon)  # time series of ice vol

        # climo the ice conc
        fldsclimo, std = cutl.climatologize(flds)
        # calc climo ice vol
        fldpltclimdt[skey], sh = cutl.calc_totseaicevol(fldclimdt[skey], fldsclimo, lat, lon)  # climo ice vol

    field = "sic"
    ncfield = field.upper()
    conv = 1 / 913.0
    tstr = "SIV (m^3)"
    divby = 1

# these comparisions ask how good is the nudging to 2xco2 ice (in a prei climate)
fldc2xplt = fldpltclimdt["gregory_2xco2"]
fldc2xpltts = fldplttsdt["gregory_2xco2"]
            if sie:
                pstr='SIEnh'
                plotfldc,_ = cutl.calc_seaiceextent(simcfld,lat,lon,model=None)
                plotfldp,_ = cutl.calc_seaiceextent(simpfld,lat,lon,model=None)
            else: # sia
                pstr='SIAnh'
                tlabs['sicn'] = 'SIA (millions of km$^2$)'
                plotfldc,_ = cutl.calc_totseaicearea(simcfld,lat,lon,model=None)
                plotfldp,_ = cutl.calc_totseaicearea(simpfld,lat,lon,model=None)

            plotfld = plotfldp-plotfldc
            #plotfld,_ = cutl.calc_totseaicearea(simfld,lat,lon,model=None)
        elif field=='sic':
            tmpc=fldcdat['sicn'][ii]
            tmpp=fldpdat['sicn'][ii]
            plotfldc,_ = cutl.calc_totseaicevol(simcfld*conv,tmpc,lat,lon)
            plotfldp,_ = cutl.calc_totseaicevol(simpfld*conv,tmpp,lat,lon)
            plotfld = plotfldp-plotfldc
            #print conv
            #print 'plotfldc,plotfldp' + str(plotfldc)+',' + str(plotfldp)
        else:
            print '@@ field ' + field + ' not recognized' 
            break
        
        if ii==5:
            clr='r'
            print 'obs field,dat ' + field,str(plotfld)
            # save obs:
            obsdat[field]=plotfld
        else:
            clr='0.5'