Changeset 4037 for TOOLS/MOSAIX


Ignore:
Timestamp:
09/27/18 10:46:10 (6 years ago)
Author:
omamce
Message:

O.M. : CreateWeightMask?
get around bugs in ncatted
start adaptation to ORCA025

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TOOLS/MOSAIX/CreateWeightsMask.bash

    r3966 r4037  
    44#MSUB -e Out_WeightsMask    # Error output 
    55#MSUB -eo 
    6 #MSUB -n 4                  # Number of processors 
     6#MSUB -n 8                  # Number of processors 
    77#MSUB -T 1800               # Time limit (seconds) 
    88#MSUB -q skylake 
     
    5252# Defines models 
    5353# ============== 
    54 OCE=ORCA2.3 
     54#OCE=ORCA2.3 
    5555#OCE=eORCA1.2 
    56 #OCE=ORCA025 
    57  
    58 #ATM=ICO30 
     56OCE=ORCA025 
     57 
     58ATM=ICO30 
    5959#ATM=ICO40 
    6060#ATM=ICO450 
    61 ATM=LMD9695 
     61#ATM=LMD9695 
    6262#ATM=LMD144X142 
    6363 
     
    6767ListOCEGRID="T U V" 
    6868ListOrder="1st" # 2nd" 
    69 ListNormalize="false true" 
     69ListNormalize="false" # true" 
    7070 
    7171## =========================================================================== 
     
    143143    ( ORCA2.3*         ) OcePerio=4 ;; 
    144144    ( ORCA1* | eORCA1* ) OcePerio=6 ;; 
     145    ( ORCA025*         ) OcePerio=6 ;; 
    145146esac 
    146147# 
     
    164165# -------------------------------------------------------------------------------------------------------- 
    165166cat <<EOF >add_c_grid.nco 
    166 nav_lon_grid_C    = nav_lon_grid_T    ; 
    167 nav_lat_grid_C    = nav_lat_grid_T    ; 
    168 bounds_lon_grid_C = bounds_lon_grid_T ; 
    169 bounds_lat_grid_C = bounds_lat_grid_T ; 
    170 mask_C            = maskutil_T        ;  
    171 area_grid_C       = area_grid_T       ; 
     167defdim("x_grid_C", \$x_grid_T.size) ; 
     168defdim("y_grid_C", \$y_grid_T.size) ; 
     169defdim("nvertex_grid_C",  4)         ; 
     170nav_lon_grid_C[y_grid_C,x_grid_C]    = nav_lon_grid_T(:,:)    ; 
     171nav_lat_grid_C[y_grid_C,x_grid_C]    = nav_lat_grid_T(:,:)    ; 
     172bounds_lon_grid_C[y_grid_C,x_grid_C,nvertex_grid_C] = bounds_lon_grid_T(:,:,:) ; 
     173bounds_lat_grid_C[y_grid_C,x_grid_C,nvertex_grid_C] = bounds_lat_grid_T(:,:,:) ; 
     174mask_C[y_grid_C,x_grid_C]            = maskutil_T(:,:)        ;  
     175area_grid_C[y_grid_C,x_grid_C]       = area_grid_T(:,:)       ; 
    172176EOF 
    173177 
    174178ncap2 --overwrite --history --script-file add_c_grid.nco ${OCE}_coordinates_mask.nc tmp_${OCE}_coordinates_mask.nc 
    175 ncks --overwrite --variable nav_lon_grid_C,nav_lat_grid_C       tmp_${OCE}_coordinates_mask.nc C_${OCE}_coordinates_mask.nc 
    176 ncks --append    --variable bounds_lon_grid_C,bounds_lat_grid_C tmp_${OCE}_coordinates_mask.nc C_${OCE}_coordinates_mask.nc 
    177 #ncks --append    --variable mask_C                  tmp_${OCE}_coordinates_mask.nc C_${OCE}_coordinates_mask.nc  
    178 ncks --append    --variable area_grid_C             tmp_${OCE}_coordinates_mask.nc C_${OCE}_coordinates_mask.nc  
    179  
    180 ncrename --dimension x_grid_T,x_grid_C                C_${OCE}_coordinates_mask.nc 
    181 ncrename --dimension y_grid_T,y_grid_C                C_${OCE}_coordinates_mask.nc 
    182 ncrename --dimension nvertex_grid_T,nvertex_grid_C    C_${OCE}_coordinates_mask.nc 
    183 ncks --append C_${OCE}_coordinates_mask.nc            ${OCE}_coordinates_mask.nc 
     179ncatted --history --attribute bounds,nav_lon_grid_C,m,c,"bounds_lon_grid_C" tmp_${OCE}_coordinates_mask.nc 
     180ncatted --history --attribute bounds,nav_lat_grid_C,m,c,"bounds_lat_grid_C" tmp_${OCE}_coordinates_mask.nc 
     181ncks --history --overwrite --variable nav_lon_grid_C,nav_lat_grid_C       tmp_${OCE}_coordinates_mask.nc C_${OCE}_coordinates_mask.nc 
     182ncks --history --append    --variable bounds_lon_grid_C,bounds_lat_grid_C tmp_${OCE}_coordinates_mask.nc C_${OCE}_coordinates_mask.nc 
     183ncks --history --append    --variable area_grid_C             tmp_${OCE}_coordinates_mask.nc C_${OCE}_coordinates_mask.nc  
     184 
     185ncks --history --append C_${OCE}_coordinates_mask.nc            ${OCE}_coordinates_mask.nc 
    184186rm C_${OCE}_coordinates_mask.nc 
    185187 
    186 ncks --overwrite --fl_fmt=${FMT_OASIS} --history ${OCE}_coordinates_mask.nc ${OCE}_coordinates_mask_${FMT_OASIS}.nc 
     188ncks --history --overwrite --fl_fmt=${FMT_OASIS} ${OCE}_coordinates_mask.nc ${OCE}_coordinates_mask_${FMT_OASIS}.nc 
    187189 
    188190ls -al 
     
    432434            ${ATM}_grid_maskFrom_${OCE}.nc 
    433435fi 
    434 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 
     436ncks --alphabetize --history --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 
    435437ncks --alphabetize --history --overwrite --fl_fmt=${FMT_OASIS} ${ATM}_grid_maskFrom_${OCE}.nc ${ATM}_grid_maskFrom_${OCE}_${FMT_OASIS}.nc 
    436438 
     
    528530## Add missing variables in rmp files 
    529531## =========================================================================== 
    530 for rmpFile in rmp_tlmd_to_[tuv]orc_*order_*.nc rmp_[tuv]orc_to_tlmd_*order_*.nc* ; do 
     532for rmpFile in rmp_?${atm}_to_[tuv]${oce}_*order_*.nc rmp_[tuv]${oce}_to_t${atm}_*order_*.nc* ; do 
    531533    echo ${rmpFile} 
    532534    a_to_o=false ; o_to_a=false 
     
    663665for File in dia_*.nc rmp_*.nc 
    664666do 
     667    ncatted --history --attribute history_of_appended_files,global,d,c,"" ${File} 
    665668    NewFile=$(echo ${File} | sed -e "s/${atm}/${ATM}/" -e "s/${oce}/${OCE}/" ) 
    666669    cp ${File} ${SUBMIT_DIR}/${NewFile} 
Note: See TracChangeset for help on using the changeset viewer.