Beispiel #1
0
  for project in ['CMIP6', 'CMIP6_extent']:
      ## --> systematic arguments = simulation, frequency, variable
      ## -- Set the aliases for the frequency
      ## -- Set default values
      cdef('root'         , root          , project=project)
      cdef('institute'    , '*'           , project=project)
      cdef('model'        , '*'           , project=project)
      cdef('mip'          , '*'           , project=project)
      #cdef('table'        , '*'           , project='CMIP6') # impossible, because of ambiguities
      cdef('grid'         , 'g*'          , project=project)
      cdef('realization'  , 'r1i1p1f*'    , project=project)
      cdef('experiment'  , 'historical'   , project=project)
      cdef('version'     , 'latest'       , project=project)
      cdef('table'        , '*'           , project=project)
      #
      calias(project, 'tos', offset=273.15)
      calias(project, 'thetao', offset=273.15)
      calias(project, 'sivolu', 'sivol')
      calias(project, 'sic', 'siconc')
      calias(project, 'sit', 'sithick')
      calias(project, 'NO3', 'no3')
      calias(project, 'PO4', 'po4')
      calias(project, 'Si', 'si')
      calias(project, 'O2', 'o2')

  cdef('extent_experiment', 'ssp585'      , project='CMIP6_extent')


  # -------------
  ## -- Define the patterns
  base_pattern1="${root}/CMIP6/${mip}/${institute}/${model}/${experiment}/${realization}/${table}/"
Beispiel #2
0
    cdef('experiment', 'historical', project='CORDEX_extent')
    cdef('model_version', '*', project='CORDEX_extent')

    # -- CORDEX Adjust
    pattern = '${root}/CORDEX-Adjust/bias-adjusted-output/${CORDEX_domain}/${institute}/${driving_model}/' \
              '${experiment}/${realization}/${model}/${bias_correction}/${frequency}/${variable}/${version}/' \
              '${variable}_${CORDEX_domain}_${driving_model}_${experiment}_${realization}_${model}_' \
              '${bias_correction}_${frequency}_${PERIOD}.nc'
    cproject('CORDEX-Adjust', 'root', 'model', 'CORDEX_domain', 'bias_correction', 'frequency', 'driving_model',
             'realization', 'experiment', 'version', 'institute', ensemble=['model', 'driving_model', 'realization'],
             separator='%')
    dataloc(project='CORDEX-Adjust', url=pattern)
    cdef('bias_correction', '*', project='CORDEX-Adjust')
    cdef('experiment', 'rcp85', project='CORDEX-Adjust')

    for project in ['CORDEX', 'CORDEX_extent', 'CORDEX-Adjust']:
        cfreqs(project, {'daily': 'day'})
        cdef('version', 'latest', project=project)
        cdef('root', root, project=project)
        cdef('institute', '*', project=project)
        cdef('realization', 'r1i1p1', project=project)
        cdef('frequency', '*', project=project)
        cdef('driving_model', '*', project=project)
        cdef('CORDEX_domain', '*', project=project)
        cdef('model', '*', project=project)
    # -- Overwrite root only for CORDEX-Adjust 
    cdef('root', '/prodigfs/project', project='CORDEX-Adjust')

    for var in ['tas', 'tasmax', 'tasmin', 'pr', 'rsds', 'sfcWind']:
        calias('CORDEX-Adjust', var, var + 'Adjust')
Beispiel #3
0
 >>> cdef('project','gpcc')
 >>> d=ds(variable='pr',period='198001',grid='05d')
 >>> d2=ds(variable='pr',period='198001',grid='1d')
 >>> d3=ds(variable='pr',period='198001',grid='T127')

