Exemplo n.º 1
0
 #
 import clogging, site_settings , cache, standard_operators, cmacro
 tim("imports")
 print("Climaf version = "+version,file=sys.stderr)
 #
 # Set default logging levels
 clogging.clog(os.getenv("CLIMAF_LOG_LEVEL","warning"))
 clogging.clog_file(os.getenv("CLIMAF_LOGFILE_LEVEL","info"))
 tim("loggings")
 #    
 # Decide for cache location
 if site_settings.onCiclad :
     default_cache="/data/"+os.getenv("USER")+"/climaf_cache"
 else: default_cache="~/tmp/climaf_cache"
 cachedir=os.getenv("CLIMAF_CACHE",default_cache)
 cache.setNewUniqueCache(cachedir)
 print ("Cache directory set to : "+cachedir+" (use $CLIMAF_CACHE if set) ",file=sys.stderr)
 tim("set cache")
 #
 # Init dynamic CliMAF operators, and import projects and some funcs in main
 exec "from climaf.projects  import *" in sys.modules['__main__'].__dict__
 tim("execs_projects")
 exec "from climaf.classes   import ds, eds, cens" in sys.modules['__main__'].__dict__
 tim("execs_classes")
 exec "from climaf.operators import cscript" in sys.modules['__main__'].__dict__
 tim("execs_cscript")
 standard_operators.load_standard_operators()
 tim("load_ops")
 #
 # Read and execute user config file
 conf_file=os.path.expanduser("~/.climaf")
Exemplo n.º 2
0
 print("Climaf version = " + version, file=sys.stderr)
 logdir = os.path.expanduser(os.getenv("CLIMAF_LOG_DIR", "."))
 #
 # Set default logging levels
 clogging.logdir = os.path.expanduser(os.getenv("CLIMAF_LOG_DIR", "."))
 clogging.clog(os.getenv("CLIMAF_LOG_LEVEL", "warning"))
 clogging.clog_file(os.getenv("CLIMAF_LOGFILE_LEVEL", "info"))
 tim("loggings")
 #
 # Decide for cache location
 if site_settings.onCiclad:
     default_cache = "/data/" + os.getenv("USER") + "/climaf_cache"
 else:
     default_cache = "~/tmp/climaf_cache"
 cachedir = os.getenv("CLIMAF_CACHE", default_cache)
 cache.setNewUniqueCache(cachedir, raz=False)
 print("Cache directory set to : " + cachedir +
       " (use $CLIMAF_CACHE if set) ",
       file=sys.stderr)
 tim("set cache")
 # Decide for cache location for remote data
 remote_cachedir = os.getenv("CLIMAF_REMOTE_CACHE",
                             cachedir + "/remote_data")
 print("Cache directory for remote data set to : " + remote_cachedir +
       " (use $CLIMAF_REMOTE_CACHE if set) ",
       file=sys.stderr)
 #
 # Init dynamic CliMAF operators, and import projects and some funcs in main
 tim("execs_projects")
 exec("from climaf.classes   import ds, eds, cens, fds"
      ) in sys.modules['__main__'].__dict__
Exemplo n.º 3
0
 #
 import clogging, site_settings , cache, standard_operators, cmacro
 tim("imports")
 print("Climaf version = "+version,file=sys.stderr)
 #
 # Set default logging levels
 clogging.clog(os.getenv("CLIMAF_LOG_LEVEL","warning"))
 clogging.clog_file(os.getenv("CLIMAF_LOGFILE_LEVEL","info"))
 tim("loggings")
 #    
 # Decide for cache location
 if site_settings.onCiclad :
     default_cache="/data/"+os.getenv("USER")+"/climaf_cache"
 else: default_cache="~/tmp/climaf_cache"
 cachedir=os.getenv("CLIMAF_CACHE",default_cache)
 cache.setNewUniqueCache(cachedir,raz=False)
 print ("Cache directory set to : "+cachedir+" (use $CLIMAF_CACHE if set) ",file=sys.stderr)
 tim("set cache")
 #
 # Init dynamic CliMAF operators, and import projects and some funcs in main
 exec "from climaf.projects  import *" in sys.modules['__main__'].__dict__
 tim("execs_projects")
 exec "from climaf.classes   import ds, eds, cens, fds" in sys.modules['__main__'].__dict__
 tim("execs_classes")
 exec "from climaf.operators import cscript" in sys.modules['__main__'].__dict__
 tim("execs_cscript")
 standard_operators.load_standard_operators()
 tim("load_ops")
 #
 # Read and execute user config file
 conf_file=os.path.expanduser("~/.climaf")