Subroutine transpmodel_last_step

230 : 
231 : !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
232 : !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
233 : !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
234 : !+++ Post-yearly step
235 : 
236 :       subroutine transpmodel_last_step (tp_netass, option)
237 :       use vom_vegwat_mod
238 :       implicit none
239 : 
240 :       REAL*8, INTENT(in) :: tp_netass
241 :       integer, INTENT(in) :: option
242 : 
243 :       if (option .eq. 2) then
244 :         print *,'Cumulative error in water balance (initial Ws+Input-Output-final Ws, in m): ',error
245 :         print *,'Number of times dtsu was limiting: ',dtsu_count
246 :         print *,'Number of times dtmax was limiting: ',dtmax_count
247 : 
248 :         close(kfile_resultshourly)
249 :         close(kfile_resultsdaily)
250 :         close(kfile_resultsyearly)
251 :           close(kfile_rsurfdaily)
252 :           close(kfile_delzhourly)
253 :           close(kfile_ruptkthourly)
254 :           close(kfile_suhourly)
255 : 
256 :         write(*,*) "Model run COMPLETE"
257 :         write(*,*) " "
258 :         write(*,*) "The carbon profit achieved is: ",tp_netass
259 :         write(*,*) "Hourly results are saved in resulthourly.txt"
260 :         write(*,*) "Daily results are saved in resultsdaily.txt"
261 :         write(*,*) "Yearly results are saved in yearly.txt"
262 :         write(*,*) "Soil results are saved in delyudaily.txt, rsurfdaily.txt, ruptkhourly.txt, suvechourly.txt"
263 :       endif
264 : 
265 :       if (option .eq. 3) then
266 :         open(kfile_model_output, FILE=trim(adjustl(i_outputpath))// &
267 :              trim(adjustl(sfile_model_output)), STATUS='replace')
268 :         write(kfile_model_output,'(E13.6)') tp_netass
269 :         close(kfile_model_output)
270 : 
271 :         write(*,*) "Model run COMPLETE"
272 :         write(*,*) " "
273 :         write(*,*) "The carbon profit achieved is: ",tp_netass
274 :         write(*,*) "Best ncp is saved in model_output.txt"
275 :       endif
276 : 
277 :       return
278 :       end subroutine transpmodel_last_step