Changeset 4172 for TOOLS/MOSAIX/CreateOasisGrids.bash
- Timestamp:
- 12/05/18 11:17:10 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TOOLS/MOSAIX/CreateOasisGrids.bash
r3913 r4172 25 25 # $HeadURL$ 26 26 27 ## 28 ## Default configuration (may be overrided by command line parameters) 27 set +vx 28 29 echo ${Titre}"Starting CreateOasisGrids.bash"${Norm} 30 31 ## 32 echo ${Titre}"Default configuration (may be overrided by command line parameters)"${Norm} 29 33 ## =========================================================================== 30 34 OCE=ORCA2.3 … … 32 36 ATM=ICO30 33 37 #ATM=ICO40 34 # 35 # 36 # 38 #ATM=ICO450 39 #ATM=LMD144142 40 #ATM=LMD9695 37 41 38 42 ## =========================================================================== … … 42 46 ## =========================================================================== 43 47 44 # Defines computer 48 echo ${Titre}"Defines computer"${Norm} 45 49 # ================ 46 50 if [[ $(hostname) = curie* ]] ; then arch=curie ; center=tgcc ; fi … … 72 76 73 77 ## 74 ## Command line parameters 78 echo ${Titre}"Command line parameters"${Norm} 75 79 ## =========================================================================== 76 80 set -e … … 97 101 98 102 ## 99 ## Short names (grid names in Oasis) 103 echo ${Titre}"Short names (grid names in Oasis)"${Norm} 100 104 ## =========================================================================== 101 105 case ${OCE} in … … 111 115 112 116 ## 113 ## Get input files 117 echo ${Titre}"Get input files"${Norm} 114 118 ## =========================================================================== 115 119 [[ -f ${OCE}_coordinates_mask.nc ]] || cp ${R_IN}/OCE/NEMO/${OCE}/${OCE}_coordinates_mask.nc . … … 117 121 118 122 # 119 # Format for OASIS-MCT files : should be NetCDF3 classic or NetCDF3 64 bits 123 echo ${Titre}"Format for OASIS-MCT files : should be NetCDF3 classic or NetCDF3 64 bits"${Norm} 120 124 # --------------------------------------------------------------------------- 121 125 FL_FMT3=64bit 122 126 123 127 # 124 # Cleaning 128 echo ${Titre}"Cleaning"${Norm} 125 129 # ---------------------------------------------------------------------------- 126 130 rm -f grids_${CplModel}.nc masks_${CplModel}.nc areas_${CplModel}.nc … … 128 132 129 133 # 130 # Creates NetCDF3 version of input files 134 echo ${Titre}"Creates NetCDF3 version of input files"${Norm} 131 135 # ---------------------------------------------------------------------------- 132 136 ncks --overwrite --fl_fmt=${FL_FMT} --history ${OCE}_coordinates_mask.nc ${OCE}_coordinates_mask_${FL_FMT3}.nc … … 135 139 136 140 # 137 # Creates ocean fields 141 echo ${Titre}"Creates ocean fields"${Norm} 138 142 # ---------------------------------------------------------------------------- 139 143 for OCEGRID in T U V ; do … … 162 166 163 167 # 164 # We need to have different names for dimensions and variables 168 echo ${Titre}"We need to have different names for dimensions and variables"${Norm} 165 169 # ---------------------------------------------------------------------------- 166 170 ncrename --history --variable lon,alon grids_${CplModel}.nc … … 212 216 213 217 # 214 # DYNAMICO grids : 215 # - Set correct order of dimensions 216 # - Add a dimension 218 echo ${Titre}"DYNAMICO grids : 1) Set correct order of dimensions, 2) Add a dimension"${Norm} 217 219 # ---------------------------------------------------------------------------- 218 220 if [[ ${atm} = dynamico* || ${atm} = ico* ]] ; then … … 243 245 244 246 # 245 # Some changes specific to LMDZ lon/lat grid 247 echo ${Titre}"Some changes specific to LMDZ lon/lat grid"${Norm} 246 248 # ---------------------------------------------------------------------------- 247 249 if [[ ${atm} = lmd* ]] ; then 248 # Spreads lon and lat to get 2D fields250 echo ${Titre}"Spreads lon and lat to get 2D fields"${Norm} 249 251 # ----------------------------------------------------------------------- 250 252 mv grids_${CplModel}.nc grids_${CplModel}_tmp.nc … … 261 263 --attribute overlap,alat,o,i,0 grids_${CplModel}.nc 262 264 263 # Generates cell corners265 echo ${Titre}"Generates cell corners"${Norm} 264 266 # ----------------------------------------------------------------------- 265 267 cat <<EOF > add_bounds.nco … … 290 292 291 293 # 292 # Generates grid "o${atm}", "o" meaning "one": same as t${atm} grid, with surfaces set to 1 294 echo ${Titre}"Generates grid o${atm}, 'o' meaning 'one'"${Norm} 295 # same as t${atm} grid, with surfaces set to 1 293 296 # and mask to 0 (ocean everywhere, to compute integral over the whole grid)) 294 297 # This grid is used when field are quantities instead of fluxes (i.e river flow) … … 306 309 307 310 # 308 # Final renaming 311 echo ${Titre}"Final renaming"${Norm} 309 312 # ---------------------------------------------------------------------------- 310 313 for OCEGRID in T U V … … 348 351 349 352 ## 350 ## Change all NetCDF files to NetCDF 3 format 353 echo ${Titre}"Change all NetCDF files to NetCDF 3 format"${Norm} 351 354 ## =========================================================================== 352 355 for InFile in areas_${CplModel}.nc grids_${CplModel}.nc masks_${CplModel}.nc ; do … … 359 362 360 363 ## 361 ## Add some useful information in NetCDF headers 364 echo ${Titre}"Add some useful information in NetCDF headers"${Norm} 362 365 ## =========================================================================== 363 366 UUID=$(uuid) … … 390 393 --attribute release,global,o,c,"$(uname -r)" \ 391 394 --attribute hardware,global,o,c,"$(uname -i)" \ 392 --attribute Comment,global,o,c,"Preliminary attempt - Do not trust !" \393 395 --attribute SVN_Author,global,o,c,"$Author$" \ 394 396 --attribute SVN_Date,global,o,c,"$Date$" \ … … 399 401 done 400 402 401 ##402 ## Cleaning403 ## ===========================================================================404 #rm *_tmp.nc ${OCE}_coordinates_mask_${FL_FMT3}.nc ${ATM}_grid_maskFrom_${OCE}_${FL_FMT3}.nc *.nco405 403 406 404 exit 407 405 # 408 # Name of the dimensions ?406 echo ${Titre}"Name of the dimensions ?"${Norm} 409 407 # ---------------------------------------------------------------------------- 410 408 for OCEGRID in T U V ; do … … 416 414 417 415 ## =========================================================================== 418 ## 419 ## That's all folk's !!! 420 ## 421 ## =========================================================================== 416 echo ${Titre}"exit from CreateOasisGrids "${Norm} 417 418 ## =========================================================================== 419 ## 420 echo ${Titre}" That's all folk's !!! "${Norm} 421 ## 422 ## ===========================================================================
Note: See TracChangeset
for help on using the changeset viewer.