| 1 | SUBROUTINE info_run_PEM(year_iter,criterion_stop,i_myear,n_myear) |
|---|
| 2 | |
|---|
| 3 | !======================================================================= |
|---|
| 4 | ! |
|---|
| 5 | ! Purpose: Write in a file called info_run_PEM.txt the reason why the PEM did stop and the number of extrapolation year done |
|---|
| 6 | ! Update the file tmp_PEMyears.txt to count the number of simulated Martian years |
|---|
| 7 | ! |
|---|
| 8 | ! Author: RV, JBC |
|---|
| 9 | !======================================================================= |
|---|
| 10 | |
|---|
| 11 | use time_evol_mod, only: convert_years |
|---|
| 12 | |
|---|
| 13 | IMPLICIT NONE |
|---|
| 14 | |
|---|
| 15 | integer, intent(in) :: year_iter, criterion_stop ! # of year and reason to stop |
|---|
| 16 | integer, intent(in) :: i_myear, n_myear ! Current simulated Martian year and maximum number of Martian years to be simulated |
|---|
| 17 | |
|---|
| 18 | logical :: ok |
|---|
| 19 | |
|---|
| 20 | inquire(file = 'info_run_PEM.txt', exist = ok) |
|---|
| 21 | if (ok) then |
|---|
| 22 | open(12,file = 'info_run_PEM.txt',status = "old",position = "append",action = "write") |
|---|
| 23 | else |
|---|
| 24 | open(12,file = 'info_run_PEM.txt',status = "new",action = "write") |
|---|
| 25 | endif |
|---|
| 26 | write(12,*) year_iter, i_myear, criterion_stop |
|---|
| 27 | close(12) |
|---|
| 28 | |
|---|
| 29 | open(100,file = 'tmp_PEMyears.txt',status = 'replace') |
|---|
| 30 | write(100,*) i_myear, n_myear, convert_years |
|---|
| 31 | close(100) |
|---|
| 32 | |
|---|
| 33 | END SUBROUTINE info_run_PEM |
|---|