- Timestamp:
- 10/22/18 15:59:44 (6 years ago)
- Location:
- TOOLS/MOSAIX
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TOOLS/MOSAIX/CreateWeightsMask.bash
r4081 r4082 68 68 ListOrder="1st 2nd" 69 69 ListNormalize="false true" 70 ListQuantity="true false" 70 71 71 72 ## =========================================================================== … … 193 194 ## NEMO T point towards ATM - 1st order 194 195 ## =========================================================================== 195 echo ${Green}"${OCE} T toward ${ATM} - 1st order"${Norm}196 echo ${Green}"${OCE} T toward ${ATM} - 1stOrder"${Norm} 196 197 cp ${SUBMIT_DIR}/iodef_oce_to_atm.xml iodef.xml 198 Suffix=1stOrder_UnNormalized_Surfacic 197 199 198 200 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_T … … 200 202 python update_xml.py -i iodef.xml -n 'context[@id="interpol_read"]/domain_definition/domain[@id="domain_dst"]' -k type -v ${atm_domain_type} 201 203 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_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_false204 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}_${Suffix} 203 205 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}" 204 206 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} … … 207 209 python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_src"]' -k type -v ${oce_domain_type} 208 210 python 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.nc211 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}_${Suffix}.nc 210 212 python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain' -k order -v 1 211 213 python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="normalization"]' -t false 214 python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="quantity"]' -t false 212 215 python 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 216 python update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain' -k quantity -v false 217 218 cp iodef.xml iodef_t${oce}_to_t${atm}_${Suffix}.xml 215 219 ln -fs ${OCE}_coordinates_mask.nc oce_grid.nc 216 220 ln -fs ${ATM}_grid.nc atm_grid.nc … … 228 232 where (OceFrac < 0.0 ) OceFrac=0.0 ; 229 233 EOF 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.nc231 ncatted --history -a missing_value,OceFrac,d,,"" -a _FillValue,OceFrac,d,,"" dia_t${oce}_to_t${atm}_ 1storder_false.nc234 ncap2 --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 235 ncatted --history -a missing_value,OceFrac,d,,"" -a _FillValue,OceFrac,d,,"" dia_t${oce}_to_t${atm}_${Suffix}.nc 232 236 233 237 ## 234 238 ## Creates mask on ATM grid 235 239 ## =========================================================================== 236 cp dia_t${oce}_to_t${atm}_ 1storder_false.nc dia_t${oce}_to_t${atm}_1storder_false_mask.nc237 ncks --alphabetize --history --overwrite --variable OceFrac dia_t${oce}_to_t${atm}_ 1storder_false_mask.nc ${ATM}_grid_maskFrom_${OCE}.nc240 cp dia_t${oce}_to_t${atm}_${Suffix}.nc dia_t${oce}_to_t${atm}_${Suffix}_mask.nc 241 ncks --alphabetize --history --overwrite --variable OceFrac dia_t${oce}_to_t${atm}_${Suffix}_mask.nc ${ATM}_grid_maskFrom_${OCE}.nc 238 242 239 243 cat <<EOF > creation_masque.nco … … 242 246 EOF 243 247 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.nc245 ncrename --history --variable OceFrac,OceMask dia_t${oce}_to_t${atm}_ 1storder_false_mask.nc246 247 ncks --overwrite --history --variable OceMask dia_t${oce}_to_t${atm}_ 1storder_false_mask.nc tmp_OceMask.nc248 ncap2 --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 249 ncrename --history --variable OceFrac,OceMask dia_t${oce}_to_t${atm}_${Suffix}_mask.nc 250 251 ncks --overwrite --history --variable OceMask dia_t${oce}_to_t${atm}_${Suffix}_mask.nc tmp_OceMask.nc 248 252 ncks --history --append tmp_OceMask.nc ${ATM}_grid_maskFrom_${OCE}.nc 249 rm dia_t${oce}_to_t${atm}_ 1storder_false_mask.nc253 rm dia_t${oce}_to_t${atm}_${Suffix}_mask.nc 250 254 251 255 # Change dimension names, and some attributes accordingly … … 284 288 esac 285 289 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,,} 290 293 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 292 302 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} 308 304 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 310 333 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 316 335 done 317 336 done 318 337 done 319 320 338 ## 321 339 ## ATM towards NEMO points … … 337 355 esac 338 356 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 346 366 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} 353 368 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} 357 375 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 358 391 done 359 392 done 360 393 done 361 362 394 ## 363 395 ## Creates mask of coastal OCE points … … 384 416 cp ${SUBMIT_DIR}/iodef_atm_to_oce.xml iodef.xml 385 417 for 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 410 457 done 411 ##458 ## 412 459 ## Copy all NetCDF files to NetCDF 3 format (needed for OASIS) 413 460 ## =========================================================================== … … 532 579 ncrename --history --variable weight,remap_matrix ${rmpFile} 533 580 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} ;; 536 583 esac 537 584 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} ;; 540 591 esac 541 592 ncatted --history --attribute conventions,global,o,c,"SCRIP" ${rmpFile} … … 563 614 ## Add missing variables in rmp files 564 615 ## =========================================================================== 565 for rmpFile in rmp_?${atm}_to_[tuv]${oce}_* order_*.nc rmp_[tuv]${oce}_to_t${atm}_*order_*.nc* ; do616 for rmpFile in rmp_?${atm}_to_[tuv]${oce}_*.nc rmp_[tuv]${oce}_to_t${atm}_*.nc* ; do 566 617 echo ${rmpFile} 567 618 a_to_o=false ; o_to_a=false -
TOOLS/MOSAIX/iodef_atm_to_oce.xml
r4081 r4082 73 73 <variable name="conventions" type="string">SCRIP</variable> 74 74 <variable name="normalization" type="string">none</variable> 75 <variable name="quantity" type="string">none</variable> 75 76 <variable name="source_grid" type="string">curvilinear</variable> 76 77 <variable name="dest_grid" type="string">unstructured</variable> … … 107 108 <domain id="domain_dst" type="curvilinear" prec="8" > 108 109 <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"/> 110 111 </domain> 111 112 </domain_definition> -
TOOLS/MOSAIX/iodef_oce_to_atm.xml
r4081 r4082 73 73 <variable name="conventions" type="string">SCRIP</variable> 74 74 <variable name="normalization" type="string">none</variable> 75 <variable name="quantity" type="string">none</variable> 75 76 <variable name="source_grid" type="string">curvilinear</variable> 76 77 <variable name="dest_grid" type="string">unstructured</variable> … … 110 111 <domain id="domain_dst" type="unstructured" prec="8" > 111 112 <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"/> 113 114 </domain> 114 115 </domain_definition>
Note: See TracChangeset
for help on using the changeset viewer.