Ignore:
Timestamp:
02/24/22 09:58:49 (2 years ago)
Author:
omamce
Message:

O.M. : changes in MOSAIX

  • Correct ocean mask to remove periodic duplicated points, to have full conservation of run-off
  • Suppress creation of corc mask, which is not used
  • Put SVN keywords in make_mosaic
  • Update nemo.py with somùe additionnal utilities
  • Adapt RunOffWeights?.py to new nemo module
  • Adapt CalvingWeights?.py to new ORCA configurations
File:
1 edited

Legend:

Unmodified
Added
Removed
  • TOOLS/MOSAIX/CreateOasisGrids.bash

    r5159 r6064  
    5151if [[ $(hostname) = irene* ]]    ; then arch=irene ; center=tgcc ; fi 
    5252if [[ $(hostname) = lsce3005* ]] ; then arch=spip  ; center=spip ; fi 
     53if [[ $(hostname) = lsce5138* ]] ; then arch=spip  ; center=spip ; fi 
    5354 
    5455PROGRAM=$(basename ${0}) 
     
    152153    ncks -C --history --append --variable area_grid_${OCEGRID} ${OCE}_coordinates_mask.nc areas_${CplModel}.nc 
    153154    # Inverts mask values and switch to integer 
    154     ncks --history -C --variable mask_${OCEGRID} ${OCE}_coordinates_mask.nc mask_${OCEGRID}_tmp.nc 
    155     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,,       \ 
    159160    mask_${OCEGRID}_tmp.nc 
    160161     
    161     ncap2 --history --append --script "mask_${OCEGRID}=int(1-mask_${OCEGRID});"    mask_${OCEGRID}_tmp.nc masks_${CplModel}.nc 
     162    ncap2 --history --append --script "maskutil_${OCEGRID}=int(1-maskutil_${OCEGRID});"    mask_${OCEGRID}_tmp.nc masks_${CplModel}.nc 
    162163    rm mask_${OCEGRID}_tmp.nc 
    163164    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}.nc 
     165            --attribute long_name,maskutil_${OCEGRID},o,c,"Land-sea mask" \ 
     166            --attribute units,maskutil_${OCEGRID},o,c,"Land:1, Ocean:0"    masks_${CplModel}.nc 
    166167    # Change order of dimensions 
    167168    mv grids_${CplModel}.nc grids_${CplModel}_tmp.nc 
     
    327328 
    328329 
    329 echo ${Titre}"Generates grid c${atm}, 'o' meaning 'one'"${Norm} 
    330 # same as t${atm} grid, with surfaces set to grid area 
    331 # and mask to 0 (ocean everywhere, to compute integral over the whole grid)) 
    332 # ---------------------------------------------------------------------------- 
    333 mv grids_${CplModel}.nc grids_${CplModel}_tmp.nc 
    334 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 
    335  
    336 mv areas_${CplModel}.nc areas_${CplModel}_tmp.nc 
    337 ncap2 --history --script "c${atm}_aire=aire"   areas_${CplModel}_tmp.nc areas_${CplModel}.nc 
    338  
    339 mv masks_${CplModel}.nc masks_${CplModel}_tmp.nc 
    340 ncap2 --history --script "c${atm}_mask=int(Oce2AtmMask)*0+0 ; " masks_${CplModel}_tmp.nc masks_${CplModel}.nc 
    341  
    342 rm grids_${CplModel}_tmp.nc areas_${CplModel}_tmp.nc masks_${CplModel}_tmp.nc 
     330# 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 
    343344 
    344345echo ${Titre}"Generates grid o${oce}, 'o' meaning 'one'"${Norm} 
    345346# same as t${oce} grid, with surfaces set to 1 
    346347# 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 
    348349# -------------------------------------------------------------------------------------------------------- 
    349350mv grids_${CplModel}.nc grids_${CplModel}_tmp.nc 
     
    354355 
    355356ncks -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}.nc 
     357ncap2 --history --append --script "maskutil_O=maskutil_T; " maskutil_T.nc masks_${CplModel}.nc 
    357358 
    358359rm grids_${CplModel}_tmp.nc areas_${CplModel}_tmp.nc  
    359360 
    360361 
    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.nc 
    365 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 
    366  
    367 mv areas_${CplModel}.nc areas_${CplModel}_tmp.nc 
    368 ncap2 --history --script "area_grid_C=area_grid_T ; "   areas_${CplModel}_tmp.nc areas_${CplModel}.nc 
    369  
    370 ncap2 --history --append --script "mask_C=maskutil_T; " maskutil_T.nc masks_${CplModel}.nc 
    371  
    372 rm grids_${CplModel}_tmp.nc areas_${CplModel}_tmp.nc maskutil_T.nc 
     362# 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 
    373374 
    374375# 
    375376echo ${Titre}"Final renaming"${Norm} 
    376377# ---------------------------------------------------------------------------- 
    377 for OCEGRID in T U V O C 
     378for OCEGRID in T U V O 
    378379do 
    379380    ocegrid=${OCEGRID~} # To lowercase 
     
    382383    ncrename --history --variable bounds_lon_grid_${OCEGRID},${ocegrid}${oce}.clo  grids_${CplModel}.nc 
    383384    ncrename --history --variable bounds_lat_grid_${OCEGRID},${ocegrid}${oce}.cla  grids_${CplModel}.nc 
    384     ncrename --history --variable mask_${OCEGRID},${ocegrid}${oce}.msk             masks_${CplModel}.nc 
     385    ncrename --history --variable maskutil_${OCEGRID},${ocegrid}${oce}.msk         masks_${CplModel}.nc 
    385386    ncrename --history --variable area_grid_${OCEGRID},${ocegrid}${oce}.srf        areas_${CplModel}.nc 
    386387     
     
    399400ncrename --history --variable bounds_lat,t${atm}.cla          grids_${CplModel}.nc 
    400401 
    401 for ATMGRID in O C ; do 
     402for ATMGRID in O ; do 
    402403    atmgrid=${ATMGRID~} # To lowercase 
    403404    ncrename --history --variable ${atmgrid}${atm}_lon,${atmgrid}${atm}.lon         grids_${CplModel}.nc 
     
    409410done 
    410411     
    411 for ATMGRID in T O C ; do 
     412for ATMGRID in T O ; do 
    412413    atmgrid=${ATMGRID~} # To lowercase 
    413414    ncatted --history \ 
Note: See TracChangeset for help on using the changeset viewer.