Changeset 377 for trunk


Ignore:
Timestamp:
11/03/10 16:50:59 (14 years ago)
Author:
brocksce
Message:

IGCM_sys_ncap replaced by IGCM_sys_ncap2 because ncap2 can do more than ncap
Added correction of climatological axis in create_se
Added all different calendars
Added defdim("tbnds",2)
Added test to handle time_counter and time UNLIMITED dimension (for CPL component)

Location:
trunk/libIGCM
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/libIGCM/AA_create_multi_se

    r373 r377  
    379379 
    380380        # detect time counter : time or time_counter ie unlimited variable 
    381         ncdump -h ${liste_file_se_tmp[1]} 
    382381        var_unlim=$(ncdump -h ${liste_file_se_tmp[1]}|grep UNLIMITED| cut -d ' ' -f 1) 
    383382 
     
    406405        # 
    407406        IGCM_sys_Rm ${OUT_SE[*]} 
    408         # 
    409         if [ ${var_unlim} = "time_counter" ] ; then 
    410                 IGCM_sys_ncap -Oh -s 'time_counter[time_counter]={15.5, 45, 74.5, 105, 135.5, 166, 196.5, 227.5, 258, 288.5,319, 349.5} ; time_counter_bnds[time_counter,tbnds]={0, 31, 31, 59, 59, 90, 90, 120, 120, 151, 151, 181, 181, 212, 212, 243, 243, 273, 273, 304, 304, 334, 334, 365. } ; time_counter@units="days since 0000-01-01 00:00:00" ; time_counter@time_origin="01-JAN 0000 00:00:00" ; time_counter@calendar="NOLEAP" ; time_counter@bounds="time_counter_bnds" ' ${RESULT_MULTI_SE} tmp.nc 
     407         
     408        # Put correct climatological axis following calendar  
     409        if [[ ${var_unlim} = time* ]] ; then 
     410                case ${config_UserChoices_CalendarType} in 
     411                        360d) 
     412                                # 360 days 
     413                                IGCM_sys_ncap2 -Oh -s 'defdim("tbnds",2) ; time_counter[time_counter]={15, 45, 75, 105, 135, 165, 195, 225, 255, 285, 315, 345.} ; time_counter_bnds[time_counter,tbnds]={0, 30, 30, 60, 60, 90, 90, 120, 120, 150, 150, 180, 180, 210, 210, 240, 240, 270, 270, 300, 300, 330, 330, 360.} ; time_counter@units="days since 0000-01-01 00:00:00" ; time_counter@time_origin="01-JAN 0000 00:00:00" ; time_counter@calendar="360_day" ; time_counter@bounds="time_counter_bnds"' ${RESULT_MULTI_SE} tmp.nc 
     414                                ;; 
     415                        noleap) 
     416                                # 365 days 
     417                                IGCM_sys_ncap2 -Oh -s 'defdim("tbnds",2) ; time_counter[time_counter]={15.5, 45, 74.5, 105, 135.5, 166, 196.5, 227.5, 258, 288.5, 319, 349.5} ; time_counter_bnds[time_counter,tbnds]={0, 31, 31, 59, 59, 90, 90, 120, 120, 151, 151, 181, 181, 212, 212, 243, 243, 273, 273, 304, 304, 334, 334, 365.} ; time_counter@units="days since 0000-01-01 00:00:00" ; time_counter@time_origin="01-JAN 0000 00:00:00" ; time_counter@calendar="noleap" ; time_counter@bounds="time_counter_bnds"' ${RESULT_MULTI_SE} tmp.nc 
     418                                ;; 
     419                        all_leap) 
     420                                # 366 days 
     421                                IGCM_sys_ncap2 -Oh -s 'defdim("tbnds",2) ; time_counter[time_counter]={15.5, 45.5, 75.5, 106, 136.5, 167, 197.5, 228.5, 259, 289.5, 320, 350.5} ; time_counter_bnds[time_counter,tbnds]={0, 31, 31, 60, 60, 91, 91, 121, 121, 152, 152, 182, 182, 213, 213, 244, 244, 274, 274, 305, 305, 335, 335, 366.} ; time_counter@units="days since 0000-01-01 00:00:00" ; time_counter@time_origin="01-JAN 0000 00:00:00" ; time_counter@calendar="all_leap" ; time_counter@bounds="time_counter_bnds"' ${RESULT_MULTI_SE} tmp.nc 
     422                                ;; 
     423                        leap|gregorian) 
     424                                # 365.2425 days 
     425                                IGCM_sys_ncap2 -Oh -s 'defdim("tbnds",2) ; time_counter[time_counter]={15.5, 45.12125, 74.7425, 105.2425, 135.7425, 166.2425, 196.7425, 227.7425, 258.2425, 288.7425, 319.2425, 349.7425} ; time_counter_bnds[time_counter,tbnds]={0, 31, 31, 59.2425, 59.2425, 90.2425, 90.2425, 120.2425, 120.2425, 151.2425, 151.2425, 181.2425, 181.2425, 212.2425, 212.2425, 243.2425, 243.2425, 273.2425, 273.2425, 304.2425, 304.2425, 334.2425, 334.2425, 365.2425} ; time_counter@units="days since 0000-01-01 00:00:00" ; time_counter@time_origin="01-JAN 0000 00:00:00" ; time_counter@calendar="gregorian" ; time_counter@bounds="time_counter_bnds"' ${RESULT_MULTI_SE} tmp.nc 
     426                                ;; 
     427                esac 
    411428                IGCM_sys_Rm ${RESULT_MULTI_SE} 
    412429                IGCM_sys_Mv tmp.nc ${RESULT_MULTI_SE} 
  • trunk/libIGCM/AA_create_se

    r376 r377  
    562562        var_unlim=$(ncdump -h ${RESULT_SE}|grep UNLIMITED| cut -d ' ' -f 1) 
    563563 
    564         # add modulo attribute on time axis 
    565         IGCM_sys_ncatted -a modulo,${var_unlim},c,c," " ${RESULT_SE} 
     564        # Put correct climatological axis following calendar  
     565        if [[ ${var_unlim} = time* ]] ; then 
     566                case ${config_UserChoices_CalendarType} in 
     567                        360d) 
     568                                # 360 days 
     569                                IGCM_sys_ncap2 -Oh -s 'defdim("tbnds",2) ; time_counter[time_counter]={15, 45, 75, 105, 135, 165, 195, 225, 255, 285, 315, 345.} ; time_counter_bnds[time_counter,tbnds]={0, 30, 30, 60, 60, 90, 90, 120, 120, 150, 150, 180, 180, 210, 210, 240, 240, 270, 270, 300, 300, 330, 330, 360.} ; time_counter@units="days since 0000-01-01 00:00:00" ; time_counter@time_origin="01-JAN 0000 00:00:00" ; time_counter@calendar="360_day" ; time_counter@bounds="time_counter_bnds"' ${RESULT_SE} tmp.nc 
     570                                ;; 
     571                        noleap) 
     572                                # 365 days 
     573                                IGCM_sys_ncap2 -Oh -s 'defdim("tbnds",2) ; time_counter[time_counter]={15.5, 45, 74.5, 105, 135.5, 166, 196.5, 227.5, 258, 288.5, 319, 349.5} ; time_counter_bnds[time_counter,tbnds]={0, 31, 31, 59, 59, 90, 90, 120, 120, 151, 151, 181, 181, 212, 212, 243, 243, 273, 273, 304, 304, 334, 334, 365.} ; time_counter@units="days since 0000-01-01 00:00:00" ; time_counter@time_origin="01-JAN 0000 00:00:00" ; time_counter@calendar="noleap" ; time_counter@bounds="time_counter_bnds"' ${RESULT_SE} tmp.nc 
     574                                ;; 
     575                        all_leap) 
     576                                # 366 days 
     577                                IGCM_sys_ncap2 -Oh -s 'defdim("tbnds",2) ; time_counter[time_counter]={15.5, 45.5, 75.5, 106, 136.5, 167, 197.5, 228.5, 259, 289.5, 320, 350.5} ; time_counter_bnds[time_counter,tbnds]={0, 31, 31, 60, 60, 91, 91, 121, 121, 152, 152, 182, 182, 213, 213, 244, 244, 274, 274, 305, 305, 335, 335, 366.} ; time_counter@units="days since 0000-01-01 00:00:00" ; time_counter@time_origin="01-JAN 0000 00:00:00" ; time_counter@calendar="all_leap" ; time_counter@bounds="time_counter_bnds"' ${RESULT_SE} tmp.nc 
     578                                ;; 
     579                        leap|gregorian) 
     580                                # 365.2425 days 
     581                                IGCM_sys_ncap2 -Oh -s 'defdim("tbnds",2) ; time_counter[time_counter]={15.5, 45.12125, 74.7425, 105.2425, 135.7425, 166.2425, 196.7425, 227.7425, 258.2425, 288.7425, 319.2425, 349.7425} ; time_counter_bnds[time_counter,tbnds]={0, 31, 31, 59.2425, 59.2425, 90.2425, 90.2425, 120.2425, 120.2425, 151.2425, 151.2425, 181.2425, 181.2425, 212.2425, 212.2425, 243.2425, 243.2425, 273.2425, 273.2425, 304.2425, 304.2425, 334.2425, 334.2425, 365.2425} ; time_counter@units="days since 0000-01-01 00:00:00" ; time_counter@time_origin="01-JAN 0000 00:00:00" ; time_counter@calendar="gregorian" ; time_counter@bounds="time_counter_bnds"' ${RESULT_SE} tmp.nc 
     582                                ;; 
     583                esac 
     584                IGCM_sys_Rm ${RESULT_SE} 
     585                IGCM_sys_Mv tmp.nc ${RESULT_SE} 
     586        fi 
    566587        # 
    567588        eval IGCM_sys_Put_Out ${RESULT_SE} \${R_OUT_${comp}}/Analyse/SE/${RESULT_SE} 
  • trunk/libIGCM/AA_create_ts

    r376 r377  
    856856                    # WE PUT FINAL FILE ON FILE SYSTEM 
    857857                    [ "${FLAG_B}" = "FALSE" ] && file_out=${config_UserChoices_JobName}_${DATE_BUILD}_${FlagDir}_${var}.nc 
    858                     #IGCM_sys_ncatted -a modulo,time_counter,c,c," " ${file_out} 
    859858                    file_before=${config_UserChoices_JobName}_${DateBegin}_${DATE_FIN_JOB_B}_${FlagDir}_${var}.nc 
    860859                    # 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_cesium.ksh

    r375 r377  
    12771277# NCO OPERATOR 
    12781278 
    1279 function IGCM_sys_ncap { 
    1280     IGCM_debug_PushStack "IGCM_sys_ncap" -- $@ 
    1281     if ( $DEBUG_sys ) ; then 
    1282         echo "IGCM_sys_ncap :" $@ 
    1283     fi 
    1284     ncap "$@" 
    1285     if [ $? -gt 0 ] ; then 
    1286        echo "IGCM_sys_ncap : erreur ${@}." 
    1287 #       IGCM_debug_Exit "ncap" 
    1288     fi 
    1289  
    1290     IGCM_debug_PopStack "IGCM_sys_ncap" 
     1279function IGCM_sys_ncap2 { 
     1280    IGCM_debug_PushStack "IGCM_sys_ncap2" -- $@ 
     1281    if ( $DEBUG_sys ) ; then 
     1282        echo "IGCM_sys_ncap2 :" $@ 
     1283    fi 
     1284    ncap2 "$@" 
     1285    if [ $? -gt 0 ] ; then 
     1286       echo "IGCM_sys_ncap2 : erreur ${@}." 
     1287#       IGCM_debug_Exit "ncap2" 
     1288    fi 
     1289 
     1290    IGCM_debug_PopStack "IGCM_sys_ncap2" 
    12911291} 
    12921292 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_default.ksh

    r375 r377  
    11611161# NCO OPERATOR 
    11621162 
    1163 function IGCM_sys_ncap { 
    1164     IGCM_debug_PushStack "IGCM_sys_ncap" -- $@ 
    1165     if ( $DEBUG_sys ) ; then 
    1166         echo "IGCM_sys_ncap :" $@ 
    1167     fi 
    1168     /usr/local/bin/ncap "$@" 
    1169     if [ $? -gt 0 ] ; then 
    1170        echo "IGCM_sys_ncap : erreur ${@}." 
    1171 #       IGCM_debug_Exit "ncap" 
    1172     fi 
    1173  
    1174     IGCM_debug_PopStack "IGCM_sys_ncap" 
     1163function IGCM_sys_ncap2 { 
     1164    IGCM_debug_PushStack "IGCM_sys_ncap2" -- $@ 
     1165    if ( $DEBUG_sys ) ; then 
     1166        echo "IGCM_sys_ncap2 :" $@ 
     1167    fi 
     1168    /usr/local/bin/ncap2 "$@" 
     1169    if [ $? -gt 0 ] ; then 
     1170       echo "IGCM_sys_ncap2 : erreur ${@}." 
     1171#       IGCM_debug_Exit "ncap2" 
     1172    fi 
     1173 
     1174    IGCM_debug_PopStack "IGCM_sys_ncap2" 
    11751175} 
    11761176 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_mercure.ksh

    r375 r377  
    11191119# NCO OPERATOR 
    11201120 
    1121 function IGCM_sys_ncap { 
    1122     IGCM_debug_PushStack "IGCM_sys_ncap" -- $@ 
    1123     if ( $DEBUG_sys ) ; then 
    1124         echo "IGCM_sys_ncap :" $@ 
    1125     fi 
    1126     ncap "$@" 
    1127     if [ $? -gt 0 ] ; then 
    1128        echo "IGCM_sys_ncap : erreur ${@}." 
    1129 #       IGCM_debug_Exit "ncap" 
    1130     fi 
    1131  
    1132     IGCM_debug_PopStack "IGCM_sys_ncap" 
     1121function IGCM_sys_ncap2 { 
     1122    IGCM_debug_PushStack "IGCM_sys_ncap2" -- $@ 
     1123    if ( $DEBUG_sys ) ; then 
     1124        echo "IGCM_sys_ncap2 :" $@ 
     1125    fi 
     1126    ncap2 "$@" 
     1127    if [ $? -gt 0 ] ; then 
     1128       echo "IGCM_sys_ncap2 : erreur ${@}." 
     1129#       IGCM_debug_Exit "ncap2" 
     1130    fi 
     1131 
     1132    IGCM_debug_PopStack "IGCM_sys_ncap2" 
    11331133} 
    11341134 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_obelix.ksh

    r375 r377  
    11781178# NCO OPERATOR 
    11791179 
    1180 function IGCM_sys_ncap { 
    1181     IGCM_debug_PushStack "IGCM_sys_ncap" -- $@ 
    1182     if ( $DEBUG_sys ) ; then 
    1183         echo "IGCM_sys_ncap :" $@ 
    1184     fi 
    1185     /usr/local/bin/ncap "$@" 
    1186     if [ $? -gt 0 ] ; then 
    1187        echo "IGCM_sys_ncap : erreur ${@}." 
    1188 #       IGCM_debug_Exit "ncap" 
    1189     fi 
    1190  
    1191     IGCM_debug_PopStack "IGCM_sys_ncap" 
     1180function IGCM_sys_ncap2 { 
     1181    IGCM_debug_PushStack "IGCM_sys_ncap2" -- $@ 
     1182    if ( $DEBUG_sys ) ; then 
     1183        echo "IGCM_sys_ncap2 :" $@ 
     1184    fi 
     1185    /usr/local/bin/ncap2 "$@" 
     1186    if [ $? -gt 0 ] ; then 
     1187       echo "IGCM_sys_ncap2 : erreur ${@}." 
     1188#       IGCM_debug_Exit "ncap2" 
     1189    fi 
     1190 
     1191    IGCM_debug_PopStack "IGCM_sys_ncap2" 
    11921192} 
    11931193 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_platine.ksh

    r375 r377  
    12211221# NCO OPERATOR 
    12221222 
    1223 function IGCM_sys_ncap { 
    1224     IGCM_debug_PushStack "IGCM_sys_ncap" -- $@ 
    1225     if ( $DEBUG_sys ) ; then 
    1226         echo "IGCM_sys_ncap :" $@ 
    1227     fi 
    1228     /applications/nco/bin/ncap "$@" 
    1229     if [ $? -gt 0 ] ; then 
    1230        echo "IGCM_sys_ncap : erreur ${@}." 
    1231 #       IGCM_debug_Exit "ncap" 
    1232     fi 
    1233  
    1234     IGCM_debug_PopStack "IGCM_sys_ncap" 
     1223function IGCM_sys_ncap2 { 
     1224    IGCM_debug_PushStack "IGCM_sys_ncap2" -- $@ 
     1225    if ( $DEBUG_sys ) ; then 
     1226        echo "IGCM_sys_ncap2 :" $@ 
     1227    fi 
     1228    /applications/nco/bin/ncap2 "$@" 
     1229    if [ $? -gt 0 ] ; then 
     1230       echo "IGCM_sys_ncap2 : erreur ${@}." 
     1231#       IGCM_debug_Exit "ncap2" 
     1232    fi 
     1233 
     1234    IGCM_debug_PopStack "IGCM_sys_ncap2" 
    12351235} 
    12361236 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_ulam.ksh

    r375 r377  
    10001000# NCO OPERATOR 
    10011001 
    1002 function IGCM_sys_ncap { 
    1003     IGCM_debug_PushStack "IGCM_sys_ncap" -- $@ 
    1004     if ( $DEBUG_sys ) ; then 
    1005         echo "IGCM_sys_ncap :" $@ 
    1006     fi 
    1007     ncap "$@" 
    1008     if [ $? -gt 0 ] ; then 
    1009        echo "IGCM_sys_ncap : erreur ${@}." 
    1010        IGCM_debug_Exit "ncap" 
    1011     fi 
    1012  
    1013     IGCM_debug_PopStack "IGCM_sys_ncap" 
     1002function IGCM_sys_ncap2 { 
     1003    IGCM_debug_PushStack "IGCM_sys_ncap2" -- $@ 
     1004    if ( $DEBUG_sys ) ; then 
     1005        echo "IGCM_sys_ncap2 :" $@ 
     1006    fi 
     1007    ncap2 "$@" 
     1008    if [ $? -gt 0 ] ; then 
     1009       echo "IGCM_sys_ncap2 : erreur ${@}." 
     1010       IGCM_debug_Exit "ncap2" 
     1011    fi 
     1012 
     1013    IGCM_debug_PopStack "IGCM_sys_ncap2" 
    10141014} 
    10151015 
Note: See TracChangeset for help on using the changeset viewer.