Changeset 388 for trunk


Ignore:
Timestamp:
11/24/10 11:36:09 (14 years ago)
Author:
brocksce
Message:
  • Clean up
  • Trap cdo error to avoid display of

cdo mulc: Open failed on >xxxx_tmp1.nc<
Unsupported file structure
Happens when ncks -Oh -x -v extracts nothing else than coordinate variables
That's the case for ocean variables such as zosga

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libIGCM/AA_create_ts

    r387 r388  
    854854                IGCM_sys_ncrcat --hst -v ${liste_coord}${var} ${liste_file_tmp[*]} ${config_UserChoices_JobName}_${DATE_BUILD}_${FlagDir}_${var}.nc 
    855855                # 
    856 #                 # Change time axis name to be CF compliant 
    857 #                 if [ ${time_axis} != time_counter ]; then 
    858 #                   IGCM_sys_ncrename -O -v ${time_axis},time_counter ${config_UserChoices_JobName}_${DATE_BUILD}_${FlagDir}_${var}.nc 
    859 #                 fi 
    860                 # 
    861856                if [ "${FLAG_B}" = "TRUE" ] ; then 
    862857                    # WE CONCATENATE WITH EXISTING FILES 
     
    882877                        file_out_YE=${config_UserChoices_JobName}_${DATE_BUILD_END}_1Y_${var}.nc 
    883878                        # 
     879                        # Compute yearly average considering calendar 
     880                        # and set date of the mid year to 01/07 at 00:00 
     881                        IGCM_sys_cdo -settime,00:00 -setday,1 -setmon,7 -settunits,days -divdpy -yearsum -muldpm -selvar,${var} ${file_out} ${file_out_YE} 
    884882                        # Extract all ancillary variables except $var, they will be appended after the cdo command 
    885883                        # Needed because cdo applies calculs on all variables 
    886884                        IGCM_sys_ncks -Oh -x -v ${var} ${file_out} ${file_out_YE%%.nc}_tmp1.nc 
    887                         # This will remove the time axis because cdo rewrites severely with only considered useful variables  
    888                         IGCM_sys_cdo -mulc,1 ${file_out_YE%%.nc}_tmp1.nc ${file_out_YE%%.nc}_tmp2.nc 
    889                         # Compute yearly average considering calendar 
    890                         # and set date of the mid year to 01/07 at 00:00 
    891                         IGCM_sys_cdo -settime,00:00 -setday,1 -setmon,7 -settunits,days -divdpy -yearsum -muldpm -selvar,${var} ${file_out} ${file_out_YE} 
    892                         # Now append all ancillary variables 
    893                         IGCM_sys_ncks -h -A ${file_out_YE%%.nc}_tmp2.nc ${file_out_YE} 
     885                        # This will remove the time axis because cdo rewrites severely with only considered useful variables 
     886                        IGCM_sys_cdo -mulc,1 ${file_out_YE%%.nc}_tmp1.nc ${file_out_YE%%.nc}_tmp2.nc > /dev/null 2>&1 
     887                        if [ $? -eq 0 ] ; then 
     888                                # Now append all ancillary variables if previous cdo operator ok 
     889                                IGCM_sys_ncks -h -A ${file_out_YE%%.nc}_tmp2.nc ${file_out_YE} 
     890                        fi 
     891 
    894892                        # Put global history attribut 
    895893                        IGCM_sys_ncatted -Oh -a history,global,o,c,"build by libIGCM/create_ts" ${file_out_YE} 
Note: See TracChangeset for help on using the changeset viewer.