"""

from climaf.dataloc import dataloc
from climaf.classes import cproject, calias
from climaf.site_settings import atCNRM

if atCNRM:
    cproject('gpcc', 'grid')  # grid writes as '05d', '1d' or 'T127'

    url_gpcc = "/cnrm/amacs/DATA/OBS/netcdf/monthly_mean/gpcc/GPCC.Reanalysis.${grid}.nc"
    dataloc(project='gpcc', organization='generic', url=[url_gpcc])

    # Defining alias and derived variables for GPCC, together with filenames
    ##############################################################################

    calias("gpcc",
           'pr',
           'GPCC',
           scale=1. / 86400.,
           missing=1.e+20,
           units="kg m-2 s-1")

    #calias("gpcc",'GPCC'    ,'GPCC' ,                                   ,units="mm/day")
    #NSTA:="Number of stations available for a specific analysis grid in a specific month"
    #calias("gpcc",'site'    ,'NSTA'   )
Beispiel #4
0
cdef('variable', 'tas', project='CMIP6CERFACS')
cdef('table', 'Amon', project='CMIP6CERFACS')
cdef('realization', 'r*i1p1f*', project='CMIP6CERFACS')
cdef('grid', 'g*', project='CMIP6CERFACS')

# -- Specify the pattern
root1 = "/data/scratch/globc/dcom/CMIP6/${mip}/${institute}/${model}/${model}_${simulation}_${realization}/"
pathfiles1 = root1 + "${variable}_${table}_${model}_${simulation}_${realization}_${grid}_${PERIOD}.nc"
root2 = "/data/scratch/globc/dcom/PRIMAVERA/WP6_HIGHRESMIP/${model}_${simulation}_${realization}/"
pathfiles2 = root2 + "${variable}_${table}_${model}_${simulation}_${realization}_${grid}_${PERIOD}.nc"
root3 = "/data/scratch/globc/vrousseau/MODELE/${model}_${simulation}_${realization}/"
pathfiles3 = root3 + "${variable}_${table}_${model}_${simulation}_${realization}_${grid}_${PERIOD}.nc"

# -- call the dataloc CliMAF function
dataloc(project='CMIP6CERFACS', organization='generic', url=[pathfiles1])
dataloc(project='CMIP6CERFACS', organization='generic', url=[pathfiles2])
dataloc(project='CMIP6CERFACS', organization='generic', url=[pathfiles3])

# -- Define alias if necessary
calias("CMIP6CERFACS", "msftmyz", scale=1.e-3)
calias("CMIP6CERFACS", "tos", offset=273.15)
calias("CMIP6CERFACS", "thetao", offset=273.15)
calias("CMIP6CERFACS", "thetaoga", offset=273.15)
calias("CMIP6CERFACS", 'sic', 'siconc', filenameVar='siconc')
calias("CMIP6CERFACS", 'sit', 'sithick', filenameVar='sithick')
calias("CMIP6CERFACS", 'sivolu', 'sivol', filenameVar='sivol')
# Obs de MOC RAPID (Il a fallu bricoler les donnees d'origine pour la dimension time au debut et unlim)
# dataloc(project="ref_climatos",organization="generic",
#        url='/home/esanchez/data_climaf/${variable}_vertical_unlim.nc')
calias(project='ref_climatos', variable='moc', fileVariable='stream_function_mar', filenameVar='moc')
Beispiel #5
0
Example of an 'gpcp' project dataset declaration ::

 >>> cdef('project','gpcp')
 >>> d=ds(variable='pr',period='198001',grid='2.5d', frequency='monthly')
 >>> d2=ds(variable='pr',period='198001',grid='1d',frequency='daily')
 
"""


from climaf.dataloc import dataloc
from climaf.classes import cproject, calias
from climaf.site_settings import atCNRM

if atCNRM:
    cproject('gpcp','grid', ('frequency','monthly'), separator="_")  # grid writes as '1d', '2.5d', 'T42' or 'T127'

    root="/cnrm/vdr/DATA/OBS/netcdf/${frequency}"
    patmonth=root+"_mean/gpcp/${variable}_gpcp.${grid}.nc"
    patday  =root+"/gpcp/${variable}_gpcp.${grid}.nc"
    dataloc(project='gpcp', organization='generic', url=[patmonth,patday])
    
    
    # Defining alias and derived variables for GPCP, together with filenames
    ##############################################################################

    # Original data is mm/day
    calias("gpcp",'precip'    ,'precip', filenameVar='pr')   
    # Compute in SI
    calias("gpcp",'pr'    ,'precip', scale=1./86400.,units="kg m-2 s-1", filenameVar='pr')   
    
Beispiel #6
0
Example of an 'gpcc' project dataset declaration ::

 >>> cdef('project','gpcc')
 >>> d=ds(variable='pr',period='198001',grid='05d')
 >>> d2=ds(variable='pr',period='198001',grid='1d')
 >>> d3=ds(variable='pr',period='198001',grid='T127')

