Changeset 3686 for TOOLS


Ignore:
Timestamp:
03/23/18 10:55:23 (6 years ago)
Author:
omamce
Message:

O.M. : correct OIceFrc variable name.
More documentation

Location:
TOOLS/MOSAIX
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • TOOLS/MOSAIX/CreateOasisGrids.bash

    r3665 r3686  
    6767## Command line parameters 
    6868## =========================================================================== 
     69set -e 
    6970set -o verbose 
    7071set -o xtrace 
     
    106107## =========================================================================== 
    107108[[ -f ${OCE}_coordinates_mask.nc ]] || cp ${R_IN}/OCE/NEMO/${OCE}/${OCE}_coordinates_mask.nc  . 
    108 [[ -f ${ATM}_grid.nc             ]] || cp ${R_IN}/ATM/${ATM}/${ATM}_grid.nc                   . 
     109[[ -f ${ATM}_grid.nc             ]] || cp ${R_IN}/ATM/GRID/${ATM}_grid.nc                   . 
    109110 
    110111# 
     
    129130 
    130131for OCEGRID in T U V ; do 
    131     ncks --fl_fmt=${FL_FMT} -C --history --append -v nav_lon_grid_${OCEGRID},nav_lat_grid_${OCEGRID},bounds_lon_grid_${OCEGRID},bounds_lat_grid_${OCEGRID} ${OCE}_coordinates_mask_${FL_FMT}.nc grids_${CplModel}.nc 
    132     ncks --fl_fmt=${FL_FMT} -C --history --append -v area_grid_${OCEGRID} ${OCE}_coordinates_mask_${FL_FMT}.nc areas_${CplModel}.nc 
     132    ncks --fl_fmt=${FL_FMT} -C --history --append --variable nav_lon_grid_${OCEGRID},nav_lat_grid_${OCEGRID},bounds_lon_grid_${OCEGRID},bounds_lat_grid_${OCEGRID} ${OCE}_coordinates_mask_${FL_FMT}.nc grids_${CplModel}.nc 
     133    ncks --fl_fmt=${FL_FMT} -C --history --append --variable area_grid_${OCEGRID} ${OCE}_coordinates_mask_${FL_FMT}.nc areas_${CplModel}.nc 
    133134    # Inverts mask values and switch to integer 
    134     ncks --fl_fmt=${FL_FMT} --history -C -v mask_${OCEGRID} ${OCE}_coordinates_mask_${FL_FMT}.nc mask_${OCEGRID}_tmp.nc 
     135    ncks --fl_fmt=${FL_FMT} --history -C --variable mask_${OCEGRID} ${OCE}_coordinates_mask_${FL_FMT}.nc mask_${OCEGRID}_tmp.nc 
    135136    ncatted --history \ 
    136137            --attribute coordinates,mask_${OCEGRID},d,,         \ 
     
    139140    mask_${OCEGRID}_tmp.nc 
    140141     
    141     ncap2 --fl_fmt=${FL_FMT} --history --append -s "mask_${OCEGRID}=int(1-mask_${OCEGRID});"    mask_${OCEGRID}_tmp.nc masks_${CplModel}.nc 
     142    ncap2 --fl_fmt=${FL_FMT} --history --append --script "mask_${OCEGRID}=int(1-mask_${OCEGRID});"    mask_${OCEGRID}_tmp.nc masks_${CplModel}.nc 
    142143    ncatted --history \ 
    143144            --attribute long_name,mask_${OCEGRID},o,c,"Land-sea mask" \ 
     
    148149done 
    149150 
    150 ncks --history --append -v lon,lat ${ATM}_grid_maskFrom_${OCE}_${FL_FMT}.nc grids_${CplModel}.nc 
     151ncks --history --append --variable lon,lat ${ATM}_grid_maskFrom_${OCE}_${FL_FMT}.nc grids_${CplModel}.nc 
    151152 
    152153# 
    153154# We need to have different names for dimensions and variables 
    154155# ---------------------------------------------------------------------------- 
    155 ncrename --history -v lon,alon   grids_${CplModel}.nc 
    156 ncrename --history -v lat,alat   grids_${CplModel}.nc 
     156ncrename --history --variable lon,alon   grids_${CplModel}.nc 
     157ncrename --history --variable lat,alat   grids_${CplModel}.nc 
    157158 
    158159if [[ ${ATM} = dynamico* || ${ATM} = ICO* ]] ; then  
    159     ncks --fl_fmt=${FL_FMT} --history --append -v bounds_lon,bounds_lat ${ATM}_grid_maskFrom_${OCE}_${FL_FMT}.nc grids_${CplModel}.nc 
     160    ncks --fl_fmt=${FL_FMT} --history --append --variable bounds_lon,bounds_lat ${ATM}_grid_maskFrom_${OCE}_${FL_FMT}.nc grids_${CplModel}.nc 
    160161fi 
    161162 
    162 ncks --fl_fmt=${FL_FMT} --history -C --append -v aire   ${ATM}_grid_maskFrom_${OCE}_${FL_FMT}.nc areas_${CplModel}.nc 
     163ncks --fl_fmt=${FL_FMT} --history -C --append --variable aire   ${ATM}_grid_maskFrom_${OCE}_${FL_FMT}.nc areas_${CplModel}.nc 
    163164ncatted --history --attribute coordinates,aire,d,,     \ 
    164165        --attribute _FillValue,aire,d,,                \ 
     
    169170        areas_${CplModel}.nc 
    170171 
    171 ncks --fl_fmt=${FL_FMT} --history -C -v OceMask         ${ATM}_grid_maskFrom_${OCE}_${FL_FMT}.nc OceMask_tmp.nc 
     172ncks --fl_fmt=${FL_FMT} --history -C --variable OceMask         ${ATM}_grid_maskFrom_${OCE}_${FL_FMT}.nc OceMask_tmp.nc 
    172173ncatted --history \ 
    173174        --attribute coordinates,OceMask,d,,         \ 
     
    176177        --attribute missing_value,OceMask,d,,       \ 
    177178        OceMask_tmp.nc 
    178 ncap2 --fl_fmt=${FL_FMT} --history --append -s "OceMask=int(1-OceMask)"            OceMask_tmp.nc masks_${CplModel}.nc # For OASIS, ocean=0, land=1 
     179ncap2 --fl_fmt=${FL_FMT} --history --append --script "OceMask=int(1-OceMask)"            OceMask_tmp.nc masks_${CplModel}.nc # For OASIS, ocean=0, land=1 
    179180ncatted --history \ 
    180181        --attribute long_name,OceMask,o,c,"Land-sea mask"   \ 
     
    186187 
    187188if [[ ${atm} = *dynamico* || ${atm} = ico* ]] ; then 
    188     ncrename --history -d cell,ycell grids_${CplModel}.nc 
    189     ncrename --history -d cell,ycell areas_${CplModel}.nc 
    190     ncrename --history -d cell,ycell masks_${CplModel}.nc 
     189    ncrename --history --dimension cell,ycell grids_${CplModel}.nc 
     190    ncrename --history --dimension cell,ycell areas_${CplModel}.nc 
     191    ncrename --history --dimension cell,ycell masks_${CplModel}.nc 
    191192fi 
    192193# if [[ ${atm} = *lmd* ]] ; then 
    193 #     ncrename -d lon,tlmdlon  grids_${CplModel}.nc 
    194 #     ncrename -d lat,tlmdlat  grids_${CplModel}.nc 
    195 #     ncrename -d lon,tlmdlon  masks_${CplModel}.nc 
    196 #     ncrename -d lat,tlmdlat  masks_${CplModel}.nc 
    197 #     ncrename -d lon,tlmdlon  areas_${CplModel}.nc 
    198 #     ncrename -d lat,tlmdlat  areas_${CplModel}.nc 
     194#     ncrename --dimension lon,tlmdlon  grids_${CplModel}.nc 
     195#     ncrename --dimension lat,tlmdlat  grids_${CplModel}.nc 
     196#     ncrename --dimension lon,tlmdlon  masks_${CplModel}.nc 
     197#     ncrename --dimension lat,tlmdlat  masks_${CplModel}.nc 
     198#     ncrename --dimension lon,tlmdlon  areas_${CplModel}.nc 
     199#     ncrename --dimension lat,tlmdlat  areas_${CplModel}.nc 
    199200# fi 
    200201 
     
    219220EOF 
    220221     
    221     ncap2 --fl_fmt=${FL_FMT} --history --append -S add_dim.nco  grids_${CplModel}_tmp.nc grids_${CplModel}.nc 
     222    ncap2 --fl_fmt=${FL_FMT} --history --append --script-file add_dim.nco  grids_${CplModel}_tmp.nc grids_${CplModel}.nc 
    222223     
    223224    mv masks_${CplModel}.nc masks_${CplModel}_tmp.nc 
    224     ncap2 --fl_fmt=${FL_FMT} --history --append -s 'defdim("xcell",1) ; OceMask[time_counter,ycell,xcell]=OceMask(:,:)'  masks_${CplModel}_tmp.nc masks_${CplModel}.nc 
     225    ncap2 --fl_fmt=${FL_FMT} --history --append --script 'defdim("xcell",1) ; OceMask[time_counter,ycell,xcell]=OceMask(:,:)'  masks_${CplModel}_tmp.nc masks_${CplModel}.nc 
    225226 
    226227    mv areas_${CplModel}.nc areas_${CplModel}_tmp.nc 
    227     ncap2 --fl_fmt=${FL_FMT} --history --append -s 'defdim("xcell",1) ; aire[ycell,xcell]=aire(:) ; '                       areas_${CplModel}_tmp.nc areas_${CplModel}.nc 
     228    ncap2 --fl_fmt=${FL_FMT} --history --append --script 'defdim("xcell",1) ; aire[ycell,xcell]=aire(:) ; '                       areas_${CplModel}_tmp.nc areas_${CplModel}.nc 
    228229fi 
    229230 
     
    235236    # ----------------------------------------------------------------------- 
    236237    mv grids_${CplModel}.nc grids_${CplModel}_tmp.nc 
    237     ncap2 --fl_fmt=${FL_FMT} --history --append -s "alon[lat,lon]=alon; alat[lat,lon]=alat"  grids_${CplModel}_tmp.nc grids_${CplModel}.nc 
     238    ncap2 --fl_fmt=${FL_FMT} --history --append --script "alon[lat,lon]=alon; alat[lat,lon]=alat"  grids_${CplModel}_tmp.nc grids_${CplModel}.nc 
    238239    ncatted --history \ 
    239240            --attribute long_name,alon,o,c,"Longitude"    \ 
     
    270271EOF 
    271272    mv grids_${CplModel}.nc grids_${CplModel}_tmp.nc 
    272     ncap2 --fl_fmt=${FL_FMT} --history -S add_bounds.nco -O grids_${CplModel}_tmp.nc grids_${CplModel}.nc 
     273    ncap2 --fl_fmt=${FL_FMT} --history --script-file add_bounds.nco -O grids_${CplModel}_tmp.nc grids_${CplModel}.nc 
    273274fi 
    274275 
    275276# 
    276 # Generates grid "aone" : same as t-ocean grid, with surfaces set to 1 
     277# Generates grid "o${atm}e" : same as t${atm} grid, with surfaces set to 1 
     278# and mask to 0 (ocean everywhere, to compute integral over the whole grid)) 
    277279# This grid is used when field are quantities instead of fluxes (i.e river flow) 
    278280# ---------------------------------------------------------------------------- 
    279281mv grids_${CplModel}.nc grids_${CplModel}_tmp.nc 
    280 ncap2 --fl_fmt=${FL_FMT} --history -s "aone_lon=alon; aone_lat=alat; bounds_aone_lon=bounds_lon; bounds_aone_lat=bounds_lat; " grids_${CplModel}_tmp.nc grids_${CplModel}.nc 
     282ncap2 --fl_fmt=${FL_FMT} --history --script "o${atm}_lon=alon; o${atm}_lat=alat; bounds_o${atm}_lon=bounds_lon; bounds_o${atm}_lat=bounds_lat; " grids_${CplModel}_tmp.nc grids_${CplModel}.nc 
    281283 
    282284mv areas_${CplModel}.nc areas_${CplModel}_tmp.nc 
    283 ncap2 --fl_fmt=${FL_FMT} --history -s "aone_aire=aire*0+1; " areas_${CplModel}_tmp.nc areas_${CplModel}.nc 
     285ncap2 --fl_fmt=${FL_FMT} --history --script "o${atm}_aire=aire*0.0d+1.0d; "  areas_${CplModel}_tmp.nc areas_${CplModel}.nc 
    284286 
    285287mv masks_${CplModel}.nc masks_${CplModel}_tmp.nc 
    286 ncap2 --fl_fmt=${FL_FMT} --history -s "aone_mask=int(OceMask); " masks_${CplModel}_tmp.nc masks_${CplModel}.nc 
     288ncap2 --fl_fmt=${FL_FMT} --history --script "o${atm}_mask=int(OceMask)*0+0; " masks_${CplModel}_tmp.nc masks_${CplModel}.nc 
    287289 
    288290# 
     
    292294do 
    293295    ocegrid=${OCEGRID~} # To lowercase 
    294     ncrename --history -v nav_lon_grid_${OCEGRID},${ocegrid}${oce}.lon     grids_${CplModel}.nc 
    295     ncrename --history -v nav_lat_grid_${OCEGRID},${ocegrid}${oce}.lat     grids_${CplModel}.nc 
    296     ncrename --history -v bounds_lon_grid_${OCEGRID},${ocegrid}${oce}.clo  grids_${CplModel}.nc 
    297     ncrename --history -v bounds_lat_grid_${OCEGRID},${ocegrid}${oce}.cla  grids_${CplModel}.nc 
    298     ncrename --history -v mask_${OCEGRID},${ocegrid}${oce}.msk             masks_${CplModel}.nc 
    299     ncrename --history -v area_grid_${OCEGRID},${ocegrid}${oce}.srf        areas_${CplModel}.nc 
     296    ncrename --history --variable nav_lon_grid_${OCEGRID},${ocegrid}${oce}.lon     grids_${CplModel}.nc 
     297    ncrename --history --variable nav_lat_grid_${OCEGRID},${ocegrid}${oce}.lat     grids_${CplModel}.nc 
     298    ncrename --history --variable bounds_lon_grid_${OCEGRID},${ocegrid}${oce}.clo  grids_${CplModel}.nc 
     299    ncrename --history --variable bounds_lat_grid_${OCEGRID},${ocegrid}${oce}.cla  grids_${CplModel}.nc 
     300    ncrename --history --variable mask_${OCEGRID},${ocegrid}${oce}.msk             masks_${CplModel}.nc 
     301    ncrename --history --variable area_grid_${OCEGRID},${ocegrid}${oce}.srf        areas_${CplModel}.nc 
    300302     
    301303    ncatted --history \ 
     
    306308done 
    307309 
    308 ncrename --history -v alon,t${atm}.lon           grids_${CplModel}.nc 
    309 ncrename --history -v alat,t${atm}.lat           grids_${CplModel}.nc 
    310 ncrename --history -v aone_lon,o${atm}.lon       grids_${CplModel}.nc 
    311 ncrename --history -v aone_lat,o${atm}.lat       grids_${CplModel}.nc 
    312 ncrename --history -v OceMask,t${atm}.msk        masks_${CplModel}.nc 
    313 ncrename --history -v aone_mask,o${atm}.msk      masks_${CplModel}.nc 
    314 ncrename --history -v aire,t${atm}.srf           areas_${CplModel}.nc 
    315 ncrename --history -v aone_aire,o${atm}.srf      areas_${CplModel}.nc 
    316  
    317 ncrename --history -v bounds_lon,t${atm}.clo        grids_${CplModel}.nc 
    318 ncrename --history -v bounds_lat,t${atm}.cla        grids_${CplModel}.nc 
    319 ncrename --history -v bounds_aone_lon,o${atm}.clo   grids_${CplModel}.nc 
    320 ncrename --history -v bounds_aone_lat,o${atm}.cla   grids_${CplModel}.nc 
     310ncrename --history --variable alon,t${atm}.lon                grids_${CplModel}.nc 
     311ncrename --history --variable alat,t${atm}.lat                grids_${CplModel}.nc 
     312ncrename --history --variable o${atm}_lon,o${atm}.lon         grids_${CplModel}.nc 
     313ncrename --history --variable o${atm}_lat,o${atm}.lat         grids_${CplModel}.nc 
     314ncrename --history --variable OceMask,t${atm}.msk             masks_${CplModel}.nc 
     315ncrename --history --variable o${atm}_mask,o${atm}.msk        masks_${CplModel}.nc 
     316ncrename --history --variable aire,t${atm}.srf                areas_${CplModel}.nc 
     317ncrename --history --variable o${atm}_aire,o${atm}.srf        areas_${CplModel}.nc 
     318 
     319ncrename --history --variable bounds_lon,t${atm}.clo          grids_${CplModel}.nc 
     320ncrename --history --variable bounds_lat,t${atm}.cla          grids_${CplModel}.nc 
     321ncrename --history --variable bounds_o${atm}_lon,o${atm}.clo  grids_${CplModel}.nc 
     322ncrename --history --variable bounds_o${atm}_lat,o${atm}.cla  grids_${CplModel}.nc 
    321323 
    322324for atmgrid in t o ; do 
     
    324326            --attribute bounds,${atmgrid}${atm}.lon,c,c,"${atmgrid}${atm}.clo"   \ 
    325327            --attribute bounds,${atmgrid}${atm}.lat,c,c,"${atmgrid}${atm}.cla"   \ 
    326             --attribute units,${atmgrid}${atm}.clo,o,c,"degrees_east"         \ 
     328            --attribute units,${atmgrid}${atm}.clo,o,c,"degrees_east"            \ 
    327329            --attribute units,${atmgrid}${atm}.cla,o,c,"degrees_north"        grids_${CplModel}.nc 
    328330done 
     
    389391for OCEGRID in T U V ; do 
    390392    ocegrid=${OCEGRID~} # Downcase name of grids 
    391     ncrename --history -d  x_grid_${OCEGRID},x${ocegrid}${oce}         grids_${CplModel}.nc 
    392     ncrename --history -d  y_grid_${OCEGRID},y${ocegrid}${oce}         grids_${CplModel}.nc 
    393     ncrename --history -d  nvertex_grid_${OCEGRID},crn${ocegrid}${oce} grids_${CplModel}.nc 
     393    ncrename --history --dimension  x_grid_${OCEGRID},x${ocegrid}${oce}         grids_${CplModel}.nc 
     394    ncrename --history --dimension  y_grid_${OCEGRID},y${ocegrid}${oce}         grids_${CplModel}.nc 
     395    ncrename --history --dimension  nvertex_grid_${OCEGRID},crn${ocegrid}${oce} grids_${CplModel}.nc 
    394396done 
    395397 
  • TOOLS/MOSAIX/CreateRestartAtm4Oasis.bash

    r3665 r3686  
    100100## Extract variables 
    101101## =========================================================================== 
    102 ncks --overwrite --fl_fmt=${FL_FMT} --history -d time_counter,0,0 -v lon,lat,sols,soll,fract_oce,fract_sic,precip,snow,evap_sic,evap_oce,wind10m,taux_oce,tauy_oce,taux_sic,tauy_sic ${AtmFile} flxat_fields.nc 
    103 ncwa --overwrite --fl_fmt=${FL_FMT} --history -a time_counter flxat_fields.nc flxat_fields_notime.nc # remove time dimension  
     102ncks --overwrite --fl_fmt=${FL_FMT} --history --dimension time_counter,0,0 --variable lon,lat,sols,soll,fract_oce,fract_sic,precip,snow,evap_sic,evap_oce,wind10m,taux_oce,tauy_oce,taux_sic,tauy_sic ${AtmFile} flxat_fields.nc 
     103ncwa --overwrite --fl_fmt=${FL_FMT} --history --average time_counter flxat_fields.nc flxat_fields_notime.nc # remove time dimension  
    104104ncatted --history --attribute history,global,d,c,""  flxat_fields_notime.nc          # cleaning of history attributes 
    105105 
     
    114114    ico_nbp=$( echo "sqrt(($dim_cell-2)/10)+1" | bc -l | sed 's/\..*//' ) 
    115115    ATM=ICO${ico_nbp} 
    116     ncrename --history -d cell,y flxat_fields_notime.nc 
     116    ncrename --history --dimension cell,y flxat_fields_notime.nc 
    117117cat <<EOF > add_dim.nco 
    118118defdim("x",1) ; 
     
    133133tauy_sic [y,x] = tauy_sic  ; 
    134134EOF 
    135     ncap2 --history --overwrite --fl_fmt=${FL_FMT} -S add_dim.nco flxat_fields_notime.nc tmp_flxat_fields_notime.nc 
     135    ncap2 --history --overwrite --fl_fmt=${FL_FMT} --script-file add_dim.nco flxat_fields_notime.nc tmp_flxat_fields_notime.nc 
    136136    mv tmp_flxat_fields_notime.nc flxat_fields_notime.nc 
    137137 
     
    147147    dim_lat=$(ncdump -h flxat_fields_notime.nc | grep "lat *=" | awk '{print $3}' ) 
    148148    dim_lon=$(ncdump -h flxat_fields_notime.nc | grep "lon *=" | awk '{print $3}' ) 
    149     ncrename --history -d lon,x flxat_fields_notime.nc 
    150     ncrename --history -d lat,y flxat_fields_notime.nc 
     149    ncrename --history --dimension lon,x flxat_fields_notime.nc 
     150    ncrename --history --dimension lat,y flxat_fields_notime.nc 
    151151cat <<EOF > add_dim.nco 
    152152lon[y,x] = lon ; 
    153153lat[y,x] = lat ; 
    154154EOF 
    155     ncap2 --history --overwrite --fl_fmt=${FL_FMT} -S add_dim.nco flxat_fields_notime.nc tmp_flxat_fields_notime.nc 
     155    ncap2 --history --overwrite --fl_fmt=${FL_FMT} --script-file add_dim.nco flxat_fields_notime.nc tmp_flxat_fields_notime.nc 
    156156    mv tmp_flxat_fields_notime.nc flxat_fields_notime.nc 
    157157    (( dim_lat = dim_lat - 1 )) 
     
    216216// 
    217217EOF 
    218 ncap2 --overwrite --fl_fmt=${FL_FMT} -h -S create_flxat.nco flxat_fields_notime.nc tmp_flxat.nc 
     218ncap2 --overwrite --fl_fmt=${FL_FMT} --history --script-file create_flxat.nco flxat_fields_notime.nc tmp_flxat.nc 
    219219  
    220 ncks --fl_fmt=${FL_FMT} --overwrite -h -v lon,lat tmp_flxat.nc flxat.nc 
    221 [[ ${IsUnstructured} = yes ]] && ncks --fl_fmt=${FL_FMT} --append -v bounds_lon,bounds_lat tmp_flxat.nc flxat.nc 
    222 ncks --fl_fmt=${FL_FMT} --append  -h -v COTAUXXU,COTAUYYU,COTAUZZU,COTAUXXV,COTAUYYV,COTAUZZV,COTOTRAI,COTOTSNO,COTOTEVA,COICEVAP,COQSRMIX,COQNSMIX,COSHFICE,CONSFICE,CODFLXDT,COCALVIN,COLIQRUN,COWINDSP,COTAUMOD tmp_flxat.nc flxat.nc 
     220ncks --fl_fmt=${FL_FMT} --overwrite --history --variable lon,lat tmp_flxat.nc flxat.nc 
     221[[ ${IsUnstructured} = yes ]] && ncks --fl_fmt=${FL_FMT} --history --append --variable bounds_lon,bounds_lat tmp_flxat.nc flxat.nc 
     222ncks --fl_fmt=${FL_FMT} --append --history --variable COTAUXXU,COTAUYYU,COTAUZZU,COTAUXXV,COTAUYYV,COTAUZZV,COTOTRAI,COTOTSNO,COTOTEVA,COICEVAP,COQSRMIX,COQNSMIX,COSHFICE,CONSFICE,CODFLXDT,COCALVIN,COLIQRUN,COWINDSP,COTAUMOD tmp_flxat.nc flxat.nc 
    223223 
    224224## 
     
    262262## =========================================================================== 
    263263mv flxat.nc flxat_${ATM}_maskFrom_${OCE}.nc 
    264 ncks -v COCALVIN flxat_${ATM}_maskFrom_${OCE}.nc icbrg_${ATM}_maskFrom_${OCE}.nc 
    265 ncks -v COCALVIN flxat_${ATM}_maskFrom_${OCE}.nc icshf_${ATM}_maskFrom_${OCE}.nc 
     264ncks --history --variable COCALVIN flxat_${ATM}_maskFrom_${OCE}.nc icbrg_${ATM}_maskFrom_${OCE}.nc 
     265ncks --history --variable COCALVIN flxat_${ATM}_maskFrom_${OCE}.nc icshf_${ATM}_maskFrom_${OCE}.nc 
    266266 
    267267## 
  • TOOLS/MOSAIX/CreateRestartOce4Oasis.bash

    r3665 r3686  
    104104## Extract variables 
    105105## =========================================================================== 
    106 ncks --overwrite --fl_fmt=${FL_FMT} --history -d time_counter,0,0 -v ${IceVar} ${IceFile} sstoce_fields.nc 
    107 ncks --overwrite --fl_fmt=${FL_FMT} --history -d time_counter,0,0 -v tos       ${OceFile} oce_fields.nc 
     106ncks --overwrite --fl_fmt=${FL_FMT} --history -d time_counter,0,0 --variable ${IceVar} ${IceFile} sstoce_fields.nc 
     107ncks --overwrite --fl_fmt=${FL_FMT} --history -d time_counter,0,0 --variable tos       ${OceFile} oce_fields.nc 
    108108ncks --append --fl_fmt=${FL_FMT} --history oce_fields.nc   sstoce_fields.nc 
    109 ncwa --overwrite --fl_fmt=${FL_FMT} --history -a time_counter sstoce_fields.nc sstoce_fields_notime.nc # Remove time dimension 
     109ncwa --overwrite --fl_fmt=${FL_FMT} --history --average time_counter sstoce_fields.nc sstoce_fields_notime.nc # Remove time dimension 
    110110ncatted --history --attribute history,global,d,c,""  sstoce_fields_notime.nc           # Clean attributes 
    111111 
     
    126126 
    127127cat <<EOF > create_sstoce.nco 
    128 OIceFrac       = double ( ${IceVar}(:,:) ) ;  
     128OIceFrc        = double ( ${IceVar}(:,:) ) ;  
    129129//tos.simple_fill_miss(tos)               ; 
    130 O_SSTSST[y,x]  = double ( (tos   (:,:) + 273.15d) * (1.0d-OIceFrac) ) ; 
    131 //O_AlbIce[y,x]  = double ( ialb   (:,:)            * OIceFrac(:,:)   ) ; 
    132 //O_TepIce[y,x]  = double ( (tsice (:,:) + 273.15d) * OIceFrac(:,:)   ) ; 
    133 O_AlbIce[y,x]  = double (   0.65d            * OIceFrac(:,:)   ) ; 
    134 O_TepIce[y,x]  = double ( (-20.0d + 273.15d) * OIceFrac(:,:)   ) ; 
     130O_SSTSST[y,x]  = double ( (tos   (:,:) + 273.15d) * (1.0d-OIceFrc) ) ; 
     131//O_AlbIce[y,x]  = double ( ialb   (:,:)            * OIceFrc(:,:)   ) ; 
     132//O_TepIce[y,x]  = double ( (tsice (:,:) + 273.15d) * OIceFrc(:,:)   ) ; 
     133O_AlbIce[y,x]  = double (   0.65d            * OIceFrc(:,:)   ) ; 
     134O_TepIce[y,x]  = double ( (-20.0d + 273.15d) * OIceFrc(:,:)   ) ; 
    135135O_OCurx1[y,x]  = 0.0d ; 
    136136O_OCury1[y,x]  = 0.0d ; 
     
    138138EOF 
    139139 
    140 ncap2 --overwrite --fl_fmt=${FL_FMT} --history -S create_sstoce.nco sstoce_fields_notime.nc tmp_sstoc.nc 
     140ncap2 --overwrite --fl_fmt=${FL_FMT} --history --script-file create_sstoce.nco sstoce_fields_notime.nc tmp_sstoc.nc 
    141141 
    142 ncks --fl_fmt=${FL_FMT} --overwrite --history -v OIceFrac,O_SSTSST,O_AlbIce,O_TepIce,O_OCurx1,O_OCury1,O_OCurz1 tmp_sstoc.nc sstoc.nc 
     142ncks --fl_fmt=${FL_FMT} --overwrite --history --variable OIceFrc,O_SSTSST,O_AlbIce,O_TepIce,O_OCurx1,O_OCury1,O_OCurz1 tmp_sstoc.nc sstoc.nc 
    143143 
    144144ncatted --history --attribute comment,O_SSTSST,o,c,"SST weighted by fraction of open ocean"          sstoc.nc 
  • TOOLS/MOSAIX/CreateWeightsMask.bash

    r3665 r3686  
    4444# Defines models 
    4545# ============== 
    46 #OCE=ORCA2.3 
    47 OCE=eORCA1.2 
     46OCE=ORCA2.3 
     47#OCE=eORCA1.2 
    4848#OCE=ORCA025 
    4949 
     
    7777    ( curie | irene ) 
    7878    set +vx 
    79     module unload cdo nco ferret 
    80     module unload netcdf hdf5 
    81     module load python # /2.7.12 
    82     module load netcdf/4.3.3.1_hdf5_parallel # Version for XIOS 
    83     module load nco 
     79    module purge 
     80    source /ccc/cont003/home/dsm/p86ipsl/.env_intel17.0.2_curie; 
     81    source /ccc/cont003/home/dsm/p86ipsl/.env_netcdf4.3.3.1_curie 
    8482    R_IN=$(ccc_home -u igcmg --cccwork)/IGCM 
    8583    TMPDIR=${SCRATCHDIR}/TMP 
     
    169167## =========================================================================== 
    170168cp dia_t${oce}_to_t${atm}_1storder.nc  dia_t${oce}_to_t${atm}_1storder_mask.nc 
    171 ncks --alphabetize --history --overwrite -v OceFrac dia_t${oce}_to_t${atm}_1storder_mask.nc  ${ATM}_grid_maskFrom_${OCE}.nc 
    172 ncks --alphabetize --history --append    -v aire    atm_grid.nc                              ${ATM}_grid_maskFrom_${OCE}.nc 
    173 [[ ${atm} = *ico* ]] && ncks --alphabetize --history --append -v bounds_lon,bounds_lat atm_grid.nc                              ${ATM}_grid_maskFrom_${OCE}.nc 
     169ncks --alphabetize --history --overwrite --variable OceFrac dia_t${oce}_to_t${atm}_1storder_mask.nc  ${ATM}_grid_maskFrom_${OCE}.nc 
     170ncks --alphabetize --history --append    --variable aire    atm_grid.nc                              ${ATM}_grid_maskFrom_${OCE}.nc 
     171[[ ${atm} = *ico* ]] && ncks --alphabetize --history --append --variable bounds_lon,bounds_lat atm_grid.nc                              ${ATM}_grid_maskFrom_${OCE}.nc 
    174172 
    175173cat <<EOF > creation_masque.nco 
     
    178176EOF 
    179177ncap2 --history --overwrite --script-file creation_masque.nco dia_t${oce}_to_t${atm}_1storder_mask.nc tmp_dia_t${oce}_to_t${atm}_1storder_mask.nc ; mv tmp_dia_t${oce}_to_t${atm}_1storder_mask.nc dia_t${oce}_to_t${atm}_1storder_mask.nc 
    180 ncrename --history -v OceFrac,OceMask dia_t${oce}_to_t${atm}_1storder_mask.nc 
    181  
    182 ncks --alphabetize --history --append  -v OceMask dia_t${oce}_to_t${atm}_1storder_mask.nc   ${ATM}_grid_maskFrom_${OCE}.nc 
     178ncrename --history --variable OceFrac,OceMask dia_t${oce}_to_t${atm}_1storder_mask.nc 
     179 
     180ncks --alphabetize --history --append --variable OceMask dia_t${oce}_to_t${atm}_1storder_mask.nc   ${ATM}_grid_maskFrom_${OCE}.nc 
    183181 
    184182 
     
    276274OceMask [time_counter,cell] = OceMask (:) ; 
    277275EOF 
    278     ncap2 -O --history --script-file add_time.nco   ${ATM}_grid_maskFrom_${OCE}.nc tmp_${ATM}_grid_maskFrom_${OCE}.nc ; mv tmp_${ATM}_grid_maskFrom_${OCE}.nc ${ATM}_grid_maskFrom_${OCE}.nc 
    279     ncks --alphabetize -O --mk_rec time_counter ${ATM}_grid_maskFrom_${OCE}.nc tmp_${ATM}_grid_maskFrom_${OCE}.nc ; mv tmp_${ATM}_grid_maskFrom_${OCE}.nc ${ATM}_grid_maskFrom_${OCE}.nc 
     276    ncap2 --overwrite --history --script-file add_time.nco   ${ATM}_grid_maskFrom_${OCE}.nc tmp_${ATM}_grid_maskFrom_${OCE}.nc ; mv tmp_${ATM}_grid_maskFrom_${OCE}.nc ${ATM}_grid_maskFrom_${OCE}.nc 
     277    ncks --alphabetize --overwrite --mk_rec time_counter ${ATM}_grid_maskFrom_${OCE}.nc tmp_${ATM}_grid_maskFrom_${OCE}.nc ; mv tmp_${ATM}_grid_maskFrom_${OCE}.nc ${ATM}_grid_maskFrom_${OCE}.nc 
    280278    ncatted --history \ 
    281279            -a coordinates,OceFrac,c,c,"time_counter cell" \ 
     
    289287OceMask [time_counter,lat,lon] = OceMask (:,:) ; 
    290288EOF 
    291     ncap2 -O --history --script-file add_time.nco   ${ATM}_grid_maskFrom_${OCE}.nc tmp_${ATM}_grid_maskFrom_${OCE}.nc ; mv tmp_${ATM}_grid_maskFrom_${OCE}.nc ${ATM}_grid_maskFrom_${OCE}.nc 
    292     ncks --alphabetize -O --mk_rec time_counter ${ATM}_grid_maskFrom_${OCE}.nc tmp_${ATM}_grid_maskFrom_${OCE}.nc ; mv tmp_${ATM}_grid_maskFrom_${OCE}.nc ${ATM}_grid_maskFrom_${OCE}.nc 
     289    ncap2 --overwrite --history --script-file add_time.nco   ${ATM}_grid_maskFrom_${OCE}.nc tmp_${ATM}_grid_maskFrom_${OCE}.nc ; mv tmp_${ATM}_grid_maskFrom_${OCE}.nc ${ATM}_grid_maskFrom_${OCE}.nc 
     290    ncks --alphabetize --overwrite --mk_rec time_counter ${ATM}_grid_maskFrom_${OCE}.nc tmp_${ATM}_grid_maskFrom_${OCE}.nc ; mv tmp_${ATM}_grid_maskFrom_${OCE}.nc ${ATM}_grid_maskFrom_${OCE}.nc 
    293291    ncatted --history \ 
    294292            -a coordinates,OceFrac,c,c,"time_counter lat lon" \ 
     
    452450            ncap2 --history --append --script-file add_varatm.nco ${ATM}_grid_maskFrom_${OCE}.nc ${file_a_to_o} 
    453451             
    454             ncks --alphabetize --history --overwrite  -v src_address,dst_address,remap_matrix,src_grid_dims,src_grid_center_lat,src_grid_center_lon,src_grid_corner_lon,src_grid_corner_lat,src_grid_area,src_grid_imask,dst_grid_dims,dst_grid_center_lat,dst_grid_center_lon,dst_grid_corner_lon,dst_grid_corner_lat,dst_grid_area,dst_grid_imask ${file_o_to_a} rmp_tmp.nc 
     452            ncks --alphabetize --history --overwrite --variable src_address,dst_address,remap_matrix,src_grid_dims,src_grid_center_lat,src_grid_center_lon,src_grid_corner_lon,src_grid_corner_lat,src_grid_area,src_grid_imask,dst_grid_dims,dst_grid_center_lat,dst_grid_center_lon,dst_grid_corner_lon,dst_grid_corner_lat,dst_grid_area,dst_grid_imask ${file_o_to_a} rmp_tmp.nc 
    455453            mv rmp_tmp.nc ${file_o_to_a} 
    456             ncks --alphabetize --history --overwrite  -v src_address,dst_address,remap_matrix,src_grid_dims,src_grid_center_lat,src_grid_center_lon,src_grid_corner_lon,src_grid_corner_lat,src_grid_area,src_grid_imask,dst_grid_dims,dst_grid_center_lat,dst_grid_center_lon,dst_grid_corner_lon,dst_grid_corner_lat,dst_grid_area,dst_grid_imask ${file_a_to_o} rmp_tmp.nc 
     454            ncks --alphabetize --history --overwrite --variable src_address,dst_address,remap_matrix,src_grid_dims,src_grid_center_lat,src_grid_center_lon,src_grid_corner_lon,src_grid_corner_lat,src_grid_area,src_grid_imask,dst_grid_dims,dst_grid_center_lat,dst_grid_center_lon,dst_grid_corner_lon,dst_grid_corner_lat,dst_grid_area,dst_grid_imask ${file_a_to_o} rmp_tmp.nc 
    457455            mv rmp_tmp.nc ${file_a_to_o} 
    458456 
     
    490488            ncap2 --history --append --script-file add_varatm.nco ${ATM}_grid_maskFrom_${OCE}.nc ${file_a_to_o} 
    491489 
    492             ncks --alphabetize --history --overwrite  -v src_address,dst_address,remap_matrix,src_grid_dims,src_grid_center_lat,src_grid_center_lon,src_grid_corner_lon,src_grid_corner_lat,src_grid_area,src_grid_imask,dst_grid_dims,dst_grid_center_lat,dst_grid_center_lon,dst_grid_area,dst_grid_imask ${file_o_to_a} rmp_tmp.nc 
     490            ncks --alphabetize --history --overwrite --variable src_address,dst_address,remap_matrix,src_grid_dims,src_grid_center_lat,src_grid_center_lon,src_grid_corner_lon,src_grid_corner_lat,src_grid_area,src_grid_imask,dst_grid_dims,dst_grid_center_lat,dst_grid_center_lon,dst_grid_area,dst_grid_imask ${file_o_to_a} rmp_tmp.nc 
    493491            mv rmp_tmp.nc ${file_o_to_a} 
    494             ncks --alphabetize --history --overwrite  -v src_address,dst_address,remap_matrix,src_grid_dims,src_grid_center_lat,src_grid_center_lon,src_grid_area,src_grid_imask,dst_grid_dims,dst_grid_center_lat,dst_grid_center_lon,dst_grid_corner_lon,dst_grid_corner_lat,dst_grid_area,dst_grid_imask ${file_a_to_o} rmp_tmp.nc 
     492            ncks --alphabetize --history --overwrite --variable src_address,dst_address,remap_matrix,src_grid_dims,src_grid_center_lat,src_grid_center_lon,src_grid_area,src_grid_imask,dst_grid_dims,dst_grid_center_lat,dst_grid_center_lon,dst_grid_corner_lon,dst_grid_corner_lat,dst_grid_area,dst_grid_imask ${file_a_to_o} rmp_tmp.nc 
    495493            mv rmp_tmp.nc ${file_a_to_o} 
    496494 
Note: See TracChangeset for help on using the changeset viewer.