Changeset 435
- Timestamp:
- 04/06/11 16:16:13 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libIGCM/libIGCM_date/libIGCM_date.ksh
r373 r435 23 23 #D- types of calendars are possible : 24 24 #D- 25 #D- - gregorian(other name leap) :25 #D- - leap|gregorian|standard (other name leap) : 26 26 #D- The normal calendar. The time origin for the 27 27 #D- julian day in this case is 24 Nov -4713. 28 #D- - noleap :28 #D- - noleap|365_day : 29 29 #D- A 365 day year without leap years. 30 #D- - all_leap :30 #D- - all_leap|366_day : 31 31 #D- A 366 day year with only leap years. 32 #D- - 360d :32 #D- - 360d|360_day : 33 33 #D- Year of 360 days with month of equal length. 34 34 … … 176 176 # What is the calendar : 177 177 case ${config_UserChoices_CalendarType} in 178 360d )178 360d|360_day) 179 179 if [ X$2 = X ] ; then 180 180 echo 360 … … 184 184 # IGCM_debug_PopStack "IGCM_date_DaysInYear" 185 185 return;; 186 noleap )186 noleap|365_day) 187 187 if [ X$2 = X ] ; then 188 188 echo 365 … … 193 193 # IGCM_debug_PopStack "IGCM_date_DaysInYear" 194 194 return;; 195 all_leap )195 all_leap|366_day) 196 196 if [ X$2 = X ] ; then 197 197 echo 366 … … 289 289 290 290 # What is the calendar : 291 if [ "${config_UserChoices_CalendarType}" = "360d" ]; then291 if ( [ "${config_UserChoices_CalendarType}" = "360d" ] || [ "${config_UserChoices_CalendarType}" = "360_day" ] ) ; then 292 292 if [ X$3 = X ] ; then 293 293 echo 30 … … 637 637 # Then add days in year until year2 matches year1 638 638 639 if [ "${config_UserChoices_CalendarType}" = "360d" ] ; then 640 res=$(( ( ( $yyyy1 - $yyyy2 ) * 360 ) + $res )) 641 elif [ "${config_UserChoices_CalendarType}" = "noleap" ] ; then 642 res=$(( ( ( $yyyy1 - $yyyy2 ) * 365 ) + $res )) 643 elif [ "${config_UserChoices_CalendarType}" = "all_leap" ] ; then 644 res=$(( ( ( $yyyy1 - $yyyy2 ) * 366 ) + $res )) 645 elif ( [ "${config_UserChoices_CalendarType}" = "leap" ] || [ "${config_UserChoices_CalendarType}" = "gregorian" ] ) ; then 646 while [ $yyyy2 -lt $yyyy1 ] 647 do 648 IGCM_date_DaysInYear $yyyy2 diy 649 res=$(( $res + $diy )) 650 yyyy2=$(( $yyyy2 + 1 )) 651 done 652 fi 639 case ${config_UserChoices_CalendarType} in 640 360d|360_day) 641 res=$(( ( ( $yyyy1 - $yyyy2 ) * 360 ) + $res )) ;; 642 noleap|365_day) 643 res=$(( ( ( $yyyy1 - $yyyy2 ) * 365 ) + $res )) ;; 644 all_leap|366_day) 645 res=$(( ( ( $yyyy1 - $yyyy2 ) * 366 ) + $res )) ;; 646 leap|gregorian|standard) 647 while [ $yyyy2 -lt $yyyy1 ] 648 do 649 IGCM_date_DaysInYear $yyyy2 diy 650 res=$(( $res + $diy )) 651 yyyy2=$(( $yyyy2 + 1 )) 652 done 653 ;; 654 esac 655 653 656 654 657 # if argument 2 was larger than argument 1 then … … 747 750 if [ ${1} -lt 5000000 ]; then 748 751 case ${config_UserChoices_CalendarType} in 749 360d )752 360d|360_day) 750 753 aux=-360;; 751 noleap )754 noleap|365_day) 752 755 aux=-365;; 753 all_leap )756 all_leap|366_day) 754 757 aux=-366;; 755 leap|gregorian )758 leap|gregorian|standard) 756 759 aux=-366;; 757 760 esac … … 761 764 # which is number of days since JC and 10000101 762 765 case ${config_UserChoices_CalendarType} in 763 360d )766 360d|360_day) 764 767 aux=359640;; 765 noleap )768 noleap|365_day) 766 769 aux=364635;; 767 all_leap )770 all_leap|366_day) 768 771 aux=365634;; 769 leap|gregorian )772 leap|gregorian|standard) 770 773 aux=364877;; 771 774 esac … … 775 778 # which is number of days since JC and 19000101 776 779 case ${config_UserChoices_CalendarType} in 777 360d )780 360d|360_day) 778 781 aux=683640;; 779 noleap )782 noleap|365_day) 780 783 aux=693135;; 781 all_leap )784 all_leap|366_day) 782 785 aux=695034;; 783 leap|gregorian )786 leap|gregorian|standard) 784 787 aux=693595;; 785 788 esac
Note: See TracChangeset
for help on using the changeset viewer.