"""

from climaf.dataloc import dataloc
from climaf.classes import cproject, calias
from climaf.site_settings import atCNRM

if atCNRM:
    cproject('gpcc','grid')  # grid writes as '05d', '1d' or 'T127'

    url_gpcc="/cnrm/vdr/DATA/OBS/netcdf/monthly_mean/gpcc/GPCC.Reanalysis.${grid}.nc"
    dataloc(project='gpcc', organization='generic', url=[url_gpcc])


    # Defining alias and derived variables for GPCC, together with filenames
    ##############################################################################

    calias("gpcc",'pr'       ,'GPCC' ,scale=1./86400. ,missing=1.e+20, units="kg m-2 s-1")

    #calias("gpcc",'GPCC'    ,'GPCC' ,                                   ,units="mm/day")
    #NSTA:="Number of stations available for a specific analysis grid in a specific month" 
    #calias("gpcc",'site'    ,'NSTA'   ) 

Beispiel #7
0
# Frequency alias
cfreqs('IGCM_OUT', {'monthly':'1M' , 'daily':'1D' , 'seasonal':'SE', 'annual_cycle':'SE'})

urls_IGCM_OUT=[
              "/${root}/${login}/IGCM_OUT/${model}/*/${experiment}/${simulation}/${DIR}/${OUT}/*/${simulation}_YYYYMMDD_YYYYMMDD_${frequency}_${variable}.nc",
	      "/${root}/${login}/IGCM_OUT/${model}/*/${experiment}/${simulation}/${DIR}/${OUT}/${frequency}/${simulation}_${frequency}_${clim_period}_1M_${variable}.nc"
              ]


# Next command will lead to explore all directories in 'urls_IGCM_OUT'
# for searching data for a CliMAF dataset (by function ds) except if 
# a more specific dataloc entry matches the arguments to 'ds'
dataloc(project="IGCM_OUT", organization="generic", url=urls_IGCM_OUT)

# OCE
calias("IGCM_OUT", 'tos'     ,'tos'                ,filenameVar='grid_T')
calias("IGCM_OUT", 'sos'     ,'sos'                ,filenameVar='grid_T')
calias("IGCM_OUT", 'to'      ,'thetao'             ,filenameVar='grid_T')
calias("IGCM_OUT", 'so'      ,'so'                 ,filenameVar='grid_T')
calias("IGCM_OUT", 'zos'     ,'zos'                ,filenameVar='grid_T')
calias("IGCM_OUT", 'mlotst'  ,'mldr10_1'           ,filenameVar='grid_T')

# ICE
calias("IGCM_OUT", 'sic',    'siconc',   scale=100 ,filenameVar="ICE") 

# ATM
calias("IGCM_OUT", 'pr'   ,'precip' ,filenameVar='histmth')
calias("IGCM_OUT", 'psl'  ,'slp'    ,filenameVar='histmth')
calias("IGCM_OUT", 'tas'  ,'tas'    ,filenameVar='histmth')
calias("IGCM_OUT", 'tas'  ,'t2m'    ,filenameVar='histmth')
calias("IGCM_OUT", 'uas'  ,'uas'    ,filenameVar='histmth')
Beispiel #8
0
    # Next command will lead to explore all directories in 'urls_IGCM_OUT'
    # for searching data for a CliMAF dataset (by function ds) except if
    # a more specific dataloc entry matches the arguments to 'ds'
    dataloc(project="IGCM_OUT", organization="generic", url=urls_IGCM_OUT)

    # -- Note:
    # -- In the project IGCM_OUT, we have defined aliases for both the CMIP variable names (aliased to the old igcm
    #    names when necessary)
    # -- and the old IGCM names to take advantage of the mechanisms behind calias (scale, offset, filenameVar)

    # ---------------------------------------- #
    # -- Aliases to the CMIP variable names -- #

    # OCE
    calias("IGCM_OUT", 'tos', offset=273.15, filenameVar='grid_T')
    calias("IGCM_OUT", 'sos', filenameVar='grid_T')
    calias("IGCM_OUT", 'thetao', offset=273.15, filenameVar='grid_T')
    calias("IGCM_OUT", 'so', filenameVar='grid_T')
    calias("IGCM_OUT", 'zos', filenameVar='grid_T')
    calias("IGCM_OUT", 'mlotst', 'mldr10_1', filenameVar='grid_T')
    calias("IGCM_OUT", 'mlddt02', 'mld_dt02', filenameVar='grid_T')
    calias("IGCM_OUT", 'hc300', scale=1.E-9, filenameVar='grid_T')
    calias("IGCM_OUT", 'wfo', filenameVar='grid_T')

    # ICE
    calias("IGCM_OUT", 'sic', 'siconc', scale=100, filenameVar="icemod")
    calias("IGCM_OUT", 'sit', 'sithic', filenameVar="icemod")
    calias("IGCM_OUT", 'sivolu', filenameVar="icemod")

    # ATM general variables
Beispiel #9
0
    cproject('erai',('grid','_'), ('frequency','monthly'))  # no grid writes as '_' , otherwise as e.g. 'T42' or 'T127' 

    root="/cnrm/vdr/DATA/OBS/netcdf/${frequency}"
    patmonth1=root+"_mean/erai/erai_???_mm_${variable}${grid}YYYY-YYYY.nc"   #for original grid
    patmonth2=root+"_mean/erai/erai_???_mm_${variable}.${grid}.YYYY-YYYY.nc" #for other grids e.g. : grid ='T42' or 'T127'
    patday1=root+"/erai/ei_${variable}${grid}YYYY-YYYY.nc"   #for original grid
    patday2=root+"/erai/ei_${variable}_${grid}_YYYY-YYYY.nc" #for other grids e.g.: grid ='T42' or 'T127'
    dataloc(project='erai', organization='generic', url=[patmonth1,patmonth2,patday1,patday2])


    # Defining alias and derived variables for ERAI, together with filenames
    ##############################################################################
    # Valid both for daily and monthly data (to check : energy flux in W for
    # daily and Joules for monthly ????)

    calias("erai",'sic'    ,'ci'  ,filenameVar='CI')
    calias("erai",'tos'    ,'sst' ,filenameVar='SSTK')
    calias("erai",'z'      ,'z'   ,filenameVar='Z')
    calias("erai",'ta'     ,'t'   ,filenameVar='T')
    calias("erai",'ua'     ,'u'   ,filenameVar='U')
    calias("erai",'va'     ,'v'   ,filenameVar='V')
    calias("erai",'hus'    ,'q'   ,filenameVar='Q')
    calias("erai",'prw'    ,'tcw' ,filenameVar='TCW')
    calias("erai",'prc'    ,'cp'  ,filenameVar='CP')
    calias("erai",'prl'    ,'lsp' ,filenameVar='LSP')
    calias("erai",'prsn'   ,'sf'  ,filenameVar='SF')
    calias("erai",'hfss'   ,'sshf',filenameVar='SSHF')
    calias("erai",'hfls'   ,'slhf',filenameVar='SLHF')
    calias("erai",'ps'     ,'msl' ,filenameVar='MSL')
    calias("erai",'clt'    ,'tcc' ,filenameVar='TCC')
    calias("erai",'uas'    ,'u10' ,filenameVar='10U')
Beispiel #10
0
 >>> d=ds(variable='pr',period='198001',grid='2.5d', frequency='monthly')
 >>> d2=ds(variable='pr',period='198001',grid='1d',frequency='daily')
 
"""

