- Timestamp:
- 12/13/10 16:38:31 (13 years ago)
- Location:
- tags/libIGCM_v1_10
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tags/libIGCM_v1_10/AA_TimeSeries_Checker
r396 r402 60 60 echo "This action can potentially submit numbers of jobs (up to 50)" 61 61 echo "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"62 echo -e "\033[1;31mDo you want me to run in dryrun mode just telling what I would submit?\033[m" 63 echo -e "\033[1;31mOr do you want me to submit job for real? Answer yes in this case.\033[m" 64 64 echo -n " Run for real (y/n) :" 65 65 read ActionAnswer … … 339 339 IGCM_debug_Print 2 "File(s) that will be removed ${RemoveList[*]}" 340 340 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?" 342 342 echo -n " Your answer (y/n) : \033[m" 343 343 read RemoveAnswer … … 345 345 oui|OUI|o|y|yes|YES) 346 346 echo "OK. I will erase them" 347 IGCM_sys_Rm ${RemoveList[*]}347 IGCM_sys_Rm -f ${RemoveList[*]} 348 348 ;; 349 349 non|NON|n|no|NO) … … 411 411 echo 412 412 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}" 414 414 fi 415 415 fi … … 450 450 IGCM_date_GetYearMonth ${DateBegin} YearBegin MonthBegin 451 451 CompletedFlag=${SavedCompletedFlag} 452 453 unset CompToRead 454 unset FlagToRead 455 unset NameToRead 452 456 453 457 if [ X${Launch2D} = Xtrue ] ; then -
tags/libIGCM_v1_10/libIGCM_post/IGCM_Patch_20101208_nudge_interp.ksh
r399 r402 20 20 # 21 21 # 22 function IGCM_Patch_ nudge_interp {22 function IGCM_Patch_20101208_nudge_interp { 23 23 IGCM_debug_PushStack "IGCM_Patch_nudge_interp" $@ 24 24 25 ##### 25 ################################################################################################### 26 # 1 - Define variables 26 27 # 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. 28 29 # To do one year complete for one variable X, 13 month must be present. 29 ##### 30 ################################################################################################### 30 31 filein=${1} 31 32 … … 38 39 echo var=$var year=$year 39 40 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 ################################################################################################### 44 45 filelist=${var}_*.nc 45 46 echo 'filelist 1 = ' ${filelist} … … 51 52 done 52 53 53 ##### 54 # Add a final time step in each file, coming from the first time step in following month55 ##### 54 ################################################################################################### 55 # 3 - Add a final time step in each file, coming from the first time step in following month 56 ################################################################################################### 56 57 filelist=${var}_*.nc 57 58 echo 'filelist 2 = ' ${filelist} … … 70 71 done 71 72 72 ##### 73 # Remove 13'th month74 ##### 73 ################################################################################################### 74 # 4 - Remove 13'th month 75 ################################################################################################### 75 76 if [ -f ${var}_13_${year}.nc ] ; then 76 77 echo Remove file ${var}_13_${year}.nc … … 84 85 function IGCM_era2gcm { 85 86 #set -xv 86 # ####################################################################87 # Function that interpolates filein at destionation gridfile.88 # Results in arestored 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" $@ 90 91 91 IGCM_debug_PushStack "IGCM_era2gcm" $@ 92 ################################################################### 93 # 1 - Define variables 94 ################################################################### 92 95 filein=$1 93 96 fileout=$2 … … 95 98 year=$4 96 99 97 ##################################################################### 98 # Find dimension for destination grid 99 ##################################################################### 100 # Define file with destination grid 100 101 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`105 102 106 ###################################################################107 103 # Find time boundaries 108 ###################################################################109 104 tmin=1 110 105 tmax=`ncdump -h ${filein} | grep time | head -1 | awk ' { print $6 } '` 111 106 tmax=$( echo ${tmax} | awk '-F(' '{print $2}' ) 112 echo iim=$iim jjm=$jjm tmax=$tmax113 107 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 114 129 ################################################################### 115 # Create ferret script for interpolation130 # 2 - Create ferret script for interpolation 116 131 ################################################################### 117 # Write first part of ferret script 118 cat << eod > tmpinterp.jnl 132 cat << eod > ${varin}.jnl 119 133 set memory/size=50 120 134 121 135 use ${gridfile} 122 136 use ${filein} 123 let uwnd=u 124 let vwnd=v 125 let air=ta 126 let rh=r 127 let sp=msl 137 let ${varout}=${varin} 128 138 129 define axis/t=1-jan-${year}:31-dec-${year}:6/units=hours thour 130 eod 139 define axis/t=01-JAN-${year}:31-DEC-${year}:6/units=hours thour 131 140 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 141 define grid/like=${varout}[d=2]/x=cu[d=1]/y=cu[d=1] grille_u 142 define grid/like=${varout}[d=2]/x=cv[d=1]/y=cv[d=1] grille_v 143 define grid/like=${varout}[d=2]/x=cv[d=1]/y=cu[d=1] grille_t 158 144 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]145 save/clobber/file=${fileout} ${varout}[d=2,g=${grille},l=1,gt=thour@asn] 146 repeat/l=1:${tmax} save/file="${fileout}"/append ${varout}[d=2,g=${grille},gt=thour@asn] 161 147 162 148 exit … … 164 150 165 151 ################################################################### 166 # Lanch interpolation with ferret152 # 3 - Launch interpolation with ferret 167 153 ################################################################### 168 154 ferret -nojnl <<eod > /dev/null 169 go tmpinterp.jnl155 go ${varin}.jnl 170 156 quit 171 157 eod
Note: See TracChangeset
for help on using the changeset viewer.