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

Last change on this file since 3369 was 3369, checked in by emillour, 6 months ago

Mars PCM:
Change the way the rate of outputs for diagfi.nc files is specified:
IMPORTANT: Specifying "ecritphy" no longer possible and will trigger an error.
Use "outputs_per_sol" to specify output rate instead.
This should makes things (hopefully) clearer for users and also better
enforces a cleaner and clearer separation between dynamics and physics.
EM

File size: 1.6 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    INTEGER,SAVE :: iphysiq   ! call physics every iphysiq dynamical step
26                              ! (set via conf_phys)
27!$OMP THREADPRIVATE(iphysiq)
28    INTEGER,SAVE :: ecritstart ! write a restart state every ecritstart
29                               ! dynamical steps (set via conf_phys)
30!$OMP THREADPRIVATE(ecritstart)
31CONTAINS
32
33  SUBROUTINE init_time(day_ini_, day_end_, hour_ini_, daysec_, dtphys_)
34
35    IMPLICIT NONE
36    INTEGER,INTENT(IN) :: day_ini_
37    INTEGER,INTENT(IN) :: day_end_
38    REAL,INTENT(IN) :: hour_ini_
39    REAL,INTENT(IN) :: daysec_
40    REAL,INTENT(IN) :: dtphys_
41   
42    day_ini=day_ini_
43    day_end=day_end_
44    hour_ini=hour_ini_
45    daysec=daysec_
46    dtphys=dtphys_
47   
48    ! compute number of physics steps per sol
49    steps_per_sol=nint(daysec/dtphys)
50   
51  END SUBROUTINE init_time
52
53END MODULE time_phylmdz_mod     
Note: See TracBrowser for help on using the repository browser.