def cmip5_model2inst(model): ## CHECK-ME: A dictionary is preferred to avoid using find, which causes some issues on some machines in the past (too slow)
    """
    Return the institute given the model name in CMIP5
    """

    instdict = {}
    instdict['HadGEM2-CC'] = 'MOHC'
    instdict['HadGEM2-A'] = 'MOHC'
    instdict['HadCM3'] = 'MOHC'
    instdict['HadGEM2-ES'] = 'MOHC'
    instdict['FIO-ESM'] = 'FIO'
    instdict['fio-esm'] = 'FIO'
    instdict['CCSM4'] = 'NCAR'
    instdict['GEOS-5'] = 'NASA-GMAO'
    instdict['inmcm4'] = 'INM'
    instdict['CanESM2'] = 'CCCma'
    instdict['CanCM4'] = 'CCCma'
    instdict['CanAM4'] = 'CCCma'
    instdict['GISS-E2-R'] = 'NASA-GISS'
    instdict['GISS-E2-R-CC'] = 'NASA-GISS'
    instdict['GISS-E2-H-CC'] = 'NASA-GISS'
    instdict['GISS-E2-H'] = 'NASA-GISS'
    instdict['CNRM-CM5'] = 'CNRM-CERFACS'
    instdict['CNRM-CM5-2'] = 'CNRM-CERFACS'
    instdict['NICAM-09'] = 'NICAM'
    instdict['IPSL-CM5A-LR'] = 'IPSL'
    instdict['IPSL-CM5A-MR'] = 'IPSL'
    instdict['IPSL-CM5B-LR'] = 'IPSL'
    instdict['CSIRO-Mk3-6-0'] = 'CSIRO-QCCCE'
    instdict['CESM1-CAM5'] = 'NSF-DOE-NCAR'
    instdict['CESM1-CAM5-1-FV2'] = 'NSF-DOE-NCAR'
    instdict['CESM1-BGC'] = 'NSF-DOE-NCAR'
    instdict['CESM1-WACCM'] = 'NSF-DOE-NCAR'
    instdict['CESM1-FASTCHEM'] = 'NSF-DOE-NCAR'
    instdict['NorESM1-M'] = 'NCC'
    instdict['NorESM1-ME'] = 'NCC'
    instdict['CFSv2-2011'] = 'NOAA-NCEP'
    instdict['ACCESS1-3'] = 'CSIRO-BOM'
    instdict['ACCESS1-0'] = 'CSIRO-BOM'
    instdict['CMCC-CM'] = 'CMCC'
    instdict['CMCC-CESM'] = 'CMCC'
    instdict['CMCC-CMS'] = 'CMCC'
    instdict['FGOALS-g2'] = 'LASG-CESS'
    instdict['FGOALS-s2'] = 'LASG-IAP'
    instdict['FGOALS-gl'] = 'LASG-IAP'
    instdict['GFDL-HIRAM-C180'] = 'NOAA-GFDL'
    instdict['GFDL-ESM2G'] = 'NOAA-GFDL'
    instdict['GFDL-CM2p1'] = 'NOAA-GFDL'
    instdict['GFDL-CM3'] = 'NOAA-GFDL'
    instdict['GFDL-ESM2M'] = 'NOAA-GFDL'
    instdict['GFDL-HIRAM-C360'] = 'NOAA-GFDL'
    instdict['EC-EARTH'] = 'ICHEC'
    instdict['BNU-ESM'] = 'BNU'
    instdict['CFSv2-2011'] = 'COLA-CFS'
    instdict['HadGEM2-AO'] = 'NIMR-KMA'
    instdict['MIROC4h'] = 'MIROC'
    instdict['MIROC5'] = 'MIROC'
    instdict['MIROC-ESM'] = 'MIROC'
    instdict['MIROC-ESM-CHEM'] = 'MIROC'
    instdict['bcc-csm1-1'] = 'BCC'
    instdict['bcc-csm1-1-m'] = 'BCC'
    #instdict['HadGEM2-ES'] = 'INPE'
    instdict['MPI-ESM-LR'] = 'MPI-M'
    instdict['MPI-ESM-MR'] = 'MPI-M'
    instdict['MPI-ESM-P'] = 'MPI-M'
    instdict['MRI-AGCM3-2H'] = 'MRI'
    instdict['MRI-CGCM3'] = 'MRI'
    instdict['MRI-ESM1'] = 'MRI'
    instdict['MRI-AGCM3-2S'] = 'MRI'

    return instdict[model]