source: trunk/LMDZ.MARS/libf/phymars/time_phylmdz_mod.F90

Last change on this file was 3923, checked in by jmauxion, 3 weeks ago

Mars PCM:
Adding a slow_diagfi flag to the run.def file for 1D model only. When False, the netcdf
file is opened/closed once, thus saving significant computing time. When true,
the opening frequency is at output frequency (required in debug mode).
JM

File size: 1.8 KB
Line 
1MODULE time_phylmdz_mod
2
3    IMPLICIT NONE
4    REAL,SAVE    :: dtphys      ! physics time step (s)
5!$OMP THREADPRIVATE(dtphys)
6
7    REAL,SAVE    :: daysec     ! length of day (s)
8!$OMP THREADPRIVATE(daysec)
9
10    INTEGER,SAVE :: steps_per_sol ! number of physics steps per sol
11!$OMP THREADPRIVATE(steps_per_sol)
12
13    INTEGER,SAVE :: day_ini     ! initial day of the run
14!$OMP THREADPRIVATE(day_ini)
15    INTEGER,SAVE :: day_end     ! final day of the run
16!$OMP THREADPRIVATE(day_end)
17    REAL,SAVE :: hour_ini       ! start time (fraction of day) of the run
18                                ! 0=<hour_ini<1
19!$OMP THREADPRIVATE(hour_ini)
20
21    INTEGER,SAVE :: outputs_per_sol ! for diagfi.nc outputs, number of outputs
22                                    ! per sol (set via conf_phys)
23!$OMP THREADPRIVATE(outputs_per_sol)
24
25    LOGICAL,SAVE :: slow_diagfi ! to handle wether the netcdf file is
26                                ! opened/close once or at output frequency
27!$OMP THREADPRIVATE(slow_diagfi)
28
29    INTEGER,SAVE :: iphysiq   ! call physics every iphysiq dynamical step
30                              ! (set via conf_phys)
31!$OMP THREADPRIVATE(iphysiq)
32    INTEGER,SAVE :: ecritstart ! write a restart state every ecritstart
33                               ! dynamical steps (set via conf_phys)
34!$OMP THREADPRIVATE(ecritstart)
35CONTAINS
36
37  SUBROUTINE init_time(day_ini_, day_end_, hour_ini_, daysec_, dtphys_)
38
39    IMPLICIT NONE
40    INTEGER,INTENT(IN) :: day_ini_
41    INTEGER,INTENT(IN) :: day_end_
42    REAL,INTENT(IN) :: hour_ini_
43    REAL,INTENT(IN) :: daysec_
44    REAL,INTENT(IN) :: dtphys_
45   
46    day_ini=day_ini_
47    day_end=day_end_
48    hour_ini=hour_ini_
49    daysec=daysec_
50    dtphys=dtphys_
51   
52    ! compute number of physics steps per sol
53    steps_per_sol=nint(daysec/dtphys)
54   
55  END SUBROUTINE init_time
56
57END MODULE time_phylmdz_mod     
Note: See TracBrowser for help on using the repository browser.