Changeset 4186 for TOOLS/MOSAIX/CreateOasisGrids.bash
- Timestamp:
- 12/12/18 11:26:20 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TOOLS/MOSAIX/CreateOasisGrids.bash
r4172 r4186 54 54 PROGRAM=$(basename ${0}) 55 55 56 case ${arch} in57 ( curie | irene )58 set +vx59 module unload cdo nco ferret60 module unload netcdf hdf561 module load python # /2.7.1262 module load netcdf/4.3.3.1_hdf5_parallel # Version for XIOS63 module load nco64 R_IN=$(ccc_home -u igcmg --cccwork)/IGCM65 TMPDIR=${SCRATCHDIR}/TMP66 SUBMIT_DIR=${BRIDGE_MSUB_PWD:-${SUBMIT_DIR}}67 ;;68 ( spip )69 R_IN=${HOME}/Scratch/IGCM70 TMPDIR=${HOME}/Scratch/TMP71 SUBMIT_DIR=$(pwd)72 MPIRUN=/opt/local/bin/mpirun-openmpi-gcc49 -n 273 ;;74 ( * ) exit -1 ;;75 esac56 # case ${arch} in 57 # ( curie | irene ) 58 # set +vx 59 # module unload cdo nco ferret 60 # module unload netcdf hdf5 61 # module load python # /2.7.12 62 # module load netcdf/4.3.3.1_hdf5_parallel # Version for XIOS 63 # module load nco 64 # R_IN=$(ccc_home -u igcmg --cccwork)/IGCM 65 # TMPDIR=${SCRATCHDIR}/TMP 66 # SUBMIT_DIR=${BRIDGE_MSUB_PWD:-${SUBMIT_DIR}} 67 # ;; 68 # ( spip ) 69 # R_IN=${HOME}/Scratch/IGCM 70 # TMPDIR=${HOME}/Scratch/TMP 71 # SUBMIT_DIR=$(pwd) 72 # MPIRUN=/opt/local/bin/mpirun-openmpi-gcc49 -n 2 73 # ;; 74 # ( * ) exit -1 ;; 75 # esac 76 76 77 77 ## … … 185 185 186 186 ncks --fl_fmt=${FL_FMT3} --history -C --variable OceMask ${ATM}_grid_maskFrom_${OCE}_${FL_FMT3}.nc OceMask_tmp.nc 187 ncwa --history --overwrite --average time_counter OceMask_tmp.nc OceMask_tmp2.nc # Suppress time dimension 187 188 ncatted --history \ 189 --attribute cell_methods,OceMask,d,c, \ 188 190 --attribute coordinates,OceMask,d,, \ 189 191 --attribute online_operation,OceMask,d,, \ … … 191 193 --attribute missing_value,OceMask,d,, \ 192 194 OceMask_tmp.nc 193 ncap2 --fl_fmt=${FL_FMT3} --history --append --script "OceMask=int(1-OceMask)" OceMask_tmp.nc masks_${CplModel}.nc # For OASIS, ocean=0, land=1195 ncap2 --fl_fmt=${FL_FMT3} --history --append --script "OceMask=int(1-OceMask)" OceMask_tmp2.nc masks_${CplModel}.nc # For OASIS, ocean=0, land=1 194 196 rm OceMask_tmp.nc 195 197 ncatted --history \ … … 216 218 217 219 # 218 echo ${Titre}"DYNAMICO grids : 1) Set correct order of dimensions, 2) Add a dimension"${Norm}219 # ----------------------------------------------------------------------------220 220 if [[ ${atm} = dynamico* || ${atm} = ico* ]] ; then 221 echo ${Titre}"DYNAMICO grids : 1) Set correct order of dimensions, 2) Add a dimension"${Norm} 222 # ------------------------------------------------------------------------------------------- 221 223 mv grids_${CplModel}.nc grids_${CplModel}_tmp.nc 222 224 ncpdq --permute nvertex,ycell,xcell grids_${CplModel}_tmp.nc grids_${CplModel}.nc 223 225 224 226 mv grids_${CplModel}.nc grids_${CplModel}_tmp.nc 225 227 cat <<EOF >add_dim.nco … … 232 234 // 233 235 EOF 234 236 235 237 ncap2 --fl_fmt=${FL_FMT3} --history --append --script-file add_dim.nco grids_${CplModel}_tmp.nc grids_${CplModel}.nc 236 238 237 239 mv masks_${CplModel}.nc masks_${CplModel}_tmp.nc 238 ncap2 --fl_fmt=${FL_FMT3} --history --append --script 'defdim("xcell",1) ; OceMask[time_counter,ycell,xcell]=OceMask(:,:)' masks_${CplModel}_tmp.nc masks_${CplModel}.nc 240 ncap2 --fl_fmt=${FL_FMT3} --history --append --script 'defdim("xcell",1) ' masks_${CplModel}_tmp.nc masks_${CplModel}.nc 241 mv masks_${CplModel}.nc masks_${CplModel}_tmp.nc 242 ncap2 --fl_fmt=${FL_FMT3} --history --append --script 'OceMask[ycell,xcell]=OceMask' masks_${CplModel}_tmp.nc masks_${CplModel}.nc 239 243 240 244 mv areas_${CplModel}.nc areas_${CplModel}_tmp.nc 241 ncap2 --fl_fmt=${FL_FMT3} --history --append --script 'defdim("xcell",1) ; aire[ycell,xcell]=aire (:) ; 'areas_${CplModel}_tmp.nc areas_${CplModel}.nc245 ncap2 --fl_fmt=${FL_FMT3} --history --append --script 'defdim("xcell",1) ; aire[ycell,xcell]=aire ; ' areas_${CplModel}_tmp.nc areas_${CplModel}.nc 242 246 243 247 rm -f grids_${CplModel}_tmp.nc areas_${CplModel}_tmp.nc masks_${CplModel}_tmp.nc 244 248 fi 245 249 246 250 # 247 251 echo ${Titre}"Some changes specific to LMDZ lon/lat grid"${Norm} … … 292 296 293 297 # 298 294 299 echo ${Titre}"Generates grid o${atm}, 'o' meaning 'one'"${Norm} 295 300 # same as t${atm} grid, with surfaces set to 1 … … 308 313 rm grids_${CplModel}_tmp.nc areas_${CplModel}_tmp.nc masks_${CplModel}_tmp.nc 309 314 315 316 echo ${Titre}"Generates grid o${oce}, 'o' meaning 'one'"${Norm} 317 # same as t${oce} grid, with surfaces set to 1 318 # and mask to 0 (ocean everywhere, to compute integral over the whole grid)) 319 # This grid is used when field are quantities instead of fluxes (i.e river flow) 320 # -------------------------------------------------------------------------------------------------------- 321 mv grids_${CplModel}.nc grids_${CplModel}_tmp.nc 322 ncap2 --fl_fmt=${FL_FMT3} --history --script "nav_lon_grid_O=nav_lon_grid_T; nav_lat_grid_O=nav_lat_grid_T; bounds_lon_grid_O=bounds_lon_grid_T; bounds_lat_grid_O=bounds_o${oce}_lat=bounds_lat_grid_T; " grids_${CplModel}_tmp.nc grids_${CplModel}.nc 323 324 mv areas_${CplModel}.nc areas_${CplModel}_tmp.nc 325 ncap2 --fl_fmt=${FL_FMT3} --history --script "area_grid_O=area_grid_T*0.0d+1.0d;" areas_${CplModel}_tmp.nc areas_${CplModel}.nc 326 327 ncks -C --history --overwrite -v maskutil_T ${OCE}_coordinates_mask_${FL_FMT3}.nc maskutil_T_${FL_FMT3}.nc 328 ncap2 --fl_fmt=${FL_FMT3} --history --append --script "mask_O=maskutil_T; " maskutil_T_${FL_FMT3}.nc masks_${CplModel}.nc 329 330 rm grids_${CplModel}_tmp.nc areas_${CplModel}_tmp.nc 331 332 333 echo ${Titre}"Creates OCEAN C grid : redundant points removed to compute proper integrals"${Norm} 334 # -------------------------------------------------------------------------------------------------------- 335 336 mv grids_${CplModel}.nc grids_${CplModel}_tmp.nc 337 ncap2 --fl_fmt=${FL_FMT3} --history --script "nav_lon_grid_C=nav_lon_grid_T; nav_lat_grid_C=nav_lat_grid_T; bounds_lon_grid_C=bounds_lon_grid_T; bounds_lat_grid_C=bounds_o${oce}_lat=bounds_lat_grid_T; " grids_${CplModel}_tmp.nc grids_${CplModel}.nc 338 339 mv areas_${CplModel}.nc areas_${CplModel}_tmp.nc 340 ncap2 --fl_fmt=${FL_FMT3} --history --script "area_grid_C=area_grid_T ; " areas_${CplModel}_tmp.nc areas_${CplModel}.nc 341 342 #mv masks_${CplModel}.nc masks_${CplModel}_tmp.nc 343 ncap2 --fl_fmt=${FL_FMT3} --history --append --script "mask_C=maskutil_T; " maskutil_T_${FL_FMT3}.nc masks_${CplModel}.nc 344 345 rm grids_${CplModel}_tmp.nc areas_${CplModel}_tmp.nc maskutil_T_${FL_FMT3}.nc 346 310 347 # 311 348 echo ${Titre}"Final renaming"${Norm} 312 349 # ---------------------------------------------------------------------------- 313 for OCEGRID in T U V 350 for OCEGRID in T U V O C 314 351 do 315 352 ocegrid=${OCEGRID~} # To lowercase … … 342 379 ncrename --history --variable bounds_o${atm}_lat,o${atm}.cla grids_${CplModel}.nc 343 380 344 for atmgrid in t o ; do 381 for ATMGRID in T O ; do 382 atmgrid=${ATMGRID~} # To lowercase 345 383 ncatted --history \ 346 384 --attribute bounds,${atmgrid}${atm}.lon,c,c,"${atmgrid}${atm}.clo" \ … … 414 452 415 453 ## =========================================================================== 416 echo ${Titre}" exit from CreateOasisGrids "${Norm}454 echo ${Titre}"Exit from CreateOasisGrids "${Norm} 417 455 418 456 ## ===========================================================================
Note: See TracChangeset
for help on using the changeset viewer.