from climaf.dataloc import dataloc
from climaf.classes import cproject, calias
from climaf.site_settings import atCNRM

if atCNRM:
    cproject('gpcp', 'grid', ('frequency', 'monthly'),
             separator="_")  # grid writes as '1d', '2.5d', 'T42' or 'T127'

    root = "/cnrm/amacs/DATA/OBS/netcdf/${frequency}"
    patmonth = root + "_mean/gpcp/${variable}_gpcp.${grid}.nc"
    patday = root + "/gpcp/${variable}_gpcp.${grid}.nc"
    dataloc(project='gpcp', organization='generic', url=[patmonth, patday])

    # Defining alias and derived variables for GPCP, together with filenames
    ##############################################################################

    # Original data is mm/day
    calias("gpcp", 'precip', 'precip', filenameVar='pr')
    # Compute in SI
    calias("gpcp",
           'pr',
           'precip',
           scale=1. / 86400.,
           units="kg m-2 s-1",
           filenameVar='pr')
Beispiel #11
0
from climaf.dataloc import dataloc
from climaf.classes import cproject, calias, cdef
from climaf.site_settings import atCNRM

if atCNRM:
    cproject('cruts3','grid')  # no grid writes as '', otherwise as e.g. 'T127'

    url1_cruts3="/cnrm/amacs/DATA/OBS/netcdf/monthly_mean/cruts3/${variable}_cru_ts_3${grid}.nc"  #for original grid
    url2_cruts3="/cnrm/amacs/DATA/OBS/netcdf/monthly_mean/cruts3/${variable}_cru_ts_3.${grid}.nc" #for other grids write e.g. as : grid ='T127'
    dataloc(project='cruts3', organization='generic', url=[url1_cruts3,url2_cruts3])


    # Defining alias and derived variables for CRUTS3, together with filenames
    ##############################################################################

    calias("cruts3",'clt'   ,'cld'  ,filenameVar='cld') 
    
    calias("cruts3",'evspsbl','pet' ,scale=1./86400. ,filenameVar='pet',units="kg m-2 s-1")
    #pet:="potential evapotranspiration"; units="mm/day" 
    #evspsbl:="water_evaporation_flux" en kg.m-2.s-1

    calias("cruts3",'pr'    ,'pr'  ,scale=1./(86400.*30.3),filenameVar='pr', units="kg m-2 s-1") 
    #pr:="precipitation"; units="mm" 
    #pr[CMIP5]:="precipitation" en kg.m-2.s-1

    calias("cruts3",'tasmin','tmn' ,scale=1., offset=273.15 ,filenameVar='tmn', units="K") 
    calias("cruts3",'tas'   ,'tmp' ,scale=1., offset=273.15 ,filenameVar='tmp', units="K") 
    calias("cruts3",'tasmax','tmx' ,scale=1., offset=273.15 ,filenameVar='tmx', units="K")
    calias("cruts3",'prw'   ,'vap' ,scale=1./0.0980665      ,filenameVar='vap', units="kg.m-2") 

Beispiel #12
0
    # Next command will lead to explore all directories in 'urls_NEMO'
    # for searching data for a CliMAF dataset (by function ds) except if
    # a more specific dataloc entry matches the arguments to 'ds'
    dataloc(project="NEMO", organization="generic", url=urls_NEMO)

    # -- Note:
    # -- In the project NEMO, we have defined aliases for both the CMIP variable names (aliased to the old igcm names
    #    when necessary)
    # -- and the old IGCM names to take advantage of the mechanisms behind calias (scale, offset, filenameVar)

    # ---------------------------------------- #
    # -- Aliases to the CMIP variable names -- #

    # OCE
    calias("NEMO", 'tos', offset=273.15, filenameVar='grid_T')
    calias("NEMO", 'sos', filenameVar='grid_T')
    calias("NEMO", 'thetao', offset=273.15, filenameVar='grid_T')
    calias("NEMO", 'so', filenameVar='grid_T')
    calias("NEMO", 'zos', filenameVar='grid_T')
    calias("NEMO", 'mlotst', 'mldr10_3', filenameVar='grid_T')
    calias("NEMO", 'mlddt02', 'mld_dt02', filenameVar='grid_T')
    calias("NEMO", 'hc300', scale=1.E-9, filenameVar='grid_T')
    calias("NEMO", 'wfo', filenameVar='grid_T')

    # ICE
    calias("NEMO", 'sic', 'siconc', scale=100, filenameVar="icemod")
    calias("NEMO", 'sit', 'sithic', filenameVar="icemod")

    # ATM general variables
    calias("NEMO", 'pr', 'precip', filenameVar='histmth')
