Ignore:
Timestamp:
10/25/23 17:11:15 (8 months ago)
Author:
omamce
Message:

O.M. : MOSAIX

Improved code with pylint analysis

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TOOLS/MOSAIX/CreateWeightsMask.bash

    r6360 r6666  
    33#MSUB -o Out_WeightsMask    # Standard output 
    44#MSUB -e Out_WeightsMask    # Error output 
    5 #MSUB -n 1                  # Number of processors 
    6 #MSUB -T 7200              # Time limit (seconds) 
    7 #MSUB -Q normal 
     5#MSUB -n 4                  # Number of processors 
     6#MSUB -T 1800              # Time limit (seconds) 
     7#MSUB -Q test 
    88#MSUB -q rome 
    99#MSUB -p devcmip6 
     
    2121### =========================================================================== 
    2222## 
    23 ##  MOSAIX is under CeCILL_V2 licence. See "Licence_CeCILL_V2-en.txt" 
    24 ##  file for an english version of the licence and 
    25 ##  "Licence_CeCILL_V2-fr.txt" for a french version. 
    26 ## 
    27 ##  Permission is hereby granted, free of charge, to any person or 
    28 ##  organization obtaining a copy of the software and accompanying 
    29 ##  documentation covered by this license (the "Software") to use, 
    30 ##  reproduce, display, distribute, execute, and transmit the 
    31 ##  Software, and to prepare derivative works of the Software, and to 
    32 ##  permit third-parties to whom the Software is furnished to do so, 
    33 ##  all subject to the following: 
    34 ## 
    35 ##  Warning, to install, configure, run, use any of MOSAIX software or 
    36 ##  to read the associated documentation you'll need at least one (1) 
    37 ##  brain in a reasonably working order. Lack of this implement will 
    38 ##  void any warranties (either express or implied).  Authors assumes 
    39 ##  no responsability for errors, omissions, data loss, or any other 
    40 ##  consequences caused directly or indirectly by the usage of his 
    41 ##  software by incorrectly or partially configured 
    42 ## 
     23##  Warning, to install, configure, run, use any of Olivier Marti's 
     24##  software or to read the associated documentation you'll need at least 
     25##  one (1) brain in a reasonably working order. Lack of this implement 
     26##  will void any warranties (either express or implied). 
     27##  O. Marti assumes no responsability for errors, omissions, 
     28##  data loss, or any other consequences caused directly or indirectly by 
     29##  the usage of his software by incorrectly or partially configured 
     30##  personal. 
    4331## 
    4432## SVN information 
     
    5038# 
    5139## Tested with :  
    52 # CplModel=eORCA1.2xLMD144142 ; qsub -r ${CplModel} -o Out_${CplModel} -e Out_${CplModel} CreateWeightsMask.bash 
     40# CplModel=eORCA1.4.2xICO60 ; ccc_msub -r ${CplModel} -o Out_${CplModel} -e Out_${CplModel} CreateWeightsMask.bash 
    5341# CplModel=ORCA2.3xLMD9695 
    5442# CplModel=ORCA2.3xICO30 
     
    5947# CplModel=eORCA025.1xLMD144142 
    6048# CplModel=eORCA025.1xLMD256256 
    61 # 
     49# CplModel=eORCA1.4.2xICO40 
     50# CplModel=eORCA1.4.2xICO60 
     51# ccc_msub -r ${CplModel} -o Out_${CplModel} -e Out_${CplModel} CreateWeightsMask.bash 
     52 
     53echo 'Test' 
     54ls -alt /ccc/work/cont003/gencmip6/p86mart/TMP/MOSAIX 
    6255 
    6356set +vx 
     
    8275echo ${Titre}"Defines model"${Norm} 
    8376# ================================= 
    84 #CplModel=ORCA2.3xLMD9695 
     77CplModel=ORCA2.3xLMD9695 
    8578#CplModel=ORCA2.3xICO30 
    8679#CplModel=ORCA2.3xICO40 
     
    9083#CplModel=eORCA1.2xLMD256256 
    9184#CplModel=eORCA1.2xICO40 
     85#CplModel=eORCA1.2xICO60 
    9286#CplModel=eORCA1.4.2xICO40 
    9387#CplModel=eORCA1.2xICO450 
    9488#CplModel=eORCA025.1xLMD256256 
    95 CplModel=eORCA1.4.2xICO80 
    9689 
    9790#Version="v0" ; Comment="Fully tested in IPSLCM6 eORCA1.2 x LMD 144x142" 
     
    144137# \!/ No spaces in any analysis \!/ 
    145138# 
    146 # Specific commands : 'Runoff', 'Calving' 
     139# Specific commands : 'Runoff', 'Calving', 'Grids' 
    147140# 
    148141# Keywords :  
     
    194187#CommandList=( Grids ) 
    195188 
     189if [[ ${Version} = test_runoff_* ]] ; then 
     190    CommandList=( Runoff ) 
     191fi 
     192 
    196193## =========================================================================== 
    197194## 
     
    286283    set +e 
    287284    R_IN=$(ccc_home -u igcmg --cccwork)/IGCM 
    288     TMPDIR=${CCCWORKDIR}/TMP 
     285    TMPDIR=${CCCWORKDIR}/TMP/MOSAIX 
    289286    SUBMIT_DIR=${BRIDGE_MSUB_PWD:-${SUBMIT_DIR}} 
    290287    MpiRun="time ccc_mprun" 
     
    292289    module purge 
    293290    source ${SUBMIT_DIR}/arch.env 
    294     module load nco #/4.9.1 
    295     module load cdo #/1.9.5 
     291    module load nco 
    296292    module load python3  
    297293    module load datadir/igcmg 
    298294    module list 
    299     cp ${SUBMIT_DIR}/arch.env . ${TMPDIR} 
    300295    set -e 
    301296    ;; 
     
    311306 
    312307set -x ; set -e 
    313  
     308ls -alt ${TMPDIR} 
    314309mkdir -p ${TMPDIR}/${CplModel} || exit 1 
    315310cd       ${TMPDIR}/${CplModel} || exit 2 
     
    346341cp ${SUBMIT_DIR}/iodef_atm_to_oce.xml   . 
    347342cp ${SUBMIT_DIR}/iodef_oce_to_atm.xml   . 
     343cp ${SUBMIT_DIR}/arch.env               . 
    348344 
    349345[[ -f ${R_IN}/OCE/NEMO/${OCE}/${OCE}_coordinates_mask.nc       ]] && cp ${R_IN}/OCE/NEMO/${OCE}/${OCE}_coordinates_mask.nc        . 
     
    604600            --attribute Ocean,global,o,c,"${OCE} https://www.nemo-ocean.eu"       \ 
    605601            --attribute Atmosphere,global,o,c,"${ATM} http://lmdz.lmd.jussieu.fr" \ 
    606             --attribute production,global,o,c,"$(finger ${LOGNAME} | head -1 | awk '{print $4}')" \ 
    607602            --attribute originalFiles,global,o,c,"${OCE}_coordinates_mask.nc ${ATM}_grid_mask.nc"      \ 
    608603            --attribute associatedFiles,global,o,c,"grids_${CplModel}.nc areas_${CplModel}.nc masks_${CplModel}.nc" \ 
     
    822817              --o2a=${ATM}_grid_maskFrom_${OCE}.nc --output=rmp_t${atm}_to_t${oce}_runoff_${runOff_atmQuantity}_to_${runOff_oceQuantity}.nc \ 
    823818              --fmt=${FMT_XIOS} \ 
    824               --atmQuantity=${runOff_atmQuantity} --oceQuantity=${runOff_oceQuantity} --ocePerio=${OcePerio} 
     819              --atmQuantity=${runOff_atmQuantity} --oceQuantity=${runOff_oceQuantity} --ocePerio=${OcePerio} --modelName="${ModelName}" 
    825820fi 
    826821 
     
    835830                 --oce=${OCE} --atm=${ATM} --type=nosouth   \ 
    836831                 --grids=grids_${CplModel}.nc --areas=areas_${CplModel}.nc --masks=masks_${CplModel}.nc \ 
    837                  --o2a=${ATM}_grid_maskFrom_${OCE}.nc 
     832                 --o2a=${ATM}_grid_maskFrom_${OCE}.nc --modelName="${ModelName}" 
    838833        ${PyRun} python3 -u CalvingWeights.py --output=rmp_t${atm}_to_t${oce}_calving_iceberg.nc  --fmt=${FMT_XIOS} \ 
    839834                 --oce=${OCE} --atm=${ATM} --type=iceberg  --repartition_file=eORCA_R025_runoff_v1.2.nc --repartition_var=Icb_flux \ 
    840835                 --grids=grids_${CplModel}.nc --areas=areas_${CplModel}.nc --masks=masks_${CplModel}.nc \ 
    841                  --o2a=${ATM}_grid_maskFrom_${OCE}.nc 
     836                 --o2a=${ATM}_grid_maskFrom_${OCE}.nc --modelName="${ModelName}" 
    842837        ${PyRun} python3 -u CalvingWeights.py --output=rmp_t${atm}_to_t${oce}_calving_iceshelf.nc --fmt=${FMT_XIOS} \ 
    843838                 --oce=${OCE} --atm=${ATM} --type=iceshelf --repartition_file=eORCA_R025_runoff_v1.2.nc --repartition_var=sornfisf \ 
    844839                 --grids=grids_${CplModel}.nc --areas=areas_${CplModel}.nc --masks=masks_${CplModel}.nc \ 
    845                  --o2a=${ATM}_grid_maskFrom_${OCE}.nc 
     840                 --o2a=${ATM}_grid_maskFrom_${OCE}.nc --modelName="${ModelName}" 
    846841        ;; 
    847842         
     
    858853                 --oce=${OCE} --atm=${ATM} --type=nosouth   \ 
    859854                 --grids=grids_${CplModel}.nc --areas=areas_${CplModel}.nc --masks=masks_${CplModel}.nc \ 
    860                  --o2a=${ATM}_grid_maskFrom_${OCE}.nc 
     855                 --o2a=${ATM}_grid_maskFrom_${OCE}.nc --modelName="${ModelName}" 
    861856        ${PyRun} python3 -u CalvingWeights.py --output=rmp_t${atm}_to_t${oce}_calving_iceberg.nc  --fmt=${FMT_XIOS} \ 
    862857                 --oce=${OCE} --atm=${ATM} --type=iceberg --repartition_file=runoff-icb_DaiTrenberth_Depoorter_eORCA1_JD.nc --repartition_var=Icb_flux \ 
    863858                 --grids=grids_${CplModel}.nc --areas=areas_${CplModel}.nc --masks=masks_${CplModel}.nc \ 
    864                  --o2a=${ATM}_grid_maskFrom_${OCE}.nc 
     859                 --o2a=${ATM}_grid_maskFrom_${OCE}.nc --modelName="${ModelName}" 
    865860        ${PyRun} python3 -u CalvingWeights.py --output=rmp_t${atm}_to_t${oce}_calving_iceshelf.nc --fmt=${FMT_XIOS} \ 
    866861                 --oce=${OCE} --atm=${ATM} --type=iceshelf --repartition_file=runoff-icb_DaiTrenberth_Depoorter_eORCA1_JD.nc --repartition_var=sornfisf \ 
    867862                 --grids=grids_${CplModel}.nc --areas=areas_${CplModel}.nc --masks=masks_${CplModel}.nc \ 
    868                  --o2a=${ATM}_grid_maskFrom_${OCE}.nc 
     863                 --o2a=${ATM}_grid_maskFrom_${OCE}.nc --modelName="${ModelName}" 
    869864        ;; 
    870865         
     
    873868                 --oce=${OCE} --atm=${ATM} --type=full --ocePerio=${OcePerio} \ 
    874869                 --grids=grids_${CplModel}.nc --areas=areas_${CplModel}.nc --masks=masks_${CplModel}.nc \ 
    875                  --o2a=${ATM}_grid_maskFrom_${OCE}.nc 
     870                 --o2a=${ATM}_grid_maskFrom_${OCE}.nc --modelName="${ModelName}" 
    876871        ;; 
    877872    esac 
     
    957952Python version   : ${PYTHON_VER} 
    958953 
    959 EOF 
    960  
    961 echo 'SVN Information : '                                              >> README.txt 
    962 echo '$Author$ '                                              >> README.txt 
    963 echo '$Date$ '          >> README.txt 
    964 echo '$Revision$ '                                              >> README.txt 
    965 echo '$Id$ ' >> README.txt 
    966 echo '$HeadURL$ ' >> README.txt 
     954SVN Information : 
     955$Author$ 
     956$Date$ 
     957$Revision$ 
     958$Id$ 
     959$HeadURL$ 
     960 
     961EOF 
     962 
     963 
    967964 
    968965echo ${Titre}"Compute checksums and add them to README"${Norm} 
     
    996993## 
    997994## =========================================================================== 
    998  
Note: See TracChangeset for help on using the changeset viewer.