Changeset 466


Ignore:
Timestamp:
Dec 9, 2011, 5:10:15 PM (13 years ago)
Author:
acolaitis
Message:

Added localtime.e and streamfunction.e to the gcm wrapper.

Location:
trunk/UTIL/PYTHON
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/UTIL/PYTHON/README.MCS

    r465 r466  
    2727-------
    2828-------
    29 Ok, but after all, I want to interpolate these fields on the vertical grid used by MCS... (make sure to have rho in
    30 your file for a better interpolation. You also need aps, bps, and ps)
     29Ok, but after all, I want to interpolate these fields on the vertical grid used in the MCS data... (make sure to have rho in
     30your file for a better interpolation. You also need aps, bps, ps and phisinit, at least in diagfi.nc or phisinit.nc.)
    3131
    3232command -> mcs.py -f $YourSimulation/diagfi.nc -m /d5/lmlmd/MCS_processeddata/MCSdata_binned_MY29.nc --var temp,co2ice -i
     
    3434-------
    3535-------
    36 Ok, but I dont care for the intermediary diagfi_P.nc file, it takes to much space. I want to remove it automatically
     36Ok, but I dont care for the intermediary diagfi_P.nc file, it takes too much space. I want to remove it automatically
    3737after the computation
    3838
     
    4444
    4545command -> mcs.py -f $YourSimulation/diagfi.nc -m /d5/lmlmd/MCS_processeddata/MCSdata_binned_MY29.nc --var temp,co2ice -i --ditch -H
    46 output -> diagfi_P_h_MCS.nc
     46output -> diagfi_h_P_MCS.nc
    4747-------
    4848-------
     
    5151
    5252command -> mcs.py -f $YourSimulation/diagfi.nc -m /d5/lmlmd/MCS_processeddata/MCSdata_binned_MY29.nc --var temp,co2ice -i -H
    53 output -> diagfi_P_h_MCS.nc
     53output -> diagfi_h_P_MCS.nc
    5454-------
    5555-------
     
    5757
    5858command -> mcs.py -f $YourSimulation/diagfi.nc -m /d5/lmlmd/MCS_processeddata/MCSdata_binned_MY29.nc --var temp,co2ice -i -H --override
    59 output -> diagfi_P_h_MCS.nc
     59output -> diagfi_P.nc , diagfi_h_P.nc , diagfi_h_P_MCS.nc
    6060-------
  • trunk/UTIL/PYTHON/gcm_transformations.py

    r465 r466  
    33### A. Colaitis -- LMD -- 08/11/2011 <-- Added ZRECAST for altitude mode, and MCS and TES modes for Pressure
    44### A. Colaitis -- LMD -- 08/11/2011 <-- Added HRECAST for MCS and TES predefined grids
    5 ###
    6 
    7 ### TODO
    8 ### add wrapper to streamfunction.e
    9 ### add wrapper to localtime.e
     5###                                      Added wrapper to streamfunction.e
     6###                                      Added wrapper to localtime.e
    107
    118def call_zrecast (  interp_mode   = '4', \
     
    119116    return output_name
    120117
     118def call_localtime (  input_name = None, \
     119                    fields  = 'all', \
     120                    times = None):
     121
     122    import numpy as np
     123    from myplot import separatenames
     124    from os import system
     125    system("rm -f localtime.auto.def")
     126    system("touch localtime.auto.def")
     127    indicefile=0
     128    outputfilename=""
     129    append="_LT"
     130    f = open('localtime.auto.def', 'w')
     131    for zfile in input_name:
     132        f.write(zfile+"\n")
     133        for zvar in fields:
     134             f.write(zvar+"\n")
     135        f.write("\n")
     136    f.write(str(len(times))+"\n")
     137    for t in times:
     138        f.write(str(t)+"\n")
     139    f.close()
     140    system("localtime.e < localtime.auto.def")
     141
     142    if indicefile is 0:
     143          outputfilename=input_name[indicefile][0:len(input_name[0])-3]+append+".nc"
     144    else:
     145          outputfilename=outputfilename+","+input_name[indicefile][0:len(input_name[0])-3]+append+".nc"
     146    indicefile = indicefile +1
     147
     148    for i in range(len(outputfilename)):
     149        output_name = separatenames(outputfilename)
     150
     151    return output_name
     152
     153def call_streamfunction (  input_name = None):
     154    import numpy as np
     155    from myplot import separatenames
     156    from os import system
     157    system("rm -f streamfunction.auto.def")
     158    system("touch streamfunction.auto.def")
     159    indicefile=0
     160    outputfilename=""
     161    append="_stream"
     162    f = open('streamfunction.auto.def', 'w')
     163    for zfile in input_name:
     164        f.write(zfile+"\n")
     165    f.close()
     166    system("streamfunction.e < streamfunction.auto.def")
     167
     168    if indicefile is 0:
     169          outputfilename=input_name[indicefile][0:len(input_name[0])-3]+append+".nc"
     170    else:
     171          outputfilename=outputfilename+","+input_name[indicefile][0:len(input_name[0])-3]+append+".nc"
     172    indicefile = indicefile +1
     173
     174    for i in range(len(outputfilename)):
     175        output_name = separatenames(outputfilename)
     176
     177    return output_name
     178
Note: See TracChangeset for help on using the changeset viewer.