Beispiel #13
0
"""

from climaf.dataloc import dataloc
from climaf.classes import cproject, calias
from climaf.site_settings import atCNRM

if atCNRM:
    cproject('erai-land','grid')  # no grid writes as '_' , otherwise as e.g. 'T127'

    root="/cnrm/vdr/DATA/OBS/netcdf/monthly_mean/erai-land/erai_???_mm_${variable}"
    suffix="YYYY-YYYY.nc"
    #
    url_erai_land1=root+"${grid}"+suffix   #for original grid
    url_erai_land2=root+".${grid}."+suffix #for other grids write e.g. as : grid='T127'
    #
    dataloc(project='erai-land', organization='generic', url=[url_erai_land1,url_erai_land2])


    # Defining alias and derived variables for ERAI-land, together with filenames
    ############################################################################## 

    #asn:="Snow albedo" sans dimension 
    #calias("erai-land",''    ,'asn'  ,filenameVar='ASN') 

    #calias("erai-land",'snw'    ,'rsn'  , scale= 'snd',filenameVar='RSN') ?
    #rsn=Snow density "kg m**-3"ds .nc

    calias("erai-land",'snd' ,'sd'  ,filenameVar='SD')


Beispiel #14
0
"""

from climaf.dataloc import dataloc
from climaf.classes import cproject, calias
from climaf.site_settings import atCNRM

if atCNRM:
    cproject('erai-land',
             'grid')  # no grid writes as '_' , otherwise as e.g. 'T127'

    root = "/cnrm/amacs/DATA/OBS/netcdf/monthly_mean/erai-land/erai_???_mm_${variable}"
    suffix = "${PERIOD}.nc"
    #
    url_erai_land1 = root + "${grid}" + suffix  # for original grid
    url_erai_land2 = root + ".${grid}." + suffix  # for other grids write e.g. as : grid='T127'
    #
    dataloc(project='erai-land',
            organization='generic',
            url=[url_erai_land1, url_erai_land2])

    # Defining alias and derived variables for ERAI-land, together with filenames
    ##############################################################################

    # asn:="Snow albedo" sans dimension
    # calias("erai-land",''    ,'asn'  ,filenameVar='ASN')

    # calias("erai-land",'snw'    ,'rsn'  , scale= 'snd',filenameVar='RSN') ?
    # rsn=Snow density "kg m**-3"ds .nc

    calias("erai-land", 'snd', 'sd', filenameVar='SD')
Beispiel #15
0
    dataloc(project="emn36", organization="generic", url=[pathgI, pathgO])

    # Define default values
    ############################################

    # You do not need to use a GROUPs experiment
    cdef("group", "", project="emn36")

    cdef("frequency", "monthly", project="emn36")
    cfreqs("emn36", {"daily": "d", "monthly": "m"})

    # More details about data organization
    ############################################

    # Describe how to locate some ocean variables in multi-variable data files
    calias("emn36", 'e-p', filenameVar='S')
    calias("emn36", 'fcalva', filenameVar='S')
    calias("emn36", 'fcalvg', filenameVar='S')
    calias("emn36", 'friver', filenameVar='S')
    calias("emn36", 'flake', filenameVar='S')
    calias("emn36", 'omlmax', filenameVar='S')
    calias("emn36", 'so', filenameVar='S')
    calias("emn36", 'sos', filenameVar='S')
    calias("emn36", 'wfo', filenameVar='S')

    calias("emn36", 'thetao', filenameVar='T')
    calias("emn36", 'tos', filenameVar='T')
    calias("emn36", 'tossq', filenameVar='T')
    calias("emn36", 'zos', filenameVar='T')
    calias("emn36", 'zossq', filenameVar='T')
    calias("emn36", 'nshfls', filenameVar='T')
Beispiel #16
0
cproject('ref_ts', ('frequency', 'monthly'), ('product', '*'),
         ('period', '1900-2050'),
         'obs_type',
         'table',
         ensemble=['product'])
cfreqs('ref_ts', {'monthly': 'mo', 'daily': 'day'})

cdef('variable', '*', project='ref_ts')
cdef('product', '*', project='ref_ts')
cdef('simulation', 'refproduct', project='ref_ts')
cdef('period', '1980-2005', project='ref_ts')
cdef('obs_type', '*', project='ref_ts')
cdef('table', '*', project='ref_ts')

calias('ref_climatos', 'O2', scale=44.64)
# Obs de MOC RAPID (Il a fallu bricoler les donnees d'origine pour la dimension time au debut et unlim)
#dataloc(project="ref_climatos",organization="generic",
#        url='/home/esanchez/data_climaf/${variable}_vertical_unlim.nc')
calias(project='ref_climatos',
       variable='moc',
       fileVariable='stream_function_mar',
       filenameVar='moc')
