Changeset 382


Ignore:
Timestamp:
11/10/10 12:14:54 (14 years ago)
Author:
brocksce
Message:

All ancillary variables are now kept from original file
Not coordinates variables that are not used, for example PFT(PFT)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libIGCM/AA_create_ts

    r380 r382  
    862862                    # 
    863863                    if [ ${FlagDir} = "1M" ] ; then 
    864                         # Compute yearly average considering calendar 
    865864                        file_before_YE=${config_UserChoices_JobName}_${DateBegin}_${DATE_FIN_JOB_B}_1Y_${var}.nc 
    866865                        file_out_YE=${config_UserChoices_JobName}_${DATE_BUILD_END}_1Y_${var}.nc 
    867866                        # 
    868                         # Set date of the mid year to 01/07 at 00:00 
    869                         # better than default where the date information in the outputfile is the date of the last contributing time step in the input file 
     867                        # Extract all ancillary variables except $var, they will be appended after the cdo command 
     868                        # Needed because cdo applies calculs on all variables 
     869                        IGCM_sys_ncks -Oh -x -v ${var} ${file_out} ${file_out_YE%%.nc}_tmp1.nc 
     870                        # This will remove the time axis because cdo rewrites severely with only considered useful variables  
     871                        IGCM_sys_cdo -mulc,1 ${file_out_YE%%.nc}_tmp1.nc ${file_out_YE%%.nc}_tmp2.nc 
     872                        # Compute yearly average considering calendar 
     873                        # and set date of the mid year to 01/07 at 00:00 
    870874                        IGCM_sys_cdo -settime,00:00 -setday,1 -setmon,7 -settunits,days -divdpy -yearsum -muldpm -selvar,${var} ${file_out} ${file_out_YE} 
     875                        # Now append all ancillary variables 
     876                        IGCM_sys_ncks -h -A ${file_out_YE%%.nc}_tmp2.nc ${file_out_YE} 
     877                        # Put global history attribut 
     878                        IGCM_sys_ncatted -Oh -a history,global,o,c,"build by libIGCM/create_ts" ${file_out_YE} 
    871879                        # 
    872880                        eval IGCM_sys_Put_Out ${file_out_YE} \${R_OUT_${comp}}/Analyse/TS_MO_YE/${file_out_YE} 
     
    874882                    fi 
    875883                    # 
    876                     IGCM_sys_Rm ${file_out} 
     884                    IGCM_sys_Rm ${file_out} ${file_out_YE%%.nc}_tmp*.nc 
    877885                    # 
    878886                fi 
Note: See TracChangeset for help on using the changeset viewer.