diff --git a/Plant/CANEGRO-Sugarcane/SC_CCOUT.for b/Plant/CANEGRO-Sugarcane/SC_CCOUT.for index 4ff091427..fc19f70e9 100644 --- a/Plant/CANEGRO-Sugarcane/SC_CCOUT.for +++ b/Plant/CANEGRO-Sugarcane/SC_CCOUT.for @@ -10,11 +10,12 @@ c - Aerial dry mass (t/ha) c - Stalk dry mass (t/ha) c - Sucrose mass (t/ha) c ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - +! FO 05-09-2023 Commented out CMDMD and RDMD because of need to +! remove output files. c ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: SUBROUTINE SC_CCOUT(CONTROL, & BADMD, SMDMD, SUCMD, IRRAMT, RAIN, ! Canegro inputs - & CMDMD, SWDF1, TMIN, LGDMD, LDDMD, RDMD, SMFMD, + & SWDF1, TMIN, LGDMD, LDDMD, SMFMD, & PAR, Fi, EP, ES) c *************************************************************** @@ -36,8 +37,9 @@ c CMDMD is cellulose DM. c LGDMD, LDDMD are green tops DM and trash DM c RDMD is root dry mass REAL, INTENT(IN) :: BADMD, SMDMD, SUCMD, IRRAMT, RAIN, - & CMDMD, SWDF1, TMIN, LGDMD, LDDMD, RDMD, PAR, Fi, EP, ES, + & SWDF1, TMIN, LGDMD, LDDMD, PAR, Fi, EP, ES, & SMFMD +! REAL, INTENT(IN) :: CMDMD, RDMD c Local state variables c ::::::::::::::::::::: @@ -67,13 +69,13 @@ c Days to 80% canopy cover INTEGER COUNTER c The file unit number for the summary output file. - INTEGER CCOUT +! INTEGER CCOUT c Filename - CHARACTER*20 OFILE +! CHARACTER*20 OFILE c Does the file exist, is this the first run?: - LOGICAL FILE_EXISTS !, FIRST +! LOGICAL FILE_EXISTS !, FIRST c Error status: - INTEGER ERRNUM +! INTEGER ERRNUM c =============================================================== c RUN INITIALISATION @@ -95,57 +97,57 @@ c Write a file header c Open growth aspects output file: c :::::::::::::::::::::::::::::::: c Set file name: - OFILE = 'CCSUMMRY.OUT' - -c Get file unit number: - CALL GETLUN('CCSUMMRY', CCOUT) - -c Check that the file exists: - FILE_EXISTS = .FALSE. - INQUIRE(FILE=OFILE, EXIST=FILE_EXISTS) - -c Open the file - IF (FILE_EXISTS) THEN -c In append mode if the file already exists - OPEN (UNIT=CCOUT, FILE=OFILE, STATUS='OLD', - & IOSTAT=ERRNUM, POSITION='APPEND') - ELSE -c A new file if not existing - OPEN (UNIT=CCOUT, FILE=OFILE, STATUS='NEW', - & IOSTAT = ERRNUM) - WRITE(CCOUT,'("*CLIMATE CHANGE SUMMARY OUTPUT FILE")') - WRITE(CCOUT,'("! IRRC - Cumulative irrigation (mm)")') - WRITE(CCOUT,'("! PRCM - Cumulative rainfall (mm)")') - WRITE(CCOUT,'("! FDAYS - # frost days (TMIN < 1.5°C)")') - WRITE(CCOUT,'("! SDAYS - # stress days (SWDF1 < 0.05)")') - WRITE(CCOUT,'("! D80Fi - # days to 80% canopy cover")') - WRITE(CCOUT,'("! SMFMH - Fresh cane yield WM (t/ha)")') - WRITE(CCOUT,'("! BADMH - Aerial DM (t/ha)")') - WRITE(CCOUT,'("! SMDMH - Stalk DM (t/ha)")') - WRITE(CCOUT,'("! SUCMH - Sucrose mass (t/ha)")') - WRITE(CCOUT,'("! FBDMH - Total fibre DM (t/ha)")') - WRITE(CCOUT,'("! CMDMH - Cellulosic DM (t/ha)")') - WRITE(CCOUT,'("! LGDMH - Green tops DM (t/ha)")') - WRITE(CCOUT,'("! LDDMH - Trash DM (t/ha)")') - WRITE(CCOUT,'("! RDMH - Roots DM (t/ha)")') - WRITE(CCOUT,'("! WSPH - avg. SWDF1 water stress")') - WRITE(CCOUT,'("! AvgFi - avg. frac. int. of PAR")') - WRITE(CCOUT,'("! IPARC - Intercepted PAR (MJ/m2)")') - WRITE(CCOUT,'("! EPCM - Cumulative transpiration (mm)")') - WRITE(CCOUT,'("! ETCM - Cumulative evapo-transp. (mm)")') - WRITE(CCOUT,'("! BADMRUE - Aerial dry mass [PA]RUE (g/MJ)")') - WRITE(CCOUT,'("! BADMWUE - Aerl. DM WUE (t/100 mm ET)")') - WRITE(CCOUT,'("! SMDMWUE - Stlk. DM WUE (t/100 mm ET)")') - WRITE(CCOUT,'("! SMFMWUE - St Fresh Mass WUE (t/100 mm ET)")') - WRITE(CCOUT,'("")') -c Write column headings - WRITE(CCOUT, '(A8, 1H , A4, 1H , A5, 1H , 23(A8, 1H ))') - & '@EXPCODE', 'TRNO', 'RUNNO', 'IRRC', 'PRCM','FDAYS', - & 'SDAYS','D80Fi','SMFMH','BADMH', 'SMDMH', 'SUCMH', 'FBDMH', - & 'CMDMH', 'LGDMH', 'LDDMH', 'RDMH', 'WSPH', 'AVGFI','IPARC', - & 'EPCM','ETCM', 'BADMRUE', 'BADMWUE', 'SMDMWUE', 'SMFMWUE' - ENDIF - +! OFILE = 'CCSUMMRY.OUT' +! +!c Get file unit number: +! CALL GETLUN('CCSUMMRY', CCOUT) +! +!c Check that the file exists: +! FILE_EXISTS = .FALSE. +! INQUIRE(FILE=OFILE, EXIST=FILE_EXISTS) +! +!c Open the file +! IF (FILE_EXISTS) THEN +!c In append mode if the file already exists +! OPEN (UNIT=CCOUT, FILE=OFILE, STATUS='OLD', +! & IOSTAT=ERRNUM, POSITION='APPEND') +! ELSE +!c A new file if not existing +! OPEN (UNIT=CCOUT, FILE=OFILE, STATUS='NEW', +! & IOSTAT = ERRNUM) +! WRITE(CCOUT,'("*CLIMATE CHANGE SUMMARY OUTPUT FILE")') +! WRITE(CCOUT,'("! IRRC - Cumulative irrigation (mm)")') +! WRITE(CCOUT,'("! PRCM - Cumulative rainfall (mm)")') +! WRITE(CCOUT,'("! FDAYS - # frost days (TMIN < 1.5°C)")') +! WRITE(CCOUT,'("! SDAYS - # stress days (SWDF1 < 0.05)")') +! WRITE(CCOUT,'("! D80Fi - # days to 80% canopy cover")') +! WRITE(CCOUT,'("! SMFMH - Fresh cane yield WM (t/ha)")') +! WRITE(CCOUT,'("! BADMH - Aerial DM (t/ha)")') +! WRITE(CCOUT,'("! SMDMH - Stalk DM (t/ha)")') +! WRITE(CCOUT,'("! SUCMH - Sucrose mass (t/ha)")') +! WRITE(CCOUT,'("! FBDMH - Total fibre DM (t/ha)")') +! WRITE(CCOUT,'("! CMDMH - Cellulosic DM (t/ha)")') +! WRITE(CCOUT,'("! LGDMH - Green tops DM (t/ha)")') +! WRITE(CCOUT,'("! LDDMH - Trash DM (t/ha)")') +! WRITE(CCOUT,'("! RDMH - Roots DM (t/ha)")') +! WRITE(CCOUT,'("! WSPH - avg. SWDF1 water stress")') +! WRITE(CCOUT,'("! AvgFi - avg. frac. int. of PAR")') +! WRITE(CCOUT,'("! IPARC - Intercepted PAR (MJ/m2)")') +! WRITE(CCOUT,'("! EPCM - Cumulative transpiration (mm)")') +! WRITE(CCOUT,'("! ETCM - Cumulative evapo-transp. (mm)")') +! WRITE(CCOUT,'("! BADMRUE - Aerial dry mass [PA]RUE (g/MJ)")') +! WRITE(CCOUT,'("! BADMWUE - Aerl. DM WUE (t/100 mm ET)")') +! WRITE(CCOUT,'("! SMDMWUE - Stlk. DM WUE (t/100 mm ET)")') +! WRITE(CCOUT,'("! SMFMWUE - St Fresh Mass WUE (t/100 mm ET)")') +! WRITE(CCOUT,'("")') +!c Write column headings +! WRITE(CCOUT, '(A8, 1H , A4, 1H , A5, 1H , 23(A8, 1H ))') +! & '@EXPCODE', 'TRNO', 'RUNNO', 'IRRC', 'PRCM','FDAYS', +! & 'SDAYS','D80Fi','SMFMH','BADMH', 'SMDMH', 'SUCMH', 'FBDMH', +! & 'CMDMH', 'LGDMH', 'LDDMH', 'RDMH', 'WSPH', 'AVGFI','IPARC', +! & 'EPCM','ETCM', 'BADMRUE', 'BADMWUE', 'SMDMWUE', 'SMFMWUE' +! ENDIF +! c Initialised total irrigation to 0.0 IRR_TOT = 0.0 RAIN_TOT = 0.0 @@ -219,27 +221,27 @@ c Recalculate Bio-physical variables to output ENDIF c Write summary data to file. - WRITE(CCOUT, '(A8, 1H , I4, 1H , I5, 1H , ' // - ! Irrigation and rainfall - & '2(F8.0, 1H ), '// - ! Frost and stress days, days to 80% Fi - & '3(I8, 1H ), ' // - ! Biomass variables - & '9(F8.1, 1H ), ' // - ! SDWF1, AvgFi, IPARC, EPC, ETC - & '2(F8.2, 1H ), 3(F8.0, 1H ),' // - ! RUE and WUE - & '4(F8.3, 1H ))') - & Control%FILEX, Control%TRTNUM, Control%RUN, - & IRR_TOT, RAIN_TOT, - & FROST_DAYS, STRESS_DAYS, DAYS80Fi, SMFMD, - & BADMD, SMDMD, SUCMD, FIBDM, CMDMD, LGDMD, LDDMD, RDMD, - & SWDF1_TOT / (1.0*COUNTER), AvgFi, IPARC, EPC, ETC, - & BADMD*100.0 / IPARC, cBADMD, cSMDMD, cSMFMD - -c Close the output file - CLOSE(UNIT=CCOUT) - +! WRITE(CCOUT, '(A8, 1H , I4, 1H , I5, 1H , ' // +! ! Irrigation and rainfall +! & '2(F8.0, 1H ), '// +! ! Frost and stress days, days to 80% Fi +! & '3(I8, 1H ), ' // +! ! Biomass variables +! & '9(F8.1, 1H ), ' // +! ! SDWF1, AvgFi, IPARC, EPC, ETC +! & '2(F8.2, 1H ), 3(F8.0, 1H ),' // +! ! RUE and WUE +! & '4(F8.3, 1H ))') +! & Control%FILEX, Control%TRTNUM, Control%RUN, +! & IRR_TOT, RAIN_TOT, +! & FROST_DAYS, STRESS_DAYS, DAYS80Fi, SMFMD, +! & BADMD, SMDMD, SUCMD, FIBDM, CMDMD, LGDMD, LDDMD, RDMD, +! & SWDF1_TOT / (1.0*COUNTER), AvgFi, IPARC, EPC, ETC, +! & BADMD*100.0 / IPARC, cBADMD, cSMDMD, cSMFMD +! +!c Close the output file +! CLOSE(UNIT=CCOUT) +! c End of DYNAMIC conditional statement ENDIF diff --git a/Plant/CANEGRO-Sugarcane/SC_CNGRO.for b/Plant/CANEGRO-Sugarcane/SC_CNGRO.for index dc331feb9..873ecdd92 100644 --- a/Plant/CANEGRO-Sugarcane/SC_CNGRO.for +++ b/Plant/CANEGRO-Sugarcane/SC_CNGRO.for @@ -714,8 +714,8 @@ c ::::::::::::::::::::::::::::::::: c Call the climate change summary output file subroutine (module). CALL SC_CCOUT(CONTROL, Part%AERLDM, Part%STKDM, Part%SUCMAS, - & IRRAMT, Weather%RAIN, CELLSE_DM, WaterBal%SWDF1, TMIN, - & Part%TOPDM, Out%TRASDM, Out%ROOTDM, Part%STKWM, Out%PAR, + & IRRAMT, Weather%RAIN, WaterBal%SWDF1, TMIN, + & Part%TOPDM, Out%TRASDM, Part%STKWM, Out%PAR, & Growth%Li, EP, ES) c Call the climate change summary output file subroutine (module). @@ -1113,9 +1113,9 @@ c ::::::::::::::::::::::: & CONTROL, STGDOY, HUBaseEm, Growth%LI) c Call the climate change summary output file subroutine (module). - CALL SC_CCOUT(CONTROL, Part%AERLDM, Part%STKDM, Part%SUCMAS, - & IRRAMT, Weather%RAIN, CELLSE_DM, WaterBal%SWDF1, TMIN, - & Part%TOPDM, Out%TRASDM, Out%ROOTDM, Part%STKWM, Out%PAR, + CALL SC_CCOUT(CONTROL, Part%AERLDM, Part%STKDM, Part%SUCMAS, + & IRRAMT, Weather%RAIN, WaterBal%SWDF1, TMIN, + & Part%TOPDM, Out%TRASDM, Part%STKWM, Out%PAR, & Growth%Li, EP, ES) @@ -1216,8 +1216,8 @@ c in this subroutine (for now) c Call the climate change summary output file subroutine (module). CALL SC_CCOUT(CONTROL, Part%AERLDM, Part%STKDM, Part%SUCMAS, - & IRRAMT, Weather%RAIN, CELLSE_DM, WaterBal%SWDF1, TMIN, - & Part%TOPDM, Out%TRASDM, Out%ROOTDM, Part%STKWM, Out%PAR, + & IRRAMT, Weather%RAIN, WaterBal%SWDF1, TMIN, + & Part%TOPDM, Out%TRASDM, Part%STKWM, Out%PAR, & Growth%Li, EP, ES) diff --git a/Plant/CANEGRO-Sugarcane/SC_ETOUT.for b/Plant/CANEGRO-Sugarcane/SC_ETOUT.for index e8c6b202f..44845cd40 100644 --- a/Plant/CANEGRO-Sugarcane/SC_ETOUT.for +++ b/Plant/CANEGRO-Sugarcane/SC_ETOUT.for @@ -49,13 +49,13 @@ c Cumulative transpiration + evaporation INTEGER COUNTER c The file unit number for the summary output file. - INTEGER ETOUT +! INTEGER ETOUT c Filename - CHARACTER*20 OFILE +! CHARACTER*20 OFILE c Does the file exist, is this the first run?: - LOGICAL FILE_EXISTS !, FIRST +! LOGICAL FILE_EXISTS !, FIRST c Error status: - INTEGER ERRNUM +! INTEGER ERRNUM c Days after planting INTEGER DAP INTEGER DOY, YEAR, YRDOY, NDAY, iMON, DAYMON !, YR, YEARPLT @@ -101,57 +101,57 @@ c Write a file header c Open growth aspects output file: c :::::::::::::::::::::::::::::::: c Set file name: - OFILE = 'ETSUMMRY.OUT' - -c Get file unit number: - CALL GETLUN('ETSUMMRY', ETOUT) - -c Check that the file exists: - FILE_EXISTS = .FALSE. - INQUIRE(FILE=OFILE, EXIST=FILE_EXISTS) - -c Open the file - IF (FILE_EXISTS) THEN -c In append mode if the file already exists - OPEN (UNIT=ETOUT, FILE=OFILE, STATUS='OLD', - & IOSTAT=ERRNUM, POSITION='APPEND') -! WRITE(*,*) 'Appending to existing file.' - ELSE -c A new file if not existing - OPEN (UNIT=ETOUT, FILE=OFILE, STATUS='NEW', - & IOSTAT = ERRNUM) - -! WRITE(*,*) 'Writing to new file.' - - WRITE(ETOUT,'("*MONTHLY EVAPORATION SUMMARY OUTPUT FILE")') - WRITE(ETOUT,'("! RUNNO - Cumulative irrigation (mm)")') - WRITE(ETOUT,'("! TRNO-the DSSAT CSM internal TRNO variable")') - WRITE(ETOUT,'("! HV_YEAR – harvest year")') - WRITE(ETOUT,'("! HV_MON – harvest month")') - WRITE(ETOUT,'(A)') "! GRYR_No – the year of growth for this " - & // "month's output " - WRITE(ETOUT,'("! GRMON_No – the growth month number, from 1 - & to n where n is the number of months at harvest. - & ")') - WRITE(ETOUT,'("! MONTH – month number, 1-12 for Jan- Dec")') - WRITE(ETOUT,'("! FI – average canopy cover for that month.")') - WRITE(ETOUT,'("! ETc – sum of plant (EP) and soil (ET) - & evaporation over the course of the month")') - WRITE(ETOUT,'("! EToc – sum of potential evaporation, i.e. EO, - & over the course of the month")') - WRITE(ETOUT,'("! ETo – sum of FAO-56 shortgrass potential - & evaporation, over the course of the month")') - WRITE(ETOUT,'("! ETc_ETo – monthly average ETc / ETo")') - WRITE(ETOUT,'("! ETc_EToc – monthly average ETc / EToc")') - WRITE(ETOUT,'("! RNOFF - Monthly cumulative runoff (mm)")') - WRITE(ETOUT,'("! DRAIN - Monthly cumulative drainage (mm)")') - WRITE(ETOUT,'("")') -c Write column headings - WRITE(ETOUT, '(A8, 1H , A5, 1H , A4, 1H , 13(A8, 1H ))') - & '@EXPCODE', 'RUNNO', 'TRNO', 'HV_YEAR', 'HV_MON','GRYR_NO', - & 'GRMON_NO','MONTH','FI','ETc', 'EToc', 'ETc_ETo', 'ETo', - & 'ETc_EToc', 'RNOFF', 'DRAIN' - ENDIF +! OFILE = 'ETSUMMRY.OUT' +! +!c Get file unit number: +! CALL GETLUN('ETSUMMRY', ETOUT) +! +!c Check that the file exists: +! FILE_EXISTS = .FALSE. +! INQUIRE(FILE=OFILE, EXIST=FILE_EXISTS) +! +!c Open the file +! IF (FILE_EXISTS) THEN +!c In append mode if the file already exists +! OPEN (UNIT=ETOUT, FILE=OFILE, STATUS='OLD', +! & IOSTAT=ERRNUM, POSITION='APPEND') +!! WRITE(*,*) 'Appending to existing file.' +! ELSE +!c A new file if not existing +! OPEN (UNIT=ETOUT, FILE=OFILE, STATUS='NEW', +! & IOSTAT = ERRNUM) +! +!! WRITE(*,*) 'Writing to new file.' +! +! WRITE(ETOUT,'("*MONTHLY EVAPORATION SUMMARY OUTPUT FILE")') +! WRITE(ETOUT,'("! RUNNO - Cumulative irrigation (mm)")') +! WRITE(ETOUT,'("! TRNO-the DSSAT CSM internal TRNO variable")') +! WRITE(ETOUT,'("! HV_YEAR � harvest year")') +! WRITE(ETOUT,'("! HV_MON � harvest month")') +! WRITE(ETOUT,'(A)') "! GRYR_No � the year of growth for this " +! & // "month's output " +! WRITE(ETOUT,'("! GRMON_No � the growth month number, from 1 +! & to n where n is the number of months at harvest. +! & ")') +! WRITE(ETOUT,'("! MONTH � month number, 1-12 for Jan- Dec")') +! WRITE(ETOUT,'("! FI � average canopy cover for that month.")') +! WRITE(ETOUT,'("! ETc � sum of plant (EP) and soil (ET) +! & evaporation over the course of the month")') +! WRITE(ETOUT,'("! EToc � sum of potential evaporation, i.e. EO, +! & over the course of the month")') +! WRITE(ETOUT,'("! ETo � sum of FAO-56 shortgrass potential +! & evaporation, over the course of the month")') +! WRITE(ETOUT,'("! ETc_ETo � monthly average ETc / ETo")') +! WRITE(ETOUT,'("! ETc_EToc � monthly average ETc / EToc")') +! WRITE(ETOUT,'("! RNOFF - Monthly cumulative runoff (mm)")') +! WRITE(ETOUT,'("! DRAIN - Monthly cumulative drainage (mm)")') +! WRITE(ETOUT,'("")') +!c Write column headings +! WRITE(ETOUT, '(A8, 1H , A5, 1H , A4, 1H , 13(A8, 1H ))') +! & '@EXPCODE', 'RUNNO', 'TRNO', 'HV_YEAR', 'HV_MON','GRYR_NO', +! & 'GRMON_NO','MONTH','FI','ETc', 'EToc', 'ETc_ETo', 'ETo', +! & 'ETc_EToc', 'RNOFF', 'DRAIN' +! ENDIF c Initialised total irrigation to 0.0 COUNTER = 0 @@ -336,39 +336,39 @@ c CALL MTHEND(YR,MTH) endif c Write summary data to file. - WRITE(ETOUT, '(A8, 1H , ' // !File name1 - & 'I5, 1X , '// !Run number2 - & 'I4, 1H , ' // !Treatment number3 - & 'I8, 1H '// !HV_YEAR4 - & 'A8, 1H '// !HV_MON5 - & 'I8, 1H '// !Growth year num6 - & 'I8, 1H '// !Growth month num7 - & 'I8, 1H '// !Current month num8 - & 'F8.3, 1H '// !FI9 - & 'F8.3, 1H '// !ETc10 - & 'F8.3, 1H '// !EToc11 - & 'F8.3, 1H '// !ETo12 - & 'F8.3, 1H '// !ETc_ETo13 - & 'F8.3, 1H '// !ETc_EToc14 - & 'F8.3, 1H '// !Runoff - & 'F8.3, 1H )') !Drainage - & Control%FILEX, !File1 - & Control%RUN, !Run number2 - & Control%TRTNUM, !Treatment number3 - & YRHV, !Harvest year4 - & MONHV, !Harvest month5 - & GRYRNO, !Growth year number6 - & GRMONNO, !Growth month number7 - & iMON, !Current month number8 - & AvgFi, !average canopy cover for the month9 - & ETV, !Sum of EP and ET evaporation for the mon10 - & EToc, !Sum of EO for the month11 - & ETc_ETo, !Sum of EO for the month12 - & ETo, !Monthly average ETc_ETo13 -! & (ETV/EToc), !Monthly average ETc_ETo14 - & ETc_ETo14, !Monthly average ETc_ETo14 - & cRUNOFF, ! Monthly cumulative runoff - & cDRAIN ! Monthly cumulative drainage +! WRITE(ETOUT, '(A8, 1H , ' // !File name1 +! & 'I5, 1X , '// !Run number2 +! & 'I4, 1H , ' // !Treatment number3 +! & 'I8, 1H '// !HV_YEAR4 +! & 'A8, 1H '// !HV_MON5 +! & 'I8, 1H '// !Growth year num6 +! & 'I8, 1H '// !Growth month num7 +! & 'I8, 1H '// !Current month num8 +! & 'F8.3, 1H '// !FI9 +! & 'F8.3, 1H '// !ETc10 +! & 'F8.3, 1H '// !EToc11 +! & 'F8.3, 1H '// !ETo12 +! & 'F8.3, 1H '// !ETc_ETo13 +! & 'F8.3, 1H '// !ETc_EToc14 +! & 'F8.3, 1H '// !Runoff +! & 'F8.3, 1H )') !Drainage +! & Control%FILEX, !File1 +! & Control%RUN, !Run number2 +! & Control%TRTNUM, !Treatment number3 +! & YRHV, !Harvest year4 +! & MONHV, !Harvest month5 +! & GRYRNO, !Growth year number6 +! & GRMONNO, !Growth month number7 +! & iMON, !Current month number8 +! & AvgFi, !average canopy cover for the month9 +! & ETV, !Sum of EP and ET evaporation for the mon10 +! & EToc, !Sum of EO for the month11 +! & ETc_ETo, !Sum of EO for the month12 +! & ETo, !Monthly average ETc_ETo13 +!! & (ETV/EToc), !Monthly average ETc_ETo14 +! & ETc_ETo14, !Monthly average ETc_ETo14 +! & cRUNOFF, ! Monthly cumulative runoff +! & cDRAIN ! Monthly cumulative drainage COUNTER = 0 ETV = 0 @@ -396,7 +396,7 @@ c =============================================================== ELSEIF (Control%DYNAMIC .EQ. SEASEND) THEN c Close the output file - CLOSE(UNIT=ETOUT) +! CLOSE(UNIT=ETOUT) c End of DYNAMIC conditional statement ENDIF diff --git a/Plant/CANEGRO-Sugarcane/SC_NITRO.for b/Plant/CANEGRO-Sugarcane/SC_NITRO.for index 5d34573c7..3fa900597 100644 --- a/Plant/CANEGRO-Sugarcane/SC_NITRO.for +++ b/Plant/CANEGRO-Sugarcane/SC_NITRO.for @@ -51,6 +51,8 @@ c Use the composite variable defn: c All variables to be declared: IMPLICIT NONE c and saved between subroutine calls: + EXTERNAL SC_OPNIT + SAVE diff --git a/Plant/CANEGRO-Sugarcane/SC_OPNIT.for b/Plant/CANEGRO-Sugarcane/SC_OPNIT.for index 6f72a12cc..0eb71c8bb 100644 --- a/Plant/CANEGRO-Sugarcane/SC_OPNIT.for +++ b/Plant/CANEGRO-Sugarcane/SC_OPNIT.for @@ -24,16 +24,17 @@ ! Exporting what MvdL used to export for his 2011 paper ! & Control%YRDOY, & MASSES, - & N_POOL, ! ok -! & N_ALLOC,! ok - & N_STRESS, ! ok? -! & PSV_UPTAKE, FO has commented it in SC_NITRO -! & N_SENESCE, ! ok TODO check if this is = to SENESCE % ResE(n,1) (HBD) - & N_CONC, ! ok -! & TOT_N_DEMAND, POT_N_SUPPLY, !ok TODO is it necessary to be exported? (HBD) -! & TUNO3, ! FO has commented it in SC_NITRO; TODO check necessity here (HBD) - & ABVGRND_N_MASS, TOT_N_POOL, !ok,ok - & ACC_UPTAKE) ! ok + & N_POOL, +! & N_ALLOC, + & N_STRESS, +! & PSV_UPTAKE, ! FO has commented it in SC_NITRO +! & N_SENESCE, ! check if this is = to SENESCE % ResE(n,1) (HBD) + & N_CONC, +! & TOT_N_DEMAND, POT_N_SUPPLY, is it necessary to be exported? (HBD) +! & TUNO3, ! FO has commented it in SC_NITRO; check necessity here (HBD) + & ABVGRND_N_MASS, +! & TOT_N_POOL, !FO commented it out variable not used + & ACC_UPTAKE) !----------------------------------------------------------------------- USE ModuleDefs @@ -69,9 +70,9 @@ ! The variable "ISWITCH" is of type "SwitchType". TYPE (SwitchType) ISWITCH - TYPE (SOILTYPE) SoilProp +! TYPE (SOILTYPE) SoilProp TYPE (ResidueType) SENESCE - TYPE (N_PARAM_TYPE) N_PARAMS(NUM_COMPS) +! TYPE (N_PARAM_TYPE) N_PARAMS(NUM_COMPS) ! CANEGRO N variables ! MASSES: Dry masses of each plant component, @@ -107,11 +108,11 @@ !REAL TOT_N_DEMAND ! Potential NO3 and NH4 uptake !REAL POT_N_SUPPLY - ! FO has commented TUNO3 in SC_NITRO +! FO has commented TUNO3 in SC_NITRO !REAL TUNO3 !, TUNH4 REAL ABVGRND_N_MASS REAL ACC_UPTAKE - REAL TOT_N_POOL +! REAL TOT_N_POOL IDETG = ISWITCH % IDETG IDETN = ISWITCH % IDETN @@ -156,10 +157,10 @@ WRITE (NOUTDN,230) 230 FORMAT('@YEAR DOY DAS DAP', & ' CNAD', - & ' SNAD LGNAD RNAD',! VNAD', + & ' SNAD LNAD RNAD',! VNAD', ! & ' LDNAD', ! total N & ' NUPC', - & ' SN%D LGN%D RN%D',! VN%D + & ' SN%D LN%D RN%D',! VN%D ! & ' LDN%D')!, ! total Nconc & ' NSTD') ! & ' SNN0C SNN1C') @@ -249,9 +250,4 @@ c Conc = N_pool/mass, if mass < 0 !*********************************************************************** RETURN END SUBROUTINE SC_OPNIT -!======================================================================= - - -! TODO: 1) add total crop and dead leaves N masses and conc's -! TODO: 2) look for ICASA acronyms for those variables (TNAD?); LDN%D is new -! Note: dead leaves vars are somehow related to DSSAT SNNPD and SNWPD \ No newline at end of file +!======================================================================= \ No newline at end of file diff --git a/Soil/GHG/Denit_DayCent.for b/Soil/GHG/Denit_DayCent.for index d2f2003fb..ae126902c 100644 --- a/Soil/GHG/Denit_DayCent.for +++ b/Soil/GHG/Denit_DayCent.for @@ -78,7 +78,9 @@ C======================================================================= wfps = n2o_data % wfps ! Compute the Nitrate effect on Denitrification -! Changed NO3 effect on denitrification based on paper "General model for N2O and N2 gas emissions from soils due to denitrification" +! Changed NO3 effect on denitrification based on paper +! "General model for N2O and N2 gas emissions from soils +! due to denitrification" ! Del Grosso et. al, GBC 12/00, -mdh 5/16/00 A(1) = 9.23 A(2) = 1.556 @@ -88,15 +90,16 @@ C======================================================================= NDAYS_WET = 0.0 min_nitrate = 0.1 -! Calculate the number of top layers to accelerate slow denitrification -! as in DayCent denitrify.c +! Calculate the number of top layers to accelerate s +! slow denitrification as in DayCent denitrify.c NLAYR = SOILPROP % NLAYR DLAYR = SOILPROP % DLAYR DS = SOILPROP % DS Denit_depth = 30. !cm depth for accelerated dentitrification DD_layer = 1 !layer number at depth = Denit_depth -! Save soil layer at Denit_depth (if it's at least half the layer thickness) +! Save soil layer at Denit_depth +! (if it's at least half the layer thickness) cumdep = 0.0 do L = 1, nlayr cumdep = cumdep + dlayr(L) @@ -164,7 +167,8 @@ C======================================================================= !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! Daycent denitrification routines PG 17/5/13 -! CO2ppm is labile C which is derivation of CO2 produced on any day +! CO2ppm is labile C which is derivation of CO2 produced +! on any day if (L == 1) then ! first soil layer includes residue layer-chp CO2ppm(1) = (newCO2(0)+newCO2(1))*kg2ppm(L) @@ -187,11 +191,14 @@ C======================================================================= else a_coeff = -0.1*dD0(L) + 0.019 endif - co2_correct(L)=co2PPM(L)*(1.0+a_coeff*(wfps(L)-WFPS_thres)) !the amount labile C is adjusted taking into account diffusion + co2_correct(L)=co2PPM(L)*(1.0+a_coeff*(wfps(L)-WFPS_thres)) + !the amount labile C is adjusted taking into account diffusion endif -! Compute the Carbon Dioxide effect on Denitrification fDco2, ppm N -! Changed CO2 effect on denitrification based on paper "General model for N2O and N2 gas emissions from soils due to denitrification" +! Compute the Carbon Dioxide effect on Denitrification fDco2, +! ppm N Changed CO2 effect on denitrification based on paper +! "General model for N2O and N2 gas emissions from soils due to +! denitrification" ! Del Grosso et. al, GBC 12/00, -mdh 5/16/00 ! daycent NO3 factor fDno3 = (A(2) + (A(3)/PI) * atan(PI*A(4)*(no3(L)-A(1)))) @@ -200,7 +207,9 @@ C======================================================================= !chp fDco2 = 0.1 * co2_correct(L)**1.27 !daycent labile C factor ! daycent labile C factor ! Comment from Upendra - 2018-10-09 -! This will always be > 1; even at 50 ppm fDCO2 = 16 – I’m assuming CO2 is in ppm. So it will not play any role .. +! This will always be > 1; +! even at 50 ppm fDCO2 = 16 � I�m assuming CO2 is in ppm. +! So it will not play any role .. fDco2 = 0.1 * co2_correct(L)**1.3 - min_nitrate fDco2 = max(0.0, fDco2) @@ -208,7 +217,8 @@ C======================================================================= ! 9/28/2017 Based on DayCent dentitrificaion routine (denitrify.c) ! Dtotflux = (fDno3 < fDco2) ? fDno3 : fDco2; -! /* Minimum value for potential denitrification in top 2 soil layers */ +! /* Minimum value for potential denitrification in top 2 soil +! layers */ ! /* ppm N, 9/18/00 -cindyk */ ! chp: top 2 layers in DayCent = 30 cm ! if (ilyr < 2) { @@ -219,12 +229,15 @@ C======================================================================= endif ! Compute wfps effect on denitrification, (fDwfps, 0-1) -! Changed wfps effect on denitrification based on paper "General model for N2O and N2 gas emissions from soils due to denitrification" +! Changed wfps effect on denitrification based on paper +! "General model for N2O and N2 gas emissions from soils +! due to denitrification" ! Del Grosso et. al, GBC 12/00, -mdh 5/16/00 M = min(0.113, dD0(L)) * (-1.25) + 0.145 -! The x_inflection calculation should take into account the corrected CO2 concentration, cak - 07/31/02 +! The x_inflection calculation should take into +! account the corrected CO2 concentration, cak - 07/31/02 ! daycent X_inflection/adjustment for WFPS response x_inflect = (9.0 - M * co2_correct(L)) @@ -235,13 +248,16 @@ C======================================================================= fDwfps = max(0.0, fDwfps) denitrifppm(L) = fDwfps * fNO3fCO2 !daycent -C denitrifppm(L) = 6.0 * 1.E-04 * CW * NO3(L) * WFDENIT * TFDENIT ! from DSSAT DENIT version, moved here from below PG +C denitrifppm(L) = 6.0 * 1.E-04 * CW * NO3(L) * WFDENIT * TFDENIT +! from DSSAT DENIT version, moved here from below PG C Convert total dentrification, N2O and N2 to kg/ha/d from ppm denitrif(L) = denitrifppm(L)/kg2ppm(L) -! *** Moved this section up from below - needs to be done prior to partitioning to N2 and N2O -! Modify Denitrification rate based on available NO3 & flooding effects +! *** Moved this section up from below - needs to be done prior +! to partitioning to N2 and N2O +! Modify Denitrification rate based on available NO3 +! & flooding effects DENITRIF(L) = AMAX1 (DENITRIF(L), 0.0) ! The minimum amount of NO3 that stays behind in the soil and @@ -272,11 +288,15 @@ C Convert total dentrification, N2O and N2 to kg/ha/d from ppm ! *** End of Moved section ! *** Ratio of N2 to N2O -! Nitrate effect on the ratio of N2 to N2O. Two approaches, use maximum of ratio1 and ratio2 +! Nitrate effect on the ratio of N2 to N2O. +! Two approaches, use maximum of ratio1 and ratio2 ! Maximum N2/N2O ratio soil respiration function -! Changed the NO3 and CO2 effect on the N2/N2O ratio based on paper "General model for N2O and N2 gas emissions from soils due to denitrification" +! Changed the NO3 and CO2 effect on the N2/N2O ratio based +! on paper "General model for N2O and N2 gas emissions +! from soils due to denitrification" ! Del Grosso et. al, GBC 12/00, -mdh 5/16/00 -! fRno3_co2 estimates the ratio as a function of electron donor to substrate -mdh 5/17/00 +! fRno3_co2 estimates the ratio as a function of +! electron donor to substrate -mdh 5/17/00 k1 = max(1.5, 38.4 - 350. * dD0(L)) @@ -289,7 +309,9 @@ C Convert total dentrification, N2O and N2 to kg/ha/d from ppm endif C WFPS effect on the N2/N2O Ratio */ -C Changed wfps effect on the N2/N2O ratio based on paper "General model for N2O and N2 gas emissions from soils due to denitrification" +C Changed wfps effect on the N2/N2O ratio based on paper +! "General model for N2O and N2 gas emissions from soils +! due to denitrification" C Del Grosso et. al, GBC 12/00, -mdh 5/16/00 fRwfps = max(0.1, 0.015 * wfps(L)*100 - 0.32) @@ -298,7 +320,8 @@ C Compute the N2:N2O Ratio ! Rn2n2o = max(0.1,fRno3_co2 * fRwfps) ratio1(L) = max(0.1, fRno3_co2 * fRwfps) -! Count the number of days that water filled pore space is above 0.80 +! Count the number of days that water filled pore space +! is above 0.80 if (wfps(L) >= 0.80) then ndays_wet(L) = min(7, ndays_wet(L) + 1) else @@ -314,12 +337,14 @@ C Compute the N2:N2O Ratio endif C Calculate N2O -! PG changed n2ofluxppm to n2odenitppm to differentiate n2o from denitrification +! PG changed n2ofluxppm to n2odenitppm to differentiate n2o +! from denitrification ! n2ofluxppm(L) = denitrifppm(L) / (Rn2n2o + 1.0) Rn2n2o(L) = max(ratio1(L), ratio2(L)) n2odenit(L) = denitrif(L) / (Rn2n2o(L) + 1.0) -! PG changed n2oflux to n2odenit to differentiate n2o from denitrification +! PG changed n2oflux to n2odenit to differentiate n2o +! from denitrification n2flux(L) = denitrif(L) - n2odenit(L) ! Reduce soil NO3 by the amount denitrified and add this to