Commit c5c03866 authored by Espen Sollum's avatar Espen Sollum
Browse files

Basic files added for flexpart

parent c5094e69
...@@ -28,7 +28,8 @@ verbose: 1 ...@@ -28,7 +28,8 @@ verbose: 1
logfile: pyvar.logtest logfile: pyvar.logtest
# Execution directory # Execution directory
workdir : /home/chimereges/aberchet/CIF_dummy_test/ #workdir : /home/eso/repos/CIF/test/
workdir : /home/eso/tmp/CIFtest
# Initial date # Initial date
# Use the following compatible format for the date: # Use the following compatible format for the date:
...@@ -58,7 +59,8 @@ mode: ...@@ -58,7 +59,8 @@ mode:
name: forward name: forward
version: std version: std
perturb_obsvect: True perturb_obsvect: True
obserror: 0.01 # obserror: 0.01
obserror: 0.25
##################################################################### #####################################################################
##################################################################### #####################################################################
...@@ -73,7 +75,7 @@ model : ...@@ -73,7 +75,7 @@ model :
version : std version : std
# H matrix # H matrix
fic_pg : /home/users/aberchet/CIF/model_sources/dummy_gauss/Pasquill-Gifford.txt fic_pg : /home/eso/repos/CIF/model_sources/dummy_gauss/Pasquill-Gifford.txt
##################################################################### #####################################################################
##################################################################### #####################################################################
...@@ -90,8 +92,10 @@ measurements : ...@@ -90,8 +92,10 @@ measurements :
version: std version: std
# File where to save data, if does not exist. Reads from there if exists # File where to save data, if does not exist. Reads from there if exists
fic_monitor : /home/chimereges/aberchet/CIF_dummy_test/monitor_reference.nc fic_monitor : /home/eso/tmp/CIFtest/monitor_reference.nc
# fic_monitor : /home/eso/tmp/CIFtest/monitor_reference.csv
dump_type : nc dump_type : nc
# dump_type : csv
species : species :
# List of tracers to include in the monitor file # List of tracers to include in the monitor file
# For each tracer observations, please specify: # For each tracer observations, please specify:
...@@ -127,8 +131,10 @@ obsvect: ...@@ -127,8 +131,10 @@ obsvect:
plugin: plugin:
name: standard name: standard
version: std version: std
fic_obsvect : /home/chimereges/aberchet/CIF_dummy_test/monitor_reference.nc fic_obsvect : /home/eso/tmp/CIFtest/monitor_reference.nc
# fic_obsvect : /home/eso/tmp/CIFtest/monitor_reference.csv
dump_type: nc dump_type: nc
# dump_type: csv
##################################################################### #####################################################################
##################################################################### #####################################################################
...@@ -169,13 +175,13 @@ controlvect: ...@@ -169,13 +175,13 @@ controlvect:
errtype : max errtype : max
err : 1 err : 1
period : '1D' period : '1D'
dir: /home/chimereges/aberchet/CIF_dummy_test/controlvect/ dir: /home/eso/tmp/CIFtest/controlvect/
fic: flx_real.txt fic: flx_real.txt
hcorrelations : hcorrelations :
landsea: False landsea: False
dump_hcorr : True dump_hcorr : True
dircorrel : /home/chimereges/aberchet/CIF_dummy_test/controlvect/ dircorrel : /home/eso/tmp/CIFtest/controlvect/
sigma: 3000 sigma: 1000
tcorrelations : tcorrelations :
sigma_t: 5 sigma_t: 5
flx_text: 'CIF' flx_text: 'CIF'
...@@ -207,8 +213,7 @@ meteo : ...@@ -207,8 +213,7 @@ meteo :
plugin : plugin :
name : dummy name : dummy
version : csv version : csv
dirmeteo : /home/users/aberchet/CIF/data/dummy_gauss/ dirmeteo : /home/eso/repos/CIF/data/dummy_gauss/
ficmeteo : meteo2.csv ficmeteo : meteo.csv
resolution: '1H' #####################################################################
##################################################################### #####################################################################
#####################################################################
\ No newline at end of file
...@@ -22,13 +22,13 @@ ...@@ -22,13 +22,13 @@
# Verbose level # Verbose level
# 1 = Basic information # 1 = Basic information
# 2 = Debugging # 2 = Debugging
verbose : 1 verbose : 2
# Log file (to be saved in $wordkir) # Log file (to be saved in $wordkir)
logfile: pyCIF.logtest logfile: pyCIF.logtest
# Execution directory # Execution directory
workdir : /home/chimereges/aberchet/CIF_dummy_test_inv/ workdir : /home/eso/tmp/CIFtest
# Initial date # Initial date
# Use the following compatible format for the date: # Use the following compatible format for the date:
...@@ -76,7 +76,12 @@ model : ...@@ -76,7 +76,12 @@ model :
version : std version : std
# H matrix # H matrix
fic_pg : /home/users/aberchet/CIF/model_sources/dummy_gauss/Pasquill-Gifford.txt fic_pg : /home/eso/repos/CIF/model_sources/dummy_gauss/Pasquill-Gifford.txt
#####################################################################
#####################################################################
# Save H for later use in inversions
save_H: True
##################################################################### #####################################################################
##################################################################### #####################################################################
...@@ -90,7 +95,7 @@ obsvect: ...@@ -90,7 +95,7 @@ obsvect:
plugin: plugin:
name: standard name: standard
version: std version: std
fic_obsvect : /home/chimereges/aberchet//CIF_dummy_test/obsvect/monitor.nc fic_obsvect : /home/eso/tmp/CIFtest/monitor_reference.nc
dump_type: nc dump_type: nc
##################################################################### #####################################################################
##################################################################### #####################################################################
...@@ -162,12 +167,13 @@ controlvect: ...@@ -162,12 +167,13 @@ controlvect:
errtype : avg errtype : avg
xb_value : 1 xb_value : 1
err : 1 err : 1
period : '2D' period : '1D'
flx_text: '' dir: /home/eso/tmp/CIFtest/controlvect/
fic: flx_real.txt
hcorrelations : hcorrelations :
landsea: False landsea: False
dump_hcorr : True dump_hcorr : True
dircorrel : /home/chimereges/aberchet/CIF_dummy_test_inv/ dircorrel : /home/eso/tmp/CIFtest/controlvect/
sigma: 1000 sigma: 1000
tcorrelations : tcorrelations :
sigma_t: 200 sigma_t: 200
...@@ -175,3 +181,32 @@ controlvect: ...@@ -175,3 +181,32 @@ controlvect:
##################################################################### #####################################################################
#####################################################################
#####################################################################
# Domain definition
domain :
plugin :
name : dummy
version : std
xmin: 0
xmax: 25000
nlon: 30
ymin: 0
ymax: 20000
nlat: 15
#####################################################################
#####################################################################
#####################################################################
#####################################################################
# Meteo definition
meteo :
plugin :
name : dummy
version : csv
dirmeteo : /home/eso/repos/CIF/data/dummy_gauss/
ficmeteo : meteo.csv
#####################################################################
#####################################################################
...@@ -22,13 +22,14 @@ ...@@ -22,13 +22,14 @@
# Verbose level # Verbose level
# 1 = Basic information # 1 = Basic information
# 2 = Debugging # 2 = Debugging
verbose : 1 verbose : 2
# Log file (to be saved in $wordkir) # Log file (to be saved in $wordkir)
logfile: pyvar.logtest logfile: pyvar.logtest
# Execution directory # Execution directory
workdir : /home/chimereges/aberchet/CIF_dummy_test/ #workdir : /home/eso/repos/CIF/test/
workdir : /home/eso/tmp/CIFtest
# Initial date # Initial date
# Use the following compatible format for the date: # Use the following compatible format for the date:
...@@ -57,8 +58,8 @@ mode: ...@@ -57,8 +58,8 @@ mode:
plugin: plugin:
name: post-proc name: post-proc
version: std version: std
controlvect_fic: /home/chimereges/aberchet/CIF_dummy_test/controlvect_final.pickle # controlvect_fic: /home/eso/tmp/CIF_dummy_test/controlvect_final.pickle
# controlvect_fic: /home/chimereges/aberchet/CIF_dummy_test/obsoperator/fwd_-001/controlvect.pickle controlvect_fic: /home/eso/tmp/CIFtest/obsoperator/fwd_-001/controlvect.pickle
##################################################################### #####################################################################
##################################################################### #####################################################################
...@@ -73,7 +74,7 @@ model : ...@@ -73,7 +74,7 @@ model :
version : std version : std
# H matrix # H matrix
fic_pg : /home/users/aberchet/CIF/model_sources/dummy_gauss/Pasquill-Gifford.txt fic_pg : /home/eso/repos/CIF/model_sources/dummy_gauss/Pasquill-Gifford.txt
##################################################################### #####################################################################
##################################################################### #####################################################################
...@@ -90,7 +91,9 @@ measurements : ...@@ -90,7 +91,9 @@ measurements :
version: std version: std
# File where to save data, if does not exist. Reads from there if exists # File where to save data, if does not exist. Reads from there if exists
fic_monitor : /home/chimereges/aberchet/CIF_dummy_test/monitor_reference.nc fic_monitor :
# /home/chimereges/aberchet/CIF_dummy_test/monitor_reference.nc
/home/eso/tmp/CIFtest/monitor_reference.nc
dump_type : nc dump_type : nc
species : species :
# List of tracers to include in the monitor file # List of tracers to include in the monitor file
...@@ -134,7 +137,7 @@ obsvect: ...@@ -134,7 +137,7 @@ obsvect:
plugin: plugin:
name: standard name: standard
version: std version: std
fic_obsvect : /home/chimereges/aberchet/CIF_dummy_test/monitor_reference.nc fic_obsvect : /home/eso/tmp/CIFtest/monitor_reference.nc
dump_type: nc dump_type: nc
##################################################################### #####################################################################
##################################################################### #####################################################################
...@@ -175,12 +178,12 @@ controlvect: ...@@ -175,12 +178,12 @@ controlvect:
errtype : max errtype : max
err : 1 err : 1
period : '1D' period : '1D'
dir: /home/chimereges/aberchet/CIF_dummy_test/controlvect/ dir: /home/eso/tmp/CIFtest/controlvect/
fic: flx_real.txt fic: flx_real.txt
hcorrelations : hcorrelations :
landsea: False landsea: False
dump_hcorr : True dump_hcorr : True
dircorrel : /home/chimereges/aberchet/CIF_dummy_test/controlvect/ dircorrel : /home/eso/tmp/CIFtest/controlvect/
sigma: 100 sigma: 100
tcorrelations : tcorrelations :
sigma_t: 5 sigma_t: 5
...@@ -214,7 +217,7 @@ meteo : ...@@ -214,7 +217,7 @@ meteo :
plugin : plugin :
name : dummy name : dummy
version : csv version : csv
dirmeteo : /home/users/aberchet/CIF/data/dummy_gauss/ dirmeteo : /home/eso/repos/CIF/data/dummy_gauss/
ficmeteo : meteo.csv ficmeteo : meteo.csv
##################################################################### #####################################################################
##################################################################### #####################################################################
......
...@@ -30,8 +30,7 @@ logfile: pyvar.logtest ...@@ -30,8 +30,7 @@ logfile: pyvar.logtest
# Execution directory # Execution directory
#workdir : /home/satellites13/msaunois/INVERSION/GCP_2018/run_00_18_inca_base_network/ #workdir : /home/satellites13/msaunois/INVERSION/GCP_2018/run_00_18_inca_base_network/
#workdir : /home/satellites13/aberchet/msaunois/ workdir : /home/eso/tmp/CIFtest/
workdir : /home/chimereges/aberchet/GCP_congrad_obs/
# Initial date # Initial date
# Use the following compatible format for the date: # Use the following compatible format for the date:
...@@ -70,31 +69,7 @@ mode: ...@@ -70,31 +69,7 @@ mode:
plugin: plugin:
name: 4dvar name: 4dvar
version: std version: std
minimizer: controlvect_fic: /home/eso/tmp/CIFtest/obsoperator/adj_0011/controlvect.pickle
plugin:
name: congrad
version: std
simulator:
plugin:
name: gausscost
version: std
reload_from_previous: True
maxiter: 20
epsg: 0.02
df1: 0.01
chi_min:
chi_max:
#mode:
# plugin:
# name: adj-tl_test
# version: std
# increments: 0.2
# incrmode: cst
# testspace: control
# reload_results: True
#####################################################################
#####################################################################
##################################################################### #####################################################################
##################################################################### #####################################################################
...@@ -401,23 +376,18 @@ meteo: ...@@ -401,23 +376,18 @@ meteo:
################## ##################
# Parameters below are not yet included in PYVAR # Parameters below are not yet included in PYVAR
#
#
## surface geopotential file # surface geopotential file
#ficgeopot : null ficgeopot : null
#
## first guess path of the file if wanted # first guess path of the file if wanted
#prevanal: null prevanal: null
## LMDz precomputed (1) or not (0) # LMDz precomputed (1) or not (0)
#precalc : 0 precalc : 0
## perturb predefined prior/concentrations # perturb predefined prior/concentrations
#perturbdir : null perturbdir : null
## seed for random number generation # seed for random number generation
#seed : 3 seed : 3
## diagnostics (0=none; 1=1D(time); 2=2D(lev,time); 3=4D(lat,lon,lev,time) ) # diagnostics (0=none; 1=1D(time); 2=2D(lev,time); 3=4D(lat,lon,lev,time) )
#diag : 0 diag : 0
#
#
#
#
#
...@@ -23,11 +23,13 @@ L_BIBIO = -lbibio ...@@ -23,11 +23,13 @@ L_BIBIO = -lbibio
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# Option de compilation FORTRAN # Option de compilation FORTRAN
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
OPTIMTRU90 = -cpp -O3 -DCPP_PARA -assume byterecl -r8 -DNC_DOUBLE -assume buffered_io #-check all -traceback #OPTIMTRU90 = -cpp -O3 -DCPP_PARA -assume byterecl -r8 -DNC_DOUBLE -assume buffered_io #-check all -traceback
INCLUDE = -I$(LIBF)/grid -I$(LIBF)/bibio -I. -I$(LIBF)/dyn3d -I/usr/local/include -I$(LIBF)/phylmd -I${LOCAL_DIR}/libo -module $(LIBO) -I $(LIBO) OPTIMTRU90 = -Wfatal-errors -cpp -O3 -DCPP_PARA -fdefault-real-8 -DNC_DOUBLE -fcray-pointer #-check all -traceback
INCLUDE = -I$(LIBF)/grid -I$(LIBF)/bibio -I. -I$(LIBF)/dyn3d -I/usr/local/include -I$(LIBF)/phylmd -I${LOCAL_DIR}/libo -J$(LIBO) -I$(LIBO)
F90 = mpif90 F90 = mpif90
COMPTRU90 = $(F90) $(OPTIMTRU90) $(INCLUDE) -c COMPTRU90 = $(F90) $(OPTIMTRU90) $(INCLUDE) -c
LINK = $(F90) -cpp -O -DCPP_PARA -DUSE_VT -align all -assume byterecl -r8 -DNC_DOUBLE -assume buffered_io -extend_source -I${LOCAL_DIR}/libo -module $(LIBO) -I $(LIBO) #LINK = $(F90) -cpp -O -DCPP_PARA -DUSE_VT -align all -assume byterecl -r8 -DNC_DOUBLE -assume buffered_io -extend_source -I${LOCAL_DIR}/libo -module $(LIBO) -I $(LIBO)
LINK = $(F90) -cpp -O -DCPP_PARA -DUSE_VT -fdefault-real-8 -DNC_DOUBLE -I${LOCAL_DIR}/libo -J$(LIBO) -I$(LIBO)
AR = ar AR = ar
#OPTION_LINK = -L/usr/local/lib -lnetcdff -lnetcdf -I/usr/local/include #OPTION_LINK = -L/usr/local/lib -lnetcdff -lnetcdf -I/usr/local/include
OPTION_LINK = -lnetcdff -lnetcdf OPTION_LINK = -lnetcdff -lnetcdf
......
#!/usr/bin/env python #!/usr/bin/env python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
"""config sub-module """config sub-module
This module handles the configuration of the pyCIF runs. It loads a Yaml This module handles the configuration of the pyCIF runs. It loads a Yaml
configuration file including all paramaters necessary to setting up pyCIF. configuration file including all paramaters necessary to setting up pyCIF.
""" """
import yaml import yaml
import os import os
import pycif.utils.check as check import pycif.utils.check as check
import pycif.utils.dates as dates import pycif.utils.dates as dates
def load(def_file): def load(def_file):
"""Generates a dictionary including all pyCIF parameters """Generates a dictionary including all pyCIF parameters
Args: Args:
def_file (string) : Path to the definition file def_file (string) : Path to the definition file
Handles both absolute and relative paths Handles both absolute and relative paths
Returns: Returns:
config_dict (dictionary): Dictionary populated with all pyCIF parameters config_dict (dictionary): Dictionary populated with all pyCIF parameters
""" """
fic = os.path.abspath(def_file) fic = os.path.abspath(def_file)
try: try:
with open(fic, 'r') as f: with open(fic, 'r') as f:
config_dict = yaml.load(f) config_dict = yaml.load(f)
config_dict['def_file'] = fic config_dict['def_file'] = fic
# Converting dates to datetime if necessary # Converting dates to datetime if necessary
config_dict['datei'] = dates.date2datetime(config_dict['datei']) config_dict['datei'] = dates.date2datetime(config_dict['datei'])
config_dict['datef'] = dates.date2datetime(config_dict['datef']) config_dict['datef'] = dates.date2datetime(config_dict['datef'])
return config_dict return config_dict
except IOError as e: except IOError as e:
print "Couldn't find config file", fic print "Couldn't find config file", fic
print "Please check directories" print "Please check directories"
raise e raise e
except yaml.scanner.ScannerError as e: except yaml.scanner.ScannerError as e:
print "Error in the syntax of config file", fic print "Error in the syntax of config file", fic
raise e raise e
def config_verbose(config_dict): def config_verbose(config_dict):
"""Prints out main input parameters for pyCIF """Prints out main input parameters for pyCIF
""" """
verbose_txt = [ verbose_txt = [
"pyCIF has been initialized with the following parameters:", "pyCIF has been initialized with the following parameters:",
"Yaml configuration file: {}".format(config_dict['def_file']), "Yaml configuration file: {}".format(config_dict['def_file']),
"Log file: {}".format(config_dict['logfile']), "Log file: {}".format(config_dict['logfile']),
"Start date: {}".format(config_dict['datei']), "Start date: {}".format(config_dict['datei']),
"End date: {}".format(config_dict['datef']), "End date: {}".format(config_dict['datef']),
"Working directory: {}".format(config_dict['workdir']), "Working directory: {}".format(config_dict['workdir']),
] ]
map(lambda v: check.verbose(v), verbose_txt) map(lambda v: check.verbose(v), verbose_txt)
...@@ -4,8 +4,10 @@ ...@@ -4,8 +4,10 @@
import lmdz import lmdz
import chimere import chimere
import dummy import dummy
import flexpart
from pycif.utils.classes.models import Model from pycif.utils.classes.models import Model
Model.register_plugin('LMDZ', 'std', lmdz) Model.register_plugin('LMDZ', 'std', lmdz)
Model.register_plugin('CHIMERE', 'std', chimere) Model.register_plugin('CHIMERE', 'std', chimere)
Model.register_plugin('FLEXPART', 'std', flexpart)
Model.register_plugin('dummy', 'std', dummy) Model.register_plugin('dummy', 'std', dummy)
...@@ -238,6 +238,15 @@ class Plugin(object): ...@@ -238,6 +238,15 @@ class Plugin(object):
importlib.import_module(subclass[0], 'pycif.utils.classes'), importlib.import_module(subclass[0], 'pycif.utils.classes'),
subclass[1]) subclass[1])
@classmethod
def print_registered(cls):
"""Print all registered plugins.
"""
print cls.registered
@classmethod @classmethod
def load_registered(cls, name, version, plg_type, plg_orig=None): def load_registered(cls, name, version, plg_type, plg_orig=None):
"""Get a sub-class instance of a registered plugin. """Get a sub-class instance of a registered plugin.
......
...@@ -63,7 +63,7 @@ class Setup(Plugin): ...@@ -63,7 +63,7 @@ class Setup(Plugin):
try: