Changeset 4163 for dynamico_lmdz/guided


Ignore:
Timestamp:
Oct 17, 2019, 6:27:03 PM (5 years ago)
Author:
jisesh
Message:

guided: Improved input data preperation from CAMELOT data sets

Location:
dynamico_lmdz/guided/Data
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • dynamico_lmdz/guided/Data/job_interpolation_camelot.sh

    r4159 r4163  
    33#PBS -q day
    44#PBS -n
    5 #PBS -l nodes=1:ppn=8
     5#PBS -l nodes=1:ppn=64
    66#PBS -l walltime=20:30:00
    77#PBS -l mem=120gb
     
    99
    1010#####comment:PBS -l mem=31922327552,ncpus=60
    11 #Jobs start in the HOME directory, cd to submitted directory
    1211cd "$PBS_O_WORKDIR"
    1312
     
    3433
    3534
    36 export OMP_NUM_THREADS=1
    37 export OMP_STACKSIZE=128M
     35#export OMP_NUM_THREADS=1
     36#export OMP_STACKSIZE=128M
    3837ulimit -s unlimited
    3938
    4039module load python/2.7-anaconda50
    4140python vertical_interpolation_camelot.py >> vertical_interpolation.log
    42 #mpirun -np 40 -cpus-per-proc $OMP_NUM_THREADS -bycore -bind-to-core -report-bindings ./gcm.exe >> gcm.log
    43 #gdb ./gcm.exe >> gcm.log
    4441
    4542
  • dynamico_lmdz/guided/Data/vertical_interpolation_camelot.py

    r4159 r4163  
    11from __future__ import division
    2 import argparse
    32import numpy as np
    43from netCDF4 import Dataset
    5 import matplotlib.pyplot as plt
    6 from mpl_toolkits.basemap import Basemap
    7 import matplotlib.mlab as mlab
    8 import matplotlib.colors
    94import sys
    105import os
    116import math
    127from scipy.interpolate import interp1d
    13 from matplotlib.ticker import AutoMinorLocator
    148import netCDF4 as cdf
     9
     10
     11#levels = [100., 200., 300., 500., 700., 1000., 2000., 3000., 5000., 7000., 10000., 12500., 15000., 17500., 20000., 22500.,25000., 30000., 35000., 40000.,
     12#    45000., 50000., 55000., 60000., 65000., 70000., 75000., 77500., 80000., 82500., 85000., 87500., 90000., 92500., 95000., 97500., 100000.]
     13levels = [1., 2., 3., 5., 7., 10., 20., 30., 50., 70., 100., 125., 150., 175., 200., 225.,250., 300., 350., 400.,
     14    450., 500., 550., 600., 650., 700., 750., 775., 800., 825., 850., 875., 900., 925., 950., 975., 1000.]
     15levels = levels[::-1]
     16print(levels)
    1517
    1618dw1 = Dataset('2001.nc','r')
     
    1820dpfulloned = dw1.variables['level'][:]
    1921dpfull = np.zeros(((len(dpfulloned),dtfull.shape[2],dtfull.shape[3])))
    20 for l in xrange(0, len(dpfulloned)):
     22#------ mb conversion
     23#dpfulloned = dpfulloned *100.
     24for l in range(0, len(dpfulloned)):
    2125    dpfull[l,:,:]= dpfulloned[l]
    22        
    2326print(dpfull)
     27
    2428dtfull = dw1.variables['t'][:,:,:,:]
    2529#dPSfull = dw1.variables['PS'][:,:,:]
     
    2731lat = dw1.variables['lat'][:]
    2832lon = dw1.variables['lon'][:]
    29 levels = [100., 200., 300., 500., 700., 1000., 2000., 3000., 5000., 7000., 10000., 12500., 15000., 17500., 20000., 22500.,25000., 30000., 35000., 40000.,
    30     45000., 50000., 55000., 60000., 65000., 70000., 75000., 77500., 80000., 82500., 85000., 87500., 90000., 92500., 95000., 97500., 100000.]
    31 
    32 levels = levels[::-1]
    33 print(levels)
    3433
    3534dim0=dtfull.shape[0]
     
    5049pfull = dpfull
    5150
    52 for t in range(dim1):
     51for t in range(dim0):
    5352    print("time step=",t)
    5453    tfull = dtfull[t,:,:,:]
    5554    out2 = vertical_int2(levels, pfull, tfull)
    5655    out3[t,:,:,:]=out2[:,:,:]
    57 
    5856del tfull,dtfull
    5957
    6058dufull = dw1.variables['u'][:,:,:,:]
    6159out4 = np.zeros((((dim0,len(levels),dim2,dim3))))
    62 for t in range(dim1):
     60for t in range(dim0):
    6361    print("time step=",t)
    6462    ufull = dufull[t,:,:,:]
     
    6967dvfull = dw1.variables['v'][:,:,:,:]
    7068out5 = np.zeros((((dim0,len(levels),dim2,dim3))))
    71 for t in range(dim1):
     69for t in range(dim0):
    7270    print("time step=",t)
    7371    vfull = dvfull[t,:,:,:]
     
    7674del vfull,dvfull
    7775
     76
    7877print("-----------------------------writing NetCDF--------------------------------")
    7978print(out3)
    80 #sys.exit(0)
    8179try:
    8280    f = cdf.Dataset('interpolated_data.nc', 'w', format='NETCDF4')
    8381except:
    8482    print("Error occurred while opening new netCDF file, Error: ", sys.exc_info()[0])
    85 levels2 = [levels[i] / 100. for i in range(len(levels))]
     83#levels2 = [levels[i] / 100. for i in range(len(levels))]
     84levels2 = levels
    8685#levels2 = [int(i) for i in levels2]
    87 #print(levels2)
    8886f.createDimension('lon', len(lon))
    8987f.createDimension('lat', len(lat))
Note: See TracChangeset for help on using the changeset viewer.