source: trunk/LMDZ.GENERIC/libf/phystd/stelang.F @ 3523

Last change on this file since 3523 was 1216, checked in by emillour, 11 years ago

Generic model:
Major cleanup, in order to ease the use of LMDZ.GENERIC with (parallel) dynamics
in LMDZ.COMMON: (NB: this will break LMDZ.UNIVERSAL, which should be thrashed
in the near future)

  • Updated makegcm_* scripts (and makdim) and added the "-full" (to enforce full recomputation of the model) option
  • In dyn3d: converted control.h to module control_mod.F90 and converted iniadvtrac.F to module infotrac.F90
  • Added module mod_const_mpi.F90 in dyn3d (not used in serial mode)
  • Rearanged input/outputs routines everywhere to handle serial/MPI cases. physdem.F => phyredem.F90 , phyetat0.F => phyetat0.F90 ; all read/write routines for startfi files are gathered in module iostart.F90
  • added parallelism related routines init_phys_lmdz.F90, comgeomphy.F90, dimphy.F90, iniphysiq.F90, mod_grid_phy_lmdz.F90, mod_phys_lmdz_mpi_data.F90, mod_phys_lmdz_mpi_transfert.F90, mod_phys_lmdz_omp_data.F90, mod_phys_lmdz_omp_transfert.F90, mod_phys_lmdz_para.F90, mod_phys_lmdz_transfert_para.F90 in phymars and mod_const_mpi.F90 in dyn3d (for compliance with parallelism)
  • added created generic routines 'planetwide_maxval' and 'planetwide_minval', in module "planetwide_mod", that enable obtaining the max and min of a field over the whole planet. This should be further imroved with computation of means (possibly area weighed), etc.

EM

File size: 3.1 KB
RevLine 
[253]1      subroutine stelang(kgrid,psilon,pcolon,psilat,pcolat,
[1174]2     &                ptim1,ptim2,ptim3,pmu0,pfract, pflat)
[253]3      IMPLICIT NONE
4
5C
6C**** *LW*   - ORGANIZES THE LONGWAVE CALCULATIONS
7C
8C     PURPOSE.
9C     --------
10C          CALCULATES THE STELLAR ANGLE FOR ALL THE POINTS OF THE GRID
11C
12C**   INTERFACE.
13C     ----------
14C      SUBROUTINE STELANG ( KGRID )
15C
16C        EXPLICIT ARGUMENTS :
17C        --------------------
18C     ==== INPUTS  ===
19C
20C PSILON(KGRID)   : SINUS OF THE LONGITUDE
21C PCOLON(KGRID)   : COSINUS OF THE LONGITUDE
22C PSILAT(KGRID)   : SINUS OF THE LATITUDE
23C PCOLAT(KGRID)   : COSINUS OF THE LATITUDE
24C PTIM1           : SIN(DECLI)
25C PTIM2           : COS(DECLI)*COS(TIME)
26C PTIM3           : SIN(DECLI)*SIN(TIME)
27C
28C     ==== OUTPUTS ===
29C
30C PMU0 (KGRID)    : SOLAR ANGLE
31C PFRACT(KGRID)   : DAY FRACTION OF THE TIME INTERVAL
32C
33C        IMPLICIT ARGUMENTS :   NONE
34C        --------------------
35C
36C     METHOD.
37C     -------
38C
39C     EXTERNALS.
40C     ----------
41C
42C         NONE
43C
44C     REFERENCE.
45C     ----------
46C
47C         RADIATIVE PROCESSES IN METEOROLOGIE AND CLIMATOLOGIE
48C         PALTRIDGE AND PLATT
49C
50C     AUTHOR.
51C     -------
52C        FREDERIC HOURDIN
53C
54C     MODIFICATIONS.
55C     --------------
56C        ORIGINAL :90-01-14
57C                  92-02-14 CALCULATIONS DONE THE ENTIER GRID (J.Polcher)
58C-----------------------------------------------------------------------
59C
60C     ------------------------------------------------------------------
61
62C-----------------------------------------------------------------------
63C
64C*      0.1   ARGUMENTS
65C             ---------
66C
[1216]67      INTEGER,INTENT(IN) :: kgrid
68      REAL,INTENT(IN) :: ptim1,ptim2,ptim3, pflat
69      REAL,INTENT(IN) :: psilon(kgrid),pcolon(kgrid)
70      REAL,INTENT(IN) :: psilat(kgrid), pcolat(kgrid)
71      REAL,INTENT(OUT) :: pmu0(kgrid),pfract(kgrid)
[253]72C
73      INTEGER jl
[1174]74      REAL ztim1,ztim2,ztim3, rap
[253]75C------------------------------------------------------------------------
76C------------------------------------------------------------------------
77C------------------------------------------------------------------------
78C
79C------------------------------------------------------------------------
80C
81C*     1.     INITIALISATION
82C             --------------
83C
[1174]84c----- SG: geometry adapted to a flattened planet (Feb2014)
85
86      rap = 1./((1.-pflat)**2)
87
[253]88 100  CONTINUE
89C
90      DO jl=1,kgrid
91        pmu0(jl)=0.
92        pfract(jl)=0.
93      ENDDO
94C
95C*     1.1     COMPUTATION OF THE SOLAR ANGLE
96C              ------------------------------
97C
98      DO jl=1,kgrid
[1174]99        ztim1=psilat(jl)*ptim1*rap
[253]100        ztim2=pcolat(jl)*ptim2
101        ztim3=pcolat(jl)*ptim3
102        pmu0(jl)=ztim1+ztim2*pcolon(jl)+ztim3*psilon(jl)
[1216]103        pmu0(jl)=pmu0(jl)/SQRT(pcolat(jl)**2+(rap**2)*(psilat(jl)**2))
[1174]104
[253]105      ENDDO
106C
107C*     1.2      DISTINCTION BETWEEN DAY AND NIGHT
108C               ---------------------------------
109C
110      DO jl=1,kgrid
111        IF (pmu0(jl).gt.0.) THEN
112          pfract(jl)=1.
113c       pmu0(jl)=sqrt(1224.*pmu0(jl)*pmu0(jl)+1.)/35.
114      ELSE
115c       pmu0(jl)=0.
116        pfract(jl)=0.
117        ENDIF
118      ENDDO
119C
120      RETURN
121      END
Note: See TracBrowser for help on using the repository browser.