File indexing completed on 2021-09-17 05:15:38 UTC
view on githubraw file Latest commit 13d362b8 on 2021-09-16 18:57:16 UTC
8f7d13d0c9 Jean*0001 #include "ECCO_OPTIONS.h"
8c157ed454 Patr*0002
0003 subroutine cost_gencost_assignperiod(
0004 I startofday, startofmonth, startofyear,
0005 I inday, inmonth, inyear,
0006 I endofday, endofmonth, endofyear,
0007 O startofgen, endofgen, ingen,
0008 O sum1gen, genrec,
e7d9258ace Gael*0009 I myiter, mythid )
8c157ed454 Patr*0010
0011
0012
0013
0014
0015 implicit none
0016
0017
0018
0019 #include "EEPARAMS.h"
0020 #include "SIZE.h"
0021 #include "PARAMS.h"
f09238ab8f Gael*0022 #ifdef ALLOW_ECCO
13d362b8c1 Ou W*0023 # include "ECCO_SIZE.h"
0024 # include "ECCO.h"
f09238ab8f Gael*0025 #endif
8c157ed454 Patr*0026
0027
0028
0029 logical startofday
0030 logical startofmonth
0031 logical startofyear
0032 logical inday
0033 logical inmonth
0034 logical inyear
0035 logical endofday
0036 logical endofmonth
0037 logical endofyear
0038 logical startofgen(NGENCOST)
0039 logical endofgen(NGENCOST)
0040 logical ingen(NGENCOST)
69f8f4c84c Patr*0041 integer sum1gen(NGENCOST)
0042 integer genrec(NGENCOST)
8c157ed454 Patr*0043
e7d9258ace Gael*0044 integer myiter, mythid
8c157ed454 Patr*0045
0046 #ifdef ALLOW_GENCOST_CONTRIBUTION
0047
0048
e7db56ba12 Gael*0049 integer k
8c157ed454 Patr*0050
0051
0052
e7db56ba12 Gael*0053 do k = 1, NGENCOST
f09238ab8f Gael*0054 if ( (using_gencost(k)).AND.( (gencost_flag(k).GE.1).OR.
0055 & (gencost_avgperiod(k).NE.' ') ) ) then
e7db56ba12 Gael*0056 if ( gencost_avgperiod(k) .EQ. 'day' .OR.
0057 & gencost_avgperiod(k) .EQ. 'DAY' ) then
0058 startofgen(k) = startofday
0059 endofgen(k) = endofday
0060 ingen(k) = inday
0061 sum1gen(k) = sum1day
0062 genrec(k) = dayrec
0063 else if ( gencost_avgperiod(k) .EQ. 'month' .OR.
0064 & gencost_avgperiod(k) .EQ. 'MONTH' ) then
0065 startofgen(k) = startofmonth
0066 endofgen(k) = endofmonth
0067 ingen(k) = inmonth
0068 sum1gen(k) = sum1mon
0069 genrec(k) = monrec
0070 else if ( gencost_avgperiod(k) .EQ. 'year' .OR.
0071 & gencost_avgperiod(k) .EQ. 'YEAR' ) then
0072 startofgen(k) = startofyear
0073 endofgen(k) = endofyear
0074 ingen(k) = inyear
0075 sum1gen(k) = sum1year
0076 genrec(k) = yearrec
e7d9258ace Gael*0077 else if ( gencost_avgperiod(k) .EQ. 'step' .OR.
0078 & gencost_avgperiod(k) .EQ. 'STEP' ) then
0079 startofgen(k) = .TRUE.
0080 endofgen(k) = .TRUE.
0081 ingen(k) = .TRUE.
0082 sum1gen(k) = 1
0083 genrec(k) = 1+ myiter - niter0
985662a3b3 Gael*0084 else if ( gencost_avgperiod(k) .EQ. 'const' .OR.
0085 & gencost_avgperiod(k) .EQ. 'CONST' ) then
0086 startofgen(k) = .TRUE.
0087 endofgen(k) = (myiter.EQ.niter0)
0088 ingen(k) = (myiter.EQ.niter0)
0089 sum1gen(k) = 1
0090 genrec(k) = 1
0091 print*,'gf-const ',startofgen(k),myiter,niter0
8c157ed454 Patr*0092 else
0093 STOP 'gencost_avgperiod wrongly specified'
0094 end if
d48a8e29bf Patr*0095 end if
8c157ed454 Patr*0096 end do
8f7d13d0c9 Jean*0097
8c157ed454 Patr*0098 #endif /* ALLOW_GENCOST_CONTRIBUTION */
0099
0100 end