#!/usr/bin/env python3 ### ### Script to check water conservation in the IPSL coupled model ### ## Warning, to install, configure, run, use any of included software or ## to read the associated documentation you'll need at least one (1) ## brain in a reasonably working order. Lack of this implement will ## void any warranties (either express or implied). Authors assumes ## no responsability for errors, omissions, data loss, or any other ## consequences caused directly or indirectly by the usage of his ## software by incorrectly or partially configured personal ## ## ## SVN information # $Author$ # $Date$ # $Revision$ # $Id: $ # $HeadURL$ # Where do we run ? import pathlib, os SysName, NodeName, Release, Version, Machine = os.uname () TGCC = ( 'irene' in NodeName ) IDRIS = ( 'jeanzay' in NodeName ) SPIP = ( 'lsce5138' in NodeName ) or ( 'spip' in NodeName.lower () ) ## Set site specific libIGCM directories, and other specific stuff # =========================================================================================== if TGCC : CPU = subprocess.getoutput ( 'lscpu | grep "Model name"' ) if "Intel(R) Xeon(R) Platinum" in CPU : Machine = 'irene' if "AMD" in CPU : Machine = 'irene-amd' if libIGCM : if ARCHIVE == None : ARCHIVE = subprocess.getoutput ( f'ccc_home --cccstore -d {Project} -u {User}' ) if STORAGE == None : STORAGE = subprocess.getoutput ( f'ccc_home --cccwork -d {Project} -u {User}' ) if SCRATCHDIR == None : SCRATCHDIR = subprocess.getoutput ( f'ccc_home --cccscratch -d {Project} -u {User}' ) if R_IN == None : R_IN = os.path.join ( subprocess.getoutput ( f'ccc_home --cccwork -d igcmg -u igcmg' ), 'IGCM') if rebuild == None : rebuild = os.path.join ( subprocess.getoutput ( f'ccc_home --ccchome -d igcmg -u igcmg' ), 'Tools', Machine, 'rebuild_nemo', 'bin', 'rebuild_nemo' ) ## Specific to run at TGCC. # Needed before importing a NetCDF library (netCDF4, xarray, cmds, etc ...) if platform.python_version () == '3.7.5' : import mpi4py mpi4py.rc.initialize = False ## Creates output directory name if TmpDir == None : TmpDir = subprocess.getoutput ( 'ccc_home -s' ) config['Files']['TmpDir'] = TmpDir # =========================================================================================== if IDRIS : Machine = 'jean-zay' if libIGCM : if ARCHIVE == None : ARCHIVE = os.path.join ( '/', 'gpfsstore' , 'rech', Project, User ) if STORAGE == None : STORAGE = os.path.join ( '/', 'gpfswork' , 'rech', Project, User ) if SCRATCHDIR == None : SCRATCHDIR = os.path.join ( '/', 'gpfsscratch', 'rech', Project, User ) if R_IN == None : R_IN = os.path.join ( '/', 'gpfswork' , 'rech', 'psl', 'commun', 'IGCM' ) if rebuild == None : rebuild = os.path.join ( '/', 'gpfswork', 'rech', 'psl', 'commun', 'Tools', 'rebuild', 'modipsl_IOIPSL_PLUS_v2_2_4', 'bin', 'rebuild' ) ## Creates output directory name if TmpDir == None : TmpDir = os.getenv ( 'CCFRSCRATCH' ) config['Files']['TmpDir'] = TmpDir # =========================================================================================== if SPIP : Machine = 'spip' if libIGCM : if ARCHIVE == None : ARCHIVE = os.path.join ( '/', 'Users', User, 'Data' ) if STORAGE == None : STORAGE = os.path.join ( '/', 'Users', User, 'Data' ) if SCRATCHDIR == None : SCRATCHDIR = os.path.join ( '/', 'Users', User, 'Data' ) if R_IN == None : R_IN = os.path.join ( '/', 'Users', User, 'Data', 'IGCM' ) ## Creates output directory name if TmpDir == None : TmpDir = os.path.join ( pathlib.Path.home (), 'Scratch' ) config['Files']['TmpDir'] = TmpDir # ===========================================================================================