calias(project='ref_ts',
       variable='moc',
       fileVariable='stream_function_mar',
       filenameVar='moc')

if (root):
    #pattern1=root+"ts/*/${frequency}/${variable}/${variable}_*mon_${product}*_YYYYMM-YYYYMM.nc"
    pattern1 = root + "ts/*/${frequency}/${variable}/${variable}_${table}_${product}_${obs_type}_${PERIOD}.nc"
Beispiel #17
0
    # -- call the dataloc CliMAF function
    # -- CMIP5
    dataloc(project='CMIP5', organization='generic', url=pattern1)
    dataloc(project='CMIP5', organization='generic', url=patternf)
    # -- CMIP5_extent
    dataloc(project='CMIP5_extent', organization='generic', url=pattern1)
    dataloc(project='CMIP5_extent', organization='generic', url=pattern2)

    # -- Make the alias and default values for both projects
    for project in ['CMIP5', 'CMIP5_extent']:
        # calias(project, 'tos', offset=273.15)
        # calias(project, 'thetao', offset=273.15)
        # calias(project, 'sivolu', 'sivol')
        # calias(project, 'sic', 'siconc')
        # calias(project, 'sit', 'sithick')
        calias(project, 'NO3', 'no3')
        calias(project, 'PO4', 'po4')
        calias(project, 'Si', 'si')
        calias(project, 'O2', 'o2')

        cdef('root', root, project=project)
        # cdef('institute'   , '*'          , project=project)
        cdef('table', '*', project=project)  # impossible, because of ambiguities
        cdef('realm', '*', project=project)
        cdef('realization', 'r1i1p1', project=project)
        cdef('experiment', 'historical', project=project)
        cdef('version', '*', project=project)
        cdef('frequency', '*', project=project)
    cdef('extent_experiment', 'rcp85', project='CMIP5_extent')

    # -- Declare a CMIP5-Adjust CliMAF project: bias corrected CMIP5 simulations
Beispiel #18
0
"""

This module declares the project E-OBS : 
This archive is available on Ciclad (IPSL)

The specific attributes are:
- grid : '*'


"""

from climaf.dataloc import dataloc
from climaf.classes import cproject, calias, cfreqs, cdef
from climaf.site_settings import onCiclad, atTGCC, atIDRIS, atCerfacs, atCNRM

if onCiclad:
    # -- Create E-OBS CliMAF project
    EOBS_pattern = '/bdd/E-OBS/Grid_${grid}/${variable}_${grid}_${PERIOD}_v15.0.nc4'
    cproject('E-OBS', 'grid', 'frequency', separator='%')
    dataloc(project='E-OBS', organization='generic', url=EOBS_pattern)

    # -- Make a
    cdef('frequency', 'daily', project='E-OBS')
    cdef('grid', '*deg_*', project='E-OBS')
    cdef('period', '*', project='E-OBS')
    cdef('variable', '*', project='E-OBS')
    cfreqs('E-OBS', {'daily': 'day'})

    calias('E-OBS', 'tasmin', 'tn')
    calias('E-OBS', 'tasmax', 'tx')
Beispiel #19
0
    root = "/cnrm/amacs/DATA/OBS/netcdf/${frequency}"
    patmonth1 = root + "_mean/erai/erai_???_mm_${variable}${grid}${PERIOD}.nc"  #for original grid
    patmonth2 = root + "_mean/erai/erai_???_mm_${variable}.${grid}.${PERIOD}.nc"  #for other grids e.g. : grid ='T42' or 'T127'
    patday1 = root + "/erai/ei_${variable}${grid}${PERIOD}.nc"  #for original grid
    patday2 = root + "/erai/ei_${variable}_${grid}_${PERIOD}.nc"  #for other grids e.g.: grid ='T42' or 'T127'
    dataloc(project='erai',
            organization='generic',
            url=[patmonth1, patmonth2, patday1, patday2])

    # Defining alias and derived variables for ERAI, together with filenames
    ##############################################################################
    # Valid both for daily and monthly data (to check : energy flux in W for
    # daily and Joules for monthly ????)

    calias("erai", 'sic', 'ci', filenameVar='CI')
    calias("erai", 'tos', 'sst', filenameVar='SSTK')
    calias("erai", 'z', 'z', filenameVar='Z')
    calias("erai", 'ta', 't', filenameVar='T')
    calias("erai", 'ua', 'u', filenameVar='U')
    calias("erai", 'va', 'v', filenameVar='V')
    calias("erai", 'hus', 'q', filenameVar='Q')
    calias("erai", 'prw', 'tcw', filenameVar='TCW')
    calias("erai", 'prc', 'cp', filenameVar='CP')
    calias("erai", 'prl', 'lsp', filenameVar='LSP')
    calias("erai", 'prsn', 'sf', filenameVar='SF')
    calias("erai", 'hfss', 'sshf', filenameVar='SSHF')
    calias("erai", 'hfls', 'slhf', filenameVar='SLHF')
    calias("erai", 'ps', 'msl', filenameVar='MSL')
    calias("erai", 'clt', 'tcc', filenameVar='TCC')
    calias("erai", 'uas', 'u10', filenameVar='10U')
Beispiel #20
0
    # -- Specify the pattern
    pattern1 = "${root}/${login}/IGCM_OUT/${IPSL_MODEL}/${status}/${experiment}/${simulation}/CMIP6/${realm}/" \
               "${variable}_*${frequency}_${model}_${experiment}_${realization}_${grid}_${PERIOD}.nc"
    pattern2 = "${root}/${login}/IGCM_OUT/${IPSL_MODEL}/${status}/${experiment}/${simulation}/CMIP6/${realm}/" \
               "${variable}_${table}_${model}_${experiment}_${realization}_${grid}_${PERIOD}.nc"
    # pattern3="${root}/${login}/IGCM_OUT/${IPSL_MODEL}/${status}/${experiment}/${simulation}/CMIP6/${realm}/"
    #          "${variable}_${MIP_prefix}${frequency}${MIP_suffix}${qualifier}_${model}_${experiment}_${realization}_"
    #          "${grid}_${PERIOD}.nc"
    # pattern4="${root}/${login}/IGCM_OUT/${IPSL_MODEL}/${status}/${experiment}/${simulation}/CMIP6/${realm}/"
    #          "${variable}_${miptable}_${model}_${experiment}_${realization}_${grid}_${PERIOD}.nc"
    # -- Si on precise seulement la MIP table, on n'a pas la frequence ;
    #    on pourrait rajouter une analyse de la table, si elle existe, pour rajouter la frequence?
    #

    # pattern1="${root}/*/${variable}_${table}_${model}_${experiment}_${realization}_${gr}_${PERIOD}.nc"
    # pattern2="${root}/${variable}_${table}_${model}_${experiment}_${realization}_${gr}_${PERIOD}.nc"
    # -- call the dataloc CliMAF function
    dataloc(project='IGCM_CMIP6', organization='generic', url=[pattern2])

    calias('IGCM_CMIP6', 'tos', offset=273.15)
    calias('IGCM_CMIP6', 'thetao', offset=273.15)
    calias('IGCM_CMIP6', 'sic', 'siconc')
    calias('IGCM_CMIP6', 'sit', 'sithick')
    calias('IGCM_CMIP6', 'wfo', 'wfonocorr')
    calias('IGCM_CMIP6', 'sivolu', 'sivol')
    calias('IGCM_CMIP6', 'NO3', 'no3')
    calias('IGCM_CMIP6', 'PO4', 'po4')
    calias('IGCM_CMIP6', 'Si', 'si')
    calias('IGCM_CMIP6', 'O2', 'o2')
Beispiel #21
0
    # More details about data organization
    ############################################

    # Describe how to locate some ocean variables in multi-variable data files
    #calias("em", 'sos' ,filenameVar='S*')
    #calias("em", 'so'  ,filenameVar='S*')
    #calias("em", 'fcalva' ,filenameVar='S*')
    #calias("em", 'fcalvg' ,filenameVar='S*')
    #calias("em", 'omlmax' ,filenameVar='S*')
    #calias("em", 'wfo' ,filenameVar='S*')
    #calias("em", 'friver' ,filenameVar='S*')
    #calias("em", 'e-p' ,filenameVar='S*')
    #calias("em", 'flake' ,filenameVar='S*')
    
    calias("em", 'to'  ,offset=273.15,filenameVar='T_table2.2')
    calias("em", 'tos' ,offset=273.15, filenameVar='T_table2.2')
    calias("em", 'tossq' ,filenameVar='T_table2.2')
    calias("em", 'zos' ,filenameVar='T_table2.2')
    calias("em", 'zossq' ,filenameVar='T_table2.2')
    calias("em", 'zosto' ,filenameVar='T_table2.2')
    calias("em", 'omlmax' ,filenameVar='T_table2.2')
    calias("em", 'pbo' ,filenameVar='T_table2.2')
    calias("em", 'rhopoto' ,filenameVar='T_table2.2')
    calias("em", 'so' ,filenameVar='T_table2.2')
    calias("em", 'sos' ,filenameVar='T_table2.2')
    calias("em", 'thetao' ,filenameVar='T_table2.2')
    
    calias("em", 'emps' ,filenameVar='T_table2.5')
    calias("em", 'evt' ,filenameVar='T_table2.5')
    calias("em", 'evs' ,filenameVar='T_table2.5')
Beispiel #22
0
configuration files

Simulation names (or 'EXPIDs') are assumed to be unique in the namespace defined by the user's configuration
file, which may include shared simulation

Example for defining an EM dataset::

 >>> tas=ds(project='EM', simulation='GSAGNS1', variable='tas', period='1975', frequency='monthly', realm='L')

 A number of Seaice fields are duly described with 1.e+20 as missing value (which is ill described in data files); see code for details

