source: LMDZ6/trunk/libf/phylmd/ecrad/ifs/fcttim.func.h @ 5423

Last change on this file since 5423 was 4773, checked in by idelkadi, 13 months ago
  • Update of Ecrad in LMDZ The same organization of the Ecrad offline version is retained in order to facilitate the updating of Ecrad in LMDZ and the comparison between online and offline results. version 1.6.1 of Ecrad (https://github.com/lguez/ecrad.git)
  • Implementation of the double call of Ecrad in LMDZ


File size: 2.1 KB
Line 
1! (C) Copyright 1989- ECMWF.
2! (C) Copyright 1989- Meteo-France.
3!
4! This software is licensed under the terms of the Apache Licence Version 2.0
5! which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6!
7! In applying this licence, ECMWF does not waive the privileges and immunities
8! granted to it by virtue of its status as an intergovernmental organisation
9! nor does it submit to any jurisdiction.
10
11!     ------------------------------------------------------------------
12
13! - Time functions
14!   the descriptions are in the annex 1 of the documentation
15
16! TIME
17
18! NDD   : extraxt dd from ccaammdd
19! NMM   : extract mm from ccaammdd
20! NAA   : extract aa from ccaammdd
21! NCCAA : extract ccaa from ccaammdd
22! NAMD  : extract aammdd from ccaammdd
23! NCENT : return centuary of ccaammdd
24! NYEARC: returns year of the centuary from ccaammdd
25! NCONSTRUCT_DATE : returns ccaammdd given centuary,year,month and day
26! NCTH  : turn seconds into hours
27! RTIME : returns the time of the model (in seconds of course!)
28! RINCDAY : length of a day (in seconds)
29
30INTEGER(KIND=JPIM) :: NDD,NMM,NCCAA,NAA,NAMD,NCTH,NZZAA,NZZMM,NCENT,NYEARC,&
31&NCONSTRUCT_DATE
32REAL(KIND=JPRD) :: RJUDAT,RTIME
33REAL(KIND=JPRB) :: RINCDAY
34INTEGER(KIND=JPIM) :: KGRDAT,KSEC,KAAAA,KMM,KDD,KSS
35INTEGER(KIND=JPIM) :: KCENT,KYEARC,KMONTH,KDAY
36
37NDD(KGRDAT)  =MOD(KGRDAT,100)
38NMM(KGRDAT)  =MOD((KGRDAT-NDD(KGRDAT))/100,100)
39NCCAA(KGRDAT)=KGRDAT/10000
40NAA(KGRDAT)=MOD(NCCAA(KGRDAT),100)
41NAMD(KGRDAT)=MOD(KGRDAT,1000000)
42NCTH(KSEC)=KSEC/3600
43NCENT(KGRDAT)=NCCAA(KGRDAT)/100+MIN(NAA(KGRDAT),1)
44NYEARC(KGRDAT)=NAA(KGRDAT)+100*(1-MIN(NAA(KGRDAT),1))
45NCONSTRUCT_DATE(KCENT,KYEARC,KMONTH,KDAY)=&
46&(KCENT-1)*10**6+KYEARC*10**4+KMONTH*10**2+KDAY
47
48NZZAA(KAAAA,KMM)=KAAAA-( (1-SIGN(1,KMM-3))/2 )
49NZZMM(KMM)=KMM+6*(1-SIGN(1,KMM-3))
50RJUDAT(KAAAA,KMM,KDD)=1720994.5_JPRD + REAL(&
51  &2-NZZAA(KAAAA,KMM)/100 + (NZZAA(KAAAA,KMM)/100)/4 &
52&+ INT(365.25_JPRD*REAL(NZZAA(KAAAA,KMM),JPRD))&
53&+ INT(30.601_JPRD*REAL(NZZMM(KMM)+1,JPRD))&
54&+ KDD,JPRD)
55RTIME(KAAAA,KMM,KDD,KSS,RINCDAY)=(RJUDAT(KAAAA,KMM,KDD)-2451545._JPRD)&
56    &*RINCDAY+REAL(KSS,JPRD)
57!    -------------------------------------------------------------
Note: See TracBrowser for help on using the repository browser.