Changeset 6064 for TOOLS/MOSAIX/CreateOasisGrids.bash
- Timestamp:
- 02/24/22 09:58:49 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TOOLS/MOSAIX/CreateOasisGrids.bash
r5159 r6064 51 51 if [[ $(hostname) = irene* ]] ; then arch=irene ; center=tgcc ; fi 52 52 if [[ $(hostname) = lsce3005* ]] ; then arch=spip ; center=spip ; fi 53 if [[ $(hostname) = lsce5138* ]] ; then arch=spip ; center=spip ; fi 53 54 54 55 PROGRAM=$(basename ${0}) … … 152 153 ncks -C --history --append --variable area_grid_${OCEGRID} ${OCE}_coordinates_mask.nc areas_${CplModel}.nc 153 154 # Inverts mask values and switch to integer 154 ncks --history -C --variable mask _${OCEGRID} ${OCE}_coordinates_mask.nc mask_${OCEGRID}_tmp.nc155 ncatted --history \ 156 --attribute coordinates,mask _${OCEGRID},d,, \157 --attribute online_operation,mask _${OCEGRID},d,, \158 --attribute cell_measures,mask _${OCEGRID},d,, \155 ncks --history -C --variable maskutil_${OCEGRID} ${OCE}_coordinates_mask.nc mask_${OCEGRID}_tmp.nc 156 ncatted --history \ 157 --attribute coordinates,maskutil_${OCEGRID},d,, \ 158 --attribute online_operation,maskutil_${OCEGRID},d,, \ 159 --attribute cell_measures,maskutil_${OCEGRID},d,, \ 159 160 mask_${OCEGRID}_tmp.nc 160 161 161 ncap2 --history --append --script "mask _${OCEGRID}=int(1-mask_${OCEGRID});" mask_${OCEGRID}_tmp.nc masks_${CplModel}.nc162 ncap2 --history --append --script "maskutil_${OCEGRID}=int(1-maskutil_${OCEGRID});" mask_${OCEGRID}_tmp.nc masks_${CplModel}.nc 162 163 rm mask_${OCEGRID}_tmp.nc 163 164 ncatted --history \ 164 --attribute long_name,mask _${OCEGRID},o,c,"Land-sea mask" \165 --attribute units,mask _${OCEGRID},o,c,"Land:1, Ocean:0" masks_${CplModel}.nc165 --attribute long_name,maskutil_${OCEGRID},o,c,"Land-sea mask" \ 166 --attribute units,maskutil_${OCEGRID},o,c,"Land:1, Ocean:0" masks_${CplModel}.nc 166 167 # Change order of dimensions 167 168 mv grids_${CplModel}.nc grids_${CplModel}_tmp.nc … … 327 328 328 329 329 echo ${Titre}"Generates grid c${atm}, 'o' meaning 'one'"${Norm}330 # same as t${atm} grid, with surfaces set to grid area331 # and mask to 0 (ocean everywhere, to compute integral over the whole grid))332 # ----------------------------------------------------------------------------333 mv grids_${CplModel}.nc grids_${CplModel}_tmp.nc334 ncap2 --history --script "c${atm}_lon=alon ; c${atm}_lat=alat ; bounds_c${atm}_lon=bounds_lon ; bounds_c${atm}_lat=bounds_lat ; " grids_${CplModel}_tmp.nc grids_${CplModel}.nc335 336 mv areas_${CplModel}.nc areas_${CplModel}_tmp.nc337 ncap2 --history --script "c${atm}_aire=aire" areas_${CplModel}_tmp.nc areas_${CplModel}.nc338 339 mv masks_${CplModel}.nc masks_${CplModel}_tmp.nc340 ncap2 --history --script "c${atm}_mask=int(Oce2AtmMask)*0+0 ; " masks_${CplModel}_tmp.nc masks_${CplModel}.nc341 342 rm grids_${CplModel}_tmp.nc areas_${CplModel}_tmp.nc masks_${CplModel}_tmp.nc330 # echo ${Titre}"Generates grid c${atm}, 'o' meaning 'one'"${Norm} 331 # # same as t${atm} grid, with surfaces set to grid area 332 # # and mask to 0 (ocean everywhere, to compute integral over the whole grid)) 333 # # ---------------------------------------------------------------------------- 334 # mv grids_${CplModel}.nc grids_${CplModel}_tmp.nc 335 # ncap2 --history --script "c${atm}_lon=alon ; c${atm}_lat=alat ; bounds_c${atm}_lon=bounds_lon ; bounds_c${atm}_lat=bounds_lat ; " grids_${CplModel}_tmp.nc grids_${CplModel}.nc 336 337 # mv areas_${CplModel}.nc areas_${CplModel}_tmp.nc 338 # ncap2 --history --script "c${atm}_aire=aire" areas_${CplModel}_tmp.nc areas_${CplModel}.nc 339 340 # mv masks_${CplModel}.nc masks_${CplModel}_tmp.nc 341 # ncap2 --history --script "c${atm}_mask=int(Oce2AtmMask)*0+0 ; " masks_${CplModel}_tmp.nc masks_${CplModel}.nc 342 343 # rm grids_${CplModel}_tmp.nc areas_${CplModel}_tmp.nc masks_${CplModel}_tmp.nc 343 344 344 345 echo ${Titre}"Generates grid o${oce}, 'o' meaning 'one'"${Norm} 345 346 # same as t${oce} grid, with surfaces set to 1 346 347 # and mask to 0 (ocean everywhere, to compute integral over the whole grid)) 347 # This grid is used when field are quantities instead of fluxes (i.e river flow)348 # This grid is used when field are quantities instead of fluxes 348 349 # -------------------------------------------------------------------------------------------------------- 349 350 mv grids_${CplModel}.nc grids_${CplModel}_tmp.nc … … 354 355 355 356 ncks -C --history --overwrite -v maskutil_T ${OCE}_coordinates_mask.nc maskutil_T.nc 356 ncap2 --history --append --script "mask _O=maskutil_T; " maskutil_T.nc masks_${CplModel}.nc357 ncap2 --history --append --script "maskutil_O=maskutil_T; " maskutil_T.nc masks_${CplModel}.nc 357 358 358 359 rm grids_${CplModel}_tmp.nc areas_${CplModel}_tmp.nc 359 360 360 361 361 echo ${Titre}"Creates OCEAN C grid : redundant points removed to compute proper integrals"${Norm}362 # --------------------------------------------------------------------------------------------------------363 364 mv grids_${CplModel}.nc grids_${CplModel}_tmp.nc365 ncap2 --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}.nc366 367 mv areas_${CplModel}.nc areas_${CplModel}_tmp.nc368 ncap2 --history --script "area_grid_C=area_grid_T ; " areas_${CplModel}_tmp.nc areas_${CplModel}.nc369 370 ncap2 --history --append --script "mask_C=maskutil_T; " maskutil_T.nc masks_${CplModel}.nc371 372 rm grids_${CplModel}_tmp.nc areas_${CplModel}_tmp.nc maskutil_T.nc362 # echo ${Titre}"Creates OCEAN C grid : redundant points removed to compute proper integrals"${Norm} 363 # # -------------------------------------------------------------------------------------------------------- 364 365 # mv grids_${CplModel}.nc grids_${CplModel}_tmp.nc 366 # ncap2 --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 367 368 # mv areas_${CplModel}.nc areas_${CplModel}_tmp.nc 369 # ncap2 --history --script "area_grid_C=area_grid_T ; " areas_${CplModel}_tmp.nc areas_${CplModel}.nc 370 371 # ncap2 --history --append --script "mask_C=maskutil_T; " maskutil_T.nc masks_${CplModel}.nc 372 373 # rm grids_${CplModel}_tmp.nc areas_${CplModel}_tmp.nc maskutil_T.nc 373 374 374 375 # 375 376 echo ${Titre}"Final renaming"${Norm} 376 377 # ---------------------------------------------------------------------------- 377 for OCEGRID in T U V O C378 for OCEGRID in T U V O 378 379 do 379 380 ocegrid=${OCEGRID~} # To lowercase … … 382 383 ncrename --history --variable bounds_lon_grid_${OCEGRID},${ocegrid}${oce}.clo grids_${CplModel}.nc 383 384 ncrename --history --variable bounds_lat_grid_${OCEGRID},${ocegrid}${oce}.cla grids_${CplModel}.nc 384 ncrename --history --variable mask _${OCEGRID},${ocegrid}${oce}.mskmasks_${CplModel}.nc385 ncrename --history --variable maskutil_${OCEGRID},${ocegrid}${oce}.msk masks_${CplModel}.nc 385 386 ncrename --history --variable area_grid_${OCEGRID},${ocegrid}${oce}.srf areas_${CplModel}.nc 386 387 … … 399 400 ncrename --history --variable bounds_lat,t${atm}.cla grids_${CplModel}.nc 400 401 401 for ATMGRID in O C; do402 for ATMGRID in O ; do 402 403 atmgrid=${ATMGRID~} # To lowercase 403 404 ncrename --history --variable ${atmgrid}${atm}_lon,${atmgrid}${atm}.lon grids_${CplModel}.nc … … 409 410 done 410 411 411 for ATMGRID in T O C; do412 for ATMGRID in T O ; do 412 413 atmgrid=${ATMGRID~} # To lowercase 413 414 ncatted --history \
Note: See TracChangeset
for help on using the changeset viewer.