Changeset 4278


Ignore:
Timestamp:
02/11/19 15:02:38 (5 years ago)
Author:
jgipsl
Message:

Adaptation for compiling of LMDZ for regular lat-lon grid.
Indentation and some reorganization.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CONFIG/UNIFORM/v7/ICOLMDZOR_v7/compile_icolmdzor.sh

    r4275 r4278  
    1414export ROOT=$modipsl/modeles/DYNAMICO 
    1515 
    16 #### 1.1 Set default options  
     16#### Set default options  
    1717# Optimization mode 
    1818# optmode=prod/dev/debug 
    1919optmode=prod 
    2020# Resolution if compiling LMDZ in regular mode without DYNAMICO 
     21# Use for example following "./compile_icolmdzor.sh -regular_lonlat 144x142x79" 
    2122regular_latlon=no 
    2223# fcm_arch 
     
    2728full_flag="" 
    2829 
    29 #### 1.2 Read arguments  
     30#### Read arguments  
    3031# Loop over all arguments to modify default set up 
    3132while (($# > 0)) ; do 
    32 case $1 in 
    33 "-h") cat <<fin 
     33    case $1 in 
     34        "-h") cat <<fin 
    3435 
    3536######################################################################## 
    36 # Usage of the script compile_config 
     37# Usage of the script compile_icolmdzor.sh 
    3738# 
    3839######################################################################## 
     
    4041./compile_config [Options]  
    4142 
    42 Options 
    43 .... 
    44  
    45 Example 1 : ... 
    46 ... 
     43Options: -full, -regular_latlon 
     44 
     45Example 1: Default compilation of DYNAMICO-LMDZ-ORCHIDEE with XIOS and IOIPSL 
     46./compile_icolmdzor.sh 
     47 
     48Example 2: Default compilation with full recompilation of all components 
     49./compile_icolmdzor.sh -full 
     50 
     51Example 3: Compilation of LMDZ in regular lat-lon for dimension 144x142x79.  
     52The dimension can be changed to any other 3d dimension. DYNAMICO is also compiled as default. 
     53./compile_icolmdzor.sh -regular_latlon 144x142x79 
    4754 
    4855fin 
    49 exit;; 
    50  
    51 "-parallel") 
    52 parallel=$2 ; shift ; shift ;;  
    53                 
    54 "-arch") 
    55 fcm_arch="$2" ; shift ; shift ;; 
    56  
    57 "-xios") 
    58 xios="$2" ; shift ; shift ;; 
    59  
    60 "-optmode") 
    61 optmode=$2 ; shift ; shift ;; 
    62  
    63 "-regular_latlon") 
    64 regular_latlon=$2 ; shift ; shift ;; 
    65  
    66 "-full") 
    67 full_flag="-full"; shift ;; 
    68 *) 
    69 echo "unknown option "$2" , exiting..." 
    70 exit  
    71 esac 
     56            exit;; 
     57 
     58        "-parallel") 
     59            parallel=$2 ; shift ; shift ;;  
     60         
     61        "-arch") 
     62            fcm_arch="$2" ; shift ; shift ;; 
     63         
     64        "-xios") 
     65            xios="$2" ; shift ; shift ;; 
     66         
     67        "-optmode") 
     68            optmode=$2 ; shift ; shift ;; 
     69         
     70        "-regular_latlon") 
     71            regular_latlon=yes ; 
     72            resol_atm_3d=$2 ; shift ; shift ;; 
     73         
     74        "-full") 
     75            full_flag="-full"; shift ;; 
     76         
     77        *) 
     78            echo "unknown option "$2" , exiting..." 
     79            exit  
     80    esac 
    7281done 
    73 echo full_flag=$full_flag 
    74  
    75 ### 1.3 Read host dependent default values 
    76 ###     These variables will not be changed if they were set as argument 
     82 
     83 
     84### Read host dependent default values 
     85### These variables will not be changed if they were set as argument 
    7786###./host.sh $host 
    7887# Later : Following lines should be set in host.sh file 
    7988# begin host.sh 
    8089if [ $fcm_arch == default ] ; then 
    81 # Find out current host and source specific paths and commands for the host 
    82 case $( hostname -s ) in 
    83 ada*) 
    84 fcm_arch=X64_ADA;; 
    85 irene*) 
    86 fcm_arch=X64_IRENE; 
    87 source /ccc/cont003/home/igcmg/igcmg/MachineEnvironment/irene/env_irene ;; 
    88 asterix*|obelix*) 
    89 fcm_arch=ifort_LSCE;; 
    90 *) 
    91 echo Current host is not known. You must use option -fcm_arch to specify which architecuture files to use. 
    92 echo Exit now. 
    93 exit 
    94 esac 
     90    # Find out current host and source specific paths and commands for the host 
     91    case $( hostname -s ) in 
     92        ada*) 
     93            fcm_arch=X64_ADA;; 
     94        irene*) 
     95            fcm_arch=X64_IRENE; 
     96            source /ccc/cont003/home/igcmg/igcmg/MachineEnvironment/irene/env_irene ;; 
     97        asterix*|obelix*) 
     98            fcm_arch=ifort_LSCE;; 
     99        *) 
     100            echo Current host is not known. You must use option -fcm_arch to specify which architecuture files to use. 
     101            echo Exit now. 
     102            exit 
     103    esac 
    95104fi 
    96105 
    97106##### End host.sh 
    98107echo 
    99 echo Following arguments are set in current compiling: 
     108echo "Following arguments are set in current compiling:" 
    100109echo "   optmode = $optmode, parallel = $parallel, fcm_arch = $fcm_arch, full_flag=$full regular_latlon=$regular_latlon" 
    101110 
     
    103112## 2.1 Compile ioipsl 
    104113cd $modipsl/modeles/IOIPSL 
    105 echo; echo NOW COMPILE IOIPSL 
     114echo; echo "NOW COMPILE IOIPSL" 
    106115echo ./makeioipsl_fcm -$optmode -parallel -arch ${fcm_arch} -arch_path $arch_path -j 8 $full_flag 
    107116./makeioipsl_fcm -$optmode -parallel -arch ${fcm_arch} -arch_path $arch_path -j 8 $full_flag 
    108117# Test if compiling succeded  
    109118if [[ $? != 0 ]] ; then  
    110   echo "THERE IS A PROBLEM IN IOIPSL COMPILATION - STOP" 
    111   exit 
     119    echo "THERE IS A PROBLEM IN IOIPSL COMPILATION - STOP" 
     120    exit 
    112121fi 
    113122 
    114123## 2.2 Compile xios 
    115124cd $modipsl/modeles/XIOS 
    116 echo; echo NOW COMPILE XIOS 
     125echo; echo "NOW COMPILE XIOS" 
    117126echo ./make_xios --$optmode --arch $fcm_arch --arch_path $arch_path --job 8 $full_flag 
    118127./make_xios --$optmode --arch $fcm_arch --arch_path $arch_path --job 8 $full_flag 
    119128# Test if compiling succeded  
    120129if [[ $? != 0 ]] ; then  
    121   echo "THERE IS A PROBLEM IN XIOS COMPILATION - STOP" 
    122   exit 
     130    echo "THERE IS A PROBLEM IN XIOS COMPILATION - STOP" 
     131    exit 
    123132fi 
    124133 
    125134## 2.3 Compile orchidee 
    126135cd $modipsl/modeles/ORCHIDEE 
    127 echo; echo NOW COMPILE ORCHIDEE 
     136echo; echo "NOW COMPILE ORCHIDEE" 
    128137echo    ./makeorchidee_fcm -j 8 -parallel $parallel -$optmode -arch ${fcm_arch} $full_flag -driver 
    129138./makeorchidee_fcm -j 8 -parallel $parallel -$optmode -arch ${fcm_arch} $full_flag -driver 
     
    134143fi 
    135144 
    136  
    137 ## 2.5 Compile lmdz 
     145## 2.4 Compile lmdz 
    138146cd $modipsl/modeles/LMDZ 
    139 if [ ${regular_latlon} = no ] ; then 
    140     # Compile as library to couple to DYNAMICO 
    141     echo; echo NOW COMPILE LMDZ FOR COUPLING TO DYNAMICO 
    142     echo ./makelmdz_fcm -p lmd -rrtm true -$optmode -mem -parallel $parallel -libphy -v orchidee2.1 -io xios -arch $fcm_arch -j 8 $full_flag 
    143     ./makelmdz_fcm -p lmd -rrtm true -$optmode -mem -parallel $parallel -libphy -v orchidee2.1 -io xios -arch $fcm_arch -j 8 $full_flag 
    144 else 
    145     # Compile regular lat-lon exectuable 
    146     echo; echo NOW COMPILE LMDZ REGULAR LAT-LON MODE. Resolution = ${regular_latlon} 
    147     echo ./makelmdz_fcm -d ${regular_latlon} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -arch_path $arch_path -j 8 $full_flag gcm 
    148     ./makelmdz_fcm -d ${regular_latlon} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -arch_path $arch_path -j 8 $full_flag gcm 
    149 fi 
    150  
    151 # Test if compiling finished 
    152 if [[ $? != 0 ]] ; then 
    153     echo "THERE IS A PROBLEM IN LMDZ COMPILATION - STOP" 
    154     exit 
    155 fi 
    156  
    157 # Compile DYNAMICO 
    158 echo; echo NOW COMPILE DYNAMICO  
     147# Compile LMDZ as library to couple to DYNAMICO 
     148echo; echo "NOW COMPILE LMDZ FOR COUPLING TO DYNAMICO" 
     149echo ./makelmdz_fcm -p lmd -rrtm true -$optmode -mem -parallel $parallel -libphy -v orchidee2.1 -io xios -arch $fcm_arch -j 8 $full_flag 
     150./makelmdz_fcm -p lmd -rrtm true -$optmode -mem -parallel $parallel -libphy -v orchidee2.1 -io xios -arch $fcm_arch -j 8 $full_flag 
     151# Test if compiling finished 
     152if [[ $? != 0 ]] ; then 
     153    echo "THERE IS A PROBLEM IN LMDZ PHYSICS COMPILATION - STOP" 
     154    exit 
     155fi 
     156 
     157 
     158## 2.5 Compile DYNAMICO 
     159echo; echo "NOW COMPILE DYNAMICO " 
    159160cd $modipsl/modeles/DYNAMICO 
    160161echo ./make_icosa -$optmode -parallel $parallel -external_ioipsl -with_xios -arch $fcm_arch -arch_path $arch_path -job 8 $full_flag 
     
    162163# Test if compiling finished 
    163164if [[ $? != 0 ]] ; then 
    164   echo "THERE IS A PROBLEM IN DYNAMICO COMPILATION - STOP" 
    165   exit 
    166 fi 
    167  
    168 # Compile interface ICOSA_LMDZ 
    169 echo; echo NOW COMPILE ICOSA_LMDZ  
     165    echo "THERE IS A PROBLEM IN DYNAMICO COMPILATION - STOP" 
     166    exit 
     167fi 
     168 
     169## 2.6 Compile interface ICOSA_LMDZ 
     170echo; echo "NOW COMPILE ICOSA_LMDZ " 
    170171cd $modipsl/modeles/ICOSA_LMDZ 
    171172echo ./make_icosa_lmdz -nodeps -p lmd -$optmode -parallel $parallel -with_orchidee -arch ${fcm_arch} -arch_path ${arch_path} -job 8 $full_flag 
     
    174175# Test if compiling finished 
    175176if [[ $? != 0 ]] ; then 
    176   echo "THERE IS A PROBLEM IN ICOSA_LMDZ COMPILATION - STOP" 
    177   exit 
    178 fi 
    179  
    180 # Move executables to modipsl/bin folder 
     177    echo "THERE IS A PROBLEM IN ICOSA_LMDZ COMPILATION - STOP" 
     178    exit 
     179fi 
     180 
     181 
     182## 2.7 Compile LMDZ for regular latlon configuration 
     183if [ $regular_latlon = yes ] ; then 
     184 
     185    cd $modipsl/modeles/LMDZ 
     186    # Compile LMDZ regular lat-lon exectuable 
     187    echo; echo "NOW COMPILE LMDZ REGULAR LAT-LON MODE. Resolution = ${resol_atm_3d}" 
     188    echo ./makelmdz_fcm -d ${resol_atm_3d} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -j 8 $full_flag gcm 
     189    ./makelmdz_fcm -d ${resol_atm_3d} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -j 8 $full_flag gcm 
     190    # Test if compiling finished 
     191    if [[ $? != 0 ]] ; then 
     192        echo "THERE IS A PROBLEM IN LMDZ REGULAR LATLON COMPILATION - STOP" 
     193        exit 
     194    fi 
     195 
     196    # Compile ce0l initialization program for LMDZ regular lat-lon exectuable 
     197    echo; echo "NOW COMPILE CE0L OF LMDZ. Resolution = ${resol_atm_3d}" 
     198    echo ./makelmdz_fcm -d ${resol_atm_3d} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -j 8 $full_flag ce0l 
     199    ./makelmdz_fcm -d ${resol_atm_3d} -p lmd -rrtm true -$optmode -mem -parallel $parallel -io xios -v orchidee2.1 -arch $fcm_arch -j 8 $full_flag ce0l 
     200    # Test if compiling finished 
     201    if [[ $? != 0 ]] ; then 
     202        echo "THERE IS A PROBLEM IN CE0L (LMDZ) REGULAR LATLON COMPILATION - STOP" 
     203        exit 
     204    fi 
     205 
     206    # Find executable suffix 
     207    if [ $parallel == seq ] || [ $parallel == none ] ; then 
     208        suffix=_${resol_atm_3d}_phylmd_seq_orch 
     209    else 
     210        suffix=_${resol_atm_3d}_phylmd_para_mem_orch 
     211    fi 
     212    echo suffix = $suffix 
     213     
     214    # Move executables to modipsl/bin folder 
     215    echo "Move gcm.e and ce0l executable to modipsl/bin" 
     216    if [ $modipsl/modeles/LMDZ/bin/gcm${suffix}.e ] ;  then mv $modipsl/modeles/LMDZ/bin/gcm${suffix}.e $modipsl/bin/gcm_${resol_atm_3d}.e ; fi 
     217    if [ $modipsl/modeles/LMDZ/bin/ce0l${suffix}.e ] ;  then mv $modipsl/modeles/LMDZ/bin/ce0l${suffix}.e $modipsl/bin/ce0l_${resol_atm_3d}.e ; fi 
     218 
     219    # Write .resol file 
     220    cd $submitdir    
     221    resol2D=$( echo ${resol_atm_3d} | awk '-Fx' '{print $1}' )$( echo ${resol_atm_3d} | awk '-Fx' '{print $2}' ) 
     222    echo "noORCAxLMD$resol2D" >.resol 
     223    echo "RESOL_ATM_3D=${resol_atm_3d}" >>.resol 
     224fi 
     225 
     226 
     227##  Move executables to modipsl/bin folder 
    181228echo "Move executables to modipsl/bin" 
    182229if [ $modipsl/modeles/ICOSA_LMDZ/bin/icosa_lmdz.exe ] ; then mv $modipsl/modeles/ICOSA_LMDZ/bin/icosa_lmdz.exe $modipsl/bin/. ; fi 
     
    184231 
    185232 
    186 # Write resolution into .resol file 
    187 if [ $regular_latlon != no ] ; then 
    188     # Copy executable 
    189 # Find executable suffix  
    190 if [ $parallel == seq ] || [ $parallel == none ] ; then 
    191     suffix=_seq 
    192 else 
    193     suffix=_para 
    194 fi 
    195 suffix=${suffix}_orch 
    196 echo suffix = $suffix 
    197      
    198  
    199     # Write .resol file 
    200     cd $submitdir    
    201     resol2D=$( echo ${regular_latlon} | awk '-Fx' '{print $1}' )$( echo ${regular_latlon} | awk '-Fx' '{print $2}' ) 
    202     echo "noORCAxLMD$resol2D" >.resol 
    203     echo "RESOL_ATM_3D=${regular_latlon}" >>.resol 
    204 fi 
    205  
    206233echo  
    207 echo ALL COMPILING FINISHED 
     234echo "ALL COMPILING FINISHED" 
    208235echo 
     236 
    209237exit 
    210238 
Note: See TracChangeset for help on using the changeset viewer.