"""

from climaf.site_settings import atCNRM

if atCNRM :

    from climaf.dataloc import dataloc
    from climaf.classes import cproject, calias, cfreqs
    
    cproject('EM' , ('frequency','monthly'), ('realm','*') )
    cfreqs('EM',{'monthly':'mon' , 'daily':'day1' })
    dataloc(project='EM', organization='EM', url=['dummy'])

    # Ideally, one should be able to write :
    #cmissing('EM',1.e+20, realm='I')
    calias('EM',[ 'sic', 'sit', 'sim', 'snd', 'ialb', 'tsice', 'mpalb', 'snomlet',
                  'tmelt', 'bmelt', 'snc','sic1','sic2', 'sic3', 'sic4', 'ssi', 'ageice'],
           missing=1.e+20)

Beispiel #23
0
if atCerfacs:
    root = "/data/scratch/globc/dcom/globc_obs/OBS4MIPS_ANA4MIPS_CMOR/Tier1/ERA5/"
if atCNRM:
    root = "/cnrm/est/COMMON/climaf/reference_datasets_from_IPSL/"

cproject('ref_era5cerfacs', ('frequency', 'monthly'),
         'product', ('period', '1979-2018'),
         'obs_type',
         'table',
         separator='%')
cfreqs('ref_era5cerfacs', {'monthly': 'mon', 'daily': 'day'})

cdef('variable', '*', project='ref_era5cerfacs')
cdef('product', 'ERA5', project='ref_era5cerfacs')
cdef('period', '1979-2018', project='ref_era5cerfacs')
cdef('obs_type', 'reanalysis', project='ref_era5cerfacs')
cdef('table', '*', project='ref_era5cerfacs')

# Obs de MOC RAPID (Il a fallu bricoler les donnees d'origine pour la dimension time au debut et unlim)
# dataloc(project="ref_climatos",organization="generic",
#        url='/home/esanchez/data_climaf/${variable}_vertical_unlim.nc')
calias(project='ref_era5cerfacs',
       variable='moc',
       fileVariable='stream_function_mar',
       filenameVar='moc')

if root:
    pattern1 = root + "${variable}_${table}_${obs_type}_${product}_${PERIOD}.nc"
    dataloc(project='ref_era5cerfacs', organization='generic', url=[pattern1])

#calias("ref_era5cerfacs","tas",offset=273.15)
Beispiel #24
0
    # a more specific dataloc entry matches the arguments to 'ds'
    dataloc(project="IGCM_OUT_old",
            organization="generic",
            url=urls_IGCM_OUT_old)

    # -- Note:
    # -- In the project IGCM_OUT_old, we have defined aliases for both the CMIP variable names (aliased to the old igcm names when necessary)
    # -- and the old IGCM names to take advantage of the mechanisms behind calias (scale, offset, filenameVar)

    # ---------------------------------------- #
    # -- Aliases to the CMIP variable names -- #

    # OCE
    calias("IGCM_OUT_old",
           'tos',
           'sosstsst',
           offset=273.15,
           filenameVar='grid_T')
    calias("IGCM_OUT_old", 'sos', 'sosaline', filenameVar='grid_T')
    calias("IGCM_OUT_old",
           'thetao',
           'votemper',
           offset=273.15,
           filenameVar='grid_T')
    calias("IGCM_OUT_old", 'so', 'vosaline', filenameVar='grid_T')
    calias("IGCM_OUT_old", 'zos', 'sossheig', filenameVar='grid_T')
    calias("IGCM_OUT_old", 'mlotst', 'mldr10_3', filenameVar='grid_T')
    calias("IGCM_OUT_old", 'mlddt02', 'mld_dt02', filenameVar='grid_T')
    calias("IGCM_OUT_old",
           'hc300',
           'sohtc300',
Beispiel #25
0
from climaf.site_settings import atCNRM, onCiclad
from climaf.operators import derive

p = cproject("CMIP5",
             "model",
             "experiment", ("frequency", "monthly"), ("table", "*"),
             ("realm", "*"), ("version", "last"),
             ensemble=["model", "simulation"])
cdef("simulation", "r1i1p1", project="CMIP5")

# Frequency alias
cfreqs('CMIP5', {'monthly': 'mon', 'daily': 'day'})

urls_CMIP5 = None

if atCNRM:
    # Declare the directory for CNRM-CM CMIP5 data on CNRM's Lustre file system.
    urls_CMIP5 = ["/cnrm/cmip/cnrm/ESG"]
if onCiclad:
    # Declare a list of root directories for CMIP5 data on IPLS's Ciclad file system
    urls_CMIP5 = ["/prodigfs/project/"]

if urls_CMIP5:
    # Next command will lead to explore all directories in 'url'
    # for searching data for a CliMAF dataset (by function ds) except if
    # a more specific dataloc entry matches the arguments to 'ds'
    dataloc(project="CMIP5", organization="CMIP5_DRS", url=urls_CMIP5)

calias('CMIP5', 'hflsevap', 'hfls', scale=1. / 2.5e6)
derive('CMIP5', 'pme', 'minus', 'pr', 'hflsevap')