File indexing completed on 2018-03-02 18:38:15 UTC
view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
6d54cf9ca1 Ed H*0001 #include "CAL_OPTIONS.h"
a63ed37559 Patr*0002
0003 subroutine cal_DaysPerMonth(
0004 I myiter,
0005 I mytime,
0006 O ndays,
0007 I mythid
0008 & )
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034 implicit none
0035
0036
0037
0038 #include "cal.h"
0039
0040
0041
0042 integer myiter
0043 _RL mytime
0044 integer ndays
0045 integer mythid
0046
0047
0048
0049 integer mydate(4)
0050 integer myday
0051 integer mymonth
0052 integer myyear
0053 integer finalyear
0054 integer finalmonth
0055 integer present
0056 integer final
0057 integer ierr
0058
0059
0060
0061 call cal_GetDate( myiter, mytime, mydate, mythid )
0062
0063 myday = mod(mydate(1),100)
0064 mymonth = mod(mydate(1)/100,100)
0065 myyear = mydate(1)/10000
0066 present = mydate(1)/100
0067 finalyear = modelenddate(1)/10000
0068 finalmonth = mod(modelenddate(1)/100,100)
0069 final = modelenddate(1)/100
0070
0071 if (myyear .lt. finalyear) then
0072 ndays = ndaymonth(mymonth,mydate(3)) - myday + 1
0073 else if (myyear .eq. finalyear) then
0074 if (mymonth .eq. finalmonth) then
0075 ndays = mod(modelenddate(1),100) - myday + 1
0076 else
0077 ndays = ndaymonth(mymonth,mydate(3)) - myday + 1
0078 endif
0079 else
0080
0081 ierr = 1201
0082 call cal_PrintError( ierr, mythid )
0083 stop ' stopped in cal_DaysPerMonth.'
0084
0085 endif
0086
0087 return
0088 end