Ignore:
Timestamp:
12/05/18 11:17:10 (6 years ago)
Author:
omamce
Message:

O.M. :

  • More documentation
  • Update run-off weights computation
  • Update calving weights computation
File:
1 edited

Legend:

Unmodified
Added
Removed
  • TOOLS/MOSAIX/CreateOasisGrids.bash

    r3913 r4172  
    2525#  $HeadURL$ 
    2626 
    27 ## 
    28 ## Default configuration (may be overrided by command line parameters) 
     27set +vx 
     28 
     29echo ${Titre}"Starting CreateOasisGrids.bash"${Norm} 
     30 
     31## 
     32echo ${Titre}"Default configuration (may be overrided by command line parameters)"${Norm} 
    2933## =========================================================================== 
    3034OCE=ORCA2.3 
     
    3236ATM=ICO30 
    3337#ATM=ICO40 
    34 # ATM=ICO450 
    35 # ATM=LMD144142 
    36 # ATM=LMD9695 
     38#ATM=ICO450 
     39#ATM=LMD144142 
     40#ATM=LMD9695 
    3741 
    3842## =========================================================================== 
     
    4246## =========================================================================== 
    4347 
    44 # Defines computer 
     48echo ${Titre}"Defines computer"${Norm} 
    4549# ================ 
    4650if [[ $(hostname) = curie* ]]    ; then arch=curie ; center=tgcc ; fi 
     
    7276 
    7377## 
    74 ## Command line parameters 
     78echo ${Titre}"Command line parameters"${Norm} 
    7579## =========================================================================== 
    7680set -e 
     
    97101 
    98102## 
    99 ## Short names (grid names in Oasis)  
     103echo ${Titre}"Short names (grid names in Oasis)"${Norm} 
    100104## =========================================================================== 
    101105case ${OCE} in 
     
    111115 
    112116## 
    113 ## Get input files 
     117echo ${Titre}"Get input files"${Norm} 
    114118## =========================================================================== 
    115119[[ -f ${OCE}_coordinates_mask.nc ]] || cp ${R_IN}/OCE/NEMO/${OCE}/${OCE}_coordinates_mask.nc  . 
     
    117121 
    118122# 
    119 # Format for OASIS-MCT files : should be NetCDF3 classic or NetCDF3 64 bits 
     123echo ${Titre}"Format for OASIS-MCT files : should be NetCDF3 classic or NetCDF3 64 bits"${Norm} 
    120124# --------------------------------------------------------------------------- 
    121125FL_FMT3=64bit 
    122126 
    123127# 
    124 # Cleaning 
     128echo ${Titre}"Cleaning"${Norm} 
    125129# ---------------------------------------------------------------------------- 
    126130rm -f grids_${CplModel}.nc masks_${CplModel}.nc areas_${CplModel}.nc 
     
    128132 
    129133# 
    130 # Creates NetCDF3 version of input files 
     134echo ${Titre}"Creates NetCDF3 version of input files"${Norm} 
    131135# ---------------------------------------------------------------------------- 
    132136ncks --overwrite --fl_fmt=${FL_FMT} --history ${OCE}_coordinates_mask.nc      ${OCE}_coordinates_mask_${FL_FMT3}.nc 
     
    135139 
    136140# 
    137 # Creates ocean fields 
     141echo ${Titre}"Creates ocean fields"${Norm} 
    138142# ---------------------------------------------------------------------------- 
    139143for OCEGRID in T U V ; do 
     
    162166  
    163167# 
    164 # We need to have different names for dimensions and variables 
     168echo ${Titre}"We need to have different names for dimensions and variables"${Norm} 
    165169# ---------------------------------------------------------------------------- 
    166170ncrename --history --variable lon,alon   grids_${CplModel}.nc 
     
    212216 
    213217# 
    214 # DYNAMICO grids : 
    215 #  - Set correct order of dimensions 
    216 #  - Add a dimension 
     218echo ${Titre}"DYNAMICO grids : 1) Set correct order of dimensions, 2) Add a dimension"${Norm} 
    217219# ---------------------------------------------------------------------------- 
    218220if [[ ${atm} = dynamico* || ${atm} = ico* ]] ; then 
     
    243245 
    244246# 
    245 # Some changes specific to LMDZ lon/lat grid 
     247echo ${Titre}"Some changes specific to LMDZ lon/lat grid"${Norm} 
    246248# ---------------------------------------------------------------------------- 
    247249if [[ ${atm} = lmd* ]] ; then 
    248     # Spreads lon and lat to get 2D fields 
     250    echo ${Titre}"Spreads lon and lat to get 2D fields"${Norm} 
    249251    # ----------------------------------------------------------------------- 
    250252    mv grids_${CplModel}.nc grids_${CplModel}_tmp.nc 
     
    261263            --attribute overlap,alat,o,i,0                grids_${CplModel}.nc 
    262264     
    263     # Generates cell corners 
     265    echo ${Titre}"Generates cell corners"${Norm} 
    264266    # ----------------------------------------------------------------------- 
    265267cat <<EOF > add_bounds.nco 
     
    290292 
    291293# 
    292 # Generates grid "o${atm}", "o" meaning "one": same as t${atm} grid, with surfaces set to 1 
     294echo ${Titre}"Generates grid o${atm}, 'o' meaning 'one'"${Norm} 
     295# same as t${atm} grid, with surfaces set to 1 
    293296# and mask to 0 (ocean everywhere, to compute integral over the whole grid)) 
    294297# This grid is used when field are quantities instead of fluxes (i.e river flow) 
     
    306309 
    307310# 
    308 # Final renaming 
     311echo ${Titre}"Final renaming"${Norm} 
    309312# ---------------------------------------------------------------------------- 
    310313for OCEGRID in T U V 
     
    348351 
    349352## 
    350 ## Change all NetCDF files to NetCDF 3 format 
     353echo ${Titre}"Change all NetCDF files to NetCDF 3 format"${Norm} 
    351354## =========================================================================== 
    352355for InFile in areas_${CplModel}.nc grids_${CplModel}.nc masks_${CplModel}.nc ; do 
     
    359362 
    360363## 
    361 ## Add some useful information in NetCDF headers 
     364echo ${Titre}"Add some useful information in NetCDF headers"${Norm} 
    362365## =========================================================================== 
    363366UUID=$(uuid) 
     
    390393            --attribute release,global,o,c,"$(uname -r)"               \ 
    391394            --attribute hardware,global,o,c,"$(uname -i)"              \ 
    392             --attribute Comment,global,o,c,"Preliminary attempt - Do not trust !" \ 
    393395            --attribute SVN_Author,global,o,c,"$Author$"      \ 
    394396            --attribute SVN_Date,global,o,c,"$Date$" \ 
     
    399401done 
    400402 
    401 ## 
    402 ## Cleaning 
    403 ## =========================================================================== 
    404 #rm  *_tmp.nc ${OCE}_coordinates_mask_${FL_FMT3}.nc ${ATM}_grid_maskFrom_${OCE}_${FL_FMT3}.nc *.nco 
    405403 
    406404exit 
    407405# 
    408 # Name of the dimensions ?  
     406echo ${Titre}"Name of the dimensions ?"${Norm}  
    409407# ---------------------------------------------------------------------------- 
    410408for OCEGRID in T U V ; do 
     
    416414 
    417415## =========================================================================== 
    418 ## 
    419 ##                               That's all folk's !!! 
    420 ## 
    421 ## =========================================================================== 
     416echo ${Titre}"exit from CreateOasisGrids "${Norm} 
     417 
     418## =========================================================================== 
     419## 
     420echo ${Titre}"                  That's all folk's !!!   "${Norm} 
     421## 
     422## =========================================================================== 
Note: See TracChangeset for help on using the changeset viewer.