source: TOOLS/WATER_BUDGET/SetLibIGCM.py @ 6508

Last change on this file since 6508 was 6508, checked in by omamce, 13 months ago

WaterUtils?.pyVersion qui marche pour :
Water Budget
O.M.

Version qui marche pour :

  • Grille LMDZ et routage SECHIBA
  • Grille ICO avec sorties natives et routage SIMPLE : routage pas très précis.

Ne marche pas pour :

  • Grille LMDZ et routage SIMPLE : pb sur runoff
  • Grille ICO avec sorties interpolées :

# Erreurs relatives

### VALID-CM622-LR.01 - LMDZ : OK ? Sauf LIC

  • LIC : 1.e-2
  • SRF : 4.e-6
  • SRF/ATM : 2e-10
  • RUNOFF : 1.5e-4

### VALID-CM622-SIMPLE-ROUTING - LMDZ : Erreur RUNOFF, LIC

  • LIC : 1.6
  • SRF : 1e-6
  • SRF/ATM : 1.e-10
  • RUNOFF : -7

### TEST-CM72-SIMPLE-ROUTING.13 - ICO : Erreur SRF, RUNOFF, LIC

  • LIC : 150
  • SRF : 0.5
  • SRF/ATM : 4e-2
  • RUNOFF : 700

### CM71v420-LR-pd-02.ini - ICO interpolé : Erreur SRF, RUNOFF, LIC

  • LIC : 15
  • SRF : 0.7
  • SRF/ATM : -5.e-2
  • ROUTING : 3e3

### CM71v420-LR-pd-02.ini - ICO natif : Erreurs faibles RUNOFF, LIC

  • LIC : 0.3
  • SRF : 7.e-6
  • SRF/ATM : -6.e-9
  • ROUTING : 5.e-2
File size: 3.3 KB
Line 
1# Where do we run ?
2import pathlib, os
3
4SysName, NodeName, Release, Version, Machine = os.uname ()
5TGCC  = ( 'irene'    in NodeName )
6IDRIS = ( 'jeanzay'  in NodeName )
7SPIP  = ( 'lsce5138' in NodeName ) or ( 'spip' in NodeName.lower () )
8
9## Set site specific libIGCM directories, and other specific stuff
10# ===========================================================================================
11if TGCC :
12    CPU = subprocess.getoutput ( 'lscpu | grep "Model name"' )
13    if "Intel(R) Xeon(R) Platinum" in CPU : Machine = 'irene'
14    if "AMD"                       in CPU : Machine = 'irene-amd'
15
16    if libIGCM : 
17        if ARCHIVE    == None : ARCHIVE     = subprocess.getoutput ( f'ccc_home --cccstore   -d {Project} -u {User}' )
18        if STORAGE    == None : STORAGE     = subprocess.getoutput ( f'ccc_home --cccwork    -d {Project} -u {User}' )
19        if SCRATCHDIR == None : SCRATCHDIR  = subprocess.getoutput ( f'ccc_home --cccscratch -d {Project} -u {User}' )
20        if R_IN       == None : R_IN        = os.path.join ( subprocess.getoutput ( f'ccc_home --cccwork -d igcmg -u igcmg' ), 'IGCM')
21        if rebuild    == None : rebuild     = os.path.join ( subprocess.getoutput ( f'ccc_home --ccchome -d igcmg -u igcmg' ), 'Tools', Machine, 'rebuild_nemo', 'bin', 'rebuild_nemo' )
22
23    ## Specific to run at TGCC.
24    # Needed before importing a NetCDF library (netCDF4, xarray, cmds, etc ...)
25    if platform.python_version () == '3.7.5' :
26        import mpi4py
27        mpi4py.rc.initialize = False
28       
29    ## Creates output directory name
30    if TmpDir == None :
31        TmpDir = subprocess.getoutput ( 'ccc_home -s' )
32        config['Files']['TmpDir'] = TmpDir
33       
34# ===========================================================================================
35if IDRIS :
36    Machine = 'jean-zay'
37    if libIGCM : 
38        if ARCHIVE    == None : ARCHIVE    = os.path.join ( '/', 'gpfsstore'  , 'rech', Project, User )
39        if STORAGE    == None : STORAGE    = os.path.join ( '/', 'gpfswork'   , 'rech', Project, User )
40        if SCRATCHDIR == None : SCRATCHDIR = os.path.join ( '/', 'gpfsscratch', 'rech', Project, User )
41        if R_IN       == None : R_IN       = os.path.join ( '/', 'gpfswork'   , 'rech', 'psl', 'commun', 'IGCM' )
42        if rebuild    == None : rebuild    = os.path.join ( '/', 'gpfswork', 'rech', 'psl', 'commun', 'Tools', 'rebuild', 'modipsl_IOIPSL_PLUS_v2_2_4', 'bin', 'rebuild' )
43
44    ## Creates output directory name
45    if TmpDir == None :
46        TmpDir = os.getenv ( 'CCFRSCRATCH' )
47        config['Files']['TmpDir'] = TmpDir
48
49# ===========================================================================================
50if SPIP :
51    Machine = 'spip'
52    if libIGCM : 
53        if ARCHIVE    == None : ARCHIVE    = os.path.join ( '/', 'Users', User, 'Data' )
54        if STORAGE    == None : STORAGE    = os.path.join ( '/', 'Users', User, 'Data' )
55        if SCRATCHDIR == None : SCRATCHDIR = os.path.join ( '/', 'Users', User, 'Data' )
56        if R_IN       == None : R_IN       = os.path.join ( '/', 'Users', User, 'Data', 'IGCM' )
57
58    ## Creates output directory name
59    if TmpDir == None :
60        TmpDir = os.path.join ( pathlib.Path.home (), 'Scratch' )
61        config['Files']['TmpDir'] = TmpDir
62
63# ===========================================================================================
Note: See TracBrowser for help on using the repository browser.