Changeset 1178 in lmdz_wrf for trunk/tools/nc_var_tools.py


Ignore:
Timestamp:
Oct 11, 2016, 6:26:01 PM (8 years ago)
Author:
lfita
Message:

Testing and fixing `npp' wrong minimum values for mindifflonlat

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/nc_var_tools.py

    r1177 r1178  
    1590015900            quit(-1)
    1590115901   
     15902    # Checking right lon, lat ranges
     15903    iminlon = np.min(ilonvals)
     15904    imaxlon = np.max(ilonvals)
     15905    rminlon = np.min(rlonvals)
     15906    rmaxlon = np.max(rlonvals)
     15907
     15908    if np.abs(imaxlon - rmaxlon) > 100.:
     15909        print warnmsg
     15910        print '  ' + fname + ': reshaping longitudes!'
     15911        print '    input maximum lon:', imaxlon   
     15912        print '    target maximum lon:', rmaxlon   
     15913        print '    shifting input longitudes...'
     15914        if rmaxlon > 180.:
     15915            ilonvals = np.where(ilonvals < 0., ilonvals + 360., ilonvals)
     15916        else:
     15917            ilonvals = np.where(ilonvals > 180., ilonvals - 360., ilonvals)
     15918
    1590215919    idx = ilonvals.shape[1]
    1590315920    idy = ilonvals.shape[0]
Note: See TracChangeset for help on using the changeset viewer.