Changeset 402 for tags


Ignore:
Timestamp:
12/13/10 16:38:31 (13 years ago)
Author:
sdipsl
Message:
  • Cesium changes his behaviour this week end. Usually only environment variable poitned by list_var_env are passed to a child job. Suddenly cesium passes all environement variables to the child jobs. Add a workaround.
  • Upgrade IGCM_Patch_20101208_nudge_interp.ksh (jg)
  • Cosmetics
Location:
tags/libIGCM_v1_10
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tags/libIGCM_v1_10/AA_TimeSeries_Checker

    r396 r402  
    6060echo "This action can potentially submit numbers of jobs (up to 50)" 
    6161echo "This action can potentially remove unnecessary files but I will ALWAYS ask permission to do so" 
    62 echo "\033[1;31mDo you want me to run in dryrun mode just telling what I would submit?\033[m" 
    63 echo "\033[1;31mOr do you want me to submit job for real? Answer yes in this case.\033[m" 
     62echo -e "\033[1;31mDo you want me to run in dryrun mode just telling what I would submit?\033[m" 
     63echo -e "\033[1;31mOr do you want me to submit job for real? Answer yes in this case.\033[m" 
    6464echo -n " Run for real (y/n) :" 
    6565read ActionAnswer 
     
    339339                                IGCM_debug_Print 2 "File(s) that will be removed ${RemoveList[*]}" 
    340340                                if [ ${action} = true ] ; then 
    341                                     echo "\033[1;32mDo you want to remove them?" 
     341                                    echo -e "\033[1;32mDo you want to remove them?" 
    342342                                    echo -n " Your answer (y/n) : \033[m" 
    343343                                    read RemoveAnswer 
     
    345345                                        oui|OUI|o|y|yes|YES) 
    346346                                            echo "OK. I will erase them" 
    347                                             IGCM_sys_Rm ${RemoveList[*]} 
     347                                            IGCM_sys_Rm -f ${RemoveList[*]} 
    348348                                            ;; 
    349349                                        non|NON|n|no|NO) 
     
    411411                                    echo 
    412412                                else 
    413                                     IGCM_debug_Print 2 "\033[1;31mI should NOW submit ${FILE} chunck ${Dimension}\033[m period ${ChunckDebut}-${ChunckFin} and CompletedFlag=${ChunckCompletedFlag}" 
     413                                    IGCM_debug_Print 2 -e "\033[1;31mI should NOW submit ${FILE} chunck ${Dimension}\033[m period ${ChunckDebut}-${ChunckFin} and CompletedFlag=${ChunckCompletedFlag}" 
    414414                                fi 
    415415                            fi 
     
    450450IGCM_date_GetYearMonth ${DateBegin} YearBegin MonthBegin 
    451451CompletedFlag=${SavedCompletedFlag} 
     452 
     453unset CompToRead 
     454unset FlagToRead 
     455unset NameToRead 
    452456 
    453457if [ X${Launch2D} = Xtrue ] ; then 
  • tags/libIGCM_v1_10/libIGCM_post/IGCM_Patch_20101208_nudge_interp.ksh

    r399 r402  
    2020#  
    2121# 
    22 function IGCM_Patch_nudge_interp { 
     22function IGCM_Patch_20101208_nudge_interp { 
    2323    IGCM_debug_PushStack "IGCM_Patch_nudge_interp" $@ 
    2424 
    25 ##### 
     25################################################################################################### 
     26# 1 - Define variables 
    2627# Filein is the first month to interpolate for a variable. 
    27 # Filein name should be at format X_Y_ZZZZ.nc, where X=varaiable name [u or v], Y=[1,13] and ZZZZ=year. 
     28# Filein name should be at format X_Y_ZZZZ.nc, where X=varaiable name [u,v,ta], Y=[1,13] and ZZZZ=year. 
    2829# To do one year complete for one variable X, 13 month must be present. 
    29 ##### 
     30################################################################################################### 
    3031    filein=${1} 
    3132 
     
    3839    echo var=$var year=$year 
    3940 
    40 ##### 
    41 # Interpolate all files for the actual varaiable. 
    42 # Original files will be overritten. 
    43 ##### 
     41################################################################################################### 
     42# 2 - Interpolate all files for the actual varaiable. 
     43#     Original files will be overritten. 
     44################################################################################################### 
    4445    filelist=${var}_*.nc 
    4546    echo 'filelist 1 = ' ${filelist} 
     
    5152    done 
    5253 
    53 ##### 
    54 # Add a final time step in each file, coming from the first time step in following month 
    55 ##### 
     54################################################################################################### 
     55# 3 - Add a final time step in each file, coming from the first time step in following month 
     56################################################################################################### 
    5657    filelist=${var}_*.nc 
    5758    echo 'filelist 2 = ' ${filelist} 
     
    7071    done 
    7172 
    72 ##### 
    73 # Remove 13'th month 
    74 ##### 
     73################################################################################################### 
     74# 4 - Remove 13'th month 
     75################################################################################################### 
    7576    if [ -f ${var}_13_${year}.nc ] ; then 
    7677        echo Remove file ${var}_13_${year}.nc 
     
    8485function IGCM_era2gcm { 
    8586#set -xv 
    86 ##################################################################### 
    87 # Function that interpolates filein at destionation gridfile. 
    88 # Results in are stored in fileout. 
    89 ##################################################################### 
     87# Function that does a linear interpolation of the variable in  
     88# filein towards the destionation grid in gridfile. Results in are  
     89# stored in fileout. 
     90    IGCM_debug_PushStack "IGCM_era2gcm" $@ 
    9091 
    91     IGCM_debug_PushStack "IGCM_era2gcm" $@ 
     92################################################################### 
     93# 1 - Define variables 
     94################################################################### 
    9295    filein=$1 
    9396    fileout=$2 
     
    9598    year=$4 
    9699 
    97 ##################################################################### 
    98 # Find dimension for destination grid 
    99 ##################################################################### 
     100# Define file with destination grid 
    100101    gridfile=start.nc 
    101     iip1=`ncdump -h $gridfile | grep rlonu | head -1 | awk ' { print $3 } '` 
    102     jjm=`ncdump -h $gridfile | grep rlatv | head -1 | awk ' { print $3 } '` 
    103     jjp1=`expr $jjm + 1` 
    104     iim=`expr $iip1 - 1` 
    105102     
    106 ################################################################### 
    107103# Find time boundaries 
    108 ################################################################### 
    109104    tmin=1 
    110105    tmax=`ncdump -h ${filein} | grep time | head -1 | awk ' { print $6 } '` 
    111106    tmax=$( echo ${tmax} | awk '-F(' '{print $2}' ) 
    112     echo iim=$iim jjm=$jjm tmax=$tmax 
    113107     
     108# Choose grid and output variable name  
     109    if [ ${varin} = 'u' ] ; then  
     110        varout=uwnd 
     111        grille='grille_u' 
     112    elif [ ${varin} = 'v' ] ; then  
     113        varout=vwnd 
     114        grille='grille_v' 
     115    elif [ ${varin} = 'ta' ] ; then  
     116        varout=air 
     117        grille='grille_t' 
     118    elif [ ${varin} = 'r' ] ; then  
     119        varout=rh 
     120        grille='grille_t' 
     121    elif [ ${varin} = 'msl' ] ; then  
     122        varout=sp 
     123        grille='grille_t' 
     124    else  
     125        echo Error : ${varin} unknown!!!! 
     126        exit 
     127    fi  
     128 
    114129################################################################### 
    115 # Create ferret script for interpolation 
     130# 2 - Create ferret script for interpolation 
    116131################################################################### 
    117 # Write first part of ferret script 
    118     cat << eod >  tmpinterp.jnl 
     132    cat << eod >  ${varin}.jnl 
    119133set memory/size=50 
    120134 
    121135use ${gridfile} 
    122136use ${filein} 
    123 let uwnd=u 
    124 let vwnd=v 
    125 let air=ta 
    126 let rh=r 
    127 let sp=msl 
     137let ${varout}=${varin} 
    128138 
    129 define axis/t=1-jan-${year}:31-dec-${year}:6/units=hours thour 
    130 eod 
     139define axis/t=01-JAN-${year}:31-DEC-${year}:6/units=hours thour 
    131140 
    132 # Add one line depending on variable name to ferret script 
    133     imax=${iip1} 
    134     jmax=${jjp1} 
    135     if [ ${varin} = 'u' ] ; then  
    136         varout=uwnd 
    137         echo define grid/like=uwnd[d=2]/x=cu[d=1]/y=cu[d=1] grille >> tmpinterp.jnl 
    138     elif [ ${varin} = 'v' ] ; then  
    139         varout=vwnd 
    140         jmax=${jjm} 
    141         echo define grid/like=vwnd[d=2]/x=cv[d=1]/y=cv[d=1] grille >> tmpinterp.jnl 
    142     elif [ ${varin} = 'ta' ] ; then  
    143         varout=air 
    144         echo define grid/like=air[d=2]/x=cv[d=1]/y=cu[d=1] grille >> tmpinterp.jnl 
    145     elif [ ${varin} = 'r' ] ; then  
    146         varout=rh 
    147         echo define grid/like=air[d=2]/x=cv[d=1]/y=cu[d=1] grille >> tmpinterp.jnl 
    148     elif [ ${varin} = 'msl' ] ; then  
    149         varout=sp 
    150         echo define grid/like=air[d=2]/x=cv[d=1]/y=cu[d=1] grille >> tmpinterp.jnl 
    151     else  
    152         echo Error : ${varin} unknown!!!! 
    153         exit 
    154     fi  
    155      
    156 # Write second part of ferret script 
    157     cat << eod >>  tmpinterp.jnl 
     141define grid/like=${varout}[d=2]/x=cu[d=1]/y=cu[d=1] grille_u 
     142define grid/like=${varout}[d=2]/x=cv[d=1]/y=cv[d=1] grille_v 
     143define grid/like=${varout}[d=2]/x=cv[d=1]/y=cu[d=1] grille_t 
    158144 
    159 save/clobber/file=${fileout} ${varout}[d=2,g=grille,i=1:${imax},j=1:${jmax},l=1,gt=thour@asn] 
    160 repeat/l=1:${tmax} save/file="${fileout}"/append ${varout}[d=2,g=grille,i=1:${imax},j=1:${jmax},gt=thour@asn] 
     145save/clobber/file=${fileout} ${varout}[d=2,g=${grille},l=1,gt=thour@asn] 
     146repeat/l=1:${tmax} save/file="${fileout}"/append ${varout}[d=2,g=${grille},gt=thour@asn] 
    161147 
    162148exit 
     
    164150     
    165151################################################################### 
    166 # Lanch interpolation with ferret 
     152# 3 - Launch interpolation with ferret 
    167153################################################################### 
    168154    ferret -nojnl <<eod >  /dev/null 
    169 go tmpinterp.jnl 
     155go ${varin}.jnl 
    170156quit 
    171157eod 
Note: See TracChangeset for help on using the changeset viewer.