Changeset 4082 for TOOLS


Ignore:
Timestamp:
10/22/18 15:59:44 (6 years ago)
Author:
omamce
Message:

O.M. : add the 'quantity' case to CreateWeightsOasis?

Location:
TOOLS/MOSAIX
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TOOLS/MOSAIX/CreateWeightsMask.bash

    r4081 r4082  
    6868ListOrder="1st 2nd" 
    6969ListNormalize="false true" 
     70ListQuantity="true false" 
    7071 
    7172## =========================================================================== 
     
    193194## NEMO T point towards ATM - 1st order 
    194195## =========================================================================== 
    195 echo ${Green}"${OCE} T toward ${ATM} - 1storder"${Norm} 
     196echo ${Green}"${OCE} T toward ${ATM} - 1stOrder"${Norm} 
    196197cp ${SUBMIT_DIR}/iodef_oce_to_atm.xml   iodef.xml 
     198Suffix=1stOrder_UnNormalized_Surfacic 
    197199 
    198200python update_xml.py -i iodef.xml -n 'context[@id="interpol_read"]/file_definition/file[@id="file_src"]/field[@id="mask_src"]'   -k name  -v maskutil_T 
     
    200202python update_xml.py -i iodef.xml -n 'context[@id="interpol_read"]/domain_definition/domain[@id="domain_dst"]'                   -k type  -v ${atm_domain_type} 
    201203python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="file_src"]/field[@id="mask_source"]' -k name  -v maskutil_T 
    202 python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]'                               -k name  -v dia_t${oce}_to_t${atm}_1storder_false 
     204python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]'                               -k name  -v dia_t${oce}_to_t${atm}_${Suffix} 
    203205python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="title"]'       -t "${OCE} mask interpolated to ${ATM}" 
    204206python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="source_grid"]' -t ${oce_domain_type} 
     
    207209python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_src"]'                    -k type  -v ${oce_domain_type} 
    208210python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]'                    -k type  -v ${atm_domain_type} 
    209 python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain' -k weight_filename -v rmp_t${oce}_to_t${atm}_1storder_false.nc 
     211python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain' -k weight_filename -v rmp_t${oce}_to_t${atm}_${Suffix}.nc 
    210212python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain' -k order -v 1 
    211213python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="normalization"]' -t false 
     214python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="quantity"]'      -t false 
    212215python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   -k renormalize -v false 
    213  
    214 cp iodef.xml iodef_t${oce}_to_t${atm}_1storder_false.xml 
     216python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   -k quantity    -v false 
     217 
     218cp iodef.xml iodef_t${oce}_to_t${atm}_${Suffix}.xml 
    215219ln -fs ${OCE}_coordinates_mask.nc  oce_grid.nc 
    216220ln -fs ${ATM}_grid.nc              atm_grid.nc 
     
    228232where (OceFrac <  0.0 )  OceFrac=0.0 ;  
    229233EOF 
    230 ncap2 --history --overwrite --script-file correction_masque.nco dia_t${oce}_to_t${atm}_1storder_false.nc tmp_dia_t${oce}_to_t${atm}_1storder_false.nc ; mv tmp_dia_t${oce}_to_t${atm}_1storder_false.nc dia_t${oce}_to_t${atm}_1storder_false.nc 
    231 ncatted --history -a missing_value,OceFrac,d,,"" -a _FillValue,OceFrac,d,,"" dia_t${oce}_to_t${atm}_1storder_false.nc 
     234ncap2 --history --overwrite --script-file correction_masque.nco dia_t${oce}_to_t${atm}_${Suffix}.nc tmp_dia_t${oce}_to_t${atm}_${Suffix}.nc ; mv tmp_dia_t${oce}_to_t${atm}_${Suffix}.nc dia_t${oce}_to_t${atm}_${Suffix}.nc 
     235ncatted --history -a missing_value,OceFrac,d,,"" -a _FillValue,OceFrac,d,,"" dia_t${oce}_to_t${atm}_${Suffix}.nc 
    232236 
    233237## 
    234238##  Creates mask on ATM grid 
    235239## =========================================================================== 
    236 cp dia_t${oce}_to_t${atm}_1storder_false.nc  dia_t${oce}_to_t${atm}_1storder_false_mask.nc 
    237 ncks --alphabetize --history --overwrite --variable OceFrac dia_t${oce}_to_t${atm}_1storder_false_mask.nc  ${ATM}_grid_maskFrom_${OCE}.nc 
     240cp dia_t${oce}_to_t${atm}_${Suffix}.nc  dia_t${oce}_to_t${atm}_${Suffix}_mask.nc 
     241ncks --alphabetize --history --overwrite --variable OceFrac dia_t${oce}_to_t${atm}_${Suffix}_mask.nc  ${ATM}_grid_maskFrom_${OCE}.nc 
    238242 
    239243cat <<EOF > creation_masque.nco 
     
    242246EOF 
    243247 
    244 ncap2 --history --overwrite --script-file creation_masque.nco dia_t${oce}_to_t${atm}_1storder_false_mask.nc tmp_dia_t${oce}_to_t${atm}_1storder_false_mask.nc ; mv tmp_dia_t${oce}_to_t${atm}_1storder_false_mask.nc dia_t${oce}_to_t${atm}_1storder_false_mask.nc 
    245 ncrename --history --variable OceFrac,OceMask dia_t${oce}_to_t${atm}_1storder_false_mask.nc 
    246  
    247 ncks --overwrite --history --variable OceMask dia_t${oce}_to_t${atm}_1storder_false_mask.nc tmp_OceMask.nc 
     248ncap2 --history --overwrite --script-file creation_masque.nco dia_t${oce}_to_t${atm}_${Suffix}_mask.nc tmp_dia_t${oce}_to_t${atm}_${Suffix}_mask.nc ; mv tmp_dia_t${oce}_to_t${atm}_${Suffix}_mask.nc dia_t${oce}_to_t${atm}_${Suffix}_mask.nc 
     249ncrename --history --variable OceFrac,OceMask dia_t${oce}_to_t${atm}_${Suffix}_mask.nc 
     250 
     251ncks --overwrite --history --variable OceMask dia_t${oce}_to_t${atm}_${Suffix}_mask.nc tmp_OceMask.nc 
    248252ncks --history --append tmp_OceMask.nc ${ATM}_grid_maskFrom_${OCE}.nc 
    249 rm dia_t${oce}_to_t${atm}_1storder_false_mask.nc 
     253rm dia_t${oce}_to_t${atm}_${Suffix}_mask.nc 
    250254 
    251255# Change dimension names, and some attributes accordingly 
     
    284288    esac 
    285289    for normalize in ${ListNormalize} ; do 
    286         for OCEGRID in ${ListOCEGRID} ; do 
    287             ocegrid=${OCEGRID,,} 
    288              
    289             if [[ ! -f rmp_${ocegrid}${oce}_to_t${atm}_${order}order_${normalize}.nc ]] ; then 
     290        for quantity in ${ListQuantity} ; do 
     291            for OCEGRID in ${ListOCEGRID} ; do 
     292                ocegrid=${OCEGRID,,} 
    290293                 
    291                 echo ${Green}"${OCE} ${OCEGRID} toward ${ATM} - ${order}order - normalize: ${normalize}"${Norm} 
     294                case ${normalize} in 
     295                    ( true )  NormName=Normalized  ;; 
     296                    ( false ) NormName=UnNormalized ;; 
     297                esac 
     298                case ${quantity} in 
     299                    ( true )  QuantName=Integrated ;; 
     300                    ( false ) QuantName=Surfacic ;; 
     301                esac 
    292302                 
    293                 python update_xml.py -i iodef.xml -n 'context[@id="interpol_read"]/file_definition/file[@id="file_src"]/field[@id="mask_src"]'     -k name  -v maskutil_${OCEGRID} 
    294                 python update_xml.py -i iodef.xml -n 'context[@id="interpol_read"]/domain_definition/domain[@id="domain_src"]'                     -k type  -v ${oce_domain_type} 
    295                 python update_xml.py -i iodef.xml -n 'context[@id="interpol_read"]/domain_definition/domain[@id="domain_dst"]'                     -k type  -v ${atm_domain_type} 
    296                 python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="file_src"]/field[@id="mask_source"]'   -k name  -v maskutil_${OCEGRID} 
    297                 python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]'                                 -k name  -v dia_${ocegrid}${oce}_to_t${atm}_${order}order_${normalize} 
    298                 python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="title"]'         -t "${OCE} mask interpolated to ${ATM}" 
    299                 python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="source_grid"]'   -t ${oce_domain_type} 
    300                 python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="dest_grid"]'     -t ${atm_domain_type} 
    301                 python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="order"]'         -t ${num_order} 
    302                 python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="normalization"]' -t ${normalize} 
    303                 python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_src"]'                      -k type  -v ${oce_domain_type} 
    304                 python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]'                      -k type  -v ${atm_domain_type} 
    305                 python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   -k order -v ${num_order} 
    306                 python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain' -k weight_filename -v rmp_${ocegrid}${oce}_to_t${atm}_${order}order_${normalize}.nc 
    307                 python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain' -k renormalize     -v ${normalize} 
     303                Suffix=${order}Order_${NormName}_${QuantName} 
    308304                 
    309                 cp iodef.xml iodef_${ocegrid}${oce}_t${atm}_${order}order_${normalize}.xml 
     305                if [[ ! -f rmp_${ocegrid}${oce}_to_t${atm}_${Suffix}.nc ]] ; then 
     306                     
     307                    echo ${Green}"${OCE} ${OCEGRID} toward ${ATM} - ${order}Order - normalize: ${normalize} - quantity: ${quantity}"${Norm} 
     308                     
     309                    python update_xml.py -i iodef.xml -n 'context[@id="interpol_read"]/file_definition/file[@id="file_src"]/field[@id="mask_src"]'     -k name  -v maskutil_${OCEGRID} 
     310                    python update_xml.py -i iodef.xml -n 'context[@id="interpol_read"]/domain_definition/domain[@id="domain_src"]'                     -k type  -v ${oce_domain_type} 
     311                    python update_xml.py -i iodef.xml -n 'context[@id="interpol_read"]/domain_definition/domain[@id="domain_dst"]'                     -k type  -v ${atm_domain_type} 
     312                    python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="file_src"]/field[@id="mask_source"]'   -k name  -v maskutil_${OCEGRID} 
     313                    python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]'                                 -k name  -v dia_${ocegrid}${oce}_to_t${atm}_${Suffix} 
     314                    python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="title"]'         -t "${OCE} mask interpolated to ${ATM}" 
     315                    python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="source_grid"]'   -t ${oce_domain_type} 
     316                    python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="dest_grid"]'     -t ${atm_domain_type} 
     317                    python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="order"]'         -t ${num_order} 
     318                    python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="normalization"]' -t ${normalize} 
     319                    python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="quantity"]'      -t ${quantity} 
     320                    python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_src"]'                      -k type  -v ${oce_domain_type} 
     321                    python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]'                      -k type  -v ${atm_domain_type} 
     322                    python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   -k order -v ${num_order} 
     323                    python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain' -k weight_filename -v rmp_${ocegrid}${oce}_to_t${atm}_${Suffix}.nc 
     324                    python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain' -k renormalize     -v ${normalize} 
     325                    python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain' -k quantity        -v ${quantity} 
     326                     
     327                    cp iodef.xml iodef_${ocegrid}${oce}_t${atm}_${Suffix}.xml 
     328                     
     329                    ln -fs ${OCE}_coordinates_mask.nc  oce_grid.nc 
     330                    ln -fs ${ATM}_grid.nc              atm_grid.nc 
     331                    time /usr/bin/time ${MPIRUN} ./interpol.exe --mask_src=yes --mask_dst=yes 
     332                fi 
    310333                 
    311                 ln -fs ${OCE}_coordinates_mask.nc  oce_grid.nc 
    312                 ln -fs ${ATM}_grid.nc              atm_grid.nc 
    313                 time /usr/bin/time ${MPIRUN} ./interpol.exe --mask_src=yes --mask_dst=yes 
    314             fi 
    315              
     334            done 
    316335        done 
    317336    done 
    318337done 
    319  
    320338## 
    321339## ATM towards NEMO points 
     
    337355    esac 
    338356    for normalize in ${ListNormalize} ; do 
    339         python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   -k order -v ${num_order} 
    340         python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="order"]'         -t ${num_order}    
    341         python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="normalization"]' -t ${normalize} 
    342         python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   -k renormalize     -v ${normalize} 
    343          
    344         for OCEGRID in ${ListOCEGRID} ; do 
    345             ocegrid=${OCEGRID,,} 
     357        for quantity in ${ListQuantity} ; do 
     358            case ${normalize} in 
     359                ( true )  NormName=Normalized  ;; 
     360                ( false ) NormName=UnNormalized ;; 
     361            esac 
     362            case ${quantity} in 
     363                ( true )  QuantName=Integrated ;; 
     364                ( false ) QuantName=Surfacic ;; 
     365            esac 
    346366             
    347             echo ${Green}"${ATM} toward ${OCE} ${OCEGRID} - ${order}order - normalize: ${normalize}"${Norm} 
    348             python update_xml.py -i iodef.xml -n 'context[@id="interpol_read"]/file_definition/file[@id="file_dst"]/field[@id="mask_dst"]'   -k name  -v mask_${OCEGRID} 
    349             python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="file_dst"]/field[@id="mask_dest"]'   -k name  -v mask_${OCEGRID} 
    350             python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]'                               -k name  -v dia_t${atm}_to_${ocegrid}${oce}_${order}order_${normalize} 
    351             python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain' -k weight_filename -v rmp_t${atm}_to_${ocegrid}${oce}_${order}order_${normalize}.nc 
    352             cp iodef.xml iodef_t${atm}_to_${ocegrid}${oce}_${order}order_${normalize}.xml 
     367            Suffix=${order}Order_${NormName}_${QuantName} 
    353368             
    354             ln -fs ${OCE}_coordinates_mask.nc  oce_grid.nc 
    355             ln -fs ${ATM}_grid.nc              atm_grid.nc 
    356             time /usr/bin/time ${MPIRUN} ./interpol.exe --mask_src=yes --mask_dst=yes 
     369            python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   -k order -v ${num_order} 
     370            python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="order"]'         -t ${num_order}    
     371            python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="normalization"]' -t ${normalize} 
     372            python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="quantity"]'      -t ${quantity} 
     373            python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   -k renormalize     -v ${normalize} 
     374            python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   -k quantity        -v ${quantity} 
    357375             
     376            for OCEGRID in ${ListOCEGRID} ; do 
     377                ocegrid=${OCEGRID,,} 
     378                 
     379                echo ${Green}"${ATM} toward ${OCE} ${OCEGRID} - ${order}Order - normalize: ${normalize} - quantity: ${quantity}"${Norm} 
     380                python update_xml.py -i iodef.xml -n 'context[@id="interpol_read"]/file_definition/file[@id="file_dst"]/field[@id="mask_dst"]'   -k name  -v mask_${OCEGRID} 
     381                python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="file_dst"]/field[@id="mask_dest"]'   -k name  -v mask_${OCEGRID} 
     382                python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]'                               -k name  -v dia_t${atm}_to_${ocegrid}${oce}_${Suffix} 
     383                python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain' -k weight_filename -v rmp_t${atm}_to_${ocegrid}${oce}_${Suffix}.nc 
     384                cp iodef.xml iodef_t${atm}_to_${ocegrid}${oce}_${Suffix}.xml 
     385                 
     386                ln -fs ${OCE}_coordinates_mask.nc  oce_grid.nc 
     387                ln -fs ${ATM}_grid.nc              atm_grid.nc 
     388                time /usr/bin/time ${MPIRUN} ./interpol.exe --mask_src=yes --mask_dst=yes 
     389                 
     390            done 
    358391        done 
    359392    done 
    360393done 
    361  
    362394## 
    363395## Creates mask of coastal OCE points 
     
    384416cp ${SUBMIT_DIR}/iodef_atm_to_oce.xml           iodef.xml 
    385417for normalize in ${ListNormalize} ; do 
    386     python update_xml.py -i iodef.xml -n 'context[@id="interpol_read"]/domain_definition/domain[@id="domain_src"]'                   -k type  -v ${atm_domain_type} 
    387     python update_xml.py -i iodef.xml -n 'context[@id="interpol_read"]/domain_definition/domain[@id="domain_dst"]'                   -k type  -v ${oce_domain_type} 
    388     python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="title"]'       -t "${ATM} coastal mask interpolated to ${OCE}" 
    389     python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="source_grid"]' -t ${atm_domain_type} 
    390     python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="dest_grid"]'   -t ${oce_domain_type} 
    391     python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_src"]'                    -k type  -v ${atm_domain_type} 
    392     python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]'                    -k type  -v ${oce_domain_type} 
    393     python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain' -k order -v 1 
    394     python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="order"]'       -t 1 
    395     python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="normalization"]' -t ${normalize} 
    396     python update_xml.py -i iodef.xml -n 'context[@id="interpol_read"]/file_definition/file[@id="file_src"]'                         -k name  -v ${ATM}_grid_maskFrom_${OCE} 
    397     python update_xml.py -i iodef.xml -n 'context[@id="interpol_read"]/file_definition/file[@id="file_src"]/field[@id="mask_src"]'   -k name  -v AtmCoastal 
    398     python update_xml.py -i iodef.xml -n 'context[@id="interpol_read"]/file_definition/file[@id="file_dst"]/field[@id="mask_dst"]'   -k name  -v OceCoastal 
    399     python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]'                               -k name  -v dia_o${atm}_to_c${oce}_1storder_${normalize} 
    400     python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain' -k weight_filename -v rmp_o${atm}_to_c${oce}_1storder_${normalize}.nc 
    401     python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain' -k renormalize     -v ${normalize} 
    402      
    403     cp iodef.xml iodef_o${atm}_to_c${oce}_1storder_${normalize}.xml 
    404      
    405     ln -fs ${OCE}_coordinates_mask.nc  oce_grid.nc 
    406     ln -fs ${ATM}_grid.nc              atm_grid.nc 
    407     time /usr/bin/time ${MPIRUN} ./interpol.exe --mask_src=yes --mask_dst=yes 
    408  
    409     # Now we should divide weight par source (atm) grid area : run-off is a quantity/s integrated on the grid mox, not a flux  
     418    for quantity in ${ListQuantity} ; do 
     419        case ${normalize} in 
     420            ( true )  NormName=Normalized  ;; 
     421            ( false ) NormName=UnNormalized ;; 
     422        esac 
     423        case ${quantity} in 
     424            ( true )  QuantName=Integrated ;; 
     425            ( false ) QuantName=Surfacic ;; 
     426        esac 
     427         
     428        Suffix=${order}Order_${NormName}_${QuantName} 
     429         
     430        python update_xml.py -i iodef.xml -n 'context[@id="interpol_read"]/domain_definition/domain[@id="domain_src"]'                   -k type  -v ${atm_domain_type} 
     431        python update_xml.py -i iodef.xml -n 'context[@id="interpol_read"]/domain_definition/domain[@id="domain_dst"]'                   -k type  -v ${oce_domain_type} 
     432        python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="title"]'       -t "${ATM} coastal mask interpolated to ${OCE}" 
     433        python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="source_grid"]' -t ${atm_domain_type} 
     434        python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="dest_grid"]'   -t ${oce_domain_type} 
     435        python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_src"]'                    -k type  -v ${atm_domain_type} 
     436        python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]'                    -k type  -v ${oce_domain_type} 
     437        python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain' -k order -v 1 
     438        python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="order"]'       -t 1 
     439        python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="normalization"]' -t ${normalize} 
     440        python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="quantity"]'    -t ${quantity} 
     441        python update_xml.py -i iodef.xml -n 'context[@id="interpol_read"]/file_definition/file[@id="file_src"]'                         -k name  -v ${ATM}_grid_maskFrom_${OCE} 
     442        python update_xml.py -i iodef.xml -n 'context[@id="interpol_read"]/file_definition/file[@id="file_src"]/field[@id="mask_src"]'   -k name  -v AtmCoastal 
     443        python update_xml.py -i iodef.xml -n 'context[@id="interpol_read"]/file_definition/file[@id="file_dst"]/field[@id="mask_dst"]'   -k name  -v OceCoastal 
     444        python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]'                               -k name  -v dia_o${atm}_to_c${oce}_${Suffix} 
     445        python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain' -k weight_filename -v rmp_o${atm}_to_c${oce}_${Suffix}.nc 
     446        python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain' -k renormalize     -v ${normalize} 
     447        python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain' -k quantity        -v ${quantity} 
     448         
     449        cp iodef.xml iodef_o${atm}_to_c${oce}_${Suffix}.xml 
     450         
     451        ln -fs ${OCE}_coordinates_mask.nc  oce_grid.nc 
     452        ln -fs ${ATM}_grid.nc              atm_grid.nc 
     453        time /usr/bin/time ${MPIRUN} ./interpol.exe --mask_src=yes --mask_dst=yes 
     454         
     455        # Now we should divide weight par source (atm) grid area : run-off is a quantity/s integrated on the grid mox, not a flux  
     456    done 
    410457done 
    411 ## 
     458    ## 
    412459## Copy all NetCDF files to NetCDF 3 format (needed for OASIS) 
    413460## =========================================================================== 
     
    532579    ncrename --history --variable  weight,remap_matrix  ${rmpFile} 
    533580    case ${rmpFile} in 
    534         ( *_1storder_*.nc ) ncatted --history --attribute map_method,global,o,c,"Conservative Remapping - 1st order"  ${rmpFile} ;; 
    535         ( *_2ndorder_*.nc ) ncatted --history --attribute map_method,global,o,c,"Conservative Remapping - 2nd order"  ${rmpFile} ;; 
     581        ( *1storder* ) ncatted --history --attribute map_method,global,o,c,"Conservative Remapping - 1st order"  ${rmpFile} ;; 
     582        ( *2ndorder* ) ncatted --history --attribute map_method,global,o,c,"Conservative Remapping - 2nd order"  ${rmpFile} ;; 
    536583    esac 
    537584    case ${rmpFile} in 
    538         ( *_true.nc  ) ncatted --history --attribute map_method,global,o,c,"Normalization: true"  ${rmpFile} ;; 
    539         ( *_false.nc ) ncatted --history --attribute map_method,global,o,c,"Normalization: false" ${rmpFile} ;; 
     585        ( *_Normalized*   ) ncatted --history --attribute map_method,global,o,c,"Normalization: true"  ${rmpFile} ;; 
     586        ( *_UnNormalized* ) ncatted --history --attribute map_method,global,o,c,"Normalization: false" ${rmpFile} ;; 
     587    esac 
     588    case ${rmpFile} in 
     589        ( *Integrated*   ) ncatted --history --attribute map_method,global,o,c,"Quantity: true"  ${rmpFile} ;; 
     590        ( *Surfacic*     ) ncatted --history --attribute map_method,global,o,c,"Quantity: false" ${rmpFile} ;; 
    540591    esac 
    541592    ncatted --history --attribute conventions,global,o,c,"SCRIP"   ${rmpFile} 
     
    563614## Add missing variables in rmp files 
    564615## =========================================================================== 
    565 for rmpFile in rmp_?${atm}_to_[tuv]${oce}_*order_*.nc rmp_[tuv]${oce}_to_t${atm}_*order_*.nc* ; do 
     616for rmpFile in rmp_?${atm}_to_[tuv]${oce}_*.nc rmp_[tuv]${oce}_to_t${atm}_*.nc* ; do 
    566617    echo ${rmpFile} 
    567618    a_to_o=false ; o_to_a=false 
  • TOOLS/MOSAIX/iodef_atm_to_oce.xml

    r4081 r4082  
    7373        <variable name="conventions"   type="string">SCRIP</variable> 
    7474        <variable name="normalization" type="string">none</variable> 
     75        <variable name="quantity"      type="string">none</variable> 
    7576        <variable name="source_grid"   type="string">curvilinear</variable> 
    7677        <variable name="dest_grid"     type="string">unstructured</variable> 
     
    107108      <domain id="domain_dst" type="curvilinear" prec="8" > 
    108109        <generate_rectilinear_domain/> 
    109         <interpolate_domain order="1" renormalize="false" write_weight="true" weight_filename="rmp_tatm_to_toce_1storder.nc"/> 
     110        <interpolate_domain order="1" renormalize="false" quantity="false" write_weight="true" weight_filename="rmp_tatm_to_toce_1storder.nc"/> 
    110111      </domain> 
    111112    </domain_definition> 
  • TOOLS/MOSAIX/iodef_oce_to_atm.xml

    r4081 r4082  
    7373        <variable name="conventions"   type="string">SCRIP</variable> 
    7474        <variable name="normalization" type="string">none</variable> 
     75        <variable name="quantity"      type="string">none</variable> 
    7576        <variable name="source_grid"   type="string">curvilinear</variable> 
    7677        <variable name="dest_grid"     type="string">unstructured</variable> 
     
    110111      <domain id="domain_dst" type="unstructured" prec="8" > 
    111112        <generate_rectilinear_domain/> 
    112         <interpolate_domain order="1" renormalize="false" write_weight="true" weight_filename="rmp_toce_to_tatm_1storder.nc"/> 
     113        <interpolate_domain order="1" renormalize="false" quantity="false" write_weight="true" weight_filename="rmp_toce_to_tatm_1storder.nc"/> 
    113114      </domain> 
    114115    </domain_definition> 
Note: See TracChangeset for help on using the changeset viewer.