| 517 | |
| 518 | The second stage is to take the sets produced in stage 1 and to reduce the time period of any forcing data to more closely match that required for the standard SETTE testing. To permit some additional testing for those cases where longer tests may be required a period of twice the standard test length has been chosen. The standard test lengths are: |
| 519 | |
| 520 | ||GYRE_PISCES ||90 days || |
| 521 | ||ORCA2_ICE_PISCES ||62 days || |
| 522 | ||ORCA2_OFF_PISCES ||95 days || |
| 523 | ||AMM12 ||4 days || |
| 524 | ||SAS ||16 days || |
| 525 | ||ORCA2_ICE_OBS ||5 days || |
| 526 | ||AGRIF ||5d and 9h || |
| 527 | ||WED025 ||10 days || |
| 528 | |
| 529 | where the maximum length returned by grepping the setting of ITEND from sette_reference_configurations.sh has been taken. There are two cases where simply doubling this length and selecting a number of time records based on that number does not work though: |
| 530 | |
| 531 | * ORCA2_OFF_PISCES which uses a climatological set of inputs and starts on 1st January => the last record is also needed at the start. |
| 532 | * WED025 which starts on 15th January => 35 days of records are required for a 20 day test. |
| 533 | |
| 534 | More on these cases later but first the additional commands required to limit the time records are: |
| 535 | |
| 536 | {{{ |
| 537 | mkdir r4.2_RC |
| 538 | cd r4.2_RC |
| 539 | cp -pr ../r4.2_RC_FULL/AGRIF_DEMO_v4.2_RC_FULL AGRIF_DEMO_v4.2_RC |
| 540 | cp -pr ../r4.2_RC_FULL/AMM12_v4.2_RC_FULL AMM12_v4.2_RC |
| 541 | cp -pr ../r4.2_RC_FULL/ICE_AGRIF_v4.2_RC_FULL ICE_AGRIF_v4.2_RC |
| 542 | cp -pr ../r4.2_RC_FULL/ISOMIP+_v4.2_RC_FULL ISOMIP+_v4.2_RC |
| 543 | cp -pr ../r4.2_RC_FULL/ORCA2_ICE_v4.2_RC_FULL ORCA2_ICE_v4.2_RC |
| 544 | cp -pr ../r4.2_RC_FULL/ORCA2_OFF_v4.2_RC_FULL ORCA2_OFF_v4.2_RC |
| 545 | cp -pr ../r4.2_RC_FULL/SAS_v4.2_RC_FULL SAS_v4.2_RC |
| 546 | cp -pr ../r4.2_RC_FULL/WED025_v4.2_RC_FULL WED025_v4.2_RC |
| 547 | ########## ORCA2_ICEcmds ########## |
| 548 | cd ORCA2_ICE_v4.2_RC |
| 549 | # |
| 550 | # |
| 551 | # ncar_precip.15JUNE2009_fill.nc ncar_rad.15JUNE2009_fill.nc slp.15JUNE2009_fill.nc |
| 552 | # LAT LON TIME |
| 553 | # q_10.15JUNE2009_fill.nc t_10.15JUNE2009_fill.nc u_10.15JUNE2009_fill.nc v_10.15JUNE2009_fill.nc |
| 554 | # lat lon time |
| 555 | # Need 180 days @ 6 hourly = 720 records |
| 556 | # |
| 557 | ncks --4 --dfl_lvl 1 --no_abc -v T_10_MOD -d time,0,719 --cnk_plc='xpl' --cnk_dmn lon,32 --cnk_dmn lat,32 --cnk_dmn time,1 t_10.15JUNE2009_fill.nc new_t_10.15JUNE2009_fill.nc |
| 558 | # |
| 559 | ncks --4 --dfl_lvl 1 --no_abc -v U_10_MOD -d time,0,719 --cnk_plc='xpl' --cnk_dmn lon,32 --cnk_dmn lat,32 --cnk_dmn time,1 u_10.15JUNE2009_fill.nc new_u_10.15JUNE2009_fill.nc |
| 560 | # |
| 561 | ncks --4 --dfl_lvl 1 --no_abc -v V_10_MOD -d time,0,719 --cnk_plc='xpl' --cnk_dmn lon,32 --cnk_dmn lat,32 --cnk_dmn time,1 v_10.15JUNE2009_fill.nc new_v_10.15JUNE2009_fill.nc |
| 562 | # |
| 563 | ncks --4 --dfl_lvl 1 --no_abc -v Q_10_MOD -d time,0,719 --cnk_plc='xpl' --cnk_dmn lon,32 --cnk_dmn lat,32 --cnk_dmn time,1 q_10.15JUNE2009_fill.nc new_q_10.15JUNE2009_fill.nc |
| 564 | # |
| 565 | ncks --4 --dfl_lvl 1 --no_abc -v LWDN_MOD,SWDN_MOD -d time,0,179 --cnk_plc='xpl' --cnk_dmn LON,32 --cnk_dmn LAT,32 --cnk_dmn time,1 ncar_rad.15JUNE2009_fill.nc new_ncar_rad.15JUNE2009_fill.nc |
| 566 | # |
| 567 | ncks --4 --dfl_lvl 1 --no_abc -v PRC_MOD1,SNOW --cnk_plc='xpl' --cnk_dmn LON,32 --cnk_dmn LAT,32 --cnk_dmn time,1 ncar_precip.15JUNE2009_fill.nc new_ncar_precip.15JUNE2009_fill.nc |
| 568 | # |
| 569 | ncks --4 --dfl_lvl 1 --no_abc -v SLP -d TIME,0,719 --cnk_plc='xpl' --cnk_dmn LON,32 --cnk_dmn LAT,32 --cnk_dmn TIME,1 slp.15JUNE2009_fill.nc new_slp.15JUNE2009_fill.nc |
| 570 | # |
| 571 | for f in new*; do ff=${f/new_}; mv $f $ff; done |
| 572 | # |
| 573 | ncks --4 --no_abc --cnk_plc='xpl' -d time_counter,0,719 --cnk_dmn x,30 --cnk_dmn y,30 --cnk_dmn time_counter,1 sdw_ecwaves_orca2.nc new_sdw_ecwaves_orca2.nc |
| 574 | mv new_sdw_ecwaves_orca2.nc sdw_ecwaves_orca2.nc |
| 575 | cd ../ |
| 576 | # WEDcmds |
| 577 | cd WED025_v4.2_RC |
| 578 | # u10 v10 t10 precip rsds q10 slp rlds snow |
| 579 | # WED025 starts in middle of January; need 20 days from then = 35 days = 280 records @ 3hourly |
| 580 | for v in u10 v10 t10 precip rsds q10 slp rlds snow |
| 581 | do |
| 582 | ncks -O -d time,0,279 --cnk_dmn longitude,64 --cnk_dmn latitude,64 ${v}_JRA_y2000.nc 20d_${v}_JRA_y2000.nc |
| 583 | done |
| 584 | # |
| 585 | for v in u10 v10 t10 precip rsds q10 slp rlds snow |
| 586 | do |
| 587 | mv 20d_${v}_JRA_y2000.nc ${v}_JRA_y2000.nc |
| 588 | done |
| 589 | }}} |
| 590 | These changes reduce the overall volume from 5.5GB to 4.5GB but the two cases mentioned earlier are still large contributors to this volume. The next stage will reduce the volume further by reducing the number of significant digits used for most data. This will allow for much more efficient compression but the SETTE results will be changed as a result. There is, however, an intermediate option which is to reduce the precision of the data that has to be supplied in order to maintain contiguous time records but which are not actually used. |
| 591 | |
| 592 | * In the ORCA2_OFF_PISCES case records 0-37 and 72 of each 5-day mean, annual dataset need to be kept at the original precision but all other records can be reduced to the minimum precision. |
| 593 | |
| 594 | * For WED025, records 0-110 are not used and can, therefore be held at minimum precision. |
| 595 | |
| 596 | Using ncks to achieve is troublesome with compressed data. I appears to be reluctant to insert later records into |
| 597 | compressed datasets. However, carrying out all operations on netCDF-3 format files and converting to netCDF-4 at the end works. Thus, this rather tortuous combination achieves the desired result: |
| 598 | |
| 599 | {{{ |
| 600 | #!/bin/bash |
| 601 | if [ 1 == 1 ] ; then |
| 602 | cd ORCA2_OFF_v4.2_RC |
| 603 | for var in T |
| 604 | do |
| 605 | echo ${var} |
| 606 | # Create minimal precision netcdf3 version of entire dataset |
| 607 | ncks -3 -O --no_abc --ppc default=1 dyna_grid_${var}.nc new2_dyna_grid_${var}.nc |
| 608 | # Create netcdf3 version of original dataset |
| 609 | ncks -3 dyna_grid_${var}.nc new3_dyna_grid_${var}.nc |
| 610 | # Overwrite records 0-71 with minimal precision |
| 611 | ncks -3 --no_abc -A -d time_counter,0,71 new2_dyna_grid_${var}.nc new3_dyna_grid_${var}.nc |
| 612 | # Overwrite records 0-37 with original precision |
| 613 | ncks -3 --no_abc -A -d time_counter,0,37 dyna_grid_${var}.nc new3_dyna_grid_${var}.nc |
| 614 | # Create netcdf-4 final version with required chunking and compression |
| 615 | nccopy -7 -c "time_counter/1,x/60,y/50,deptht/4" -d 4 new3_dyna_grid_${var}.nc new4_dyna_grid_${var}.nc |
| 616 | done |
| 617 | # Tidy up |
| 618 | rm new[2,3]*.nc |
| 619 | mv new4_dyna_grid_T.nc dyna_grid_T.nc |
| 620 | |
| 621 | for var in U |
| 622 | do |
| 623 | echo ${var} |
| 624 | ncks -3 -O --no_abc --ppc default=1 dyna_grid_${var}.nc new2_dyna_grid_${var}.nc |
| 625 | ncks -3 dyna_grid_${var}.nc new3_dyna_grid_${var}.nc |
| 626 | ncks -3 --no_abc -A -d time_counter,0,71 new2_dyna_grid_${var}.nc new3_dyna_grid_${var}.nc |
| 627 | ncks -3 --no_abc -A -d time_counter,0,37 dyna_grid_${var}.nc new3_dyna_grid_${var}.nc |
| 628 | nccopy -7 -c "time_counter/1,x/60,y/50,depthu/4" -d 4 new3_dyna_grid_${var}.nc new4_dyna_grid_${var}.nc |
| 629 | done |
| 630 | rm new[2,3]*.nc |
| 631 | mv new4_dyna_grid_U.nc dyna_grid_U.nc |
| 632 | |
| 633 | for var in V |
| 634 | do |
| 635 | echo ${var} |
| 636 | ncks -3 -O --no_abc --ppc default=1 dyna_grid_${var}.nc new2_dyna_grid_${var}.nc |
| 637 | ncks -3 dyna_grid_${var}.nc new3_dyna_grid_${var}.nc |
| 638 | ncks -3 --no_abc -A -d time_counter,0,71 new2_dyna_grid_${var}.nc new3_dyna_grid_${var}.nc |
| 639 | ncks -3 --no_abc -A -d time_counter,0,37 dyna_grid_${var}.nc new3_dyna_grid_${var}.nc |
| 640 | nccopy -7 -c "time_counter/1,x/60,y/50,depthv/4" -d 4 new3_dyna_grid_${var}.nc new4_dyna_grid_${var}.nc |
| 641 | done |
| 642 | rm new[2,3]*.nc |
| 643 | mv new4_dyna_grid_V.nc dyna_grid_V.nc |
| 644 | |
| 645 | for var in W |
| 646 | do |
| 647 | echo ${var} |
| 648 | ncks -3 -O --no_abc --ppc default=1 dyna_grid_${var}.nc new2_dyna_grid_${var}.nc |
| 649 | ncks -3 dyna_grid_${var}.nc new3_dyna_grid_${var}.nc |
| 650 | ncks -3 --no_abc -A -d time_counter,0,71 new2_dyna_grid_${var}.nc new3_dyna_grid_${var}.nc |
| 651 | ncks -3 --no_abc -A -d time_counter,0,37 dyna_grid_${var}.nc new3_dyna_grid_${var}.nc |
| 652 | nccopy -7 -c "time_counter/1,x/60,y/50,depthw/4" -d 4 new3_dyna_grid_${var}.nc new4_dyna_grid_${var}.nc |
| 653 | done |
| 654 | rm new[2,3]*.nc |
| 655 | mv new4_dyna_grid_W.nc dyna_grid_W.nc |
| 656 | cd ../ |
| 657 | fi |
| 658 | # |
| 659 | if [ 1 == 1 ] ; then |
| 660 | cd WED025_v4.2_RC |
| 661 | # WEDcmds |
| 662 | # u10 v10 t10 precip rsds q10 slp rlds snow |
| 663 | # WED025 starts in middle of January; need 20 days from then = 35 days = 280 records @ 3hourly |
| 664 | # But the first 13.875 days records (111 @ 3 hourly) can be stored at minimal precision |
| 665 | for v in u10 v10 t10 precip rsds q10 slp rlds snow |
| 666 | do |
| 667 | ncks -3 -O --no_abc --ppc default=1 ${v}_JRA_y2000.nc new2_${v}_JRA_y2000.nc |
| 668 | ncks -3 ${v}_JRA_y2000.nc new3_${v}_JRA_y2000.nc |
| 669 | ncks -3 --no_abc -A -d time,0,110 new2_${v}_JRA_y2000.nc new3_${v}_JRA_y2000.nc |
| 670 | nccopy -7 -c "time/1,longitude/64,latitude/64" -d 4 new3_${v}_JRA_y2000.nc new4_${v}_JRA_y2000.nc |
| 671 | done |
| 672 | rm new[2,3]*.nc |
| 673 | # |
| 674 | for v in u10 v10 t10 precip rsds q10 slp rlds snow |
| 675 | do |
| 676 | mv new4_${v}_JRA_y2000.nc ${v}_JRA_y2000.nc |
| 677 | done |
| 678 | # |
| 679 | cd ../ |
| 680 | fi |
| 681 | }}} |
| 682 | |
| 683 | With this secondary manipulation the overall volumes reduces from 4.5 GB to 3.7GB and there is no change in SETTE results when compared with results using the r4.2_RC_FULL set |
| 684 | |
| 685 | |