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